aboutsummaryrefslogtreecommitdiff
path: root/chrome/content/redirectList.js
diff options
context:
space:
mode:
authorEinar Egilsson2007-08-07 12:59:18 +0000
committerEinar Egilsson2007-08-07 12:59:18 +0000
commit87b8db3e5ebf0911f613f71ce1251276ece47304 (patch)
tree042467f6560e93aaa58545f6bdcedb01999ea0b6 /chrome/content/redirectList.js
parenta62300554bc3c4f0e5df918fef40c57fef521974 (diff)
Redirector 0.9.2
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@74 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome/content/redirectList.js')
-rw-r--r--chrome/content/redirectList.js39
1 files changed, 29 insertions, 10 deletions
diff --git a/chrome/content/redirectList.js b/chrome/content/redirectList.js
index 081359f..159bc8a 100644
--- a/chrome/content/redirectList.js
+++ b/chrome/content/redirectList.js
@@ -12,16 +12,7 @@ var RedirectList = {
var item, row, value;
for each (item in items) {
- row = document.createElement('listitem');
-
- this.createCell(row, item.pattern);
- this.createCell(row, item.exampleUrl);
- this.createCell(row, item.redirectUrl);
- this.createCell(row, item.onlyIfLinkExists);
- this.createCell(row, item.patternType);
-
- row.item = item;
-
+ row = this.createRow(item);
list.appendChild(row);
}
},
@@ -33,6 +24,18 @@ var RedirectList = {
row.appendChild(cell);
},
+ createRow : function(item) {
+ var row = document.createElement('listitem');
+
+ this.createCell(row, item.pattern);
+ this.createCell(row, item.exampleUrl);
+ this.createCell(row, item.redirectUrl);
+ this.createCell(row, item.onlyIfLinkExists);
+ this.createCell(row, item.patternType);
+
+ row.item = item;
+ return row;
+ },
onLoad : function() {
try {
@@ -51,6 +54,22 @@ var RedirectList = {
window.close();
},
+ addRedirect : function() {
+
+ var item = { pattern : '', exampleUrl : '', redirectUrl : '', onlyIfLinkExists : false, patternType : 'W'};
+
+ window.openDialog("chrome://redirector/content/redirect.xul",
+ "redirect",
+ "chrome,dialog,modal,centerscreen", item);
+
+ if (item.saved) {
+ var row = this.createRow(item);
+ $('lstRedirects').appendChild(row);
+ Redirector.addRedirect(item);
+ }
+
+ },
+
editRedirect : function() {
var listItem = this.lstRedirects.selectedItem;