show_own_source.js 574 B

12345678910111213141516
  1. if (typeof ace == "undefined" && typeof require == "undefined") {
  2. document.body.innerHTML = "<p style='padding: 20px 50px;'>couldn't find ace.js file, <br>"
  3. + "to build it run <code>node Makefile.dryice.js full<code>"
  4. } else if (typeof ace == "undefined" && typeof require != "undefined") {
  5. require(["ace/ace"], setValue)
  6. } else {
  7. require = ace.require;
  8. setValue()
  9. }
  10. function setValue() {
  11. require("ace/lib/net").get(document.baseURI, function(t){
  12. var el = document.getElementById("editor");
  13. el.env.editor.setValue(t, 1);
  14. })
  15. }