summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
Diffstat (limited to 'template')
-rw-r--r--template/banner.st10
-rw-r--r--template/head.st2
-rw-r--r--template/messagepane.st10
-rw-r--r--template/search_files.st132
4 files changed, 32 insertions, 122 deletions
diff --git a/template/banner.st b/template/banner.st
index a4229f5..530555c 100644
--- a/template/banner.st
+++ b/template/banner.st
@@ -68,11 +68,11 @@
$if(user_nick)$
<!-- <div id="facebooklike">
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2Fdumpfm%2F240317626149%3Fref%3Dts&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=segoe+ui&amp;colorscheme=dark&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
- </div> ---!>
+ </div> -->
<div id="searchbox">
- <input type="text" name="search-query" id="search-query" />
+ <input type="text" name="search-query" id="search-query" searchstyle="mini" />
<!--<div class="search_icon"></div>-->
</div>
$else$
@@ -109,11 +109,9 @@
- <div id="search-results" style="background-color: white;">
+ <div id="inpage-search-results" style="background-color: white;">
<div id="search-controls">
- <a id="search-control-previous">previous</a>
- <span id="search-control-text"></span>
- <a id="search-control-next">next</a>
+ <span id="search-message"></span>
<a id="search-control-close" href="javascript:Search.close()">close</a>
</div>
<div id="search-results-images"></div>
diff --git a/template/head.st b/template/head.st
index 4171858..ad23a44 100644
--- a/template/head.st
+++ b/template/head.st
@@ -5,7 +5,7 @@
<script type="text/javascript" src="$domain$/static/js/jquery-ui-1.8.effects.min.js"></script>
<script type="text/javascript" src="$domain$/static/js/pichat.js"></script>
<link rel="stylesheet" type="text/css" href="$domain$/static/css/dump.css">
-
+<script>Domain = "$domain$"</script>
$if(!user_nick)$
<link href="$domain$/static/form_login/front.css" media="screen, projection" rel="stylesheet" type="text/css">
diff --git a/template/messagepane.st b/template/messagepane.st
index 673c2ec..d5247f0 100644
--- a/template/messagepane.st
+++ b/template/messagepane.st
@@ -1,13 +1,14 @@
<div id="messagePane">
<style>
#chatbuttons {
- position: absolute;
- right: 25px;
- top: 0px;
+ font-size: 9px;
+ position: fixed;
+ right: 5px;
+ bottom: 0px;
}
#textbutton, #imgbutton, #clearbutton {
float: right;
- background: #CDF8FF;
+ background: #fff;
color: #666;
z-index: 0;
margin-left: 15px;
@@ -16,6 +17,7 @@
#clearbutton {
text-decoration: underline
cursor: pointer;
+ display: none;
}
</style>
<div id="chatbuttons">
diff --git a/template/search_files.st b/template/search_files.st
index 9759f07..4ef0118 100644
--- a/template/search_files.st
+++ b/template/search_files.st
@@ -1,121 +1,31 @@
+<!DOCTYPE html>
<html>
<head>
<title>dump.fm image search</title>
$head()$
<style>
- body{margin:6%;}
- img { max-width: 400px; max-height: 400px;}
- h1 { width: 40%; display:inline-block; margin: 20px; font-size: 30px;}
+ img { max-width: 400px; max-height: 400px;} /* FIX THIS */
+ html,body,img,div{margin:0; border:0; padding:0}
+ body { overflow: visible;}
+ h1 { display:inline-block; margin: 20px; font-size: 30px;}
+ fieldset { display: inline }
+ p { margin-left: 20px; display: inline-block; }
</style>
- </head>
- <body class="profile" style="margin:1%;">
-
+
+<script>
+
+jQuery(document).ready(Search.initFullpage)
+
+</script>
+</head>
+<body>
+
<center>search dumps: <input type="text" name="search-query" id="search-query" /></center><br><br>
- <center><div id="message"></div><br><br></center>
- <div id="content">
- <div id="footerc">
- $footer()$
- </div></div>
+ <center><div id="search-message"></div><br><br></center>
+ <div id="fullpage-search-results">
+ <div id="search-results-images"></div>
+ </div>
- </body>
-
- <script>
- var term = ""
- var imagesPerPage = 25;
- var images = []
-
- var Search = {};
-
- function addScript(term){
- jQuery("#search-script").remove()
- jQuery("head").append("<scr"+"ipt src='/cmd/ghettosearch/"+term+"' id='search-script'></sc"+"ript>")
- }
-
- function setContent(x){
- jQuery("#content").html(x)
- }
-
- function setMessage(x){
- jQuery("#message").html(x)
- }
-
- Search.searchError = function(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 += '<a href="'+images[i]+'"><img src="'+images[i]+'"></a>'
- imageCounter += 1
- }
- contentString += '<br><br>'
- if(num > 0)
- contentString += '<a href="javascript:renderPage('+(num-1)+')"><h1>previous</h1></a> '
- if (images.length > start + imageCounter)
- contentString += ' <a href="javascript:renderPage('+(num+1)+')"><h1>next</h1></a>'
- setContent(contentString)
- }
-
- Search.searchResult = function(results){
- images = []
- var alreadyGot = {}
- if(results === null || results.length == 0) {
- setContent("")
- setMessage("no results found")
- } else {
- for(var r = 0; r<results.length; r++){
- var content = results[r]['content']
- if (content.substring(0,6) == "<safe>") continue; // skip html posts
- var imageUrls = getImagesAsArray(content);
- for (var i=0; i<imageUrls.length; i++){
- var imageUrl = imageUrls[i];
- if (imageUrl in alreadyGot) continue;
- alreadyGot[imageUrl] = true
- var validImage = true;
- for(var t = 0; t<tokens.length; t++){
- if (imageUrl.toLowerCase().indexOf(tokens[t]) == -1) {
- validImage = false;
- break;
- }
- }
- if (validImage)
- images.push(imageUrl);
- }
- }
- if (images.length == 0) {
- setMessage("no results found")
- }
- renderPage(0)
- }
- }
-
- var tokens = []
-
- function doSearch(){
- term = jQuery("#search-query").val().trim().toLowerCase()
- var rawTokens = term.split(" ")
- tokens = []
- for(var t = 0; t < rawTokens.length; t++) {
- if (rawTokens[t].length > 2)
- tokens.push(rawTokens[t])
- }
- if (tokens.length == 0) {
- setMessage("search query too small")
- } else {
- setMessage("searching for '"+tokens.join(" and ")+"'")
- addScript(tokens.join("+"))
- }
- }
- jQuery("#search-query").keydown(ifEnter(doSearch))
-
- </script>
-
+</body>
</html>