From 34a46d631836b5a2755a49653d672c43c5c077ce Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 23 Dec 2015 14:35:52 +0000 Subject: [PATCH] should be clean enough to push --- src/static/js/ace.js | 6 +++++- src/static/js/ace2_inner.js | 9 ++++++++- src/static/js/domline.js | 3 ++- src/static/js/pad.js | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/static/js/ace.js b/src/static/js/ace.js index a5e365ce..0e81974c 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -286,6 +286,7 @@ window.onload = function () {\n\ iframe.name = "ace_inner";\n\ iframe.title = "pad";\n\ iframe.scrolling = "no";\n\ + iframe.setAttribute("sandbox", "allow-same-origin allow-scripts allow-popups allow-forms allow-modals");\n\ var outerdocbody = document.getElementById("outerdocbody");\n\ iframe.frameBorder = 0;\n\ iframe.allowTransparency = true; // for IE\n\ @@ -325,10 +326,13 @@ window.onload = function () {\n\ // bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly // (throbs busy while typing) - outerHTML.push('', '', scriptTag(outerScript), '
x
'); + var testHTML = 'WONT WORK in Chrome'; + + outerHTML.push('', '', scriptTag(outerScript), '
x
'+testHTML+''); var outerFrame = document.createElement("IFRAME"); outerFrame.name = "ace_outer"; + outerFrame.setAttribute("sandbox", "allow-same-origin allow-scripts allow-popups allow-forms allow-modals"); outerFrame.frameBorder = 0; // for IE outerFrame.title = "Ether"; info.frame = outerFrame; diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index ccc16668..4473126c 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -5006,8 +5006,14 @@ function Ace2Inner(){ }); }) +/* + $(root).on("dragend", function(e){ + top.console.log("dragend"); + }); + $(root).on("drop", function(e){ + top.console.log("DROP"); if(e.target.a || e.target.localName === "a"){ e.preventDefault(); } @@ -5020,7 +5026,7 @@ function Ace2Inner(){ e: e }); }); - +*/ // CompositionEvent is not implemented below IE version 8 if ( !(browser.msie && parseInt(browser.version <= 9)) && document.documentElement) @@ -5444,6 +5450,7 @@ function Ace2Inner(){ lineNumbersShown++; var n = lineNumbersShown; var div = odoc.createElement("DIV"); + //calculate height for new line number if(b){ var h = (b.clientHeight || b.offsetHeight); diff --git a/src/static/js/domline.js b/src/static/js/domline.js index 03f1b9c8..013f713d 100644 --- a/src/static/js/domline.js +++ b/src/static/js/domline.js @@ -70,6 +70,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) if (document) { result.node = document.createElement("div"); + result.node.setAttribute("contentEditable", true); // Works but doesn't allow drag n drop ;( } else { @@ -80,7 +81,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) } var html = []; - var preHtml = '', + var preHtml = '', postHtml = ''; var curHTML = null; diff --git a/src/static/js/pad.js b/src/static/js/pad.js index eb90a883..394d853e 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -513,7 +513,7 @@ var pad = { _afterHandshake: function() { pad.clientTimeOffset = new Date().getTime() - clientVars.serverTimestamp; - + //initialize the chat chat.init(this); getParams();