aboutsummaryrefslogtreecommitdiff
path: root/chrome/content/redirectList.js
diff options
context:
space:
mode:
authorEinar Egilsson2007-05-28 23:17:52 +0000
committerEinar Egilsson2007-05-28 23:17:52 +0000
commitf77a93fe56b90c89d3a881d9af84d43e451efe8d (patch)
treec7be0b2a34e2e7566961793d7168f698ae96240a /chrome/content/redirectList.js
parentca4130f47bbe7f461dc1bc29d4aebb2dec305677 (diff)
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@56 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome/content/redirectList.js')
-rw-r--r--chrome/content/redirectList.js29
1 files changed, 20 insertions, 9 deletions
diff --git a/chrome/content/redirectList.js b/chrome/content/redirectList.js
index 522fa20..7a273cd 100644
--- a/chrome/content/redirectList.js
+++ b/chrome/content/redirectList.js
@@ -1,30 +1,41 @@
var RedirectList = {
+ id : "redirector@einaregilsson.com",
+ name : "Redirector",
addItemsToListBox : function(items) {
- var list = document.getElementById('foo');
+ var list = $('lstRedirects');
var item, row, value;
for each (item in items) {
-
row = document.createElement('listitem');
- for each (value in item) {
- cell = document.createElement('listcell');
- cell.setAttribute('label',value);
- cell.setAttribute('value',value);
- row.appendChild(cell);
- }
+ this.createCell(row, item.exampleUrl);
+ this.createCell(row, item.pattern);
+ this.createCell(row, item.redirectUrl);
+ this.createCell(row, item.onlyIfLinkExists);
list.appendChild(row);
}
},
+ createCell : function(row, value) {
+ var cell = document.createElement('listcell');
+ cell.setAttribute('label', value);
+ cell.setAttribute('value', value);
+ row.appendChild(cell);
+ },
onLoad : function() {
- addItemsToList(items);
+ try {
+ RedirLib.initialize(this);
+ Redirector.init();
+ this.addItemsToListBox(Redirector.list);
+ } catch(e) {
+ alert(e);
+ }
}
};