aboutsummaryrefslogtreecommitdiff
path: root/chrome/js
diff options
context:
space:
mode:
authorEinar Egilsson2011-08-30 14:09:25 +0200
committerEinar Egilsson2011-08-30 14:09:25 +0200
commite5f69904485c924d8eef44dd64ee7a07d9fc4789 (patch)
treed30ddb70b6232c67803124346aa37b6fd12ad071 /chrome/js
parentf0843d03e265c47258c92499248f45bff4ece6f4 (diff)
Delete redirects
Diffstat (limited to 'chrome/js')
-rw-r--r--chrome/js/settings.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/chrome/js/settings.js b/chrome/js/settings.js
index c5675f6..29cdf29 100644
--- a/chrome/js/settings.js
+++ b/chrome/js/settings.js
@@ -75,7 +75,7 @@ $(document).ready(function() {
var template = $('#redirect-list').html().replace(/^\s*|\s$/g, '');
function databind() {
- $('#redirect-list').html('');
+ $('#redirect-list').empty();
for (var i = 0; i < Redirector.redirectCount; i++) {
var redirect = Redirector.getRedirectAt(i);
var node = $(template);
@@ -87,10 +87,16 @@ $(document).ready(function() {
node.data('redirect', redirect);
}
- $('#redirect-list li a').click(function() {
- alert(this.parentNode.parentNode.redirect);
- });
}
+
+ $('#redirect-list li div a.delete').live('click', function(ev) {
+ var redirect = $(this.parentNode.parentNode).data('redirect');
+ if (PromptService.confirm(null, tr("deleteConfirmationTitle"), tr("deleteConfirmationText"))) {
+ Redirector.deleteRedirect(redirect);
+ $(this.parentNode.parentNode).remove();
+ }
+ ev.preventDefault();
+ });
databind();