Widget:A2debugger: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
J* (Diskussion | Beiträge) |
J* (Diskussion | Beiträge) (sollte so besser sein) |
||
| 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="button" value="Los!" id="a2dbgGotoBtn">< | + | <div class="a2dbgWindow" id="a2dbgState"> |
| + | <form id="a2dbgGotoForm"> | ||
| + | <input type="text" id="a2dbgGoto" maxlength="3" style="width: 4em;"/><input type="button" value="Los!" id="a2dbgGotoBtn"> | ||
| + | </form> | ||
| + | <form id="a2dbgItemForm"> | ||
<textarea id="a2dbgItems" style="width:80%; height: 200px;"></textarea><input type="button" value="Setze!" id="a2dbgItemBtn"> | <textarea id="a2dbgItems" style="width:80%; height: 200px;"></textarea><input type="button" value="Setze!" id="a2dbgItemBtn"> | ||
| − | </ | + | </form> |
| − | |||
| − | |||
</div> | </div> | ||
| − | + | <ul class="a2dbgWindow" id="a2dbgEventLog"> | |
| + | </ul> | ||
| + | </div> | ||
| + | |||
<script type="text/javascript"> | <script type="text/javascript"> | ||
| Zeile 23: | Zeile 28: | ||
$("#a2dbgSwitch").click(); | $("#a2dbgSwitch").click(); | ||
| − | $("# | + | $("#a2dbgGotoForm").submit( function(){ |
| − | a2.clearEventChain(); | + | try { |
| − | + | a2.clearEventChain(); | |
| + | a2.loadPage(parseInt($("#a2dbgGoto").val())); | ||
| + | } | ||
| + | catch (err) { | ||
| + | a2.log(err); | ||
| + | } | ||
| + | return false; | ||
}); | }); | ||
| − | $("# | + | $("#a2dbgItemForm").submit( function(){ |
| − | var d = ""; | + | 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); | ||
| + | } | ||
}); | }); | ||
</script> | </script> | ||
Version vom 6. Mai 2013, 10:50 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="button" value="Los!" id="a2dbgGotoBtn">
</form>
<form id="a2dbgItemForm">
<textarea id="a2dbgItems" style="width:80%; height: 200px;"></textarea><input type="button" 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);
}
});
</script>