Closes #201, new collection (formerly project) naming
Dialog on new collection and cleaner dialog for rename
This commit is contained in:
parent
fe29c538e9
commit
6ad69b3a13
3 changed files with 33 additions and 7 deletions
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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...">
|
||||
|
|
|
@ -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?
|
||||
|
|
Loading…
Add table
Reference in a new issue