diff options
author | Einar Egilsson | 2007-05-21 22:03:05 +0000 |
---|---|---|
committer | Einar Egilsson | 2007-05-21 22:03:05 +0000 |
commit | 502c24f18cdfa0f808d9383313bb4f965c7fb11f (patch) | |
tree | c9f2523995b6fc59e3bf6cc3bcc9200bbedd5e95 /chrome/content/redirect.js |
Redirector
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@53 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome/content/redirect.js')
-rw-r--r-- | chrome/content/redirect.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/chrome/content/redirect.js b/chrome/content/redirect.js new file mode 100644 index 0000000..bd1a686 --- /dev/null +++ b/chrome/content/redirect.js @@ -0,0 +1,30 @@ +//// $Id$ + +var Redirect = { + + onLoad : function() { + var params = window.arguments[0]; + $('txtExampleUrl').value = params.inn.url; + $('txtPattern').value = params.inn.url; + $('txtRedirectUrl').value = params.inn.redirect || ''; + + }, + + onAccept : function() { + var params = window.arguments[0]; + + params.out.pattern = $('txtPattern').value; + params.out.patternType = 'Wildcard'; + params.out.redirectUrl = $('txtRedirectUrl').value; + params.out.onlyIfLinkExists = $('chkOnlyIfLinkExists').checked; + + return true; + }, + + testPattern : function() { + try { + alert(RedirectorCommon.wildcardMatch($('txtPattern').value, $('txtExampleUrl').value)); + } catch(e) {alert(e);} + } + +};
\ No newline at end of file |