Widget:A2Event: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
J* (Diskussion | Beiträge) |
J* (Diskussion | Beiträge) |
||
Zeile 21: | Zeile 21: | ||
var error = ""; | var error = ""; | ||
try { | try { | ||
− | var event = a2.parser.parse("<!--{$event|escape:'javascript'}-->"); | + | var event = window.a2.parser.parse("<!--{$event|escape:'javascript'}-->"); |
} catch (e) { | } catch (e) { | ||
var error = e; | var error = e; |
Version vom 6. Juli 2012, 19:00 Uhr
<script type="text/javascript">
$(function () { if (!window.a2){ importJS("MediaWiki:Skin/Projekt:Adventure2/lib.js"); importJS("MediaWiki:Skin/Projekt:Adventure2/parser.js"); } a2WaitForInit() }); function a2WaitForInit() { if (window.a2) a2Init(); else window.setTimeout(a2WaitForInit, 500); } function a2Init(){ var event = {}; var error = ""; try { var event = window.a2.parser.parse(""); } catch (e) { var error = e; } if ("" == "render"){ if (!error) a2.registerEventHandler(event); } else {
$pre = $("
");
$pre.text("\n"+String(error)); $("#bodyContent").append($pre); }
</script>