diff options
-rwxr-xr-x | bin/installDeps.sh | 4 | ||||
-rw-r--r-- | src/node/handler/ExportHandler.js | 8 | ||||
-rw-r--r-- | src/node/utils/Settings.js | 13 | ||||
-rw-r--r-- | src/package.json | 2 | ||||
-rw-r--r-- | src/static/js/contentcollector.js | 11 | ||||
-rw-r--r-- | tests/frontend/specs/importexport.js | 3 |
6 files changed, 35 insertions, 6 deletions
diff --git a/bin/installDeps.sh b/bin/installDeps.sh index 58eb32f2..ba2f56a4 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -81,9 +81,9 @@ DOWNLOAD_JQUERY="true" NEEDED_VERSION="1.9.1" if [ -f "src/static/js/jquery.js" ]; then if [ $(uname) = "SunOS" ]; then - VERSION=$(cat src/static/js/jquery.js | head -n 3 | ggrep -o "v[0-9]\.[0-9]\(\.[0-9]\)\?"); + VERSION=$(head -n 3 src/static/js/jquery.js | ggrep -o "v[0-9]\.[0-9]\(\.[0-9]\)\?") else - VERSION=$(cat src/static/js/jquery.js | head -n 3 | grep -o "v[0-9]\.[0-9]\(\.[0-9]\)\?"); + VERSION=$(head -n 3 src/static/js/jquery.js | grep -o "v[0-9]\.[0-9]\(\.[0-9]\)\?") fi if [ ${VERSION#v} = $NEEDED_VERSION ]; then diff --git a/src/node/handler/ExportHandler.js b/src/node/handler/ExportHandler.js index 0a0e51f1..0654deb4 100644 --- a/src/node/handler/ExportHandler.js +++ b/src/node/handler/ExportHandler.js @@ -158,8 +158,12 @@ exports.doExport = function(req, res, padId, type) //if this is a html export, we can send this from here directly if(type == "html") { - res.send(html); - callback("stop"); + // do any final changes the plugin might want to make cake + hooks.aCallFirst("exportHTMLSend", html, function(err, newHTML){ + if(newHTML.length) html = newHTML; + res.send(html); + callback("stop"); + }); } else //write the html export to a file { diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index af7ede81..05ae3bd8 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -236,6 +236,19 @@ exports.reloadSettings = function reloadSettings() { process.env['DEBUG'] = 'socket.io:' + exports.loglevel; // Used by SocketIO for Debug log4js.replaceConsole(); + if(exports.abiword){ + // Check abiword actually exists + if(exports.abiword != null) + { + fs.exists(exports.abiword, function(exists) { + if (!exists) { + console.error("Abiword does not exist at this path, check your settings file"); + exports.abiword = null; + } + }); + } + } + if(!exports.sessionKey){ // If the secretKey isn't set we also create yet another unique value here exports.sessionKey = randomString(32); console.warn("You need to set a sessionKey value in settings.json, this will allow your users to reconnect to your Etherpad Instance if your instance restarts"); diff --git a/src/package.json b/src/package.json index b92477d6..8ba31be8 100644 --- a/src/package.json +++ b/src/package.json @@ -28,7 +28,7 @@ "cheerio" : ">=0.18.0", "async-stacktrace" : ">=0.0.2", "npm" : ">=2.1.x", - "ejs" : ">=1.0.0", + "ejs" : "~1.0.0", "graceful-fs" : ">=3.0.4", "slide" : ">=1.1.6", "semver" : ">=2.3.0", diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index e90783ae..0dea2de0 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -538,7 +538,16 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class if(rr && rr[1]){ type = rr[1] } else { - type = (tname == "ul" ? (type.match("indent") || node.attribs.class && node.attribs.class.match("indent") ? "indent" : "bullet") : "number") + String(Math.min(_MAX_LIST_LEVEL, (state.listNesting || 0) + 1)); + if(tname == "ul"){ + if((type && type.match("indent")) || (node.attribs && node.attribs.class && node.attribs.class.match("indent"))){ + type = "indent" + } else { + type = "bullet" + } + } else { + type = "number" + } + type = type + String(Math.min(_MAX_LIST_LEVEL, (state.listNesting || 0) + 1)); } oldListTypeOrNull = (_enterList(state, type) || 'none'); } diff --git a/tests/frontend/specs/importexport.js b/tests/frontend/specs/importexport.js index 4ba8d57b..59607dba 100644 --- a/tests/frontend/specs/importexport.js +++ b/tests/frontend/specs/importexport.js @@ -6,6 +6,9 @@ describe("import functionality", function(){ function getinnertext(){ var inner = helper.padInner$ + if(!inner){ + return "" + } var newtext = "" inner("div").each(function(line,el){ newtext += el.innerHTML+"\n" |