Closes #955, Don't generate bibliography when dragging many items
Default limit set to 50, configurable in the Export pane
This commit is contained in:
parent
8437a55e3e
commit
f73e2ceb58
|
@ -455,6 +455,7 @@ To add a new preference:
|
||||||
<preferences>
|
<preferences>
|
||||||
<preference id="pref-export-citePaperJournalArticleURL" name="extensions.zotero.export.citePaperJournalArticleURL" type="bool"/>
|
<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"/>
|
<preference id="pref-quickCopy-setting" name="extensions.zotero.export.quickCopy.setting" type="string"/>
|
||||||
|
<preference id="pref-quickCopy-dragLimit" name="extensions.zotero.export.quickCopy.dragLimit" type="int"/>
|
||||||
</preferences>
|
</preferences>
|
||||||
|
|
||||||
<groupbox>
|
<groupbox>
|
||||||
|
@ -503,6 +504,15 @@ To add a new preference:
|
||||||
|
|
||||||
<separator/>
|
<separator/>
|
||||||
|
|
||||||
|
<!-- TODO: localize -->
|
||||||
|
<hbox align="center">
|
||||||
|
<label value="Disable Quick Copy when dragging more than"/>
|
||||||
|
<textbox preference="pref-quickCopy-dragLimit" size="3"/>
|
||||||
|
<label value="items" flex="1"/>
|
||||||
|
</hbox>
|
||||||
|
|
||||||
|
<separator/>
|
||||||
|
|
||||||
<label id="quickCopy-macWarning" hidden="true" value="&zotero.preferences.quickCopy.macWarning;"/>
|
<label id="quickCopy-macWarning" hidden="true" value="&zotero.preferences.quickCopy.macWarning;"/>
|
||||||
</groupbox>
|
</groupbox>
|
||||||
</prefpane>
|
</prefpane>
|
||||||
|
|
|
@ -1715,17 +1715,19 @@ Zotero.ItemTreeView.prototype.onDragStart = function (event, transferData, actio
|
||||||
}
|
}
|
||||||
else if (mode.indexOf('bibliography') == 0) {
|
else if (mode.indexOf('bibliography') == 0) {
|
||||||
var content = Zotero.QuickCopy.getContentFromItems(items, format, null, event.shiftKey);
|
var content = Zotero.QuickCopy.getContentFromItems(items, format, null, event.shiftKey);
|
||||||
if (oldMethod) {
|
if (content) {
|
||||||
if (content.html) {
|
if (oldMethod) {
|
||||||
transferData.data.addDataForFlavour("text/html", content.html);
|
if (content.html) {
|
||||||
|
transferData.data.addDataForFlavour("text/html", content.html);
|
||||||
|
}
|
||||||
|
transferData.data.addDataForFlavour("text/unicode", content.text);
|
||||||
}
|
}
|
||||||
transferData.data.addDataForFlavour("text/unicode", content.text);
|
else {
|
||||||
}
|
if (content.html) {
|
||||||
else {
|
event.dataTransfer.setData("text/html", content.html);
|
||||||
if (content.html) {
|
}
|
||||||
event.dataTransfer.setData("text/html", content.html);
|
event.dataTransfer.setData("text/plain", content.text);
|
||||||
}
|
}
|
||||||
event.dataTransfer.setData("text/plain", content.text);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -132,6 +132,11 @@ Zotero.QuickCopy = new function() {
|
||||||
* contain properties 'text' and 'html' is returned.
|
* contain properties 'text' and 'html' is returned.
|
||||||
*/
|
*/
|
||||||
function getContentFromItems(items, format, callback, modified) {
|
function getContentFromItems(items, format, callback, modified) {
|
||||||
|
if (items.length > Zotero.Prefs.get('export.quickCopy.dragLimit')) {
|
||||||
|
Zotero.debug("Skipping quick copy for " + items.length + " items");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var [mode, format] = format.split('=');
|
var [mode, format] = format.split('=');
|
||||||
var [mode, contentType] = mode.split('/');
|
var [mode, contentType] = mode.split('/');
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,7 @@ pref("extensions.zotero.rtfScan.lastInputFile", "");
|
||||||
pref("extensions.zotero.rtfScan.lastOutputFile", "");
|
pref("extensions.zotero.rtfScan.lastOutputFile", "");
|
||||||
|
|
||||||
pref("extensions.zotero.export.quickCopy.setting", 'bibliography=http://www.zotero.org/styles/chicago-note');
|
pref("extensions.zotero.export.quickCopy.setting", 'bibliography=http://www.zotero.org/styles/chicago-note');
|
||||||
|
pref("extensions.zotero.export.quickCopy.dragLimit", 50);
|
||||||
|
|
||||||
// Integration settings
|
// Integration settings
|
||||||
pref("extensions.zotero.integration.port", 50001);
|
pref("extensions.zotero.integration.port", 50001);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user