From 0b4ed7432d750f98aa6f62e5515b57f3e7e8a4d4 Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Tue, 20 Apr 2010 21:00:41 +0200 Subject: Home & pad/url search buttons --- etherpad/src/plugins/twitterStyleTags/hooks.js | 11 ++++++++++- etherpad/src/plugins/twitterStyleTags/main.js | 4 +++- .../src/plugins/twitterStyleTags/templates/tagBrowser.ejs | 7 +++++++ etherpad/src/plugins/urlIndexer/hooks.js | 7 ++++++- etherpad/src/plugins/urlIndexer/main.js | 3 ++- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/etherpad/src/plugins/twitterStyleTags/hooks.js b/etherpad/src/plugins/twitterStyleTags/hooks.js index 9465ccc..1072579 100644 --- a/etherpad/src/plugins/twitterStyleTags/hooks.js +++ b/etherpad/src/plugins/twitterStyleTags/hooks.js @@ -44,4 +44,13 @@ function padModelWriteToDB(args) { sqlobj.insert("PAD_TAG", {PAD_ID: args.padId, TAG_ID: tag_row['ID']}); } } -} \ No newline at end of file +} + +function docbarItemsAll() { + return ["Home"]; +} + +function docbarItemsTagBrowser() { + return ["Pads"]; +} + diff --git a/etherpad/src/plugins/twitterStyleTags/main.js b/etherpad/src/plugins/twitterStyleTags/main.js index 34d5d85..d64abff 100644 --- a/etherpad/src/plugins/twitterStyleTags/main.js +++ b/etherpad/src/plugins/twitterStyleTags/main.js @@ -5,13 +5,15 @@ import("sqlbase.sqlobj"); import("sqlbase.sqlcommon"); function init() { - this.hooks = ['handlePath', 'aceGetFilterStack', 'aceCreateDomLine', 'padModelWriteToDB']; + this.hooks = ['handlePath', 'aceGetFilterStack', 'aceCreateDomLine', 'padModelWriteToDB', 'docbarItemsAll', 'docbarItemsTagBrowser']; this.client = new main.init(); this.description = 'Twitter-style tags allows the user to tag pads by writing #tagname anywhere in the pad text. Tags are automatically linked to searches for that tag in other pads. This plugin also provides an alternative home-page for Etherpad with a display of the last changed public pads as well as that information available as an RSS stream.'; this.handlePath = hooks.handlePath; this.aceGetFilterStack = main.aceGetFilterStack; this.aceCreateDomLine = main.aceCreateDomLine; this.padModelWriteToDB = hooks.padModelWriteToDB; + this.docbarItemsAll = hooks.docbarItemsAll; + this.docbarItemsTagBrowser = hooks.docbarItemsTagBrowser; this.install = install; this.uninstall = uninstall; diff --git a/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs b/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs index ea1076e..e101196 100644 --- a/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs +++ b/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs @@ -31,6 +31,13 @@ limitations under the License. */ %> Browse Tags <% return ejs_data; }); %> +<% + template.define('docBarItems', function() { + return plugins.callHookStr('docbarItemsTagBrowserPad', {}, '', '', '') + + plugins.callHookStr('docbarItemsTagBrowser', {}, '', '', ''); + }); +%> + <% template.define('sideBar', function() { var ejs_data=''; %>
<% if (isProAccountEnabled()) { %> diff --git a/etherpad/src/plugins/urlIndexer/hooks.js b/etherpad/src/plugins/urlIndexer/hooks.js index 45d37f1..e0ff050 100644 --- a/etherpad/src/plugins/urlIndexer/hooks.js +++ b/etherpad/src/plugins/urlIndexer/hooks.js @@ -41,4 +41,9 @@ function padModelWriteToDB(args) { sqlobj.insert("PAD_URL", {PAD_ID: args.padId, URL: new_urls[i]}); } } -} \ No newline at end of file +} + +function docbarItemsTagBrowser() { + return ["URLs"]; +} + diff --git a/etherpad/src/plugins/urlIndexer/main.js b/etherpad/src/plugins/urlIndexer/main.js index 0b2847f..18bdef1 100644 --- a/etherpad/src/plugins/urlIndexer/main.js +++ b/etherpad/src/plugins/urlIndexer/main.js @@ -4,10 +4,11 @@ import("sqlbase.sqlobj"); import("sqlbase.sqlcommon"); function init() { - this.hooks = ['padModelWriteToDB', 'handlePath']; + this.hooks = ['padModelWriteToDB', 'handlePath', 'docbarItemsTagBrowser']; this.description = 'Indexes URLs linked to in pads so that they can be displayed outside pads, searched for etc.'; this.padModelWriteToDB = hooks.padModelWriteToDB; this.handlePath = hooks.handlePath; + this.docbarItemsTagBrowser = hooks.docbarItemsTagBrowser; this.install = install; this.uninstall = uninstall; -- cgit v1.2.3-1-g7c22