diff options
| author | pepperpepperpepper <pepper@scannerjammer.com> | 2015-11-16 19:58:26 -0800 |
|---|---|---|
| committer | pepperpepperpepper <pepper@scannerjammer.com> | 2015-11-16 19:58:26 -0800 |
| commit | dfda5d7399da4b4d19f13abd6dc390e23ff294c4 (patch) | |
| tree | 55967488cc83fe3dec7f69e86827acac8630f5f7 | |
| parent | 80000dd26f003a62b1a3ecfb91ee6216179b1273 (diff) | |
ok time to finish this gallery
| -rw-r--r-- | examples/break.py | 29 | ||||
| -rw-r--r-- | examples/grid.sh | 2 | ||||
| -rw-r--r-- | examples/jsonp.sh | 2 | ||||
| -rw-r--r-- | examples/test.sh | 2 | ||||
| -rw-r--r-- | share/Flask_test/blueprint_test.py | 21 | ||||
| -rwxr-xr-x | share/Flask_test/pbserver.py | 40 | ||||
| -rw-r--r-- | share/Flask_test/test.py | 46 | ||||
| -rw-r--r-- | share/Flask_test/test2.py | 1 | ||||
| -rw-r--r-- | share/OLD/inspect_objects_example.py | 15 | ||||
| -rw-r--r-- | share/frontend/htmljs/imbreak_main.js | 113 | ||||
| -rw-r--r-- | share/frontend/htmljs/imgradient_index.html | 539 | ||||
| -rw-r--r-- | share/frontend/htmljs/imgrid_main.js | 121 | ||||
| -rw-r--r-- | share/frontend/server/simple_proxy.py | 27 |
13 files changed, 0 insertions, 958 deletions
diff --git a/examples/break.py b/examples/break.py deleted file mode 100644 index 91d888d..0000000 --- a/examples/break.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python2.7 -import requests, sys -import simplejson as json -URL_BASE = "http://127.0.0.1:8080" - -example_params = { - "url" : "http://i.asdf.us/im/de/HolyMountain2_1322275112_seamonkey.gif", - "breaktype" : "RGB_WASH", - "finalformat" : "png", - "breakmode" : "extreme", - "breakangle" : "10", - "username" : "donkey", - "expanded" : "false" -} - -def post_request(url, data): - r = requests.post(url, data=data) - if r.status_code != 200: - sys.stderr.write("ERROR: %s\n" % r.status_code) - sys.stderr.write("REASON: %s\n" % r.reason) - sys.exit(1) - return json.loads(r.text) - -def test(api_name, params): - return post_request("%s/%s" % (URL_BASE, api_name), params) - -if __name__ == "__main__": - print test("PbBreak", example_params) - diff --git a/examples/grid.sh b/examples/grid.sh deleted file mode 100644 index d6d76e4..0000000 --- a/examples/grid.sh +++ /dev/null @@ -1,2 +0,0 @@ -#curl localhost:8999/im/api/imgrid -H 'Cookie: imname=pepper' -H 'Origin: http://asdf.us' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: */*' -H 'Referer: http://asdf.us/imgrid/' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'width=700&height=500&linethickness=1&opacity=1&linecolor=MISTYROSE4&spacing=10&vlines=false&hlines=false&shadow=false&bgimage=&bgcolor=transparent&imageinstead=&planebgcolor=transparent&skycolor=none&planebgimage=&transition=background&swing=0&tilt=0&roll=0&zoom=0&trim=false&format=&username=pepper' --compressed -curl http://asdf.us/im/api/imgrid -H 'Cookie: imname=pepper' -H 'Origin: http://asdf.us' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: */*' -H 'Referer: http://asdf.us/imgrid/' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'width=700&height=500&linethickness=1&opacity=1&linecolor=MISTYROSE4&spacing=10&vlines=false&hlines=false&shadow=false&bgimage=&bgcolor=transparent&imageinstead=&planebgcolor=transparent&skycolor=none&planebgimage=&transition=background&swing=0&tilt=0&roll=0&zoom=0&trim=false&format=&username=pepper' --compressed diff --git a/examples/jsonp.sh b/examples/jsonp.sh deleted file mode 100644 index 8539853..0000000 --- a/examples/jsonp.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -curl 'http://asdf.us/cgi-bin/im/generate?callback=jsonp1431361693303&url=http%3A%2F%2Fwww.maskworld.com%2Fpix%2Fmasks%2F025-party-face-gesicht-fasching-karneval-carnival-halloween-latex-film-movie-larp-theatre-theater-horror-rubber-gummi-mask-masks-maske-masken.jpg&name=test&transparent=true&fuzz=5' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36' -H 'Accept: */*' -H 'Referer: http://carbonpictures.com/pb/' -H 'Cookie: imname=yo' -H 'Connection: keep-alive' --compressed diff --git a/examples/test.sh b/examples/test.sh deleted file mode 100644 index 860fc0f..0000000 --- a/examples/test.sh +++ /dev/null @@ -1,2 +0,0 @@ -#curl localhost:8999/test -curl http://asdf.us/test diff --git a/share/Flask_test/blueprint_test.py b/share/Flask_test/blueprint_test.py deleted file mode 100644 index 2e7c31d..0000000 --- a/share/Flask_test/blueprint_test.py +++ /dev/null @@ -1,21 +0,0 @@ -from flask import Blueprint, abort, jsonify -simple_page = Blueprint('simple_page', __name__) -@simple_page.route('/homies') -def show(): - return "what's up"; - -@simple_page.route('/nope') -def nope(): - return bad_request("oh hell no") - -def bad_request(message): - response = jsonify({'message': message}) - response.status_code = 400 - return response - - -#@simple_page.errorhandler(500) -#def custom400(error): -# response = jsonify({'message': error.description['message']}) -# # etc. - diff --git a/share/Flask_test/pbserver.py b/share/Flask_test/pbserver.py deleted file mode 100755 index 400883a..0000000 --- a/share/Flask_test/pbserver.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/python2.7 - -#static routes -#{{{ -@route('/im/<filename>') -def server_static(filename): - return static_file(filename, root='frontend/im/') -@route('/im') -def server_static(): - return static_file("index.html", root='frontend/im/') -@route('/imgrid') -def server_static(): - return static_file("index.html", root='frontend/imgrid/') -@route('/imgradient') -def server_static(): - return static_file("index.html", root='frontend/imgradient/') -@route('/imlandscape') -def server_static(): - return static_file("index.html", root='frontend/imlandscape/') -@route('/impattern') -def server_static(): - return static_file("index.html", root='frontend/impattern/') -@route('/imbreak') -def server_static(): - return static_file("index.html", root='frontend/imbreak/') -@route('/') -def server_static(): - return static_file("index.html", root='frontend/im/') -@route('/css/<filename>') -def server_static(filename): - return static_file(filename, root='frontend/css/') -@route('/js/<filename>') -def server_static(filename): - return static_file(filename, root='frontend/js/') -@route('/img/<filename>') -def server_static(filename): - return static_file(filename, root='frontend/img/') -#}}} - -#run(host='0.0.0.0', port=8999, debug=True) diff --git a/share/Flask_test/test.py b/share/Flask_test/test.py deleted file mode 100644 index b383b0d..0000000 --- a/share/Flask_test/test.py +++ /dev/null @@ -1,46 +0,0 @@ -import simplejson as json -from flask import Flask -from flask import abort, redirect, url_for -from blueprint_test import simple_page -app = Flask(__name__) -app.register_blueprint(simple_page) -#app.logger.debug('A value for debugging') -#app.logger.warning('A warning occurred (%d apples)', 42) -#app.logger.error('An error occurred') - -@app.route("/") -def hello(): - return "Hello World!" - -if __name__ == "__main__": - app.run() - -@app.route('/login', methods=['POST', 'GET']) -def login(): - error = None - if request.method == 'POST': - if valid_login(request.form['username'], - request.form['password']): - return log_the_user_in(request.form['username']) - else: - error = 'Invalid username/password' - #searchword = request.args.get('key', '') - # the code below is executed if the request method - # was GET or the credentials were invalid - return render_template('login.html', error=error) - - - -@app.route('/') -def index(): - return redirect(url_for('login')) - -@app.route('/login') -def login(): - abort(401) - this_is_never_executed() - - -url_for('static', filename='style.css') - - diff --git a/share/Flask_test/test2.py b/share/Flask_test/test2.py deleted file mode 100644 index 0a831b6..0000000 --- a/share/Flask_test/test2.py +++ /dev/null @@ -1 +0,0 @@ -print __name__ diff --git a/share/OLD/inspect_objects_example.py b/share/OLD/inspect_objects_example.py deleted file mode 100644 index 92e28b7..0000000 --- a/share/OLD/inspect_objects_example.py +++ /dev/null @@ -1,15 +0,0 @@ -class Test(object): - def __init__(self, one="la", two="di"): - self._test_args(inspect.getargvalues(inspect.currentframe())); - - def _test_args(self, _args_vals): - for arg in _args_vals.args: - if arg == "self": - continue - try: - sys.stdout.write("%s\n" % arg) - sys.stdout.write("\t%s\n" % _args_vals.locals.get(arg)) - except Exception as e: - sys.stderr.write("%s\n" % e ); - -t = Test(); diff --git a/share/frontend/htmljs/imbreak_main.js b/share/frontend/htmljs/imbreak_main.js deleted file mode 100644 index c56c9a2..0000000 --- a/share/frontend/htmljs/imbreak_main.js +++ /dev/null @@ -1,113 +0,0 @@ -var Main = - { - firsttime: true, - generating: false, - thelast: "", - enter: function (e) - { - if (Main.generating) - return - if (e.keyCode === 13) - Main.go() - }, - go: function () - { - if (Main.generating) - return - Main.generating = true - var theloader = '<span style="width:100%;margin-right:40%"><img style="width:140px;height:120px;display:inline;" src="generating.gif"></img></span>' - $("#output-cmd").html(theloader).show() - $('.result').show() - $('.results').show() - $("#output-img").show() - $("#output-url").show() - $("#result").show() - var data = - { - breakmode:$('input:radio[name=modeswitch]:checked').val(), - breaktype: $('#breaktype :selected').val(), - breakangle: $("#breakangle").val(), - url: $('#url').val(), - username: $('#username').val(), - firsttime: Main.firsttime.toString() - } - if (data["breakmode"] == "gradual") - { - data["breakmode"] = "subtle" - if (Main.lines && Main.thelast == $('#url').val()) - { - Main.firsttime = false - data["url"] = Main.lines[1] - } - } - else - { - Main.firsttime = true - } - Main.thelast = $('#url').val(); - thestring = JSON.stringify(data); - $('#error').append(thestring); - if (data.username.length > 0) - document.cookie = "imname="+data.username+";path=/;domain=.asdf.us;max-age=1086400" - $.post("/im/api/imbreak", data, Main.callback) - }, - error: function (s) - { - $("#output-cmd").html("<span class='error'>ERROR: " + s + "</span>").show() - $("#output-url").hide() - $("#output-img").hide() - }, - filesize: function (size) - { - if (size < 1024) - return size.toString() + " bytes" - if (size < 1024 * 1024) - return Math.floor (size/1024).toString() + " KB" - else - return Math.floor (size/(1024*1024)).toString() + " MB" - }, - callback: function (data) - { - data = JSON.parse(data) - $('#error').append('called'); - $("#output-cmd").html('') - $('#output-url').val(data.url) - $("#output-img").html("click image to enlarge<br><a target=_blank href='"+data.url+"'>"+"<img src='"+data.url+"' id='output-image'></img><br>"+"</a>" -); - $("#output-info").html('-ACTUAL SIZE-<br>'+Main.filesize(data.size)+'<br>'+data.width+'<br>'+data.height+'<br><br>'+'<span>see more at →<a href="http://asdf.us/im/gallery">photoblaster gallery</a></span>'+'<br>') - Main.generating = false - }, - cookie: function () - { - if (document.cookie) - { - var cookies = document.cookie.split(";") - for (i in cookies) - { - var cookie = cookies[i].split("=") - if (cookie[0].indexOf("imname") !== -1) - { - if (cookie[1] !== 'false' && cookie[1] !== 'undefined' && cookie[1].length) - { - return cookie[1] - } - } - } - } - return "" - }, - init: function () - { - var name = Main.cookie () - $("#username").val(name) - $("#breakbutton").bind("click", Main.go) - $(document).bind("keydown", Main.enter) - } - } -//$('#theform').each(function(){ -// this.reset(); -// }); - - - -Main.init () diff --git a/share/frontend/htmljs/imgradient_index.html b/share/frontend/htmljs/imgradient_index.html deleted file mode 100644 index 275bfec..0000000 --- a/share/frontend/htmljs/imgradient_index.html +++ /dev/null @@ -1,539 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<!-- - __ __ __ __ __ __ __ -/_/\/\ /_/\/\ /_/\/\ /_/\/\ /_/\/\ /_/\/\ /_/\/\ -\_\ / \_\ / \_\ / \_\ / \_\ / \_\ / \_\ / -/_/ \ /_/ \ /_/ \ /_/ \ /_/ \ /_/ \ /_/ \ -\_\/\ \ \_\/\ \ \_\/\ \ \_\/\ \ \_\/\ \ \_\/\ \ \_\/\ \ - \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ ---> - -<html> -<head> -<title>GRADIENT PHOTOBLASTER</title> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta property="og:title" content="GRADIENT PHOTOBLASTER"/> -<meta property="og:type" content="website"/> -<meta name=Author content="Pepper .... with help from Jules Welter/LaPlace"/> -<meta property="og:url" content="http://asdf.us/imgradient/"/> -<meta property="og:image" content="http://asdf.us/g/experiment/whitegreencrazy.jpg" /> -<meta property="og:site_name" content="asdf.us"/> -<meta property="og:description" content="choose colors and options, let it flow out of you."/> -<meta property="fb:admins" content="100001923956223,1709246"/> -<link href="css/custom-theme/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" /> -<style type="text/css"> -* - { - padding: 0; - margin: 0; - font-family: times; - } -body - { - background-color: #e6e0e0; - color: #696969; - overflow-x:hidden; - } -h1 - { - font-size: 40px; - } -#brightness-slider,#hue-slider,#saturation-slider,#blur-slider - { - margin-top:10px; - margin-bottom:10px; - background-color:#B3B3B3; - } -#stripenumber,#stripeintensity,#percentbeveled - { - height:10px; - width :25px; - font-size:9; - } -#controls,#result - { - padding: 10px; - width: 460px; - } -#controls - { - display:block; - font-size: 14px; - top: 10px; left: 10px; - z-index: 5; - background-color: #fff; - -moz-box-shadow: 0px 0px 9px 3px mediumseagreen; - -webkit-box-shadow: 0px 0px 9px 3px mediumseagreen; - box-shadow: 0px 0px 9px 3px mediumseagreen; - border: 60px outset #777; - } -#result - { - background-color: #d6d0d0; - top: 10px; left: 580px; - z-index: 5; - display: none; - position: fixed; - } -#instructions - { - position: absolute; - bottom: 10px; - left: 10px; - line-height: 18px; - z-index: 1; - } -p - { - background-color: #fff; - padding: 10px; - font-size: 14px; - width: 430px; - display: block; - } -#gallery-link - { - background-color: #fff; - position: absolute; - top: 10px; - right: 10px; - padding: 10px; - z-index: 10; - } -.error - { - color: red; - font-size: 20px; - } -a - { - color: #b4d; - font-weight: bold; - } -label - - { - display: inline-block; - width: 300px; - padding-right: 10px; - text-align: center; - } -input[type=text] - { - width: 100px; - } -#img-url,#output-url,#img-background - { - width: 200px; - } -#img-width,#img-height,#img-brightness,#img-saturation,#img-contrast,#img-hue,#img-rotate,#img-blur,#img-tilt - { - width: 50px; - text-align: right; - } -button - { - padding: 2px 5px; - font-size: 16px; - width:200px; - float:right; - font-weight:bold; - color:#222222; - } -#result img - { - max-width: 400px; - max-height: 400px; - } -#output-cmd - { - font-size: 12px; - white-space: pre; - } -.shim - { - height: 10px; - clear: both; - display: block; - } -#output-url - { - width: 320px; - } -#likebutton - { - position: fixed; - bottom: 10px; - right: 10px; - width: 350px; - background-color: #fff; - padding: 10px; - color: #ddd; - font-family: times; - text-transform: uppercase; - } -.arrow - { - float:right; - white-space:inherit; - display:inline; - } - -</style> -<body> -<div id="error"></div> -<div id="controls"> -<form id="reset" onsubmit="return false"> -<h1> - GRADIENT GENERATOR FOR PHOTOBLASTER - <img src="http://i.asdf.us/im/4e/angreekcolumnshowcaselg_1315115918_pepper.gif"/> - <img src="http://i.asdf.us/im/4e/angreekcolumnshowcaselg_1315115933_pepper.gif"/> - <img src="http://i.asdf.us/im/4e/angreekcolumnshowcaselg_1315115941_pepper.gif"/> - <img src="http://i.asdf.us/im/4e/angreekcolumnshowcaselg_1315115946_pepper.gif"/> - <img src="http://i.asdf.us/im/4e/angreekcolumnshowcaselg_1315115946_pepper.gif"/> - <img src="http://i.asdf.us/im/4e/angreekcolumnshowcaselg_1315115946_pepper.gif"/> - <img src="http://i.asdf.us/im/4e/angreekcolumnshowcaselg_1315115946_pepper.gif"/> - <img src="http://i.asdf.us/im/4e/angreekcolumnshowcaselg_1315115946_pepper.gif"/> -</h1> - - <span class="shim"></span> - - - <label><span style="font-weight:bold; color:black;">CHOOSE A GRADIENT TYPE<span class="arrow">→</span></span></label> - <select id="gradient-type"> - <option selected="selected" value="gradient">STRAIGHT FADE</option> - <option value="plasma">PLASMA</option> - <!-- <option value="-function sinusoid 4,-90 gradient:">bands</option>--> - <option value="canvas">JUST A FLAT COLOR</option> - <option value="radial">RADIAL GRADIENT</option> - <option value="colorspace">GRAYSCALE PLASMA</option> - <option value="plasmawash">PLASMA WASH</option> - <option value="gradientwash">GRADIENT WASH</option> - <option value="mirrored">MIRRORED PLASMA</option> - <option value="noise">RANDOM NOISE</option> - </select> - - <span class="shim"></span> - - <label><span style="font-weight:bold">ADJUST THE WIDTH</span><span class="arrow">→</span></label> - <input type="text" id="img-width" value="400" /><small>px</small> - <br/> - - <span class="shim"></span> - - <label><span style="font-weight:bold">ADJUST THE HEIGHT</span><span class="arrow">→</span></label> - <input type="text" id="img-height" value="400" /><small>px</small> - <br/> - - <span class="shim"></span> - - <label>CHOOSE SOME COLORS<span class="arrow">→</span></label> - <a href="http://asdf.us/imgrid/colors" target="_blank">list of color names</a> - - <span class="shim"></span> - - <label><span style="font-weight:bold; color:black;">COLOR 1</span><span class="arrow">→</span></label> - <input type="text" id="img-color1" value="white" /> - <br/> - - <span class="shim"></span> - - <label><span style="font-weight:bold; color:black;">COLOR 2</span><span class="arrow">→</span></label> - <input type="text" id="img-color2" value="black" /> - <br/> - - <span class="shim"></span> - - <span style="font-size:11px"> - <label>BANDS(also called stripes)?<span class="arrow">→</span></label> - <input type="checkbox" id="stripes" value="1" /> - <small>if yes...</small><label>NUMBER:</label><input value="" type="text" id="stripenumber"></input><small>0-400</small><label>INTENSITY:</label><input value="" type="text" id="stripeintensity"></input><small>0-2000</small> - </span> - - <span class="shim"></span> - <span class="shim"></span> - - <label>BLURRINESS <small>(0-20)</small><span class="arrow">→</span></label> - <input type="text" id="img-blur" value="" /> - <br/> - - <div class="slider" id="blur-slider"></div> - - <label>HUE <small>(0-200)</small><span class="arrow">→</span></label> - <input type="text" id="img-hue" value="" /> - <br/> - - <div class="slider" id="hue-slider"></div> - - <label>SATURATION <small>(0-200)</small><span class="arrow">→</span></label> - <input type="text" id="img-saturation" value="" /> - <br/> - - <div class="slider" id="saturation-slider"></div> - - <label>BRIGHTNESS <small>(0-200)</small><span class="arrow">→</span></label> - <input type="text" id="img-brightness" value="" /> - <br/> - - <div class="slider" id="brightness-slider"></div> - - <span class="shim"></span> - - - <label><span style="font-size:11px">CHOOSE A HALFTONE FILTER</span><span class="arrow">→</span></label> - <select id="halftone-type"> - <option selected="selected" value="">None</option> - <option value="checkeredfade">checkered-fade</option> - <option value="etchedtransition">etched-transition</option> - <option value="bendaydots">benday dots</option> - <option value="smallerdots1">smaller dots 1</option> - <option value="smallerdots2">smaller dots 2</option> - <option value="flatstripes">flat stripes</option> - </select> - - - <span class="shim"></span> - - <label><span style="font-size:11px">ADD A BEVELED BORDER</span><span class="arrow">→</span></label> - - <select id="bevel-type"> - <option selected="selected" value="">None</option> - <option value="flatout">flat out</option> - <option value="flatinner">flat inner</option> - <option value="evenlyframed">evely framed</option> - <option value="biginner">big inner</option> - <option value="bigouter">big outer</option> - <option value="dramaticflatout">dramatic flat out</option> - <option value="dramaticflatinner">dramatic flat inner</option> - </select> - - <span style="font-size:11px"><label>PERCENT BEVELED?</label></span> <input val="" type="text" id="percentbeveled"><small>%</small> - - - <span class="shim"></span> - <span class="shim"></span> - <label>FLIP HORIZONTALLY? - <span class="arrow">→</span></label> - <input type="checkbox" id="img-flop" value="1" /> - <br/> - - <label>FLIP VERTICALLY?<span class="arrow">→</span></label> - <input type="checkbox" id="img-flip" value="1" /> - <br/> - <label>TILT<small>(0-360)</small><span class="arrow">→</span></label> - <input type="text" id="img-tilt" value="" />° - <br/> - <span class="shim"></span> - - <label>ROTATE THE CANVAS<small>(0-360)</small><span class="arrow">→</span></label> - <input type="text" id="img-rotate" value="" />° - <br/> - - <span class="shim"></span> - - <span class="shim"></span> - - <label>output format:</label> - <select id="img-format"> - <option selected="selected">png</option> - <option>jpg</option> - <option>gif</option> - </select> - - <span class="shim"></span> - - <label>PUT YOUR NAME HERE >>></label> - <input type="text" id="img-name" value="" /> - <br/> - - <span class="shim"></span> - - <label> </label> - <button id="img-generate">GENERATE</button> - - <span class="shim"></span> - <br> - VIEW AND ARRANGE THE PHOTOBLASTS → <a href="/im/gallery/" target="_blank">Image Gallery</a><br/> - <span class="shim"></span> - OPEN THE PHOTOBLASTER EDITOR → <a href="/im" target="_blank">PHOTOBLASTER</a> - <span class="shim"></span> - TOP PHOTOBLASTS GO TO THE TUMBLR → <a href="http://photoblaster.tumblr.com/">Photoblaster Tumblr</a> - </p> - -</div> - -<div id="result"> - → <input type="text" id="output-url"/><br/> - <span id="output-cmd"></span><br/> - - <img id="output-img" /> -</div> -</form> -</div> - -<div id="likebutton"> -<div id="fb-root" style="background-color: transparent;"></div><script src="http://connect.facebook.net/en_US/all.js#appId=236917449658413&xfbml=1"></script><fb:like href="http://asdf.us/im/" send="false" width="347" show_faces="true" colorscheme="light" font="" style="background-color: transparent;"></fb:like> -</div> - -<script type="text/javascript" src="/js/jquery.js"></script> -<script type="text/javascript" src="jquery-ui-1.8.16.custom.min.js"></script> -<script type="text/javascript"> - - $(function() { - $( "#blur-slider" ).slider({ - value:0, - min: 0, - max: 20, - step: 1, - slide: function( event, ui ) { - $( "#img-blur" ).val(ui.value); - } - }); - $( "#img-blur" ).val( $( "#blur-slider" ).slider( "value" ) ); - - $( "#brightness-slider" ).slider({ - value:100, - min: 0, - max: 200, - step: 1, - slide: function( event, ui ) { - $( "#img-brightness" ).val(ui.value); - } - }); - $( "#img-brightness" ).val( $( "#brightness-slider" ).slider( "value" ) ); - - $( "#hue-slider" ).slider({ - value:100, - min: 0, - max: 200, - step: 1, - slide: function( event, ui ) { - $( "#img-hue" ).val(ui.value); - } - }); - $( "#img-hue" ).val($( "#hue-slider" ).slider( "value" ) ); - - $( "#saturation-slider" ).slider({ - value:100, - min: 0, - max: 200, - step: 1, - slide: function( event, ui ) { - $( "#img-saturation" ).val(ui.value); - } - }); - $( "#img-saturation" ).val($( "#saturation-slider" ).slider( "value" ) ); - }); - -var Main = - { - API_HEADER: "#@imgradient", - enter: function (e) - { -// console.log("calling enter") - if (e.keyCode === 13){ - Main.go() - } - }, - go: function () - { - $("#output-cmd").html('generating...').show() - $("#result").show() - var data = - { - flip: $('#img-flip:checked').val() !== undefined ? "true" : "false", - flop: $('#img-flop:checked').val() !== undefined ? "true" : "false", - tilt: $('#img-tilt').val(), - rotate: $("#img-rotate").val(), - subtract: $("#img-subtract").val(), - width: $("#img-width").val(), - height: $("#img-height").val(), - color2: $("#img-color2").val(), - color1: $("#img-color1").val(), - brightness: $("#img-brightness").val(), - saturation: $("#img-saturation").val(), - blurriness: $("#img-blur").val(), - hue: $("#img-hue").val(), - contrast: $("#img-contrast").val(), - gradienttype: $('#gradient-type :selected').val(), - bevel: $('#bevel-type :selected').val(), - percentbeveled: $('#percentbeveled').val(), - halftone: $('#halftone-type :selected').val(), - stripes: $('#stripes:checked').val() !== undefined ? "true" : "false", - stripenumber: $('#stripenumber').val(), - stripeintensity: $('#stripeintensity').val(), - format: $('#img-format :selected').text(), - name: $("#img-name").val(), - } - if (data.name.length > 0){ - document.cookie = "imname="+data.name+";path=/;domain=.asdf.us;max-age=1086400" - } - $.post("/im/api/imgradient", data, Main.callback) - $("#controls").css('margin',"") - }, - error: function (s) - { - $("#output-cmd").html("<span class='error'>ERROR: " + s + "</span>").show() - $("#output-url").hide() - $("#output-img").hide() - }, - callback: function (data) - { - data = JSON.parse(data) - if (data.error){ - return Main.error(data.error) - } - $("#output-cmd").html("size: "+Main.filesize(data.size)+"<br/>"+data.height + " x " + data.width) - $("#output-url").val(data.url) - $("#output-img").hide().attr("src", data.url).fadeIn(700) - }, - filesize: function (size) - { - if (size < 1024) - return size + " bytes" - if (size < 1024 * 1024) - return Math.floor (size/1024) + " KB" - else - return Math.floor (size/(1024*1024)) + " MB" - }, - cookie: function () - { - if (document.cookie) - { - var cookies = document.cookie.split(";") - for (i in cookies) - { - var cookie = cookies[i].split("=") - if (cookie[0].indexOf("imname") !== -1) - { - if (cookie[1] !== 'false' && cookie[1] !== 'undefined' && cookie[1].length) - { - return cookie[1] - } - } - } - } - return "" - }, - init: function () - { - var name = Main.cookie () - $("#img-name").val(name) - }, -} - -$(document).ready(function(){ - Main.init () - $('form').submit(function() { - return false; - }); - $(document).keydown(Main.enter) - $("#img-generate").click(Main.go) - document.getElementById("reset").reset() -}) -</script> -<!--<script type="text/javascript" src="http://asdf.us/js/pbembed.js"></script>--> -</body> -</html> - diff --git a/share/frontend/htmljs/imgrid_main.js b/share/frontend/htmljs/imgrid_main.js deleted file mode 100644 index f88e235..0000000 --- a/share/frontend/htmljs/imgrid_main.js +++ /dev/null @@ -1,121 +0,0 @@ -var Main = - { - API_HEADER: "#@imgrid", - generating: false, - enter: function (e) - { - if (Main.generating) - return - if (e.keyCode === 13) - Main.go() - }, - go: function () - { - if (Main.generating) - return - Main.generating = true - var theloader = '<span style="width:100%;margin-right:40%"><img style="width:140px;height:120px;display:inline;" src="generating.gif"></img></span>' - $("#output-cmd").html(theloader).show() - if($('#transition :selected').val() === 'tile'||$('#transition :selected').val()=== 'random') - { - $('#output-cmd').append("<br><span style='color:red'>WARNING: THIS REQUEST MIGHT TAKE A WHILE</span>") - } - $('.results').show() - $("#output-img").show() - $("#output-url").show() - $("#result").show() - var data = - { - width: $("#img-width").val(), - height: $("#img-height").val(), - linethickness: $("#line-thickness").val(), - opacity: $("#line-opacity").val(), - linecolor: $("#line-color").val(), - spacing: $("#line-spacing").val(), - vlines: $('#v-lines:checked').val() !== undefined ? "true" : "false", - hlines: $('#h-lines:checked').val() !== undefined ? "true" : "false", - shadow: $('#shadow:checked').val() !== undefined ? "true" : "false", - bgimage: $("#bg-image").val(), - bgcolor: $("#bg-color").val(), - imageinstead: $("#imageinstead").val(), - planebgcolor: $("#planebgcolor").val(), - skycolor: $("#skycolor").val(), - planebgimage: $("#planebgimage").val(), - transition: $('#transition :selected').val(), - swing: $("#swing").val(), - tilt: $("#tilt").val(), - roll: $("#roll").val(), - zoom: $("#zoom").val(), - trim: $("#trim:checked").val() !== undefined ? "true" : "false", - format: $('#format :selected').val(), - username: $('#username').val() - } - if (data.transition == 'infinite'){ - $('#genbutton').append("<span style='color:red'>WARNING:This might take a while</span>")} - if (data.username.length > 0) - document.cookie = "imname="+data.username+";path=/;domain=.asdf.us;max-age=1086400" - $.post("/im/api/imgrid", data, Main.callback) - }, - error: function (s) - { - $("#output-cmd").html("<span class='error'>ERROR: " + s + "</span>").show() - $("#output-url").hide() - $("#output-img").hide() - }, - filesize: function (size) - { - if (size < 1024) - return size.toString() + " bytes" - if (size < 1024 * 1024) - return Math.floor (size/1024).toString() + " KB" - else - return Math.floor (size/(1024*1024)).toString() + " MB" - }, - callback: function (data) - { - data = JSON.parse(data) - $("#output-cmd").html('') - $("#output-img").html("<a target=_blank href='"+data.url+"'>"+"<img src='"+data.url+"'></img><br>"+"</a>"); - $("#output-url").val(data.url) - $("#output-info").html('-ACTUAL SIZE-<br>'+Main.filesize(data.size)+'<br>'+data.width+'<br>'+data.height+'<br><br>'+'<span style="float:right">see more at →<a href="http://asdf.us/im/gallery">photoblaster gallery</a></span>'+'<br>') - Main.generating = false - }, - cookie: function () - { - if (document.cookie) - { - var cookies = document.cookie.split(";") - for (i in cookies) - { - var cookie = cookies[i].split("=") - if (cookie[0].indexOf("imname") !== -1) - { - if (cookie[1] !== 'false' && cookie[1] !== 'undefined' && cookie[1].length) - { - return cookie[1] - } - } - } - } - return "" - }, - init: function () - { - var name = Main.cookie () - $("#username").val(name) - if (name) - { -// $("#userlink").show() - // $("#userlink a").attr("href", "/im/gallery/?name="+name).html(name+"'s photoblasts") - } - $("#generate").bind("click", Main.go) - $(document).bind("keydown", Main.enter) - } - } -$('#theform').each(function(){ - this.reset(); - }); - - - -Main.init () diff --git a/share/frontend/server/simple_proxy.py b/share/frontend/server/simple_proxy.py deleted file mode 100644 index 8588887..0000000 --- a/share/frontend/server/simple_proxy.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python3 -import http.server -import urllib.request -import re - -class MyHTTPRequestHandler(http.server.CGIHTTPRequestHandler ): - def end_headers(self): - self.send_my_headers() - - http.server.CGIHTTPRequestHandler .end_headers(self) - - def send_my_headers(self): - self.send_header("Access-Control-Allow-Origin", "*") - - def do_GET(self): - if self.path[0:14] == "/cgi-bin/proxy": - self.copyfile(urllib.request.urlopen(self.path[15:]), self.wfile) - super().do_GET(); - else: - super().do_GET() - - def do_POST(self): - super().do_POST(); - -if __name__ == '__main__': - http.server.test(port=8181, HandlerClass=MyHTTPRequestHandler) - |
