"Use"->"Keep" existing rights field for clarity in My Publications

This commit is contained in:
Dan Stillman 2015-11-01 18:21:48 -05:00
parent 53478f4752
commit 3ad6e78d98
4 changed files with 21 additions and 21 deletions

View file

@ -31,7 +31,7 @@ var Zotero_Publications_Dialog = new function () {
var _hasRights = null;
var _includeFiles = true;
var _includeNotes = true;
var _useRights = true;
var _keepRights = true;
var _shareSettings = {
sharing: 'reserved', // 'reserved', 'cc', 'cc0'
adaptations: 'no',
@ -50,7 +50,7 @@ var Zotero_Publications_Dialog = new function () {
_hasFiles = _io.hasFiles;
_hasNotes = _io.hasNotes;
_hasRights = _io.hasRights;
if (_hasRights == 'none') _useRights = false;
if (_hasRights == 'none') _keepRights = false;
delete _io.hasFiles;
delete _io.hasNotes;
delete _io.hasRights;
@ -98,20 +98,20 @@ var Zotero_Publications_Dialog = new function () {
}
}
else if (pageid == 'choose-sharing') {
let useRightsBox = document.getElementById('use-rights');
let useRightsCheckbox = document.getElementById('use-rights-checkbox');
let keepRightsBox = document.getElementById('keep-rights');
let keepRightsCheckbox = document.getElementById('keep-rights-checkbox');
if (_hasRights == 'none') {
useRightsBox.hidden = true;
keepRightsBox.hidden = true;
document.getElementById('sharing-radiogroup').focus();
}
else {
let str = 'publications.sharing.useRightsField';
let str = 'publications.sharing.keepRightsField';
if (_hasRights == 'some') {
str += 'WhereAvailable';
}
useRightsCheckbox.label = Zotero.getString(str);
useRightsCheckbox.checked = _useRights;
this.updateUseRights(useRightsCheckbox.checked);
keepRightsCheckbox.label = Zotero.getString(str);
keepRightsCheckbox.checked = _keepRights;
this.updateKeepRights(keepRightsCheckbox.checked);
}
}
// Select appropriate radio button from current license
@ -145,7 +145,7 @@ var Zotero_Publications_Dialog = new function () {
// items, go to license chooser next
(currentPage.pageid == 'choose-sharing'
&& _shareSettings.sharing == 'cc'
&& !(_hasRights == 'all' && _useRights))) {
&& !(_hasRights == 'all' && _keepRights))) {
this.lastPage = false;
finishButton.hidden = true;
nextButton.hidden = false;
@ -177,11 +177,11 @@ var Zotero_Publications_Dialog = new function () {
/**
* Update rights setting from checkbox and hide sharing setting if necessary
*/
this.updateUseRights = function (useRights) {
_useRights = useRights;
this.updateKeepRights = function (keepRights) {
_keepRights = keepRights;
// If all items have rights and we're using them, the sharing page is the last page
document.getElementById('choose-sharing-options').hidden = _hasRights == 'all' && useRights;
document.getElementById('choose-sharing-options').hidden = _hasRights == 'all' && keepRights;
this.updateNextButton();
}
@ -211,7 +211,7 @@ var Zotero_Publications_Dialog = new function () {
this.onFinish = function () {
_io.includeFiles = document.getElementById('include-files').checked;
_io.includeNotes = document.getElementById('include-notes').checked;
_io.useRights = _useRights;
_io.keepRights = _keepRights;
_io.license = _license;
_io.licenseName = _getLicenseName(_license);
}

View file

@ -60,9 +60,9 @@
<wizardpage pageid="choose-sharing" label="&zotero.publications.sharing.title;"
onpageshow="Zotero_Publications_Dialog.updatePage()">
<vbox id="use-rights">
<checkbox id="use-rights-checkbox"
oncommand="Zotero_Publications_Dialog.updateUseRights(this.checked)"/>
<vbox id="keep-rights">
<checkbox id="keep-rights-checkbox"
oncommand="Zotero_Publications_Dialog.updateKeepRights(this.checked)"/>
<separator/>
</vbox>
<vbox id="choose-sharing-options">

View file

@ -1672,7 +1672,7 @@ Zotero.CollectionTreeView.prototype.drop = Zotero.Promise.coroutine(function* (r
// Set Rights field for My Publications
if (options.license) {
if (!options.useRights || !newItem.getField('rights')) {
if (!options.keepRights || !newItem.getField('rights')) {
newItem.setField('rights', options.licenseName);
}
}
@ -1836,7 +1836,7 @@ Zotero.CollectionTreeView.prototype.drop = Zotero.Promise.coroutine(function* (r
copyOptions.childFileAttachments = io.includeFiles;
copyOptions.childLinks = true;
copyOptions.tags = true; // TODO: add checkbox
['useRights', 'license', 'licenseName'].forEach(function (field) {
['keepRights', 'license', 'licenseName'].forEach(function (field) {
copyOptions[field] = io[field];
});
}

View file

@ -1023,8 +1023,8 @@ styles.editor.output.individualCitations = Individual Citations
styles.editor.output.singleCitation = Single Citation (with position "first")
styles.preview.instructions = Select one or more items in Zotero and click the "Refresh" button to see how these items are rendered by the installed CSL citation styles.
publications.sharing.useRightsField = Use the existing Rights field
publications.sharing.useRightsFieldWhereAvailable = Use the existing Rights field where available
publications.sharing.keepRightsField = Keep the existing Rights field
publications.sharing.keepRightsFieldWhereAvailable = Keep the existing Rights field where available
publications.cc.moreInfo.text = Be sure you have read the Creative Commons %S before placing your work under a CC license. Note that the license you apply cannot be revoked, even if you later choose different terms or cease publishing the work.
publications.cc.moreInfo.linkText = Considerations for licensors
publications.cc0.moreInfo.text = Be sure you have read the Creative Commons %S before applying CC0 to your work. Please note that dedicating your work to the public domain is irreversible, even if you later choose different terms or cease publishing the work.