diff options
author | Egil Moeller <egil.moller@freecode.no> | 2010-04-20 21:00:41 +0200 |
---|---|---|
committer | Egil Moeller <egil.moller@freecode.no> | 2010-04-20 21:00:41 +0200 |
commit | 0b4ed7432d750f98aa6f62e5515b57f3e7e8a4d4 (patch) | |
tree | 75e9a3cd5b5cd75f6d1f2cbed9773bd8b042a200 | |
parent | bd2190f0453f6a189b84b3ff2f1af05d5e023801 (diff) | |
download | etherpad-0b4ed7432d750f98aa6f62e5515b57f3e7e8a4d4.tar.gz etherpad-0b4ed7432d750f98aa6f62e5515b57f3e7e8a4d4.tar.xz etherpad-0b4ed7432d750f98aa6f62e5515b57f3e7e8a4d4.zip |
Home & pad/url search buttons
-rw-r--r-- | etherpad/src/plugins/twitterStyleTags/hooks.js | 11 | ||||
-rw-r--r-- | etherpad/src/plugins/twitterStyleTags/main.js | 4 | ||||
-rw-r--r-- | etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs | 7 | ||||
-rw-r--r-- | etherpad/src/plugins/urlIndexer/hooks.js | 7 | ||||
-rw-r--r-- | 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 ["<td class='docbarbutton'><a href='/ep/tag/'>Home</a></td>"]; +} + +function docbarItemsTagBrowser() { + return ["<td class='docbarbutton'><a href='/ep/tag/'>Pads</a></td>"]; +} + 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. */ %> <td id="docbarpadtitle"><span>Browse Tags</span></td> <% return ejs_data; }); %> +<% + template.define('docBarItems', function() { + return plugins.callHookStr('docbarItemsTagBrowserPad', {}, '', '', '') + + plugins.callHookStr('docbarItemsTagBrowser', {}, '', '', ''); + }); +%> + <% template.define('sideBar', function() { var ejs_data=''; %> <div id="padusers"> <% 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 ["<td class='docbarbutton'><a href='/ep/url/'>URLs</a></td>"]; +} + 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; |