From ed62ee6110431d1351961a135e290e6e8541dba5 Mon Sep 17 00:00:00 2001 From: Kenox Date: Fri, 4 Nov 2022 09:28:51 +0100 Subject: [PATCH] Fix width issue --- static/application.js | 2 +- static/application.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/application.js b/static/application.js index 4bd41bd..c9183be 100644 --- a/static/application.js +++ b/static/application.js @@ -329,7 +329,7 @@ function highlightNew(code) { codes[i].style.removeProperty("background-color"); } - const windowWidth = $(document).width(); + const windowWidth = $(window).width(); console.log("Window width: " + windowWidth + " - MaxWidth: " + maxWidth) if(windowWidth > maxWidth) maxWidth = windowWidth; diff --git a/static/application.min.js b/static/application.min.js index fcf11b0..0ecd109 100644 --- a/static/application.min.js +++ b/static/application.min.js @@ -1 +1 @@ -const workersUrl="https://api.knx.cool/";var haste_document=function(){this.locked=!1};htmlEscape=function(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/0;)t[0].parentNode.removeChild(t[0])}function highlightNew(e){const t=document.getElementsByTagName("code");let o=0;for(let e=0;eo&&(o=t[e].offsetWidth),t[e].style.removeProperty("background-color");const n=$(document).width();console.log("Window width: "+n+" - MaxWidth: "+o),n>o&&(o=n);for(let e=0;e'+e+"");$("#messages").prepend(o),setTimeout(function(){o.slideUp("fast",function(){$(this).remove()})},3e3)},haste.prototype.lightKey=function(){this.configureKey(["new","save"])},haste.prototype.fullKey=function(){this.configureKey(["new","duplicate","raw"])},haste.prototype.configureKey=function(e){var t,o=0;$("#box2 .function").each(function(){for(t=$(this),o=0;o0;)t[0].parentNode.removeChild(t[0]);this.$box.hide(),this.doc=new haste_document,this.setTitle(),this.lightKey(),this.$textarea.val("").show("fast",function(){this.focus()}),this.removeLineNumbers()},haste.extensionMap={rb:"ruby",py:"python",pl:"perl",php:"php",scala:"scala",go:"go",xml:"xml",html:"xml",htm:"xml",css:"css",js:"javascript",vbs:"vbscript",lua:"lua",pas:"delphi",java:"java",cpp:"cpp",cc:"cpp",m:"objectivec",vala:"vala",sql:"sql",sm:"smalltalk",lisp:"lisp",ini:"ini",diff:"diff",bash:"bash",sh:"bash",tex:"tex",erl:"erlang",hs:"haskell",md:"markdown",txt:"",coffee:"coffee",swift:"swift"},haste.prototype.lookupExtensionByType=function(e){for(var t in haste.extensionMap)if(haste.extensionMap[t]===e)return t;return e},haste.prototype.lookupTypeByExtension=function(e){return haste.extensionMap[e]||e},haste.prototype.addLineNumbers=function(e){if(removeElementsByClass("linenumber"),window.location.hash){highlightNew(getLineElement(window.location.hash.substring(1)))}},haste.prototype.removeLineNumbers=function(){removeElementsByClass("highlight"),removeElementsByClass("linenumber");let e=document.createElement("a");e.classList.add("linenumber");let t=document.createTextNode(">");e.appendChild(t),document.body.appendChild(e)},haste.prototype.loadDocument=function(e){var t=e.split(".",2),o=this;o.doc=new haste_document,o.doc.load(t[0],function(e){if(e){const t=e.value.split(/\r\n|\r|\n/);for(let n=0;n/g,">").replace(/0;)t[0].parentNode.removeChild(t[0])}function highlightNew(e){const t=document.getElementsByTagName("code");let o=0;for(let e=0;eo&&(o=t[e].offsetWidth),t[e].style.removeProperty("background-color");const n=$(window).width();console.log("Window width: "+n+" - MaxWidth: "+o),n>o&&(o=n);for(let e=0;e'+e+"");$("#messages").prepend(o),setTimeout(function(){o.slideUp("fast",function(){$(this).remove()})},3e3)},haste.prototype.lightKey=function(){this.configureKey(["new","save"])},haste.prototype.fullKey=function(){this.configureKey(["new","duplicate","raw"])},haste.prototype.configureKey=function(e){var t,o=0;$("#box2 .function").each(function(){for(t=$(this),o=0;o0;)t[0].parentNode.removeChild(t[0]);this.$box.hide(),this.doc=new haste_document,this.setTitle(),this.lightKey(),this.$textarea.val("").show("fast",function(){this.focus()}),this.removeLineNumbers()},haste.extensionMap={rb:"ruby",py:"python",pl:"perl",php:"php",scala:"scala",go:"go",xml:"xml",html:"xml",htm:"xml",css:"css",js:"javascript",vbs:"vbscript",lua:"lua",pas:"delphi",java:"java",cpp:"cpp",cc:"cpp",m:"objectivec",vala:"vala",sql:"sql",sm:"smalltalk",lisp:"lisp",ini:"ini",diff:"diff",bash:"bash",sh:"bash",tex:"tex",erl:"erlang",hs:"haskell",md:"markdown",txt:"",coffee:"coffee",swift:"swift"},haste.prototype.lookupExtensionByType=function(e){for(var t in haste.extensionMap)if(haste.extensionMap[t]===e)return t;return e},haste.prototype.lookupTypeByExtension=function(e){return haste.extensionMap[e]||e},haste.prototype.addLineNumbers=function(e){if(removeElementsByClass("linenumber"),window.location.hash){highlightNew(getLineElement(window.location.hash.substring(1)))}},haste.prototype.removeLineNumbers=function(){removeElementsByClass("highlight"),removeElementsByClass("linenumber");let e=document.createElement("a");e.classList.add("linenumber");let t=document.createTextNode(">");e.appendChild(t),document.body.appendChild(e)},haste.prototype.loadDocument=function(e){var t=e.split(".",2),o=this;o.doc=new haste_document,o.doc.load(t[0],function(e){if(e){const t=e.value.split(/\r\n|\r|\n/);for(let n=0;n