From 27f25b8c61b18f290a72cf154aa8462ed5bce338 Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Wed, 30 May 2012 17:18:43 +0200 Subject: [PATCH 01/21] Added hook to catch edit events --- src/static/js/ace2_inner.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 723d410f..cc9f1288 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -341,6 +341,11 @@ function Ace2Inner(){ return rep; }; + editorInfo.ace_getAuthor = function() + { + return thisAuthor; + } + var currentCallStack = null; function inCallStack(type, action) @@ -439,6 +444,14 @@ function Ace2Inner(){ try { result = action(); + + hooks.callAll('aceEditEvent', { + callstack: currentCallStack, + editorInfo: editorInfo, + rep: rep, + documentAttributeManager: documentAttributeManager + }); + //console.log("Just did action for: "+type); cleanExit = true; } @@ -522,6 +535,7 @@ function Ace2Inner(){ { return rep.lines.atOffset(charOffset).key; } + function dispose() { From d5faefdeaef04811c7f6059c413c816e5f8b2d49 Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Sat, 9 Jun 2012 10:53:51 -0400 Subject: [PATCH 02/21] Bugfix to setPadHTML. resolves #764 --- src/node/utils/ImportHtml.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/node/utils/ImportHtml.js b/src/node/utils/ImportHtml.js index 4b50b032..5c6bb634 100644 --- a/src/node/utils/ImportHtml.js +++ b/src/node/utils/ImportHtml.js @@ -50,9 +50,7 @@ function setPadHTML(pad, html, callback) } // Get the new plain text and its attributes - var newText = map(result.lines, function (e) { - return e + '\n'; - }).join(''); + var newText = result.lines.join('\n'); apiLogger.debug('newText:'); apiLogger.debug(newText); var newAttribs = result.lineAttribs.join('|1+1') + '|1+1'; From 486f7c904e08f1a524335afe44372fc056f2a0f6 Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Mon, 11 Jun 2012 23:33:17 -0400 Subject: [PATCH 03/21] Bugfix to setHTML - it was ignoring the last letter of each line. fixes issue #768 --- src/node/utils/ImportHtml.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node/utils/ImportHtml.js b/src/node/utils/ImportHtml.js index 5c6bb634..7c638fb8 100644 --- a/src/node/utils/ImportHtml.js +++ b/src/node/utils/ImportHtml.js @@ -20,7 +20,6 @@ var log4js = require('log4js'); var Changeset = require("ep_etherpad-lite/static/js/Changeset"); var contentcollector = require("ep_etherpad-lite/static/js/contentcollector"); -var map = require("ep_etherpad-lite/static/js/ace2_common").map; function setPadHTML(pad, html, callback) { @@ -60,7 +59,7 @@ function setPadHTML(pad, html, callback) var attribsIter = Changeset.opIterator(attribs); var textIndex = 0; var newTextStart = 0; - var newTextEnd = newText.length - 1; + var newTextEnd = newText.length; while (attribsIter.hasNext()) { var op = attribsIter.next(); From 23075138b9ffb643cda3c1842dcbd4fb737ed373 Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Tue, 12 Jun 2012 11:03:09 -0400 Subject: [PATCH 04/21] Lock down npm version to avaoid bug in later version --- src/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.json b/src/package.json index c46abbbf..48750fbc 100644 --- a/src/package.json +++ b/src/package.json @@ -25,7 +25,7 @@ "log4js" : "0.4.1", "jsdom-nocontextifiy" : "0.2.10", "async-stacktrace" : "0.0.2", - "npm" : "1.1", + "npm" : "1.1.24", "ejs" : "0.6.1", "graceful-fs" : "1.1.5", "slide" : "1.1.3", From 048380284189e09ad0012a8e8f57a651402591c6 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 12 Jun 2012 22:52:22 +0200 Subject: [PATCH 05/21] resolve issue #384 and also clear chat counter whenever focus is on chat input. Just a slightly nicer chat experience --- src/static/js/chat.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 23b47667..47b0ae3c 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -114,9 +114,13 @@ var chat = (function() { var count = Number($("#chatcounter").text()); count++; + + // is the users focus already in the chatbox? + var alreadyFocused = $("#chatinput").is(":focus"); + $("#chatcounter").text(count); // chat throb stuff -- Just make it throw for twice as long - if(wasMentioned) + if(wasMentioned && !alreadyFocused) { // If the user was mentioned show for twice as long and flash the browser window if (chatMentions == 0){ title = document.title; @@ -130,7 +134,11 @@ var chat = (function() $('#chatthrob').html(""+authorName+"" + ": " + text).show().delay(2000).hide(400); } } - + // Clear the chat mentions when the user clicks on the chat input box + $('#chatinput').click(function(){ + chatMentions = 0; + document.title = title; + }); self.scrollDown(); }, From 2cbe29eb45ba14bab3196f0e5b0500928164884b Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 12 Jun 2012 14:20:54 -0700 Subject: [PATCH 06/21] Fix pad.js' customStart. Appears that sourcing of static/custom/pad.js was removed from templates/pad.html. This prevented static/custom/pad.js:customStart from running. Add it back to get customStart working again. --- src/templates/pad.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/templates/pad.html b/src/templates/pad.html index 97aaa817..e1babca8 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -320,6 +320,8 @@ + + - +