From 2d8d9afeb01df0772661348321974627d42c8850 Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Fri, 12 Mar 2010 21:17:30 +0100 Subject: Readonly public pads --- .../etherpad/src/etherpad/control/tag/tag_control.js | 9 ++++++++- trunk/etherpad/src/templates/tag/tag_search.ejs | 19 ++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/trunk/etherpad/src/etherpad/control/tag/tag_control.js b/trunk/etherpad/src/etherpad/control/tag/tag_control.js index 3fe680c..d902b56 100644 --- a/trunk/etherpad/src/etherpad/control/tag/tag_control.js +++ b/trunk/etherpad/src/etherpad/control/tag/tag_control.js @@ -18,6 +18,7 @@ import("faststatic"); import("dispatch.{Dispatcher,PrefixMatcher,forward}"); import("etherpad.utils.*"); +import("etherpad.collab.server_utils"); import("etherpad.globals.*"); import("etherpad.log"); import("etherpad.pad.padusers"); @@ -196,12 +197,17 @@ function onRequest() { var matchingPads; if (tags.length > 0 || antiTags.length > 0) { - var sql = "select p.ID from PAD_META as p, " + querySql.sql + " as q where p.ID = q.ID limit 10" + var sql = "select p.ID, p.TAGS from PAD_TAG_CACHE as p, " + querySql.sql + " as q where p.ID = q.ID limit 10" matchingPads = sqlobj.executeRaw(sql, querySql.params); } else { matchingPads = []; } + for (i = 0; i < matchingPads.length; i++) { + matchingPads[i].TAGS = matchingPads[i].TAGS.split('#'); + } +log.info({pads:matchingPads}); + var isPro = pro_utils.isProDomainRequest(); var userId = padusers.getUserId(); @@ -221,6 +227,7 @@ function onRequest() { renderHtml("tag/tag_search.ejs", { tagsToQuery: tagsToQuery, + padIdToReadonly: server_utils.padIdToReadonly, tags: tags, antiTags: antiTags, newTags: newTags, diff --git a/trunk/etherpad/src/templates/tag/tag_search.ejs b/trunk/etherpad/src/templates/tag/tag_search.ejs index d7fe351..18e88e1 100644 --- a/trunk/etherpad/src/templates/tag/tag_search.ejs +++ b/trunk/etherpad/src/templates/tag/tag_search.ejs @@ -21,6 +21,13 @@ limitations under the License. */ %> helpers.includeCometJs(); helpers.includeJs("json2.js"); helpers.addToHead('\n\n'); + + function inArray(item, arr) { + for (var i = 0; i < arr.length; i++) + if (arr[i] == item) + return true; + return false; + } %>
@@ -94,7 +101,17 @@ limitations under the License. */ %>

Matching pads

-- cgit v1.2.3