From 6b11ae330d735b2af767f8951a78167f373b15fe Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Fri, 25 Nov 2011 09:13:03 +0100 Subject: [PATCH 01/42] added handling of de-indenting when already on higher level --- static/js/ace2_inner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 9c647b6df..e606f88dd 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -3560,10 +3560,10 @@ function OUTER(gscope) foundLists = true; var t = listType[1]; var level = Number(listType[2]); - var newLevel = Math.max(1, Math.min(MAX_LIST_LEVEL, level + (isOut ? -1 : 1))); + var newLevel = Math.max(0, Math.min(MAX_LIST_LEVEL, level + (isOut ? -1 : 1))); if (level != newLevel) { - mods.push([n, t + newLevel]); + mods.push([n, (newLevel > 0) ? t + newLevel : '']); } } } From ea2e7d05507086afc0a5a9f35820736c5aa22ee2 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Fri, 25 Nov 2011 10:29:31 +0100 Subject: [PATCH 02/42] added support for (de)indent of regular text --- static/css/iframe_editor.css | 17 +++++++++++++++++ static/js/ace2_inner.js | 20 ++++++++++---------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/static/css/iframe_editor.css b/static/css/iframe_editor.css index 7be570112..86ca99117 100644 --- a/static/css/iframe_editor.css +++ b/static/css/iframe_editor.css @@ -32,6 +32,23 @@ ul.list-bullet6 { list-style-type: square; } ul.list-bullet7 { list-style-type: disc; } ul.list-bullet8 { list-style-type: circle; } +ul.list-indent1 { margin-left: 1.5em; } +ul.list-indent2 { margin-left: 3em; } +ul.list-indent3 { margin-left: 4.5em; } +ul.list-indent4 { margin-left: 6em; } +ul.list-indent5 { margin-left: 7.5em; } +ul.list-indent6 { margin-left: 9em; } +ul.list-indent7 { margin-left: 10.5em; } +ul.list-indent8 { margin-left: 12em; } + +ul.list-indent1 { list-style-type: none; } +ul.list-indent2 { list-style-type: none; } +ul.list-indent3 { list-style-type: none; } +ul.list-indent4 { list-style-type: none; } +ul.list-indent5 { list-style-type: none; } +ul.list-indent6 { list-style-type: none; } +ul.list-indent7 { list-style-type: none; } +ul.list-indent8 { list-style-type: none; } body { margin: 0; diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index e606f88dd..3da6bf800 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -3548,25 +3548,25 @@ function OUTER(gscope) lastLine = Math.max(firstLine, rep.selEnd[0] - ((rep.selEnd[1] == 0) ? 1 : 0)); var mods = []; - var foundLists = false; for (var n = firstLine; n <= lastLine; n++) { var listType = getLineListType(n); + var t = 'indent'; + var level = 0; if (listType) { listType = /([a-z]+)([12345678])/.exec(listType); if (listType) { - foundLists = true; - var t = listType[1]; - var level = Number(listType[2]); - var newLevel = Math.max(0, Math.min(MAX_LIST_LEVEL, level + (isOut ? -1 : 1))); - if (level != newLevel) - { - mods.push([n, (newLevel > 0) ? t + newLevel : '']); - } + t = listType[1]; + level = Number(listType[2]); } } + var newLevel = Math.max(0, Math.min(MAX_LIST_LEVEL, level + (isOut ? -1 : 1))); + if (level != newLevel) + { + mods.push([n, (newLevel > 0) ? t + newLevel : '']); + } } if (mods.length > 0) @@ -3574,7 +3574,7 @@ function OUTER(gscope) setLineListTypes(mods); } - return foundLists; + return true; } editorInfo.ace_doIndentOutdent = doIndentOutdent; From caf879297461ff94ef9d2a9d0e2e12406a97c722 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Fri, 25 Nov 2011 11:10:57 +0100 Subject: [PATCH 03/42] applying/removing list now preserves the indentation level --- static/js/ace2_inner.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 3da6bf800..bd313f52a 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -5235,7 +5235,8 @@ function OUTER(gscope) var allLinesAreList = true; for (var n = firstLine; n <= lastLine; n++) { - if (!getLineListType(n)) + var listType = getLineListType(n); + if (!listType || listType.slice(0, 'bullet'.length) != 'bullet') { allLinesAreList = false; break; @@ -5245,8 +5246,16 @@ function OUTER(gscope) var mods = []; for (var n = firstLine; n <= lastLine; n++) { + var t = ''; + var level = 0; + var listType = /([a-z]+)([12345678])/.exec(getLineListType(n)); + if (listType) + { + t = listType[1]; + level = Number(listType[2]); + } var t = getLineListType(n); - mods.push([n, allLinesAreList ? '' : (t ? t : 'bullet1')]); + mods.push([n, allLinesAreList ? 'indent' + level : (t ? 'bullet' + level : 'bullet1')]); } setLineListTypes(mods); } From 9c14dcd49805628083a16b8890f7e52feebaacea Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Fri, 25 Nov 2011 11:19:22 +0100 Subject: [PATCH 04/42] updated menu bar labels --- static/pad.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/pad.html b/static/pad.html index a8ab0dc5b..c84de5b1d 100644 --- a/static/pad.html +++ b/static/pad.html @@ -50,12 +50,12 @@
  • - +
  • - +
  • From 7d184a681ab9d550671109b3eb69dc2565099419 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Sat, 26 Nov 2011 00:02:25 +0100 Subject: [PATCH 05/42] fix indenting while cursor is in the line --- static/js/ace2_inner.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index bd313f52a..08c8d01b3 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -3538,7 +3538,8 @@ function OUTER(gscope) function doIndentOutdent(isOut) { - if (!(rep.selStart && rep.selEnd)) + if (!(rep.selStart && rep.selEnd) || + ((rep.selStart[0] == rep.selEnd[0]) && (rep.selStart[1] == rep.selEnd[1]) && rep.selEnd[1] > 1)) { return false; } From 2cc47211f98899b96b0e592f76da3b67ddc69b82 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Sun, 27 Nov 2011 19:10:22 +0100 Subject: [PATCH 06/42] one more 'one line fix'. Fixes bullet list auto replacing indented text whenever a new char is appended to it. This was caused by 'bullet' being hardcoded in a regular expression :/ --- static/js/contentcollector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/contentcollector.js b/static/js/contentcollector.js index a776affec..577b24c6c 100644 --- a/static/js/contentcollector.js +++ b/static/js/contentcollector.js @@ -473,7 +473,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class if (tname == "ul") { var type; - var rr = cls && /(?:^| )list-(bullet[12345678])\b/.exec(cls); + var rr = cls && /(?:^| )list-([a-z]+[12345678])\b/.exec(cls); type = rr && rr[1] || "bullet" + String(Math.min(_MAX_LIST_LEVEL, (state.listNesting || 0) + 1)); oldListTypeOrNull = (_enterList(state, type) || 'none'); } From 5838e7ee7f5b0c64617bcbc68122babc74d78dbb Mon Sep 17 00:00:00 2001 From: Kai Hermann Date: Tue, 30 Aug 2011 16:47:16 +0200 Subject: [PATCH 07/42] fixed merge conflicts --- static/timeslider.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/timeslider.html b/static/timeslider.html index 4dbf8d939..c1ea176d8 100644 --- a/static/timeslider.html +++ b/static/timeslider.html @@ -271,7 +271,11 @@ Return to pad From 054af3da770c248fc467050185af7f5abc9e74a2 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 28 Nov 2011 02:42:30 +0000 Subject: [PATCH 08/42] Change embe this pad to share and embed this pad --- static/pad.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/pad.html b/static/pad.html index 8ae65aadf..1186cd8e4 100644 --- a/static/pad.html +++ b/static/pad.html @@ -86,7 +86,7 @@
  • - +
  • From e5d12f1d56cb8867099219778e9f97d2736a1830 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Mon, 28 Nov 2011 11:18:47 -0800 Subject: [PATCH 09/42] cherry picking @Yaco-Sistemas commit to fix IE 8 --- static/js/ace2_common.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/js/ace2_common.js b/static/js/ace2_common.js index 184785863..de2fede1c 100644 --- a/static/js/ace2_common.js +++ b/static/js/ace2_common.js @@ -76,10 +76,13 @@ function isArray(testObject) if (typeof exports !== "undefined") { - var navigator = {userAgent: "node-js"}; + userAgent = "node-js"; +} +else +{ + userAgent = navigator.userAgent.toLowerCase(); } // Figure out what browser is being used (stolen from jquery 1.2.1) -userAgent = navigator.userAgent.toLowerCase(); var browser = { version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1], safari: /webkit/.test(userAgent), From ec56ca75adb02278974551fdff21d4e140aac0d9 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Mon, 28 Nov 2011 11:26:36 -0800 Subject: [PATCH 10/42] Fixed #135, thx to @Wikinaut --- static/js/pad2.js | 2 +- static/timeslider.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/pad2.js b/static/js/pad2.js index d194b6607..6f398bade 100644 --- a/static/js/pad2.js +++ b/static/js/pad2.js @@ -174,7 +174,7 @@ function handshake() function sendClientReady(isReconnect) { var padId = document.location.pathname.substring(document.location.pathname.lastIndexOf("/") + 1); - padId = unescape(padId); // unescape neccesary due to Safari and Opera interpretation of spaces + padId = decodeURIComponent(padId); // unescape neccesary due to Safari and Opera interpretation of spaces if(!isReconnect) document.title = document.title + " | " + padId; diff --git a/static/timeslider.html b/static/timeslider.html index c1ea176d8..11c5ef7f4 100644 --- a/static/timeslider.html +++ b/static/timeslider.html @@ -62,7 +62,7 @@ //get the padId out of the url var urlParts= document.location.pathname.split("/"); - padId = urlParts[urlParts.length-2]; + padId = decodeURIComponent(urlParts[urlParts.length-2]); //set the title document.title = document.title + " | " + padId; From deedc17ca803051fbb3750df0881a08aeb7a1ea9 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Mon, 28 Nov 2011 11:28:06 -0800 Subject: [PATCH 11/42] Added backup and patch files to .gitignore. Makes life a bit easier --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ab91434bd..50cd6e212 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ bin/abiword.exe bin/node.exe etherpad-lite-win.zip var/dirty.db -bin/convertSettings.json \ No newline at end of file +bin/convertSettings.json +*~ +*.patch \ No newline at end of file From 769892a736b7334b85a040cb6e7cd1eb4415ee85 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 28 Nov 2011 20:45:27 +0000 Subject: [PATCH 12/42] Show QR code on read only and non read only options --- static/js/pad_editbar.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/static/js/pad_editbar.js b/static/js/pad_editbar.js index 7cea3c1af..97bd7f85b 100644 --- a/static/js/pad_editbar.js +++ b/static/js/pad_editbar.js @@ -206,15 +206,14 @@ var padeditbar = (function() { if ($('#readonlyinput').is(':checked')) { - $('#qrcode').show(); var basePath = document.location.href.substring(0, document.location.href.indexOf("/p/")); var readonlyLink = basePath + "/ro/" + clientVars.readOnlyId; $('#embedinput').val("