Skip to content

Instantly share code, notes, and snippets.

View dimapaloskin's full-sized avatar
:octocat:
>_

Dima Paloskin dimapaloskin

:octocat:
>_
View GitHub Profile
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);
@dimapaloskin
dimapaloskin / gist:9151719
Created February 22, 2014 10:24
Ace-editor + CtrlS handler + opacity + text inserting
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);
$(document).keydown(function(event) {
//19 for Mac Command+S
if (!( String.fromCharCode(event.which).toLowerCase() == 's' && event.ctrlKey) && !(event.which == 19)) return true;
EditSite_SaveEditingText();
event.preventDefault();
return false;
});
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");
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: 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");
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()
{
@dimapaloskin
dimapaloskin / gist:8644017
Last active January 4, 2016 15:59
For validator
<!DOCTYPE html>
<html>
<head>
<title>Test 2</title>
<meta charset="utf-8" />
<style>
.title {
text-align: center;
}