Widget:A2Event: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
J* (Diskussion | Beiträge) K |
J* (Diskussion | Beiträge) |
||
Zeile 5: | Zeile 5: | ||
} | } | ||
− | + | var event = {}; | |
+ | var error = ""; | ||
+ | try { | ||
var event = a2.parser.parse("<!--{$event|escape:'javascript'}-->"); | var event = a2.parser.parse("<!--{$event|escape:'javascript'}-->"); | ||
− | + | } catch (e) { | |
+ | var error = e | ||
} | } | ||
− | else { | + | |
− | $(".a2eventInfo").last().text("<!--{$event|escape:'javascript'}-->"); | + | if ("<!--{$action|escape:'javascript'}-->" == "render"){ |
+ | if (!error) | ||
+ | a2.registerEventHandler(event); | ||
+ | } else { | ||
+ | $(".a2eventInfo").last().text("<!--{$event|escape:'javascript'}-->\n"+String(e)); | ||
} | } | ||
</script> | </script> |
Version vom 6. Juli 2012, 18:43 Uhr
<script type="text/javascript"> if (!window.a2){ importJS("MediaWiki:Skin/Projekt:Adventure2/lib.js"); importJS("MediaWiki:Skin/Projekt:Adventure2/parser.js"); } var event = {}; var error = ""; try { var event = a2.parser.parse(""); } catch (e) { var error = e }
if ("" == "render"){ if (!error) a2.registerEventHandler(event); } else { $(".a2eventInfo").last().text("\n"+String(e)); } </script>