Widget:A2Event: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
J* (Diskussion | Beiträge) |
J* (Diskussion | Beiträge) |
||
Zeile 1: | Zeile 1: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
− | + | ||
− | + | ||
$(function () { | $(function () { | ||
if (!window.a2){ | if (!window.a2){ | ||
Zeile 30: | Zeile 30: | ||
a2.registerEventHandler(event); | a2.registerEventHandler(event); | ||
} else { | } else { | ||
− | $pre = $("< | + | $pre = $("<pr"+"e/>"); |
$pre.text("<!--{$event|escape:'javascript'}-->\n"+String(error)); | $pre.text("<!--{$event|escape:'javascript'}-->\n"+String(error)); | ||
$("#bodyContent").append($pre); | $("#bodyContent").append($pre); |
Version vom 6. Juli 2012, 19:11 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 && window.a2.parser) 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 = $("<pr"+"e/>"); $pre.text("\n"+String(error)); $("#bodyContent").append($pre); } } </script>