Skip to content

Instantly share code, notes, and snippets.

@dimapaloskin
Created February 22, 2014 09:35
Show Gist options
  • Save dimapaloskin/9151163 to your computer and use it in GitHub Desktop.
Save dimapaloskin/9151163 to your computer and use it in GitHub Desktop.
Ace
var js = document.createElement("script"); js.type = "text/javascript"; js.src = 'http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js';document.body.appendChild(js);
var js = document.createElement("script"); js.type = "text/javascript"; js.src = 'http://code.jquery.com/jquery-1.11.0.min.js';document.body.appendChild(js);
var style = document.createElement("style"); style.innerHTML = '#editor {position: absolute; top: 0; left: 400px; width: 600px; height: 80%;}'; document.body.appendChild(style);
var div = document.createElement("div"); div.setAttribute('id', 'editor'); document.body.appendChild(div);
setTimeout(function () {
window.e = ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/html");
}, 2000);
function EditSite_SaveEditingText()
{
EditSite_SetTextFile(window.e.getSession().getValue());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment