aboutsummaryrefslogtreecommitdiff
path: root/chrome/content/code/settings.xul.js
diff options
context:
space:
mode:
authorEinar Egilsson2009-10-15 09:49:49 +0000
committerEinar Egilsson2009-10-15 09:49:49 +0000
commit9266c7831e5e4d0f4e123bd62e6cc0a2d114038f (patch)
treee4f8dce7b087ba1e6f438edf22218e516469ba30 /chrome/content/code/settings.xul.js
parentfe10350d0c16eb700e22960c34c25c4d8b50d94f (diff)
Del and Enter keys work in redirect list.
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@268 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome/content/code/settings.xul.js')
-rw-r--r--chrome/content/code/settings.xul.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/chrome/content/code/settings.xul.js b/chrome/content/code/settings.xul.js
index c7b375c..f85c1ee 100644
--- a/chrome/content/code/settings.xul.js
+++ b/chrome/content/code/settings.xul.js
@@ -12,6 +12,8 @@ var Settings = {
btnEdit : null,
btnUp : null,
btnDown : null,
+ btnExport : null,
+ btnImport : null,
chkEnableRedirector : null,
chkShowStatusBarIcon : null,
chkShowContextMenu : null,
@@ -25,6 +27,8 @@ var Settings = {
this.btnEdit = document.getElementById('btnEdit');
this.btnUp = document.getElementById('btnUp');
this.btnDown = document.getElementById('btnDown');
+ this.btnExport = document.getElementById('btnExport');
+ this.btnImport = document.getElementById('btnImport');
this.chkEnableRedirector = document.getElementById('chkEnableRedirector');
this.chkShowStatusBarIcon = document.getElementById('chkShowStatusBarIcon');
this.chkShowContextMenu = document.getElementById('chkShowContextMenu');
@@ -39,7 +43,8 @@ var Settings = {
this.template = document.getElementsByTagName('richlistitem')[0];
this.lstRedirects.removeChild(this.template);
this.addItemsToListBox(Redirector.list);
-
+ this.selectionChange();
+
this.strings = document.getElementById('redirector-strings');
this.strings.getPluralized = function(id, number) {
id += number == 1 ? 'Singular' : '';
@@ -188,6 +193,14 @@ var Settings = {
alert(e);
}
},
+
+ listKeypress : function(event) {
+ if (event.keyCode == 13) { //Enter button
+ this.editRedirect();
+ } else if (event.keyCode == 46) { //Del button
+ this.deleteRedirect();
+ }
+ },
selectionChange : function() {
if (!this.lstRedirects) {
@@ -199,6 +212,7 @@ var Settings = {
this.btnDelete.disabled = (index == -1);
this.btnUp.disabled = (index <= 0);
this.btnDown.disabled = (index == -1 || index >= Redirector.list.length-1);
+ this.btnExport.disabled = (Redirector.list.length == 0);
},
importExport : function(mode, captionKey, func) {