From f77a93fe56b90c89d3a881d9af84d43e451efe8d Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Mon, 28 May 2007 23:17:52 +0000 Subject: git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@56 119bf307-c92d-0410-89bd-8f53e6181181 --- chrome/content/redirectList.js | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'chrome/content/redirectList.js') 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); + } } }; -- cgit v1.2.3-70-g09d2