aboutsummaryrefslogtreecommitdiff
path: root/chrome/js/settings.js
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/js/settings.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);