<% /* Copyright 2009 Google Inc. Copyright 2010 Pita, Peter Martischka Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, 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.addToHead('\n\n'); function inArray(item, arr) { for (var i = 0; i < arr.length; i++) if (arr[i] == item) return true; return false; } %> <% template.define('docBarTitle', function() { var ejs_data=''; %> Browse Tags <% return ejs_data; }); %> <% template.define('sideBar', function() { var ejs_data=''; %>
<% if (isProAccountEnabled()) { %> Create new pad Create new team <% } else { %> Create new pad <% } %>
<% return ejs_data; }); %> <% 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; }); %> <% template.define('contentArea', function() { var ejs_data=''; %>
<%: template.use('queryRefiner', function() { var ejs_data=''; %>

Search for pads that have the tag

<% for (i = 0; i < newTags.length; i++) { %> #<%= newTags[i].tagname %> <% } %>

Search for pads that don't have the tag

<% for (i = 0; i < newTags.length; i++) { %> !#<%= newTags[i].tagname %> <% } %> <% return ejs_data; }); %>
<%: template.use('queryResult', function() { var ejs_data=''; %> <% 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; }); %>
<% return ejs_data; }); %>