From c29a7abc00e65cc49f83c64d9beab0676541e214 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 19 Dec 2006 21:20:56 +0000 Subject: [PATCH] Addresses #401, Add keyboard shortcuts Closes #371, OCLC OpenURL resolver lookup should be a manual operation Closes #341, Switch preferences to use prefwindow with multiple prefpanes - Keyboard shortcuts for various actions and interface elements while Zotero pane is open, editable via new preference pane (which needs a better icon) -- more coming - Switched keyboard shortcuts on Mac (including Zotero pane shortcut) back to Command-Shift, since apparently Command-Option-everything is more or less totally broken on OS X -- this does conflict with Redo on OS X, but people can change one of the two if they care. - Option (on by default) to try to override existing shortcuts, which should help with some conflicts (e.g. Web Developer extension has a lot) - Preferences now use prefwindow, which is totally buggy but when it works makes for a nicer and more platform-specific UI (e.g. preferences take effect immediately on OS X with no OK button) - "Search for Resolvers" button instead of automatic request - Zotero.Prefs.get() now takes a second 'global' param to easily get non-Zotero prefs - Focus tag selector on display --- chrome/content/zotero/about.xul | 2 +- .../content/zotero/bindings/tagselector.xml | 8 + chrome/content/zotero/overlay.js | 74 ++++++- chrome/content/zotero/overlay.xul | 13 +- chrome/content/zotero/preferences.js | 92 ++++---- chrome/content/zotero/preferences.xul | 203 ++++++++++++------ chrome/content/zotero/xpcom/zotero.js | 87 +++++++- chrome/locale/en-US/zotero/preferences.dtd | 40 ++-- chrome/locale/en-US/zotero/zotero.properties | 3 + chrome/skin/default/zotero/preferences.css | 59 +++++ defaults/preferences/zotero.js | 10 + 11 files changed, 451 insertions(+), 140 deletions(-) create mode 100644 chrome/skin/default/zotero/preferences.css diff --git a/chrome/content/zotero/about.xul b/chrome/content/zotero/about.xul index 4b1e64857..247ca4066 100644 --- a/chrome/content/zotero/about.xul +++ b/chrome/content/zotero/about.xul @@ -10,7 +10,7 @@ orient="vertical" buttons="accept" buttonlabelaccept="&zotero.about.close;" - onload="onLoad();" + onload="moveToAlertPosition(); onLoad();" ondialogaccept="return true;"> @@ -291,9 +294,13 @@ + + modifiers="accel alt" /> \ No newline at end of file diff --git a/chrome/content/zotero/preferences.js b/chrome/content/zotero/preferences.js index db484922d..862c4ae89 100644 --- a/chrome/content/zotero/preferences.js +++ b/chrome/content/zotero/preferences.js @@ -20,13 +20,6 @@ ***** END LICENSE BLOCK ***** */ -var autoUpdateBox; -var reportTranslationFailure; -var positionMenu; -var parseEndnoteBox; -var automaticSnapshots; -var openURLMenu; -var openURLResolvers; var openURLServerField; var openURLVersionMenu; var zoteroPaneOnTopInitial; @@ -45,58 +38,49 @@ var zoteroPaneOnTopInitial; */ function init() -{ - autoUpdateBox = document.getElementById('autoUpdateBox'); - autoUpdateBox.checked = Zotero.Prefs.get('automaticScraperUpdates'); - - reportTranslationFailure = document.getElementById('reportTranslationFailure'); - reportTranslationFailure.checked = Zotero.Prefs.get('reportTranslationFailure'); - - positionMenu = document.getElementById('positionMenu'); - positionMenu.selectedIndex = zoteroPaneOnTopInitial = Zotero.Prefs.get('zoteroPaneOnTop') ? 0 : 1; - - parseEndnoteBox = document.getElementById('parseEndnoteBox'); - parseEndnoteBox.checked = Zotero.Prefs.get('parseEndNoteMIMETypes'); - - automaticSnapshots = document.getElementById('automaticSnapshots'); - automaticSnapshots.checked = Zotero.Prefs.get('automaticSnapshots'); - - openURLServerField = document.getElementById('openURLServerField'); - openURLServerField.value = Zotero.Prefs.get('openURL.resolver'); - openURLVersionMenu = document.getElementById('openURLVersionMenu'); - openURLVersionMenu.value = Zotero.Prefs.get('openURL.version'); - - openURLMenu = document.getElementById('openURLMenu'); - - openURLResolvers = Zotero.OpenURL.discoverResolvers(); - for(var i in openURLResolvers) - { - openURLMenu.insertItemAt(i,openURLResolvers[i]['name']); - if(openURLResolvers[i]['url'] == Zotero.Prefs.get('openURL.resolver') && openURLResolvers[i]['version'] == Zotero.Prefs.get('openURL.version')) - openURLMenu.selectedIndex = i; - } -} - -function accept() { - Zotero.Prefs.set('automaticScraperUpdates', autoUpdateBox.checked); - Zotero.Prefs.set('reportTranslationFailure', reportTranslationFailure.checked); - Zotero.Prefs.set('zoteroPaneOnTop', positionMenu.selectedIndex == 0); - - if(Zotero.Prefs.get('parseEndNoteMIMETypes') != parseEndnoteBox.checked) - { - Zotero.Prefs.set('parseEndNoteMIMETypes', parseEndnoteBox.checked); - Zotero.Ingester.MIMEHandler.init(); + // Display the appropriate modifier keys for the platform + var rows = document.getElementById('zotero-prefpane-keys').getElementsByTagName('row'); + for (var i=0; i - + - + + + - - - -