summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--photoblaster/server.py10
-rw-r--r--share/frontend/imgrid/css/jeremy.css113
-rw-r--r--share/frontend/imgrid/js/colors_iframe.js45
-rw-r--r--share/frontend/imgrid/js/intro.js5
-rw-r--r--share/frontend/imlandscape/js/pb.js4
5 files changed, 174 insertions, 3 deletions
diff --git a/photoblaster/server.py b/photoblaster/server.py
index 9ce7e19..9082d05 100644
--- a/photoblaster/server.py
+++ b/photoblaster/server.py
@@ -7,6 +7,7 @@ import re
import cherrypy
from paste.translogger import TransLogger
import simplejson as json
+import urllib2
from photoblaster.modules import PbGenerate, PbGrid, PbBreaker, PbPattern,\
PbLandscape, PbGradient, PbProcessError, Pb
@@ -78,10 +79,17 @@ class Server(object):
# Static Routes (for local development only!!!)
@self.app.route('/<path:path>')
- def static_proxy(path):
+ def send_static(path):
# send_static_file will guess the correct MIME type
return self.app.send_static_file(path)
+ @self.app.route('/proxy', methods=['GET'])
+ def proxy_image():
+ url = request.args.get("url")
+ req = urllib2.Request(url=url)
+ req = urllib2.urlopen(req)
+ return req.read()
+
@self.app.route('/im/data', methods=['GET'])
def get_data():
args_dict = request.args.to_dict()
diff --git a/share/frontend/imgrid/css/jeremy.css b/share/frontend/imgrid/css/jeremy.css
new file mode 100644
index 0000000..800d312
--- /dev/null
+++ b/share/frontend/imgrid/css/jeremy.css
@@ -0,0 +1,113 @@
+body{
+ font-family:georgia, Arial;
+ font-size:10pt;
+}
+h1{
+ font-size:18px;
+ width:50%;
+ margin:10px;
+ padding:10px;
+}
+#flatcontrols{
+ width:40%;
+ margin:10px;
+ padding:10px;
+}
+.lineadj{
+ display:none;
+}
+.threedadj{
+ display:none;
+}
+.gridbgadj{
+ display:none;
+}
+.imageoptions{
+ display:none;
+}
+.results{
+ display:none;
+ position:relative;
+ z-index:-100;
+}
+#output-url{
+ z-index:100;
+ width:500px;
+}
+.slider{
+ background-color:#eee5de;
+ display:inline-block;
+ width:50%;
+}
+#opacity-slider{
+ width:100%;
+ display:inline-block;
+ margin-right:0;
+ margin-left:0;
+}
+input{
+ width:70px;
+}
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default
+{
+background-color:#555;
+}
+#result
+{
+position:fixed;
+right:20%;
+top:20px;
+}
+#output-url
+{
+width:100%;
+}
+.urlinput
+{
+width:60%;
+}
+a
+{
+background-color:white;
+max-width:100px;
+}
+a:link{
+ color: black;
+}
+a:visited{
+ color: black;
+}
+a:hover{
+ color: black;
+}
+a:active{
+ color: black;
+}
+table td{
+ padding:4px;
+}
+#threedmore, #imageoptionsmore{
+ background-color:white;
+ cursor:pointer;
+ font-size:20px;
+ text-align:center;
+}
+button {
+ background: white;
+ color: #000000;
+ font-size: 18px;
+ font-family: Georgia, serif;
+ text-decoration: none;
+ vertical-align: middle;
+}
+.button:hover {
+ border-top-color: #78e072;
+ background: #78e072;
+ color: #000000;
+}
+.options{
+ background-color:white;
+}
+.options-table{
+ width:100%;
+}
diff --git a/share/frontend/imgrid/js/colors_iframe.js b/share/frontend/imgrid/js/colors_iframe.js
new file mode 100644
index 0000000..5e6d5b2
--- /dev/null
+++ b/share/frontend/imgrid/js/colors_iframe.js
@@ -0,0 +1,45 @@
+
+
+
+
+function launch_iframe(input_target){
+ $.fancybox.open({
+ href : '/im/colors/index.html',
+ width : 1100, // set the width
+ height : 710,
+ fitToView : true,
+ autoDimensions:false,
+ autoSize:false,
+ type : 'iframe',
+ closeBtn : false,
+ padding : 5,
+ beforeShow : function(){
+ $('.fancybox-iframe').contents().find('#submitvalue').click(function(){
+ $('.fancybox-iframe').contents().find('form').submit();
+ $.fancybox.close();
+ });
+ },
+ beforeClose : function(){
+ x = $('.fancybox-iframe').contents().find('#namespace').val();
+ },
+ afterClose: function(){
+ $(input_target).val(x);
+ }
+ });
+}
+$(document).ready(function(){
+ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
+ return;
+ }
+ var element_list = [".bg-color", ".line-color", ".planebgcolor", ".skycolor"]
+ element_list.forEach(
+ function(l){
+ console.log("a"+l)
+ $("a"+l).click(function(event){
+ event.preventDefault();
+ launch_iframe("input"+l)
+ });
+ }
+ )
+
+})
diff --git a/share/frontend/imgrid/js/intro.js b/share/frontend/imgrid/js/intro.js
new file mode 100644
index 0000000..7165325
--- /dev/null
+++ b/share/frontend/imgrid/js/intro.js
@@ -0,0 +1,5 @@
+$(document).ready(function(){
+ $('#intro').fadeOut(1000,function(){
+ $('#intro').remove()
+ })
+});
diff --git a/share/frontend/imlandscape/js/pb.js b/share/frontend/imlandscape/js/pb.js
index 46c0bd6..ede2b04 100644
--- a/share/frontend/imlandscape/js/pb.js
+++ b/share/frontend/imlandscape/js/pb.js
@@ -60,8 +60,8 @@ function loadNew() {
console.log(textureURL);
console.log(heightmapURL);
stop_animating();
- var new_texture = '/cgi-bin/proxy?'+textureURL;
- var new_heightmap = '/cgi-bin/proxy?'+heightmapURL;
+ var new_texture = '/proxy?url='+textureURL;
+ var new_heightmap = '/proxy?url='+heightmapURL;
initGraphics(new_texture, new_heightmap, function(){ animate() } );
}