From e2cc4f87d36006d74cdcef7362dd51728802d4aa Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Mon, 14 Sep 2015 14:26:18 +0000 Subject: Almost ready --- .gitignore | 4 ++ build.py | 61 +++++++++++++++++++++ build.sh | 7 --- css/help.css | 6 -- css/popup.css | 2 + css/redirector.css | 115 +++++++++++++++++++++++++++++++-------- help.html | 5 +- icon.html | 13 +---- images/icon128active.png | Bin 1289 -> 1211 bytes images/icon128disabled.png | Bin 1275 -> 1202 bytes images/icon128redirected.png | Bin 0 -> 1168 bytes js/background.js | 25 ++++++--- js/controllers/redirectorpage.js | 7 +-- js/platform.js | 6 -- js/redirect.js | 2 +- manifest.json | 1 + popup.html | 4 +- redirector.html | 106 ++++++++++++++++++++---------------- 18 files changed, 245 insertions(+), 119 deletions(-) create mode 100755 build.py delete mode 100755 build.sh create mode 100644 images/icon128redirected.png delete mode 100644 js/platform.js diff --git a/.gitignore b/.gitignore index 343ea52..6a7347c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ *.xpi *.DS_Store +*.zip +build/* +ffox.sh + diff --git a/build.py b/build.py new file mode 100755 index 0000000..741da58 --- /dev/null +++ b/build.py @@ -0,0 +1,61 @@ +#!/usr/bin/python + +import os, os.path, re, zipfile, json + +def get_files_to_zip(): + #Exclude git stuff, build scripts etc. + exclude = [r'(\\|/)\.git(\\|/)', r'\.(py|sh)$', r'\.DS_Store$', r'\.gitignore$',r'(\\|/)build(\\|/)'] + + zippable_files = [] + for root, folders, files in os.walk('.'): + for f in files: + file = os.path.join(root,f) + if not any(re.search(p, file) for p in exclude): + zippable_files.append(file) + return zippable_files + +def create_addon(files, browser): + output_folder = 'build' + if not os.path.isdir(output_folder): + os.mkdir(output_folder) + + extension = 'zip' + if browser == 'firefox': + extension = 'xpi' + + output_file = os.path.join(output_folder, 'redirector-%s.%s' % (browser, extension)) + zf = zipfile.ZipFile(output_file, 'w', zipfile.ZIP_STORED) + + print '' + print '**** Creating addon for %s ****' % browser + for f in files: + print 'Adding', f + if f.endswith('manifest.json'): + manifest = json.load(open(f)) + if browser != 'firefox': + del manifest['applications'] #Firefox specific, and causes warnings in other browsers... + + if browser == 'opera': + manifest['options_ui']['page'] = 'redirector.html' #Opera opens options in new tab, where the popup would look really ugly + manifest['options_ui']['chrome_style'] = False + + zf.writestr(f[2:], json.dumps(manifest, indent=2)) + else: + zf.write(f[2:]) + + zf.close() + +if __name__ == '__main__': + #Make sure we can run this from anywhere + folder = os.path.dirname(os.path.realpath(__file__)) + os.chdir(folder) + + files = get_files_to_zip() + + print '******* REDIRECTOR BUILD SCRIPT *******' + print '' + + browsers = ['chrome', 'firefox', 'opera'] + for b in browsers: + create_addon(files, b) + diff --git a/build.sh b/build.sh deleted file mode 100755 index 47e0b4b..0000000 --- a/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -if [ -f Redirector.xpi ]; -then - rm Redirector.xpi -fi - -zip Redirector.xpi * -r -x *unittest* *.DS_Store -x .gitignore *.xpi *.sh diff --git a/css/help.css b/css/help.css index ae6928e..02ca9ee 100644 --- a/css/help.css +++ b/css/help.css @@ -30,12 +30,6 @@ h1 { margin-bottom:80px; } -h1 span { - font-size:80px; - position: relative; - top:3px; -} - h4 { font-size:24px; margin-bottom:0px; diff --git a/css/popup.css b/css/popup.css index 7451ec8..1f0069c 100644 --- a/css/popup.css +++ b/css/popup.css @@ -9,6 +9,7 @@ h1 { margin-top:-4px; font-size:22px; font-weight: bold; + letter-spacing: 1.5px; } h1 span { @@ -27,4 +28,5 @@ button { margin-top:-16px; color:red; height:13px; + font-size:12px; } \ No newline at end of file diff --git a/css/redirector.css b/css/redirector.css index 3eb2d72..18c0977 100644 --- a/css/redirector.css +++ b/css/redirector.css @@ -13,11 +13,10 @@ h1, h2, h3, h5, h6 { h1 { font-size:55px; - margin:-15px 0px 0px 0px; - -webkit-user-select:none; - -moz-user-select:none; + margin-bottom:0px; cursor:default; padding:0px; + letter-spacing: 2.1px; } h3 { @@ -34,7 +33,7 @@ h4 { h5 { font-size:20px; - margin:-20px 0 0 0; + margin:-6px 0 0 0; color:#5e6163; } @@ -170,8 +169,9 @@ input[type="radio"] { /* Table of redirects */ .redirect-table { - width:90%; - max-width: 800px; + width:intrinsic; + max-width:1024px; + min-width:600px; border:solid 1px #bbb; margin:0px auto; border-radius:3px; @@ -179,12 +179,32 @@ input[type="radio"] { .redirect-row { position: relative; - font-size:13px; + font-size:14px; padding:8px; line-height:18px; border-bottom:solid 1px #bbb; } +.redirect-info { + display:table; +} + +.redirect-info div { + display:table-row; +} + +.redirect-info div label { + display:table-cell; + padding:3px 5px; + white-space: nowrap; +} + +.redirect-info div p { + display:table-cell; + word-wrap:break-word; + max-width:900px; +} + .redirect-row:last-child { border-bottom: none !important; } @@ -193,7 +213,7 @@ input[type="radio"] { background:#f8f8f8; } -.redirect-row.disabled label, .redirect-row.disabled span, a.disabled { +.redirect-row.disabled label, .redirect-row.disabled span, .redirect-row.disabled p, a.disabled { color:#bbb !important; } @@ -207,13 +227,15 @@ input[type="radio"] { #delete-redirect-form { position: fixed; - width:500px; + padding:10px; + min-width:500px; + width:intrinsic; background:white; border:solid 1px #bbb; border-radius:3px; z-index: 6000; left:50%; - margin-left:-250px; + margin-left:-260px; top:50%; margin-top:-220px; height:220px; @@ -228,6 +250,16 @@ input[type="radio"] { font-weight:bold; text-align: right; display:inline-block; + vertical-align: top; +} + +#delete-redirect-form div span { + display:inline-block; + width: 330px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + vertical-align: top; } .redirect-row h4 span.disabled-marker { @@ -277,43 +309,70 @@ a.disabled:hover { #edit-redirect-form { position: fixed; - width:500px; + display:table; + width:700px; background:white; border:solid 1px #bbb; border-radius:3px; z-index: 6000; left:50%; - margin-left:-250px; + margin-left:-350px; top:50%; margin-top:-258px; font-size:12px; } -#edit-redirect-form div{ - margin-bottom:7px; +.form-grid { + display:table; } -#edit-redirect-form div label:first-child { - width:130px; +.form-grid > div{ + display:table-row; +} + +.form-grid > div > label { + display:table-cell; font-weight:bold; text-align: right; + padding:6px; + white-space: nowrap; + width:120px; + vertical-align:top; +} + +.edit-example-result { + width:500px; display:inline-block; + word-wrap:break-word; + margin-top:4px; } -#edit-redirect-form .second-column { - display:block; - margin-left: 133px; +.example-result-error { + margin-top:4px; + display:inline-block; +} + +#unescape-matches, #escape-matches { + margin-top:5px; } -#edit-redirect-form div input[type='text'] { - width:300px; +.form-grid div input[type='text'] { + width:510px; +} + +.input-cell { + padding-top:2px; +} + +.input-cell label { + display:block; } .error { color:red; } -.placeholder, { +.placeholder { color:#c0c0c0; font-size:11px; } @@ -322,6 +381,10 @@ a.disabled:hover { color: #c0c0c0; } +.advanced { + margin-top:8px; +} + #advanced-toggle { padding-top:3px; text-align: center; @@ -335,13 +398,19 @@ a.disabled:hover { text-decoration: underline; } +.advanced div .input-cell label:first-child { + margin-top:2px; +} + a[ng-click] { cursor:pointer; } -#wildcardtype { +#wildcardtype, #regextype { margin-right:10px; + display:inline-block; + margin-top:1px; } .button-container { diff --git a/help.html b/help.html index f27af2c..835e76b 100644 --- a/help.html +++ b/help.html @@ -1,13 +1,14 @@ - Redirector Help + REDIRECTOR HELP + -

edirector Help

+

REDIRECTOR HELP

Table of contents