summaryrefslogtreecommitdiffstats
path: root/etherpad/src/plugins/twitterStyleTags/controllers
diff options
context:
space:
mode:
authorEgil Moeller <egil.moller@freecode.no>2010-04-12 20:35:34 +0200
committerEgil Moeller <egil.moller@freecode.no>2010-04-12 20:35:34 +0200
commit3ecd19e733897bc26b5a803f06f7aa26d4877f0c (patch)
tree4804519b1b4399f2b6af98dd40245e7fc5fe4d36 /etherpad/src/plugins/twitterStyleTags/controllers
parentf509fce5e7c45299a7798ae1dc0d731eb1eaf1cb (diff)
downloadetherpad-3ecd19e733897bc26b5a803f06f7aa26d4877f0c.tar.gz
etherpad-3ecd19e733897bc26b5a803f06f7aa26d4877f0c.tar.bz2
etherpad-3ecd19e733897bc26b5a803f06f7aa26d4877f0c.zip
Moved some more stuff to the model
Diffstat (limited to 'etherpad/src/plugins/twitterStyleTags/controllers')
-rw-r--r--etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js19
1 files changed, 4 insertions, 15 deletions
diff --git a/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js b/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js
index ac0d949..f0b7470 100644
--- a/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js
+++ b/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js
@@ -35,20 +35,10 @@ import("etherpad.pad.padutils");
function onRequest() {
- var tags = new Array();
- var antiTags = new Array();
-
- if (request.params.query != undefined && request.params.query != '') {
- var query = request.params.query.split(',');
- for (i = 0; i < query.length; i++)
- if (query[i][0] == '!')
- antiTags.push(query[i].substring(1));
- else
- tags.push(query[i]);
- }
+ var tags = tagQuery.queryToTags(request.params.query);
/* Create the pad filter sql */
- var querySql = tagQuery.getQueryToSql(tags.concat(['public']), antiTags);
+ var querySql = tagQuery.getQueryToSql(tags.tags.concat(['public']), tags.antiTags);
/* Use the pad filter sql to figure out which tags to show in the tag browser this time. */
var queryNewTagsSql = tagQuery.newTagsSql(querySql);
@@ -77,7 +67,6 @@ function onRequest() {
var isProUser = (isPro && ! padusers.isGuest(userId));
-
padutils.setOptsAndCookiePrefs(request);
var prefs = helpers.getClientVar('cookiePrefsToSet');
var bodyClass = (prefs.isFullWidth ? "fullwidth" : "limwidth")
@@ -87,8 +76,8 @@ function onRequest() {
config: appjet.config,
tagQuery: tagQuery,
padIdToReadonly: server_utils.padIdToReadonly,
- tags: tags,
- antiTags: antiTags,
+ tags: tags.tags,
+ antiTags: tags.antiTags,
newTags: newTags,
matchingPads: matchingPads,
bodyClass: 'nonpropad',