From 230302b132dbfab0f8342820144a58febabc40ee Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 1 Jan 2015 22:40:45 +0000 Subject: [PATCH 01/81] fix timeslider stars and frontend tests, needs css polish --- src/static/css/timeslider.css | 8 +++++++- tests/frontend/specs/timeslider_revisions.js | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/static/css/timeslider.css b/src/static/css/timeslider.css index 4c84a7fc..49f89421 100644 --- a/src/static/css/timeslider.css +++ b/src/static/css/timeslider.css @@ -154,11 +154,17 @@ stepper:active{ top: 20px; width: 25px; } +.star:before{ + font-family: fontawesome-etherpad; + content: "\e835"; + vertical-align:middle; + font-size:16px; +} #timeslider .star { cursor: pointer; height: 16px; position: absolute; - top: 40px; + top: 25px; width: 15px; } #timeslider #timer { diff --git a/tests/frontend/specs/timeslider_revisions.js b/tests/frontend/specs/timeslider_revisions.js index 76fde33a..2afd2e9d 100644 --- a/tests/frontend/specs/timeslider_revisions.js +++ b/tests/frontend/specs/timeslider_revisions.js @@ -19,6 +19,7 @@ describe("timeslider", function(){ inner$("div").first().sendkeys('a'); }, timePerRev*i); } + chrome$('.buttonicon-savedRevision').click(); setTimeout(function() { // go to timeslider @@ -51,6 +52,8 @@ describe("timeslider", function(){ setTimeout(function() { //make sure the text has changed expect( timeslider$('#padcontent').text() ).not.to.eql( latestContents ); + var starIsVisible = timeslider$('.star').is(":visible"); + expect( starIsVisible ).to.eql( true ); done(); }, 1000); From e2ea82f8df23f7ba68b5873024ddef178748c8c9 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 2 Jan 2015 10:58:48 +0100 Subject: [PATCH 02/81] Localisation updates from https://translatewiki.net. --- src/locales/bgn.json | 75 ++++++++++++++++++++++++++++++++++++++++++++ src/locales/diq.json | 1 + 2 files changed, 76 insertions(+) create mode 100644 src/locales/bgn.json diff --git a/src/locales/bgn.json b/src/locales/bgn.json new file mode 100644 index 00000000..00efbf3f --- /dev/null +++ b/src/locales/bgn.json @@ -0,0 +1,75 @@ +{ + "@metadata": { + "authors": [ + "Baloch Afghanistan" + ] + }, + "index.newPad": "یاداشتی نوکین کتابچه", + "index.createOpenPad": "یا جوڑ\t کورتین/پاچ کورتین یک کتابچه ئی یاداشتی بی نام:", + "pad.toolbar.bold.title": "پررنگ (Ctrl-B)", + "pad.toolbar.italic.title": "چوّٹ (Ctrl-I)", + "pad.toolbar.underline.title": "جهلگ خط (Ctrl-U)", + "pad.toolbar.strikethrough.title": "خط وارته (Ctrl+5)", + "pad.toolbar.ol.title": "ترتیب بوتگین لر لیست (Ctrl+Shift+N)", + "pad.toolbar.ul.title": "ترتیب نه بوتگین لر لیست (Ctrl+Shift+L)", + "pad.toolbar.indent.title": "بیئتئ بوتگین (TAB)", + "pad.toolbar.unindent.title": "در آتگی (Shift+TAB)", + "pad.toolbar.undo.title": "باطل‌کورتین (Ctrl-Z)", + "pad.toolbar.redo.title": "شه نوک (Ctrl-Y)", + "pad.toolbar.clearAuthorship.title": "نویسوکئ رنگانی پاک کورتین (Ctrl+Shift+C)", + "pad.toolbar.import_export.title": "بی تئ کورتین/دَر کورتین شه/بی رکم رکمین قالیبان", + "pad.toolbar.timeslider.title": "وختئ لَگوشوک", + "pad.toolbar.savedRevision.title": "نسخه ئی ذخیره کورتین", + "pad.toolbar.settings.title": "تنظیمات", + "pad.colorpicker.save": "ذخیره", + "pad.colorpicker.cancel": "کنسیل", + "pad.loading": "لودینگ...", + "pad.wrongPassword": "شمی پاسورد جووان نه اینت", + "pad.settings.padSettings": "یاداشتئ دفترچه ئی تنظیمات", + "pad.settings.myView": "نئ دیست", + "pad.settings.stickychat": "هبر موچین وختا بی دیستئ تاکدیمئ سرا بیئت", + "pad.settings.colorcheck": "نویسوکی رنگ ئان", + "pad.settings.linenocheck": "خط ئانی نمبر", + "pad.settings.rtlcheck": "محتوایی وانتین شه راست بی چپا؟", + "pad.settings.fontType": "قلم رکم:", + "pad.settings.fontType.normal": "ساددگ", + "pad.settings.fontType.monospaced": "Monospace", + "pad.settings.globalView": "سراسرین دیست یا نما", + "pad.settings.language": "زبان:", + "pad.importExport.exporthtml": "HTML", + "pad.importExport.exportplain": "ساده گین متن", + "pad.importExport.exportword": "Microsoft Word", + "pad.importExport.exportpdf": "PDF", + "pad.importExport.exportopen": "ODF (پاچین سندئ قالب)", + "pad.importExport.abiword.innerHTML": "شما تا توانیت که شه ساده گین متنی ئین قالب یا اچ‌تی‌ام‌ال بی تئ کنیت . په گیشتیرین کارا ئییان پیشرفته ئین بی تئ کورتینا AbiWord نصب کنیت.", + "pad.modals.connected": "وصل بوت.", + "pad.modals.userdup": "نوکین دروازه گئ پاچ کورتین", + "pad.modals.unauth": "مجاز نه اینت", + "pad.modals.deleted.explanation": "ای یاداشتی دفترچه پاک بوته.", + "pad.share.readonly": "فقط وانتین", + "pad.share.link": "لینک", + "pad.chat": "چت وهبر", + "timeslider.toolbar.exportlink.title": "دَر کورتین", + "timeslider.month.january": "جنوری", + "timeslider.month.february": "فیبروری", + "timeslider.month.march": "مارچ", + "timeslider.month.april": "اپریل", + "timeslider.month.may": "می", + "timeslider.month.june": "جون", + "timeslider.month.july": "جولای", + "timeslider.month.august": "اگوست", + "timeslider.month.september": "سیپٹمبر", + "timeslider.month.october": "اکتوبر", + "timeslider.month.november": "نوامبر", + "timeslider.month.december": "ڈ\tسمبر", + "timeslider.unnamedauthors": "{{num}} بی نامین نویسوک", + "pad.userlist.entername": "وتئ ناما نیویشته بکنیت", + "pad.userlist.unnamed": "بی نام", + "pad.userlist.guest": "مهمان", + "pad.userlist.deny": "رد کورتین", + "pad.userlist.approve": "قبول کورتین", + "pad.impexp.importbutton": "انون بی تئ کن", + "pad.impexp.importing": "بی بی تئ کورتینی حالا...", + "pad.impexp.uploadFailed": "آپلود انجام نه بوت، پدا کوشش کن", + "pad.impexp.copypaste": "کپی پیست کَنیت" +} diff --git a/src/locales/diq.json b/src/locales/diq.json index 61d40169..81a55477 100644 --- a/src/locales/diq.json +++ b/src/locales/diq.json @@ -48,6 +48,7 @@ "pad.modals.userdup": "Zewbina pençere de bi a", "pad.modals.unauth": "Selahiyetdar niyo", "pad.modals.initsocketfail": "Nêresneyêno ciyageyroği.", + "pad.modals.slowcommit.explanation": "Server cewab nêdano.", "pad.modals.deleted": "Esteriya.", "pad.modals.deleted.explanation": "Ena ped wedariye", "pad.share": "Na ped vıla ke", From 26c839063f2a006cc5ac28266c0a2156924c01c2 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 4 Jan 2015 14:47:08 +0000 Subject: [PATCH 03/81] check file system that abiword exists --- src/node/utils/Settings.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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"); From 751adb24fde9a093e3bf57e2e8350b2ae67db52e Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 5 Jan 2015 18:38:34 +0100 Subject: [PATCH 04/81] Finally fix AttribManager#removeAttributeOnLine return safely if the attribute wasn't found. fixes #2394 --- src/static/js/AttributeManager.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/static/js/AttributeManager.js b/src/static/js/AttributeManager.js index a11f6cef..974d8ad9 100644 --- a/src/static/js/AttributeManager.js +++ b/src/static/js/AttributeManager.js @@ -164,12 +164,20 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({ var builder = Changeset.builder(this.rep.lines.totalWidth()); var hasMarker = this.lineHasMarker(lineNum); var attribs + var foundAttrib = false attribs = this.getAttributesOnLine(lineNum).map(function(attrib) { - if(attrib[0] === attributeName) return [attributeName, null] + if(attrib[0] === attributeName) { + foundAttrib = true + return [attributeName, null] // remove this attrib from the linemarker + } return attrib }) + if(!foundAttrib) { + return + } + if(hasMarker){ ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 0])); // If length == 4, there's [author, lmkr, insertorder, + the attrib being removed] thus we can remove the marker entirely From 17ce67d936777eea7d85106bdf978661dde73bd8 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 6 Jan 2015 16:31:52 +0000 Subject: [PATCH 05/81] final html export hook --- src/node/handler/ExportHandler.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 { From ce156540bab1754dd569acd3532ff7c26ed73161 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Wed, 7 Jan 2015 07:03:53 +0100 Subject: [PATCH 06/81] fix importexport-tests --- tests/frontend/specs/importexport.js | 3 +++ 1 file changed, 3 insertions(+) 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" From f2c443809fe2123e32cd86b9752126f0186ebd7b Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 7 Jan 2015 15:18:54 +0000 Subject: [PATCH 07/81] roll ejs back as its broken at v2 --- src/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From 1f558dc8430b53f349d7161d773bc177354f3791 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Thu, 8 Jan 2015 12:54:08 +0100 Subject: [PATCH 08/81] Removed useless use of cat --- bin/installDeps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 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 From 82efcdb430e402626efb9fdef93a6aaba0d31ffa Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Fri, 9 Jan 2015 02:04:03 +0100 Subject: [PATCH 09/81] fix for uls without class --- src/static/js/contentcollector.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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'); } From 9b9a7471671c1773c4f203ed5493be6d5bdc5913 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 11 Jan 2015 00:02:02 -0800 Subject: [PATCH 10/81] Support ejs 2.0 Fixes #2437. This is still relying on undocumented behavior, but should unbreak the app in the mean time. --- src/node/eejs/index.js | 2 +- src/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/eejs/index.js b/src/node/eejs/index.js index 30f5a442..5f2baaf3 100644 --- a/src/node/eejs/index.js +++ b/src/node/eejs/index.js @@ -114,7 +114,7 @@ exports.require = function (name, args, mod) { args.e = exports; args.require = require; - var template = '<% e._init(buf); %>' + fs.readFileSync(ejspath).toString() + '<% e._exit(); %>'; + var template = '<% e._init([__output]); %>' + fs.readFileSync(ejspath).toString() + '<% e._exit(); %>'; exports.info.args.push(args); exports.info.file_stack.push({path: ejspath, inherit: []}); diff --git a/src/package.json b/src/package.json index 8ba31be8..6c6123da 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" : "^2.0.0", "graceful-fs" : ">=3.0.4", "slide" : ">=1.1.6", "semver" : ">=2.3.0", From a080b12eac8d571fcf14691a490b79c3f26e012c Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 11 Jan 2015 22:40:56 +0100 Subject: [PATCH 11/81] Add new favicon (32x32) with associated svg file --- src/etherpad_icon.svg | 92 +++++++++++++++++++++++++++++++++++++++++ src/static/favicon.ico | Bin 1150 -> 4286 bytes 2 files changed, 92 insertions(+) create mode 100644 src/etherpad_icon.svg diff --git a/src/etherpad_icon.svg b/src/etherpad_icon.svg new file mode 100644 index 00000000..ebdcde99 --- /dev/null +++ b/src/etherpad_icon.svg @@ -0,0 +1,92 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/static/favicon.ico b/src/static/favicon.ico index df7b628996cd0a205dc5df5b1188342a80f34e90..938e95502402fd81aa79bc0e26feabfdfac29e2a 100644 GIT binary patch literal 4286 zcmdUyUr19?9LJ9{5bY(XBrHghY+}Ad5EkOp&HtPx6hM=ugSZ0d_! z(-t{Un{zs-$4MmALu61OR8kRLqK72GqCcL#hdg%DIqr7nLvvq$=bm$Zzt8X7bMD+0%ugw5}#UazNJU0qIb+`Mcyn?Lh@%${(Zq6n_nP1Y;N3)|J6e%b2 zHf4UA=UmJ~*8HDssHB#2Wr}2ODigW9EQ{}P6wx1dh$5{9RGcZ=|AKGSYv>izDMfO? zKh8RmHU2n$@nWS?CyQ^<_R^k;XNu&kd=f7|S$wN@fDUM=BDpo+Q|4dLwb8b!up(Wp zx+|MsQ&aO|2j_ev4{+@KH&?V^|Fi$t!Cd0*Kfrs>n2n8%lEGkL_k!&Q6sxwjcHU?- zzC)~479Z*q$IZ*@ENZvgec^EU6|^ulHPwXn4BjUhi+%1s_}@UB71$8+c)iX~xc=Gv z#A2~s@Vf-RCD^A>VKQv=?|{BAF80(V%oprMxqQxIc_7B~k&%&>`uh3h% zm}NPk{$;#2-VbpXp>5BfcuvmG&d#>+=Y{);7V&eTM-Y3T^kdvju;UPWxAcmAHpYT`Q-*0iFR7asU7T literal 1150 zcma)$F-pWx6h*Hnh}cXe+F7~`t7HM$ft71WKvM)#SlOlx!c=yeQn9nrg(Q_#aE9-H z3c+u}iw z_j`i}x#|5VEQK8&r1ugJ;^}P@mckAX(tC*q@xFV7rLe<;^j_jYy!*=#mckAX(tC*q zy&gL}Xnk3h&(k!W(xtSUZETy~tQ*JitZAAxzmc-8>qp!C<+pA7V9&Ho>haxfwqcw8 x2fokqe3<9?b{K{$OHmXPH!r)cyR&Cl`o6#U&wJgMy!rT&K96_VzDS!}=?C51Xs7@H From a553b44dbccf76603ae516464cd695a8f4fd7d6e Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 11 Jan 2015 23:59:18 +0000 Subject: [PATCH 12/81] refix plugins --- src/node/eejs/index.js | 2 +- src/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/eejs/index.js b/src/node/eejs/index.js index 5f2baaf3..30f5a442 100644 --- a/src/node/eejs/index.js +++ b/src/node/eejs/index.js @@ -114,7 +114,7 @@ exports.require = function (name, args, mod) { args.e = exports; args.require = require; - var template = '<% e._init([__output]); %>' + fs.readFileSync(ejspath).toString() + '<% e._exit(); %>'; + var template = '<% e._init(buf); %>' + fs.readFileSync(ejspath).toString() + '<% e._exit(); %>'; exports.info.args.push(args); exports.info.file_stack.push({path: ejspath, inherit: []}); diff --git a/src/package.json b/src/package.json index 6c6123da..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" : "^2.0.0", + "ejs" : "~1.0.0", "graceful-fs" : ">=3.0.4", "slide" : ">=1.1.6", "semver" : ">=2.3.0", From 648ebc08d64894eb08f8c1d3b2dfe90c796b7ec4 Mon Sep 17 00:00:00 2001 From: nemetz Date: Fri, 16 Jan 2015 11:11:34 -0200 Subject: [PATCH 13/81] check for io.js Added a check for io.js --- bin/installDeps.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/installDeps.sh b/bin/installDeps.sh index ba2f56a4..00575845 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -23,6 +23,7 @@ hash curl > /dev/null 2>&1 || { } #Is node installed? +#not checking io.js, default installation creates a symbolic link to node hash node > /dev/null 2>&1 || { echo "Please install node.js ( http://nodejs.org )" >&2 exit 1 @@ -45,9 +46,13 @@ fi #check node version NODE_VERSION=$(node --version) NODE_V_MINOR=$(echo $NODE_VERSION | cut -d "." -f 1-2) +#iojs version checking added +IOJS_VERSION=$(iojs --version) if [ ! $NODE_V_MINOR = "v0.8" ] && [ ! $NODE_V_MINOR = "v0.10" ] && [ ! $NODE_V_MINOR = "v0.11" ]; then - echo "You're running a wrong version of node, you're using $NODE_VERSION, we need v0.8.x, v0.10.x or v0.11.x" >&2 - exit 1 + if [ ! $IOJS_VERSION ]; then + echo "You're running a wrong version of node, or io.js is not installed. You're using $NODE_VERSION, we need v0.8.x, v0.10.x or v0.11.x" >&2 + exit 1 + fi fi #Get the name of the settings file From 6d6ddd7f9f06d6cbf71ee3e1cff0f7b501432f4d Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 18 Jan 2015 12:15:41 +0100 Subject: [PATCH 14/81] Prevent form submit on plugin page --- src/static/js/admin/plugins.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/static/js/admin/plugins.js b/src/static/js/admin/plugins.js index 8a4c732e..15406f5f 100644 --- a/src/static/js/admin/plugins.js +++ b/src/static/js/admin/plugins.js @@ -131,6 +131,11 @@ $(document).ready(function () { $("#search-query").unbind('keyup').keyup(function () { search($("#search-query").val()); }); + + // Prevent form submit + $('#search-query').parent().bind('submit', function() { + return false; + }); // update & install $(".do-install, .do-update").unbind('click').click(function (e) { From 46440733996787eaa6c3555b53f0640a30e94cd7 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 18 Jan 2015 13:56:30 +0100 Subject: [PATCH 15/81] Prevent dublicates in search results --- src/static/js/admin/plugins.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/static/js/admin/plugins.js b/src/static/js/admin/plugins.js index 15406f5f..a60ad446 100644 --- a/src/static/js/admin/plugins.js +++ b/src/static/js/admin/plugins.js @@ -181,6 +181,7 @@ $(document).ready(function () { socket.on('results:search', function (data) { if(!data.results.length) search.end = true; + if(data.query.offset == 0) search.results = []; search.messages.hide('nothing-found') search.messages.hide('fetching') $("#search-query").removeAttr('disabled') From 3c6db077ed453c491a61707081928242f7ad4a5f Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 18 Jan 2015 14:22:27 +0100 Subject: [PATCH 16/81] Change domain for plugins.json request --- src/static/js/pluginfw/installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js index 90bd9aa2..35e42c17 100644 --- a/src/static/js/pluginfw/installer.js +++ b/src/static/js/pluginfw/installer.js @@ -61,7 +61,7 @@ exports.availablePlugins = null; var cacheTimestamp = 0; exports.getAvailablePlugins = function(maxCacheAge, cb) { - request("http://etherpad.org/plugins.json", function(er, response, plugins){ + request("http://static.etherpad.org/plugins.json", function(er, response, plugins){ if (er) return cb && cb(er); if(exports.availablePlugins && maxCacheAge && Math.round(+new Date/1000)-cacheTimestamp <= maxCacheAge) { return cb && cb(null, exports.availablePlugins) From 83fae2227940fb771a7dd24454417d668d147ff2 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 18 Jan 2015 15:32:48 +0000 Subject: [PATCH 17/81] allow list text entry up to 16 items --- src/static/js/contentcollector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index 0dea2de0..b7b3c568 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -23,7 +23,7 @@ * limitations under the License. */ -var _MAX_LIST_LEVEL = 8; +var _MAX_LIST_LEVEL = 16; var UNorm = require('unorm'); var Changeset = require('./Changeset'); @@ -523,7 +523,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class }else{ var type = null; } - var rr = cls && /(?:^| )list-([a-z]+[12345678])\b/.exec(cls); + var rr = cls && /(?:^| )list-([a-z]+[0-9]+)\b/.exec(cls); // lists do not need to have a type, so before we make a wrong guess, check if we find a better hint within the node's children if(!rr && !type){ for (var i in node.children){ From ca6b729acea91d0997a96685e7b98286de163483 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 18 Jan 2015 19:58:38 +0000 Subject: [PATCH 18/81] fix for ep page view pageup/down --- src/static/js/ace2_inner.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 86f69bab..5b847f9b 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3867,7 +3867,10 @@ function Ace2Inner(){ updateBrowserSelectionFromRep(); var myselection = document.getSelection(); // get the current caret selection, can't use rep. here because that only gives us the start position not the current var caretOffsetTop = myselection.focusNode.parentNode.offsetTop || myselection.focusNode.offsetTop; // get the carets selection offset in px IE 214 - // top.console.log(caretOffsetTop); + + // sometimes the first selection is -1 which causes problems (Especially with ep_page_view) + // so use focusNode.offsetTop value. + if(caretOffsetTop === -1) caretOffsetTop = myselection.focusNode.offsetTop; setScrollY(caretOffsetTop); // set the scrollY offset of the viewport on the document }, 200); From c0a4051b7a9c4531b4c0843ccd676f60f339ec02 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 18 Jan 2015 20:12:02 +0000 Subject: [PATCH 19/81] use etherpads own yajsml --- src/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.json b/src/package.json index 8ba31be8..17757620 100644 --- a/src/package.json +++ b/src/package.json @@ -11,7 +11,7 @@ { "name": "Marcel Klehr" } ], "dependencies" : { - "yajsml" : "1.1.6", + "etherpad-yajsml" : ">=0.0.1", "request" : ">=2.48.0", "etherpad-require-kernel" : ">=1.0.7", "resolve" : ">=1.0.0", From 689ced8443e4e8491cbd184027d10c953c0d8466 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 18 Jan 2015 20:15:17 +0000 Subject: [PATCH 20/81] and this one.. --- src/node/hooks/express/static.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/hooks/express/static.js b/src/node/hooks/express/static.js index c6a22745..e5a2bff0 100644 --- a/src/node/hooks/express/static.js +++ b/src/node/hooks/express/static.js @@ -2,7 +2,7 @@ var minify = require('../../utils/Minify'); var plugins = require("ep_etherpad-lite/static/js/pluginfw/plugins"); var CachingMiddleware = require('../../utils/caching_middleware'); var settings = require("../../utils/Settings"); -var Yajsml = require('yajsml'); +var Yajsml = require('etherpad-yajsml'); var _ = require("underscore"); exports.expressCreateServer = function (hook_name, args, cb) { From 7e69bc65ce507391353f6ca8d67ccc967e0f571f Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 18 Jan 2015 23:03:54 +0000 Subject: [PATCH 21/81] remove infinite load was causing pain --- src/static/js/admin/plugins.js | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/static/js/admin/plugins.js b/src/static/js/admin/plugins.js index a60ad446..a1ad624a 100644 --- a/src/static/js/admin/plugins.js +++ b/src/static/js/admin/plugins.js @@ -26,12 +26,11 @@ $(document).ready(function () { $('#search-progress').show() search.messages.show('fetching') - storeScrollPosition() search.searching = true } search.searching = false; search.offset = 0; - search.limit = 25; + search.limit = 999; search.results = []; search.sortBy = 'name'; search.sortDir = /*DESC?*/true; @@ -43,7 +42,7 @@ $(document).ready(function () { $('.search-results .messages .'+msg+' *').show() }, hide: function(msg) { - //$('.search-results .messages').hide() + $('.search-results .messages').hide() $('.search-results .messages .'+msg+'').hide() $('.search-results .messages .'+msg+' *').hide() } @@ -104,28 +103,6 @@ $(document).ready(function () { }) } - // Infinite scroll - var scrollPosition - function storeScrollPosition() { - scrollPosition = $(window).scrollTop() - } - function restoreScrollPosition() { - setTimeout(function() { - $(window).scrollTop(scrollPosition) - }, 0) - } - - $(window).scroll(checkInfiniteScroll) - function checkInfiniteScroll() { - if(search.end || search.searching) return;// don't keep requesting if there are no more results - setTimeout(function() { - try{ - var top = $('.results>tr:last').offset().top - if($(window).scrollTop()+$(window).height() > top) search(search.searchTerm) - }catch(e){} - }, 1) - } - function updateHandlers() { // Search $("#search-query").unbind('keyup').keyup(function () { @@ -209,8 +186,6 @@ $(document).ready(function () { } search.messages.hide('fetching') $('#search-progress').hide() - restoreScrollPosition() - checkInfiniteScroll() search.searching = false }); From af70902befcade65769f335a63443f6dc5dc5ef8 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 18 Jan 2015 23:16:58 +0000 Subject: [PATCH 22/81] support deeper nested elements on exports --- src/node/utils/ExportHelper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/utils/ExportHelper.js b/src/node/utils/ExportHelper.js index 3297c6d3..7a81bbbf 100644 --- a/src/node/utils/ExportHelper.js +++ b/src/node/utils/ExportHelper.js @@ -55,7 +55,7 @@ exports._analyzeLine = function(text, aline, apool){ var listType = Changeset.opAttributeValue(opIter.next(), 'list', apool); if (listType){ lineMarker = 1; - listType = /([a-z]+)([12345678])/.exec(listType); + listType = /([a-z]+)([0-9+])/.exec(listType); if (listType){ line.listTypeName = listType[1]; line.listLevel = Number(listType[2]); From bd9ff770fe9f6efeba07a57e0a870ca7ecad1774 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 18 Jan 2015 23:21:34 +0000 Subject: [PATCH 23/81] reset all numbers on first item --- src/node/utils/ExportHtml.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index c882e0ef..3cecb996 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -470,7 +470,7 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback) 'ul.indent { list-style-type: none; }' + 'ol { list-style-type: none; padding-left:0;}' + - 'body > ol { counter-reset: first second; }' + + 'body > ol { counter-reset: first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelth thirteenth fourteenth fifteenth sixteenth; }' + 'ol > li:before {' + 'content: counter(first) ". " ;'+ 'counter-increment: first;}' + From e50ea6ffea8e0f9879a061119382e844a7f23346 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 18 Jan 2015 23:24:20 +0000 Subject: [PATCH 24/81] whoops proper regexp fix for listNumber --- src/node/utils/ExportHelper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/utils/ExportHelper.js b/src/node/utils/ExportHelper.js index 7a81bbbf..297c2d7a 100644 --- a/src/node/utils/ExportHelper.js +++ b/src/node/utils/ExportHelper.js @@ -55,7 +55,7 @@ exports._analyzeLine = function(text, aline, apool){ var listType = Changeset.opAttributeValue(opIter.next(), 'list', apool); if (listType){ lineMarker = 1; - listType = /([a-z]+)([0-9+])/.exec(listType); + listType = /([a-z]+)([0-9]+)/.exec(listType); if (listType){ line.listTypeName = listType[1]; line.listLevel = Number(listType[2]); From 6bc74a9adbbb9ad8187944853ce0aa3570df3cff Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 18 Jan 2015 23:33:29 +0000 Subject: [PATCH 25/81] more export logic handling --- src/node/utils/ExportHtml.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index 3cecb996..5e5aca84 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -470,7 +470,7 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback) 'ul.indent { list-style-type: none; }' + 'ol { list-style-type: none; padding-left:0;}' + - 'body > ol { counter-reset: first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelth thirteenth fourteenth fifteenth sixteenth; }' + + 'body > ol { counter-reset: first second third fourth fifth sixth seventh eigth ninth tenth eleventh twelth thirteenth fourteenth fifteenth sixteenth; }' + 'ol > li:before {' + 'content: counter(first) ". " ;'+ 'counter-increment: first;}' + @@ -504,15 +504,15 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback) 'counter-increment: eigth;}' + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + - 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eight) "." counter(ninth) ". ";'+ + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eigth) "." counter(ninth) ". ";'+ 'counter-increment: ninth;}' + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + - 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eighth) "." counter(ninth) "." counter(tenth) ". ";'+ + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eigth) "." counter(ninth) "." counter(tenth) ". ";'+ 'counter-increment: tenth;}' + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + - 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eighth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) ". ";'+ + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eigth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) ". ";'+ 'counter-increment: eleventh;}' + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + From 0bd7914c3b409408d9a2b0f4f3d6b9ff95df0758 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 18 Jan 2015 23:58:47 +0000 Subject: [PATCH 26/81] dont paste on middle click of link --- src/static/js/ace2_inner.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 5b847f9b..811c9a1f 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -4858,6 +4858,14 @@ function Ace2Inner(){ $(document).on("click", handleIEOuterClick); } if (browser.msie) $(root).on("paste", handleIEPaste); + + // Don't paste on middle click of links + $(root).on("paste", function(e){ + if(e.target.a){ + e.preventDefault(); + } + }) + // CompositionEvent is not implemented below IE version 8 if ( !(browser.msie && browser.version < 9) && document.documentElement) { From 33c62329baa9a0fd41d2ba16158845bb892aafdc Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 00:28:32 +0000 Subject: [PATCH 27/81] better regexp for line items --- src/static/js/ace2_inner.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 811c9a1f..bd1f0053 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -5106,7 +5106,7 @@ function Ace2Inner(){ { return null; } - type = /([a-z]+)[0-9+]/.exec(type); + type = /([a-z]+)[0-9]+/.exec(type); if(type[1] == "indent") { return null; @@ -5115,7 +5115,7 @@ function Ace2Inner(){ //2-find the first line of the list while(lineNum-1 >= 0 && (type=getLineListType(lineNum-1))) { - type = /([a-z]+)[0-9+]/.exec(type); + type = /([a-z]+)[0-9]+/.exec(type); if(type[1] == "indent") break; lineNum--; @@ -5135,7 +5135,7 @@ function Ace2Inner(){ while(listType = getLineListType(line)) { //apply new num - listType = /([a-z]+)([0-9+])/.exec(listType); + listType = /([a-z]+)([0-9]+)/.exec(listType); curLevel = Number(listType[2]); if(isNaN(curLevel) || listType[0] == "indent") { From 73d6030762c9fc37819668826b88e087d4e5ad24 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 00:36:12 +0000 Subject: [PATCH 28/81] boop --- src/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.json b/src/package.json index 17757620..97a2dd6a 100644 --- a/src/package.json +++ b/src/package.json @@ -11,7 +11,7 @@ { "name": "Marcel Klehr" } ], "dependencies" : { - "etherpad-yajsml" : ">=0.0.1", + "etherpad-yajsml" : ">=0.0.2", "request" : ">=2.48.0", "etherpad-require-kernel" : ">=1.0.7", "resolve" : ">=1.0.0", From 63c65f784ba2b9bb3bd1f088e97f4112128d1075 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 01:45:49 +0000 Subject: [PATCH 29/81] semi working example --- src/locales/en.json | 1 + src/static/css/pad.css | 11 +++++++++++ src/static/js/chat.js | 14 ++++++++++++++ src/static/js/pad.js | 15 +++++++++++++++ src/templates/pad.html | 4 ++++ 5 files changed, 45 insertions(+) diff --git a/src/locales/en.json b/src/locales/en.json index 7f5846fd..de309ba1 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -32,6 +32,7 @@ "pad.settings.padSettings": "Pad Settings", "pad.settings.myView": "My View", "pad.settings.stickychat": "Chat always on screen", + "pad.settings.chatAndUsers": "Show Chat and Users", "pad.settings.colorcheck": "Authorship colors", "pad.settings.linenocheck": "Line numbers", "pad.settings.rtlcheck": "Read content from right to left?", diff --git a/src/static/css/pad.css b/src/static/css/pad.css index 4ba9f575..1b648206 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -914,6 +914,17 @@ input[type=checkbox] { border-left: 1px solid #ccc !important; width: 185px !important; } +.chatAndUsers{ + display:block !important; + right:0px !important; + border-radius:0px !important; + height:185px !important; + width:180px !important; +} +.chatAndUsersChat{ + top:300px !important; +} + @media screen and (max-width: 600px) { .toolbar ul li.separator { display: none; diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 4cbbbaa7..82ca15bd 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -54,6 +54,20 @@ var chat = (function() isStuck = false; } }, + chatAndUsers: function(status){ + if(status || $('#options-chatandusers').prop('checked')){ + padcookie.setPref("chatAndUsers", true); + chat.stickToScreen(true); + $('#options-stickychat').prop("disabled", "disabled"); + $('#users').addClass("chatAndUsers"); + $("#chatbox").addClass("chatAndUsersChat"); + }else{ + chat.stickToScreen(false); + $('#options-stickychat').prop("disabled", false); + $('#users').removeClass("chatAndUsers"); + $("#chatbox").removeClass("chatAndUsersChat"); + } + }, hide: function () { // decide on hide logic based on chat window being maximized or not diff --git a/src/static/js/pad.js b/src/static/js/pad.js index ff62f86c..5b173642 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -120,6 +120,7 @@ var getParameters = [ { name: "userColor", checkVal: null, callback: function(val) { settings.globalUserColor = decodeURIComponent(val); } }, { name: "rtl", checkVal: "true", callback: function(val) { settings.rtlIsTrue = true } }, { name: "alwaysShowChat", checkVal: "true", callback: function(val) { chat.stickToScreen(); } }, + { name: "chatAndUsers", checkVal: "true", callback: function(val) { chat.chatAndUsers(); } }, { name: "lang", checkVal: null, callback: function(val) { window.html10n.localize([val, 'en']); } } ]; @@ -562,6 +563,10 @@ var pad = { chat.stickToScreen(true); // stick it to the screen $('#options-stickychat').prop("checked", true); // set the checkbox to on } + if(padcookie.getPref("chatAndUsers")){ // if we have a cookie for always showing chat then show it + chat.chatAndUsers(true); // stick it to the screen + $('#options-chatandusers').prop("checked", true); // set the checkbox to on + } if(padcookie.getPref("showAuthorshipColors") == false){ pad.changeViewOption('showAuthorColors', false); } @@ -791,6 +796,16 @@ var pad = { $('#options-stickychat').prop("checked", false); // set the checkbox for off } }, + determineChatAndUsersVisibility: function(){ + var chatAUVisCookie = padcookie.getPref('chatAndUsersVisible'); + if(chatAUVisCookie){ // if the cookie is set for chat always visible + chat.chatAndUsers(true); // stick it to the screen + $('#options-chatandusers').prop("checked", true); // set the checkbox to on + } + else{ + $('#options-chatandusers').prop("checked", false); // set the checkbox for off + } + }, determineAuthorshipColorsVisibility: function(){ var authColCookie = padcookie.getPref('showAuthorshipColors'); if (authColCookie){ diff --git a/src/templates/pad.html b/src/templates/pad.html index ce1ea218..48b46c41 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -133,6 +133,10 @@

