From f432a10a164e9a32f7bb915e5ca8cef5489f3ccd Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Thu, 24 Sep 2015 10:46:03 +0000 Subject: Few fixes from Jack Black by email, thanks :) --- css/redirector.css | 3 +-- help.html | 18 +++++++++--------- js/controllers/deleteredirect.js | 6 +++--- redirector.html | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/css/redirector.css b/css/redirector.css index 31fb8cf..97b877c 100644 --- a/css/redirector.css +++ b/css/redirector.css @@ -256,8 +256,7 @@ a.disabled:hover { #delete-redirect-form { position: fixed; padding:10px; - min-width:500px; - width:intrinsic; + width:500px; background:white; border:solid 1px #bbb; border-radius:3px; diff --git a/help.html b/help.html index a9cb717..95ff9da 100644 --- a/help.html +++ b/help.html @@ -4,7 +4,7 @@ REDIRECTOR HELP - + @@ -77,8 +77,8 @@
  • Redirect to: This is the url that you will be redirected to when you open any page where the url matches the include pattern. You can use the special signs $1, $2, $3 etc. in the url, they will be replaced by the results of captures with regular expressions or stars with wildcards. For instance, if you have the include pattern http://google.com/*, redirect to http://froogle.com/$1 - and you open the page http://google.com/foobar, then you will be redireced to http://froogle.com/foobar, since 'foobar' was what the star replaced. $1 is for the - first star in the pattern, $2 for the second and so on. For regular expression $1 is for the first parantheses, $2 for the second etc.
  • + and you open the page http://google.com/foobar, then you will be redirected to http://froogle.com/foobar, since 'foobar' was what the star replaced. $1 is for the + first star in the pattern, $2 for the second and so on. For regular expression $1 is for the first parentheses, $2 for the second etc.
  • Pattern type: This specifies how Redirector should interpret the patterns, either as wildcards or regular expressions.
  • @@ -91,7 +91,7 @@ matches will be unescaped (turned from e.g. http%3A%2F%2Fbar%2Ecom to http://bar.com) before being inserted into the target url. -
  • Escape matches: The opposite of Unescape matches. Let's say you want to redirect all requests to +
  • Escape matches: The opposite of Unescape matches. Let's say you want to redirect all requests to a domain like http://example.com to some proxy site that took the url to proxy as an url parameter. Then you might do something like the regular expression pattern ^(http://example\.com/.*) and redirect it to http://proxysite.com?url=$1. If you used the Escape matches option then the final url would become http://proxysite.com?url=http%3A%2F%2Fexample.com%2Ffoo%2Fbar. @@ -132,7 +132,7 @@

    Regular expressions allow for more complicated patterns but they are a lot harder to learn than wildcards. I'm not gonna create a regex tutorial here but normal javascript regex syntax works, look at http://regular-expressions.info for an introduction to regular expressions. $1,$2 etc. can be used in the redirect url and will be replaced with contents of captures in - the regular expressions. Captures are specified with parantheses. Example: http://example.com/index.asp\?id=(\d+) will match the url + the regular expressions. Captures are specified with parentheses. Example: http://example.com/index.asp\?id=(\d+) will match the url http://example.com/index.asp?id=12345 and $1 will be replaced by 12345. (A common mistake in regex patterns is to forget to escape the ? sign in the querystring of the url. ? is a special character in regular expressions so if you want to match an url with a querystring you should escape it as \?).

    @@ -180,7 +180,7 @@ Redirect to: - http://example.com/printerfriendly.com?id=$1&a=b + http://example.com/printerfriendly.php?id=$1&a=b Pattern type: @@ -206,7 +206,7 @@ Redirect to: - http://example.com/printerfriendly.com?id=$1&a=b + http://example.com/printerfriendly.php?id=$1&a=b Pattern type: @@ -238,7 +238,7 @@ Redirect to: - http://example.com/category/cats/index.php + http://example.com/category/cat/index.php Pattern type: @@ -246,7 +246,7 @@ Example result: - http://example.com/category/cats/index.php + http://example.com/category/cat/index.php
  • diff --git a/js/controllers/deleteredirect.js b/js/controllers/deleteredirect.js index f480339..c126df9 100644 --- a/js/controllers/deleteredirect.js +++ b/js/controllers/deleteredirect.js @@ -11,14 +11,14 @@ redirectorApp.controller('DeleteRedirectCtrl', ['$scope', function($s) { $s.cancelDelete = function(index) { delete $s.redirect; - delete $s.deletingIndex; + delete $s.deleteIndex; $s.$parent.showDeleteForm = false; } $s.deleteRedirect = function() { - $s.redirects.splice($s.deletingIndex, 1); + $s.redirects.splice($s.deleteIndex, 1); delete $s.redirect; - delete $s.deletingIndex; + delete $s.deleteIndex; $s.$parent.showDeleteForm = false; $s.saveChanges(); }; diff --git a/redirector.html b/redirector.html index 1627d03..7b381e2 100644 --- a/redirector.html +++ b/redirector.html @@ -5,7 +5,7 @@ - + -- cgit v1.2.3