From 01483406ee2bd45b9f98e0e552b828556cb8b8d0 Mon Sep 17 00:00:00 2001 From: Robin Buse Date: Tue, 26 Jul 2011 18:11:51 +0300 Subject: [PATCH 01/39] pass w3c validator --- static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index 7648e838..f6c350f4 100644 --- a/static/index.html +++ b/static/index.html @@ -85,7 +85,7 @@
New Pad

or create/open a Pad with the name
-
+
From 2e163f2924efd020e77d2d11569d21b3b134b1dc Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Tue, 26 Jul 2011 17:00:56 +0100 Subject: [PATCH 02/39] reorganzied the bin folder --- bin/{runDebug.sh => debugRun.sh} | 2 +- bin/runTests.sh | 14 -------------- bin/{runSafe.sh => safeRun.sh} | 0 3 files changed, 1 insertion(+), 15 deletions(-) rename bin/{runDebug.sh => debugRun.sh} (88%) delete mode 100755 bin/runTests.sh rename bin/{runSafe.sh => safeRun.sh} (100%) diff --git a/bin/runDebug.sh b/bin/debugRun.sh similarity index 88% rename from bin/runDebug.sh rename to bin/debugRun.sh index 46eec8e8..8e1d737e 100755 --- a/bin/runDebug.sh +++ b/bin/debugRun.sh @@ -3,7 +3,7 @@ type -P node-inspector &>/dev/null || { echo "You need to install node-inspector to run the tests!" >&2 echo "You can install it with npm" >&2 - echo "Run: npm install node-inspector" >&2 + echo "Run: npm install -g node-inspector" >&2 exit 1 } diff --git a/bin/runTests.sh b/bin/runTests.sh deleted file mode 100755 index f22004e3..00000000 --- a/bin/runTests.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -type -P nodeunit &>/dev/null || { - echo "You need to install Nodeunit to run the tests!" >&2 - echo "You can install it with npm" >&2 - echo "Run: npm install nodeunit" >&2 - exit 1 -} - -if [ -d "../bin" ]; then - cd "../" -fi - -nodeunit tests diff --git a/bin/runSafe.sh b/bin/safeRun.sh similarity index 100% rename from bin/runSafe.sh rename to bin/safeRun.sh From b987a23cd0cb83c6ff0b4beb659fda46347cb26b Mon Sep 17 00:00:00 2001 From: Robin Buse Date: Tue, 26 Jul 2011 19:32:41 +0300 Subject: [PATCH 03/39] Edited static/index.html via GitHub --- static/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index f6c350f4..955eb4db 100644 --- a/static/index.html +++ b/static/index.html @@ -73,12 +73,12 @@ font-weight: bold; font-size: 17px; padding: 5px; - width: 245px; + width: 215px; outline: none; } input[type="submit"] { height: 35px; - width: 40px; + width: 70px; }
From 56ab112fa33d7fb9035a04d4a6ccdce4b9726724 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Tue, 26 Jul 2011 17:39:25 +0100 Subject: [PATCH 04/39] Timeslider Javascript is now minified too --- node/minify.js | 41 ++++++++++++++++++++++++++++++++--------- node/server.js | 8 ++++---- static/timeslider.html | 25 ++++--------------------- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/node/minify.js b/node/minify.js index fe9a8908..f34b400f 100644 --- a/node/minify.js +++ b/node/minify.js @@ -30,16 +30,32 @@ var Buffer = require('buffer').Buffer; var gzip = require('gzip'); var server = require('./server'); +var padJS = ["jquery.min.js", "pad_utils.js", "plugins.js", "undo-xpopup.js", "json2.js", "pad_cookie.js", "pad_editor.js", "pad_editbar.js", "pad_docbar.js", "pad_modals.js", "ace.js", "collab_client.js", "pad_userlist.js", "pad_impexp.js", "pad_savedrevs.js", "pad_connectionstatus.js", "pad2.js", "jquery-ui.js", "chat.js"]; + +var timesliderJS = ["jquery.min.js", "plugins.js", "undo-xpopup.js", "json2.js", "colorutils.js", "draggable.js", "pad_utils.js", "pad_cookie.js", "pad_editor.js", "pad_editbar.js", "pad_docbar.js", "pad_modals.js", "easysync2_client.js", "domline_client.js", "linestylefilter_client.js", "cssmanager_client.js", "broadcast.js", "broadcast_slider.js", "broadcast_revisions.js"]; + /** - * Answers a http request for the pad javascript + * creates the minifed javascript for the given minified name * @param req the Express request * @param res the Express response */ -exports.padJS = function(req, res) +exports.minifyJS = function(req, res, jsFilename) { res.header("Content-Type","text/javascript"); - - var jsFiles = ["jquery.min.js", "pad_utils.js", "plugins.js", "undo-xpopup.js", "json2.js", "pad_cookie.js", "pad_editor.js", "pad_editbar.js", "pad_docbar.js", "pad_modals.js", "ace.js", "collab_client.js", "pad_userlist.js", "pad_impexp.js", "pad_savedrevs.js", "pad_connectionstatus.js", "pad2.js", "jquery-ui.js", "chat.js"]; + + //choose the js files we need + if(jsFilename == "pad.js") + { + jsFiles = padJS; + } + else if(jsFilename == "timeslider.js") + { + jsFiles = timesliderJS; + } + else + { + throw new Error("there is no profile for creating " + name); + } //minifying is enabled if(settings.minify) @@ -91,7 +107,7 @@ exports.padJS = function(req, res) function(callback) { //check the modification time of the minified js - fs.stat("../var/minified_pad.js", function(err, stats) + fs.stat("../var/minified_" + jsFilename, function(err, stats) { if(err && err.code != "ENOENT") callback(err); @@ -122,6 +138,13 @@ exports.padJS = function(req, res) //find all includes in ace.js and embed them function(callback) { + //if this is not the creation of pad.js, skip this part + if(jsFilename != "pad.js") + { + callback(); + return; + } + var founds = fileValues["ace.js"].match(/\$\$INCLUDE_[a-zA-Z_]+\([a-zA-Z0-9.\/_"]+\)/gi); //go trough all includes @@ -194,7 +217,7 @@ exports.padJS = function(req, res) //write the results plain in a file function(callback) { - fs.writeFile("../var/minified_pad.js", result, "utf8", callback); + fs.writeFile("../var/minified_" + jsFilename, result, "utf8", callback); }, //write the results compressed in a file function(callback) @@ -202,7 +225,7 @@ exports.padJS = function(req, res) gzip(result, 9, function(err, compressedResult){ if(err) {callback(err); return} - fs.writeFile("../var/minified_pad.js.gz", compressedResult, callback); + fs.writeFile("../var/minified_" + jsFilename + ".gz", compressedResult, callback); }); } ],callback); @@ -217,12 +240,12 @@ exports.padJS = function(req, res) var pathStr; if(gzipSupport) { - pathStr = path.normalize(__dirname + "/../var/minified_pad.js.gz"); + pathStr = path.normalize(__dirname + "/../var/minified_" + jsFilename + ".gz"); res.header('Content-Encoding', 'gzip'); } else { - pathStr = path.normalize(__dirname + "/../var/minified_pad.js"); + pathStr = path.normalize(__dirname + "/../var/minified_" + jsFilename ); } res.sendfile(pathStr, { maxAge: server.maxAge }); diff --git a/node/server.js b/node/server.js index a1c42ae1..c79dfede 100644 --- a/node/server.js +++ b/node/server.js @@ -87,19 +87,19 @@ async.waterfall([ }); //serve minified files - app.get('/minified/:id', function(req, res) + app.get('/minified/:id', function(req, res, next) { res.header("Server", serverName); var id = req.params.id; - if(id == "pad.js") + if(id == "pad.js" || id == "timeslider.js") { - minify.padJS(req,res); + minify.minifyJS(req,res,id); } else { - res.send('404 - Not Found', 404); + next(); } }); diff --git a/static/timeslider.html b/static/timeslider.html index 6c6ab850..b850874a 100644 --- a/static/timeslider.html +++ b/static/timeslider.html @@ -8,7 +8,10 @@ - + + + + - - - - - - - - - - - - - - - - - - - From 1a43731a062be3c31b1873a373741514e908033f Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Tue, 26 Jul 2011 18:02:23 +0100 Subject: [PATCH 05/39] Ops, looks like I broke the wordle export at some point, now I fixed it --- static/pad.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/pad.html b/static/pad.html index 613d8291..73af50b7 100644 --- a/static/pad.html +++ b/static/pad.html @@ -225,7 +225,7 @@ We removed this feature cause its not worth the space it needs in the editbar
Microsoft Word
PDF
OpenDocument
-
Wordle
+
Wordle
From 1e54c41f60c8ffa2f671132f9c767a6b6aeebadf Mon Sep 17 00:00:00 2001 From: Robin Buse Date: Tue, 26 Jul 2011 20:14:01 +0300 Subject: [PATCH 06/39] Edited static/index.html via GitHub --- static/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index 955eb4db..f6c350f4 100644 --- a/static/index.html +++ b/static/index.html @@ -73,12 +73,12 @@ font-weight: bold; font-size: 17px; padding: 5px; - width: 215px; + width: 245px; outline: none; } input[type="submit"] { height: 35px; - width: 70px; + width: 40px; }
From 6867d881b17f198afd148e9752fd2b37d048e0ca Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Tue, 26 Jul 2011 18:54:42 +0100 Subject: [PATCH 07/39] Hide import/export options that are not avaiable if abiword isn't configured --- node/PadMessageHandler.js | 2 ++ static/js/pad_impexp.js | 24 +++++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/node/PadMessageHandler.js b/node/PadMessageHandler.js index 5d43fa6b..faf0ec6f 100644 --- a/node/PadMessageHandler.js +++ b/node/PadMessageHandler.js @@ -24,6 +24,7 @@ var Changeset = require("./Changeset"); var AttributePoolFactory = require("./AttributePoolFactory"); var authorManager = require("./AuthorManager"); var readOnlyManager = require("./ReadOnlyManager"); +var settings = require('./settings'); /** * A associative array that translates a session to a pad @@ -731,6 +732,7 @@ function handleClientReady(client, message) "fullWidth": false, "hideSidebar": false }, + "abiwordAvailable": settings.abiword != null, "hooks": {} } diff --git a/static/js/pad_impexp.js b/static/js/pad_impexp.js index 964eced6..e5dee7af 100644 --- a/static/js/pad_impexp.js +++ b/static/js/pad_impexp.js @@ -233,12 +233,26 @@ var padimpexp = (function() // build the export links $("#exporthtmla").attr("href", document.location.href + "/export/html"); $("#exportplaina").attr("href", document.location.href + "/export/txt"); - $("#exportworda").attr("href", document.location.href + "/export/doc"); - $("#exportpdfa").attr("href", document.location.href + "/export/pdf"); - $("#exportopena").attr("href", document.location.href + "/export/odt"); $("#exportwordlea").attr("href", document.location.href + "/export/wordle"); - - $("#importform").get(0).setAttribute('action', document.location.href + "/import"); + + //hide stuff thats not avaible if abiword is disabled + if(!clientVars.abiwordAvailable) + { + $("#exportworda").remove(); + $("#exportpdfa").remove(); + $("#exportopena").remove(); + $("#importexport").css({"height":"95px"}); + $("#importexportline").css({"height":"95px"}); + $("#import").html("Import is not available"); + } + else + { + $("#exportworda").attr("href", document.location.href + "/export/doc"); + $("#exportpdfa").attr("href", document.location.href + "/export/pdf"); + $("#exportopena").attr("href", document.location.href + "/export/odt"); + + $("#importform").get(0).setAttribute('action', document.location.href + "/import"); + } $("#impexp-close").click(function() { From 75cc53139ebddf6a463636224f46a0d5c2033c05 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Tue, 26 Jul 2011 19:28:49 +0100 Subject: [PATCH 08/39] Shell scripts are now POSIX compatible, thx @ Johannes Schauer --- bin/generateJsDoc.sh | 6 +++--- bin/run.sh | 12 ++++++------ bin/runDebug.sh | 4 ++-- bin/runSafe.sh | 6 +++--- bin/runTests.sh | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/generateJsDoc.sh b/bin/generateJsDoc.sh index c9424b74..cf876278 100755 --- a/bin/generateJsDoc.sh +++ b/bin/generateJsDoc.sh @@ -1,15 +1,15 @@ -#!/bin/bash +#!/bin/sh if [ -d "../bin" ]; then cd "../" fi -type -P node &>/dev/null || { +hash node > /dev/null 2>&1 || { echo "You need to install node!" >&2 exit 1 } -type -P doc.md &>/dev/null || { +hash doc.md > /dev/null 2>&1 || { echo "You need to install doc.md! npm install -g doc.md" >&2 exit 1 } diff --git a/bin/run.sh b/bin/run.sh index 0b72dc3f..3256d0fd 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh #Move to the folder where ep-lite is installed FOLDER=$(dirname $(readlink -f $0)) @@ -10,20 +10,20 @@ if [ -d "../bin" ]; then fi #Stop the script if its started as root -if [[ $EUID -eq 0 ]]; then +if [ "$(id -u)" -eq 0 ]; then echo "You shouldn't start Etherpad-Lite as root!" 1>&2 echo "Use authbind if you want to use a port lower than 1024 -> http://en.wikipedia.org/wiki/Authbind" 1>&2 exit 1 fi #Is node installed? -type -P node &>/dev/null || { +hash node > /dev/null 2>&1 || { echo "You need to install node to run Etherpad-Lite!" >&2 exit 1 } #Is npm installed? -type -P npm &>/dev/null || { +hash npm > /dev/null 2>&1 || { echo "You need to install npm to run Etherpad-Lite!" >&2 exit 1 } @@ -43,12 +43,12 @@ NEEDED_VERSION="1.6.2" if [ -f "static/js/jquery.min.js" ]; then VERSION=$(cat static/js/jquery.min.js | head -n 2 | tail -n 1 | grep -o "v[0-9]*\.[0-9]*\.[0-9]*"); - if [[ ${VERSION:1} = $NEEDED_VERSION ]]; then + if [ ${VERSION#v} = $NEEDED_VERSION ]; then DOWNLOAD_JQUERY="false" fi fi -if [[ $DOWNLOAD_JQUERY = "true" ]]; then +if [ $DOWNLOAD_JQUERY = "true" ]; then wget -O static/js/jquery.min.js http://code.jquery.com/jquery-$NEEDED_VERSION.min.js fi diff --git a/bin/runDebug.sh b/bin/runDebug.sh index 46eec8e8..041edbb6 100755 --- a/bin/runDebug.sh +++ b/bin/runDebug.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -type -P node-inspector &>/dev/null || { +hash node-inspector > /dev/null 2>&1 || { echo "You need to install node-inspector to run the tests!" >&2 echo "You can install it with npm" >&2 echo "Run: npm install node-inspector" >&2 diff --git a/bin/runSafe.sh b/bin/runSafe.sh index 180de1fe..d7d2b99c 100755 --- a/bin/runSafe.sh +++ b/bin/runSafe.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh #This script ensures that ep-lite is automatically restarting after an error happens @@ -49,12 +49,12 @@ do bin/run.sh >>$1 2>>$1 #Send email - if [ $ERROR_HANDLING == 1 ]; then + if [ $ERROR_HANDLING = 1 ]; then TIME_NOW=$(date +%s) TIME_SINCE_LAST_SEND=$(($TIME_NOW - $LAST_EMAIL_SEND)) if [ $TIME_SINCE_LAST_SEND -gt $TIME_BETWEEN_EMAILS ]; then - echo -e "Server was restared at: $(date)\nThe last 50 lines of the log before the error happens:\n $(tail -n 50 $1)" | mail -s "Pad Server was restarted" $EMAIL_ADDRESS + printf "Server was restared at: $(date)\nThe last 50 lines of the log before the error happens:\n $(tail -n 50 $1)" | mail -s "Pad Server was restarted" $EMAIL_ADDRESS LAST_EMAIL_SEND=$TIME_NOW fi diff --git a/bin/runTests.sh b/bin/runTests.sh index f22004e3..aa36dbba 100755 --- a/bin/runTests.sh +++ b/bin/runTests.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -type -P nodeunit &>/dev/null || { +hash nodeunit > /dev/null 2>&1 || { echo "You need to install Nodeunit to run the tests!" >&2 echo "You can install it with npm" >&2 echo "Run: npm install nodeunit" >&2 From e96595896c8b33df9756acfb18f4b572696185e2 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Wed, 27 Jul 2011 13:35:22 +0100 Subject: [PATCH 09/39] Fixed wordle export under https --- static/js/pad_impexp.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/static/js/pad_impexp.js b/static/js/pad_impexp.js index e5dee7af..8e4b269d 100644 --- a/static/js/pad_impexp.js +++ b/static/js/pad_impexp.js @@ -289,9 +289,7 @@ var padimpexp = (function() }, export2Wordle: function() { - padUrl = location.pathname; - padHost = location.host; - var padUrl = "http://" + padHost + padUrl + "/export/txt"; + var padUrl = document.location.href + "/export/txt"; $.get(padUrl, function(data) { From de5c0741f7585e0afde690bba128c0b1b0c3c035 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Wed, 27 Jul 2011 14:37:12 +0100 Subject: [PATCH 10/39] improved the bin files --- README.md | 7 +++--- bin/debugRun.sh | 19 ++++++++++++---- bin/installDeps.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++ bin/run.sh | 41 ++------------------------------- 4 files changed, 76 insertions(+), 47 deletions(-) create mode 100755 bin/installDeps.sh diff --git a/README.md b/README.md index d2745b43..d476c961 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,8 @@ The Node.js version of your Linux repository might be too old/new. Please compil 2. Install npm `curl http://npmjs.org/install.sh | sh` 3. Ensure you have installed the sqlite develob libraries, gzip and git `apt-get install libsqlite3-dev gzip git-core` 4. Clone the git repository `git clone 'git://github.com/Pita/etherpad-lite.git'` -5. Install the dependencies `cd etherpad-lite && npm install` -6. Start it with `bin/run.sh` -7. Open your web browser and visit +5. Start it with `bin/run.sh` (the first run will install all dependencies) +6. Open your web browser and visit # Next Steps You can modify the settings in the file settings.json @@ -60,4 +59,4 @@ You can join the [mailinglist](http://groups.google.com/group/etherpad-lite-dev) You also help the project, if you only host a ep-lite instance and share your experience with us. # License -[Apache License v2](http://www.apache.org/licenses/LICENSE-2.0.html) \ No newline at end of file +[Apache License v2](http://www.apache.org/licenses/LICENSE-2.0.html) diff --git a/bin/debugRun.sh b/bin/debugRun.sh index 014d11cd..fede0b50 100755 --- a/bin/debugRun.sh +++ b/bin/debugRun.sh @@ -1,5 +1,17 @@ #!/bin/sh +#Move to the folder where ep-lite is installed +FOLDER=$(dirname $(readlink -f $0)) +cd $FOLDER + +#Was this script started in the bin folder? if yes move out +if [ -d "../bin" ]; then + cd "../" +fi + +#prepare the enviroment +bin/installDeps.sh || exit 1 + hash node-inspector > /dev/null 2>&1 || { echo "You need to install node-inspector to run the tests!" >&2 echo "You can install it with npm" >&2 @@ -11,9 +23,8 @@ node-inspector & echo "If you new to node-inspector, take a look at this video: http://youtu.be/AOnK3NVnxL8" -if [ -d "../bin" ]; then - cd "../" -fi - cd "node" node --debug server.js + +#kill node-inspector before ending +kill $! diff --git a/bin/installDeps.sh b/bin/installDeps.sh new file mode 100755 index 00000000..feff219e --- /dev/null +++ b/bin/installDeps.sh @@ -0,0 +1,56 @@ +#Move to the folder where ep-lite is installed +FOLDER=$(dirname $(readlink -f $0)) +cd $FOLDER + +#Was this script started in the bin folder? if yes move out +if [ -d "../bin" ]; then + cd "../" +fi + +#Is wget installed? +hash wget > /dev/null 2>&1 || { + echo "Please install wget" >&2 + exit 1 +} + +#Is node installed? +hash node > /dev/null 2>&1 || { + echo "Please install node.js ( http://nodesjs.org )" >&2 + exit 1 +} + +#Is npm installed? +hash npm > /dev/null 2>&1 || { + echo "Please install npm ( http://npmjs.org )" >&2 + exit 1 +} + +#Does a settings.json exist? if no copy the template +if [ ! -f "settings.json" ]; then + echo "Copy the settings template to settings.json..." + cp -v settings.json.template settings.json || exit 1 +fi + +echo "Ensure that all dependencies are up to date..." +npm install || exit 1 + +echo "Ensure jQuery is downloaded and up to date..." +DOWNLOAD_JQUERY="true" +NEEDED_VERSION="1.6.2" +if [ -f "static/js/jquery.min.js" ]; then + VERSION=$(cat static/js/jquery.min.js | head -n 2 | tail -n 1 | grep -o "v[0-9]*\.[0-9]*\.[0-9]*"); + + if [ ${VERSION#v} = $NEEDED_VERSION ]; then + DOWNLOAD_JQUERY="false" + fi +fi + +if [ $DOWNLOAD_JQUERY = "true" ]; then + wget -O static/js/jquery.min.js http://code.jquery.com/jquery-$NEEDED_VERSION.min.js || exit 1 +fi + +#Remove all minified data to force node creating it new +echo "Clear minfified cache..." +rm -f var/minified* + +exit 0 diff --git a/bin/run.sh b/bin/run.sh index 3256d0fd..e89e3af9 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -16,45 +16,8 @@ if [ "$(id -u)" -eq 0 ]; then exit 1 fi -#Is node installed? -hash node > /dev/null 2>&1 || { - echo "You need to install node to run Etherpad-Lite!" >&2 - exit 1 -} - -#Is npm installed? -hash npm > /dev/null 2>&1 || { - echo "You need to install npm to run Etherpad-Lite!" >&2 - exit 1 -} - -#Does a settings.json exist? if no copy the template -if [ ! -f "settings.json" ]; then - echo "Copy the settings template to settings.json..." - cp -v settings.json.template settings.json -fi - -echo "Ensure that all dependencies are up to date..." -npm install - -echo "Ensure jQuery is downloaded and up to date..." -DOWNLOAD_JQUERY="true" -NEEDED_VERSION="1.6.2" -if [ -f "static/js/jquery.min.js" ]; then - VERSION=$(cat static/js/jquery.min.js | head -n 2 | tail -n 1 | grep -o "v[0-9]*\.[0-9]*\.[0-9]*"); - - if [ ${VERSION#v} = $NEEDED_VERSION ]; then - DOWNLOAD_JQUERY="false" - fi -fi - -if [ $DOWNLOAD_JQUERY = "true" ]; then - wget -O static/js/jquery.min.js http://code.jquery.com/jquery-$NEEDED_VERSION.min.js -fi - -#Remove all minified data to force node creating it new -echo "Clear minfified cache..." -rm var/minified* 2> /dev/null +#prepare the enviroment +bin/installDeps.sh || exit 1 #Move to the node folder and start echo "start..." From f4e04be9da33ed968f9b0e816dd8e85f70d4d3ce Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Wed, 27 Jul 2011 14:46:45 +0100 Subject: [PATCH 11/39] Let socket.io minify its javascript --- node/server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/node/server.js b/node/server.js index c79dfede..55aaf007 100644 --- a/node/server.js +++ b/node/server.js @@ -267,6 +267,10 @@ async.waterfall([ //reduce the log level io.set('log level', 2); + //minify socket.io javascript + if(settings.minify) + io.enable('browser client minification'); + var padMessageHandler = require("./PadMessageHandler"); var timesliderMessageHandler = require("./TimesliderMessageHandler"); From 115f7d6b5124a75f32654eb45c8e0edd65863f4e Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Wed, 27 Jul 2011 15:11:30 +0100 Subject: [PATCH 12/39] Fixed the iframe problems --- static/js/cssmanager.js | 2 +- static/js/pad_editbar.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/cssmanager.js b/static/js/cssmanager.js index 85e5552c..5601ea25 100644 --- a/static/js/cssmanager.js +++ b/static/js/cssmanager.js @@ -20,7 +20,7 @@ function makeCSSManager(emptyStylesheetTitle, top) function getSheetByTitle(title, top) { if(top) - var allSheets = window.top.document.styleSheets; + var allSheets = window.parent.parent.document.styleSheets; else var allSheets = document.styleSheets; diff --git a/static/js/pad_editbar.js b/static/js/pad_editbar.js index 75cd7402..f088eaeb 100644 --- a/static/js/pad_editbar.js +++ b/static/js/pad_editbar.js @@ -101,13 +101,13 @@ var padeditbar = (function() else if (cmd == 'embed') { var padurl = document.location; - $('#embedinput').val("