summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--photoblaster/_file.py25
-rw-r--r--photoblaster/config.py10
-rw-r--r--photoblaster/db/models/imcmd.py6
-rw-r--r--photoblaster/modules/__init__.py10
-rw-r--r--photoblaster/modules/pbconcat/__init__.py3
-rwxr-xr-xphotoblaster/modules/pbgenerate/__init__.py18
-rw-r--r--photoblaster/param/base.py6
-rw-r--r--photoblaster/param/color.py2
-rw-r--r--photoblaster/param/img_url.py30
-rw-r--r--photoblaster/param/int_.py8
-rw-r--r--photoblaster/param/json.py2
-rw-r--r--photoblaster/param/raw.py6
-rw-r--r--photoblaster/s3/cli.py2
-rw-r--r--photoblaster/server.py12
-rw-r--r--photoblaster/templates/gallery.html8
-rw-r--r--run_module_examples.py1
l---------share/frontend/css/cssreset.css1
l---------share/frontend/css/general.css1
l---------share/frontend/css/jquery-ui-1.8.16.custom.css1
l---------share/frontend/css/main.css1
l---------share/frontend/css/normalize.css1
l---------share/frontend/css/overlay.css1
l---------share/frontend/css/result.css1
l---------share/frontend/css/sketch.css1
l---------share/frontend/css/unsemantic-grid-responsive.css1
-rw-r--r--share/frontend/gallery-static/js/main.js38
-rw-r--r--share/frontend/gallery-static/main.css15
l---------share/frontend/js/colors_iframe.js1
l---------share/frontend/js/display_result.js1
l---------share/frontend/js/inputs.js1
l---------share/frontend/js/jquery-1.6.4.min.js1
l---------share/frontend/js/jquery-ui.min.js1
l---------share/frontend/js/main.js1
l---------share/frontend/js/overlay.js1
l---------share/frontend/js/preview.js1
l---------share/frontend/js/sketch.js1
l---------share/frontend/js/sliders.js1
l---------share/frontend/js/urls.js1
l---------share/frontend/js/username.js1
-rw-r--r--share/install/requirements.txt1
40 files changed, 144 insertions, 80 deletions
diff --git a/photoblaster/_file.py b/photoblaster/_file.py
index 9fb0de2..9d5d4a2 100644
--- a/photoblaster/_file.py
+++ b/photoblaster/_file.py
@@ -1,7 +1,7 @@
import os
import re
import random
-import sha
+import hashlib
import sys
import time
from subprocess import Popen, PIPE, call
@@ -38,10 +38,18 @@ class File(object):
def _make_creation_time(self):
self._creation_time = str(int(time.time()))
+
def _make_hashdir(self):
- self._hashdir = sha.new(
- self.get_filepath()
- ).hexdigest()[:2]
+
+ _hashdir = hashlib.sha256()
+ filepath = self.get_filepath()
+ encoded_filepath = filepath.encode('utf-8')
+ _hashdir.update(encoded_filepath)
+ hash_result = _hashdir.hexdigest()
+ last_two_chars = hash_result[-2:]
+ print(last_two_chars)
+ print(type(last_two_chars))
+ self._hashdir = last_two_chars
@classmethod
def from_url(cls, url, **kwargs):
@@ -97,10 +105,13 @@ class File(object):
def get_dimensions(self):
try:
- ident = (Popen(
+ ident = Popen(
[BIN_IDENTIFY, self.get_filepath()],
- stdout=PIPE).communicate()[0]).split(" ")
- return [int(n) for n in ident[2].split("x")]
+ stdout=PIPE, stderr=PIPE)
+ stdout, stderr = ident.communicate()
+ stdout = stdout.decode('utf-8')
+ stdout = stdout.split(" ")
+ return [int(n) for n in stdout[2].split("x")]
except Exception as e:
sys.stderr.write("Unable to get file dimensions:\n")
sys.stderr.write("%s \n" % e)
diff --git a/photoblaster/config.py b/photoblaster/config.py
index 18ae134..f6547ff 100644
--- a/photoblaster/config.py
+++ b/photoblaster/config.py
@@ -66,21 +66,21 @@ else:
SERVER_PORT = 8999
# s3
-AWS_ACCESS_KEY_ID = 'AKIAIR53VPBXKJMXZIBA'
-AWS_SECRET_ACCESS_KEY = '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'
+AWS_ACCESS_KEY_ID = 'AKIA32234ZXRWXMWTS7I'
+AWS_SECRET_ACCESS_KEY = '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'
BUCKET_NAME = 'i.asdf.us'
-SPECIAL_DOWNLOADERS = ["ryz", "pepper", "RICHARD_GIOVANNI", "dmgk", "kiny"]
+SPECIAL_DOWNLOADERS = ["ryz", "pepper", "RICHARD_GIOVANNI", "dmgk"]
SPECIAL_DOWNLOADERS_MAX_SIZE = 1024 * 1024 * 10
# database
-DB_HOST = "lalalizard.com"
+DB_HOST = "asdf.us"
DB_USER = "asdfus"
DB_PASSWORD = "gTYgT&M6q"
DB_NAME = "asdfus"
if LOCAL:
DB_HOST = "localhost"
-BASE_URL = "http://i.asdf.us"
+BASE_URL = "https://s3.amazonaws.com/i.asdf.us"
#so that dimensions concat size doesn't get too big
PBCONCAT_DIMENSIONS_LIMIT = 700
diff --git a/photoblaster/db/models/imcmd.py b/photoblaster/db/models/imcmd.py
index 0827aac..da29fc3 100644
--- a/photoblaster/db/models/imcmd.py
+++ b/photoblaster/db/models/imcmd.py
@@ -3,7 +3,7 @@
from sqlalchemy import Column, Integer, LargeBinary, String
from photoblaster.db.models import Base, Actions
-import simplejson as json
+import json
from sqlalchemy.orm import class_mapper
class ImCmd(Base, Actions):
@@ -18,8 +18,8 @@ class ImCmd(Base, Actions):
dir = Column(String(2))
oldfile = Column(String(256))
newfile = Column(String(256))
- cmd = Column(LargeBinary)
- dataobj = Column(LargeBinary)
+ cmd = Column(String(1024))
+ dataobj = Column(String(1024))
tag = Column(String(50))
def as_dict(self):
diff --git a/photoblaster/modules/__init__.py b/photoblaster/modules/__init__.py
index 5d9d91a..1e147e8 100644
--- a/photoblaster/modules/__init__.py
+++ b/photoblaster/modules/__init__.py
@@ -3,7 +3,7 @@ import imp
import os
from subprocess import call
from photoblaster.params import Params
-import simplejson as json
+import json
from photoblaster.db.models.imcmd import ImCmd
from photoblaster.config import BIN_CONVERT
@@ -27,7 +27,7 @@ class Modules(object):
return [plugin["name"] for plugin in self._plugins]
def get_module(self, name):
- plugin = filter(lambda n: n["name"] == name, self._plugins)[0]
+ plugin = list(filter(lambda n: n["name"] == name, self._plugins))[0]
return imp.load_module("modules", *plugin["info"]).get_class()
@@ -114,12 +114,12 @@ class ModuleBase(object):
):
try:
_insert_data = {
- 'date': self.get_output_file().get_creation_time(),
+ 'date': int(self.get_output_file().get_creation_time()),
'remote_addr': remote_addr,
'name': str(self.params.username),
'url': self._db_url_param,
'dir': self.get_output_file().get_hashdir(),
- 'oldfile': None,
+ 'oldfile': "",
'newfile': self.get_output_file().get_filename(),
'dataobj': json.dumps(dict(self._input_kwargs)),
'cmd': "; ".join(self.commands),
@@ -127,7 +127,7 @@ class ModuleBase(object):
}
ImCmd.create(**_insert_data)
except Exception as e:
- self.err_warn("Problem sending to database:\n %s" % str(e))
+ self.err_warn(f"Problem sending to database:\n {e}")
def create(self):
pass
diff --git a/photoblaster/modules/pbconcat/__init__.py b/photoblaster/modules/pbconcat/__init__.py
index 68ebc6d..2e17157 100644
--- a/photoblaster/modules/pbconcat/__init__.py
+++ b/photoblaster/modules/pbconcat/__init__.py
@@ -88,7 +88,7 @@ class PbConcat(ModuleBase):
"http://i.asdf.us/im/d9/PbConcat_1457326934-16_donkey.gif"
),
'img_url2': (
- "http://dump.fm/images/20100924/"
+ "http://archive.hump.fm/images/20100924/"
"1285385385062-dumpfm-j1p2m3-animate.gif"),
'username': 'donkey',
'merge_direction': 'down',
@@ -244,6 +244,7 @@ class PbConcat(ModuleBase):
"x".join(image.get_dimensions()),
"xc:%s" % canvas_color,
canvasfile.get_filepath()])
+ print(cmd)
self._call_cmd(cmd)
self._files_created.append(canvasfile)
cmd = ([
diff --git a/photoblaster/modules/pbgenerate/__init__.py b/photoblaster/modules/pbgenerate/__init__.py
index f5cfbc0..f1616ab 100755
--- a/photoblaster/modules/pbgenerate/__init__.py
+++ b/photoblaster/modules/pbgenerate/__init__.py
@@ -3,6 +3,9 @@ from photoblaster.config import BIN_CONVERT, BIN_COMPOSITE, OUTPUT_IMAGE_TYPES,\
DEFAULT_FINALFORMAT
from photoblaster.modules import ModuleBase
from photoblaster._file import File
+from pprint import pprint
+import sys
+
_GRAVITY_PARAMS = [
"NorthWest", "North", "NorthEast", "West",
@@ -149,7 +152,6 @@ class PbGenerate(ModuleBase):
"-compose", self.params.compose, "-layers", "composite",
self.get_output_file().get_filepath()
]
- import sys
sys.stderr.write(' '.join([str(x) for x in cmd]))
sys.stderr.write("\n")
self._call_cmd(cmd)
@@ -157,6 +159,11 @@ class PbGenerate(ModuleBase):
def _convert(self):
"""Imagemagick convert command"""
cmd = [BIN_CONVERT, self.params.url.get_file().get_filepath()]
+ pprint(type(self.params.rotate.value))
+ pprint(type(self.params.rotate))
+ pprint(type(self.params))
+ pprint(self.params.rotate)
+ pprint(self.params.rotate is True)
if self.params.rotate:
cmd += ["-rotate", self.params.rotate]
if self.params.flip:
@@ -171,11 +178,12 @@ class PbGenerate(ModuleBase):
if self.params.nearest and self.params.format == "gif":
cmd += [
"-coalesce", "+map",
- "-interpolate", "Nearest",
- "-interpolative-resize"
+ "-interpolate", "nearest-neighbor",
]
else:
cmd.append("-resize")
+ pprint(self.params.width)
+ pprint(self.params.height)
dimensions_str = "{}x{}".format(
self.params.width or "", self.params.height or ""
)
@@ -198,6 +206,8 @@ class PbGenerate(ModuleBase):
)
]
cmd += [self.get_output_file().get_filepath()]
+ sys.stderr.write(' '.join([str(x) for x in cmd]))
+ sys.stderr.write("\n")
self._call_cmd(cmd)
# if not self.params.format == "jpg":
@@ -226,6 +236,8 @@ class PbGenerate(ModuleBase):
if self.params.format == "jpg":
self.add_white_bg()
if self.params.background:
+ if (self.params.background):
+ print("hi")
self._composite()
super(PbGenerate, self).create()
diff --git a/photoblaster/param/base.py b/photoblaster/param/base.py
index e68cfa4..2e7abb5 100644
--- a/photoblaster/param/base.py
+++ b/photoblaster/param/base.py
@@ -41,6 +41,12 @@ class Param(object):
except Exception as e:
self.err_warn("Unable to set value {}".format(value))
+ def __bool__(self):
+ if self.value:
+ return True
+ else:
+ return False
+
def set_username(self, username):
try:
self.username = username
diff --git a/photoblaster/param/color.py b/photoblaster/param/color.py
index 80a4642..4ccc969 100644
--- a/photoblaster/param/color.py
+++ b/photoblaster/param/color.py
@@ -31,3 +31,5 @@ class Color(Param):
return s.replace(' ', '')
else:
self.err_warn("Not a color: {}\n".format(s))
+
+
diff --git a/photoblaster/param/img_url.py b/photoblaster/param/img_url.py
index bf0899a..61cb2ac 100644
--- a/photoblaster/param/img_url.py
+++ b/photoblaster/param/img_url.py
@@ -4,8 +4,10 @@ from photoblaster.config import MAX_SIZE, SPECIAL_DOWNLOADERS,\
SPECIAL_DOWNLOADERS_MAX_SIZE,\
BIN_IDENTIFY
from photoblaster._file import File
-import urllib2
+import urllib
from subprocess import Popen, PIPE
+from pprint import pprint
+import sys
class Img_url(Param):
@@ -27,6 +29,7 @@ class Img_url(Param):
super(Img_url, self).__init__(classname=classname)
self.set_username(username)
if value:
+ self._bool = True
self._file = File(
namepart=key,
classname=classname,
@@ -40,6 +43,11 @@ class Img_url(Param):
module=module
)
self.url = value
+ else:
+ self._bool = False
+
+ def __bool__(self):
+ return self._bool
def __dict__(self):
return {
@@ -73,15 +81,18 @@ class Img_url(Param):
'User-Agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)',
'Accept': '*/*',
}
- req = urllib2.Request(url, data, headers)
- response = urllib2.urlopen(req)
- return response
+ req = urllib.request.Request(url, method="GET")
+ for k in headers.keys():
+ req.add_header(k, headers[k])
+ resp = None
+ with urllib.request.urlopen(req) as response:
+ resp = urllib.request.urlopen(req).read()
+ return resp
def _download(self, url, destination, max_size=MAX_SIZE):
"""generic download method, checks the size of the filedata"""
- response = self._browser_request(url, None)
+ rawimg = self._browser_request(url, None)
- rawimg = response.read()
if len(rawimg) == 0:
self.err_warn("got zero-length file")
if len(rawimg) > max_size:
@@ -92,8 +103,8 @@ class Img_url(Param):
str(len(rawimg)/1024)
)
)
- f = open(destination, "w")
- f.write(rawimg)
+ f = open(destination, "wb")
+ f.write(bytearray(rawimg))
f.close()
def _image_mimetype(self, f):
@@ -101,7 +112,8 @@ class Img_url(Param):
retrieves the image mimetype from the file header using imagemagick
"""
mimetype = Popen(
- [BIN_IDENTIFY, f], stdout=PIPE
+ [BIN_IDENTIFY, f], stdout=PIPE,
+ encoding='utf8'
).communicate()[0].split(" ")[1].lower()
return mimetype
diff --git a/photoblaster/param/int_.py b/photoblaster/param/int_.py
index 8538e6d..6e6d066 100644
--- a/photoblaster/param/int_.py
+++ b/photoblaster/param/int_.py
@@ -13,11 +13,17 @@ class Int(Param):
if value:
self.value = int(value)
else:
- self.value = 0
+ self.value = ""
except Exception as e:
self.err_warn("Not an int: %s" % str(value))
self.err_warn(str(e))
+ def __bool__(self):
+ if not self.value:
+ return False
+ else:
+ return True
+
def __int__(self):
return int(self.value)
diff --git a/photoblaster/param/json.py b/photoblaster/param/json.py
index 407a1e2..1b70651 100644
--- a/photoblaster/param/json.py
+++ b/photoblaster/param/json.py
@@ -1,6 +1,6 @@
"""Defines the json param type"""
from photoblaster.param import Param
-import simplejson as json
+import json
class Json(Param):
"""Defines the json param type. Loads in a
diff --git a/photoblaster/param/raw.py b/photoblaster/param/raw.py
index 288c6f9..71e697a 100644
--- a/photoblaster/param/raw.py
+++ b/photoblaster/param/raw.py
@@ -12,3 +12,9 @@ class Raw(Param):
def __init__(self, value, classname=""):
super(Raw, self).__init__(classname=classname)
self.value = value or None
+
+ def __bool__(self):
+ if self.value:
+ return True
+ else:
+ return False
diff --git a/photoblaster/s3/cli.py b/photoblaster/s3/cli.py
index 9c0cb78..24d3162 100644
--- a/photoblaster/s3/cli.py
+++ b/photoblaster/s3/cli.py
@@ -27,5 +27,5 @@ class S3Cli(object):
self.log_err_fatal(str(e))
def log_err_fatal(self, msg):
- sys.stderr.write("S3 client error: %s\n", msg)
+ sys.stderr.write(f"S3 client error: {msg}\n")
sys.exit(1)
diff --git a/photoblaster/server.py b/photoblaster/server.py
index 90e1c83..107293e 100644
--- a/photoblaster/server.py
+++ b/photoblaster/server.py
@@ -7,8 +7,8 @@ import sys
import re
import cherrypy
from paste.translogger import TransLogger
-import simplejson as json
-import urllib2
+import json
+import urllib
from photoblaster.modules import Modules, PbProcessError
from photoblaster.db.models.imcmd import ImCmd
@@ -129,8 +129,8 @@ class Server(object):
@self.app.route('/im/proxy', methods=['GET'])
def p_image():
url = request.args.get("url")
- req = urllib2.Request(url=url)
- req = urllib2.urlopen(req)
+ req = urllib.Request(url=url)
+ req = urllib.urlopen(req)
header = req.headers.getheader('content-type')
if re.match(r'image', header, re.IGNORECASE):
return req.read()
@@ -213,7 +213,7 @@ class Server(object):
if request.args.get('text'):
search_params['text'] = request.args['text']
qs.append("text=" + request.args['text'])
- limit = int(request.args.get('limit', 20))
+ limit = int(request.args.get('limit', 30))
if limit > GALLERY_LIMIT:
limit = GALLERY_LIMIT
offset = int(request.args.get('start', 0))
@@ -346,7 +346,7 @@ class Server(object):
))
raise InvalidUsage('Bad Params')
except PbProcessError:
- sys.stderr.write(dict(request_form))
+ sys.stderr.write(json.dumps(request_form))
raise InvalidUsage('Problem with server-side processing')
except Exception as e:
diff --git a/photoblaster/templates/gallery.html b/photoblaster/templates/gallery.html
index 3cf51f5..a4bb3da 100644
--- a/photoblaster/templates/gallery.html
+++ b/photoblaster/templates/gallery.html
@@ -22,7 +22,7 @@ var imagedata = [
<script type="text/javascript" src="/gallery-static/js/main.js"> </script>
<script type="text/javascript" src="/gallery-static/js/jquery.isotope.min.js"></script>
<script type="text/javascript" src="/gallery-static/js/gallery_isotope_config.js?v=3"></script>
-<script type="text/javascript" src="http://asdf.us/js/pbembed.js"></script>
+<script type="text/javascript" src="//asdf.us/js/pbembed.js"></script>
<link href="/gallery-static/style.css" type="text/css" rel="stylesheet" />
</head>
@@ -41,14 +41,13 @@ var imagedata = [
<div id="help">
<b>key controls</b>
<div id="keys">
- <br/>
<div class="small"><i>when composer is launched...</i></div>
<div>ESC toggle</div>
<div>C clear</div>
<div>R reverse</div>
+ <div>BACKSPACE delete</div>
<br/>
<div class="small"><i>in the gallery...</i></div>
- <div>BACKSPACE delete</div>
<div>LEFT ARROW newer</div>
<div>RIGHT ARROW older</div>
</div>
@@ -103,6 +102,9 @@ var imagedata = [
<div class="tag-options" id="Color_Burn">Color_Burn</div>
</div>
</div>
+<div id="search">
+ <input class="pulsate_and_grow" type="text" id="search-q" placeholder="search...">
+</div>
<div id="dump">
<div id="rebus"></div>
<input id="urlz" type="text" />
diff --git a/run_module_examples.py b/run_module_examples.py
index 6a17850..741d0fb 100644
--- a/run_module_examples.py
+++ b/run_module_examples.py
@@ -4,7 +4,6 @@ from photoblaster.modules import Modules
modules = Modules()
for module_name in modules.list_modules():
- if module_name == "pbthresh":
print "\n\n\n"
print "running example for %s" % module_name
cls = modules.get_module(module_name)
diff --git a/share/frontend/css/cssreset.css b/share/frontend/css/cssreset.css
deleted file mode 120000
index 6924554..0000000
--- a/share/frontend/css/cssreset.css
+++ /dev/null
@@ -1 +0,0 @@
-../imgrid/css/cssreset.css \ No newline at end of file
diff --git a/share/frontend/css/general.css b/share/frontend/css/general.css
deleted file mode 120000
index ae33e3a..0000000
--- a/share/frontend/css/general.css
+++ /dev/null
@@ -1 +0,0 @@
-../imgrid/css/general.css \ No newline at end of file
diff --git a/share/frontend/css/jquery-ui-1.8.16.custom.css b/share/frontend/css/jquery-ui-1.8.16.custom.css
deleted file mode 120000
index 36a911f..0000000
--- a/share/frontend/css/jquery-ui-1.8.16.custom.css
+++ /dev/null
@@ -1 +0,0 @@
-../imgrid/css/jquery-ui-1.8.16.custom.css \ No newline at end of file
diff --git a/share/frontend/css/main.css b/share/frontend/css/main.css
deleted file mode 120000
index 4f96fb7..0000000
--- a/share/frontend/css/main.css
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/css/main.css \ No newline at end of file
diff --git a/share/frontend/css/normalize.css b/share/frontend/css/normalize.css
deleted file mode 120000
index 2fbfef8..0000000
--- a/share/frontend/css/normalize.css
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/css/normalize.css \ No newline at end of file
diff --git a/share/frontend/css/overlay.css b/share/frontend/css/overlay.css
deleted file mode 120000
index 264d326..0000000
--- a/share/frontend/css/overlay.css
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/css/overlay.css \ No newline at end of file
diff --git a/share/frontend/css/result.css b/share/frontend/css/result.css
deleted file mode 120000
index e90c968..0000000
--- a/share/frontend/css/result.css
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/css/result.css \ No newline at end of file
diff --git a/share/frontend/css/sketch.css b/share/frontend/css/sketch.css
deleted file mode 120000
index d2d99ca..0000000
--- a/share/frontend/css/sketch.css
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/css/sketch.css \ No newline at end of file
diff --git a/share/frontend/css/unsemantic-grid-responsive.css b/share/frontend/css/unsemantic-grid-responsive.css
deleted file mode 120000
index b5fd8ec..0000000
--- a/share/frontend/css/unsemantic-grid-responsive.css
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/css/unsemantic-grid-responsive.css \ No newline at end of file
diff --git a/share/frontend/gallery-static/js/main.js b/share/frontend/gallery-static/js/main.js
index aadc7e1..b72ee6c 100644
--- a/share/frontend/gallery-static/js/main.js
+++ b/share/frontend/gallery-static/js/main.js
@@ -82,22 +82,35 @@ var Dump = {
}
}
-function applyTag(tagname){
- tag_regex = /&tag=[^&]*/;
- if (document.URL.match(tag_regex)){
- return document.URL.replace(tag_regex, "&tag="+tagname);
- }else if(document.URL.match(/\/$/)){
- return document.URL.replace(/\/$/, "?tag="+tagname);
- }
- else{
- return document.URL+"&tag="+tagname;
- }
+function applyTag(tagname) {
+ var qs = $.QueryString
+ qs.tag = tagname
+ return serializeQS(qs)
+}
+function serializeQS (obj) {
+ let str = [];
+ for (let p in obj)
+ if (obj.hasOwnProperty(p)) {
+ str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
+ }
+ return str.join("&");
}
var Main =
{
editing: false,
kp: function (event)
{
+ if (document.activeElement && document.activeElement.getAttribute('id') === 'search-q')
+ {
+ if (event.keyCode === 13)
+ {
+ var qs = $.QueryString
+ qs.text = document.activeElement.value
+ delete qs.start
+ window.location.search = serializeQS(qs)
+ }
+ return
+ }
switch (event.keyCode)
{
// BS
@@ -163,9 +176,10 @@ var Main =
$("#help").click(function(){ $("#keys").slideToggle() })
$("#actions b").click(function(){ $("#sorting-optionsContainer").slideToggle() })
$("#tags b").click(function(){ $("#tag-optionsContainer").slideToggle() })
- $(".tag-options").click(function(){document.location.href= applyTag(this.id)});
- $(".tag-clear").click(function(){ document.location.href = document.URL.replace(/&?tag=[^&]*/ ,"").replace(/\?$/,"")});
+ $(".tag-options").click(function(){document.location.search = applyTag(this.id)});
+ $(".tag-clear").click(function(){ document.location.search = '' });
$("div img").live("click", Dump.pick)
+ $("#search-q").val($.QueryString.text || "")
Dump.load_rebus()
// Dump.clear()
}
diff --git a/share/frontend/gallery-static/main.css b/share/frontend/gallery-static/main.css
index 1201689..56afc1d 100644
--- a/share/frontend/gallery-static/main.css
+++ b/share/frontend/gallery-static/main.css
@@ -18,6 +18,19 @@ div img {
cursor: pointer;
// display: none;
}
+#search {
+ position: fixed;
+ left: 300px;
+ top: 10px;
+}
+#search input {
+ padding: 3px;
+ border: 1px solid #ddd;
+ font-weight: bold;
+ background: #f8f4fb;
+ font-size: 16px;
+ width: 140px;
+}
#dump {
position: fixed;
left: 0;
@@ -66,7 +79,7 @@ div img {
{
position: fixed;
top: 10px;
- left: 200px;
+ left: 150px;
cursor: pointer;
text-align: left;
font-family: sans-serif;
diff --git a/share/frontend/js/colors_iframe.js b/share/frontend/js/colors_iframe.js
deleted file mode 120000
index 7b48e9f..0000000
--- a/share/frontend/js/colors_iframe.js
+++ /dev/null
@@ -1 +0,0 @@
-../imgrid/js/colors_iframe.js \ No newline at end of file
diff --git a/share/frontend/js/display_result.js b/share/frontend/js/display_result.js
deleted file mode 120000
index 3108446..0000000
--- a/share/frontend/js/display_result.js
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/js/display_result.js \ No newline at end of file
diff --git a/share/frontend/js/inputs.js b/share/frontend/js/inputs.js
deleted file mode 120000
index 7dd0da5..0000000
--- a/share/frontend/js/inputs.js
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/js/inputs.js \ No newline at end of file
diff --git a/share/frontend/js/jquery-1.6.4.min.js b/share/frontend/js/jquery-1.6.4.min.js
deleted file mode 120000
index 168445e..0000000
--- a/share/frontend/js/jquery-1.6.4.min.js
+++ /dev/null
@@ -1 +0,0 @@
-../imgrid/js/jquery-1.6.4.min.js \ No newline at end of file
diff --git a/share/frontend/js/jquery-ui.min.js b/share/frontend/js/jquery-ui.min.js
deleted file mode 120000
index 4d744ec..0000000
--- a/share/frontend/js/jquery-ui.min.js
+++ /dev/null
@@ -1 +0,0 @@
-../imbreak/js/jquery-ui.min.js \ No newline at end of file
diff --git a/share/frontend/js/main.js b/share/frontend/js/main.js
deleted file mode 120000
index 1c1c131..0000000
--- a/share/frontend/js/main.js
+++ /dev/null
@@ -1 +0,0 @@
-../imgrid/js/main.js \ No newline at end of file
diff --git a/share/frontend/js/overlay.js b/share/frontend/js/overlay.js
deleted file mode 120000
index dd2be26..0000000
--- a/share/frontend/js/overlay.js
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/js/overlay.js \ No newline at end of file
diff --git a/share/frontend/js/preview.js b/share/frontend/js/preview.js
deleted file mode 120000
index 16cbafb..0000000
--- a/share/frontend/js/preview.js
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/js/preview.js \ No newline at end of file
diff --git a/share/frontend/js/sketch.js b/share/frontend/js/sketch.js
deleted file mode 120000
index 9e4ec4c..0000000
--- a/share/frontend/js/sketch.js
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/js/sketch.js \ No newline at end of file
diff --git a/share/frontend/js/sliders.js b/share/frontend/js/sliders.js
deleted file mode 120000
index 6ebbd4f..0000000
--- a/share/frontend/js/sliders.js
+++ /dev/null
@@ -1 +0,0 @@
-../imgrid/js/sliders.js \ No newline at end of file
diff --git a/share/frontend/js/urls.js b/share/frontend/js/urls.js
deleted file mode 120000
index 018f8c5..0000000
--- a/share/frontend/js/urls.js
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/js/urls.js \ No newline at end of file
diff --git a/share/frontend/js/username.js b/share/frontend/js/username.js
deleted file mode 120000
index d7b2691..0000000
--- a/share/frontend/js/username.js
+++ /dev/null
@@ -1 +0,0 @@
-../impattern/js/username.js \ No newline at end of file
diff --git a/share/install/requirements.txt b/share/install/requirements.txt
index 4de82f8..e8feccd 100644
--- a/share/install/requirements.txt
+++ b/share/install/requirements.txt
@@ -2,4 +2,5 @@
Flask-SQLAlchemy
Flask
SQLAlchemy
+selectors2
pluginbase