From b69f768ac83291de532161ae1da48ea20ffc01d6 Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Mon, 29 Aug 2011 22:47:26 +0200 Subject: CSS for settings page --- chrome/js/settings.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'chrome/js') diff --git a/chrome/js/settings.js b/chrome/js/settings.js index 3ab7c25..fbbc332 100644 --- a/chrome/js/settings.js +++ b/chrome/js/settings.js @@ -73,13 +73,27 @@ $(document).ready(function() { } } + var template = $('#redirect-list').html().replace(/^\s*|\s$/g, ''); function databind() { + $('#redirect-list').html(''); for (var i = 0; i < Redirector.redirectCount; i++) { var redirect = Redirector.getRedirectAt(i); - $('#redirect-list'); + var node = $(template); + node.find('.pattern').html(redirect.includePattern); + node.find('.redirectTo').html(redirect.redirectUrl); + node.find('.exampleUrl').html(redirect.exampleUrl); + node.find('.redirectResult').html(redirect.getMatch(redirect.exampleUrl).redirectTo); + node.appendTo('#redirect-list'); + node.redirect = redirect; } + + $('#redirect-list li a').click(function() { + alert(this.parentNode.parentNode.redirect); + }); } + + databind(); $('#import').click(importRedirects); $('#export').click(exportRedirects); -- cgit v1.2.3-70-g09d2