From cf2f0b72a31a4aba6c03d2a0903a81f8576027fe Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Mon, 4 Jun 2012 14:33:38 +0200 Subject: [PATCH 01/15] More plugin information --- src/node/hooks/express/adminplugins.js | 5 +++++ src/static/js/pluginfw/plugins.js | 14 ++++++++------ src/templates/admin/plugins.html | 3 +++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/node/hooks/express/adminplugins.js b/src/node/hooks/express/adminplugins.js index 7b21206c..fc274a07 100644 --- a/src/node/hooks/express/adminplugins.js +++ b/src/node/hooks/express/adminplugins.js @@ -16,6 +16,11 @@ exports.expressCreateServer = function (hook_name, args, cb) { "ep_etherpad-lite/templates/admin/plugins.html", render_args), {}); }); + args.app.get('/admin/plugins/info', function(req, res) { + res.send(eejs.require( + "ep_etherpad-lite/templates/admin/plugins-info.html", + {}), {}); + }); } exports.socketio = function (hook_name, args, cb) { diff --git a/src/static/js/pluginfw/plugins.js b/src/static/js/pluginfw/plugins.js index 1f66da41..1d486223 100644 --- a/src/static/js/pluginfw/plugins.js +++ b/src/static/js/pluginfw/plugins.js @@ -41,14 +41,16 @@ exports.formatParts = function () { return _.map(exports.parts, function (part) { return part.full_name; }).join("\n"); }; -exports.formatHooks = function () { +exports.formatHooks = function (hook_set_name) { var res = []; - _.chain(exports.hooks).keys().forEach(function (hook_name) { - _.forEach(exports.hooks[hook_name], function (hook) { - res.push(hook.hook_name + ": " + hook.hook_fn_name + " from " + hook.part.full_name); + var hooks = exports.extractHooks(exports.parts, hook_set_name || "hooks"); + + _.chain(hooks).keys().forEach(function (hook_name) { + _.forEach(hooks[hook_name], function (hook) { + res.push("
" + hook.hook_name + "
" + hook.hook_fn_name + " from " + hook.part.full_name + "
"); }); }); - return res.join("\n"); + return "
" + res.join("\n") + "
"; }; exports.loadFn = function (path, hookName) { @@ -62,7 +64,7 @@ exports.loadFn = function (path, hookName) { return fn; }; -exports.extractHooks = function (parts, hook_set_name, plugins) { +exports.extractHooks = function (parts, hook_set_name) { var hooks = {}; _.each(parts,function (part) { _.chain(part[hook_set_name] || {}) diff --git a/src/templates/admin/plugins.html b/src/templates/admin/plugins.html index 97001269..104f6b98 100644 --- a/src/templates/admin/plugins.html +++ b/src/templates/admin/plugins.html @@ -20,6 +20,9 @@

Etherpad Lite

+ + Technical information on installed plugins +

Installed plugins

From 3338db9485b1e97818ba67a6008866cbce15fef0 Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Tue, 5 Jun 2012 13:32:33 +0200 Subject: [PATCH 02/15] Bugfixes --- src/static/js/pluginfw/hooks.js | 2 +- src/templates/admin/plugins-info.html | 30 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/templates/admin/plugins-info.html diff --git a/src/static/js/pluginfw/hooks.js b/src/static/js/pluginfw/hooks.js index 49e46c60..7281cac9 100644 --- a/src/static/js/pluginfw/hooks.js +++ b/src/static/js/pluginfw/hooks.js @@ -102,7 +102,7 @@ exports.aCallAll = function (hook_name, args, cb) { exports.callFirst = function (hook_name, args) { if (!args) args = {}; - if (plugins.hooks[hook_name][0] === undefined) return []; + if (plugins.hooks[hook_name] === undefined) return []; return exports.syncMapFirst(plugins.hooks[hook_name], function (hook) { return hookCallWrapper(hook, hook_name, args); }); diff --git a/src/templates/admin/plugins-info.html b/src/templates/admin/plugins-info.html new file mode 100644 index 00000000..22f87073 --- /dev/null +++ b/src/templates/admin/plugins-info.html @@ -0,0 +1,30 @@ +<% + var plugins = require("ep_etherpad-lite/static/js/pluginfw/plugins"); +%> + + + + Plugin information + + + + +
+

Etherpad Lite

+
+ +

Installed plugins

+
<%= plugins.formatPlugins() %>
+ +

Installed parts

+
<%= plugins.formatParts() %>
+ +

Installed hooks

+

Server side hooks

+
<%= plugins.formatHooks() %>
+ +

Client side hooks

+
<%= plugins.formatHooks("client_hooks") %>
+
+ + From 048380284189e09ad0012a8e8f57a651402591c6 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 12 Jun 2012 22:52:22 +0200 Subject: [PATCH 03/15] 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 04/15] 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 @@ + + - +