From c1fc8bcf052c2c7e9d912c4af0f3c33f345ac64d Mon Sep 17 00:00:00 2001 From: tim b Date: Sat, 17 Jul 2010 00:03:19 -0700 Subject: better search --- template/banner.st | 38 ++++++++--------- template/google_analytics.st | 2 +- template/head.st | 20 --------- template/search_script.st | 98 -------------------------------------------- 4 files changed, 19 insertions(+), 139 deletions(-) delete mode 100644 template/search_script.st (limited to 'template') diff --git a/template/banner.st b/template/banner.st index 9630bd2..d9ff644 100644 --- a/template/banner.st +++ b/template/banner.st @@ -35,45 +35,43 @@ - $if(isadmin)$ - $endif$
- $if(user_nick)$ +$if(user_nick)$ want a room? contact us! - checkout the image vortex!! $else$ Talk with pictures! - checkout the nifty dump fm image vortex! $endif$ $if(isadmin)$ - news - gossip - art - gif - design - fashion - NAUGHTY BOYS DELIGHT - $endif$ +$endif$
- $if(user_nick)$ +$if(user_nick)$
Logout
- $else$ +
+$else$
- $form_login()$ + $form_login()$ +
+$endif$ +
+
+ previous + + next + close +
+
- $endif$ -

-$if(isadmin)$ - -$endif$
diff --git a/template/google_analytics.st b/template/google_analytics.st index 4d81b8b..48cda8b 100644 --- a/template/google_analytics.st +++ b/template/google_analytics.st @@ -13,4 +13,4 @@ qacct:"p-a3mCwIEHECjGE" + \ No newline at end of file diff --git a/template/head.st b/template/head.st index 7ff5828..a898df8 100644 --- a/template/head.st +++ b/template/head.st @@ -3,26 +3,6 @@ - - - diff --git a/template/search_script.st b/template/search_script.st deleted file mode 100644 index 94461b3..0000000 --- a/template/search_script.st +++ /dev/null @@ -1,98 +0,0 @@ -var term = "" -var imagesPerPage = 25; -var images = [] -function addScript(term) { - jQuery("#search-script").remove() - jQuery("head").append("") -} - -function setContent(x){ - jQuery("#searchresults").html(x) -} - -function setMessage(x){ - jQuery("#message").html(x) -} - -function searchError(error){ - setContent("") - setMessage(error) -} - -function renderPage(num){ - if (images.length > 0) - setMessage("page " + (num + 1)); - var contentString = '' - var start = num * imagesPerPage - var imageCounter = 0 - for(var i = start; i < images.length; i++){ - if(imageCounter > imagesPerPage) break; - contentString += '' - imageCounter += 1 - } - contentString += '

' - if(num > 0) - contentString += '

previous

' - if (images.length > start + imageCounter) - contentString += '

next

' - setContent(contentString) -} - -function searchResult(results){ - images = [] - var alreadyGot = {} - if(results === null || results.length == 0) { - setContent("") - setMessage("no results found") - } else { - for(var r = 0; r") continue; // skip html posts - var imageUrls = getImagesAsArray(content); - for (var i=0; i 2) - tokens.push(rawTokens[t]) - } - if (tokens.length == 0) { - setMessage("search query too small") - } else { - setMessage("searching for '"+tokens.join(" and ")+"'") - addScript(tokens.join("+")) - } -} - -// only search every 800ms while someone is typing -function keyHandler(){ - if (keyHandler.timeout) clearTimeout(keyHandler.timeout); - keyHandler.timeout = setTimeout(doSearch, 800) -} - -jQuery("#search-query").keyup(keyHandler) \ No newline at end of file -- cgit v1.2.3-70-g09d2