diff options
Diffstat (limited to 'etherpad/src/plugins/urlIndexer/templates/urlBrowser.ejs')
-rw-r--r-- | etherpad/src/plugins/urlIndexer/templates/urlBrowser.ejs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/etherpad/src/plugins/urlIndexer/templates/urlBrowser.ejs b/etherpad/src/plugins/urlIndexer/templates/urlBrowser.ejs new file mode 100644 index 0000000..1996dc5 --- /dev/null +++ b/etherpad/src/plugins/urlIndexer/templates/urlBrowser.ejs @@ -0,0 +1,53 @@ +<% /* +Copyright 2009 Google Inc. +Copyright 2010 Pita, Peter Martischka <petermartischka@googlemail.com> + +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<link rel="alternate" href="' + helpers.updateToUrl({format:'rss'}) + '" type="application/rss+xml" title="Query results as RSS" />\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=''; %> + <td id="docbarpadtitle"><span>Browse URLs by tags</span></td> +<% 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'; + } + %> + <dt><a href="<%= matchingUrls[i].URL %>"><%= matchingUrls[i].URL %></a><dt> + <dd> + <a href="<%= matchingPadUrl %>"><%= matchingPadId %></a>: + <% for (j = 0; j < matchingUrls[i].TAGS.length; j++) { %> + <a href="<%= helpers.updateToUrl({query:tagQuery.tagsToQuery(tags.concat([matchingUrls[i].TAGS[j]]), antiTags)}) %>" class="padtag" title="<%= matchingUrls[i].TAGS[j] %> matches">#<%= matchingUrls[i].TAGS[j] %></a> + <% } %> + </dd> + <% } %> +<% return ejs_data; }); %> |