Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

60 rader
2.0 KiB

  1. <script language="javascript">
  2. function addArgument() {
  3. var no = $("#arguments").children("div").length;
  4. $("#arguments").show();
  5. $("#arguments").append("<div><?php hm("argument"); ?> #<span>" + no + "</span>[JSON] <a href=\"#\" onclick=\"removeArgument(this);return false;\"><?php hm("remove"); ?></a><br/><textarea name=\"argument[]\" rows=\"5\" cols=\"60\"></textarea><br/></div>");
  6. }
  7. function removeArgument(link) {
  8. $(link).parent().remove();
  9. //re-order
  10. var divs = $("#arguments").children("div");
  11. for (var i=0; i<divs.length; i++) {
  12. $(divs[i]).find("span").html(i);
  13. }
  14. }
  15. </script>
  16. <div class="operation">
  17. <?php render_server_menu("execute"); ?>
  18. </div>
  19. <a href="http://api.mongodb.org/js/" target="_blank">&raquo; Javascript API</a>
  20. <?php if(isset($message)):?>
  21. <p class="error"><?php h($message);?></p>
  22. <?php endif;?>
  23. <form method="post">
  24. <textarea name="code" rows="20" cols="80" class="code-editor"><?php h(x("code"));?></textarea>
  25. <br/>
  26. <div id="arguments" <?php if(empty($arguments)):?>style="display:none"<?php endif;?>>
  27. <?php if(!empty($arguments)):?>
  28. <?php foreach ($arguments as $index=>$argument): ?>
  29. <div>
  30. <?php hm("argument"); ?> #<span><?php h($index);?></span>[JSON] <a href="#" onclick="removeArgument(this);return false"><?php hm("remove"); ?></a><br/><textarea name="argument[]" rows="5" cols="60"><?php h($argument);?></textarea><br/>
  31. </div>
  32. <?php endforeach;?>
  33. <?php endif;?>
  34. </div>
  35. <?php hm("db"); ?>:
  36. <select name="db">
  37. <?php foreach ($dbs as $value):?>
  38. <option value="<?php h($value["name"]);?>" <?php if(xn("db")==$value["name"]):?>selected="selected"<?php endif;?>><?php h($value["name"]);?></option>
  39. <?php endforeach;?>
  40. </select> <?php hm("argument"); ?>:<input type="button" onclick="addArgument()" value="<?php hm("add"); ?>"/>
  41. <br/>
  42. <input type="submit" value="Execute Code"/>
  43. </form>
  44. <?php if(isset($ret)):?>
  45. <div style="border:2px #ccc solid;margin-bottom:5px;background-color:#eeefff">
  46. <?php hm("responseserver"); ?>
  47. <div style="margin-top:5px">
  48. <?php h($ret);?>
  49. </div>
  50. </div>
  51. <?php endif; ?>