Widget:A2debugger: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
J* (Diskussion | Beiträge) |
J* (Diskussion | Beiträge) |
||
(8 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 4: | Zeile 4: | ||
<option value="a2dbgEventLog">Event-Log</option> | <option value="a2dbgEventLog">Event-Log</option> | ||
</select> | </select> | ||
− | + | </form> | |
− | + | <div id="a2dbgBottom" style="height: 300px; overflow: auto;"> | |
− | <input type="text" id="a2dbgGoto" maxlength="3" style="width: 4em;"/><input type=" | + | <div class="a2dbgWindow" id="a2dbgState"> |
− | <textarea id="a2dbgItems" style="width:80%; height: 200px;"></textarea><input type=" | + | <form id="a2dbgGotoForm"> |
− | </ | + | <input type="text" id="a2dbgGoto" maxlength="3" style="width: 4em;"/><input type="submit" value="Los!" id="a2dbgGotoBtn"> |
− | + | </form> | |
− | + | <form id="a2dbgItemForm"> | |
+ | <textarea id="a2dbgItems" style="width:80%; height: 200px;"></textarea><input type="submit" value="Setze!" id="a2dbgItemBtn"> | ||
+ | </form> | ||
</div> | </div> | ||
− | + | <ul class="a2dbgWindow" id="a2dbgEventLog"> | |
+ | </ul> | ||
+ | </div> | ||
+ | |||
<script type="text/javascript"> | <script type="text/javascript"> | ||
Zeile 22: | Zeile 27: | ||
$("#a2dbgSwitch").click(); | $("#a2dbgSwitch").click(); | ||
+ | |||
+ | $("#a2dbgGotoForm").submit( function(){ | ||
+ | try { | ||
+ | a2.clearEventChain(); | ||
+ | a2.loadPage(parseInt($("#a2dbgGoto").val())); | ||
+ | } | ||
+ | catch (err) { | ||
+ | a2.log(err); | ||
+ | } | ||
+ | return false; | ||
+ | }); | ||
+ | |||
+ | $("#a2dbgItemForm").submit( function(){ | ||
+ | try { | ||
+ | var d = ""; | ||
+ | var items = $("#a2dbgItems").val().split(/[\s\r\n]+/); | ||
+ | for (var i=0; i<items.length; i++) | ||
+ | if (!items[i].match(/^[\s\r\n]*$/)) | ||
+ | d += "|" + items[i] | ||
+ | a2.stateDecode(a2.cpage+d); | ||
+ | } | ||
+ | catch (err) { | ||
+ | a2.log(err); | ||
+ | } | ||
+ | return false; | ||
+ | }); | ||
</script> | </script> |
Aktuelle Version vom 6. Mai 2013, 09:53 Uhr
<form> <select id="a2dbgSwitch"> <option value="a2dbgState">Spielstand</option> <option value="a2dbgEventLog">Event-Log</option> </select> </form>
<form id="a2dbgGotoForm"> <input type="text" id="a2dbgGoto" maxlength="3" style="width: 4em;"/><input type="submit" value="Los!" id="a2dbgGotoBtn"> </form> <form id="a2dbgItemForm"> <textarea id="a2dbgItems" style="width:80%; height: 200px;"></textarea><input type="submit" value="Setze!" id="a2dbgItemBtn"> </form>
<script type="text/javascript"> $("#a2dbgSwitch").click(function(){ $(".a2dbgWindow").hide(); $("#"+$(this).val()).show(); $("#a2dbgBottom:visible").scrollTop($("#a2dbgBottom")[0].scrollHeight); }); $("#a2dbgSwitch").click();
$("#a2dbgGotoForm").submit( function(){ try { a2.clearEventChain(); a2.loadPage(parseInt($("#a2dbgGoto").val())); } catch (err) { a2.log(err); } return false; });
$("#a2dbgItemForm").submit( function(){ try { var d = ""; var items = $("#a2dbgItems").val().split(/[\s\r\n]+/); for (var i=0; i<items.length; i++) if (!items[i].match(/^[\s\r\n]*$/)) d += "|" + items[i] a2.stateDecode(a2.cpage+d); } catch (err) { a2.log(err); } return false; }); </script>