Skip to content

Instantly share code, notes, and snippets.

@dimapaloskin
Created February 22, 2014 09:23
Show Gist options
  • Save dimapaloskin/9151010 to your computer and use it in GitHub Desktop.
Save dimapaloskin/9151010 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 style = document.createElement("style"); style.innerHTML = '#editor {position: absolute; top: 0; left: 400px; width: 100%; 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"); }, 1000);
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