<% /* 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('tagBrowser.ejs'); helpers.setHtmlTitle("EtherPad: Browse URLs by 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 URLs by tags <% return ejs_data; }); %> <% template.define('queryResult', function() { var ejs_data=''; %> <% for (i = 0; i < matchingUrls.length; i++) { %> <% var matchingPadId = matchingUrls[i].ID; var matchingPadUrl = matchingPadId; if (!inArray('writable', matchingUrls[i].TAGS)) { matchingPadId = padIdToReadonly(matchingUrls[i].ID); matchingPadUrl = 'ep/pad/view/' + matchingPadId + '/latest'; } %>
<%= matchingUrls[i].URL %>
<%= matchingPadId %>: <% for (j = 0; j < matchingUrls[i].TAGS.length; j++) { %> #<%= matchingUrls[i].TAGS[j] %> <% } %>
<% } %> <% return ejs_data; }); %>