summaryrefslogtreecommitdiff
path: root/template/browser.st
diff options
context:
space:
mode:
authordumpfmprod <dumpfmprod@ubuntu.(none)>2010-04-02 20:59:42 -0400
committerdumpfmprod <dumpfmprod@ubuntu.(none)>2010-04-02 20:59:42 -0400
commit55a11d9eff6a4edf43db48cf02c5491530c3324e (patch)
treefbe213c241931e2d465e5676297f333c086cff9e /template/browser.st
parent4479097093127a20a40a9dceb604bf4290c09a2d (diff)
Ryder's template changes
Diffstat (limited to 'template/browser.st')
-rwxr-xr-xtemplate/browser.st267
1 files changed, 258 insertions, 9 deletions
diff --git a/template/browser.st b/template/browser.st
index 721bb98..868e0ea 100755
--- a/template/browser.st
+++ b/template/browser.st
@@ -2,8 +2,12 @@
<head>
<title>dump.fm | Image Search Beta</title>
$head()$
- <link rel="stylesheet" type="text/css" href="/static/browser.css">
+ <link rel="stylesheet" type="text/css" href="/static/css/browser.css">
<script type="text/javascript" src="/static/gritter/js/jquery.gritter.js"></script>
+<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
+ <script src="/static/js/dumpsearch.js" type="text/javascript"></script>
+ <script src="/static/js/FancyZoom.js" type="text/javascript"></script>
+<script src="/static/js/FancyZoomHTML.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/static/gritter/css/jquery.gritter.css" />
@@ -49,19 +53,264 @@
</div>
<div id="messagePane">
<div id="messageList">
- <iframe src="/static/search/browser.html"
- allowtransparency="true"
- scrolling="auto" ></iframe>
+
+<div id="ish">
+<form onSubmit="searchImages(); return false;" >
+<div align="left">
+<div style=" font-size:30;
+ text-shadow: 1px 1px 1px #000, 2px 3px 1px #f0e;
+color:#fff;
+font-weight:bold;">image search</div>
+ <tr>
+ <td colspan="2"><br>
+ <input name="q" type="text" id="q" onChange="searchImages();" size="10%">
+ <input type="submit" name="submit" id="submit" class="msgSubmit"value="Search Images">
+
+ <label>
+ </label>
+ </td>
+ <div align="left">
+ <div align="left">
+ <table class="search" width="425" border="0" cellpadding="5" cellspacing="0">
+
+
+
+ </table>
+
+
+ </div>
+</div>
+ <div id="description">
+
+
+ </div>
+ <div>
+
+
+ <div align="left">
+ <table class="search" width="425" border="0" cellpadding="5" cellspacing="0">
+ <tr>
+ <td colspan="2">
+ <p>
+ <label>where:
+ <select name="site" id="site" onChange="searchImages();">
+ <option value="flickr.com" selected>flickr</option>
+ <option value="istockphoto.com">istockphoto</option>
+ <option value="photobucket.com">photobucket</option>
+ <option value="imikimi.com">imikimi</option>
+ <option value="blingee.com">Blingee</option>
+ <option value="myspace.com">myspace</option>
+ <option value="ning.com">ning.com</option>
+ <option value="mudspace.com">MudSpace</option>
+ <option value="gov">US Government</option>
+ <option value="wordpress.com">wordpress</option>
+ <option value="blogger.com">blogger</option>
+ <option value="typepad.com">typepad</option>
+ <option value="webshots.com">webshots</option>
+ <option value="blackplanet.com">Black Planet</option>
+ <option value="http://i.walmartimages.com/">walmart</option>
+ <option value="http://www.ibiblio.org">ibiblio</option>
+ <option value="deviantart.com">deviant art</option>
+ <option value="glitter-graphics.com">Glitter Graphics</option>
+ <option value="corbis.com">corbis</option>
+ <option value="made-in-china.com">made in china</option>
+ <option value="0" selected>EVERYWHERE</option>
+ </select>
+ </label>
+ <label>
+ <input name="showFaces" type="checkbox" onClick="searchImages();">
+ Only Faces</label>
+ <div style="display:none;">&#x2605;<label> hot shit</label>&#x2605;
+ <input type="radio" name="safeSearch" id="safeSearch2" value="off" onClick="searchImages();"checked>
+ Always ON</div>
+ </td>
+ </tr>
+
+
+
+ </tr>
+ <tr>
+ <td colspan="2"><p>
+ <label>File Type</label>
+ <input type="radio" name="type" value="jpg" onClick="searchImages();">
+ JPG
+ <input name="type" type="radio" value="png" onClick="searchImages();">
+ PNG
+ <input name="type" type="radio" value="bmp" onClick="searchImages();">
+ BMP
+ <input type="radio" name="type" value="gif" onClick="searchImages();">
+ GIF
+ <input type="radio" name="type" value="0" checked onClick="searchImages();">
+ Any</p></td>
+ </tr>
+ <tr>
+ <td colspan="2"><p>
+ <label>Image Size</label>
+ <input type="radio" name="size" value="small" onClick="searchImages();">
+ Small
+ <input name="size" type="radio" value="medium" onClick="searchImages();">
+ Medium
+ <input type="radio" name="size" value="large" onClick="searchImages();">
+ Large
+ <input type="radio" name="size" value="xlarge" onClick="searchImages();">
+ XXL
+ <input type="radio" name="size" value="0" checked onClick="searchImages();">
+ Everything</p></td>
+ </tr>
+ <tr>
+ <td colspan="2"><p>
+ <label>Image Color</label>
+ <input type="radio" name="color" value="bw" onClick="searchImages();">
+ Black &amp; White
+ <input name="color" type="radio" value="gray" onClick="searchImages();">
+ Gray
+ <input type="radio" name="color" value="color" onClick="searchImages();">
+ Color
+ <input type="radio" name="color" value="0" checked onClick="searchImages();">
+ Whateva</p></td>
+ </tr>
+ </table>
+
+ </div>
+ </div>
+ </div>
+
+ <tr>
+ <td colspan="2"><div id="searchControl">
+ <div align="left">Loading...
+ </div>
+ </div></td>
+ </tr>
+ <div align="left">
+ </table>
+ </div>
+</form>
+<div align="left">
+</div> </div>
+</div></div>
</div>
</div>
</div>
</div>
- </div>
-</div>
-</div>
-
- </div>
+
+<script type="text/javascript">
+ google.load('search', '1');
+ google.setOnLoadCallback(searchImages, true);
+
+ function searchImages() {
+ var control = new google.search.SearchControl();
+ control.setResultSetSize(google.search.Search.LARGE_RESULTSET);
+ control.setNoResultsString("Sorry but no images match your search criteria. Please modify your search query and try again.");
+ control.setLinkTarget(google.search.Search.LINK_TARGET_BLANK);
+
+ var options = new google.search.SearcherOptions();
+ options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
+
+ var searcher = new google.search.ImageSearch();
+
+ for (var i = 0; i < document.forms[0].safeSearch.length; i++) {
+ if (document.forms[0].safeSearch[i].checked) {
+ if (document.forms[0].safeSearch[i].value == "off")
+ searcher.setRestriction(GSearch.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_OFF);
+ else if (document.forms[0].safeSearch[i].value == "moderate")
+ searcher.setRestriction(GSearch.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_MODERATE);
+ else if (document.forms[0].safeSearch[i].value == "strict")
+ searcher.setRestriction(GSearch.RESTRICT_SAFESEARCH, google.search.Search.SAFESEARCH_STRICT);
+ else
+ searcher.setRestriction(GSearch.RESTRICT_SAFESEARCH, null);
+ break;
+ }
+ }
+
+ for (var i = 0; i < document.forms[0].size.length; i++) {
+ if (document.forms[0].size[i].checked) {
+ if (document.forms[0].size[i].value == "small")
+ searcher.setRestriction(GimageSearch.RESTRICT_IMAGESIZE, google.search.ImageSearch.IMAGESIZE_SMALL);
+ else if (document.forms[0].size[i].value == "medium")
+ searcher.setRestriction(GimageSearch.RESTRICT_IMAGESIZE, google.search.ImageSearch.IMAGESIZE_MEDIUM);
+ else if (document.forms[0].size[i].value == "large")
+ searcher.setRestriction(GimageSearch.RESTRICT_IMAGESIZE, google.search.ImageSearch.IMAGESIZE_LARGE);
+ else if (document.forms[0].size[i].value == "xlarge")
+ searcher.setRestriction(GimageSearch.RESTRICT_IMAGESIZE, google.search.ImageSearch.IMAGESIZE_EXTRA_LARGE);
+ else
+ searcher.setRestriction(GimageSearch.RESTRICT_IMAGESIZE, null);
+ break;
+ }
+ }
+
+ for (var i = 0; i < document.forms[0].type.length; i++) {
+ if (document.forms[0].type[i].checked) {
+ if (document.forms[0].type[i].value == "bmp")
+ searcher.setRestriction(GimageSearch.RESTRICT_FILETYPE, google.search.ImageSearch.FILETYPE_BMP);
+ else if (document.forms[0].type[i].value == "jpg")
+ searcher.setRestriction(GimageSearch.RESTRICT_FILETYPE, google.search.ImageSearch.FILETYPE_JPG);
+ else if (document.forms[0].type[i].value == "png")
+ searcher.setRestriction(GimageSearch.RESTRICT_FILETYPE, google.search.ImageSearch.FILETYPE_PNG);
+ else if (document.forms[0].type[i].value == "gif")
+ searcher.setRestriction(GimageSearch.RESTRICT_FILETYPE, google.search.ImageSearch.FILETYPE_GIF);
+ else
+ searcher.setRestriction(GimageSearch.RESTRICT_FILETYPE, null);
+ break;
+ }
+ }
+
+ for (var i = 0; i < document.forms[0].color.length; i++) {
+ if (document.forms[0].color[i].checked) {
+ if (document.forms[0].color[i].value == "bw")
+ searcher.setRestriction(GimageSearch.RESTRICT_COLORIZATION, google.search.ImageSearch.COLORIZATION_BLACK_AND_WHITE );
+ else if (document.forms[0].color[i].value == "gray")
+ searcher.setRestriction(GimageSearch.RESTRICT_COLORIZATION, google.search.ImageSearch.COLORIZATION_GRAYSCALE);
+ else if (document.forms[0].color[i].value == "color")
+ searcher.setRestriction(GimageSearch.RESTRICT_COLORIZATION, google.search.ImageSearch.COLORIZATION_COLOR);
+ else
+ searcher.setRestriction(GimageSearch.RESTRICT_COLORIZATION, null);
+ break;
+ }
+ }
+
+ var list = document.forms[0].site;
+ if (list.options[list.selectedIndex].value == 0)
+ searcher.setSiteRestriction(null);
+ else
+ searcher.setSiteRestriction(list.options[list.selectedIndex].value);
+
+ for (var i = 0; i < document.forms[0].site.length; i++) {
+ if (document.forms[0].site[i].checked) {
+ if (document.forms[0].site[i].value == 0)
+ searcher.setSiteRestriction(null);
+ else
+ searcher.setSiteRestriction(document.forms[0].site[i].value);
+ break;
+ }
+ }
+
+ if (document.forms[0].showFaces.checked)
+ searcher.setRestriction(GimageSearch.RESTRICT_IMAGETYPE, GimageSearch.IMAGETYPE_FACES);
+ else
+ searcher.setRestriction(GimageSearch.RESTRICT_IMAGETYPE);
+
+ control.addSearcher(searcher, options);
+
+ function keepResult(res) {
+ $.ajax({
+ type: 'POST',
+ timeout: 5000,
+ url: '/msg',
+ data: { 'room': 'dumpfm', 'content': res.unescapedUrl },
+ cache: false,
+ dataType: 'json'
+ });
+ };
+
+ control.setOnKeepCallback(this, keepResult, 'DUMP THIS');
+ control.draw(document.getElementById("searchControl"));
+
+ control.execute(document.getElementById('q').value);
+ return false;
+ }
+ </script>
+
<div id="footerc">
<p>
$footer()$</p>