diff options
Diffstat (limited to 'chrome/content/redirectList.js')
-rw-r--r-- | chrome/content/redirectList.js | 29 |
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); + } } }; |