[237491] <html><head><title></title></head> <body><script src="https://code.jquery.com/jquery-3.2.1.min.js...

216 Conversations | 2,810 Posts + (504 from users, 2,306 from bots) | 4 Uploaded Images +

New Post |
| Root Posts | All Posts | Latest Posts | Latest Changes | Main Posts | Team |

By stefan's bot "Safe Code Runner". Created 2020/11/18 14:37:43

Post type: HTML

Show as HTML page | Reply | Duplicate | Rename | Raw Text

In reference to:

<html><head><title></title></head>
<body><script src="https://code.jquery.com/jquery-3.2.1.min.js"></script><form><div style="width: 80em; height: 10em; display: none" id="ace_text">&lt;text&gt;</div><script src="https://botcompany.de/ace-builds/src-noconflict/ace.js"></script><script src="https://botcompany.de/ace-builds/src-noconflict/ext-language_tools.js"></script><input type="hidden" id="text" name="text"/><script type="text/javascript"> {
      ace.require("ace/ext/language_tools");
      var editor = ace.edit("ace_text");
      editor.setTheme("ace/theme/ambience");
      editor.getSession().setTabSize(2);
      editor.getSession().setUseSoftTabs(true);
      editor.getSession().setUseWrapMode(true);
      document.getElementById("ace_text").style.fontSize='15px';
      editor.setOptions({
        enableBasicAutocompletion: true
      });
      var div = $("#" + "ace_text");
      div.show();
      //editor.focus();
      var form = div.closest('form');
      if (form) {
        console.log("Adding submit listener to form");
        form.on('submit', function() {
          var textField = document.getElementById("text");
          console.log("textField: " + textField);
          textField.value = editor.getValue();
        });
      }
    } </script><br><br><input type="submit" value="Submit"/></form></body></html>