blob: 5be85f7464d625a3c0e323a9584fcccbcacb6b9f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
//// $Id$
var Redirect = {
onLoad : function() {
var item = window.arguments[0];
item.saved = false;
$('txtExampleUrl').value = item.exampleUrl;
$('txtPattern').value = item.pattern;
$('txtRedirectUrl').value = item.redirectUrl || '';
$('chkOnlyIfLinkExists').checked = item.onlyIfLinkExists || false;
if (item.patternType == kRedirectorRegex) {
$('rdoRegex').setAttribute('selected', true);
$('rdoWildcard').setAttribute('selected', false);
}
},
onAccept : function() {
var item = window.arguments[0];
item.pattern = $('txtPattern').value;
if ($('rdoRegex').selected) {
item.patternType = kRedirectorRegex;
} else {
item.patternType = kRedirectorWildcard;
}
item.exampleUrl =$('txtExampleUrl').value;
item.redirectUrl = $('txtRedirectUrl').value;
item.onlyIfLinkExists = $('chkOnlyIfLinkExists').checked;
item.saved = true;
return true;
},
testPattern : function() {
var match;
alert(Redirector.wildcardMatch($('txtPattern').value, $('txtExampleUrl').value));
}
};
|