www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 6ad69b3a13fa590796ec959e66cd6168c6a2e790
parent fe29c538e96e5f139e0e33f453e7bdc0b9c7f505
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 30 Aug 2006 19:07:51 +0000

Closes #201, new collection (formerly project) naming

Dialog on new collection and cleaner dialog for rename


Diffstat:
Mchrome/chromeFiles/content/scholar/overlay.js | 33+++++++++++++++++++++++++++++----
Mchrome/chromeFiles/locale/en-US/scholar/scholar.dtd | 2+-
Mchrome/chromeFiles/locale/en-US/scholar/scholar.properties | 5+++--
3 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/chrome/chromeFiles/content/scholar/overlay.js b/chrome/chromeFiles/content/scholar/overlay.js @@ -153,7 +153,24 @@ var ScholarPane = new function() function newCollection() { - Scholar.Collections.add(Scholar.getString('pane.collections.untitled')); + var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Components.interfaces.nsIPromptService); + + var newName = { value: Scholar.getString('pane.collections.untitled') }; + var result = promptService.prompt(window, "", + Scholar.getString('pane.collections.name'), newName, "", {}); + + if (!result) + { + return false; + } + + if (!newName.value) + { + newName.value = Scholar.getString('pane.collections.untitled'); + } + + Scholar.Collections.add(newName.value); } function newSearch() @@ -276,9 +293,17 @@ var ScholarPane = new function() if(collection.isCollection()) { - var newName = prompt(Scholar.getString('pane.collections.rename'),collection.getName()); - if(newName) - collection.ref.rename(newName); + var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] + .getService(Components.interfaces.nsIPromptService); + + var newName = { value: collection.getName() }; + var result = promptService.prompt(window, "", + Scholar.getString('pane.collections.rename'), newName, "", {}); + + if (result && newName.value) + { + collection.ref.rename(newName.value); + } } else { diff --git a/chrome/chromeFiles/locale/en-US/scholar/scholar.dtd b/chrome/chromeFiles/locale/en-US/scholar/scholar.dtd @@ -20,7 +20,7 @@ <!ENTITY toolbar.newItem.label "New Item"> <!ENTITY toolbar.removeItem.label "Remove Item..."> -<!ENTITY toolbar.newCollection.label "New Collection"> +<!ENTITY toolbar.newCollection.label "New Collection..."> <!ENTITY toolbar.newSavedSearch.label "New Saved Search..."> <!ENTITY toolbar.renameCollection.label "Rename Collection..."> <!ENTITY toolbar.removeCollection.label "Remove Collection..."> diff --git a/chrome/chromeFiles/locale/en-US/scholar/scholar.properties b/chrome/chromeFiles/locale/en-US/scholar/scholar.properties @@ -1,8 +1,9 @@ pane.collections.delete = Are you sure you want to delete the selected collection? pane.collections.delete.multiple = Are you sure you want to delete the selected collections? -pane.collections.rename = Rename Collection: +pane.collections.name = Collection name: +pane.collections.rename = Rename collection: pane.collections.library = My Library -pane.collections.untitled = Untitled Collection +pane.collections.untitled = Untitled pane.items.delete = Are you sure you want to delete the selected item? pane.items.delete.multiple = Are you sure you want to delete the selected items?