diff options
author | Michał 'czesiek' Czyżewski <me@czesiek.net> | 2013-03-14 14:20:52 +0100 |
---|---|---|
committer | Michał 'czesiek' Czyżewski <me@czesiek.net> | 2013-03-14 14:20:52 +0100 |
commit | 65b653b3f51979b63ef10fbb42d564b0c8bb0820 (patch) | |
tree | c8d7d7cb41648c766d3923ed452800091b39a4ec | |
parent | 1ca734bc8c6c59b4996980f0f0103698cc9cf153 (diff) | |
download | helye-65b653b3f51979b63ef10fbb42d564b0c8bb0820.tar.gz helye-65b653b3f51979b63ef10fbb42d564b0c8bb0820.tar.bz2 helye-65b653b3f51979b63ef10fbb42d564b0c8bb0820.zip |
Indentation, whitespace fixes in templates, JS and srv.py
-rw-r--r-- | srv.py | 6 | ||||
-rw-r--r-- | static/js/penis.js | 28 | ||||
-rw-r--r-- | templates/home.html | 126 | ||||
-rw-r--r-- | templates/homeLOL.html | 101 |
4 files changed, 130 insertions, 131 deletions
@@ -8,7 +8,7 @@ from output import array app = Flask(__name__) def jsonify(data): - return flask.Markup(json.dumps(data)) + return flask.Markup(json.dumps(data)) app.jinja_env.filters['jsonify'] = jsonify @@ -16,7 +16,7 @@ app.jinja_env.filters['jsonify'] = jsonify @app.route('/') def home(first_id=None, second_id=None, third_id=None): ''' - print len(array) + print len(array) while first_id == None: rand_int = randint(0, len(array)-1) value = array[rand_int] @@ -41,7 +41,7 @@ def home(first_id=None, second_id=None, third_id=None): @app.route('/manifest.webapp') def manifest(): - return open('manifest.webapp').read() + return open('manifest.webapp').read() if __name__ == '__main__': app.run(host='127.0.0.1', port=6969, debug=True) diff --git a/static/js/penis.js b/static/js/penis.js index a3102d8..018fc44 100644 --- a/static/js/penis.js +++ b/static/js/penis.js @@ -1,16 +1,16 @@ $(function() { - $.getJSON('https://ajax.googleapis.com/ajax/services/search/images?v=1.0&imgsz=medium|large|xlarge|xxlarge&rsz=8&as_rights=(cc_publicdomain|cc_attribute|cc_sharealike|cc_nonderived).-(cc_noncommertial)&as_filetype=jpg|png|gif&safe=moderate&callback=?', {'q':words.join(' || ')}, function(data) { - results = data.responseData.results; - //for(var i in results) - { - var i = 0; // hardcore - $img = $('<img>'); - $img.attr('src', results[i].url); - $img.appendTo($('#image_wrapper')); - return; - } - }) - $(document).click(function(e) { - window.location.reload() - }); + $.getJSON('https://ajax.googleapis.com/ajax/services/search/images?v=1.0&imgsz=medium|large|xlarge|xxlarge&rsz=8&as_rights=(cc_publicdomain|cc_attribute|cc_sharealike|cc_nonderived).-(cc_noncommertial)&as_filetype=jpg|png|gif&safe=moderate&callback=?', {'q':words.join(' || ')}, function(data) { + results = data.responseData.results; + //for(var i in results) + { + var i = 0; // hardcore + $img = $('<img>'); + $img.attr('src', results[i].url); + $img.appendTo($('#image_wrapper')); + return; + } + }) + $(document).click(function(e) { + window.location.reload() + }); }); diff --git a/templates/home.html b/templates/home.html index 48a6ff5..f5e4158 100644 --- a/templates/home.html +++ b/templates/home.html @@ -1,66 +1,64 @@ <html> - <head> - <title>So.I.am-a.cat mind derailer</title> - <style> - - - @font-face{ - font-family: "TPBAFK"; src: url("http://so.i.am-a.cat/static/phont/gr82.otf") format('opentype'); - } - body - { - text-align: center; - background: #2b2b2b; - } - #word1 - { - z-index:0; - font-family: "TPBAFK"; - position:relative; - margin-top: 25px; - font-size: 46px; - font-variant: small-caps; - color: #eee; - text-shadow: 1px 1px 1px black, -1px -1px 1px black, -1px 1px 1px black, 1px -1px 1px black; - } - #word2 - { - z-index:0; - font-family: 'TPBAFK'; - position:relative; - font-size: 46px; - font-variant: small-caps; - color: #eee; - text-shadow: 1px 1px 1px black, -1px -1px 1px black, -1px 1px 1px black, 1px -1px 1px black; - } - #image_wrapper - { - margin-top: -56px; - margin-bottom: -60px; - max-height: 580px; - overflow: hidden; - z-index:1; - } - #image_wrapper img - { - width: 520px; - } - .foot { - font-size: 8px; - color: #666; - margin-top: 20px; - z-index:1; - } - </style> - </head> - <body> - <script>words = {{ words|jsonify }}; </script> - <span id="word1">{{ words[0]|e }}</span> - <div id="image_wrapper"></div> - <span id="word2">{{ words[1]|e }}</span><br /> - <div class="foot">Copyright © RiddleKiller Ltd.<br>Features Kelson Sans font by <a href=http://www.fontfabric.com/>FontFabric.com/</a></div> - <script type="text/javascript" src="{{ url_for('static', filename='js/jquery-1.7.2.min.js') }}"></script> - <script type="text/javascript" src="{{ url_for('static', filename='js/penis.js') }}"></script> - <!--<script type="text/javascript" src="{{ url_for('static', filename='js/home.js') }}"></script>--> - </body> +<head> + <title>So.I.am-a.cat mind derailer</title> + <style> + @font-face{ + font-family: "TPBAFK"; src: url("http://so.i.am-a.cat/static/phont/gr82.otf") format('opentype'); + } + body + { + text-align: center; + background: #2b2b2b; + } + #word1 + { + z-index:0; + font-family: "TPBAFK"; + position:relative; + margin-top: 25px; + font-size: 46px; + font-variant: small-caps; + color: #eee; + text-shadow: 1px 1px 1px black, -1px -1px 1px black, -1px 1px 1px black, 1px -1px 1px black; + } + #word2 + { + z-index:0; + font-family: 'TPBAFK'; + position:relative; + font-size: 46px; + font-variant: small-caps; + color: #eee; + text-shadow: 1px 1px 1px black, -1px -1px 1px black, -1px 1px 1px black, 1px -1px 1px black; + } + #image_wrapper + { + margin-top: -56px; + margin-bottom: -60px; + max-height: 580px; + overflow: hidden; + z-index:1; + } + #image_wrapper img + { + width: 520px; + } + .foot { + font-size: 8px; + color: #666; + margin-top: 20px; + z-index:1; + } + </style> +</head> +<body> + <script>words = {{ words|jsonify }}; </script> + <span id="word1">{{ words[0]|e }}</span> + <div id="image_wrapper"></div> + <span id="word2">{{ words[1]|e }}</span><br /> + <div class="foot">Copyright © RiddleKiller Ltd.<br>Features Kelson Sans font by <a href=http://www.fontfabric.com/>FontFabric.com/</a></div> + <script type="text/javascript" src="{{ url_for('static', filename='js/jquery-1.7.2.min.js') }}"></script> + <script type="text/javascript" src="{{ url_for('static', filename='js/penis.js') }}"></script> + <!--<script type="text/javascript" src="{{ url_for('static', filename='js/home.js') }}"></script>--> +</body> </html> diff --git a/templates/homeLOL.html b/templates/homeLOL.html index d4304bd..649648c 100644 --- a/templates/homeLOL.html +++ b/templates/homeLOL.html @@ -1,54 +1,55 @@ <html> - <head> - <title>HellYeah mind derailer</title> - <style> - n1 { - z-index:1; - position:absolute; - vertical-align:30%; - } - n2 { - z-index:1; - position:absolute; - vertical-align:bottom; - } - span { - font-size: 40px; - font-variant: small-caps; - color: #eee;/* - text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black; +<head> + <title>HellYeah mind derailer</title> + <style> + n1 { + z-index:1; + position:absolute; + vertical-align:30%; + } + n2 { + z-index:1; + position:absolute; + vertical-align:bottom; + } + span { + font-size: 40px; + font-variant: small-caps; + color: #eee;/* + text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black; - text-shadow: -4px 0 black, 0 4px black, 4px 0 black, 0 -4px black; + text-shadow: -4px 0 black, 0 4px black, 4px 0 black, 0 -4px black; - text-shadow: -6px 0 black, 0 6px black, 6px 0 black, 0 -6px black; */ - text-shadow: 1px 1px black, -1px 1px black, 1px -1px black, -1px -1px black, 2px 2px black, -2px 2px black, 2px -2px black, -2px -2px black, 0px 2px black, -2px 0px black, 0px -2px black, 2px 0px black; - } - body { - background: #2b2b2b; - text-align: center; - @font-face{ font-family: TPBAFK; src url("../fonts/TPBAFK-Regular.ttf")} - } - img { width: 500px; max-height: 640px; z-index:0;} - .foot { - font-size: 8px; - color: #666; - margin-top: 20px; - } - </style> - </head> - <body> - <script>words = {{ words|jsonify }}; </script> - <div id="image_wrapper"> - <n1> - <span id="word1">{{ words[0]|e }}</span1> - </n1> <br /> - <n2> - <span id="word2">{{ words[1]|e }}</span2> - </n2> - </div> - <div class="foot">Copyright © RiddleKiller Ltd.</div> - <script type="text/javascript" src="{{ url_for('static', filename='js/jquery-1.7.2.min.js') }}"></script> - <script type="text/javascript" src="{{ url_for('static', filename='js/penis.js') }}"></script> - <!--<script type="text/javascript" src="{{ url_for('static', filename='js/home.js') }}"></script>--> - </body> + text-shadow: -6px 0 black, 0 6px black, 6px 0 black, 0 -6px black; */ + text-shadow: 1px 1px black, -1px 1px black, 1px -1px black, -1px -1px black, 2px 2px black, -2px 2px black, 2px -2px black, -2px -2px black, 0px 2px black, -2px 0px black, 0px -2px black, 2px 0px black; + } + body { + background: #2b2b2b; + text-align: center; + @font-face{ font-family: TPBAFK; src url("../fonts/TPBAFK-Regular.ttf")} + } + img { width: 500px; max-height: 640px; z-index:0;} + .foot { + font-size: 8px; + color: #666; + margin-top: 20px; + } + </style> +</head> +<body> + <script>words = {{ words|jsonify }}; </script> + <div id="image_wrapper"> + <n1> + <span id="word1">{{ words[0]|e }}</span1> + </n1> + <br /> + <n2> + <span id="word2">{{ words[1]|e }}</span2> + </n2> + </div> + <div class="foot">Copyright © RiddleKiller Ltd.</div> + <script type="text/javascript" src="{{ url_for('static', filename='js/jquery-1.7.2.min.js') }}"></script> + <script type="text/javascript" src="{{ url_for('static', filename='js/penis.js') }}"></script> + <!--<script type="text/javascript" src="{{ url_for('static', filename='js/home.js') }}"></script>--> +</body> </html> |