From 2e79bd50a3eb6ba6f3cdb5f30ad776f5249e7cc4 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Sat, 19 Nov 2011 14:14:31 -0800 Subject: [PATCH 01/10] fixed socket.io logging --- node/server.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node/server.js b/node/server.js index d39fdcae8..1e0b6283c 100644 --- a/node/server.js +++ b/node/server.js @@ -436,25 +436,25 @@ async.waterfall([ //this is only a workaround to ensure it works with all browers behind a proxy //we should remove this when the new socket.io version is more stable - io.set('transports', ['xhr-polling']); + //io.set('transports', ['xhr-polling']); var socketIOLogger = log4js.getLogger("socket.io"); io.set('logger', { debug: function (str) { - socketIOLogger.debug(str); + socketIOLogger.debug.apply(socketIOLogger, arguments); }, info: function (str) { - socketIOLogger.info(str); + socketIOLogger.info.apply(socketIOLogger, arguments); }, warn: function (str) { - socketIOLogger.warn(str); + socketIOLogger.warn.apply(socketIOLogger, arguments); }, error: function (str) { - socketIOLogger.error(str); + socketIOLogger.error.apply(socketIOLogger, arguments); }, }); From 697201b3def7cb7173dfebac50624dc694e34fd6 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 20 Nov 2011 03:52:19 +0000 Subject: [PATCH 02/10] Addresses https://github.com/Pita/etherpad-lite/issues/173 but needs a lot of testing and a word of warning, at current doing shift tab deletes the previous character as it emulates a backspace. --- static/js/ace2_inner.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 9c647b6df..f45c61b23 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -3580,9 +3580,15 @@ function OUTER(gscope) function doTabKey(shiftDown) { - if (!doIndentOutdent(shiftDown)) + if (shiftDown === true){ + doDeleteKey(); + } + else { - performDocumentReplaceSelection(THE_TAB); + if (!doIndentOutdent(shiftDown)) + { + performDocumentReplaceSelection(THE_TAB); + } } } From 55a2f46ca90391e9446eff874b83e45a0161d252 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 20 Nov 2011 04:24:58 +0000 Subject: [PATCH 03/10] https://github.com/Pita/etherpad-lite/issues/143 - needs to be included with earlier commit that should still be in master if pita didn't remove. This fixes the bug where a url without http:// wouldnt be detected as a url and then a subsequent bug I am the father of where it would detect it as a user, open a new page but fudge up the url and make the page fail to load. --- static/js/domline.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/js/domline.js b/static/js/domline.js index 119b83783..7732805fd 100644 --- a/static/js/domline.js +++ b/static/js/domline.js @@ -152,6 +152,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) { if (href) { + if(!~href.indexOf("http")) // if the url doesn't include http or https etc prefix it. + { + href = "http://"+href; + } extraOpenTags = extraOpenTags + ''; extraCloseTags = '' + extraCloseTags; } From 90e9d552f0ccf8b149b4a0150a3291d0c1a7d18f Mon Sep 17 00:00:00 2001 From: Alexandre Girard Date: Mon, 21 Nov 2011 16:39:54 +0100 Subject: [PATCH 04/10] fix issue with newline in APIKEY.txt when checking api key --- node/handler/APIHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/handler/APIHandler.js b/node/handler/APIHandler.js index 57eeeb734..04464b086 100644 --- a/node/handler/APIHandler.js +++ b/node/handler/APIHandler.js @@ -70,7 +70,7 @@ var functions = { exports.handle = function(functionName, fields, req, res) { //check the api key! - if(fields["apikey"] != apikey) + if(fields["apikey"] != apikey.trim()) { res.send({code: 4, message: "no or wrong API Key", data: null}); return; From 2db81050f1e53605237ea621de26c06898f7741a Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 22 Nov 2011 21:03:50 +0000 Subject: [PATCH 05/10] Fixes "I did more testing and there are a few issues that comes up. If you type anything starting with www then that entire phrase becomes an anchor tag, even if there is a space after the www. So for example in the sentence "Put www at the start of the address" "www at" would become an anchor. The regex need updating to require a dot after the www, which I think would fix the issue, but my regex knowledge is not great." --- static/js/linestylefilter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/linestylefilter.js b/static/js/linestylefilter.js index 76f115f4a..f6cf9f357 100644 --- a/static/js/linestylefilter.js +++ b/static/js/linestylefilter.js @@ -237,7 +237,7 @@ linestylefilter.getRegexpFilter = function(regExp, tag) linestylefilter.REGEX_WORDCHAR = /[\u0030-\u0039\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u1FFF\u3040-\u9FFF\uF900-\uFDFF\uFE70-\uFEFE\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]/; linestylefilter.REGEX_URLCHAR = new RegExp('(' + /[-:@a-zA-Z0-9_.,~%+\/\\?=&#;()$]/.source + '|' + linestylefilter.REGEX_WORDCHAR.source + ')'); -linestylefilter.REGEX_URL = new RegExp(/(?:(?:https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt):\/\/|mailto:)/.source + linestylefilter.REGEX_URLCHAR.source + '*(?![:.,;])' + linestylefilter.REGEX_URLCHAR.source, 'g'); +linestylefilter.REGEX_URL = new RegExp(/(?:(?:https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt):\/\/|mailto:|www\.)/.source + linestylefilter.REGEX_URLCHAR.source + '*(?![:.,;])' + linestylefilter.REGEX_URLCHAR.source, 'g'); linestylefilter.getURLFilter = linestylefilter.getRegexpFilter( linestylefilter.REGEX_URL, 'url'); From dedd60412577b132ea2946f2af0d1db215bf8fd4 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 23 Nov 2011 15:46:34 +0000 Subject: [PATCH 06/10] Add support for embedding read only etc. --- static/js/pad_editbar.js | 9 ++++++++- static/pad.html | 27 ++++++++++++++++----------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/static/js/pad_editbar.js b/static/js/pad_editbar.js index ae1090687..f78e33fa5 100644 --- a/static/js/pad_editbar.js +++ b/static/js/pad_editbar.js @@ -102,8 +102,15 @@ var padeditbar = (function() { var padurl = window.location.href.split("?")[0]; $('#embedinput').val("