aboutsummaryrefslogtreecommitdiff
path: root/chrome/js
diff options
context:
space:
mode:
authorEinar Egilsson2011-08-29 22:47:26 +0200
committerEinar Egilsson2011-08-29 22:47:26 +0200
commitb69f768ac83291de532161ae1da48ea20ffc01d6 (patch)
tree1fe09119cb67333505ed5755e687a9b125103e3e /chrome/js
parent66ad230105ccf1b504d9589886f174020c324b18 (diff)
CSS for settings page
Diffstat (limited to 'chrome/js')
-rw-r--r--chrome/js/settings.js16
1 files changed, 15 insertions, 1 deletions
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);