Widget:A2debugger: Unterschied zwischen den Versionen

aus Kamelopedia, der wüsten Enzyklopädie
Zur Navigation springen Zur Suche springen
 
(7 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>
  <div id="a2dbgBottom" style="height: 300px; overflow: auto;">
+
</form>
    <div class="a2dbgWindow" id="a2dbgState">
+
<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"><br/>
+
  <div class="a2dbgWindow" id="a2dbgState">
       <textarea id="a2dbgItems" style="width:80%; height: 200px;"></textarea><input type="button" value="Setze!" id="a2dbgItemBtn">
+
    <form id="a2dbgGotoForm">
     </div>
+
       <input type="text" id="a2dbgGoto" maxlength="3" style="width: 4em;"/><input type="submit" value="Los!" id="a2dbgGotoBtn">
    <ul class="a2dbgWindow" id="a2dbgEventLog">
+
    </form>
    </ul>
+
    <form id="a2dbgItemForm">
 +
       <textarea id="a2dbgItems" style="width:80%; height: 200px;"></textarea><input type="submit" value="Setze!" id="a2dbgItemBtn">
 +
     </form>
 
   </div>
 
   </div>
</form>
+
  <ul class="a2dbgWindow" id="a2dbgEventLog">
 +
  </ul>
 +
  </div>
 +
 
 
   
 
   
 
  <script type="text/javascript">
 
  <script type="text/javascript">
Zeile 23: Zeile 28:
 
  $("#a2dbgSwitch").click();
 
  $("#a2dbgSwitch").click();
  
  $("#a2dbgGotoBtn").click( function(){
+
  $("#a2dbgGotoForm").submit( function(){
   a2.loadPage(parseInt($(this).val()));
+
   try {
 +
      a2.clearEventChain();
 +
      a2.loadPage(parseInt($("#a2dbgGoto").val()));
 +
  }
 +
  catch (err) {
 +
      a2.log(err);
 +
  }
 +
  return false;
 
  });
 
  });
  
  $("#a2dbgItemBtn").click( function(){
+
  $("#a2dbgItemForm").submit( function(){
   a2.stateDecode(a2.cpage+"|"+$(this).text().split("\n").join("|"));
+
   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>