- closes #841, Do not cite URL for articles with page numbers by default
- adds a preference to configure this behavior. if localizing the strings is too much work, we can defer this to a later release
This commit is contained in:
parent
43c07f853b
commit
3487bf8737
|
@ -245,9 +245,16 @@ To add a new preference:
|
|||
label="&zotero.preferences.prefpane.export;"
|
||||
image="chrome://zotero/skin/prefs-export.png">
|
||||
<preferences>
|
||||
<preference id="pref-export-citePaperJournalArticleURL" name="extensions.zotero.export.citePaperJournalArticleURL" type="bool"/>
|
||||
<preference id="pref-quickCopy-setting" name="extensions.zotero.export.quickCopy.setting" type="string"/>
|
||||
</preferences>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.preferences.citationOptions.caption;"/>
|
||||
<checkbox label="&zotero.preferences.export.citePaperJournalArticleURL;" preference="pref-export-citePaperJournalArticleURL"/>
|
||||
<label id="export-citePaperJournalArticleURL">&zotero.preferences.export.citePaperJournalArticleURL.description;</label>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.preferences.quickCopy.caption;"/>
|
||||
|
||||
|
|
|
@ -1713,6 +1713,14 @@ Zotero.CSL.Item = function(item) {
|
|||
throw "Zotero.CSL.Item called to wrap a non-item";
|
||||
}
|
||||
|
||||
// don't return URL or accessed information for journal articles if a
|
||||
// pages field exists
|
||||
if(!Zotero.Prefs.get("export.citePaperJournalArticleURL")
|
||||
&& Zotero.ItemTypes.getName(this.zoteroItem.getType()) == "journalArticle"
|
||||
&& this.zoteroItem.getField("pages")) {
|
||||
this._ignoreURL = true;
|
||||
}
|
||||
|
||||
this._properties = {};
|
||||
this._refreshItem();
|
||||
}
|
||||
|
@ -1766,6 +1774,9 @@ Zotero.CSL.Item.prototype.getNames = function(variable) {
|
|||
* Gets an Item.Date object for a specific type.
|
||||
*/
|
||||
Zotero.CSL.Item.prototype.getDate = function(variable) {
|
||||
// ignore accessed date
|
||||
if(this._ignoreURL && variable == "accessed") return false;
|
||||
|
||||
// load date variable if possible
|
||||
this._refreshItem();
|
||||
if(this._dates[variable] == undefined) {
|
||||
|
@ -1813,6 +1824,9 @@ Zotero.CSL.Item._zoteroFieldMap = {
|
|||
Zotero.CSL.Item.prototype.getVariable = function(variable, form) {
|
||||
if(!Zotero.CSL.Item._zoteroFieldMap["long"][variable]) return "";
|
||||
|
||||
// ignore URL
|
||||
if(this._ignoreURL && variable == "URL") return ""
|
||||
|
||||
var zoteroFields = [];
|
||||
var field;
|
||||
|
||||
|
@ -1832,7 +1846,6 @@ Zotero.CSL.Item.prototype.getVariable = function(variable, form) {
|
|||
zoteroFields = zoteroFields.concat(field);
|
||||
}
|
||||
|
||||
|
||||
for each(var zoteroField in zoteroFields) {
|
||||
var value = this.zoteroItem.getField(zoteroField, false, true);
|
||||
if(value != "") return value;
|
||||
|
|
|
@ -47,6 +47,10 @@
|
|||
|
||||
<!ENTITY zotero.preferences.prefpane.export "Export">
|
||||
|
||||
<!ENTITY zotero.preferences.citationOptions.caption "Citation Options">
|
||||
<!ENTITY zotero.preferences.export.citePaperJournalArticleURL "Include URLs of paper journal articles in references">
|
||||
<!ENTITY zotero.preferences.export.citePaperJournalArticleURL.description "When this option is disabled, Zotero includes URLs when citing journal articles only if the article does not have a page range specified.">
|
||||
|
||||
<!ENTITY zotero.preferences.quickCopy.caption "Quick Copy">
|
||||
<!ENTITY zotero.preferences.quickCopy.defaultOutputFormat "Default Output Format:">
|
||||
<!ENTITY zotero.preferences.quickCopy.macWarning "Note: Rich-text formatting will be lost on Mac OS X.">
|
||||
|
|
|
@ -95,7 +95,7 @@ grid row hbox:first-child
|
|||
height: 1em;
|
||||
}
|
||||
|
||||
#quickCopy-instructions, #quickCopy-macWarning
|
||||
#quickCopy-instructions, #quickCopy-macWarning, #export-citePaperJournalArticleURL
|
||||
{
|
||||
font-size: .85em;
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ pref("extensions.zotero.export.translatorSettings", 'true,false');
|
|||
pref("extensions.zotero.export.lastStyle", 'http://www.zotero.org/styles/chicago-note.csl');
|
||||
pref("extensions.zotero.export.bibliographySettings", 'save-as-rtf');
|
||||
pref("extensions.zotero.export.bibliographyLocale", '');
|
||||
pref("extensions.zotero.export.citePaperJournalArticleURL", false);
|
||||
|
||||
pref("extensions.zotero.export.quickCopy.setting", 'bibliography=http://www.zotero.org/styles/chicago-note.csl');
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user