Widget:A2debugger: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
J* (Diskussion | Beiträge) |
J* (Diskussion | Beiträge) |
||
(14 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
− | <form> | + | <form> |
− | + | <select id="a2dbgSwitch"> | |
− | + | <option value="a2dbgState">Spielstand</option> | |
− | + | <option value="a2dbgEventLog">Event-Log</option> | |
− | + | </select> | |
− | + | </form> | |
− | + | <div id="a2dbgBottom" style="height: 300px; overflow: auto;"> | |
− | + | <div class="a2dbgWindow" id="a2dbgState"> | |
− | + | <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> | ||
+ | <ul class="a2dbgWindow" id="a2dbgEventLog"> | ||
+ | </ul> | ||
</div> | </div> | ||
− | |||
− | <script type="text/javascript"> | + | |
− | $("#a2dbgSwitch").click(function(){ | + | <script type="text/javascript"> |
− | + | $("#a2dbgSwitch").click(function(){ | |
− | + | $(".a2dbgWindow").hide(); | |
− | }); | + | $("#"+$(this).val()).show(); |
+ | $("#a2dbgBottom:visible").scrollTop($("#a2dbgBottom")[0].scrollHeight); | ||
+ | }); | ||
+ | |||
+ | $("#a2dbgSwitch").click(); | ||
− | $("# | + | $("#a2dbgGotoForm").submit( function(){ |
− | </script> | + | 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> |
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>