Closes #1863, Add transform -> sentence case option

This commit is contained in:
Simon Kornblith 2011-07-11 17:14:51 +00:00
parent 498f06c49b
commit 5e8c9669ea
2 changed files with 8 additions and 2 deletions

View file

@ -1825,6 +1825,9 @@
case 'title':
var newVal = Zotero.Utilities.capitalizeTitle(val.toLowerCase(), true);
break;
case 'sentence':
var newVal = val.length ? val[0].toUpperCase()+val.substr(1).toLowerCase() : val;
break;
default:
throw ("Invalid transform mode '" + mode + "' in zoteroitembox.textTransform()");
}
@ -2264,10 +2267,12 @@
<menupopup id="field-menu">
<menu label="&zotero.item.textTransform;">
<menupopup>
<menuitem label="&zotero.item.textTransform.lowercase;" class="menuitem-non-iconic"
oncommand="document.getBindingParent(this).textTransform(document.popupNode, 'lower')"/>
<menuitem label="&zotero.item.textTransform.titlecase;" class="menuitem-non-iconic"
oncommand="document.getBindingParent(this).textTransform(document.popupNode, 'title')"/>
<menuitem label="&zotero.item.textTransform.sentencecase;" class="menuitem-non-iconic"
oncommand="document.getBindingParent(this).textTransform(document.popupNode, 'sentence')"/>
<menuitem label="&zotero.item.textTransform.lowercase;" class="menuitem-non-iconic"
oncommand="document.getBindingParent(this).textTransform(document.popupNode, 'lower')"/>
</menupopup>
</menu>
</menupopup>

View file

@ -99,6 +99,7 @@
<!ENTITY zotero.item.textTransform "Transform Text">
<!ENTITY zotero.item.textTransform.lowercase "lower case">
<!ENTITY zotero.item.textTransform.titlecase "Title Case">
<!ENTITY zotero.item.textTransform.sentencecase "Sentence case">
<!ENTITY zotero.toolbar.newNote "New Note">
<!ENTITY zotero.toolbar.note.standalone "New Standalone Note">