+

+ + +

From 13eff60dfea7b5ddcca15f9c4c4adab18c3e7dfe Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 02:13:34 +0000 Subject: [PATCH 30/81] mheh I suck at css 0ip would do a way better job of this --- src/static/css/pad.css | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index 1b648206..0ecf91f0 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -918,11 +918,24 @@ input[type=checkbox] { display:block !important; right:0px !important; border-radius:0px !important; - height:185px !important; - width:180px !important; + height:200px !important; + width:182px !important; + margin:2px 0 0 0 !important; + border: none !important; + border-bottom: 1px solid #ccc !important; +} +.chatAndUsersChat > div > #titlecross{ + display:none; } .chatAndUsersChat{ - top:300px !important; + bottom:0px !important; + padding:0 !important; + margin:0 !important; + right:0 !important; + top: 315px !important; + width:182px !important; + border: none !important; + padding:5px !important; } @media screen and (max-width: 600px) { From cadb83ac5af0911e722812d934d3133735d46ced Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 02:51:32 +0000 Subject: [PATCH 31/81] bumpage --- src/node/db/API.js | 11 ++++- src/node/handler/ImportHandler.js | 8 ++-- src/node/utils/ImportHtml.js | 2 +- tests/backend/specs/api/pad.js | 67 +++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 7 deletions(-) diff --git a/src/node/db/API.js b/src/node/db/API.js index a9df2a12..07127309 100644 --- a/src/node/db/API.js +++ b/src/node/db/API.js @@ -410,7 +410,16 @@ exports.setHTML = function(padID, html, callback) if(ERR(err, callback)) return; // add a new changeset with the new html to the pad - importHtml.setPadHTML(pad, cleanText(html), callback); + importHtml.setPadHTML(pad, cleanText(html), function(e){ + if(e){ + callback(new customError("HTML is malformed","apierror")); + return; + }else{ + //update the clients on the pad + padMessageHandler.updatePadClients(pad, callback); + return; + } + }); //update the clients on the pad padMessageHandler.updatePadClients(pad, callback); diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index a511637c..67698651 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -232,11 +232,9 @@ exports.doImport = function(req, res, padId) if(!directDatabaseAccess){ var fileEnding = path.extname(srcFile).toLowerCase(); if (abiword || fileEnding == ".htm" || fileEnding == ".html") { - try{ - importHtml.setPadHTML(pad, text); - }catch(e){ - apiLogger.warn("Error importing, possibly caused by malformed HTML"); - } + importHtml.setPadHTML(pad, text, function(e){ + if(e) apiLogger.warn("Error importing, possibly caused by malformed HTML"); + }); } else { pad.setText(text); } diff --git a/src/node/utils/ImportHtml.js b/src/node/utils/ImportHtml.js index 59802f9b..652e7fcc 100644 --- a/src/node/utils/ImportHtml.js +++ b/src/node/utils/ImportHtml.js @@ -40,7 +40,7 @@ function setPadHTML(pad, html, callback) cc.collectContent(doc); }catch(e){ apiLogger.warn("HTML was not properly formed", e); - return; // We don't process the HTML because it was bad.. + return callback(e); // We don't process the HTML because it was bad.. } var result = cc.finish(); diff --git a/tests/backend/specs/api/pad.js b/tests/backend/specs/api/pad.js index 52e7c917..012ce423 100644 --- a/tests/backend/specs/api/pad.js +++ b/tests/backend/specs/api/pad.js @@ -12,6 +12,7 @@ var apiVersion = 1; var testPadId = makeid(); var lastEdited = ""; var text = generateLongText(); +var ULhtml = '

  • one
  • 2

    • UL2
'; describe('Connectivity', function(){ it('errors if can not connect', function(done) { @@ -71,6 +72,9 @@ describe('Permission', function(){ -> movePad(newPadID, originalPadId) -- Should provide consistant pad data -> getText(originalPadId) -- Should be "hello world" -> getLastEdited(padID) -- Should not be 0 + -> setHTML(padID) -- Should fail on invalid HTML + -> setHTML(padID) *3 -- Should fail on invalid HTML + -> getHTML(padID) -- Should return HTML close to posted HTML */ @@ -390,6 +394,69 @@ describe('getLastEdited', function(){ }); }) + +describe('setHTML', function(){ + it('Sets the HTML of a Pad attempting to pass ugly HTML', function(done) { + var html = "
Hello HTML
"; + api.get(endPoint('setHTML')+"&padID="+testPadId+"&html="+html) + .expect(function(res){ + if(res.body.code !== 1) throw new Error("Allowing crappy HTML to be imported") + }) + .expect('Content-Type', /json/) + .expect(200, done) + }); +}) + +describe('setHTML', function(){ + it('Sets the HTML of a Pad with a bunch of weird unordered lists inserted', function(done) { + api.get(endPoint('setHTML')+"&padID=test&html="+ULhtml) + .expect(function(res){ + if(res.body.code !== 0) throw new Error("List HTML cant be imported") + }) + .expect('Content-Type', /json/) + .expect(200, done) + }); +}) + +describe('getHTML', function(){ + // will fail due to https://github.com/ether/etherpad-lite/issues/1604 + // reminder to self this is how the HTML looks + //
    + //
  • one
  • + //
  • 2
  • + //
+ //
+ //
    + //
      + //
    • UL2
    • + //
    + //
+ // It will look right in the browser but the export will get it horriby wrong + + // This is what the export puts out + //
    + //
  • one
  • + //
  • 2
  • + //
+ //
+ //
    + // NOTE THIS IS WHAT'S MISSING + //
  • UL2
  • + //
+ //
+ + it('Gets the HTML of a Pad with a bunch of weird unordered lists inserted', function(done) { + api.get(endPoint('getHTML')+"&padID=test") + .expect(function(res){ + console.log(res.body.data.html); + if(res.body.data !== ULhtml) throw new Error("Imported HTML does not match served HTML") + }) + .expect('Content-Type', /json/) + .expect(200, done) + }); +}) + + /* -> movePadForce Test From 85fffbe14ce5ca6f205434ce42b98eb4de12b6d6 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 02:57:10 +0000 Subject: [PATCH 32/81] more handling --- src/node/utils/ImportHtml.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node/utils/ImportHtml.js b/src/node/utils/ImportHtml.js index 652e7fcc..33fd91c6 100644 --- a/src/node/utils/ImportHtml.js +++ b/src/node/utils/ImportHtml.js @@ -91,6 +91,7 @@ function setPadHTML(pad, html, callback) apiLogger.debug('The changeset: ' + theChangeset); pad.setText(""); pad.appendRevision(theChangeset); + callback(null); } exports.setPadHTML = setPadHTML; From 4f637befeb449fc7e401b8a2a6624d288da86633 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 02:59:17 +0000 Subject: [PATCH 33/81] more fixing --- src/node/db/API.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/node/db/API.js b/src/node/db/API.js index 07127309..81dedcfe 100644 --- a/src/node/db/API.js +++ b/src/node/db/API.js @@ -420,10 +420,6 @@ exports.setHTML = function(padID, html, callback) return; } }); - - //update the clients on the pad - padMessageHandler.updatePadClients(pad, callback); - }); } From 7958f3b7232cd72e848b8922ac1ca7e2c0681515 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 03:02:34 +0000 Subject: [PATCH 34/81] nearly fully working --- tests/backend/specs/api/pad.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/backend/specs/api/pad.js b/tests/backend/specs/api/pad.js index 012ce423..05f6bdd1 100644 --- a/tests/backend/specs/api/pad.js +++ b/tests/backend/specs/api/pad.js @@ -394,7 +394,6 @@ describe('getLastEdited', function(){ }); }) - describe('setHTML', function(){ it('Sets the HTML of a Pad attempting to pass ugly HTML', function(done) { var html = "
Hello HTML
"; @@ -409,7 +408,7 @@ describe('setHTML', function(){ describe('setHTML', function(){ it('Sets the HTML of a Pad with a bunch of weird unordered lists inserted', function(done) { - api.get(endPoint('setHTML')+"&padID=test&html="+ULhtml) + api.get(endPoint('setHTML')+"&padID="+testPadId+"&html="+ULhtml) .expect(function(res){ if(res.body.code !== 0) throw new Error("List HTML cant be imported") }) @@ -446,9 +445,9 @@ describe('getHTML', function(){ //
it('Gets the HTML of a Pad with a bunch of weird unordered lists inserted', function(done) { - api.get(endPoint('getHTML')+"&padID=test") + api.get(endPoint('getHTML')+"&padID="+testPadId) .expect(function(res){ - console.log(res.body.data.html); + console.log("foo", res.body.data.html); if(res.body.data !== ULhtml) throw new Error("Imported HTML does not match served HTML") }) .expect('Content-Type', /json/) From 3463b16d1aab4277c24aef11fcb93c15f30b35da Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 03:04:23 +0000 Subject: [PATCH 35/81] nearly there... --- tests/backend/specs/api/pad.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/backend/specs/api/pad.js b/tests/backend/specs/api/pad.js index 05f6bdd1..49800e6f 100644 --- a/tests/backend/specs/api/pad.js +++ b/tests/backend/specs/api/pad.js @@ -433,16 +433,19 @@ describe('getHTML', function(){ // It will look right in the browser but the export will get it horriby wrong // This is what the export puts out + // //
    - //
  • one
  • - //
  • 2
  • + //
  • one
  • + //
  • 2
  • //
//
- //
    - // NOTE THIS IS WHAT'S MISSING - //
  • UL2
  • + //
      + //
        + //
      • UL2
      • + //
      //
    //
    + // it('Gets the HTML of a Pad with a bunch of weird unordered lists inserted', function(done) { api.get(endPoint('getHTML')+"&padID="+testPadId) From 3649118194f8441b84ada355f4fe432e34d14d21 Mon Sep 17 00:00:00 2001 From: Cetra Free Date: Mon, 19 Jan 2015 14:25:06 +1030 Subject: [PATCH 36/81] Update to timeslider to include base path for easier proxying --- src/static/js/timeslider.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/static/js/timeslider.js b/src/static/js/timeslider.js index b3c10b8a..9cb274be 100644 --- a/src/static/js/timeslider.js +++ b/src/static/js/timeslider.js @@ -60,10 +60,12 @@ function init() { var url = loc.protocol + "//" + loc.hostname + ":" + port + "/"; //find out in which subfolder we are var resource = exports.baseURL.substring(1) + 'socket.io'; + + console.log(exports.baseURL); //build up the socket io connection - socket = io.connect(url, {resource: resource}); - + socket = io.connect(url, {path: exports.baseURL + 'socket.io', resource: resource}); + //send the ready message once we're connected socket.on('connect', function() { From f1c9c58c2db481925e11c63fc7ac727802573530 Mon Sep 17 00:00:00 2001 From: Cetra Free Date: Mon, 19 Jan 2015 14:28:30 +1030 Subject: [PATCH 37/81] Update to timeslider to include base path for easier proxying --- src/static/js/timeslider.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/static/js/timeslider.js b/src/static/js/timeslider.js index 9cb274be..ec237df5 100644 --- a/src/static/js/timeslider.js +++ b/src/static/js/timeslider.js @@ -60,8 +60,6 @@ function init() { var url = loc.protocol + "//" + loc.hostname + ":" + port + "/"; //find out in which subfolder we are var resource = exports.baseURL.substring(1) + 'socket.io'; - - console.log(exports.baseURL); //build up the socket io connection socket = io.connect(url, {path: exports.baseURL + 'socket.io', resource: resource}); From 28aeeff154adf67e92735398a1e7625066b3133d Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Mon, 19 Jan 2015 09:28:03 +0100 Subject: [PATCH 38/81] Localisation updates from https://translatewiki.net. --- src/locales/ar.json | 12 ++++---- src/locales/az.json | 61 ++++++++++++++++++++------------------ src/locales/be-tarask.json | 3 ++ src/locales/ca.json | 9 ++++-- src/locales/cs.json | 1 + src/locales/de.json | 3 ++ src/locales/el.json | 3 ++ src/locales/es.json | 3 ++ src/locales/fa.json | 3 ++ src/locales/fi.json | 4 ++- src/locales/fr.json | 3 ++ src/locales/gl.json | 3 ++ src/locales/hu.json | 1 + src/locales/ia.json | 3 ++ src/locales/lb.json | 1 + src/locales/mk.json | 3 ++ src/locales/ms.json | 3 ++ src/locales/nap.json | 38 +++++++++++++++++++++++- src/locales/pl.json | 4 ++- src/locales/pt-br.json | 6 +++- src/locales/pt.json | 4 ++- src/locales/sv.json | 3 ++ src/locales/zh-hans.json | 5 +++- src/locales/zh-hant.json | 4 +-- 24 files changed, 138 insertions(+), 45 deletions(-) diff --git a/src/locales/ar.json b/src/locales/ar.json index b4ea58dd..b0d19fcc 100644 --- a/src/locales/ar.json +++ b/src/locales/ar.json @@ -3,7 +3,8 @@ "authors": [ "Ali1", "Tux-tn", - "Alami" + "Alami", + "Meno25" ] }, "index.newPad": "باد جديد", @@ -11,14 +12,14 @@ "pad.toolbar.bold.title": "سميك (Ctrl-B)", "pad.toolbar.italic.title": "مائل (Ctrl-I)", "pad.toolbar.underline.title": "تسطير (Ctrl-U)", - "pad.toolbar.strikethrough.title": "شطب", - "pad.toolbar.ol.title": "قائمة مرتبة", - "pad.toolbar.ul.title": "قائمة غير مرتبة", + "pad.toolbar.strikethrough.title": "شطب (Ctrl+5)", + "pad.toolbar.ol.title": "قائمة مرتبة (Ctrl+Shift+N)", + "pad.toolbar.ul.title": "قائمة غير مرتبة (Ctrl+Shift+L)", "pad.toolbar.indent.title": "إزاحة", "pad.toolbar.unindent.title": "حذف الإزاحة", "pad.toolbar.undo.title": "فك (Ctrl-Z)", "pad.toolbar.redo.title": "تكرار (Ctrl-Y)", - "pad.toolbar.clearAuthorship.title": "مسح ألوان التأليف", + "pad.toolbar.clearAuthorship.title": "مسح ألوان التأليف (Ctrl+Shift+C)", "pad.toolbar.import_export.title": "استيراد/تصدير من/إلى تنسيقات ملفات مختلفة", "pad.toolbar.timeslider.title": "متصفح التاريخ", "pad.toolbar.savedRevision.title": "حفظ المراجعة", @@ -46,6 +47,7 @@ "pad.importExport.import": "تحميل أي ملف نصي أو وثيقة", "pad.importExport.importSuccessful": "ناجح!", "pad.importExport.export": "تصدير الباد الحالي بصفة:", + "pad.importExport.exportetherpad": "إيثرباد", "pad.importExport.exporthtml": "إتش تي إم إل", "pad.importExport.exportplain": "نص عادي", "pad.importExport.exportword": "مايكروسوفت وورد", diff --git a/src/locales/az.json b/src/locales/az.json index 25a8ecc2..99d3216a 100644 --- a/src/locales/az.json +++ b/src/locales/az.json @@ -3,35 +3,36 @@ "authors": [ "AZISS", "Khan27", - "Mushviq Abdulla" + "Mushviq Abdulla", + "Wertuose" ] }, - "index.newPad": "Yeni Pad", - "index.createOpenPad": "və ya Pad-ı adı ilə yarat/aç:", + "index.newPad": "Yeni lövhə", + "index.createOpenPad": "və ya lövhəni bu adla yarat/aç:", "pad.toolbar.bold.title": "Qalın (Ctrl-B)", "pad.toolbar.italic.title": "Kursiv (Ctrl-I)", "pad.toolbar.underline.title": "Altından xətt çəkmə (Ctrl-U)", - "pad.toolbar.strikethrough.title": "Pozulma", - "pad.toolbar.ol.title": "Qaydaya salınmış siyahı", - "pad.toolbar.ul.title": "Qaydaya salınmamış siyahı", - "pad.toolbar.indent.title": "Abzas", - "pad.toolbar.unindent.title": "Çıxıntı", - "pad.toolbar.undo.title": "Geri Al (Ctrl-Z)", - "pad.toolbar.redo.title": "Qaytarmaq (Ctrl-Y)", + "pad.toolbar.strikethrough.title": "Üstdən xətləmək (Ctrl+5)", + "pad.toolbar.ol.title": "Sıralanmış siyahı (Ctrl+Shift+N)", + "pad.toolbar.ul.title": "Sırasız siyahı (Ctrl+Shift+L)", + "pad.toolbar.indent.title": "Abzas (TAB)", + "pad.toolbar.unindent.title": "Çıxıntı (Shift+TAB)", + "pad.toolbar.undo.title": "Geri qaytar (Ctrl+Z)", + "pad.toolbar.redo.title": "Qaytar (Ctrl+Y)", "pad.toolbar.clearAuthorship.title": "Müəlliflik Rənglərini Təmizlə", "pad.toolbar.import_export.title": "Müxtəlif fayl formatların(a/dan) idxal/ixrac", "pad.toolbar.timeslider.title": "Vaxt cədvəli", "pad.toolbar.savedRevision.title": "Saxlanılan Düzəlişlər", "pad.toolbar.settings.title": "Tənzimləmələr", - "pad.toolbar.embed.title": "Bu pad-ı yayımla", - "pad.toolbar.showusers.title": "Pad-da istifadəçiləri göstər", + "pad.toolbar.embed.title": "Bu lövhəni paylaş və qur", + "pad.toolbar.showusers.title": "Lövhədəki istifadəçiləri göstər", "pad.colorpicker.save": "Saxla", "pad.colorpicker.cancel": "İmtina", "pad.loading": "Yüklənir...", - "pad.passwordRequired": "Bu pad-a daxil olmaq üçün parol lazımdır", - "pad.permissionDenied": "Bu pad-a daxil olmaq üçün icazəniz yoxdur", + "pad.passwordRequired": "Bu lövhəyə daxil olmaq üçün parol lazımdır", + "pad.permissionDenied": "Bu lövhəyə daxil olmaq üçün icazəniz yoxdur", "pad.wrongPassword": "Sizin parolunuz səhvdir", - "pad.settings.padSettings": "Pad Tənzimləmələri", + "pad.settings.padSettings": "Lövhə nizamlamaları", "pad.settings.myView": "Mənim Görüntüm", "pad.settings.stickychat": "Söhbət həmişə ekranda", "pad.settings.colorcheck": "Müəlliflik rəngləri", @@ -45,18 +46,19 @@ "pad.importExport.import_export": "İdxal/İxrac", "pad.importExport.import": "Hər hansı bir mətn faylı və ya sənəd yüklə", "pad.importExport.importSuccessful": "Uğurlu!", - "pad.importExport.export": "Hazırki pad-ı ixrac etmək kimi:", + "pad.importExport.export": "Hazırkı lövhəni bu şəkildə ixrac et:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Adi mətn", "pad.importExport.exportword": "Microsoft Word", "pad.importExport.exportpdf": "PDF", - "pad.importExport.exportopen": "ODF (Açıq Sənəd Formatı)", + "pad.importExport.exportopen": "ODF (açıq sənəd formatı)", "pad.importExport.abiword.innerHTML": "Siz yalnız adi mətndən və ya HTML-dən idxal edə bilərsiniz. İdxalın daha mürəkkəb funksiyaları üçün, zəhmət olmasa,
    AbiWord-i quraşdırın.", "pad.modals.connected": "Bağlandı.", - "pad.modals.reconnecting": "Sizin pad yenidən qoşulur..", + "pad.modals.reconnecting": "Sizin lövhə yenidən qoşulur..", "pad.modals.forcereconnect": "Məcbur təkrarən bağlan", "pad.modals.userdup": "Başqa pəncərədə artıq açıqdır", - "pad.modals.userdup.explanation": "Sənəd, ola bilsin ki, bu kompyuterdə, brauzerin bir neçə pəncərəsində açılmışdır.", + "pad.modals.userdup.explanation": "Bu lövhə, ola bilsin ki, bu kompüterdəki brauzerin bir neçə pəncərəsində açılmışdır.", "pad.modals.userdup.advice": "Bu pəncərədən istifadəylə yenidən qoşulun.", "pad.modals.unauth": "İcazəli deyil", "pad.modals.unauth.explanation": "Bu səhifəyə baxdığınız vaxt sizin icazəniz dəyişilib. Bərpa etmək üşün yenidən cəhd edin.", @@ -69,22 +71,22 @@ "pad.modals.slowcommit.cause": "Bu şəbəkə bağlantısında problemlər yarana bilər.", "pad.modals.badChangeset.explanation": "Etdiyiniz bir redaktə sinxronizasiya serveri tərəfindən qeyri-leqal/qanundan kənar olaraq təsbit edildi.", "pad.modals.badChangeset.cause": "Bu, yanlış server tərtibatı ya da başqa bir gözlənilməyən davranışlar nəticəsində ola bilər. Bu sizə bir xəta imiş kimi görünürsə lütfən servis nəzarətçisi ilə əlaqə yaradın. Redaktəyə davam etmək üçün yenidən qoşulmanı yoxlayın.", - "pad.modals.corruptPad.explanation": "Əldə etməyə çalışdığınız sənəd zədəlidir.", + "pad.modals.corruptPad.explanation": "Daxil olmağa çalışdığınız lövhə zədəlidir.", "pad.modals.corruptPad.cause": "Bu, yanlış server tərtibatı ya da başqa bir gözlənilməyən davranışlardan əmələ gələ bilər. Lütfən servis nəzarətçisi ilə əlaqə yaradın.", "pad.modals.deleted": "Silindi.", - "pad.modals.deleted.explanation": "Bu pad silindi.", + "pad.modals.deleted.explanation": "Bu lövhə silindi.", "pad.modals.disconnected": "Əlaqə kəsilib.", "pad.modals.disconnected.explanation": "Serverə qoşulma itirilib", "pad.modals.disconnected.cause": "Server istifadə olunmur. Əgər problem təkrarlanacaqsa, bizə bildirin.", - "pad.share": "Bu pad-ı yayımla", + "pad.share": "Bu lövhəni paylaş", "pad.share.readonly": "Yalnız oxuyun", "pad.share.link": "Keçid", "pad.share.emebdcode": "URL-ni yayımla", "pad.chat": "Söhbət", - "pad.chat.title": "Bu pad üçün chat açın.", + "pad.chat.title": "Bu lövhə üçün çat açın.", "pad.chat.loadmessages": "Daha çox mesaj yüklə", "timeslider.pageTitle": "{{appTitle}} Vaxt cədvəli", - "timeslider.toolbar.returnbutton": "Pad-a qayıt", + "timeslider.toolbar.returnbutton": "Lövhəyə qayıt", "timeslider.toolbar.authors": "Müəlliflər:", "timeslider.toolbar.authorsList": "Müəllif yoxdur", "timeslider.toolbar.exportlink.title": "İxrac", @@ -104,18 +106,19 @@ "timeslider.month.october": "Oktyabr", "timeslider.month.november": "Noyabr", "timeslider.month.december": "Dekabr", - "timeslider.unnamedauthors": "{{num}} adsız müəlliflər", + "timeslider.unnamedauthors": "{{num}} adsız {[plural(num) one: müəllif, other: müəllif]}", "pad.savedrevs.marked": "Bu versiya indi yaddaşa saxlanmış kimi nişanlandı", - "pad.userlist.entername": "Adınızı daxil et", + "pad.userlist.entername": "Adınızı daxil edin", "pad.userlist.unnamed": "adsız", "pad.userlist.guest": "Qonaq", "pad.userlist.deny": "İnkar etmək", "pad.userlist.approve": "Təsdiqləmək", - "pad.editbar.clearcolors": "Bütün sənədlərdə müəlliflik rənglərini təmizlə?", - "pad.impexp.importbutton": "İndi idxal edin", + "pad.editbar.clearcolors": "Bütün sənədlərdə müəllif rəngləri təmizlənsin?", + "pad.impexp.importbutton": "İndi idxal et", "pad.impexp.importing": "İdxal...", - "pad.impexp.confirmimport": "Faylın idxalı cari mətni yeniləyəcək. Siz əminsinizmi ki, davam etmək istəyirsiniz?", + "pad.impexp.confirmimport": "Faylın idxalı lövhədəki cari mətni yeniləyəcək. Davam etmək istədiyinizə əminsinizmi?", "pad.impexp.convertFailed": "Biz bu fayl idxal etmək mümkün deyil idi. Xahiş olunur müxtəlif sənəddən istifadə edin və ya kopyalayıb yapışdırmaq yolundan istifadə edin", + "pad.impexp.padHasData": "Biz bu faylı idxal edə bilmədik, çünki bu lövhədə düzəlişlər edilib, lütfən yeni lövhə idxal edin", "pad.impexp.uploadFailed": "Yükləmədə səhv, xahiş olunur yenə cəhd edin", "pad.impexp.importfailed": "İdxal zamanı səhv", "pad.impexp.copypaste": "Xahiş edirik kopyalayıb yapışdırın", diff --git a/src/locales/be-tarask.json b/src/locales/be-tarask.json index 61a78539..f67d10fe 100644 --- a/src/locales/be-tarask.json +++ b/src/locales/be-tarask.json @@ -28,6 +28,7 @@ "pad.colorpicker.save": "Захаваць", "pad.colorpicker.cancel": "Скасаваць", "pad.loading": "Загрузка...", + "pad.noCookie": "Кукі ня знойдзеныя. Калі ласка, дазвольце кукі ў вашым браўзэры!", "pad.passwordRequired": "Для доступу да гэтага дакумэнта патрэбны пароль", "pad.permissionDenied": "Вы ня маеце дазволу на доступ да гэтага дакумэнта", "pad.wrongPassword": "Вы ўвялі няслушны пароль", @@ -46,6 +47,7 @@ "pad.importExport.import": "Загрузіжайце любыя тэкставыя файлы або дакумэнты", "pad.importExport.importSuccessful": "Пасьпяхова!", "pad.importExport.export": "Экспартаваць бягучы дакумэнт як:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Просты тэкст", "pad.importExport.exportword": "Microsoft Word", @@ -116,6 +118,7 @@ "pad.impexp.importing": "Імпартаваньне…", "pad.impexp.confirmimport": "Імпарт файла перазапіша цяперашні тэкст дакумэнту. Вы ўпэўненыя, што хочаце працягваць?", "pad.impexp.convertFailed": "Не атрымалася імпартаваць гэты файл. Калі ласка, выкарыстайце іншы фармат дакумэнту або скапіюйце ўручную.", + "pad.impexp.padHasData": "Мы не змаглі імпартаваць гэты файл, бо дакумэнт ужо мае зьмены, калі ласка, імпартуйце ў новы дакумэнт", "pad.impexp.uploadFailed": "Загрузка не атрымалася, калі ласка, паспрабуйце яшчэ раз", "pad.impexp.importfailed": "Памылка імпарту", "pad.impexp.copypaste": "Калі ласка, скапіюйце і ўстаўце", diff --git a/src/locales/ca.json b/src/locales/ca.json index 92da9d02..b7edc65b 100644 --- a/src/locales/ca.json +++ b/src/locales/ca.json @@ -13,9 +13,9 @@ "pad.toolbar.bold.title": "Negreta (Ctrl-B)", "pad.toolbar.italic.title": "Cursiva (Ctrl-I)", "pad.toolbar.underline.title": "Subratllat (Ctrl-U)", - "pad.toolbar.strikethrough.title": "Ratllat", - "pad.toolbar.ol.title": "Llista ordenada", - "pad.toolbar.ul.title": "Llista sense ordenar", + "pad.toolbar.strikethrough.title": "Ratllat (Ctrl+5)", + "pad.toolbar.ol.title": "Llista ordenada (Ctrl+Shift+N)", + "pad.toolbar.ul.title": "Llista sense ordenar (Ctrl+Shift+L)", "pad.toolbar.indent.title": "Sagnat (TAB)", "pad.toolbar.unindent.title": "Sagnat invers (Majúsc+TAB)", "pad.toolbar.undo.title": "Desfés (Ctrl-Z)", @@ -30,6 +30,7 @@ "pad.colorpicker.save": "Desa", "pad.colorpicker.cancel": "Cancel·la", "pad.loading": "S'està carregant...", + "pad.noCookie": "No s'ha trobat la galeta. Permeteu les galetes en el navegador!", "pad.passwordRequired": "Us cal una contrasenya per a accedir a aquest pad", "pad.permissionDenied": "No teniu permisos per a accedir a aquest pad", "pad.wrongPassword": "La contrasenya és incorrecta", @@ -48,6 +49,7 @@ "pad.importExport.import": "Puja qualsevol fitxer de text o document", "pad.importExport.importSuccessful": "Hi ha hagut èxit!", "pad.importExport.export": "Exporta el pad actual com a:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Text net", "pad.importExport.exportword": "Microsoft Word", @@ -118,6 +120,7 @@ "pad.impexp.importing": "Important...", "pad.impexp.confirmimport": "En importar un fitxer se sobreescriurà el text actual del pad. Esteu segur que voleu continuar?", "pad.impexp.convertFailed": "No és possible d'importar aquest fitxer. Si us plau, podeu provar d'utilitzar un format diferent o copiar i enganxar manualment.", + "pad.impexp.padHasData": "No vam poder importar el fitxer perquè el pad ja tenia canvis. Importeu-lo a un nou pad", "pad.impexp.uploadFailed": "Ha fallat la càrrega. Torneu-ho a provar", "pad.impexp.importfailed": "Ha fallat la importació", "pad.impexp.copypaste": "Si us plau, copieu i enganxeu", diff --git a/src/locales/cs.json b/src/locales/cs.json index 1c1357c4..2a6b5fec 100644 --- a/src/locales/cs.json +++ b/src/locales/cs.json @@ -48,6 +48,7 @@ "pad.importExport.import": "Nahrát libovolný textový soubor nebo dokument", "pad.importExport.importSuccessful": "Úspěšně!", "pad.importExport.export": "Exportovat stávající Pad jako:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Prostý text", "pad.importExport.exportword": "Microsoft Word", diff --git a/src/locales/de.json b/src/locales/de.json index f05d43c3..a2bca723 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -29,6 +29,7 @@ "pad.colorpicker.save": "Speichern", "pad.colorpicker.cancel": "Abbrechen", "pad.loading": "Laden …", + "pad.noCookie": "Das Cookie konnte nicht gefunden werden. Bitte erlaube Cookies in deinem Browser!", "pad.passwordRequired": "Sie benötigen ein Passwort, um auf dieses Pad zuzugreifen", "pad.permissionDenied": "Sie haben keine Berechtigung, um auf dieses Pad zuzugreifen", "pad.wrongPassword": "Ihr Passwort war falsch", @@ -47,6 +48,7 @@ "pad.importExport.import": "Text-Datei oder Dokument hochladen", "pad.importExport.importSuccessful": "Erfolgreich!", "pad.importExport.export": "Aktuelles Pad exportieren als:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Textdatei", "pad.importExport.exportword": "Microsoft Word", @@ -117,6 +119,7 @@ "pad.impexp.importing": "Importiere …", "pad.impexp.confirmimport": "Das Importieren einer Datei überschreibt den aktuellen Text des Pads. Wollen Sie wirklich fortfahren?", "pad.impexp.convertFailed": "Wir können diese Datei nicht importieren. Bitte verwenden Sie ein anderes Dokumentformat oder übertragen Sie den Text manuell.", + "pad.impexp.padHasData": "Wir konnten diese Datei nicht importieren, da dieses Pad bereits Änderungen hat. Bitte importiere zu einem neuen Pad.", "pad.impexp.uploadFailed": "Der Upload ist fehlgeschlagen. Bitte versuchen Sie es erneut.", "pad.impexp.importfailed": "Import fehlgeschlagen", "pad.impexp.copypaste": "Bitte kopieren und einfügen", diff --git a/src/locales/el.json b/src/locales/el.json index f20e1e87..740da95c 100644 --- a/src/locales/el.json +++ b/src/locales/el.json @@ -30,6 +30,7 @@ "pad.colorpicker.save": "Αποθήκευση", "pad.colorpicker.cancel": "Άκυρο", "pad.loading": "Φόρτωση...", + "pad.noCookie": "Το cookie δεν βρέθηκε. Παρακαλώ επιτρέψτε τα cookies στον περιηγητή σας!", "pad.passwordRequired": "Χρειάζεστε κωδικό πρόσβασης για πρόσβαση σε αυτό το pad", "pad.permissionDenied": "Δεν έχετε δικαίωμα πρόσβασης σε αυτό το pad", "pad.wrongPassword": "Ο κωδικός σας ήταν λανθασμένος", @@ -48,6 +49,7 @@ "pad.importExport.import": "Αποστολή οποιουδήποτε αρχείου κειμένου ή εγγράφου", "pad.importExport.importSuccessful": "Επιτυχής!", "pad.importExport.export": "Εξαγωγή τρέχοντος pad ως:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Απλό κείμενο", "pad.importExport.exportword": "Microsoft Word", @@ -118,6 +120,7 @@ "pad.impexp.importing": "Εισάγεται...", "pad.impexp.confirmimport": "Η εισαγωγή ενός αρχείου θα αντικαταστήσει το κείμενο του pad. Είστε βέβαιοι ότι θέλετε να συνεχίσετε;", "pad.impexp.convertFailed": "Δεν καταφέραμε να εισάγουμε αυτό το αρχείο. Παρακαλώ χρησιμοποιήστε διαφορετικό τύπο αρχείου ή αντιγράψτε και επικολλήστε χειροκίνητα", + "pad.impexp.padHasData": "Δεν μπορέσαμε να εισάγουμε το αρχείο επειδή το Pad είχε ήδη αλλαγές. Παρακαλούμε εισαγάγετε το αρχείο σε νέο pad", "pad.impexp.uploadFailed": "Η αποστολή απέτυχε, παρακαλώ προσπαθήστε ξανά", "pad.impexp.importfailed": "Η εισαγωγή απέτυχε", "pad.impexp.copypaste": "Παρακαλώ αντιγράψτε και επικολλήστε", diff --git a/src/locales/es.json b/src/locales/es.json index df9a415e..5547d327 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -35,6 +35,7 @@ "pad.colorpicker.save": "Guardar", "pad.colorpicker.cancel": "Cancelar", "pad.loading": "Cargando...", + "pad.noCookie": "La cookie no se pudo encontrar. ¡Por favor, habilita las cookies en tu navegador!", "pad.passwordRequired": "Necesitas una contraseña para acceder a este pad", "pad.permissionDenied": "No tienes permiso para acceder a este pad", "pad.wrongPassword": "La contraseña era incorrecta", @@ -53,6 +54,7 @@ "pad.importExport.import": "Subir cualquier texto o documento", "pad.importExport.importSuccessful": "¡Éxito!", "pad.importExport.export": "Exporta el pad actual como:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Texto plano", "pad.importExport.exportword": "Microsoft Word", @@ -123,6 +125,7 @@ "pad.impexp.importing": "Importando...", "pad.impexp.confirmimport": "Al importar un archivo se borrará el contenido actual del pad. ¿Estás seguro de que quieres continuar?", "pad.impexp.convertFailed": "No pudimos importar este archivo. Inténtalo con un formato diferente o copia y pega manualmente.", + "pad.impexp.padHasData": "No hemos podido importar este archivo porque esta almohadilla ya ha tenido cambios, por favor, importa a una nueva almohadilla", "pad.impexp.uploadFailed": "El envío falló. Intentalo de nuevo.", "pad.impexp.importfailed": "Fallo al importar", "pad.impexp.copypaste": "Intenta copiar y pegar", diff --git a/src/locales/fa.json b/src/locales/fa.json index 94f2d69f..53fb55b2 100644 --- a/src/locales/fa.json +++ b/src/locales/fa.json @@ -31,6 +31,7 @@ "pad.colorpicker.save": "ذخیره", "pad.colorpicker.cancel": "لغو", "pad.loading": "در حال بارگذاری...", + "pad.noCookie": "کوکی یافت نشد. لطفاً اجازهٔ اجرای کوکی در مروگرتان را بدهید!", "pad.passwordRequired": "برای دسترسی به این دفترچه یادداشت نیاز به یک گذرواژه دارید", "pad.permissionDenied": "شما اجازه‌ی دسترسی به این دفترچه یادداشت را ندارید", "pad.wrongPassword": "گذرواژه‌ی شما درست نیست", @@ -49,6 +50,7 @@ "pad.importExport.import": "بارگذاری پرونده‌ی متنی یا سند", "pad.importExport.importSuccessful": "موفقیت آمیز بود!", "pad.importExport.export": "برون‌ریزی این دفترچه یادداشت با قالب:", + "pad.importExport.exportetherpad": "اترپد", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "متن ساده", "pad.importExport.exportword": "Microsoft Word", @@ -119,6 +121,7 @@ "pad.impexp.importing": "در حال درون‌ریزی...", "pad.impexp.confirmimport": "با درون‌ریزی یک پرونده نوشتهٔ کنونی دفترچه پاک می‌شود. آیا می‌خواهید ادامه دهید؟", "pad.impexp.convertFailed": "ما نمی‌توانیم این پرونده را درون‌ریزی کنیم. خواهشمندیم قالب دیگری برای سندتان انتخاب کرده یا بصورت دستی آنرا کپی کنید", + "pad.impexp.padHasData": "امکان درون‌ریز این پرونده نیست زیرا این پد تغییر کرده‌است. لطفاً در پد جدید درون‌ریزی کنید.", "pad.impexp.uploadFailed": "آپلود انجام نشد، دوباره تلاش کنید", "pad.impexp.importfailed": "درون‌ریزی انجام نشد", "pad.impexp.copypaste": "کپی پیست کنید", diff --git a/src/locales/fi.json b/src/locales/fi.json index ee1775dc..25e4d084 100644 --- a/src/locales/fi.json +++ b/src/locales/fi.json @@ -10,7 +10,8 @@ "Tomi Toivio", "Veikk0.ma", "VezonThunder", - "Macofe" + "Macofe", + "MrTapsa" ] }, "index.newPad": "Uusi muistio", @@ -35,6 +36,7 @@ "pad.colorpicker.save": "Tallenna", "pad.colorpicker.cancel": "Peru", "pad.loading": "Ladataan…", + "pad.noCookie": "Evästettä ei löytynyt. Ole hyvä, ja salli evästeet selaimessasi!", "pad.passwordRequired": "Tämä muistio on suojattu salasanalla.", "pad.permissionDenied": "Käyttöoikeutesi eivät riitä tämän muistion käyttämiseen.", "pad.wrongPassword": "Väärä salasana", diff --git a/src/locales/fr.json b/src/locales/fr.json index 921d1eeb..92fcb193 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -43,6 +43,7 @@ "pad.colorpicker.save": "Enregistrer", "pad.colorpicker.cancel": "Annuler", "pad.loading": "Chargement…", + "pad.noCookie": "Le cookie n’a pas pu être trouvé. Veuillez autoriser les cookies dans votre navigateur !", "pad.passwordRequired": "Vous avez besoin d'un mot de passe pour accéder à ce pad", "pad.permissionDenied": "Il ne vous est pas permis d’accéder à ce pad", "pad.wrongPassword": "Votre mot de passe est incorrect", @@ -61,6 +62,7 @@ "pad.importExport.import": "Charger un texte ou un document", "pad.importExport.importSuccessful": "Réussi !", "pad.importExport.export": "Exporter le pad actuel comme :", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Texte brut", "pad.importExport.exportword": "Microsoft Word", @@ -131,6 +133,7 @@ "pad.impexp.importing": "Import en cours...", "pad.impexp.confirmimport": "Importer un fichier écrasera le texte actuel du pad. Êtes-vous sûr de vouloir le faire ?", "pad.impexp.convertFailed": "Nous ne pouvons pas importer ce fichier. Veuillez utiliser un autre format de document ou faire un copier/coller manuel", + "pad.impexp.padHasData": "Nous n’avons pas pu importer ce fichier parce que ce bloc a déjà eu des modifications ; veuillez importer vers un nouveau bloc", "pad.impexp.uploadFailed": "Le téléchargement a échoué, veuillez réessayer", "pad.impexp.importfailed": "Échec de l'importation", "pad.impexp.copypaste": "Veuillez copier/coller", diff --git a/src/locales/gl.json b/src/locales/gl.json index a14fbb12..b0ca6532 100644 --- a/src/locales/gl.json +++ b/src/locales/gl.json @@ -27,6 +27,7 @@ "pad.colorpicker.save": "Gardar", "pad.colorpicker.cancel": "Cancelar", "pad.loading": "Cargando...", + "pad.noCookie": "A cookie non se puido atopar. Por favor, habilite as cookies no seu navegador!", "pad.passwordRequired": "Cómpre un contrasinal para acceder a este documento", "pad.permissionDenied": "Non ten permiso para acceder a este documento", "pad.wrongPassword": "O contrasinal era incorrecto", @@ -45,6 +46,7 @@ "pad.importExport.import": "Cargar un ficheiro de texto ou documento", "pad.importExport.importSuccessful": "Correcto!", "pad.importExport.export": "Exportar o documento actual en formato:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Texto simple", "pad.importExport.exportword": "Microsoft Word", @@ -115,6 +117,7 @@ "pad.impexp.importing": "Importando...", "pad.impexp.confirmimport": "A importación dun ficheiro ha sobrescribir o texto actual do documento. Está seguro de querer continuar?", "pad.impexp.convertFailed": "Non somos capaces de importar o ficheiro. Utilice un formato de documento diferente ou copie e pegue manualmente", + "pad.impexp.padHasData": "Non puidemos importar este ficheiro porque este Pad xa tivo cambios, por favor, importe a un novo pad.", "pad.impexp.uploadFailed": "Houbo un erro ao cargar o ficheiro; inténteo de novo", "pad.impexp.importfailed": "Fallou a importación", "pad.impexp.copypaste": "Copie e pegue", diff --git a/src/locales/hu.json b/src/locales/hu.json index 7efac2df..3102790d 100644 --- a/src/locales/hu.json +++ b/src/locales/hu.json @@ -118,6 +118,7 @@ "pad.impexp.importing": "Importálás…", "pad.impexp.confirmimport": "Egy fájl importálása felülírja a jelenlegi szöveget a noteszben. Biztos hogy folytatod?", "pad.impexp.convertFailed": "Nem tudtuk importálni ezt a fájlt. Kérjük, használj másik dokumentum formátumot, vagy kézzel másold és illeszd be a tartalmat", + "pad.impexp.padHasData": "Nem tudjuk importálni ezt a fájlt, mert ez a Pad már megváltozott, kérjük, importálj egy új padra", "pad.impexp.uploadFailed": "A feltöltés sikertelen, próbáld meg újra", "pad.impexp.importfailed": "Az importálás nem sikerült", "pad.impexp.copypaste": "Kérjük másold be", diff --git a/src/locales/ia.json b/src/locales/ia.json index 50a0690c..e7f5cc2b 100644 --- a/src/locales/ia.json +++ b/src/locales/ia.json @@ -26,6 +26,7 @@ "pad.colorpicker.save": "Salveguardar", "pad.colorpicker.cancel": "Cancellar", "pad.loading": "Cargamento…", + "pad.noCookie": "Le cookie non pote esser trovate. Per favor permitte le cookies in tu navigator!", "pad.passwordRequired": "Un contrasigno es necessari pro acceder a iste pad", "pad.permissionDenied": "Tu non ha le permission de acceder a iste pad", "pad.wrongPassword": "Le contrasigno es incorrecte", @@ -44,6 +45,7 @@ "pad.importExport.import": "Incargar qualcunque file de texto o documento", "pad.importExport.importSuccessful": "Succedite!", "pad.importExport.export": "Exportar le pad actual como:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Texto simple", "pad.importExport.exportword": "Microsoft Word", @@ -114,6 +116,7 @@ "pad.impexp.importing": "Importation in curso…", "pad.impexp.confirmimport": "Le importation de un file superscribera le texto actual del pad. Es tu secur de voler continuar?", "pad.impexp.convertFailed": "Nos non ha potite importar iste file. Per favor usa un altere formato de documento o copia e colla le texto manualmente.", + "pad.impexp.padHasData": "Nos non ha potite importar iste file perque iste Pad ha jam habite cambiamentos. Per favor importa lo a un nove pad.", "pad.impexp.uploadFailed": "Le incargamento ha fallite. Per favor reproba.", "pad.impexp.importfailed": "Importation fallite", "pad.impexp.copypaste": "Per favor copia e colla", diff --git a/src/locales/lb.json b/src/locales/lb.json index 841add75..68bdb418 100644 --- a/src/locales/lb.json +++ b/src/locales/lb.json @@ -15,6 +15,7 @@ "pad.colorpicker.save": "Späicheren", "pad.colorpicker.cancel": "Ofbriechen", "pad.loading": "Lueden...", + "pad.noCookie": "Cookie gouf net fonnt. Erlaabt w.e.g. Cookien an Ärem Browser!", "pad.wrongPassword": "Äert Passwuert ass falsch", "pad.settings.fontType.normal": "Normal", "pad.settings.language": "Sprooch:", diff --git a/src/locales/mk.json b/src/locales/mk.json index fc18533f..9fc6b817 100644 --- a/src/locales/mk.json +++ b/src/locales/mk.json @@ -27,6 +27,7 @@ "pad.colorpicker.save": "Зачувај", "pad.colorpicker.cancel": "Откажи", "pad.loading": "Вчитувам...", + "pad.noCookie": "Не можев да го најдам колачето. Овозможете колачиња во вашиот прелистувач!", "pad.passwordRequired": "Потребна е лозинка за пристап", "pad.permissionDenied": "За овде не е потребна дозвола за пристап", "pad.wrongPassword": "Погрешна лозинка", @@ -45,6 +46,7 @@ "pad.importExport.import": "Подигање на било каква текстуална податотека или документ", "pad.importExport.importSuccessful": "Успешно!", "pad.importExport.export": "Извези ја тековната тетратка како", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Прост текст", "pad.importExport.exportword": "Microsoft Word", @@ -115,6 +117,7 @@ "pad.impexp.importing": "Увезувам...", "pad.impexp.confirmimport": "Увезувајќи ја податотеката ќе го замените целиот досегашен текст во тетратката. Дали сте сигурни дека сакате да продолжите?", "pad.impexp.convertFailed": "Не можев да ја увезам податотеката. Послужете се со поинаков формат или прекопирајте го текстот рачно.", + "pad.impexp.padHasData": "Не можевме да ја увеземе оваа податотека бидејќи оваа тетратка веќе има промени. Увезете ја во нова тетратка.", "pad.impexp.uploadFailed": "Подигањето не успеа. Обидете се повторно.", "pad.impexp.importfailed": "Увозот не успеа", "pad.impexp.copypaste": "Прекопирајте", diff --git a/src/locales/ms.json b/src/locales/ms.json index cf15be6e..d099de06 100644 --- a/src/locales/ms.json +++ b/src/locales/ms.json @@ -26,6 +26,7 @@ "pad.colorpicker.save": "Simpan", "pad.colorpicker.cancel": "Batalkan", "pad.loading": "Sedang dimuatkan...", + "pad.noCookie": "Cookie tidak dapat dijumpai. Tolong benarkan cookie dalam pelayar anda!", "pad.passwordRequired": "Anda memerlukan kata laluan untuk mengakses pad ini", "pad.permissionDenied": "Anda tiada kebenaran untuk mengakses pad ini", "pad.wrongPassword": "Kata laluan anda salah", @@ -44,6 +45,7 @@ "pad.importExport.import": "Muat naik sebarang fail teks atau dokumen", "pad.importExport.importSuccessful": "Berjaya!", "pad.importExport.export": "Eksport pad semasa sebagai:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Teks biasa", "pad.importExport.exportword": "Microsoft Word", @@ -114,6 +116,7 @@ "pad.impexp.importing": "Sedang mengimport...", "pad.impexp.confirmimport": "Mengimport fail akan menulis ganti teks semasa pada pad ini. Adakah anda benar-benar ingin teruskan?", "pad.impexp.convertFailed": "Fail tidak dapat diimport. Sila gunakan format dokumen yang lain atau salin tampal secara manual", + "pad.impexp.padHasData": "Kami tidak dapat mengimport fail ini kerana Pad ini sudah mengalami perubahan. Sila import ke pad yang baru", "pad.impexp.uploadFailed": "Muat naik gagal, sila cuba lagi", "pad.impexp.importfailed": "Import gagal", "pad.impexp.copypaste": "Sila salin tampal", diff --git a/src/locales/nap.json b/src/locales/nap.json index ffc7b740..6cd1651b 100644 --- a/src/locales/nap.json +++ b/src/locales/nap.json @@ -1,7 +1,8 @@ { "@metadata": { "authors": [ - "Chelin" + "Chelin", + "C.R." ] }, "index.newPad": "Novo Pad", @@ -21,23 +22,58 @@ "pad.toolbar.timeslider.title": "Presentazzione cronologgia", "pad.toolbar.savedRevision.title": "Sarva revisione", "pad.toolbar.settings.title": "Mpustaziune", + "pad.toolbar.embed.title": "Sparte e nzerta stu Pad", + "pad.toolbar.showusers.title": "Mmusta ll'utente ncopp'a stu Pad", "pad.colorpicker.save": "Sarva", "pad.colorpicker.cancel": "Canciella", "pad.loading": "Carecamiento 'n curso…", + "pad.noCookie": "Cookie nun truvata. Pe' piacere premmettete 'e cookies dint' 'o navigatóre vuosto!", "pad.passwordRequired": "Pe' accede a chisto Pad è necessaria 'na password", "pad.permissionDenied": "Nun se dispunne d\"e permisse necessare pe' accede a chisto Pad", "pad.wrongPassword": "'A password è sbagliata", "pad.settings.padSettings": "Mpostazzione d\"o pad", + "pad.settings.myView": "Mia Veruta", + "pad.settings.stickychat": "Chat sempe ncopp' 'o schermo", + "pad.settings.colorcheck": "Auturevolezza pe' culure", + "pad.settings.linenocheck": "Nummere 'e riga", + "pad.settings.rtlcheck": "Lieggere 'e cuntenute 'a destra a smerza?", + "pad.settings.fontType": "Tipo 'e funte:", "pad.settings.fontType.normal": "Nurmale", + "pad.settings.fontType.monospaced": "Monospace", + "pad.settings.globalView": "Visualizzazione globbale", + "pad.settings.language": "Llengua:", + "pad.importExport.import_export": "Mpurtaziune/sportaziune", + "pad.importExport.import": "Carreca coccherunto testo o documento", + "pad.importExport.importSuccessful": "Ngarrata!", + "pad.importExport.export": "Sportà stu Pad comme:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", + "pad.importExport.exportplain": "Testo nurmale", + "pad.importExport.exportword": "Microsoft Word", "pad.importExport.exportpdf": "PDF", "pad.importExport.exportopen": "ODF (Open Document Format)", + "pad.importExport.abiword.innerHTML": "Putite surtanto mpurtà testo chiano o furmatte HTML. Pe n'avé sisteme cchiù annanze 'e mpurtazione pe' piacere installate Abiword.", "pad.modals.connected": "Cunnesso.", "pad.modals.reconnecting": "Ricunnessione ô pad 'n curso...", "pad.modals.forcereconnect": "Forza 'a ricunnessione", "pad.modals.userdup": "Aprito 'n n'ata fenesta", + "pad.modals.userdup.explanation": "Stu Pad pare fosse araputo dint'a cchiù 'e na fenesta 'e navigatore dint'a stu computer.", + "pad.modals.userdup.advice": "Riconnettateve pe' putè ausà mmece sta fenesta.", "pad.modals.unauth": "Nun autorizzato", + "pad.modals.unauth.explanation": "'E premmesse vuoste so' cagnate pe' tramente ca se vereva sta paggena. Tentate 'e ve riconnettà.", + "pad.modals.looping.explanation": "Ce stanno probbleme 'e comunicazione c' 'o server 'e sincronizzaziona.", + "pad.modals.looping.cause": "Può darse ca ve site cullegato pe' mmiez' 'e nu firewall incompatibbele o proxy.", + "pad.modals.initsocketfail": "Nun se può arrevà 'o server.", + "pad.modals.initsocketfail.explanation": "Nun se può cunnettà 'o server e sincronizzaziona.", + "pad.modals.initsocketfail.cause": "Stu fatto è succiesso, probabbilmente pe' bbìa 'e nu probblema c' 'o navigatóre 'o ll'internet.", + "pad.modals.slowcommit.explanation": "'O server nun risponne.", + "pad.modals.slowcommit.cause": "Stu fatto può darse ca è causato pe' bbìa 'e prubbleme 'e connettività 'e rezza.", + "pad.modals.badChangeset.explanation": "Nu cagnamento ca stavate facenno è stato classeficato comme illegale p' 'o server 'e sincronizzaziona.", + "pad.modals.badChangeset.cause": "Chistu fatto può darse ca è causato pe' bbìa 'e na mpustazione errata d' 'o server o cocch'atu comportamento nun preveduto. Pe' piacere cuntattate l'ammenistratore d' 'o servizio, si se pienza ca chist'è n'errore. Tentate a ve riconnettà pe' cuntinuà 'a edità.", + "pad.modals.corruptPad.explanation": "'O pad addò vulevate trasì è scassato.", "pad.modals.deleted": "Canciellato.", + "pad.share.link": "Jonta", + "pad.chat": "Chiàcchiera", "timeslider.pageTitle": "Cronologgia {{appTitle}}", "timeslider.toolbar.returnbutton": "Ritorna ô Pad", "timeslider.toolbar.authors": "Auture:", diff --git a/src/locales/pl.json b/src/locales/pl.json index 7e68ca84..bcd7a0ef 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -5,7 +5,8 @@ "Ty221", "WTM", "Woytecr", - "Macofe" + "Macofe", + "Pan Cube" ] }, "index.newPad": "Nowy dokument", @@ -48,6 +49,7 @@ "pad.importExport.import": "Prześlij dowolny plik tekstowy lub dokument", "pad.importExport.importSuccessful": "Sukces!", "pad.importExport.export": "Eksportuj bieżący dokument jako:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Zwykły tekst", "pad.importExport.exportword": "Microsoft Word", diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json index 204d7792..e8eb79ee 100644 --- a/src/locales/pt-br.json +++ b/src/locales/pt-br.json @@ -10,7 +10,8 @@ "Rafaelff", "Dianakc", "Macofe", - "Rodrigo codignoli" + "Rodrigo codignoli", + "Webysther" ] }, "index.newPad": "Nova Nota", @@ -35,6 +36,7 @@ "pad.colorpicker.save": "Salvar", "pad.colorpicker.cancel": "Cancelar", "pad.loading": "Carregando...", + "pad.noCookie": "Cookie não foi encontrado. Por favor, habilite cookies no seu navegador!", "pad.passwordRequired": "Você precisa de uma senha para acessar esta Nota", "pad.permissionDenied": "Você não tem permissão para acessar esta Nota", "pad.wrongPassword": "Senha incorreta", @@ -53,6 +55,7 @@ "pad.importExport.import": "Enviar um arquivo texto ou documento", "pad.importExport.importSuccessful": "Completo!", "pad.importExport.export": "Exportar a presente nota como:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Texto puro", "pad.importExport.exportword": "Microsoft Word", @@ -123,6 +126,7 @@ "pad.impexp.importing": "Importando...", "pad.impexp.confirmimport": "Importar um arquivo sobrescreverá o atual texto da nota. Tem certeza de que deseja prosseguir?", "pad.impexp.convertFailed": "Não foi possível importar este arquivo. Use outro formato ou copie e cole manualmente", + "pad.impexp.padHasData": "Não foi possível importar este arquivo porque este bloco de notas já tinha alterações, consulte como importar para um novo bloco de notas", "pad.impexp.uploadFailed": "O envio falhou. Tente outra vez", "pad.impexp.importfailed": "A importação falhou", "pad.impexp.copypaste": "Copie e cole", diff --git a/src/locales/pt.json b/src/locales/pt.json index c7cfcb5c..473980fd 100644 --- a/src/locales/pt.json +++ b/src/locales/pt.json @@ -6,7 +6,8 @@ "Tuliouel", "Waldir", "Imperadeiro98", - "Macofe" + "Macofe", + "Ti4goc" ] }, "index.newPad": "Nova Nota", @@ -105,6 +106,7 @@ "pad.impexp.importbutton": "Importar agora", "pad.impexp.importing": "Importando...", "pad.impexp.confirmimport": "A importação de um ficheiro irá substituir o texto atual do pad. Tem certeza que deseja continuar?", + "pad.impexp.padHasData": "Não fomos capazes de importar este ficheiro porque esta Almofada já tinha alterações, consulte importar para um novo bloco", "pad.impexp.uploadFailed": "O upload falhou. Por favor, tente novamente", "pad.impexp.importfailed": "A importação falhou", "pad.impexp.copypaste": "Por favor, copie e cole" diff --git a/src/locales/sv.json b/src/locales/sv.json index bda3cb83..a53146bf 100644 --- a/src/locales/sv.json +++ b/src/locales/sv.json @@ -28,6 +28,7 @@ "pad.colorpicker.save": "Spara", "pad.colorpicker.cancel": "Avbryt", "pad.loading": "Läser in...", + "pad.noCookie": "Kunde inte hitta några kakor. Var god tillåt kakor i din webbläsare!", "pad.passwordRequired": "Du behöver ett lösenord för att få tillgång till detta block", "pad.permissionDenied": "Du har inte åtkomstbehörighet för detta block", "pad.wrongPassword": "Ditt lösenord var fel", @@ -46,6 +47,7 @@ "pad.importExport.import": "Ladda upp textfiler eller dokument", "pad.importExport.importSuccessful": "Åtgärden slutfördes!", "pad.importExport.export": "Export aktuellt block som:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Oformaterad text", "pad.importExport.exportword": "Microsoft Word", @@ -116,6 +118,7 @@ "pad.impexp.importing": "Importerar...", "pad.impexp.confirmimport": "Att importera en fil kommer att skriva över den aktuella texten i blocket. Är du säker på att du vill fortsätta?", "pad.impexp.convertFailed": "Vi kunde inte importera denna fil. Var god använd ett annat dokumentformat eller kopiera och klistra in den manuellt", + "pad.impexp.padHasData": "Vi kunde inte importera denna fil eftersom detta block redan har redigerats. Importera den till ett nytt block.", "pad.impexp.uploadFailed": "Uppladdningen misslyckades, var god försök igen", "pad.impexp.importfailed": "Importering misslyckades", "pad.impexp.copypaste": "Var god kopiera och klistra in", diff --git a/src/locales/zh-hans.json b/src/locales/zh-hans.json index 104e850b..bc1c97b5 100644 --- a/src/locales/zh-hans.json +++ b/src/locales/zh-hans.json @@ -24,7 +24,7 @@ "pad.toolbar.indent.title": "增加缩进(TAB)", "pad.toolbar.unindent.title": "减少缩进(Shift+TAB)", "pad.toolbar.undo.title": "撤消 (Ctrl-Z)", - "pad.toolbar.redo.title": "重做 (Ctrl-Y)", + "pad.toolbar.redo.title": "重做(Ctrl+Y)", "pad.toolbar.clearAuthorship.title": "清除作者颜色(Ctrl+Shift+C)", "pad.toolbar.import_export.title": "从不同的文件格式导入/导出", "pad.toolbar.timeslider.title": "时间轴", @@ -35,6 +35,7 @@ "pad.colorpicker.save": "保存", "pad.colorpicker.cancel": "取消", "pad.loading": "载入中……", + "pad.noCookie": "无法找到Cookie。请在您的浏览器中允许Cookie!", "pad.passwordRequired": "您需要密码才能访问这个记事本", "pad.permissionDenied": "您没有访问这个记事本的权限", "pad.wrongPassword": "您的密码错了", @@ -53,6 +54,7 @@ "pad.importExport.import": "上载任何文本文件或档案", "pad.importExport.importSuccessful": "成功!", "pad.importExport.export": "当前记事本导出为:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "纯文本", "pad.importExport.exportword": "Microsoft Word", @@ -123,6 +125,7 @@ "pad.impexp.importing": "正在导入...", "pad.impexp.confirmimport": "导入的文件将覆盖记事本的当前文本。你确定要继续吗?", "pad.impexp.convertFailed": "我们无法导入此文档。请使用他文档格式或手动复制贴上。", + "pad.impexp.padHasData": "我们无法导入此文件,因为此记事本已经变更,请导入到一个新的记事本", "pad.impexp.uploadFailed": "上载失败,请重试", "pad.impexp.importfailed": "导入失败", "pad.impexp.copypaste": "请复制粘贴", diff --git a/src/locales/zh-hant.json b/src/locales/zh-hant.json index 6d79268c..a692d0ca 100644 --- a/src/locales/zh-hant.json +++ b/src/locales/zh-hant.json @@ -96,13 +96,13 @@ "timeslider.saved": "{{year}}年{{month}}{{day}}日儲存", "timeslider.dateformat": "{{year}}年{{month}}月{{day}}日 {{hours}}:{{minutes}}:{{seconds}}", "timeslider.month.january": "1月", - "timeslider.month.february": "2月", + "timeslider.month.february": "二月", "timeslider.month.march": "3月", "timeslider.month.april": "4月", "timeslider.month.may": "5月", "timeslider.month.june": "6月", "timeslider.month.july": "7月", - "timeslider.month.august": "8月", + "timeslider.month.august": "八月", "timeslider.month.september": "9月", "timeslider.month.october": "10月", "timeslider.month.november": "11月", From 44d1d6cc13e1742fd6424e8ecb9cb914ae2e0b83 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 14:32:58 +0000 Subject: [PATCH 39/81] fix ie editing --- src/static/js/domline.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/domline.js b/src/static/js/domline.js index b1927b16..b8e6eb14 100644 --- a/src/static/js/domline.js +++ b/src/static/js/domline.js @@ -225,7 +225,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) { newHTML += ' '; } - else if (!browser.msie) + else { newHTML += '
    '; } From ab71bc7c205e6944fcdc46b09cb8e603c433540e Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 14:45:49 +0000 Subject: [PATCH 40/81] hrm --- src/static/js/ace2_inner.js | 7 +++++-- src/static/js/contentcollector.js | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index bd1f0053..ebc03ca4 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -1605,7 +1605,7 @@ function Ace2Inner(){ if (linesWrapped > 0) { - if(!browser.ie){ + if(!browser.msie){ // chrome decides in it's infinite wisdom that its okay to put the browsers visisble window in the middle of the span // an outcome of this is that the first chars of the string are no longer visible to the user.. Yay chrome.. // Move the browsers visible area to the left hand side of the span @@ -2905,6 +2905,7 @@ function Ace2Inner(){ { if (browser.msie && (!nonEmpty)) { +top.console.log("here"); var result = { node: null, appendSpan: noop, @@ -3583,6 +3584,7 @@ function Ace2Inner(){ // On Mac and Linux, move right moves to end of word and move left moves to start; // on Windows, always move to start of word. // On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no). + /* if (browser.windows && forwardNotBack) { while ((!isDone()) && isWordChar(nextChar())) @@ -3605,6 +3607,7 @@ function Ace2Inner(){ advance(); } } + */ return i; } @@ -4867,7 +4870,7 @@ function Ace2Inner(){ }) // CompositionEvent is not implemented below IE version 8 - if ( !(browser.msie && browser.version < 9) && document.documentElement) + if ( !(browser.msie && parseInt(browser.version) < 9) && document.documentElement) { $(document.documentElement).on("compositionstart", handleCompositionEvent); $(document.documentElement).on("compositionend", handleCompositionEvent); diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index b7b3c568..1759d865 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -625,13 +625,11 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class _ensureColumnZero(state); } } - if (browser.msie) { // in IE, a point immediately after a DIV appears on the next line _reachBlockPoint(node, 1, state); } - state.localAttribs = localAttribs; }; // can pass a falsy value for end of doc From c315defc3124b44e9c5300e93952f124f7e1d82f Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 15:15:52 +0000 Subject: [PATCH 41/81] temp bodge fix --- src/static/js/ace2_inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index ebc03ca4..5204e2a1 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -1910,6 +1910,7 @@ function Ace2Inner(){ if (charsLeft === 0) { var index = 0; + browser.msie = false; // Temp fix to resolve enter and backspace issues.. if (browser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0) { // best to stay at end of last empty div in IE @@ -2905,7 +2906,6 @@ function Ace2Inner(){ { if (browser.msie && (!nonEmpty)) { -top.console.log("here"); var result = { node: null, appendSpan: noop, From 5967e085b7bc7efe8ab9ab1be8c728763b3f876a Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 15:37:29 +0000 Subject: [PATCH 42/81] fix ul tests --- tests/backend/specs/api/pad.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/backend/specs/api/pad.js b/tests/backend/specs/api/pad.js index 49800e6f..3527f95a 100644 --- a/tests/backend/specs/api/pad.js +++ b/tests/backend/specs/api/pad.js @@ -12,7 +12,7 @@ var apiVersion = 1; var testPadId = makeid(); var lastEdited = ""; var text = generateLongText(); -var ULhtml = '
    • one
    • 2

      • UL2
    '; +var ULhtml = '
    • one
    • 2

      • UL2
    '; describe('Connectivity', function(){ it('errors if can not connect', function(done) { @@ -450,8 +450,9 @@ describe('getHTML', function(){ it('Gets the HTML of a Pad with a bunch of weird unordered lists inserted', function(done) { api.get(endPoint('getHTML')+"&padID="+testPadId) .expect(function(res){ - console.log("foo", res.body.data.html); - if(res.body.data !== ULhtml) throw new Error("Imported HTML does not match served HTML") + var ehtml = res.body.data.html.replace("
    ", "").toLowerCase(); + var uhtml = ULhtml.toLowerCase(); + if(ehtml !== uhtml) throw new Error("Imported HTML does not match served HTML") }) .expect('Content-Type', /json/) .expect(200, done) From 860c584b425b88ba504e4cbe50c2420a375987aa Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 19 Jan 2015 15:44:16 +0000 Subject: [PATCH 43/81] remove pointless comments --- tests/backend/specs/api/pad.js | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/tests/backend/specs/api/pad.js b/tests/backend/specs/api/pad.js index 3527f95a..6010a11c 100644 --- a/tests/backend/specs/api/pad.js +++ b/tests/backend/specs/api/pad.js @@ -399,6 +399,7 @@ describe('setHTML', function(){ var html = "
    Hello HTML
    "; api.get(endPoint('setHTML')+"&padID="+testPadId+"&html="+html) .expect(function(res){ +console.log(res.body.code); if(res.body.code !== 1) throw new Error("Allowing crappy HTML to be imported") }) .expect('Content-Type', /json/) @@ -418,35 +419,6 @@ describe('setHTML', function(){ }) describe('getHTML', function(){ - // will fail due to https://github.com/ether/etherpad-lite/issues/1604 - // reminder to self this is how the HTML looks - //
      - //
    • one
    • - //
    • 2
    • - //
    - //
    - //
      - //
        - //
      • UL2
      • - //
      - //
    - // It will look right in the browser but the export will get it horriby wrong - - // This is what the export puts out - // - //
      - //
    • one
    • - //
    • 2
    • - //
    - //
    - //
      - //
        - //
      • UL2
      • - //
      - //
    - //
    - // - it('Gets the HTML of a Pad with a bunch of weird unordered lists inserted', function(done) { api.get(endPoint('getHTML')+"&padID="+testPadId) .expect(function(res){ From 531d25ab84d34f89e9b147ffd3f2628a90ab6c8a Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 20 Jan 2015 23:50:55 +0000 Subject: [PATCH 44/81] freeze deps --- src/package.json | 65 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/src/package.json b/src/package.json index 97a2dd6a..9259b50f 100644 --- a/src/package.json +++ b/src/package.json @@ -1,48 +1,49 @@ { "name" : "ep_etherpad-lite", "description" : "A Etherpad based on node.js", - "homepage" : "https://github.com/ether/etherpad-lite", + "homepage" : "http://etherpad.org", "keywords" : ["etherpad", "realtime", "collaborative", "editor"], - "author" : "Peter 'Pita' Martischka - Primary Technology Ltd", + "author" : "Etherpad Foundation", "contributors" : [ { "name": "John McLear" }, { "name": "Hans Pinckaers" }, { "name": "Robin Buse" }, - { "name": "Marcel Klehr" } + { "name": "Marcel Klehr" }, + { "name": "Peter Martischka" } ], "dependencies" : { - "etherpad-yajsml" : ">=0.0.2", - "request" : ">=2.48.0", - "etherpad-require-kernel" : ">=1.0.7", - "resolve" : ">=1.0.0", - "socket.io" : ">=1.2.0", - "ueberDB" : ">=0.2.9", - "express" : ">3.1.0 <3.9.0", - "async" : ">=0.9.0", - "connect" : "2.7.x", + "etherpad-yajsml" : "0.0.2", + "request" : "2.51.0", + "etherpad-require-kernel" : "1.0.7", + "resolve" : "1.0.0", + "socket.io" : "1.3.2", + "ueberDB" : "0.2.10", + "express" : "3.8.1", + "async" : "0.9.0", + "connect" : "2.7.11", "clean-css" : "0.3.2", - "uglify-js" : ">=2.4.15", - "formidable" : ">=1.0.15", - "log4js" : ">=0.6.21", - "nodemailer" : "0.3.x", - "cheerio" : ">=0.18.0", - "async-stacktrace" : ">=0.0.2", - "npm" : ">=2.1.x", - "ejs" : "~1.0.0", - "graceful-fs" : ">=3.0.4", - "slide" : ">=1.1.6", - "semver" : ">=2.3.0", + "uglify-js" : "2.4.16", + "formidable" : "1.0.16", + "log4js" : "0.6.22", + "nodemailer" : "0.3.44", + "cheerio" : "0.18.0", + "async-stacktrace" : "0.0.2", + "npm" : "2.2.0", + "ejs" : "1.0.0", + "graceful-fs" : "3.0.5", + "slide" : "1.1.6", + "semver" : "4.2.0", "security" : "1.0.0", - "tinycon" : ">=0.0.1", + "tinycon" : "0.0.1", "underscore" : "1.5.1", - "unorm" : ">=1.3.3", - "languages4translatewiki" : ">=0.1.3", - "swagger-node-express" : ">=2.1.0", - "channels" : "0.0.x", - "jsonminify" : ">=0.2.3", - "measured" : ">=0.1.6", - "mocha" : ">=2.0.1", - "supertest" : ">=0.15.0" + "unorm" : "1.3.3", + "languages4translatewiki" : "0.1.3", + "swagger-node-express" : "2.1.3", + "channels" : "0.0.4", + "jsonminify" : "0.2.3", + "measured" : "0.1.6", + "mocha" : "2.1.0", + "supertest" : "0.15.0" }, "bin": { "etherpad-lite": "./node/server.js" }, "devDependencies": { From 5f9bbd0666026253beb4eb6e8f95d54fcbc573d0 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 00:03:39 +0000 Subject: [PATCH 45/81] restrict expor4t to only expose this pad ID --- src/node/utils/ExportEtherpad.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node/utils/ExportEtherpad.js b/src/node/utils/ExportEtherpad.js index 36df452d..4f91e4e3 100644 --- a/src/node/utils/ExportEtherpad.js +++ b/src/node/utils/ExportEtherpad.js @@ -48,6 +48,7 @@ exports.getPadRaw = function(padId, callback){ // Get the author info db.get("globalAuthor:"+authorId, function(e, authorEntry){ + authorEntry.padIDs = padId; if(!e) data["globalAuthor:"+authorId] = authorEntry; }); From cb6522499734afe156d1e5b660858d93645fb8c6 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 00:28:00 +0000 Subject: [PATCH 46/81] better logic for author handling --- src/node/utils/ImportEtherpad.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/node/utils/ImportEtherpad.js b/src/node/utils/ImportEtherpad.js index 8daeb536..1574a3a9 100644 --- a/src/node/utils/ImportEtherpad.js +++ b/src/node/utils/ImportEtherpad.js @@ -24,12 +24,25 @@ exports.setPadRaw = function(padId, records, callback){ async.eachSeries(Object.keys(records), function(key, cb){ var value = records[key] - // we know its an author + // Author data if(value.padIDs){ // rewrite author pad ids value.padIDs[padId] = 1; var newKey = key; + // Does this author already exist? + db.get(key, function(err, author){ + if(author){ + // Yes, add the padID to the author.. + author.padIDs.push(padId); + value = author; + }else{ + // No, create a new array with the author info in + value.padIDs = [padId]; + } + }); + + // Not author data, probably pad data }else{ // we can split it to look to see if its pad data var oldPadId = key.split(":"); From cbeb464358c231b204751e580184365e0a1467f1 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 01:16:12 +0000 Subject: [PATCH 47/81] ie now uses keydown --- tests/frontend/specs/bold.js | 3 +-- tests/frontend/specs/caret.js | 2 +- tests/frontend/specs/indentation.js | 2 +- tests/frontend/specs/italic.js | 2 +- tests/frontend/specs/redo.js | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/frontend/specs/bold.js b/tests/frontend/specs/bold.js index 703d0815..bffb281b 100644 --- a/tests/frontend/specs/bold.js +++ b/tests/frontend/specs/bold.js @@ -43,9 +43,8 @@ describe("bold button", function(){ //select this text element $firstTextElement.sendkeys('{selectall}'); - console.log(inner$(window)[0].bowser); - if(inner$(window)[0].bowser.firefox){ // if it's a mozilla browser + if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE var evtType = "keypress"; }else{ var evtType = "keydown"; diff --git a/tests/frontend/specs/caret.js b/tests/frontend/specs/caret.js index 48dd94a6..6e68b6f5 100644 --- a/tests/frontend/specs/caret.js +++ b/tests/frontend/specs/caret.js @@ -297,7 +297,7 @@ function prepareDocument(n, target){ // generates a random document with random } function keyEvent(target, charCode, ctrl, shift){ // sends a charCode to the window - if(inner$(window)[0].bowser.firefox){ // if it's a mozilla browser + if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE var evtType = "keypress"; }else{ var evtType = "keydown"; diff --git a/tests/frontend/specs/indentation.js b/tests/frontend/specs/indentation.js index 3730f6bf..c8f2cee8 100644 --- a/tests/frontend/specs/indentation.js +++ b/tests/frontend/specs/indentation.js @@ -15,7 +15,7 @@ describe("indentation button", function(){ //select this text element $firstTextElement.sendkeys('{selectall}'); - if(inner$(window)[0].bowser.firefox){ // if it's a mozilla browser + if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE var evtType = "keypress"; }else{ var evtType = "keydown"; diff --git a/tests/frontend/specs/italic.js b/tests/frontend/specs/italic.js index 955cec0f..4ef4b408 100644 --- a/tests/frontend/specs/italic.js +++ b/tests/frontend/specs/italic.js @@ -44,7 +44,7 @@ describe("italic some text", function(){ //select this text element $firstTextElement.sendkeys('{selectall}'); - if(inner$(window)[0].bowser.firefox){ // if it's a mozilla browser + if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE var evtType = "keypress"; }else{ var evtType = "keydown"; diff --git a/tests/frontend/specs/redo.js b/tests/frontend/specs/redo.js index 99056fb7..00873d14 100644 --- a/tests/frontend/specs/redo.js +++ b/tests/frontend/specs/redo.js @@ -47,7 +47,7 @@ describe("undo button then redo button", function(){ var modifiedValue = $firstTextElement.text(); // get the modified value expect(modifiedValue).not.to.be(originalValue); // expect the value to change - if(inner$(window)[0].bowser.firefox){ // if it's a mozilla browser + if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE var evtType = "keypress"; }else{ var evtType = "keydown"; From eacf1118f86fa0bf489fa86f65b970347f45077a Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 02:55:03 +0000 Subject: [PATCH 48/81] blind attempt to try --- src/static/js/ace2_inner.js | 20 ++++++++------------ src/static/js/contentcollector.js | 3 ++- src/static/js/domline.js | 4 ++-- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index bd1f0053..d2952ffe 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -34,8 +34,9 @@ var isNodeText = Ace2Common.isNodeText, binarySearchInfinite = Ace2Common.binarySearchInfinite, htmlPrettyEscape = Ace2Common.htmlPrettyEscape, noop = Ace2Common.noop; - var hooks = require('./pluginfw/hooks'); - var browser = require('./browser').browser; + +var hooks = require('./pluginfw/hooks'); +var browser = require('./browser').browser; function Ace2Inner(){ @@ -944,7 +945,7 @@ function Ace2Inner(){ showslinenumbers : function(value){ hasLineNumbers = !! value; // disable line numbers on mobile devices - if (browser.mobile) hasLineNumbers = false; + // if (browser.mobile) hasLineNumbers = false; setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers); fixView(); }, @@ -1605,7 +1606,7 @@ function Ace2Inner(){ if (linesWrapped > 0) { - if(!browser.ie){ + if(!browser.msie){ // chrome decides in it's infinite wisdom that its okay to put the browsers visisble window in the middle of the span // an outcome of this is that the first chars of the string are no longer visible to the user.. Yay chrome.. // Move the browsers visible area to the left hand side of the span @@ -2964,6 +2965,7 @@ function Ace2Inner(){ } else { + // cake return domline.createDomLine(nonEmpty, doesWrap, browser, doc); } } @@ -3583,7 +3585,7 @@ function Ace2Inner(){ // On Mac and Linux, move right moves to end of word and move left moves to start; // on Windows, always move to start of word. // On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no). - if (browser.windows && forwardNotBack) + if (browser.msie && forwardNotBack) { while ((!isDone()) && isWordChar(nextChar())) { @@ -4264,12 +4266,6 @@ function Ace2Inner(){ end.collapse(false); selection.startPoint = pointFromCollapsedRange(start); selection.endPoint = pointFromCollapsedRange(end); -/*if ((!selection.startPoint.node.isText) && (!selection.endPoint.node.isText)) { - console.log(selection.startPoint.node.uniqueId()+","+ - selection.startPoint.index+" / "+ - selection.endPoint.node.uniqueId()+","+ - selection.endPoint.index); -}*/ } return selection; } @@ -4867,7 +4863,7 @@ function Ace2Inner(){ }) // CompositionEvent is not implemented below IE version 8 - if ( !(browser.msie && browser.version < 9) && document.documentElement) + if ( !(browser.msie && browser.version <= 9) && document.documentElement) { $(document.documentElement).on("compositionstart", handleCompositionEvent); $(document.documentElement).on("compositionend", handleCompositionEvent); diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index b7b3c568..7a6deeb1 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -37,7 +37,8 @@ function sanitizeUnicode(s) function makeContentCollector(collectStyles, browser, apool, domInterface, className2Author) { - browser = browser || {}; + // browser = browser || {}; + // I don't like the above. var dom = domInterface || { isNodeText: function(n) diff --git a/src/static/js/domline.js b/src/static/js/domline.js index b1927b16..e793956b 100644 --- a/src/static/js/domline.js +++ b/src/static/js/domline.js @@ -65,7 +65,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) lineMarker: 0 }; - var browser = (optBrowser || {}); + // var browser = (optBrowser || {}); var document = optDocument; if (document) @@ -225,7 +225,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) { newHTML += ' '; } - else if (!browser.msie) + else if (!optBrowser.msie) { newHTML += '
    '; } From f880b0feb7df9c05d78f4c320ece1b846f4fe27a Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 12:18:38 +0000 Subject: [PATCH 49/81] clean up iojs --- bin/installDeps.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/bin/installDeps.sh b/bin/installDeps.sh index 00575845..fcf213e4 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -10,29 +10,29 @@ fi #Is gnu-grep (ggrep) installed on SunOS (Solaris) if [ $(uname) = "SunOS" ]; then - hash ggrep > /dev/null 2>&1 || { + hash ggrep > /dev/null 2>&1 || { echo "Please install ggrep (pkg install gnu-grep)" >&2 - exit 1 + exit 1 } fi #Is curl installed? -hash curl > /dev/null 2>&1 || { +hash curl > /dev/null 2>&1 || { echo "Please install curl" >&2 - exit 1 + exit 1 } #Is node installed? #not checking io.js, default installation creates a symbolic link to node -hash node > /dev/null 2>&1 || { +hash node > /dev/null 2>&1 || { echo "Please install node.js ( http://nodejs.org )" >&2 - exit 1 + exit 1 } #Is npm installed? -hash npm > /dev/null 2>&1 || { +hash npm > /dev/null 2>&1 || { echo "Please install npm ( http://npmjs.org )" >&2 - exit 1 + exit 1 } #check npm version @@ -40,18 +40,20 @@ NPM_VERSION=$(npm --version) NPM_MAIN_VERSION=$(echo $NPM_VERSION | cut -d "." -f 1) if [ $(echo $NPM_MAIN_VERSION) = "0" ]; then echo "You're running a wrong version of npm, you're using $NPM_VERSION, we need 1.x or higher" >&2 - exit 1 + exit 1 fi #check node version NODE_VERSION=$(node --version) NODE_V_MINOR=$(echo $NODE_VERSION | cut -d "." -f 1-2) #iojs version checking added -IOJS_VERSION=$(iojs --version) +if hash iojs 2>/dev/null; then + IOJS_VERSION=$(iojs --version) +fi if [ ! $NODE_V_MINOR = "v0.8" ] && [ ! $NODE_V_MINOR = "v0.10" ] && [ ! $NODE_V_MINOR = "v0.11" ]; then if [ ! $IOJS_VERSION ]; then echo "You're running a wrong version of node, or io.js is not installed. You're using $NODE_VERSION, we need v0.8.x, v0.10.x or v0.11.x" >&2 - exit 1 + exit 1 fi fi @@ -76,9 +78,9 @@ echo "Ensure that all dependencies are up to date... If this is the first time [ -e ep_etherpad-lite ] || ln -s ../src ep_etherpad-lite cd ep_etherpad-lite npm install --loglevel warn -) || { +) || { rm -rf node_modules - exit 1 + exit 1 } echo "Ensure jQuery is downloaded and up to date..." @@ -111,7 +113,7 @@ do if [ ! -f "src/static/custom/$f.js" ]; then cp "src/static/custom/js.template" "src/static/custom/$f.js" || exit 1 fi - + if [ ! -f "src/static/custom/$f.css" ]; then cp "src/static/custom/css.template" "src/static/custom/$f.css" || exit 1 fi From 34d6b31c983475e7bf222a593e937fdee796788d Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 13:24:21 +0000 Subject: [PATCH 50/81] some sanity --- src/static/js/ace2_inner.js | 93 ++++++++++++++++------------------ src/static/js/broadcast.js | 12 ----- src/static/js/collab_client.js | 2 +- src/static/js/pad.js | 3 +- 4 files changed, 47 insertions(+), 63 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index d2952ffe..8adbc8dc 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -19,8 +19,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -var _, $, jQuery, plugins, Ace2Common; - +var _, $, jQuery, plugins, Ace2Common, mybrowser; +mybrowser = require('./browser').browser; Ace2Common = require('./ace2_common'); plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins'); @@ -36,7 +36,6 @@ var isNodeText = Ace2Common.isNodeText, noop = Ace2Common.noop; var hooks = require('./pluginfw/hooks'); -var browser = require('./browser').browser; function Ace2Inner(){ @@ -599,7 +598,7 @@ function Ace2Inner(){ // Chrome can't handle the truth.. If CSS rule white-space:pre-wrap // is true then any paste event will insert two lines.. - if(browser.chrome){ + if(mybrowser.chrome){ $("#innerdocbody").css({"white-space":"normal"}); } @@ -945,7 +944,7 @@ function Ace2Inner(){ showslinenumbers : function(value){ hasLineNumbers = !! value; // disable line numbers on mobile devices - // if (browser.mobile) hasLineNumbers = false; + // if (mybrowser.mobile) hasLineNumbers = false; setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers); fixView(); }, @@ -1312,7 +1311,9 @@ function Ace2Inner(){ else { var offsetIntoLine = 0; - var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, browser); +mybrowser.msie = false; // cake 1 + var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, mybrowser); +mybrowser.msie = true; var lineNum = rep.lines.indexOfEntry(lineEntry); var aline = rep.alines[lineNum]; filteredFunc = linestylefilter.getLineStyleFilter( @@ -1560,13 +1561,16 @@ function Ace2Inner(){ lastDirtyNode = (lastDirtyNode && isNodeDirty(lastDirtyNode) && lastDirtyNode); if (firstDirtyNode && lastDirtyNode) { - var cc = makeContentCollector(isStyled, browser, rep.apool, null, className2Author); +// cake 2 +mybrowser.msie = false; + var cc = makeContentCollector(isStyled, mybrowser, rep.apool, null, className2Author); +mybrowser.msie = true; cc.notifySelection(selection); var dirtyNodes = []; for (var n = firstDirtyNode; n && !(n.previousSibling && n.previousSibling == lastDirtyNode); n = n.nextSibling) { - if (browser.msie) + if (mybrowser.msie) { // try to undo IE's pesky and overzealous linkification try @@ -1606,7 +1610,7 @@ function Ace2Inner(){ if (linesWrapped > 0) { - if(!browser.msie){ + if(!mybrowser.msie){ // chrome decides in it's infinite wisdom that its okay to put the browsers visisble window in the middle of the span // an outcome of this is that the first chars of the string are no longer visible to the user.. Yay chrome.. // Move the browsers visible area to the left hand side of the span @@ -1911,7 +1915,7 @@ function Ace2Inner(){ if (charsLeft === 0) { var index = 0; - if (browser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0) + if (mybrowser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0) { // best to stay at end of last empty div in IE index = 1; @@ -2904,7 +2908,7 @@ function Ace2Inner(){ function doCreateDomLine(nonEmpty) { - if (browser.msie && (!nonEmpty)) + if (mybrowser.msie && (!nonEmpty)) { var result = { node: null, @@ -2965,8 +2969,10 @@ function Ace2Inner(){ } else { - // cake - return domline.createDomLine(nonEmpty, doesWrap, browser, doc); + // cake 3 +mybrowser.msie = false; + return domline.createDomLine(nonEmpty, doesWrap, mybrowser, doc); +mybrowser.msie = true; } } @@ -3233,7 +3239,7 @@ function Ace2Inner(){ var dirtiness = {}; dirtiness.nodeId = uniqueId(n); dirtiness.knownHTML = n.innerHTML; - if (browser.msie) + if (mybrowser.msie) { // adding a space to an "empty" div in IE designMode doesn't // change the innerHTML of the div's parent; also, other @@ -3250,7 +3256,7 @@ function Ace2Inner(){ var data = getAssoc(n, "dirtiness"); if (!data) return true; if (n.id !== data.nodeId) return true; - if (browser.msie) + if (mybrowser.msie) { if (n.innerText !== data.knownText) return true; } @@ -3585,7 +3591,7 @@ function Ace2Inner(){ // On Mac and Linux, move right moves to end of word and move left moves to start; // on Windows, always move to start of word. // On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no). - if (browser.msie && forwardNotBack) + if (mybrowser.msie && forwardNotBack) { while ((!isDone()) && isWordChar(nextChar())) { @@ -3657,13 +3663,13 @@ function Ace2Inner(){ if (isModKey) return; // If the key is a keypress and the browser is opera and the key is enter, do nothign at all as this fires twice. - if (keyCode == 13 && browser.opera && (type == "keypress")){ + if (keyCode == 13 && mybrowser.opera && (type == "keypress")){ return; // This stops double enters in Opera but double Tabs still show on single tab keypress, adding keyCode == 9 to this doesn't help as the event is fired twice } var specialHandled = false; - var isTypeForSpecialKey = ((browser.msie || browser.safari || browser.chrome) ? (type == "keydown") : (type == "keypress")); - var isTypeForCmdKey = ((browser.msie || browser.safari || browser.chrome) ? (type == "keydown") : (type == "keypress")); + var isTypeForSpecialKey = ((mybrowser.msie || mybrowser.safari || mybrowser.chrome) ? (type == "keydown") : (type == "keypress")); + var isTypeForCmdKey = ((mybrowser.msie || mybrowser.safari || mybrowser.chrome) ? (type == "keydown") : (type == "keypress")); var stopped = false; @@ -3880,7 +3886,7 @@ function Ace2Inner(){ /* Attempt to apply some sanity to cursor handling in Chrome after a copy / paste event We have to do this the way we do because rep. doesn't hold the value for keyheld events IE if the user presses and holds the arrow key .. Sorry if this is ugly, blame Chrome's weird handling of viewports after new content is added*/ - if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && browser.chrome){ + if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && mybrowser.chrome){ var viewport = getViewPortTopBottom(); var myselection = document.getSelection(); // get the current caret selection, can't use rep. here because that only gives us the start position not the current var caretOffsetTop = myselection.focusNode.parentNode.offsetTop || myselection.focusNode.offsetTop; // get the carets selection offset in px IE 214 @@ -3951,10 +3957,10 @@ function Ace2Inner(){ } // Is part of multi-keystroke international character on Firefox Mac - var isFirefoxHalfCharacter = (browser.mozilla && evt.altKey && charCode === 0 && keyCode === 0); + var isFirefoxHalfCharacter = (mybrowser.firefox && evt.altKey && charCode === 0 && keyCode === 0); // Is part of multi-keystroke international character on Safari Mac - var isSafariHalfCharacter = (browser.safari && evt.altKey && keyCode == 229); + var isSafariHalfCharacter = (mybrowser.safari && evt.altKey && keyCode == 229); if (thisKeyDoesntTriggerNormalize || isFirefoxHalfCharacter || isSafariHalfCharacter) { @@ -4068,7 +4074,7 @@ function Ace2Inner(){ // each of which has node (a magicdom node), index, and maxIndex. If the node // is a text node, maxIndex is the length of the text; else maxIndex is 1. // index is between 0 and maxIndex, inclusive. - if (browser.msie) + if (mybrowser.msie) { var browserSelection; try @@ -4364,7 +4370,7 @@ function Ace2Inner(){ maxIndex: pt.maxIndex }; } - if (browser.msie) + if (mybrowser.msie) { // Oddly enough, accessing scrollHeight fixes return key handling on IE 8, // presumably by forcing some kind of internal DOM update. @@ -4653,17 +4659,17 @@ function Ace2Inner(){ for (var i = 0; i < 2; i++) { var newHeight = root.clientHeight; - var newWidth = (browser.msie ? root.createTextRange().boundingWidth : root.clientWidth); + var newWidth = root.clientWidth; var viewHeight = getInnerHeight() - iframePadBottom - iframePadTop; var viewWidth = getInnerWidth() - iframePadLeft - iframePadRight; if (newHeight < viewHeight) { newHeight = viewHeight; - if (browser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto'); +// if (mybrowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto'); } else { - if (browser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll'); +// if (mybrowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll'); } if (doesWrap) { @@ -4677,7 +4683,7 @@ function Ace2Inner(){ setIfNecessary(iframe.style, "width", newWidth + "px"); setIfNecessary(sideDiv.style, "height", newHeight + "px"); } - if (browser.mozilla) + if (mybrowser.firefox) { if (!doesWrap) { @@ -4776,14 +4782,14 @@ function Ace2Inner(){ } return false; } - if (browser.msie || browser.safari) + if (mybrowser.msie || mybrowser.safari) { setIfNecessary(root, 'contentEditable', (newVal ? 'true' : 'false')); } else { var wasSet = setIfNecessary(doc, 'designMode', (newVal ? 'on' : 'off')); - if (wasSet && newVal && browser.opera) + if (wasSet && newVal && mybrowser.opera) { // turning on designMode clears event handlers bindTheEventHandlers(); @@ -4849,11 +4855,11 @@ function Ace2Inner(){ $(document).on("keyup", handleKeyEvent); $(document).on("click", handleClick); $(root).on("blur", handleBlur); - if (browser.msie) + if (mybrowser.msie) { $(document).on("click", handleIEOuterClick); } - if (browser.msie) $(root).on("paste", handleIEPaste); + if (mybrowser.msie) $(root).on("paste", handleIEPaste); // Don't paste on middle click of links $(root).on("paste", function(e){ @@ -4863,7 +4869,7 @@ function Ace2Inner(){ }) // CompositionEvent is not implemented below IE version 8 - if ( !(browser.msie && browser.version <= 9) && document.documentElement) + if ( !(mybrowser.msie && mybrowser.version <= 9) && document.documentElement) { $(document.documentElement).on("compositionstart", handleCompositionEvent); $(document.documentElement).on("compositionend", handleCompositionEvent); @@ -4926,7 +4932,7 @@ function Ace2Inner(){ function handleBlur(evt) { - if (browser.msie) + if (mybrowser.msie) { // a fix: in IE, clicking on a control like a button outside the // iframe can "blur" the editor, causing it to stop getting @@ -4997,7 +5003,7 @@ function Ace2Inner(){ var win = outerWin; var odoc = win.document; var h; - if (browser.opera) h = win.innerHeight; + if (mybrowser.opera) h = win.innerHeight; else h = odoc.documentElement.clientHeight; if (h) return h; @@ -5326,20 +5332,9 @@ function Ace2Inner(){ { var body = doc.getElementById("innerdocbody"); root = body; // defined as a var in scope outside - if (browser.mozilla) $(root).addClass("mozilla"); - if (browser.safari) $(root).addClass("safari"); - if (browser.msie) $(root).addClass("msie"); - if (browser.msie) - { - // cache CSS background images - try - { - doc.execCommand("BackgroundImageCache", false, true); - } - catch (e) - { /* throws an error in some IE 6 but not others! */ - } - } + if (mybrowser.firefox) $(root).addClass("mozilla"); + if (mybrowser.safari) $(root).addClass("safari"); + if (mybrowser.msie) $(root).addClass("msie"); setClassPresence(root, "authorColors", true); setClassPresence(root, "doesWrap", doesWrap); diff --git a/src/static/js/broadcast.js b/src/static/js/broadcast.js index a25d889b..817155b5 100644 --- a/src/static/js/broadcast.js +++ b/src/static/js/broadcast.js @@ -66,18 +66,6 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro } } - // for IE - if (browser.msie) - { - try - { - document.execCommand("BackgroundImageCache", false, true); - } - catch (e) - {} - } - - //var socket; var channelState = "DISCONNECTED"; diff --git a/src/static/js/collab_client.js b/src/static/js/collab_client.js index 6089f197..8bc5020b 100644 --- a/src/static/js/collab_client.js +++ b/src/static/js/collab_client.js @@ -82,7 +82,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad) {} }; - if (browser.mozilla) + if (browser.firefox) { // Prevent "escape" from taking effect and canceling a comet connection; // doesn't work if focus is on an iframe. diff --git a/src/static/js/pad.js b/src/static/js/pad.js index ff62f86c..685b420b 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -494,7 +494,8 @@ var pad = { pad.initTime = +(new Date()); pad.padOptions = clientVars.initialOptions; - if ((!browser.msie) && (!(browser.mozilla && browser.version.indexOf("1.8.") == 0))) +console.log("pad", browser); + if ((!browser.msie) && (!(browser.firefox && browser.version.indexOf("1.8.") == 0))) { document.domain = document.domain; // for comet } From 990e14c9042cacd03ff16259b9140a28269678c9 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 14:25:24 +0000 Subject: [PATCH 51/81] working with a big hack --- src/static/js/ace2_inner.js | 32 +++++++++++++++---------------- src/static/js/collab_client.js | 1 - src/static/js/contentcollector.js | 10 +++++----- src/static/js/domline.js | 3 ++- src/static/js/linestylefilter.js | 6 +++--- 5 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 8adbc8dc..aa65ff95 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -21,6 +21,15 @@ */ var _, $, jQuery, plugins, Ace2Common, mybrowser; mybrowser = require('./browser').browser; + +if(mybrowser.msie){ + // Honestly fuck IE royally. + // Basically every hack we have since V11 causes a problem + if(parseInt(mybrowser.version) >= 11){ + delete mybrowser.msie; + mybrowser.firefox = true; + } +} Ace2Common = require('./ace2_common'); plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins'); @@ -1311,9 +1320,7 @@ function Ace2Inner(){ else { var offsetIntoLine = 0; -mybrowser.msie = false; // cake 1 var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, mybrowser); -mybrowser.msie = true; var lineNum = rep.lines.indexOfEntry(lineEntry); var aline = rep.alines[lineNum]; filteredFunc = linestylefilter.getLineStyleFilter( @@ -1355,7 +1362,7 @@ mybrowser.msie = true; // (from how it looks in our representation) and record them in a way // that can be used to "normalize" the document (apply the changes to our // representation, and put the DOM in a canonical form). - //top.console.log("observeChangesAroundNode(%o)", node); + // top.console.log("observeChangesAroundNode(%o)", node); var cleanNode; var hasAdjacentDirtyness; if (!isNodeDirty(node)) @@ -1561,10 +1568,7 @@ mybrowser.msie = true; lastDirtyNode = (lastDirtyNode && isNodeDirty(lastDirtyNode) && lastDirtyNode); if (firstDirtyNode && lastDirtyNode) { -// cake 2 -mybrowser.msie = false; var cc = makeContentCollector(isStyled, mybrowser, rep.apool, null, className2Author); -mybrowser.msie = true; cc.notifySelection(selection); var dirtyNodes = []; for (var n = firstDirtyNode; n && !(n.previousSibling && n.previousSibling == lastDirtyNode); @@ -2964,15 +2968,11 @@ mybrowser.msie = true; { return ""; }; - return result; } else { - // cake 3 -mybrowser.msie = false; return domline.createDomLine(nonEmpty, doesWrap, mybrowser, doc); -mybrowser.msie = true; } } @@ -3632,7 +3632,6 @@ mybrowser.msie = true; evt.preventDefault(); return; } - // Is caret potentially hidden by the chat button? var myselection = document.getSelection(); // get the current caret selection var caretOffsetTop = myselection.focusNode.parentNode.offsetTop | myselection.focusNode.offsetTop; // get the carets selection offset in px IE 214 @@ -3669,8 +3668,7 @@ mybrowser.msie = true; var specialHandled = false; var isTypeForSpecialKey = ((mybrowser.msie || mybrowser.safari || mybrowser.chrome) ? (type == "keydown") : (type == "keypress")); - var isTypeForCmdKey = ((mybrowser.msie || mybrowser.safari || mybrowser.chrome) ? (type == "keydown") : (type == "keypress")); - + var isTypeForCmdKey = (type === "keydown") var stopped = false; inCallStackIfNecessary("handleKeyEvent", function() @@ -3920,10 +3918,10 @@ mybrowser.msie = true; // only move the viewport if we're at the bottom of the viewport, if we hit down any other time the viewport shouldn't change // NOTE: This behavior only fires if Chrome decides to break the page layout after a paste, it's annoying but nothing I can do var selection = getSelection(); - top.console.log("line #", rep.selStart[0]); // the line our caret is on - top.console.log("firstvisible", visibleLineRange[0]); // the first visiblel ine - top.console.log("lastVisible", visibleLineRange[1]); // the last visible line - top.console.log(rep.selStart[0], visibleLineRange[1], rep.selStart[0], visibleLineRange[0]); + // top.console.log("line #", rep.selStart[0]); // the line our caret is on + // top.console.log("firstvisible", visibleLineRange[0]); // the first visiblel ine + // top.console.log("lastVisible", visibleLineRange[1]); // the last visible line + // top.console.log(rep.selStart[0], visibleLineRange[1], rep.selStart[0], visibleLineRange[0]); var newY = viewport.top + lineHeight; } if(newY){ diff --git a/src/static/js/collab_client.js b/src/static/js/collab_client.js index 8bc5020b..e5c0ec8b 100644 --- a/src/static/js/collab_client.js +++ b/src/static/js/collab_client.js @@ -81,7 +81,6 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad) onServerMessage: function() {} }; - if (browser.firefox) { // Prevent "escape" from taking effect and canceling a comet connection; diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index 7a6deeb1..c39410b7 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -35,9 +35,9 @@ function sanitizeUnicode(s) return UNorm.nfc(s); } -function makeContentCollector(collectStyles, browser, apool, domInterface, className2Author) +function makeContentCollector(collectStyles, abrowser, apool, domInterface, className2Author) { - // browser = browser || {}; + abrowser = abrowser || {}; // I don't like the above. var dom = domInterface || { @@ -485,7 +485,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class var cls = dom.nodeProp(node, "className"); var isPre = (tname == "pre"); - if ((!isPre) && browser.safari) + if ((!isPre) && abrowser.safari) { isPre = (styl && /\bwhite-space:\s*pre\b/i.exec(styl)); } @@ -611,7 +611,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class } } } - if (!browser.msie) + if (!abrowser.msie) { _reachBlockPoint(node, 1, state); } @@ -627,7 +627,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class } } - if (browser.msie) + if (abrowser.msie) { // in IE, a point immediately after a DIV appears on the next line _reachBlockPoint(node, 1, state); diff --git a/src/static/js/domline.js b/src/static/js/domline.js index e793956b..03f1b9c8 100644 --- a/src/static/js/domline.js +++ b/src/static/js/domline.js @@ -65,7 +65,6 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) lineMarker: 0 }; - // var browser = (optBrowser || {}); var document = optDocument; if (document) @@ -93,8 +92,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) var perTextNodeProcess = (doesWrap ? _.identity : processSpaces); var perHtmlLineProcess = (doesWrap ? processSpaces : _.identity); var lineClass = 'ace-line'; + result.appendSpan = function(txt, cls) { + var processedMarker = false; // Handle lineAttributeMarker, if present if (cls.indexOf(lineAttributeMarker) >= 0) diff --git a/src/static/js/linestylefilter.js b/src/static/js/linestylefilter.js index 675f19d0..17ab993b 100644 --- a/src/static/js/linestylefilter.js +++ b/src/static/js/linestylefilter.js @@ -318,20 +318,20 @@ linestylefilter.textAndClassFuncSplitter = function(func, splitPointsOpt) return spanHandler; }; -linestylefilter.getFilterStack = function(lineText, textAndClassFunc, browser) +linestylefilter.getFilterStack = function(lineText, textAndClassFunc, abrowser) { var func = linestylefilter.getURLFilter(lineText, textAndClassFunc); var hookFilters = hooks.callAll("aceGetFilterStack", { linestylefilter: linestylefilter, - browser: browser + browser: abrowser }); _.map(hookFilters ,function(hookFilter) { func = hookFilter(lineText, func); }); - if (browser !== undefined && browser.msie) + if (abrowser !== undefined && abrowser.msie) { // IE7+ will take an e-mail address like and linkify it to foo@bar.com. // We then normalize it back to text with no angle brackets. It's weird. So always From ce40cacafaf220e4c075daa79240dd0263aeaa5d Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 14:49:06 +0000 Subject: [PATCH 52/81] mheh looks fixed --- src/static/js/ace2_inner.js | 78 ++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index aa65ff95..dd2f2b12 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -19,15 +19,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -var _, $, jQuery, plugins, Ace2Common, mybrowser; -mybrowser = require('./browser').browser; +var _, $, jQuery, plugins, Ace2Common, bowser; +bowser = require('./browser').browser; -if(mybrowser.msie){ +if(bowser.msie){ // Honestly fuck IE royally. // Basically every hack we have since V11 causes a problem - if(parseInt(mybrowser.version) >= 11){ - delete mybrowser.msie; - mybrowser.firefox = true; + if(parseInt(bowser.version) >= 11){ + delete bowser.msie; + bowser.chrome = true; } } Ace2Common = require('./ace2_common'); @@ -607,7 +607,7 @@ function Ace2Inner(){ // Chrome can't handle the truth.. If CSS rule white-space:pre-wrap // is true then any paste event will insert two lines.. - if(mybrowser.chrome){ + if(bowser.chrome){ $("#innerdocbody").css({"white-space":"normal"}); } @@ -953,7 +953,7 @@ function Ace2Inner(){ showslinenumbers : function(value){ hasLineNumbers = !! value; // disable line numbers on mobile devices - // if (mybrowser.mobile) hasLineNumbers = false; + // if (bowser.mobile) hasLineNumbers = false; setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers); fixView(); }, @@ -1320,7 +1320,7 @@ function Ace2Inner(){ else { var offsetIntoLine = 0; - var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, mybrowser); + var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, bowser); var lineNum = rep.lines.indexOfEntry(lineEntry); var aline = rep.alines[lineNum]; filteredFunc = linestylefilter.getLineStyleFilter( @@ -1568,13 +1568,13 @@ function Ace2Inner(){ lastDirtyNode = (lastDirtyNode && isNodeDirty(lastDirtyNode) && lastDirtyNode); if (firstDirtyNode && lastDirtyNode) { - var cc = makeContentCollector(isStyled, mybrowser, rep.apool, null, className2Author); + var cc = makeContentCollector(isStyled, bowser, rep.apool, null, className2Author); cc.notifySelection(selection); var dirtyNodes = []; for (var n = firstDirtyNode; n && !(n.previousSibling && n.previousSibling == lastDirtyNode); n = n.nextSibling) { - if (mybrowser.msie) + if (bowser.msie) { // try to undo IE's pesky and overzealous linkification try @@ -1614,7 +1614,7 @@ function Ace2Inner(){ if (linesWrapped > 0) { - if(!mybrowser.msie){ + if(!bowser.msie){ // chrome decides in it's infinite wisdom that its okay to put the browsers visisble window in the middle of the span // an outcome of this is that the first chars of the string are no longer visible to the user.. Yay chrome.. // Move the browsers visible area to the left hand side of the span @@ -1919,7 +1919,7 @@ function Ace2Inner(){ if (charsLeft === 0) { var index = 0; - if (mybrowser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0) + if (bowser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0) { // best to stay at end of last empty div in IE index = 1; @@ -2912,7 +2912,7 @@ function Ace2Inner(){ function doCreateDomLine(nonEmpty) { - if (mybrowser.msie && (!nonEmpty)) + if (bowser.msie && (!nonEmpty)) { var result = { node: null, @@ -2972,7 +2972,7 @@ function Ace2Inner(){ } else { - return domline.createDomLine(nonEmpty, doesWrap, mybrowser, doc); + return domline.createDomLine(nonEmpty, doesWrap, bowser, doc); } } @@ -3239,7 +3239,7 @@ function Ace2Inner(){ var dirtiness = {}; dirtiness.nodeId = uniqueId(n); dirtiness.knownHTML = n.innerHTML; - if (mybrowser.msie) + if (bowser.msie) { // adding a space to an "empty" div in IE designMode doesn't // change the innerHTML of the div's parent; also, other @@ -3256,7 +3256,7 @@ function Ace2Inner(){ var data = getAssoc(n, "dirtiness"); if (!data) return true; if (n.id !== data.nodeId) return true; - if (mybrowser.msie) + if (bowser.msie) { if (n.innerText !== data.knownText) return true; } @@ -3591,7 +3591,7 @@ function Ace2Inner(){ // On Mac and Linux, move right moves to end of word and move left moves to start; // on Windows, always move to start of word. // On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no). - if (mybrowser.msie && forwardNotBack) + if (bowser.msie && forwardNotBack) { while ((!isDone()) && isWordChar(nextChar())) { @@ -3662,13 +3662,13 @@ function Ace2Inner(){ if (isModKey) return; // If the key is a keypress and the browser is opera and the key is enter, do nothign at all as this fires twice. - if (keyCode == 13 && mybrowser.opera && (type == "keypress")){ + if (keyCode == 13 && bowser.opera && (type == "keypress")){ return; // This stops double enters in Opera but double Tabs still show on single tab keypress, adding keyCode == 9 to this doesn't help as the event is fired twice } var specialHandled = false; - var isTypeForSpecialKey = ((mybrowser.msie || mybrowser.safari || mybrowser.chrome) ? (type == "keydown") : (type == "keypress")); - var isTypeForCmdKey = (type === "keydown") + var isTypeForSpecialKey = ((bowser.msie || bowser.safari || bowser.chrome) ? (type == "keydown") : (type == "keypress")); + var isTypeForCmdKey = ((bowser.msie || bowser.safari || bowser.chrome) ? (type == "keydown") : (type == "keypress")); var stopped = false; inCallStackIfNecessary("handleKeyEvent", function() @@ -3884,7 +3884,7 @@ function Ace2Inner(){ /* Attempt to apply some sanity to cursor handling in Chrome after a copy / paste event We have to do this the way we do because rep. doesn't hold the value for keyheld events IE if the user presses and holds the arrow key .. Sorry if this is ugly, blame Chrome's weird handling of viewports after new content is added*/ - if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && mybrowser.chrome){ + if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && bowser.chrome){ var viewport = getViewPortTopBottom(); var myselection = document.getSelection(); // get the current caret selection, can't use rep. here because that only gives us the start position not the current var caretOffsetTop = myselection.focusNode.parentNode.offsetTop || myselection.focusNode.offsetTop; // get the carets selection offset in px IE 214 @@ -3955,10 +3955,10 @@ function Ace2Inner(){ } // Is part of multi-keystroke international character on Firefox Mac - var isFirefoxHalfCharacter = (mybrowser.firefox && evt.altKey && charCode === 0 && keyCode === 0); + var isFirefoxHalfCharacter = (bowser.firefox && evt.altKey && charCode === 0 && keyCode === 0); // Is part of multi-keystroke international character on Safari Mac - var isSafariHalfCharacter = (mybrowser.safari && evt.altKey && keyCode == 229); + var isSafariHalfCharacter = (bowser.safari && evt.altKey && keyCode == 229); if (thisKeyDoesntTriggerNormalize || isFirefoxHalfCharacter || isSafariHalfCharacter) { @@ -4072,7 +4072,7 @@ function Ace2Inner(){ // each of which has node (a magicdom node), index, and maxIndex. If the node // is a text node, maxIndex is the length of the text; else maxIndex is 1. // index is between 0 and maxIndex, inclusive. - if (mybrowser.msie) + if (bowser.msie) { var browserSelection; try @@ -4368,7 +4368,7 @@ function Ace2Inner(){ maxIndex: pt.maxIndex }; } - if (mybrowser.msie) + if (bowser.msie) { // Oddly enough, accessing scrollHeight fixes return key handling on IE 8, // presumably by forcing some kind of internal DOM update. @@ -4663,11 +4663,11 @@ function Ace2Inner(){ if (newHeight < viewHeight) { newHeight = viewHeight; -// if (mybrowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto'); +// if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto'); } else { -// if (mybrowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll'); +// if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll'); } if (doesWrap) { @@ -4681,7 +4681,7 @@ function Ace2Inner(){ setIfNecessary(iframe.style, "width", newWidth + "px"); setIfNecessary(sideDiv.style, "height", newHeight + "px"); } - if (mybrowser.firefox) + if (bowser.firefox) { if (!doesWrap) { @@ -4780,14 +4780,14 @@ function Ace2Inner(){ } return false; } - if (mybrowser.msie || mybrowser.safari) + if (bowser.msie || bowser.safari) { setIfNecessary(root, 'contentEditable', (newVal ? 'true' : 'false')); } else { var wasSet = setIfNecessary(doc, 'designMode', (newVal ? 'on' : 'off')); - if (wasSet && newVal && mybrowser.opera) + if (wasSet && newVal && bowser.opera) { // turning on designMode clears event handlers bindTheEventHandlers(); @@ -4853,11 +4853,11 @@ function Ace2Inner(){ $(document).on("keyup", handleKeyEvent); $(document).on("click", handleClick); $(root).on("blur", handleBlur); - if (mybrowser.msie) + if (bowser.msie) { $(document).on("click", handleIEOuterClick); } - if (mybrowser.msie) $(root).on("paste", handleIEPaste); + if (bowser.msie) $(root).on("paste", handleIEPaste); // Don't paste on middle click of links $(root).on("paste", function(e){ @@ -4867,7 +4867,7 @@ function Ace2Inner(){ }) // CompositionEvent is not implemented below IE version 8 - if ( !(mybrowser.msie && mybrowser.version <= 9) && document.documentElement) + if ( !(bowser.msie && bowser.version <= 9) && document.documentElement) { $(document.documentElement).on("compositionstart", handleCompositionEvent); $(document.documentElement).on("compositionend", handleCompositionEvent); @@ -4930,7 +4930,7 @@ function Ace2Inner(){ function handleBlur(evt) { - if (mybrowser.msie) + if (bowser.msie) { // a fix: in IE, clicking on a control like a button outside the // iframe can "blur" the editor, causing it to stop getting @@ -5001,7 +5001,7 @@ function Ace2Inner(){ var win = outerWin; var odoc = win.document; var h; - if (mybrowser.opera) h = win.innerHeight; + if (bowser.opera) h = win.innerHeight; else h = odoc.documentElement.clientHeight; if (h) return h; @@ -5330,9 +5330,9 @@ function Ace2Inner(){ { var body = doc.getElementById("innerdocbody"); root = body; // defined as a var in scope outside - if (mybrowser.firefox) $(root).addClass("mozilla"); - if (mybrowser.safari) $(root).addClass("safari"); - if (mybrowser.msie) $(root).addClass("msie"); + if (bowser.firefox) $(root).addClass("mozilla"); + if (bowser.safari) $(root).addClass("safari"); + if (bowser.msie) $(root).addClass("msie"); setClassPresence(root, "authorColors", true); setClassPresence(root, "doesWrap", doesWrap); From f2891e3b8b3c1b0d34c729ba5c14dc4f291d5b7a Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 14:55:29 +0000 Subject: [PATCH 53/81] working --- src/static/js/ace2_inner.js | 14 +++++++------- src/static/js/pad.js | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index dd2f2b12..93739805 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -19,9 +19,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -var _, $, jQuery, plugins, Ace2Common, bowser; -bowser = require('./browser').browser; +var _, $, jQuery, plugins, Ace2Common; +var bowser = require('./browser').browser; if(bowser.msie){ // Honestly fuck IE royally. // Basically every hack we have since V11 causes a problem @@ -30,6 +30,7 @@ if(bowser.msie){ bowser.chrome = true; } } + Ace2Common = require('./ace2_common'); plugins = require('ep_etherpad-lite/static/js/pluginfw/client_plugins'); @@ -43,7 +44,6 @@ var isNodeText = Ace2Common.isNodeText, binarySearchInfinite = Ace2Common.binarySearchInfinite, htmlPrettyEscape = Ace2Common.htmlPrettyEscape, noop = Ace2Common.noop; - var hooks = require('./pluginfw/hooks'); function Ace2Inner(){ @@ -953,7 +953,7 @@ function Ace2Inner(){ showslinenumbers : function(value){ hasLineNumbers = !! value; // disable line numbers on mobile devices - // if (bowser.mobile) hasLineNumbers = false; + if (bowser.mobile) hasLineNumbers = false; setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers); fixView(); }, @@ -4657,17 +4657,17 @@ function Ace2Inner(){ for (var i = 0; i < 2; i++) { var newHeight = root.clientHeight; - var newWidth = root.clientWidth; + var newWidth = (browser.msie ? root.createTextRange().boundingWidth : root.clientWidth); var viewHeight = getInnerHeight() - iframePadBottom - iframePadTop; var viewWidth = getInnerWidth() - iframePadLeft - iframePadRight; if (newHeight < viewHeight) { newHeight = viewHeight; -// if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto'); + if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto'); } else { -// if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll'); + if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll'); } if (doesWrap) { diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 685b420b..5bbf4123 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -494,7 +494,6 @@ var pad = { pad.initTime = +(new Date()); pad.padOptions = clientVars.initialOptions; -console.log("pad", browser); if ((!browser.msie) && (!(browser.firefox && browser.version.indexOf("1.8.") == 0))) { document.domain = document.domain; // for comet From 7237a3b7cc8c43fb206846b6e0492c9d021c7da4 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 14:58:47 +0000 Subject: [PATCH 54/81] bump ueberdb --- src/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/package.json b/src/package.json index 9259b50f..0598a4b6 100644 --- a/src/package.json +++ b/src/package.json @@ -17,7 +17,7 @@ "etherpad-require-kernel" : "1.0.7", "resolve" : "1.0.0", "socket.io" : "1.3.2", - "ueberDB" : "0.2.10", + "ueberDB" : "0.2.11", "express" : "3.8.1", "async" : "0.9.0", "connect" : "2.7.11", @@ -55,5 +55,5 @@ "repository" : { "type" : "git", "url" : "http://github.com/ether/etherpad-lite.git" }, - "version" : "1.5.0" + "version" : "1.5.1" } From a2cb8a2f1933dff672d5cbe6b7671d83b4f2e948 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 15:01:39 +0000 Subject: [PATCH 55/81] rename back to browser --- src/static/js/ace2_inner.js | 76 ++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 93739805..e68a1b66 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -21,13 +21,13 @@ */ var _, $, jQuery, plugins, Ace2Common; -var bowser = require('./browser').browser; -if(bowser.msie){ +var browser = require('./browser').browser; +if(browser.msie){ // Honestly fuck IE royally. // Basically every hack we have since V11 causes a problem - if(parseInt(bowser.version) >= 11){ - delete bowser.msie; - bowser.chrome = true; + if(parseInt(browser.version) >= 11){ + delete browser.msie; + browser.chrome = true; } } @@ -607,7 +607,7 @@ function Ace2Inner(){ // Chrome can't handle the truth.. If CSS rule white-space:pre-wrap // is true then any paste event will insert two lines.. - if(bowser.chrome){ + if(browser.chrome){ $("#innerdocbody").css({"white-space":"normal"}); } @@ -953,7 +953,7 @@ function Ace2Inner(){ showslinenumbers : function(value){ hasLineNumbers = !! value; // disable line numbers on mobile devices - if (bowser.mobile) hasLineNumbers = false; + if (browser.mobile) hasLineNumbers = false; setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers); fixView(); }, @@ -1320,7 +1320,7 @@ function Ace2Inner(){ else { var offsetIntoLine = 0; - var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, bowser); + var filteredFunc = linestylefilter.getFilterStack(text, textAndClassFunc, browser); var lineNum = rep.lines.indexOfEntry(lineEntry); var aline = rep.alines[lineNum]; filteredFunc = linestylefilter.getLineStyleFilter( @@ -1568,13 +1568,13 @@ function Ace2Inner(){ lastDirtyNode = (lastDirtyNode && isNodeDirty(lastDirtyNode) && lastDirtyNode); if (firstDirtyNode && lastDirtyNode) { - var cc = makeContentCollector(isStyled, bowser, rep.apool, null, className2Author); + var cc = makeContentCollector(isStyled, browser, rep.apool, null, className2Author); cc.notifySelection(selection); var dirtyNodes = []; for (var n = firstDirtyNode; n && !(n.previousSibling && n.previousSibling == lastDirtyNode); n = n.nextSibling) { - if (bowser.msie) + if (browser.msie) { // try to undo IE's pesky and overzealous linkification try @@ -1614,7 +1614,7 @@ function Ace2Inner(){ if (linesWrapped > 0) { - if(!bowser.msie){ + if(!browser.msie){ // chrome decides in it's infinite wisdom that its okay to put the browsers visisble window in the middle of the span // an outcome of this is that the first chars of the string are no longer visible to the user.. Yay chrome.. // Move the browsers visible area to the left hand side of the span @@ -1919,7 +1919,7 @@ function Ace2Inner(){ if (charsLeft === 0) { var index = 0; - if (bowser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0) + if (browser.msie && line == (rep.lines.length() - 1) && lineNode.childNodes.length === 0) { // best to stay at end of last empty div in IE index = 1; @@ -2912,7 +2912,7 @@ function Ace2Inner(){ function doCreateDomLine(nonEmpty) { - if (bowser.msie && (!nonEmpty)) + if (browser.msie && (!nonEmpty)) { var result = { node: null, @@ -2972,7 +2972,7 @@ function Ace2Inner(){ } else { - return domline.createDomLine(nonEmpty, doesWrap, bowser, doc); + return domline.createDomLine(nonEmpty, doesWrap, browser, doc); } } @@ -3239,7 +3239,7 @@ function Ace2Inner(){ var dirtiness = {}; dirtiness.nodeId = uniqueId(n); dirtiness.knownHTML = n.innerHTML; - if (bowser.msie) + if (browser.msie) { // adding a space to an "empty" div in IE designMode doesn't // change the innerHTML of the div's parent; also, other @@ -3256,7 +3256,7 @@ function Ace2Inner(){ var data = getAssoc(n, "dirtiness"); if (!data) return true; if (n.id !== data.nodeId) return true; - if (bowser.msie) + if (browser.msie) { if (n.innerText !== data.knownText) return true; } @@ -3591,7 +3591,7 @@ function Ace2Inner(){ // On Mac and Linux, move right moves to end of word and move left moves to start; // on Windows, always move to start of word. // On Windows, Firefox and IE disagree on whether to stop for punctuation (FF says no). - if (bowser.msie && forwardNotBack) + if (browser.msie && forwardNotBack) { while ((!isDone()) && isWordChar(nextChar())) { @@ -3662,13 +3662,13 @@ function Ace2Inner(){ if (isModKey) return; // If the key is a keypress and the browser is opera and the key is enter, do nothign at all as this fires twice. - if (keyCode == 13 && bowser.opera && (type == "keypress")){ + if (keyCode == 13 && browser.opera && (type == "keypress")){ return; // This stops double enters in Opera but double Tabs still show on single tab keypress, adding keyCode == 9 to this doesn't help as the event is fired twice } var specialHandled = false; - var isTypeForSpecialKey = ((bowser.msie || bowser.safari || bowser.chrome) ? (type == "keydown") : (type == "keypress")); - var isTypeForCmdKey = ((bowser.msie || bowser.safari || bowser.chrome) ? (type == "keydown") : (type == "keypress")); + var isTypeForSpecialKey = ((browser.msie || browser.safari || browser.chrome) ? (type == "keydown") : (type == "keypress")); + var isTypeForCmdKey = ((browser.msie || browser.safari || browser.chrome) ? (type == "keydown") : (type == "keypress")); var stopped = false; inCallStackIfNecessary("handleKeyEvent", function() @@ -3884,7 +3884,7 @@ function Ace2Inner(){ /* Attempt to apply some sanity to cursor handling in Chrome after a copy / paste event We have to do this the way we do because rep. doesn't hold the value for keyheld events IE if the user presses and holds the arrow key .. Sorry if this is ugly, blame Chrome's weird handling of viewports after new content is added*/ - if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && bowser.chrome){ + if((evt.which == 37 || evt.which == 38 || evt.which == 39 || evt.which == 40) && browser.chrome){ var viewport = getViewPortTopBottom(); var myselection = document.getSelection(); // get the current caret selection, can't use rep. here because that only gives us the start position not the current var caretOffsetTop = myselection.focusNode.parentNode.offsetTop || myselection.focusNode.offsetTop; // get the carets selection offset in px IE 214 @@ -3955,10 +3955,10 @@ function Ace2Inner(){ } // Is part of multi-keystroke international character on Firefox Mac - var isFirefoxHalfCharacter = (bowser.firefox && evt.altKey && charCode === 0 && keyCode === 0); + var isFirefoxHalfCharacter = (browser.firefox && evt.altKey && charCode === 0 && keyCode === 0); // Is part of multi-keystroke international character on Safari Mac - var isSafariHalfCharacter = (bowser.safari && evt.altKey && keyCode == 229); + var isSafariHalfCharacter = (browser.safari && evt.altKey && keyCode == 229); if (thisKeyDoesntTriggerNormalize || isFirefoxHalfCharacter || isSafariHalfCharacter) { @@ -4072,7 +4072,7 @@ function Ace2Inner(){ // each of which has node (a magicdom node), index, and maxIndex. If the node // is a text node, maxIndex is the length of the text; else maxIndex is 1. // index is between 0 and maxIndex, inclusive. - if (bowser.msie) + if (browser.msie) { var browserSelection; try @@ -4368,7 +4368,7 @@ function Ace2Inner(){ maxIndex: pt.maxIndex }; } - if (bowser.msie) + if (browser.msie) { // Oddly enough, accessing scrollHeight fixes return key handling on IE 8, // presumably by forcing some kind of internal DOM update. @@ -4663,11 +4663,11 @@ function Ace2Inner(){ if (newHeight < viewHeight) { newHeight = viewHeight; - if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto'); + if (browser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'auto'); } else { - if (bowser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll'); + if (browser.msie) setIfNecessary(outerWin.document.documentElement.style, 'overflowY', 'scroll'); } if (doesWrap) { @@ -4681,7 +4681,7 @@ function Ace2Inner(){ setIfNecessary(iframe.style, "width", newWidth + "px"); setIfNecessary(sideDiv.style, "height", newHeight + "px"); } - if (bowser.firefox) + if (browser.firefox) { if (!doesWrap) { @@ -4780,14 +4780,14 @@ function Ace2Inner(){ } return false; } - if (bowser.msie || bowser.safari) + if (browser.msie || browser.safari) { setIfNecessary(root, 'contentEditable', (newVal ? 'true' : 'false')); } else { var wasSet = setIfNecessary(doc, 'designMode', (newVal ? 'on' : 'off')); - if (wasSet && newVal && bowser.opera) + if (wasSet && newVal && browser.opera) { // turning on designMode clears event handlers bindTheEventHandlers(); @@ -4853,11 +4853,11 @@ function Ace2Inner(){ $(document).on("keyup", handleKeyEvent); $(document).on("click", handleClick); $(root).on("blur", handleBlur); - if (bowser.msie) + if (browser.msie) { $(document).on("click", handleIEOuterClick); } - if (bowser.msie) $(root).on("paste", handleIEPaste); + if (browser.msie) $(root).on("paste", handleIEPaste); // Don't paste on middle click of links $(root).on("paste", function(e){ @@ -4867,7 +4867,7 @@ function Ace2Inner(){ }) // CompositionEvent is not implemented below IE version 8 - if ( !(bowser.msie && bowser.version <= 9) && document.documentElement) + if ( !(browser.msie && browser.version <= 9) && document.documentElement) { $(document.documentElement).on("compositionstart", handleCompositionEvent); $(document.documentElement).on("compositionend", handleCompositionEvent); @@ -4930,7 +4930,7 @@ function Ace2Inner(){ function handleBlur(evt) { - if (bowser.msie) + if (browser.msie) { // a fix: in IE, clicking on a control like a button outside the // iframe can "blur" the editor, causing it to stop getting @@ -5001,7 +5001,7 @@ function Ace2Inner(){ var win = outerWin; var odoc = win.document; var h; - if (bowser.opera) h = win.innerHeight; + if (browser.opera) h = win.innerHeight; else h = odoc.documentElement.clientHeight; if (h) return h; @@ -5330,9 +5330,9 @@ function Ace2Inner(){ { var body = doc.getElementById("innerdocbody"); root = body; // defined as a var in scope outside - if (bowser.firefox) $(root).addClass("mozilla"); - if (bowser.safari) $(root).addClass("safari"); - if (bowser.msie) $(root).addClass("msie"); + if (browser.firefox) $(root).addClass("mozilla"); + if (browser.safari) $(root).addClass("safari"); + if (browser.msie) $(root).addClass("msie"); setClassPresence(root, "authorColors", true); setClassPresence(root, "doesWrap", doesWrap); From 26a158447074dc3048c26882379cbc09c7c8d4a5 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 15:21:15 +0000 Subject: [PATCH 56/81] fix tests w/ new context --- tests/frontend/specs/bold.js | 2 +- tests/frontend/specs/caret.js | 2 +- tests/frontend/specs/indentation.js | 2 +- tests/frontend/specs/italic.js | 2 +- tests/frontend/specs/redo.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/frontend/specs/bold.js b/tests/frontend/specs/bold.js index bffb281b..b54466e4 100644 --- a/tests/frontend/specs/bold.js +++ b/tests/frontend/specs/bold.js @@ -44,7 +44,7 @@ describe("bold button", function(){ //select this text element $firstTextElement.sendkeys('{selectall}'); - if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE + if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE var evtType = "keypress"; }else{ var evtType = "keydown"; diff --git a/tests/frontend/specs/caret.js b/tests/frontend/specs/caret.js index 6e68b6f5..14ff8d6a 100644 --- a/tests/frontend/specs/caret.js +++ b/tests/frontend/specs/caret.js @@ -297,7 +297,7 @@ function prepareDocument(n, target){ // generates a random document with random } function keyEvent(target, charCode, ctrl, shift){ // sends a charCode to the window - if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE + if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE var evtType = "keypress"; }else{ var evtType = "keydown"; diff --git a/tests/frontend/specs/indentation.js b/tests/frontend/specs/indentation.js index c8f2cee8..8e851d87 100644 --- a/tests/frontend/specs/indentation.js +++ b/tests/frontend/specs/indentation.js @@ -15,7 +15,7 @@ describe("indentation button", function(){ //select this text element $firstTextElement.sendkeys('{selectall}'); - if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE + if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE var evtType = "keypress"; }else{ var evtType = "keydown"; diff --git a/tests/frontend/specs/italic.js b/tests/frontend/specs/italic.js index 4ef4b408..bf7f2bc6 100644 --- a/tests/frontend/specs/italic.js +++ b/tests/frontend/specs/italic.js @@ -44,7 +44,7 @@ describe("italic some text", function(){ //select this text element $firstTextElement.sendkeys('{selectall}'); - if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE + if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE var evtType = "keypress"; }else{ var evtType = "keydown"; diff --git a/tests/frontend/specs/redo.js b/tests/frontend/specs/redo.js index 00873d14..caa32fee 100644 --- a/tests/frontend/specs/redo.js +++ b/tests/frontend/specs/redo.js @@ -47,7 +47,7 @@ describe("undo button then redo button", function(){ var modifiedValue = $firstTextElement.text(); // get the modified value expect(modifiedValue).not.to.be(originalValue); // expect the value to change - if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.msie){ // if it's a mozilla or IE + if(inner$(window)[0].bowser.firefox || inner$(window)[0].bowser.modernIE){ // if it's a mozilla or IE var evtType = "keypress"; }else{ var evtType = "keydown"; From 3cd8759cec034534a29b753648263b7d08d6cb75 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 15:21:31 +0000 Subject: [PATCH 57/81] expose modernIE value --- src/static/js/ace2_inner.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 0e122e6a..4b84e784 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -28,6 +28,7 @@ if(browser.msie){ if(parseInt(browser.version) >= 11){ delete browser.msie; browser.chrome = true; + browser.modernIE = true; } } From 941cc3c24be22bf5a834e244f78b53836a630bdc Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 15:37:55 +0000 Subject: [PATCH 58/81] url param --- src/static/js/chat.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 82ca15bd..2bf233f7 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -62,6 +62,7 @@ var chat = (function() $('#users').addClass("chatAndUsers"); $("#chatbox").addClass("chatAndUsersChat"); }else{ + padcookie.setPref("chatAndUsers", false); chat.stickToScreen(false); $('#options-stickychat').prop("disabled", false); $('#users').removeClass("chatAndUsers"); From 17fa87552d97a29a703084efdaa2cb67a1c281b9 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 15:48:21 +0000 Subject: [PATCH 59/81] styling --- src/static/css/pad.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index 0ecf91f0..f5ea99d8 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -918,11 +918,12 @@ input[type=checkbox] { display:block !important; right:0px !important; border-radius:0px !important; - height:200px !important; width:182px !important; margin:2px 0 0 0 !important; border: none !important; border-bottom: 1px solid #ccc !important; + height:155px !important; + border-left: 1px solid #ccc !important; } .chatAndUsersChat > div > #titlecross{ display:none; @@ -932,10 +933,11 @@ input[type=checkbox] { padding:0 !important; margin:0 !important; right:0 !important; - top: 315px !important; + top: 200px !important; width:182px !important; border: none !important; padding:5px !important; + border-left: 1px solid #ccc !important; } @media screen and (max-width: 600px) { From 753e8fdf0b2bde3ef53ee866466ca7be3d215e7b Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 16:08:54 +0000 Subject: [PATCH 60/81] working logic --- src/static/js/chat.js | 7 ++++--- src/static/js/pad.js | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 2bf233f7..fb01befe 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -54,16 +54,17 @@ var chat = (function() isStuck = false; } }, - chatAndUsers: function(status){ - if(status || $('#options-chatandusers').prop('checked')){ + chatAndUsers: function(fromInitialCall) + { + if(fromInitialCall || $('#options-chatandusers').prop('checked')){ padcookie.setPref("chatAndUsers", true); chat.stickToScreen(true); + $('#options-stickychat').prop('checked', true) $('#options-stickychat').prop("disabled", "disabled"); $('#users').addClass("chatAndUsers"); $("#chatbox").addClass("chatAndUsersChat"); }else{ padcookie.setPref("chatAndUsers", false); - chat.stickToScreen(false); $('#options-stickychat').prop("disabled", false); $('#users').removeClass("chatAndUsers"); $("#chatbox").removeClass("chatAndUsersChat"); diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 7c2e22c7..77bfab7f 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -784,6 +784,7 @@ var pad = { handleIsFullyConnected: function(isConnected, isInitialConnect) { pad.determineChatVisibility(isConnected && !isInitialConnect); + pad.determineChatAndUsersVisibility(isConnected && !isInitialConnect); pad.determineAuthorshipColorsVisibility(); }, determineChatVisibility: function(asNowConnectedFeedback){ @@ -796,7 +797,7 @@ var pad = { $('#options-stickychat').prop("checked", false); // set the checkbox for off } }, - determineChatAndUsersVisibility: function(){ + determineChatAndUsersVisibility: function(asNowConnectedFeedback){ var chatAUVisCookie = padcookie.getPref('chatAndUsersVisible'); if(chatAUVisCookie){ // if the cookie is set for chat always visible chat.chatAndUsers(true); // stick it to the screen From aee0fd797dd5c914e07f563ca8f0ea099ecab3bd Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 16:11:00 +0000 Subject: [PATCH 61/81] working translation --- src/locales/en.json | 2 +- src/templates/pad.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index de309ba1..cafbd76e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -32,7 +32,7 @@ "pad.settings.padSettings": "Pad Settings", "pad.settings.myView": "My View", "pad.settings.stickychat": "Chat always on screen", - "pad.settings.chatAndUsers": "Show Chat and Users", + "pad.settings.chatandusers": "Show Chat and Users", "pad.settings.colorcheck": "Authorship colors", "pad.settings.linenocheck": "Line numbers", "pad.settings.rtlcheck": "Read content from right to left?", diff --git a/src/templates/pad.html b/src/templates/pad.html index 48b46c41..7c7257cc 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -135,7 +135,7 @@

    - +

    From 657974b5189719ee9b214befdd2fd5f2f3391bed Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 16:40:44 +0000 Subject: [PATCH 62/81] move saved revs notification to gritter --- src/locales/en.json | 1 + src/static/js/pad_savedrevs.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/locales/en.json b/src/locales/en.json index cafbd76e..23bb3a04 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -121,6 +121,7 @@ "timeslider.unnamedauthors": "{{num}} unnamed {[plural(num) one: author, other: authors ]}", "pad.savedrevs.marked": "This revision is now marked as a saved revision", + "pad.savedrevs.timeslider": "You can see saved revisions by visiting the timeslider", "pad.userlist.entername": "Enter your name", "pad.userlist.unnamed": "unnamed", "pad.userlist.guest": "Guest", diff --git a/src/static/js/pad_savedrevs.js b/src/static/js/pad_savedrevs.js index e1552c27..34323b22 100644 --- a/src/static/js/pad_savedrevs.js +++ b/src/static/js/pad_savedrevs.js @@ -18,7 +18,16 @@ var pad; exports.saveNow = function(){ pad.collabClient.sendMessage({"type": "SAVE_REVISION"}); - alert(_("pad.savedrevs.marked")); + $.gritter.add({ + // (string | mandatory) the heading of the notification + title: _("pad.savedrevs.marked"), + // (string | mandatory) the text inside the notification + text: _("pad.savedrevs.timeslider") || "You can view saved revisions in the timeslider", + // (bool | optional) if you want it to fade out on its own or just sit there + sticky: false, + // (int | optional) the time you want it to be alive for before fading out + time: '2000' + }); } exports.init = function(_pad){ From 036dea3d0fd06dd549c73ac5a60a6658f66ff127 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 17:25:06 +0000 Subject: [PATCH 63/81] styling --- src/static/css/pad.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index f5ea99d8..70c15b51 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -925,6 +925,10 @@ input[type=checkbox] { height:155px !important; border-left: 1px solid #ccc !important; } +.chatAndUsers > #otherusers{ + max-height: 100px; + overflow-y: auto; +} .chatAndUsersChat > div > #titlecross{ display:none; } From 6fd0285d4d48a530677eed08d280901f4fe71b54 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 21 Jan 2015 21:36:11 +0000 Subject: [PATCH 64/81] include lineContent in hok --- src/node/utils/ExportHtml.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index 5e5aca84..0bb93326 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -30,8 +30,6 @@ function getPadHTML(pad, revNum, callback) var html; async.waterfall([ // fetch revision atext - - function (callback) { if (revNum != undefined) @@ -416,6 +414,7 @@ function getHTMLFromAtext(pad, atext, authorColors) var lineContentFromHook = hooks.callAllStr("getLineHTMLForExport", { line: line, + lineContent: lineContent, apool: apool, attribLine: attribLines[i], text: textLines[i] From 1f023c52bc8d6ec83174b8387c694b5f313db826 Mon Sep 17 00:00:00 2001 From: Kay Strobach Date: Fri, 23 Jan 2015 08:14:01 +0100 Subject: [PATCH 65/81] Add: How to create an issue How to create an issue and which information should be given --- CONTRIBUTING.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0110151c..b6e1c247 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,31 @@ # Developer Guidelines (Please talk to people on the mailing list before you change this page, see our section on [how to get in touch](https://github.com/ether/etherpad-lite#get-in-touch)) +## How to write a bug report + +* Please be polite, we all are humans and problems can occur. +* Please add as much information as possible, for example + * client os(s) and version(s) + * browser(s) and version(s), is the problem reproduceable on different clients + * special environments like firewalls or antivirus + * host os and version + * npm and nodejs version + * Logfiles if available + * steps to reproduce + * what you expected to happen + * what actually happened +* Please format logfiles and code examples with markdown see github Markdown help below the issue textarea for more information. + +If you send logfiles, please set the loglevel switch DEBUG in your settings.json file: + +``` +/* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */ + "loglevel": "DEBUG", +``` + +The logfile location is defined in startup script or the log is directly shown in the commandline after you have started etherpad. + + ## Important note for pull requests **Pull requests should be issued against the develop branch**. We never pull directly into master. From c878a957b7c9696aa228e0bc14fbc1e6cd907b38 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 24 Jan 2015 02:18:59 +0000 Subject: [PATCH 66/81] fix issue in docs --- doc/api/hooks_server-side.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/hooks_server-side.md b/doc/api/hooks_server-side.md index 251cbf11..32e76ae7 100644 --- a/doc/api/hooks_server-side.md +++ b/doc/api/hooks_server-side.md @@ -314,7 +314,7 @@ exports.exportHtmlAdditionalTags = function(hook, pad, cb){ var padId = pad.id; cb(["massive","jugs"]); }; - +``` ## userLeave Called from src/node/handler/PadMessageHandler.js From 4ecf0dfad2636a7d4d73dcda1bb51d1ad1a7eec7 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 24 Jan 2015 02:24:10 +0000 Subject: [PATCH 67/81] docs for export HTML --- doc/api/hooks_server-side.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/api/hooks_server-side.md b/doc/api/hooks_server-side.md index 32e76ae7..c7e7a43a 100644 --- a/doc/api/hooks_server-side.md +++ b/doc/api/hooks_server-side.md @@ -247,6 +247,30 @@ Things in context: This hook will allow a plug-in developer to re-write each line when exporting to HTML. +Example: +``` +var Changeset = require("ep_etherpad-lite/static/js/Changeset"); + +exports.getLineHTMLForExport = function (hook, context) { + var header = _analyzeLine(context.attribLine, context.apool); + if (header) { + return "<" + header + ">" + context.lineContents + ""; + } +} + +function _analyzeLine(alineAttrs, apool) { + var header = null; + if (alineAttrs) { + var opIter = Changeset.opIterator(alineAttrs); + if (opIter.hasNext()) { + var op = opIter.next(); + header = Changeset.opAttributeValue(op, 'heading', apool); + } + } + return header; +} +``` + ## stylesForExport Called from: src/node/utils/ExportHtml.js From 372063295f54990c0bfcb9a29483e92961ae274b Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 24 Jan 2015 04:09:13 +0000 Subject: [PATCH 68/81] beginning of a hook, needs docs etc --- src/node/utils/ExportHtml.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index 0bb93326..81fc0be9 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -411,6 +411,18 @@ function getHTMLFromAtext(pad, atext, authorColors) } lists = [] + hooks.aCallAll("asyncLineHTMLForExport", { + line: line, + lineContent: lineContent, + apool: apool, + attribLine: attribLines[i], + text: textLines[i] + }, function(err, newLineContent){ + if(newLineContent.length !== 0) lineContent = newLineContent[0]; + // modified lineContent here + }); + + // Old hook probably not to be used.. var lineContentFromHook = hooks.callAllStr("getLineHTMLForExport", { line: line, @@ -419,6 +431,7 @@ function getHTMLFromAtext(pad, atext, authorColors) attribLine: attribLines[i], text: textLines[i] }, " ", " ", ""); + if (lineContentFromHook) { pieces.push(lineContentFromHook, ''); From 9abb85799c70fb66efbf0828de50869d625a1225 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 24 Jan 2015 04:31:50 +0000 Subject: [PATCH 69/81] realization how aCallAll works --- src/node/utils/ExportHtml.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index 81fc0be9..50ff11ad 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -418,7 +418,12 @@ function getHTMLFromAtext(pad, atext, authorColors) attribLine: attribLines[i], text: textLines[i] }, function(err, newLineContent){ - if(newLineContent.length !== 0) lineContent = newLineContent[0]; +//new Line Content is an array of each of the responses from aCallAll.. We should return a function to it +console.error(newLineContent); + if(newLineContent.length !== 0){ +console.error("lC", newLineContent[0]); + lineContent = newLineContent[0]; + } // modified lineContent here }); From 1890ba39766ab6146683a43c05ae64077272e3d0 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 24 Jan 2015 05:14:38 +0000 Subject: [PATCH 70/81] working, might need polish its pretty late --- src/node/utils/ExportHtml.js | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index 50ff11ad..10c2fe5f 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -411,31 +411,26 @@ function getHTMLFromAtext(pad, atext, authorColors) } lists = [] - hooks.aCallAll("asyncLineHTMLForExport", { + var context = { line: line, lineContent: lineContent, apool: apool, attribLine: attribLines[i], text: textLines[i] - }, function(err, newLineContent){ -//new Line Content is an array of each of the responses from aCallAll.. We should return a function to it -console.error(newLineContent); - if(newLineContent.length !== 0){ -console.error("lC", newLineContent[0]); - lineContent = newLineContent[0]; - } - // modified lineContent here + } + + // first context below seems superfluos + hooks.aCallAll("asyncLineHTMLForExport", context, function(err, newLineFunction){ + newLineFunction.forEach(function(fn){ + context.lineContent = fn(context); // note the fn + }); + //new Line Content is an array of each of the responses from aCallAll.. + // We should return a function to it + lineContent = context.lineContent; // modified lineContent here }); // Old hook probably not to be used.. - var lineContentFromHook = hooks.callAllStr("getLineHTMLForExport", - { - line: line, - lineContent: lineContent, - apool: apool, - attribLine: attribLines[i], - text: textLines[i] - }, " ", " ", ""); + var lineContentFromHook = hooks.callAllStr("getLineHTMLForExport", context, " ", " ", ""); if (lineContentFromHook) { From 6b0cf29af6cdf0810910f345357a6ce8409d3f09 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Sat, 24 Jan 2015 06:34:41 +0100 Subject: [PATCH 71/81] Stop processing a message without auth (i.e. a client did not send CLIENT_READY) --- src/node/handler/PadMessageHandler.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 3228330e..7ea5039d 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -257,11 +257,10 @@ exports.handleMessage = function(client, message) // FIXME: Use a hook instead // FIXME: Allow to override readwrite access with readonly - // FIXME: A message might arrive but wont have an auth object, this is obviously bad so we should deny it // Simulate using the load testing tool if(!sessioninfos[client.id].auth){ console.error("Auth was never applied to a session. If you are using the stress-test tool then restart Etherpad and the Stress test tool.") - callback(); + return; }else{ var auth = sessioninfos[client.id].auth; var checkAccessCallback = function(err, statusObject) From 713b369fc3d3576650e377d9b51abf09f2c1f9f3 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sat, 24 Jan 2015 12:49:17 +0100 Subject: [PATCH 72/81] Add 'last update' column to plugins table --- src/static/js/admin/plugins.js | 4 ++-- src/templates/admin/plugins.html | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/static/js/admin/plugins.js b/src/static/js/admin/plugins.js index a1ad624a..6c939dc2 100644 --- a/src/static/js/admin/plugins.js +++ b/src/static/js/admin/plugins.js @@ -141,14 +141,14 @@ $(document).ready(function () { // Sort $('.sort.up').unbind('click').click(function() { - search.sortBy = $(this).text().toLowerCase(); + search.sortBy = $(this).attr('data-label').toLowerCase(); search.sortDir = false; search.offset = 0; search(search.searchTerm, search.results.length); search.results = []; }) $('.sort.down, .sort.none').unbind('click').click(function() { - search.sortBy = $(this).text().toLowerCase(); + search.sortBy = $(this).attr('data-label').toLowerCase(); search.sortDir = true; search.offset = 0; search(search.searchTerm, search.results.length); diff --git a/src/templates/admin/plugins.html b/src/templates/admin/plugins.html index 96ed08fb..71c4dbcc 100644 --- a/src/templates/admin/plugins.html +++ b/src/templates/admin/plugins.html @@ -78,6 +78,7 @@ Name Description Version + Last update @@ -86,6 +87,7 @@ +

    From da86110f58400e4b7bc4ce9d0539f97cfcf88d45 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sat, 24 Jan 2015 12:55:17 +0100 Subject: [PATCH 73/81] Use https to download plugins.json --- src/static/js/pluginfw/installer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js index 35e42c17..cd2ed330 100644 --- a/src/static/js/pluginfw/installer.js +++ b/src/static/js/pluginfw/installer.js @@ -61,7 +61,7 @@ exports.availablePlugins = null; var cacheTimestamp = 0; exports.getAvailablePlugins = function(maxCacheAge, cb) { - request("http://static.etherpad.org/plugins.json", function(er, response, plugins){ + request("https://static.etherpad.org/plugins.json", function(er, response, plugins){ if (er) return cb && cb(er); if(exports.availablePlugins && maxCacheAge && Math.round(+new Date/1000)-cacheTimestamp <= maxCacheAge) { return cb && cb(null, exports.availablePlugins) From 378ed022698f044c662f6e1310d161d52c3d7df9 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 24 Jan 2015 13:30:03 +0000 Subject: [PATCH 74/81] docs --- doc/api/hooks_server-side.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/doc/api/hooks_server-side.md b/doc/api/hooks_server-side.md index c7e7a43a..75c3902b 100644 --- a/doc/api/hooks_server-side.md +++ b/doc/api/hooks_server-side.md @@ -245,7 +245,7 @@ Things in context: 2. attribLine - line attributes 3. text - line text -This hook will allow a plug-in developer to re-write each line when exporting to HTML. +This hook will allow a plug-in developer to re-write each line when exporting to HTML. Note that you problably don't want to use this plugin and will probably get better results from `asyncLineHTMLForExport` Example: ``` @@ -271,6 +271,39 @@ function _analyzeLine(alineAttrs, apool) { } ``` +## asyncLineHTMLForExport +Called from: src/node/utils/ExportHtml.js + +Things in context: + +1. The context of the line +2. lineContents - The HTML of the line +3. Attribute pool +4. Attribute line +5. Line Text + +This hook will allow functions to be returned to modify the HTML. + +Example: + +``` +exports.asyncLineHTMLForExport = function (hook, context, cb) { + cb(rewriteLine); +} + +function rewriteLine(context){ + var lineContent = context.lineContent; + sizes.forEach(function(size){ + size = size.replace("fs",""); + if(lineContent){ + lineContent = lineContent.replace(" Date: Sat, 24 Jan 2015 13:39:45 +0000 Subject: [PATCH 75/81] boop --- src/node/utils/ExportHtml.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index 10c2fe5f..962f6993 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -419,13 +419,14 @@ function getHTMLFromAtext(pad, atext, authorColors) text: textLines[i] } - // first context below seems superfluos + // See https://github.com/ether/etherpad-lite/issues/2486 hooks.aCallAll("asyncLineHTMLForExport", context, function(err, newLineFunction){ + // For each function returned by the hook call + // Process the text based on the function newLineFunction.forEach(function(fn){ context.lineContent = fn(context); // note the fn }); - //new Line Content is an array of each of the responses from aCallAll.. - // We should return a function to it + // We now have a line that has been processed by each hook function lineContent = context.lineContent; // modified lineContent here }); From e41b3ae0a3db1ff7ac8e32d129aa5ebf0ef51fca Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 24 Jan 2015 15:13:26 +0000 Subject: [PATCH 76/81] updated CL --- CHANGELOG.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 762ef39e..599ff78e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,28 @@ +# 1.5.1 + * NEW: High rez ICON + * NEW: Use HTTPS for plugins.json download + * NEW: Add 'last update' column + * NEW: Show users and chat at the same time + * NEW: Support io.js + * Fix: removeAttributeOnLine now works properly + * Fix: Plugin search and list + * Fix: Issue where unauthed request could cause error + * Fix: Privacy issue with .etherpad export + * Fix: Freeze deps to improve bisectability + * Fix: IE, everything. IE is so broken. + * Fix: Timeslider proxy + * Fix: All backend tests pass + * Fix: Better support for Export into HTML + * Fix: Timeslider stars + * Fix: Translation update + * Fix: Check filesystem if Abiword exists + * Fix: Docs formatting + * Fix: Move Save Revision notification to a gritter message + * Fix: UeberDB MySQL Timeout issue + * Fix: Indented +9 list items + * Fix: Don't paste on middle click of + * SECURITY Fix: Issue where a malformed URL could cause EP to disclose installation location + # 1.5.0 * NEW: Lots of performance improvements for page load times * NEW: Hook for adding CSS to Exports From af7cd91a823cbf13350580ca1ef824694baf9bae Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 24 Jan 2015 15:14:19 +0000 Subject: [PATCH 77/81] formatting --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 599ff78e..94be6477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # 1.5.1 - * NEW: High rez ICON + * NEW: High resolution Icon * NEW: Use HTTPS for plugins.json download * NEW: Add 'last update' column * NEW: Show users and chat at the same time From c80a64a379373e72524a313ed5b05d2203672115 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sat, 24 Jan 2015 19:24:20 +0100 Subject: [PATCH 78/81] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94be6477..75a9f327 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ * Fix: Issue where unauthed request could cause error * Fix: Privacy issue with .etherpad export * Fix: Freeze deps to improve bisectability - * Fix: IE, everything. IE is so broken. + * Fix: IE, everything. IE is so broken. * Fix: Timeslider proxy * Fix: All backend tests pass * Fix: Better support for Export into HTML @@ -20,7 +20,7 @@ * Fix: Move Save Revision notification to a gritter message * Fix: UeberDB MySQL Timeout issue * Fix: Indented +9 list items - * Fix: Don't paste on middle click of + * Fix: Don't paste on middle click of link * SECURITY Fix: Issue where a malformed URL could cause EP to disclose installation location # 1.5.0 From f3e5682a0ff99786a9a35745497ad33d5b8d9876 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 24 Jan 2015 18:31:19 +0000 Subject: [PATCH 79/81] fix issue with load of showuserandchat --- src/static/js/chat.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index fb01befe..ce9a0033 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -22,6 +22,7 @@ var hooks = require('./pluginfw/hooks'); var chat = (function() { var isStuck = false; + var userAndChat = false; var gotInitialMessages = false; var historyPointer = 0; var chatMentions = 0; @@ -56,13 +57,14 @@ var chat = (function() }, chatAndUsers: function(fromInitialCall) { - if(fromInitialCall || $('#options-chatandusers').prop('checked')){ + if(!userAndChat || fromInitialCall){ padcookie.setPref("chatAndUsers", true); chat.stickToScreen(true); $('#options-stickychat').prop('checked', true) $('#options-stickychat').prop("disabled", "disabled"); $('#users').addClass("chatAndUsers"); $("#chatbox").addClass("chatAndUsersChat"); + userAndChat = true; }else{ padcookie.setPref("chatAndUsers", false); $('#options-stickychat').prop("disabled", false); From aca745ddf6a180e17c461bfb352281ee1f3acb1c Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 25 Jan 2015 02:44:10 +0000 Subject: [PATCH 80/81] tell installer if old etherpad needs updating during plugin install --- src/node/hooks/express/adminplugins.js | 2 +- src/static/js/admin/plugins.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node/hooks/express/adminplugins.js b/src/node/hooks/express/adminplugins.js index 8e372f1c..34eafd0b 100644 --- a/src/node/hooks/express/adminplugins.js +++ b/src/node/hooks/express/adminplugins.js @@ -83,7 +83,7 @@ exports.socketio = function (hook_name, args, cb) { socket.on("install", function (plugin_name) { installer.install(plugin_name, function (er) { if(er) console.warn(er) - socket.emit("finished:install", {plugin: plugin_name, error: er? er.message : null}); + socket.emit("finished:install", {plugin: plugin_name, code: er? er.code : null, error: er? er.message : null}); }); }); diff --git a/src/static/js/admin/plugins.js b/src/static/js/admin/plugins.js index 6c939dc2..d337da03 100644 --- a/src/static/js/admin/plugins.js +++ b/src/static/js/admin/plugins.js @@ -225,6 +225,9 @@ $(document).ready(function () { socket.on('finished:install', function(data) { if(data.error) { + if(data.code === "EPEERINVALID"){ + alert("This plugin requires that you update Etherpad so it can operate in it's true glory"); + } alert('An error occured while installing '+data.plugin+' \n'+data.error) $('#installed-plugins .'+data.plugin).remove() } From 4c64b7a670c1db63ad42cfb1e5e78559e0fd1aeb Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 25 Jan 2015 22:08:40 +0100 Subject: [PATCH 81/81] Revert 'asyncLineHTMLForExport' hook --- doc/api/hooks_server-side.md | 35 +---------------------------------- src/node/utils/ExportHtml.js | 12 ------------ 2 files changed, 1 insertion(+), 46 deletions(-) diff --git a/doc/api/hooks_server-side.md b/doc/api/hooks_server-side.md index 75c3902b..c7e7a43a 100644 --- a/doc/api/hooks_server-side.md +++ b/doc/api/hooks_server-side.md @@ -245,7 +245,7 @@ Things in context: 2. attribLine - line attributes 3. text - line text -This hook will allow a plug-in developer to re-write each line when exporting to HTML. Note that you problably don't want to use this plugin and will probably get better results from `asyncLineHTMLForExport` +This hook will allow a plug-in developer to re-write each line when exporting to HTML. Example: ``` @@ -271,39 +271,6 @@ function _analyzeLine(alineAttrs, apool) { } ``` -## asyncLineHTMLForExport -Called from: src/node/utils/ExportHtml.js - -Things in context: - -1. The context of the line -2. lineContents - The HTML of the line -3. Attribute pool -4. Attribute line -5. Line Text - -This hook will allow functions to be returned to modify the HTML. - -Example: - -``` -exports.asyncLineHTMLForExport = function (hook, context, cb) { - cb(rewriteLine); -} - -function rewriteLine(context){ - var lineContent = context.lineContent; - sizes.forEach(function(size){ - size = size.replace("fs",""); - if(lineContent){ - lineContent = lineContent.replace("