From 02b51560f50ed3905c8301b46b782b30e55b0dd8 Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Sun, 11 Apr 2010 00:10:29 +0200 Subject: Made twitterStyleTags use page.ejs --- .../twitterStyleTags/controllers/tagBrowser.js | 7 + .../twitterStyleTags/templates/tagBrowser.ejs | 186 ++++++++------------- 2 files changed, 73 insertions(+), 120 deletions(-) (limited to 'etherpad') diff --git a/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js b/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js index 793067d..7071306 100644 --- a/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js +++ b/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js @@ -29,6 +29,7 @@ import("etherpad.pro.pro_accounts.getSessionProAccount"); import("sqlbase.sqlbase"); import("sqlbase.sqlcommon"); import("sqlbase.sqlobj"); +import("etherpad.pad.padutils"); function tagsToQuery(tags, antiTags) { var prefixed = []; @@ -251,7 +252,13 @@ function onRequest() { var isProUser = (isPro && ! padusers.isGuest(userId)); + + padutils.setOptsAndCookiePrefs(request); + var prefs = helpers.getClientVar('cookiePrefsToSet'); + var bodyClass = (prefs.isFullWidth ? "fullwidth" : "limwidth") + var info = { + prefs: prefs, config: appjet.config, tagsToQuery: tagsToQuery, padIdToReadonly: server_utils.padIdToReadonly, diff --git a/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs b/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs index 1f33eb8..955d2e6 100644 --- a/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs +++ b/etherpad/src/plugins/twitterStyleTags/templates/tagBrowser.ejs @@ -14,34 +14,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ %> <% + template.inherit('page.ejs'); helpers.setHtmlTitle("EtherPad: Browse tags"); helpers.includeCss("plugins/twitterStyleTags/tagBrowser.css"); helpers.includeCss("plugins/twitterStyleTags/pad.css"); - helpers.setBodyId("padbody"); - helpers.addBodyClass("limwidth nonpropad nonprouser"); - helpers.includeCss("pad2_ejs.css"); - helpers.includeJs("undo-xpopup.js"); - helpers.includeCometJs(); - helpers.includeJQuery(); - helpers.includeJs("json2.js"); - helpers.includeJs("colorutils.js"); - helpers.includeJs("ace.js"); - helpers.includeJs("collab_client.js"); - helpers.includeJs("draggable.js"); - helpers.includeJs("pad_utils.js"); - helpers.includeJs("pad_cookie.js"); - helpers.includeJs("pad_editor.js"); - helpers.includeJs("pad_userlist.js"); - helpers.includeJs("pad_editbar.js"); - helpers.includeJs("pad_chat.js"); - helpers.includeJs("pad_docbar.js"); - helpers.includeJs("pad_impexp.js"); - helpers.includeJs("pad_savedrevs.js"); - helpers.includeJs("pad_connectionstatus.js"); - helpers.includeJs("pad_modals.js"); - helpers.includeJs("pad2.js"); - helpers.suppressGA(); - helpers.setRobotsPolicy({index: false, follow: false}); helpers.addToHead('\n\n'); function inArray(item, arr) { @@ -51,108 +27,78 @@ limitations under the License. */ %> return false; } %> +<% template.define('docBarTitle', function() { var ejs_data=''; %> + Browse Tags +<% return ejs_data; }); %> -
-
-
-
-
- - <% if (isProAccountHolder) { %> -
<%= toHTML(account.email) %>(sign out)
- <% } else if (isPro) { %> - +<% template.define('sideBar', function() { var ejs_data=''; %> +
+ <% if (isProAccountEnabled()) { %> + + Create new pad + + + Create new team + + <% } else { %> + + Create new pad + <% } %>
-
- - - - - -
Browse Tags 
-
-
-
-
- <% if (isProAccountEnabled()) { %> - - Create new pad - - - Create new team - - <% } else { %> - - Create new pad - - <% } %> -
+
-
+
+<% return ejs_data; }); %> -
-
- -
-
-
-
- -
- Query: - <% if (tags.length == 0 && antiTags.length == 0) { %> - Latest changed pads - <% } else { %> - <% for (i = 0; i < tags.length; i++) { %> - #<%= tags[i] %> - <% } %> - <% for (i = 0; i < antiTags.length; i++) { %> - !#<%= antiTags[i] %> - <% } %> - <% } %> -
-
-
-
-
-

Search for pads that have the tag

- <% for (i = 0; i < newTags.length; i++) { %> - #<%= newTags[i].tagname %> - <% } %> +<% template.define('editBarItemsLeft', function() { var ejs_data=''; %> + + Query: + <% if (tags.length == 0 && antiTags.length == 0) { %> + Latest changed pads + <% } else { %> + <% for (i = 0; i < tags.length; i++) { %> + #<%= tags[i] %> + <% } %> + <% for (i = 0; i < antiTags.length; i++) { %> + !#<%= antiTags[i] %> + <% } %> + <% } %> + +<% return ejs_data; }); %> -

Search for pads that don't have the tag

- <% for (i = 0; i < newTags.length; i++) { %> - !#<%= newTags[i].tagname %> - <% } %> -
+<% template.define('contentArea', function() { var ejs_data=''; %> +
+
+

Search for pads that have the tag

+ <% for (i = 0; i < newTags.length; i++) { %> + #<%= newTags[i].tagname %> + <% } %> -
- <% for (i = 0; i < matchingPads.length; i++) { %> - <% - var matchingPadId = matchingPads[i].ID; - var matchingPadUrl = matchingPadId; - if (!inArray('writable', matchingPads[i].TAGS)) { - matchingPadId = padIdToReadonly(matchingPads[i].ID); - matchingPadUrl = 'ep/pad/view/' + matchingPadId + '/latest'; - } - %> -
<%= matchingPadId %>
-
- <% for (j = 0; j < matchingPads[i].TAGS.length; j++) { %> - #<%= matchingPads[i].TAGS[j] %> - <% } %> -
- <% } %> -
-
-
-
+

Search for pads that don't have the tag

+ <% for (i = 0; i < newTags.length; i++) { %> + !#<%= newTags[i].tagname %> + <% } %> +
-
-
-
+
+ <% for (i = 0; i < matchingPads.length; i++) { %> + <% + var matchingPadId = matchingPads[i].ID; + var matchingPadUrl = matchingPadId; + if (!inArray('writable', matchingPads[i].TAGS)) { + matchingPadId = padIdToReadonly(matchingPads[i].ID); + matchingPadUrl = 'ep/pad/view/' + matchingPadId + '/latest'; + } + %> +
<%= matchingPadId %>
+
+ <% for (j = 0; j < matchingPads[i].TAGS.length; j++) { %> + #<%= matchingPads[i].TAGS[j] %> + <% } %> +
+ <% } %> +
-
-
+<% return ejs_data; }); %> -- cgit v1.2.3-1-g7c22