diff --git a/node/minify.js b/node/minify.js index 423741ca..0ec7f4ed 100644 --- a/node/minify.js +++ b/node/minify.js @@ -1,3 +1,19 @@ +/** + * 2011 Peter 'Pita' Martischka + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS-IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + var settings = require('./settings'); var async = require('async'); var fs = require('fs'); @@ -112,7 +128,7 @@ exports.padJS = function(req, res) var quote = item.search("_Q") != -1; //read the included file - fs.readFile(".." + filename, "utf-8", function(err, data) + fs.readFile("../" + filename, "utf-8", function(err, data) { //compress the file if(type == "JS") diff --git a/settings.json b/settings.json index 11084bcb..f72ef883 100644 --- a/settings.json +++ b/settings.json @@ -29,5 +29,5 @@ This file must be valid JSON. But comments are allowed /* if true, all css & js will be minified before sending to the client. This will improve the loading performance massivly, but makes it impossible to debug the javascript/css */ - "minify" : true + "minify" : false } diff --git a/static/css/inner.css b/static/css/inner.css index a2db762f..95e7ae1f 100644 --- a/static/css/inner.css +++ b/static/css/inner.css @@ -12,7 +12,7 @@ a { cursor: pointer !important; } /*span { padding-bottom: 1px; }/* padding-top: 1px; }*/ -/*div { background: transparent url(/static/img/acecarets/default.gif) repeat-y left top }*/ +/*div { background: transparent url(static/img/acecarets/default.gif) repeat-y left top }*/ /*tt { padding-left: 3px; padding-right: 3px; margin-right: -3px; margin-left: -3px; }*/ diff --git a/static/css/pad_lite.css b/static/css/pad_lite.css index e9cdb17f..d42343a7 100644 --- a/static/css/pad_lite.css +++ b/static/css/pad_lite.css @@ -1,5 +1,5 @@ /* @override - http://localhost:9001/static/css/pad_lite.css */ + static/css/pad_lite.css */ *,html,body,p{ margin: 0; padding: 0; } .clear { clear: both; } @@ -23,7 +23,7 @@ body, textarea { font-family: Helvetica, Arial, sans-serif; } } #sharebutton { - background: url(/static/img/inviteshare2.gif) no-repeat 0 -31px; + background: url(static/img/inviteshare2.gif) no-repeat 0 -31px; position: relative; display: block; top: 6px; @@ -163,7 +163,7 @@ OLD */ /* @override - http://localhost:9001/static/css/pad_lite.css */ + static/css/pad_lite.css */ #padpage { position: absolute; @@ -190,13 +190,13 @@ a#backtoprosite, #accountnav { a#backtoprosite, #accountnav a { color: #cde7ff; text-decoration: underline; } a#backtoprosite { padding-left: 20px; left: 6px; - background: url(/static/img/protop.gif) no-repeat -5px -6px; } + background: url(static/img/protop.gif) no-repeat -5px -6px; } #accountnav { right: 30px; color: #fff; } #topbarcenter { margin-left: 150px; margin-right: 150px; text-align:center;} a#topbaretherpad { margin-left: auto; margin-right: auto; display: block; width: 103px; position: relative; top: 3px; height: 0; padding-top: 20px; -/* background: url(/static/img/padtop5.gif) no-repeat -397px -3px; overflow: hidden; */ +/* background: url(static/img/padtop5.gif) no-repeat -397px -3px; overflow: hidden; */ } @@ -208,7 +208,7 @@ a#topbaretherpad { margin-left: auto; margin-right: auto; display: block; width: #Licensing {font-size: 1.2em; color: white;float:left;margin-top:4px;margin-left:-75px; text-decoration: none; } #fullscreen {font-size: 1.2em; color: white;float:right;margin-top:4px;margin-right:-120px; text-decoration: none; } -.propad a#topbaretherpad { background: url(/static/img/protop.gif) no-repeat -397px -3px; } +.propad a#topbaretherpad { background: url(static/img/protop.gif) no-repeat -397px -3px; } #specialkeyarea { top: 5px; left: 250px; color: yellow; font-weight: bold; font-size: 1.5em; position: absolute; } @@ -235,7 +235,7 @@ a#hidetopmsg { position: absolute; right: 5px; bottom: 5px; } background: #ffc; padding: 0.6em; font-size: 1.2em; margin-top: 6px; } #docbar { margin-top: 6px; height: 25px; position: relative; zoom: 1; - background: #fbfbfb url(/static/img/padtopback2.gif) repeat-x 0 -31px; } + background: #fbfbfb url(static/img/padtopback2.gif) repeat-x 0 -31px; } .docbarbutton { @@ -284,7 +284,7 @@ a#hidetopmsg { position: absolute; right: 5px; bottom: 5px; } #docbarleft { position: absolute; left: 0; top: 0; height: 100%; overflow: hidden; - background: url(/static/img/padtop5.gif) no-repeat left -31px; width: 7px; } + background: url(static/img/padtop5.gif) no-repeat left -31px; width: 7px; } @@ -294,7 +294,7 @@ a#hidetopmsg { position: absolute; right: 5px; bottom: 5px; } overflow: hidden; text-overflow: ellipsis /*not supported in FF*/; white-space:nowrap; } .docbar-public #docbarpadtitle { padding-left: 22px; - background: url(/static/img/public.gif) no-repeat left center; } + background: url(static/img/public.gif) no-repeat left center; } #docbarrenamelink { position: absolute; top: 6px; font-size: 1.1em; display: none; } @@ -302,7 +302,7 @@ a#hidetopmsg { position: absolute; right: 5px; bottom: 5px; } #docbarrenamelink a:hover { color: #48d; } #padtitlebuttons { position: absolute; width: 74px; zoom: 1; height: 17px; top: 4px; left: 170px; display: none; - background: url(/static/img/ok_or_cancel.gif) 0px 0px; } + background: url(static/img/ok_or_cancel.gif) 0px 0px; } #padtitlesave { position: absolute; display: block; height: 0; padding-top: 17px; overflow: hidden; width: 23px; left: 0; top: 0; } @@ -338,7 +338,7 @@ a#hidetopmsg { position: absolute; right: 5px; bottom: 5px; } .hidesidebar #padeditor { right: 0; } #vdraggie { - background: url(/static/img/vdraggie.gif) no-repeat top center; + background: url(static/img/vdraggie.gif) no-repeat top center; cursor: W-resize; bottom:0; position:absolute; @@ -394,10 +394,10 @@ a#hidetopmsg { position: absolute; right: 5px; bottom: 5px; } } #editbar #syncstatussyncing { position: absolute; height: 26px; width: 26px; - background: url(/static/img/syncing2.gif) no-repeat center center; + background: url(static/img/syncing2.gif) no-repeat center center; right: 38px; top: 5px; display: none; } #editbar #syncstatusdone { position: absolute; height: 26px; width: 26px; - background: url(/static/img/syncdone.gif) no-repeat center center; + background: url(static/img/syncdone.gif) no-repeat center center; right: 38px; top: 5px; display: none; } #padsidebar { @@ -430,7 +430,7 @@ a#hidetopmsg { position: absolute; right: 5px; bottom: 5px; } #myswatch { width: 100%; height: 100%; background: transparent;/*...initially*/ } #mycolorpicker { - background: url(/static/img/colorpicker.gif) no-repeat left top; + background: url(static/img/colorpicker.gif) no-repeat left top; width: 232px; height: 140px; position: absolute; left: -240px; top: 0px; z-index: 101; @@ -537,7 +537,7 @@ table#otheruserstable { display: none; } .modaldialog.cboxreconnecting .modaldialog-inner, .modaldialog.cboxconnecting .modaldialog-inner { - background: url(/static/img/connectingbar.gif) no-repeat center 60px; + background: url(static/img/connectingbar.gif) no-repeat center 60px; height: 100px; } .modaldialog.cboxreconnecting { @@ -646,27 +646,27 @@ table#otheruserstable { display: none; } width: 100%; height: 100%; position: absolute; overflow: hidden; top: -10px; } .dbpanel-top { position: absolute; top: 0; width: 100%; - height: 400px; background-image: url(/static/img/docpanelmiddle2.png); + height: 400px; background-image: url(static/img/docpanelmiddle2.png); background-position: left top; } .dbpanel-bottom { position: absolute; height: 400px; bottom: -390px; width: 100%; - background-image: url(/static/img/docpanelmiddle2.png); + background-image: url(static/img/docpanelmiddle2.png); background-position: left top; } * html .dbpanel-top, * html .dbpanel-bottom { /* for IE 6+ */ background-color: transparent; - background-image: url(/static/img/apr09/blank.gif); + background-image: url(static/img/apr09/blank.gif); /* scale the image instead of repeating, but it amounts to the same */ - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/static/img/docpanelmiddle2.png", sizingMethod="scale"); + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="static/img/docpanelmiddle2.png", sizingMethod="scale"); } .dbpanel-leftedge, .dbpanel-rightedge, .dbpanel-botleftcorner, .dbpanel-botrightcorner { position: absolute; background-repeat: no-repeat; background-color: transparent; - background-image: url(/static/img/docpaneledge2.png); + background-image: url(static/img/docpaneledge2.png); } .dbpanel-leftedge, .dbpanel-rightedge { height: 100%; width: 7px; bottom: 11px; } @@ -680,9 +680,9 @@ table#otheruserstable { display: none; } * html .dbpanel-leftedge, * html .dbpanel-rightedge, * html .dbpanel-botleftcorner, * html .dbpanel-botrightcorner { background-color: transparent; - background-image: url(/static/img/apr09/blank.gif); + background-image: url(static/img/apr09/blank.gif); /* crop the image */ - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/static/img/docpaneledge2.png", sizingMethod="crop"); + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="static/img/docpaneledge2.png", sizingMethod="crop"); } * html .dbpanel-leftedge, * html .dbpanel-botleftcorner { left: -7px; width: 14px; } @@ -724,7 +724,7 @@ table#otheruserstable { display: none; } #exportlinks .exportlink { display: block; position: absolute; height: 22px; width: auto; background-repeat: no-repeat; - background-image: url(/static/img/fileicons.gif); + background-image: url(static/img/fileicons.gif); line-height: 22px; padding-left: 22px; padding-right: 2px; } #exportlinks .n1 { left: 350px; top: 30px; } @@ -747,11 +747,11 @@ table#otheruserstable { display: none; } } #savedrevs-scrollleft { height: 100%; width: 14px; position: absolute; left: 0; top: 0; cursor: pointer; - background: url(/static/img/savedrevarrows.gif) no-repeat right top; + background: url(static/img/savedrevarrows.gif) no-repeat right top; } #savedrevs-scrollright { height: 100%; width: 14px; position: absolute; right: 0; top: 0; cursor: pointer; - background: url(/static/img/savedrevarrows.gif) no-repeat left top; + background: url(static/img/savedrevarrows.gif) no-repeat left top; } #savedrevs-scrolly .disabledscrollleft { background-position: right bottom; } #savedrevs-scrolly .disabledscrollright { background-position: left bottom; } @@ -792,7 +792,7 @@ table#otheruserstable { display: none; } #savedrevs-savenow { display: block; position: absolute; overflow: hidden; height: 0; padding-top: 24px; width: 81px; top: 22px; right: 27px; - background: url(/static/img/savedrevsgfx2.gif) no-repeat 0 0; + background: url(static/img/savedrevsgfx2.gif) no-repeat 0 0; } #savedrevs-savenow:active { background-position: 0 -24px; } #savedrevs-close { display: block; position: absolute; right: 7px; bottom: 8px; @@ -875,7 +875,7 @@ form#reconnectform { display: none; } #feedbackbox-hide, #feedbackbox-send, #feedbackbox-back { position: absolute; display: block; background-repeat: no-repeat; - background-image: url(/static/img/feedbackbox2.gif); + background-image: url(static/img/feedbackbox2.gif); } #feedbackbox-tl { width: 392px; height: 262px; left: 0; top: 0; @@ -917,7 +917,7 @@ form#reconnectform { display: none; } .expand-collapse { height: 22px; - background-image: url(/static/img/sharedistri.gif); + background-image: url(static/img/sharedistri.gif); background-repeat: no-repeat; background-position: 0 3px; padding-left: 17px; @@ -945,7 +945,7 @@ form#reconnectform { display: none; } .modaldialog .modaldialog-hide { float: right; background-repeat: no-repeat; - background-image: url(/static/img/sharebox4.gif); + background-image: url(static/img/sharebox4.gif); display: block; width: 22px; height: 22px; background-position: -454px -6px; @@ -978,7 +978,7 @@ form#reconnectform { display: none; } #sharebox-send { float: right; background-repeat: no-repeat; - background-image: url(/static/img/sharebox4.gif); + background-image: url(static/img/sharebox4.gif); display: block; width: 87px; height: 22px; background-position: -383px -289px; @@ -1005,20 +1005,20 @@ form#reconnectform { display: none; } color: #444; } #widthprefcheck { position: absolute; - background-image: url(/static/img/layoutbuttons.gif); + background-image: url(static/img/layoutbuttons.gif); background-repeat: no-repeat; cursor: pointer; width: 86px; height: 20px; top: 4px; right: 2px; } .widthprefunchecked { background-position: -1px -1px; } .widthprefchecked { background-position: -1px -23px; } #sidebarcheck { position: absolute; - background-image: url(/static/img/layoutbuttons.gif); + background-image: url(static/img/layoutbuttons.gif); background-repeat: no-repeat; cursor: pointer; width: 86px; height: 20px; top: 4px; right: 90px; } .sidebarunchecked { background-position: -1px -45px; } .sidebarchecked { background-position: -1px -67px; } #feedbackbutton { display: block; position: absolute; width: 68px; height: 0; padding-top: 17px; overflow: hidden; - background: url(/static/img/bottomareagfx.gif); + background: url(static/img/bottomareagfx.gif); top: 5px; right: 220px; } @@ -1042,11 +1042,11 @@ a#topbarmaximize { height: 16px; margin-right:-143px; margin-top:4px; - background: url(/static/img/maximize_normal.png); + background: url(static/img/maximize_normal.png); } .maximized a#topbarmaximize { - background: url(/static/img/maximize_maximized.png); + background: url(static/img/maximize_maximized.png); } #editbarinner h1 { diff --git a/static/index.html b/static/index.html index 7eec0266..0038dd1f 100644 --- a/static/index.html +++ b/static/index.html @@ -60,13 +60,13 @@ var padname = document.getElementById("padname").value; if(padname.length > 0) { - window.location = window.location.protocol + "//" + window.location.host + "/p/" + padname; + window.location = "p/" + padname; } } function go2Random() { - window.location = window.location.protocol + "//" + window.location.host + "/p/" + randomPadName() ; + window.location = "p/" + randomPadName() ; } function randomPadName() diff --git a/static/js/ace.js b/static/js/ace.js index ef6a2a3e..07906491 100644 --- a/static/js/ace.js +++ b/static/js/ace.js @@ -172,21 +172,21 @@ function Ace2Editor() { "aceInitInnerdocbodyHead", {iframeHTML:iframeHTML}); // these lines must conform to a specific format because they are passed by the build script: - iframeHTML.push($$INCLUDE_CSS_Q("/static/css/editor.css")); - iframeHTML.push($$INCLUDE_CSS_Q("/static/css/syntax.css")); - iframeHTML.push($$INCLUDE_CSS_Q("/static/css/inner.css")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/ace2_common.js")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/skiplist.js")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/virtual_lines.js")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/easysync2.js")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/cssmanager.js")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/colorutils.js")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/undomodule.js")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/contentcollector.js")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/changesettracker.js")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/linestylefilter.js")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/domline.js")); - iframeHTML.push($$INCLUDE_JS_Q("/static/js/ace2_inner.js")); + iframeHTML.push($$INCLUDE_CSS_Q("static/css/editor.css")); + iframeHTML.push($$INCLUDE_CSS_Q("static/css/syntax.css")); + iframeHTML.push($$INCLUDE_CSS_Q("static/css/inner.css")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/ace2_common.js")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/skiplist.js")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/virtual_lines.js")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/easysync2.js")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/cssmanager.js")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/colorutils.js")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/undomodule.js")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/contentcollector.js")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/changesettracker.js")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/linestylefilter.js")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/domline.js")); + iframeHTML.push($$INCLUDE_JS_Q("static/js/ace2_inner.js")); iframeHTML.push('\'\\n\\n\''); iframeHTML.push('\' \''); @@ -207,7 +207,7 @@ function Ace2Editor() { '}, 0); }'; var outerHTML = [doctype, '', - $$INCLUDE_CSS("/static/css/editor.css"), + $$INCLUDE_CSS("static/css/editor.css"), // bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly // (throbs busy while typing) '', diff --git a/static/js/pad2.js b/static/js/pad2.js index faf97e0c..b32bd599 100644 --- a/static/js/pad2.js +++ b/static/js/pad2.js @@ -533,10 +533,10 @@ var pad = { }, preloadImages: function() { var images = [ - '/static/img/feedbackbox2.gif', - '/static/img/sharebox4.gif', - '/static/img/sharedistri.gif', - '/static/img/colorpicker.gif', + 'static/img/feedbackbox2.gif', + 'static/img/sharebox4.gif', + 'static/img/sharedistri.gif', + 'static/img/colorpicker.gif', ]; function loadNextImage() { if (images.length == 0) { diff --git a/static/js/pad_savedrevs.js b/static/js/pad_savedrevs.js index ec06a1f4..76b0649b 100644 --- a/static/js/pad_savedrevs.js +++ b/static/js/pad_savedrevs.js @@ -30,7 +30,7 @@ var padsavedrevs = (function() { '
view | restore
'+ '
'+ '
'+ - ''+ + ''+ ''); setBoxLabel(box, revisionInfo.label); setBoxTimestamp(box, revisionInfo.timestamp);