Remove lots of old Zotero for Firefox code

We still run tests in Firefox, so not everything can be removed.
This commit is contained in:
Dan Stillman 2018-08-17 02:18:35 -04:00
parent c2ca70055c
commit e48a1a2abb
36 changed files with 46 additions and 3156 deletions

View file

@ -58,17 +58,7 @@ skin zotero default chrome/skin/default/zotero/
overlay chrome://browser/content/browser.xul chrome://zotero/content/overlay.xul overlay chrome://browser/content/browser.xul chrome://zotero/content/overlay.xul
overlay chrome://zotero/content/preferences/preferences.xul chrome://zotero/content/preferences/preferences_firefox.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
overlay chrome://zotero/content/preferences/preferences.xul#cite chrome://zotero/content/preferences/preferences_firefox.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
overlay chrome://zotero/content/preferences/preferences_general.xul chrome://zotero/content/preferences/preferences_general_firefox.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
overlay chrome://zotero/content/preferences/preferences_export.xul chrome://zotero/content/preferences/preferences_export_firefox.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
overlay chrome://zotero/content/preferences/preferences_keys.xul chrome://zotero/content/preferences/preferences_keys_firefox.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
overlay chrome://zotero/content/preferences/preferences_advanced.xul chrome://zotero/content/preferences/preferences_advanced_firefox.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
overlay chrome://mozapps/content/downloads/unknownContentType.xul chrome://zotero/content/downloadOverlay.xul
style chrome://browser/content/browser.xul chrome://zotero/skin/zotero.css style chrome://browser/content/browser.xul chrome://zotero/skin/zotero.css
style chrome://global/content/customizeToolbar.xul chrome://zotero/skin/zotero.css
component {e4c61080-ec2d-11da-8ad9-0800200c9a66} components/zotero-service.js component {e4c61080-ec2d-11da-8ad9-0800200c9a66} components/zotero-service.js
component {531828f8-a16c-46be-b9aa-14845c3b010f} components/zotero-service.js component {531828f8-a16c-46be-b9aa-14845c3b010f} components/zotero-service.js

View file

@ -1,94 +1,3 @@
/*
As of Fx36, the built-in Mac styles don't properly handle a menu-button within a combined
button, so we need this ungodly mess.
*/
#zotero-toolbar-buttons[cui-areatype="toolbar"] > separator,
#zotero-toolbar-save-button[cui-areatype="toolbar"]:not(:hover) > .toolbarbutton-menubutton-dropmarker::before,
#zotero-toolbar-buttons[cui-areatype="toolbar"]:hover > #zotero-toolbar-save-button {
box-shadow: none;
}
#zotero-toolbar-save-button[cui-areatype="toolbar"] {
border: 0;
}
#zotero-toolbar-main-button[cui-areatype="toolbar"] {
margin-right: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
padding-right: 2px;
padding-left: 2px;
}
#zotero-toolbar-save-button[cui-areatype="toolbar"] {
margin-left: -1px;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: 0 solid transparent;
}
#zotero-toolbar-save-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-button {
min-width: 27px;
padding-left: 1px;
padding-right: 1px;
}
/*
* Recreate standard hover effect (except in overflow list)
*/
#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button,
#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker {
border-width: 1px;
border-style: solid;
border-color: var(--toolbarbutton-hover-bordercolor) !important;
box-shadow: var(--toolbarbutton-hover-boxshadow) !important;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker::before {
background: none;
}
#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button {
border-right: 1px solid transparent;
}
#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker {
border-left: 1px solid transparent;
}
#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > .toolbarbutton-menubutton-dropmarker {
background: inherit;
}
#zotero-toolbar-save-button[cui-areatype="toolbar"]:not([overflowedItem=true]) > .toolbarbutton-menubutton-dropmarker:hover {
background: var(--toolbarbutton-hover-background);
}
#zotero-toolbar-main-button[cui-areatype="toolbar"] {
border-right: 1px solid transparent;
}
#zotero-toolbar-save-button[cui-areatype="toolbar"]:not([overflowedItem=true]):hover {
border-left: 0 solid transparent;
}
#zotero-toolbar-buttons[cui-areatype="toolbar"]:not([overflowedItem=true]):hover > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button {
border-left: 1px solid transparent;
}
/*
* Alterations for overflow menu
*/
#zotero-toolbar-buttons[overflowedItem=true] {
margin: 6px 4px 0;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button {
max-width: 16px;
}
/* End toolbar icons */
#zotero-splitter #zotero-splitter
{ {
border-top: none; border-top: none;
@ -474,11 +383,6 @@ treechildren::-moz-tree-image {
list-style-image: url('chrome://zotero/skin/mac/toolbar-note-add.png'); list-style-image: url('chrome://zotero/skin/mac/toolbar-note-add.png');
} }
#zotero-tb-actions-menu
{
list-style-image: url('chrome://zotero/skin/mac/cog.png');
}
#zotero-collectionmenu > .menuitem-iconic, #zotero-itemmenu > .menuitem-iconic, #zotero-collectionmenu > .menu-iconic, #zotero-itemmenu > .menu-iconic { #zotero-collectionmenu > .menuitem-iconic, #zotero-itemmenu > .menuitem-iconic, #zotero-collectionmenu > .menu-iconic, #zotero-itemmenu > .menu-iconic {
padding-top: 0px !important; padding-top: 0px !important;
padding-bottom: 2px !important; padding-bottom: 2px !important;

View file

@ -1,159 +1,3 @@
/*
As of Fx36, the built-in styles don't properly handle a menu-button within combined buttons.
On Windows and Linux, the padding and hover effect (border and shading) are applied directly to
the .toolbarbutton-icon (image) instead of the toolbarbutton, so proper sizing of the SVG depends
on the total width including border and padding.
*/
/*
* Nav bar
*/
toolbar[id="nav-bar"] #zotero-toolbar-main-button .toolbarbutton-icon {
width: 28px;
}
toolbar[id="nav-bar"] #zotero-toolbar-save-button .toolbarbutton-icon {
width: 30px;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons #zotero-toolbar-main-button {
margin-right: -1px;
padding: 0; /* avoid shift on :active */
}
toolbar[id="nav-bar"] #zotero-toolbar-main-button .toolbarbutton-icon {
margin-left: 2px;
padding-left: 5px !important;
padding-right: 5px !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-save-button > .toolbarbutton-menubutton-button {
padding-left: 0;
}
toolbar[id="nav-bar"] #zotero-toolbar-save-button > .toolbarbutton-menubutton-button .toolbarbutton-icon {
padding-left: 6px !important;
padding-right: 6px !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker {
width: 18px !important;
margin-top: 6px;
margin-bottom: 6px;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker .dropmarker-icon {
padding-left: 14px !important;
padding-right: 3px !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
margin-top: 3px;
margin-bottom: 3px;
padding-left: 8px !important;
padding-right: 8px !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon,
toolbar[id="nav-bar"] #zotero-toolbar-save-button[open] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
margin-top: 0;
margin-bottom: 0;
}
toolbar[id="nav-bar"] #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
margin-top: 3px;
margin-bottom: 3px;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons > separator {
/* Copied from .toolbarbutton-menubutton-dropmarker::before */
display: -moz-box;
width: 1px;
height: 18px;
-moz-margin-end: -1px;
background-clip: padding-box;
background-position: center;
background-repeat: no-repeat;
background-size: 1px 18px;
box-shadow: var(--toolbarbutton-combined-boxshadow);
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-main-button .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button .dropmarker-icon {
border-color: var(--toolbarbutton-hover-bordercolor) !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button:hover:not(:active) > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button:hover > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
background: inherit;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button > .toolbarbutton-menubutton-button:hover:not(:active) > .toolbarbutton-icon,
/* This selector doesn't work, so the dropmarker doesn't get a hover effect. :hover doesn't seem
to have an effect on either part of the dropmarker */
toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker:hover > .dropmarker-icon {
background: var(--toolbarbutton-hover-background) !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button:hover:active:not([open]):not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button:hover[open]:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon {
background: var(--toolbarbutton-active-background);
border-color: var(--toolbarbutton-active-bordercolor);
box-shadow: var(--toolbarbutton-active-boxshadow);
transition-duration: 10ms;
}
/*
* Alterations for non-nav-bar toolbars
*/
toolbar:not([id="nav-bar"]) #zotero-toolbar-main-button > .toolbarbutton-icon,
toolbar:not([id="nav-bar"]) #zotero-toolbar-main-button-single > .toolbarbutton-icon,
toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
height: 16px;
width: 16px;
padding: 0;
}
toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker,
toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-dropmarker {
margin-left: -1px;
}
toolbar:not([id="nav-bar"]) #zotero-toolbar-buttons separator {
display: none;
}
/* Alterations for overflow panel */
#zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-icon,
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-icon,
#zotero-toolbar-save-button-single[overflowedItem=true] .toolbarbutton-icon,
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon {
width: 16px;
}
#zotero-toolbar-buttons[overflowedItem=true] {
margin-left: 0 !important;
margin-bottom: 0 !important;
margin-right: 0 !important;
padding: 0 !important;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button {
max-width: 28px !important;
margin: 0 4px 0 0 !important;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-menubutton-button {
margin-left: 8px;
}
/* End toolbar buttons */
/* /*
Override selected, unfocused tree row highlight color, which is too similar to the alternating Override selected, unfocused tree row highlight color, which is too similar to the alternating
row color by default row color by default

View file

@ -13,183 +13,6 @@
border-bottom-color: var(--theme-border-color); border-bottom-color: var(--theme-border-color);
} }
/*
As of Fx36, the built-in styles don't properly handle a menu-button within combined buttons.
On Windows and Linux, the padding and hover effect (border and shading) are applied directly to
the .toolbarbutton-icon (image) instead of the toolbarbutton, so proper sizing of the SVG depends
on the total width including border and padding.
*/
/*
* Nav bar
*/
toolbar[id="nav-bar"] #zotero-toolbar-main-button .toolbarbutton-icon {
width: 30px; /* 16 + 1 + 1 + 6 + 6 */
padding-left: 6px !important;
padding-right: 6px !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-save-button .toolbarbutton-icon {
width: 29px; /* 16 + 6 + 6 + 1 */
padding-left: 6px !important;
padding-right: 6px !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-main-button-single .toolbarbutton-icon {
width: 32px;
}
toolbar[id="nav-bar"] #zotero-toolbar-save-button-single .toolbarbutton-icon {
width: 31px; /* Compensate for border on only one side */
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker .dropmarker-icon {
padding-left: 4px;
padding-right: 4px;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons > separator {
margin-top: 11px;
margin-bottom: 11px;
-moz-margin-start: -1px !important;
-moz-margin-end: -3px !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons > separator,
toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker::before {
width: 1px;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons > #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker::before {
-moz-margin-end: -1px;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > separator,
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button:not([disabled]) > .toolbarbutton-menubutton-dropmarker::before {
background-image: none;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-main-button .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button:not([disabled]) .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button:not([disabled]) .dropmarker-icon {
border-color: var(--toolbarbutton-hover-bordercolor) !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-main-button:not(:active) .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover:not([disabled]) > #zotero-toolbar-save-button:not(:active) .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover:not([disabled]) > #zotero-toolbar-save-button:not(:active) .dropmarker-icon {
background: var(--toolbarbutton-hover-background);
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button .dropmarker-icon {
box-shadow: none;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-main-button .toolbarbutton-icon {
border-top-right-radius: 0px !important;
border-bottom-right-radius: 0px !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-buttons:hover > #zotero-toolbar-save-button .toolbarbutton-icon {
border-top-left-radius: 0px !important;
border-bottom-left-radius: 0px !important;
}
/*
There are two hover effects: when the toolbaritem is hovered over, and when the button is hovered over.
This applies the latter (and may not be right on different versions of Windows).
*/
toolbar[id="nav-bar"] #zotero-toolbar-main-button:hover:not(:active):not([disabled]) > .toolbarbutton-icon,
/*
The dropmarker doesn't honor :hover, so instead of showing the hover effect for each segment individually, do the
menu-button parts together, which at least looks like a choice.
*/
toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover .toolbarbutton-menubutton-button .toolbarbutton-icon,
toolbar[id="nav-bar"] > #zotero-toolbar-save-button:hover:not(:active):not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon {
background-color: hsla(210,48%,96%,.75) !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-main-button:hover > .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover:not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon {
border-color: hsla(210,54%,20%,.3) hsla(210,54%,20%,.35) hsla(210,54%,20%,.4) !important;
box-shadow: 0 0 1px hsla(210,54%,20%,.03),
0 0 2px hsla(210,54%,20%,.1) !important;
}
toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover:active:not([open]):not([disabled]) .toolbarbutton-menubutton-button .toolbarbutton-icon,
toolbar[id="nav-bar"] #zotero-toolbar-save-button:hover[open]:not([disabled]) .toolbarbutton-menubutton-dropmarker .dropmarker-icon {
background: var(--toolbarbutton-active-background) !important;
border-color: var(--toolbarbutton-active-bordercolor) !important;
box-shadow: var(--toolbarbutton-active-boxshadow) !important;
transition-duration: 10ms;
}
#zotero-toolbar-save-button[cui-areatype="toolbar"] > menupopup,
#zotero-toolbar-save-button-single[cui-areatype="toolbar"] > menupopup {
margin-top: -7px;
}
/*
* Alterations for non-nav-bar toolbars
*/
toolbar:not([id="nav-bar"]) #zotero-toolbar-main-button > .toolbarbutton-icon,
toolbar:not([id="nav-bar"]) #zotero-toolbar-main-button-single > .toolbarbutton-icon,
toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
height: 16px;
width: 16px;
padding: 0;
}
toolbar:not([id="nav-bar"]) #zotero-toolbar-main-button-single,
toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-button,
toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-button {
width: 24px;
}
toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker,
toolbar:not([id="nav-bar"]) #zotero-toolbar-save-button-single > .toolbarbutton-menubutton-dropmarker {
padding-left: 2px;
padding-right: 3px;
}
toolbar:not([id="nav-bar"]) #zotero-toolbar-buttons separator {
display: none;
}
/*
* Alterations for overflow panel
*/
#zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-icon,
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-icon,
#zotero-toolbar-save-button-single[overflowedItem=true] .toolbarbutton-icon,
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon {
height: 16px;
}
#zotero-toolbar-buttons[overflowedItem=true] {
margin: 6px 0 0 0 !important;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button {
max-width: 18px;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button toolbarbutton {
margin-left: 0 !important;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button .toolbarbutton-icon {
margin-left: 8px;
padding-right: 0 !important;
}
/* End toolbar buttons */
@media (min-resolution: 1.25dppx) { @media (min-resolution: 1.25dppx) {
#zotero-toolbar .toolbarbutton-icon { #zotero-toolbar .toolbarbutton-icon {

File diff suppressed because it is too large Load diff

View file

@ -1,211 +0,0 @@
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2011 Center for History and New Media
George Mason University, Fairfax, Virginia, USA
http://zotero.org
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
*/
var Zotero_DownloadOverlay = new function() {
const PDF_MIME_TYPE = "application/pdf";
const ALLOW_LIST = [
"application/pdf",
"application/postscript",
"application/xhtml+xml",
"text/html",
"text/plain",
/^audio\//,
/^image\//,
/^video\//,
/^application\/vnd\.oasis\.opendocument\./,
/^application\/vnd\.ms-/,
/^application\/vnd\.openxmlformats-officedocument/,
/^application\/vnd\.lotus-/,
/^application\/vnd\.wolfram\./,
"application/vnd.wordperfect",
"application/wordperfect5.1",
"application/msword",
"application/x-latex"
];
/**
* Saves this item, if we are supposed to save it.
*
* @return {Boolean} True if an item was saved, false if we were not supposed to save
*/
this.handleSave = Zotero.Promise.coroutine(function* () {
if(!document.getElementById('zotero-radio').selected) return false;
var retrieveMetadata = document.getElementById('zotero-recognizePDF').selected;
var url = dialog.mLauncher.source.spec;
Zotero.debug("Zotero_DownloadOverlay: Downloading from "+url);
// set up progress window
var win = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator)
.getMostRecentWindow("navigator:browser");
var libraryID, collection;
try {
let itemGroup = win.ZoteroPane.getCollectionTreeRow();
if (itemGroup.filesEditable && !itemGroup.isPublications()) {
libraryID = win.ZoteroPane.getSelectedLibraryID();
collection = win.ZoteroPane.getSelectedCollection();
}
// TODO: Just show an error instead?
else {
Zotero.debug("Cannot save files to library " + itemGroup.ref.libraryID
+ " -- saving to My Library instead", 2);
libraryID = Zotero.Libraries.userLibraryID;
}
} catch(e) {
Zotero.debug(e, 1);
};
var recognizePDF = document.getElementById('zotero-recognizePDF').checked
&& !document.getElementById('zotero-recognizePDF').hidden
&& !document.getElementById('zotero-recognizePDF').disabled;
var contentType = dialog.mLauncher.MIMEInfo.MIMEType;
// mimic dialog cancellation
dialog.onCancel();
// show progress dialog
var progressWin = new Zotero.ProgressWindow();
progressWin.changeHeadline(Zotero.getString("save.link"));
progressWin.show();
// perform import
try {
var item = yield Zotero.Attachments.importFromURL({
libraryID,
url,
collections: collection ? [collection.id] : [],
contentType
});
}
catch (e) {
if (!win) return;
progressWin.addDescription(Zotero.getString("save.link.error"));
progressWin.startCloseTimer(8000);
Zotero.logError(e);
return false;
}
if(!win) return;
progressWin.addLines([item.getDisplayTitle()], [item.getImageSrc()]);
progressWin.startCloseTimer();
if (collection) {
yield collection.addItem(item.id);
}
yield win.ZoteroPane.selectItem(item.id);
if(recognizePDF) {
var timer = Components.classes["@mozilla.org/timer;1"]
.createInstance(Components.interfaces.nsITimer);
timer.init(function() {
try {
if (item && item.getFile()) {
timer.cancel();
Zotero.RecognizePDF.recognizeItems([item]);
}
} catch(e) { dump(e.toSource()) };
}, 1000, Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);
}
return true;
});
/**
* Called when mode in dialog has been changed
*/
this.modeChanged = function() {
var zoteroSelected = document.getElementById('zotero-radio').selected;
// don't allow user to remember Zotero option for file type; i'm not sure anyone wants this
// to happen automatically
if(zoteroSelected) document.getElementById('rememberChoice').selected = false;
document.getElementById('rememberChoice').disabled = zoteroSelected;
document.getElementById('zotero-recognizePDF').disabled = !zoteroSelected;
Zotero_DownloadOverlay.updateLibraryNote();
};
/**
* Determines whether the note stating that the item will be saved to "My Library" is shown
*/
this.updateLibraryNote = function() {
var zoteroSelected = document.getElementById('zotero-radio').selected;
var zp = Zotero.getActiveZoteroPane(), canSave = true;
try {
canSave = zp.getCollectionTreeRow().filesEditable;
} catch(e) {
Zotero.logError(e);
};
document.getElementById('zotero-saveToLibrary-description').hidden = !zoteroSelected || canSave;
window.sizeToContent();
}
/**
* Called when the save dialog is opened
*/
this.init = function() {
if(Zotero.isConnector) return;
// Disable for filetypes people probably don't want to save
var show = false;
var mimeType = dialog.mLauncher.MIMEInfo.MIMEType.toLowerCase();
for (let elem of ALLOW_LIST) {
if(typeof elem === "string") {
if(elem === mimeType) {
document.getElementById('zotero-container').hidden = false;
document.getElementById('zotero-radio').disabled = false;
break;
}
} else if(elem.test(mimeType)) {
document.getElementById('zotero-container').hidden = false;
document.getElementById('zotero-radio').disabled = false;
break;
}
}
// Hook in event listener to ondialogaccept
document.documentElement.setAttribute('ondialogaccept',
'Zotero_DownloadOverlay.handleSave().then(function (saved) { if (!saved) {'
+ document.documentElement.getAttribute('ondialogaccept')
+'}})');
// Hook in event listener for mode change
var radios = document.getElementById('mode').
addEventListener("command", Zotero_DownloadOverlay.modeChanged, false);
// Set label on retrieve PDF option
if(mimeType === PDF_MIME_TYPE) {
var recognizePDF = document.getElementById('zotero-recognizePDF');
recognizePDF.label = Zotero.getString("pane.items.menu.recognizePDF");
recognizePDF.hidden = false;
recognizePDF.disabled = true;
}
};
}
window.addEventListener("load", Zotero_DownloadOverlay.init, false);
window.addEventListener("activate", Zotero_DownloadOverlay.updateLibraryNote, false);

View file

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
***** BEGIN LICENSE BLOCK *****
Copyright © 2011 Center for History and New Media
George Mason University, Fairfax, Virginia, USA
http://zotero.org
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
Based on code derived from FlashGot - a Firefox extension for external
download managers integration.
Copyright (C) 2004-2011 Giorgio Maone - g.maone@informaction.com
***** END LICENSE BLOCK *****
-->
<!DOCTYPE overlay [
<!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd"> %zoteroDTD;
]>
<overlay id="zotero-download-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="include.js"/>
<script type="application/x-javascript" src="downloadOverlay.js"/>
<radiogroup id="mode">
<vbox id="zotero-container" flex="1" hidden="true">
<radio id="zotero-radio" label="&zotero.downloadManager.label;" disabled="true"/>
<vbox style="margin-left: 15px">
<description id="zotero-saveToLibrary-description" style="font: small-caption; font-weight: normal" hidden="true">&zotero.downloadManager.saveToLibrary.description;</description>
<checkbox id="zotero-recognizePDF" hidden="true" persist="checked" disabled="true"/>
</vbox>
</vbox>
</radiogroup>
</overlay>

View file

@ -1,314 +0,0 @@
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2015 Center for History and New Media
George Mason University, Fairfax, Virginia, USA
http://zotero.org
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
*/
"use strict";
Components.utils.import("resource://zotero/config.js");
Components.utils.import("resource:///modules/CustomizableUI.jsm");
var Zotero = Components.classes["@zotero.org/Zotero;1"]
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;
var comboButtonsID = 'zotero-toolbar-buttons';
addIcon();
function addIcon() {
// Don't try to add icons more than once, and avoid warnings in tests
if (Zotero.toolbarIconAdded || CustomizableUI.getPlacementOfWidget(comboButtonsID)) {
return;
}
CustomizableUI.addListener({
onWidgetAdded: function (id, area, position) {
if (id == comboButtonsID) {
// When dropping combo button into panel, add two independent buttons instead
if (area == CustomizableUI.AREA_PANEL) {
let mainID = getSingleID('main');
let saveID = getSingleID('save');
CustomizableUI.removeWidgetFromArea(id);
// Remove independent main and save buttons first if they're already in panel
CustomizableUI.removeWidgetFromArea(mainID);
CustomizableUI.removeWidgetFromArea(saveID);
CustomizableUI.addWidgetToArea(mainID, area, position);
let placement = CustomizableUI.getPlacementOfWidget(mainID)
let mainPos = placement.position;
CustomizableUI.addWidgetToArea(saveID, area, mainPos + 1);
return;
}
var isUpgrade = false;
try {
isUpgrade = Zotero.Prefs.get("firstRunGuidanceShown.saveIcon");
} catch(e) {}
var property = "firstRunGuidance.toolbarButton." + (isUpgrade ? "upgrade" : "new");
var shortcut = Zotero.getString(
Zotero.isMac ? "general.keys.cmdShift" : "general.keys.ctrlShift"
) + Zotero.Prefs.get("keys.openZotero");
let widget = CustomizableUI.getWidget(id);
for (let instance of widget.instances) {
let doc = instance.node.ownerDocument;
updateItemForArea(instance.node, area);
doc.getElementById("zotero-main-button-guidance").show({
text: Zotero.getString(property, shortcut)
});
doc.getElementById("zotero-save-button-guidance").show();
}
}
else if (id == getSingleID('save')) {
let widget = CustomizableUI.getWidget(id);
for (let instance of widget.instances) {
instance.node.ownerDocument.defaultView.Zotero_Browser.updateStatus();
}
}
},
onWidgetOverflow: function (node, container) {
if (node.id == comboButtonsID) {
node.classList.add("toolbarbutton-1");
}
},
onWidgetUnderflow: function (node, container) {
if (node.id == comboButtonsID) {
node.classList.remove("toolbarbutton-1");
}
},
// Save icon in panel isn't in DOM until menu is shown once and therefore isn't updated
// on page loads, so update the icon status when the panel is first shown so that it
// doesn't remain disabled
onAreaNodeRegistered: function (area, node) {
if (area == CustomizableUI.AREA_PANEL) {
var placement = CustomizableUI.getPlacementOfWidget(comboButtonsID)
var update = false;
let singleID = getSingleID('save');
if (placement && placement.area == CustomizableUI.AREA_PANEL) {
update = true;
}
else {
placement = CustomizableUI.getPlacementOfWidget(singleID);
if (placement && placement.area == CustomizableUI.AREA_PANEL) {
update = true;
}
}
if (update) {
let widget = CustomizableUI.getWidget(singleID);
for (let instance of widget.instances) {
instance.node.ownerDocument.defaultView.Zotero_Browser.updateStatus();
}
}
}
}
})
// Create the combo buttons, which go in the toolbar by default
CustomizableUI.createWidget({
id: comboButtonsID,
type: 'custom',
label: ZOTERO_CONFIG.CLIENT_NAME,
tooltiptext: ZOTERO_CONFIG.CLIENT_NAME,
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function (document) {
const kNSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var item = document.createElementNS(kNSXUL, "toolbaritem");
item.setAttribute("id", comboButtonsID);
item.setAttribute("label", "Zotero (Combo)"); // TODO: localize
// Set this as an attribute in addition to the property to make sure we can style correctly.
item.setAttribute("removable", "true");
item.classList.add("chromeclass-toolbar-additional");
['main', 'save'].map(button => {
return {
name: button,
id: getID(button),
tooltiptext: getTooltipText(button),
oncommand: getCommand(button)
};
}).forEach(function(attribs, index) {
if (index != 0) {
item.appendChild(document.createElementNS(kNSXUL, "separator"));
}
let button = document.createElementNS(kNSXUL, "toolbarbutton");
if (attribs.name == 'main') {
button.setAttribute('label', Zotero.clientName);
}
else if (attribs.name == 'save') {
button.setAttribute('label', Zotero.getString('ingester.saveToZotero'));
button.setAttribute('disabled', 'true');
button.setAttribute('type', 'menu-button');
let menupopup = document.createElementNS(kNSXUL, "menupopup");
menupopup.setAttribute('onpopupshowing', "Zotero_Browser.onStatusPopupShowing(event)");
button.appendChild(menupopup);
}
delete attribs.name;
setAttributes(button, attribs);
item.appendChild(button);
});
updateItemForArea(item, this.currentArea)
return item;
}
});
// Create the independent Z button, which isn't shown by default
CustomizableUI.createWidget({
id: getSingleID('main'),
label: Zotero.clientName,
tooltiptext: getTooltipText('main'),
defaultArea: false,
onCommand: function (event) {
event.target.ownerDocument.defaultView.ZoteroOverlay.toggleDisplay();
}
});
// Create the independent save button, which isn't shown by default
CustomizableUI.createWidget({
id: getSingleID('save'),
label: Zotero.getString('ingester.saveToZotero'),
tooltiptext: getTooltipText('save'),
defaultArea: false,
onCommand: function (event) {
event.target.ownerDocument.defaultView.Zotero_Browser.scrapeThisPage(null, event);
},
onCreated: function (button) {
const kNSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
button.setAttribute('disabled', 'true');
button.setAttribute('type', 'menu-button');
let menupopup = button.ownerDocument.createElementNS(kNSXUL, "menupopup");
menupopup.setAttribute('onpopupshowing', "Zotero_Browser.onStatusPopupShowing(event)");
button.appendChild(menupopup);
}
});
Zotero.toolbarIconAdded = true;
}
function getID(button) {
switch (button) {
case 'main':
return "zotero-toolbar-main-button";
case 'save':
return "zotero-toolbar-save-button";
}
}
function getSingleID(button) {
return getID(button) + '-single';
}
function getCommand(button) {
switch (button) {
case 'main':
return "ZoteroOverlay.toggleDisplay()";
case 'save':
return "Zotero_Browser.scrapeThisPage(null, event)";
}
}
function getTooltipText(button) {
var text;
switch (button) {
case 'main':
if (Zotero && Zotero.initialized) {
text = Zotero.clientName;
let key = Zotero.Keys.getKeyForCommand('openZotero');
if (key) {
// Add RLE mark in RTL mode to make shortcut render the right way
text += (Zotero.rtl ? ' \u202B' : ' ') + '('
+ (Zotero.isMac ? '⇧⌘' : Zotero.getString('general.keys.ctrlShift'))
+ key
+ ')';
}
}
else {
if (Zotero) {
text = Zotero.startupError;
}
// Use defaults if necessary
if (!text) {
let src = 'chrome://zotero/locale/zotero.properties';
let stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]
.getService(Components.interfaces.nsIStringBundleService);
let stringBundle = stringBundleService.createBundle(src);
text = stringBundle.GetStringFromName('startupError');
}
}
break;
case 'save':
text = Zotero.getString('ingester.saveToZotero');
break;
}
return text;
}
/**
* Set various attributes that allow treeitem and subelements to be styled properly
* in the different areas
*/
function updateItemForArea(item, area) {
if (area) {
var areaType = CustomizableUI.getAreaType(area);
var inPanel = area == CustomizableUI.AREA_PANEL;
var classes = inPanel ? "panel-combined-button" : "toolbarbutton-1 toolbarbutton-combined";
item.setAttribute("cui-areatype", areaType);
item.classList.add("toolbaritem-combined-buttons");
if (inPanel) {
item.classList.add("panel-wide-item");
}
var buttons = item.getElementsByTagName('toolbarbutton');
for (let i = 0; i < buttons.length; i++) {
let button = buttons[i];
button.setAttribute("class", classes);
button.setAttribute("cui-areatype", areaType);
}
}
// In customization palette pretend it's a single icon
else {
item.classList.remove("toolbaritem-combined-buttons");
item.classList.remove("panel-wide-item");
var buttons = item.getElementsByTagName('toolbarbutton');
for (let i = 0; i < buttons.length; i++) {
let button = buttons[i];
button.setAttribute("class", "toolbarbutton-1");
button.removeAttribute("cui-areatype");
}
}
}
function setAttributes(elem, attrs) {
for (let i in attrs) {
elem.setAttribute(i, attrs[i]);
}
}

View file

@ -31,7 +31,6 @@ var ZoteroOverlay = new function()
const DEFAULT_ZPANE_HEIGHT = 300; const DEFAULT_ZPANE_HEIGHT = 300;
var toolbarCollapseState; var toolbarCollapseState;
var zoteroPane, zoteroSplitter; var zoteroPane, zoteroSplitter;
var _stateBeforeReload = false;
this.isTab = false; this.isTab = false;
@ -44,8 +43,6 @@ var ZoteroOverlay = new function()
zoteroPane = document.getElementById('zotero-pane-stack'); zoteroPane = document.getElementById('zotero-pane-stack');
zoteroSplitter = document.getElementById('zotero-splitter'); zoteroSplitter = document.getElementById('zotero-splitter');
var iconLoaded = false;
if (!Zotero) { if (!Zotero) {
throw new Error("No Zotero object"); throw new Error("No Zotero object");
} }
@ -55,30 +52,9 @@ var ZoteroOverlay = new function()
ZoteroPane_Overlay = ZoteroPane; ZoteroPane_Overlay = ZoteroPane;
// Close pane before reload
ZoteroPane_Local.addBeforeReloadListener(function(newMode) {
if(newMode == "connector") {
// save current state
_stateBeforeReload = !zoteroPane.hidden && !zoteroPane.collapsed;
// ensure pane is closed
if(!zoteroPane.collapsed) ZoteroOverlay.toggleDisplay(false, true);
}
});
// Close pane if connector is enabled
ZoteroPane_Local.addReloadListener(function() {
if(!Zotero.isConnector) {
// reopen pane if it was open before
ZoteroOverlay.toggleDisplay(_stateBeforeReload, true);
}
});
// TODO: Add only when progress window is open // TODO: Add only when progress window is open
document.getElementById('appcontent').addEventListener('mousemove', Zotero.ProgressWindowSet.updateTimers, false); document.getElementById('appcontent').addEventListener('mousemove', Zotero.ProgressWindowSet.updateTimers, false);
// Hide browser chrome on Zotero tab
XULBrowserWindow.inContentWhitelist.push("chrome://zotero/content/tab.xul");
// Perform additional initialization for full mode // Perform additional initialization for full mode
if (!Zotero.isConnector) { if (!Zotero.isConnector) {
yield _onLoadFull(); yield _onLoadFull();
@ -86,17 +62,6 @@ var ZoteroOverlay = new function()
} }
catch (e) { catch (e) {
Zotero.debug(e, 1); Zotero.debug(e, 1);
// Add toolbar icon if still necessary
if (!iconLoaded) {
try {
Services.scriptloader.loadSubScript("chrome://zotero/content/icon.js", {}, "UTF-8");
}
catch (e) {
Zotero.logError(e);
}
}
throw e; throw e;
} }
}); });
@ -127,19 +92,10 @@ var ZoteroOverlay = new function()
.getBranch('extensions.zotero.'); .getBranch('extensions.zotero.');
prefBranch.clearUserPref('statusBarIcon'); prefBranch.clearUserPref('statusBarIcon');
// Add toolbar icon
try {
iconLoaded = true;
Services.scriptloader.loadSubScript("chrome://zotero/content/icon.js", {}, "UTF-8");
}
catch (e) {
Zotero.logError(e);
}
// Used for loading pages from upgrade wizard // Used for loading pages from upgrade wizard
if (Zotero.initialURL) { if (Zotero.initialURL) {
setTimeout(function () { setTimeout(function () {
gBrowser.selectedTab = gBrowser.addTab(Zotero.initialURL); Zotero.launchURL(ZOTERO_CONFIG.START_URL);
Zotero.initialURL = null; Zotero.initialURL = null;
}, 1); }, 1);
} }
@ -151,11 +107,6 @@ var ZoteroOverlay = new function()
ZoteroPane.destroy(); ZoteroPane.destroy();
} }
this.onBeforeUnload = function() {
// close Zotero as a tab, so it won't be pinned
var zoteroTab = ZoteroOverlay.findZoteroTab();
if(zoteroTab) gBrowser.removeTab(zoteroTab);
}
/** /**
* Hides/displays the Zotero interface * Hides/displays the Zotero interface
@ -176,18 +127,6 @@ var ZoteroOverlay = new function()
return; return;
} }
if(makeVisible || makeVisible === undefined) {
if(Zotero.isConnector) {
// If in connector mode, bring Zotero Standalone to foreground
Zotero.activateStandalone();
return;
} else if(this.isTab) {
// If in separate tab mode, just open the tab
this.loadZoteroTab();
return;
}
}
if(makeVisible === undefined) makeVisible = zoteroPane.hidden || zoteroPane.collapsed; if(makeVisible === undefined) makeVisible = zoteroPane.hidden || zoteroPane.collapsed;
/* /*
@ -256,4 +195,3 @@ window.addEventListener("load", function(e) {
} }
}, false); }, false);
window.addEventListener("unload", function(e) { ZoteroOverlay.onUnload(e); }, false); window.addEventListener("unload", function(e) { ZoteroOverlay.onUnload(e); }, false);
window.addEventListener("beforeunload", function(e) { ZoteroOverlay.onBeforeUnload(e); }, false);

View file

@ -38,8 +38,6 @@
<script src="overlay.js"/> <script src="overlay.js"/>
<popup id="contentAreaContextMenu"/>
<toolbar id="zotero-toolbar" nowindowdrag="true"/> <toolbar id="zotero-toolbar" nowindowdrag="true"/>
<vbox id="appcontent"> <vbox id="appcontent">
@ -48,44 +46,5 @@
onmouseup="ZoteroPane.updateTagSelectorSize()"/> onmouseup="ZoteroPane.updateTagSelectorSize()"/>
<stack id="zotero-pane-stack" persist="savedHeight" savedHeight="300" hidden="true"/> <stack id="zotero-pane-stack" persist="savedHeight" savedHeight="300" hidden="true"/>
<zoteroguidancepanel id="zotero-main-button-guidance" about="toolbarButton" for="zotero-toolbar-main-button"
position="bottomcenter topleft" delay="2000" foregroundonly="true" noautohide="true"
hideonpagechange="true" forward="zotero-save-button-guidance"/>
<zoteroguidancepanel id="zotero-save-button-guidance" about="saveButton" for="zotero-toolbar-save-button"
position="bottomcenter topleft" x="-8" delay="2000" foregroundonly="true" noautohide="true"
hideonpagechange="true"/>
<!-- Annotation Toolbar -->
<toolbar id="zotero-annotate-tb" crop="end" insertbefore="content" hidden="true">
<toolbarbutton id="zotero-annotate-tb-add" tooltiptext="&zotero.annotate.toolbar.add.label;" oncommand="Zotero_Browser.toggleMode(this.id);"/>
<toolbarbutton id="zotero-annotate-tb-collapse" tooltiptext="&zotero.annotate.toolbar.collapse.label;" oncommand="Zotero_Browser.toggleCollapsed();"/>
<toolbarseparator/>
<toolbarbutton id="zotero-annotate-tb-highlight" tooltiptext="&zotero.annotate.toolbar.highlight.label;" oncommand="Zotero_Browser.toggleMode(this.id);"/>
<toolbarbutton id="zotero-annotate-tb-unhighlight" tooltiptext="&zotero.annotate.toolbar.unhighlight.label;" oncommand="Zotero_Browser.toggleMode(this.id);"/>
</toolbar>
</vbox> </vbox>
<menupopup id="menu_ToolsPopup">
<menuseparator id="zoteroSeparator" insertbefore="devToolsSeparator"/>
<menuitem id="tools-zotero" insertbefore="devToolsSeparator"
oncommand="ZoteroOverlay.toggleDisplay();" label="Zotero"
key="key_openZotero"/>
</menupopup>
<keyset id="mainKeyset">
<!--
The key can be changed by the pref extensions.zotero.keys.openZotero,
but if the values are changed here, the pref won't override them.
-->
<key id="key_openZotero"
key="Z"
oncommand="ZoteroOverlay.toggleDisplay();"
modifiers="accel shift" />
<key id="key_saveToZotero"
key="S"
oncommand="Zotero_Browser.scrapeThisPage();"
modifiers="accel shift" />
</keyset>
</overlay> </overlay>

View file

@ -1,69 +0,0 @@
<?xml version="1.0"?>
<!--
***** BEGIN LICENSE BLOCK *****
Copyright © 20062013 Center for History and New Media
George Mason University, Fairfax, Virginia, USA
http://zotero.org
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
-->
<!DOCTYPE prefwindow SYSTEM "chrome://zotero/locale/preferences.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="zotero-prefpane-advanced">
<preferences id="zotero-prefpane-general-preferences">
<preference id="pref-zoteroDotOrgVersionHeader"
name="extensions.zotero.zoteroDotOrgVersionHeader"
type="bool"/>
</preferences>
<tabbox id="zotero-prefpane-advanced-tabs">
<tabpanels id="zotero-prefpane-advanced-tabpanels">
<tabpanel id="zotero-prefpane-advanced-general-tab">
<groupbox id="zotero-prefpane-advanced-miscellaneous">
<checkbox label="&zotero.preferences.zoteroDotOrgVersionHeader;"
tooltiptext="&zotero.preferences.zoteroDotOrgVersionHeader.tooltip;"
preference="pref-zoteroDotOrgVersionHeader"
insertbefore="zotero-prefpane-advanced-openbuttons"/>
<separator class="thin"
insertbefore="zotero-prefpane-advanced-openbuttons"/>
</groupbox>
</tabpanel>
<tabpanel id="zotero-prefpane-advanced-keys-tab">
<grid id="zotero-keys-grid">
<rows id="zotero-keys-rows">
<row insertbefore="zotero-keys-new-item">
<label value="&zotero.preferences.keys.openZotero;" control="key-textbox-openZotero"/>
<label class="modifier"/>
<textbox id="textbox-openZotero" maxlength="1" size="1" preference="pref-keys-openZotero"/>
</row>
<row insertbefore="zotero-keys-new-item">
<label value="&zotero.preferences.keys.saveToZotero;" control="key-textbox-saveToZotero"/>
<label class="modifier"/>
<textbox id="textbox-saveToZotero" maxlength="1" size="1" preference="pref-keys-saveToZotero"/>
</row>
</rows>
</grid>
</tabpanel>
</tabpanels>
</tabbox>
</prefpane>
</overlay>

View file

@ -1,47 +0,0 @@
<?xml version="1.0"?>
<!--
***** BEGIN LICENSE BLOCK *****
Copyright © 20062013 Center for History and New Media
George Mason University, Fairfax, Virginia, USA
http://zotero.org
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
-->
<!DOCTYPE prefwindow SYSTEM "chrome://zotero/locale/preferences.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="zotero-prefpane-general">
<preferences id="zotero-prefpane-general-preferences">
<preference id="pref-launchNonNativeFiles" name="extensions.zotero.launchNonNativeFiles" type="bool"/>
<preference id="pref-parseEndNoteMIMETypes"
name="extensions.zotero.parseEndNoteMIMETypes"
type="bool" onchange="Zotero.MIMETypeHandler.init()"/>
</preferences>
<groupbox id="zotero-prefpane-miscellaneous-groupbox">
<checkbox id="launchNonNativeFiles-checkbox"
preference="pref-launchNonNativeFiles"
onsyncfrompreference="return !document.getElementById(this.getAttribute('preference')).value"
onsynctopreference="return !this.checked"
insertbefore="automaticSnapshots-checkbox"/>
<checkbox label="&zotero.preferences.parseRISRefer;"
preference="pref-parseEndNoteMIMETypes"
insertbefore="automaticSnapshots-checkbox"/>
</groupbox>
</prefpane>
</overlay>

View file

@ -445,7 +445,6 @@ ZoteroStandalone.DebugOutput = {
}; };
/** Taken from browser.js **/
function toJavaScriptConsole() { function toJavaScriptConsole() {
toOpenWindowByType("global:console", "chrome://global/content/console.xul"); toOpenWindowByType("global:console", "chrome://global/content/console.xul");
} }

View file

@ -54,14 +54,7 @@ Zotero.MIMETypeHandler = new function () {
_ignoreContentDispositionTypes = []; _ignoreContentDispositionTypes = [];
_observers = []; _observers = [];
if(Zotero.Prefs.get("parseEndNoteMIMETypes")) { // Install styles from the Cite preferences
this.registerMetadataHandlers();
}
Zotero.Prefs.registerObserver("parseEndNoteMIMETypes", function(val) {
if (val) this.registerMetadataHandlers();
else this.unregisterMetadataHandlers();
}.bind(this));
this.addHandler("application/vnd.citationstyles.style+xml", Zotero.Promise.coroutine(function* (a1, a2) { this.addHandler("application/vnd.citationstyles.style+xml", Zotero.Promise.coroutine(function* (a1, a2) {
let win = Services.wm.getMostRecentWindow("zotero:basicViewer"); let win = Services.wm.getMostRecentWindow("zotero:basicViewer");
try { try {
@ -77,40 +70,6 @@ Zotero.MIMETypeHandler = new function () {
win.close(); win.close();
} }
})); }));
this.addHandler("text/x-csl", function(a1, a2) { Zotero.Styles.install(a1, a2) }); // deprecated
this.addHandler("application/x-zotero-schema", Zotero.Schema.importSchema);
this.addHandler("application/x-zotero-settings", Zotero.Prefs.importSettings);
}
// MIME types that Zotero should handle when parseEndNoteMIMETypes preference
// is enabled
var metadataMIMETypes = [
"application/x-endnote-refer", "application/x-research-info-systems",
"application/x-inst-for-scientific-info",
"text/x-bibtex", "application/x-bibtex",
// Non-standard
"text/x-research-info-systems",
"text/application/x-research-info-systems", // Nature serves this
"text/ris", // Cell serves this
"ris" // Not even trying
];
/**
* Registers MIME types for parseEndNoteMIMETypes preference
*/
this.registerMetadataHandlers = function() {
for (var i=0; i<metadataMIMETypes.length; i++) {
this.addHandler(metadataMIMETypes[i], _importHandler, true);
}
}
/**
* Unregisters MIME types for parseEndNoteMIMETypes preference
*/
this.unregisterMetadataHandlers = function() {
for (var i=0; i<metadataMIMETypes.length; i++) {
this.removeHandler(metadataMIMETypes[i]);
}
} }
/** /**
@ -146,67 +105,6 @@ Zotero.MIMETypeHandler = new function () {
} }
/**
* Handles Refer/RIS/ISI MIME types
* @param {String} string The Refer/RIS/ISI formatted records
* @param {String} uri The URI from which the Refer/RIS/ISI formatted records were downloaded
*/
function _importHandler(string, uri, contentType, channel) {
var win = channel.notificationCallbacks.getInterface(Components.interfaces.nsIDOMWindow).top;
if(!win) {
Zotero.debug("Attempt to import from a channel without an attached document refused");
return false;
}
var hostPort = channel.URI.hostPort.replace(";", "_", "g");
var allowedSitesString = Zotero.Prefs.get("ingester.allowedSites");
allowedSites = allowedSitesString.split(";");
if(allowedSites.indexOf(hostPort) === -1) {
var title = Zotero.getString("ingester.importReferRISDialog.title");
var text = Zotero.getString("ingester.importReferRISDialog.text", channel.URI.hostPort)+"\n\n";
var checkMsg = Zotero.getString("ingester.importReferRISDialog.checkMsg");
var checkValue = {"value":false};
// make tab-modal dialog (https://developer.mozilla.org/en/Using_tab-modal_prompts)
var prompt = Components.classes["@mozilla.org/prompter;1"]
.getService(Components.interfaces.nsIPromptFactory)
.getPrompt(win, Components.interfaces.nsIPrompt);
var bag = prompt.QueryInterface(Components.interfaces.nsIWritablePropertyBag2);
bag.setPropertyAsBool("allowTabModal", true);
var continueDownload = prompt.confirmCheck(title, text, checkMsg, checkValue);
if(!continueDownload) return false;
if(checkValue.value) {
// add to allowed sites if desired
Zotero.Prefs.set("ingester.allowedSites", allowedSitesString+";"+hostPort);
}
}
var frontWindow = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].
getService(Components.interfaces.nsIWindowWatcher).activeWindow;
// attempt to import through Zotero.Translate
var translation = new Zotero.Translate("import");
translation.setLocation(uri);
translation.setString(string);
// attempt to retrieve translators
return translation.getTranslators().then(function(translators) {
if(!translators.length) {
// we lied. we can't really translate this file.
Zotero.debug("No translator found to handle this file");
return false;
}
// translate using first available
translation.setTranslator(translators[0]);
return frontWindow.Zotero_Browser.performTranslation(translation);
});
}
/** /**
* Called to observe a page load * Called to observe a page load
*/ */

View file

@ -180,32 +180,6 @@ Zotero.Prefs = new function(){
} }
}; };
// Import settings bundles
this.importSettings = function (str, uri) {
var ps = Services.prompt;
if (!uri.match(/https:\/\/([^\.]+\.)?zotero.org\//)) {
Zotero.debug("Ignoring settings file not from https://zotero.org");
return;
}
str = Zotero.Utilities.trim(str.replace(/<\?xml.*\?>\s*/, ''));
Zotero.debug(str);
var confirm = ps.confirm(
null,
"",
"Apply settings from zotero.org?"
);
if (!confirm) {
return;
}
// TODO: parse settings XML
}
// Handlers for some Zotero preferences // Handlers for some Zotero preferences
var _handlers = [ var _handlers = [
[ "automaticScraperUpdates", function(val) { [ "automaticScraperUpdates", function(val) {
@ -229,14 +203,6 @@ Zotero.Prefs = new function(){
Zotero.Prefs.set('note.fontSize', 11); Zotero.Prefs.set('note.fontSize', 11);
} }
}], }],
[ "zoteroDotOrgVersionHeader", function(val) {
if (val) {
Zotero.VersionHeader.register();
}
else {
Zotero.VersionHeader.unregister();
}
}],
[ "sync.autoSync", function(val) { [ "sync.autoSync", function(val) {
if (val) { if (val) {
Zotero.Sync.EventListeners.AutoSyncListener.register(); Zotero.Sync.EventListeners.AutoSyncListener.register();

View file

@ -392,15 +392,8 @@ Zotero.Sync.Data.Local = {
} }
catch (e) { catch (e) {
Zotero.logError(e); Zotero.logError(e);
if (Zotero.isStandalone) {
var msg = Zotero.getString('sync.error.loginManagerCorrupted1', Zotero.appName) + "\n\n" var msg = Zotero.getString('sync.error.loginManagerCorrupted1', Zotero.appName) + "\n\n"
+ Zotero.getString('sync.error.loginManagerCorrupted2', [Zotero.appName, Zotero.appName]); + Zotero.getString('sync.error.loginManagerCorrupted2', [Zotero.appName, Zotero.appName]);
}
else {
var msg = Zotero.getString('sync.error.loginManagerInaccessible') + "\n\n"
+ Zotero.getString('sync.error.checkMasterPassword', Zotero.appName) + "\n\n"
+ Zotero.getString('sync.error.corruptedLoginManager', Zotero.appName);
}
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService); .getService(Components.interfaces.nsIPromptService);
ps.alert(null, Zotero.getString('general.error'), msg); ps.alert(null, Zotero.getString('general.error'), msg);

View file

@ -231,8 +231,6 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
// Make sure that Zotero Standalone is not running as root // Make sure that Zotero Standalone is not running as root
if(Zotero.isStandalone && !Zotero.isWin) _checkRoot(); if(Zotero.isStandalone && !Zotero.isWin) _checkRoot();
_addToolbarIcon();
try { try {
yield Zotero.DataDirectory.init(); yield Zotero.DataDirectory.init();
if (this.restarting) { if (this.restarting) {
@ -333,7 +331,6 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
} }
} }
if (!Zotero.isConnector) {
if (!this.forceDataDir) { if (!this.forceDataDir) {
yield Zotero.DataDirectory.checkForMigration( yield Zotero.DataDirectory.checkForMigration(
dataDir, Zotero.DataDirectory.defaultDir dataDir, Zotero.DataDirectory.defaultDir
@ -349,10 +346,7 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
} }
// Make sure data directory isn't in Dropbox, etc. // Make sure data directory isn't in Dropbox, etc.
if (Zotero.isStandalone) {
yield Zotero.DataDirectory.checkForUnsafeLocation(dataDir); yield Zotero.DataDirectory.checkForUnsafeLocation(dataDir);
}
}
// Register shutdown handler to call Zotero.shutdown() // Register shutdown handler to call Zotero.shutdown()
var _shutdownObserver = {observe:function() { Zotero.shutdown().done() }}; var _shutdownObserver = {observe:function() { Zotero.shutdown().done() }};
@ -386,23 +380,6 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
Services.console.unregisterListener(ConsoleListener); Services.console.unregisterListener(ConsoleListener);
}); });
// Load additional info for connector or not
if(Zotero.isConnector) {
Zotero.debug("Loading in connector mode");
Zotero.Connector_Types.init();
// Store a startupError until we get information from Zotero Standalone
Zotero.startupError = Zotero.getString("connector.loadInProgress")
if(!Zotero.isFirstLoadThisSession) {
// We want to get a checkInitComplete message before initializing if we switched to
// connector mode because Standalone was launched
Zotero.IPC.broadcast("checkInitComplete");
} else {
Zotero.initComplete();
}
} else {
Zotero.debug("Loading in full mode");
return _initFull() return _initFull()
.then(function (success) { .then(function (success) {
if (!success) { if (!success) {
@ -412,9 +389,6 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
if (Zotero.isStandalone) Zotero.Standalone.init(); if (Zotero.isStandalone) Zotero.Standalone.init();
Zotero.initComplete(); Zotero.initComplete();
}) })
}
return true;
}); });
/** /**
@ -452,22 +426,6 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
}; };
var _addToolbarIcon = function () {
if (Zotero.isStandalone) return;
// Add toolbar icon
try {
Services.scriptloader.loadSubScript("chrome://zotero/content/icon.js", {}, "UTF-8");
}
catch (e) {
if (Zotero) {
Zotero.debug(e, 1);
}
Components.utils.reportError(e);
}
};
/** /**
* Initialization function to be called only if Zotero is in full mode * Initialization function to be called only if Zotero is in full mode
* *
@ -1556,8 +1514,6 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
function _showWindowZoteroPaneOverlay(doc) { function _showWindowZoteroPaneOverlay(doc) {
doc.getElementById('zotero-collections-tree').disabled = true; doc.getElementById('zotero-collections-tree').disabled = true;
doc.getElementById('zotero-items-tree').disabled = true; doc.getElementById('zotero-items-tree').disabled = true;
doc.getElementById('zotero-pane-tab-catcher-top').hidden = false;
doc.getElementById('zotero-pane-tab-catcher-bottom').hidden = false;
doc.getElementById('zotero-pane-overlay').hidden = false; doc.getElementById('zotero-pane-overlay').hidden = false;
} }
@ -1565,8 +1521,6 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
function _hideWindowZoteroPaneOverlay(doc) { function _hideWindowZoteroPaneOverlay(doc) {
doc.getElementById('zotero-collections-tree').disabled = false; doc.getElementById('zotero-collections-tree').disabled = false;
doc.getElementById('zotero-items-tree').disabled = false; doc.getElementById('zotero-items-tree').disabled = false;
doc.getElementById('zotero-pane-tab-catcher-top').hidden = true;
doc.getElementById('zotero-pane-tab-catcher-bottom').hidden = true;
doc.getElementById('zotero-pane-overlay').hidden = true; doc.getElementById('zotero-pane-overlay').hidden = true;
// See note in showZoteroPaneProgressMeter() // See note in showZoteroPaneProgressMeter()
@ -1900,13 +1854,10 @@ Zotero.Keys = new function() {
*/ */
Zotero.VersionHeader = { Zotero.VersionHeader = {
init: function () { init: function () {
if (Zotero.Prefs.get("zoteroDotOrgVersionHeader")) {
this.register(); this.register();
}
Zotero.addShutdownListener(this.unregister); Zotero.addShutdownListener(this.unregister);
}, },
// Called from this.init() and Zotero.Prefs.observe()
register: function () { register: function () {
Services.obs.addObserver(this, "http-on-modify-request", false); Services.obs.addObserver(this, "http-on-modify-request", false);
}, },

View file

@ -52,7 +52,6 @@ var ZoteroPane = new function()
this.getSortDirection = getSortDirection; this.getSortDirection = getSortDirection;
this.setItemsPaneMessage = setItemsPaneMessage; this.setItemsPaneMessage = setItemsPaneMessage;
this.clearItemsPaneMessage = clearItemsPaneMessage; this.clearItemsPaneMessage = clearItemsPaneMessage;
this.contextPopupShowing = contextPopupShowing;
this.viewSelectedAttachment = viewSelectedAttachment; this.viewSelectedAttachment = viewSelectedAttachment;
this.reportErrors = reportErrors; this.reportErrors = reportErrors;
this.displayErrorMessage = displayErrorMessage; this.displayErrorMessage = displayErrorMessage;
@ -72,16 +71,6 @@ var ZoteroPane = new function()
this.init = function () { this.init = function () {
Zotero.debug("Initializing Zotero pane"); Zotero.debug("Initializing Zotero pane");
// For now, keep actions menu in the DOM and show it in Firefox for development
if (!Zotero.isStandalone) {
document.getElementById('zotero-tb-actions-menu-separator').hidden = false;
document.getElementById('zotero-tb-actions-menu').hidden = false;
}
// Set "Report Errors..." label via property rather than DTD entity,
// since we need to reference it in script elsewhere
document.getElementById('zotero-tb-actions-reportErrors').setAttribute('label',
Zotero.getString('errorReport.reportErrors'));
// Set key down handler // Set key down handler
document.getElementById('appcontent').addEventListener('keydown', ZoteroPane_Local.handleKeyDown, true); document.getElementById('appcontent').addEventListener('keydown', ZoteroPane_Local.handleKeyDown, true);
@ -110,7 +99,6 @@ var ZoteroPane = new function()
Zotero.updateQuickSearchBox(document); Zotero.updateQuickSearchBox(document);
if (Zotero.isMac) { if (Zotero.isMac) {
//document.getElementById('zotero-tb-actions-zeroconf-update').setAttribute('hidden', false);
document.getElementById('zotero-pane-stack').setAttribute('platform', 'mac'); document.getElementById('zotero-pane-stack').setAttribute('platform', 'mac');
} else if(Zotero.isWin) { } else if(Zotero.isWin) {
document.getElementById('zotero-pane-stack').setAttribute('platform', 'win'); document.getElementById('zotero-pane-stack').setAttribute('platform', 'win');
@ -122,22 +110,11 @@ var ZoteroPane = new function()
'sync.syncWith', ZOTERO_CONFIG.DOMAIN_NAME 'sync.syncWith', ZOTERO_CONFIG.DOMAIN_NAME
); );
if (Zotero.isStandalone) {
document.getElementById('zotero-tb-feed-add-fromPage').hidden = true;
document.getElementById('zotero-tb-feed-add-fromPage-menu').hidden = true;
}
// register an observer for Zotero reload // register an observer for Zotero reload
observerService = Components.classes["@mozilla.org/observer-service;1"] observerService = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService); .getService(Components.interfaces.nsIObserverService);
observerService.addObserver(_reloadObserver, "zotero-reloaded", false); observerService.addObserver(_reloadObserver, "zotero-reloaded", false);
observerService.addObserver(_reloadObserver, "zotero-before-reload", false); observerService.addObserver(_reloadObserver, "zotero-before-reload", false);
this.addBeforeReloadListener(function(newMode) {
if(newMode == "connector") {
ZoteroPane_Local.setItemsPaneMessage(Zotero.getString('connector.standaloneOpen'));
}
return;
});
this.addReloadListener(_loadPane); this.addReloadListener(_loadPane);
// continue loading pane // continue loading pane
@ -149,7 +126,7 @@ var ZoteroPane = new function()
* mode * mode
*/ */
function _loadPane() { function _loadPane() {
if(!Zotero || !Zotero.initialized || Zotero.isConnector) return; if (!Zotero || !Zotero.initialized) return;
// Set flags for hi-res displays // Set flags for hi-res displays
Zotero.hiDPI = window.devicePixelRatio > 1; Zotero.hiDPI = window.devicePixelRatio > 1;
@ -181,9 +158,6 @@ var ZoteroPane = new function()
itemsTree.addEventListener("mousedown", ZoteroPane_Local.onTreeMouseDown, true); itemsTree.addEventListener("mousedown", ZoteroPane_Local.onTreeMouseDown, true);
itemsTree.addEventListener("click", ZoteroPane_Local.onTreeClick, true); itemsTree.addEventListener("click", ZoteroPane_Local.onTreeClick, true);
var menu = document.getElementById("contentAreaContextMenu");
menu.addEventListener("popupshowing", ZoteroPane_Local.contextPopupShowing, false);
var tagSelector = document.getElementById('zotero-tag-selector'); var tagSelector = document.getElementById('zotero-tag-selector');
tagSelector.onchange = function () { tagSelector.onchange = function () {
return ZoteroPane_Local.updateTagFilter(); return ZoteroPane_Local.updateTagFilter();
@ -977,26 +951,6 @@ var ZoteroPane = new function()
} }
}); });
this.newFeedFromPage = Zotero.Promise.coroutine(function* (event) {
let data = {unsaved: true};
if (event) {
data.url = event.target.getAttribute('feed');
} else {
data.url = gBrowser.selectedBrowser.feeds[0].href;
}
window.openDialog('chrome://zotero/content/feedSettings.xul',
null, 'centerscreen, modal', data);
if (!data.cancelled) {
let feed = new Zotero.Feed();
feed.url = data.url;
feed.name = data.title;
feed.refreshInterval = data.ttl;
feed.cleanupReadAfter = data.cleanupReadAfter;
feed.cleanupUnreadAfter = data.cleanupUnreadAfter;
yield feed.saveTx();
yield feed.updateFeed();
}
});
this.newFeedFromURL = Zotero.Promise.coroutine(function* () { this.newFeedFromURL = Zotero.Promise.coroutine(function* () {
let data = {}; let data = {};
@ -1411,7 +1365,6 @@ var ZoteroPane = new function()
"cmd_zotero_newCollection", "cmd_zotero_newCollection",
"cmd_zotero_newSavedSearch", "cmd_zotero_newSavedSearch",
"zotero-tb-add", "zotero-tb-add",
"cmd_zotero_newItemFromCurrentPage",
"zotero-tb-lookup", "zotero-tb-lookup",
"cmd_zotero_newStandaloneNote", "cmd_zotero_newStandaloneNote",
"zotero-tb-note-add", "zotero-tb-note-add",
@ -1724,14 +1677,13 @@ var ZoteroPane = new function()
for (var i=0; i<popup.childNodes.length; i++) { for (var i=0; i<popup.childNodes.length; i++) {
var node = popup.childNodes[i]; var node = popup.childNodes[i];
var className = node.className.replace('standalone-no-display', '').trim(); var className = node.className;
switch (className) { switch (className) {
case prefix + 'link': case prefix + 'link':
node.disabled = collectionTreeRow.isWithinGroup(); node.disabled = collectionTreeRow.isWithinGroup();
break; break;
case prefix + 'snapshot':
case prefix + 'file': case prefix + 'file':
node.disabled = !canEditFiles; node.disabled = !canEditFiles;
break; break;
@ -1741,7 +1693,7 @@ var ZoteroPane = new function()
break; break;
default: default:
throw ("Invalid class name '" + className + "' in ZoteroPane_Local.updateAttachmentButtonMenu()"); throw new Error(`Invalid class name '${className}'`);
} }
} }
} }
@ -3359,7 +3311,6 @@ var ZoteroPane = new function()
return; return;
} }
if (Zotero.isStandalone) {
if(uri.match(/^https?/)) { if(uri.match(/^https?/)) {
this.launchURL(uri); this.launchURL(uri);
continue; continue;
@ -3378,35 +3329,6 @@ var ZoteroPane = new function()
} }
Zotero.openInViewer(uri); Zotero.openInViewer(uri);
return;
}
// Open in new tab
var openInNewTab = event && (event.metaKey || (!Zotero.isMac && event.ctrlKey));
if (event && event.shiftKey && !openInNewTab) {
window.open(uri, "zotero-loaded-page",
"menubar=yes,location=yes,toolbar=yes,personalbar=yes,resizable=yes,scrollbars=yes,status=yes");
}
else if (openInNewTab || !window.loadURI || uris.length > 1) {
// if no gBrowser, find it
if(!gBrowser) {
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
var gBrowser = browserWindow.gBrowser;
}
// load in a new tab
var tab = gBrowser.addTab(uri);
var browser = gBrowser.getBrowserForTab(tab);
if (event && event.shiftKey || !openInNewTab) {
// if shift key is down, or we are opening in a new tab because there is no loadURI,
// select new tab
gBrowser.selectedTab = tab;
}
}
else {
window.loadURI(uri);
}
} }
} }
@ -3470,74 +3392,6 @@ var ZoteroPane = new function()
} }
// Updates browser context menu options
function contextPopupShowing()
{
if (!Zotero.Prefs.get('browserContentContextMenu')) {
return;
}
var menuitem = document.getElementById("zotero-context-add-to-current-note");
if (menuitem){
var items = ZoteroPane_Local.getSelectedItems();
if (ZoteroPane_Local.itemsView.selection && ZoteroPane_Local.itemsView.selection.count==1
&& items[0] && items[0].isNote()
&& window.gContextMenu.isTextSelected)
{
menuitem.hidden = false;
}
else
{
menuitem.hidden = true;
}
}
var menuitem = document.getElementById("zotero-context-add-to-new-note");
if (menuitem){
if (window.gContextMenu.isTextSelected)
{
menuitem.hidden = false;
}
else
{
menuitem.hidden = true;
}
}
var menuitem = document.getElementById("zotero-context-save-link-as-item");
if (menuitem) {
if (window.gContextMenu.onLink) {
menuitem.hidden = false;
}
else {
menuitem.hidden = true;
}
}
var menuitem = document.getElementById("zotero-context-save-image-as-item");
if (menuitem) {
// Not using window.gContextMenu.hasBGImage -- if the user wants it,
// they can use the Firefox option to view and then import from there
if (window.gContextMenu.onImage) {
menuitem.hidden = false;
}
else {
menuitem.hidden = true;
}
}
// If Zotero is locked or library is read-only, disable menu items
var menu = document.getElementById('zotero-content-area-context-menu');
var disabled = Zotero.locked;
if (!disabled && self.collectionsView.selection && self.collectionsView.selection.count) {
var collectionTreeRow = self.collectionsView.selectedTreeRow;
disabled = !collectionTreeRow.editable;
}
for (let menuitem of menu.firstChild.childNodes) {
menuitem.disabled = disabled;
}
}
/** /**
* @return {Promise<Integer|null|false>} - The id of the new note in non-popup mode, null in * @return {Promise<Integer|null|false>} - The id of the new note in non-popup mode, null in
* popup mode (where a note isn't created immediately), or false if library isn't editable * popup mode (where a note isn't created immediately), or false if library isn't editable
@ -3603,6 +3457,7 @@ var ZoteroPane = new function()
} }
// TODO: Move to server_connector
this.addSelectedTextToCurrentNote = Zotero.Promise.coroutine(function* () { this.addSelectedTextToCurrentNote = Zotero.Promise.coroutine(function* () {
if (!this.canEdit()) { if (!this.canEdit()) {
this.displayCannotEditLibraryMessage(); this.displayCannotEditLibraryMessage();
@ -3642,17 +3497,6 @@ var ZoteroPane = new function()
}); });
this.createItemAndNoteFromSelectedText = Zotero.Promise.coroutine(function* (event) {
var str = event.currentTarget.ownerDocument.popupNode.ownerDocument.defaultView.getSelection().toString();
var uri = event.currentTarget.ownerDocument.popupNode.ownerDocument.location.href;
var item = yield ZoteroPane.addItemFromPage();
if (item) {
return ZoteroPane.newNote(false, item.key, str, uri)
}
});
this.openNoteWindow = function (itemID, col, parentKey) { this.openNoteWindow = function (itemID, col, parentKey) {
if (!this.canEdit()) { if (!this.canEdit()) {
this.displayCannotEditLibraryMessage(); this.displayCannotEditLibraryMessage();
@ -4153,42 +3997,6 @@ var ZoteroPane = new function()
}); });
/*
* Create an attachment from the current page
*
* |itemID| -- itemID of parent item
* |link| -- create web link instead of snapshot
*/
this.addAttachmentFromPage = Zotero.Promise.coroutine(function* (link, itemID) {
if (Zotero.DB.inTransaction()) {
yield Zotero.DB.waitForTransaction();
}
if (typeof itemID != 'number') {
throw new Error("itemID must be an integer");
}
var progressWin = new Zotero.ProgressWindow();
progressWin.changeHeadline(Zotero.getString('save.' + (link ? 'link' : 'attachment')));
var type = link ? 'web-link' : 'snapshot';
var icon = 'chrome://zotero/skin/treeitem-attachment-' + type + '.png';
progressWin.addLines(window.content.document.title, icon)
progressWin.show();
progressWin.startCloseTimer();
if (link) {
return Zotero.Attachments.linkFromDocument({
document: window.content.document,
parentItemID: itemID
});
}
return Zotero.Attachments.importFromDocument({
document: window.content.document,
parentItemID: itemID
});
});
this.viewItems = Zotero.Promise.coroutine(function* (items, event) { this.viewItems = Zotero.Promise.coroutine(function* (items, event) {
if (items.length > 1) { if (items.length > 1) {
if (!event || (!event.metaKey && !event.shiftKey)) { if (!event || (!event.metaKey && !event.shiftKey)) {
@ -4290,8 +4098,8 @@ var ZoteroPane = new function()
// TODO: update DB with new info if changed? // TODO: update DB with new info if changed?
var ext = Zotero.File.getExtension(file); var ext = Zotero.File.getExtension(file);
var externalViewer = Zotero.isStandalone || (!Zotero.MIME.hasNativeHandler(mimeType, ext) && var externalViewer = !Zotero.MIME.hasInternalHandler(mimeType, ext)
(!Zotero.MIME.hasInternalHandler(mimeType, ext) || Zotero.Prefs.get('launchNonNativeFiles'))); || Zotero.Prefs.get('launchNonNativeFiles');
} }
if (!externalViewer) { if (!externalViewer) {

View file

@ -43,7 +43,6 @@
<script src="reportInterface.js"/> <script src="reportInterface.js"/>
<script src="timelineInterface.js"/> <script src="timelineInterface.js"/>
<script src="recognizePDFDialog.js"/> <script src="recognizePDFDialog.js"/>
<script src="browser.js" type="application/javascript;version=1.8"/>
<script src="lookup.js"/> <script src="lookup.js"/>
<script src="locateMenu.js" type="application/javascript;version=1.8"/> <script src="locateMenu.js" type="application/javascript;version=1.8"/>
@ -66,38 +65,9 @@
<command id="cmd_zotero_newSavedSearch" oncommand="ZoteroPane_Local.newSearch()"/> <command id="cmd_zotero_newSavedSearch" oncommand="ZoteroPane_Local.newSearch()"/>
<command id="cmd_zotero_newStandaloneNote" oncommand="ZoteroPane_Local.newNote(event.shiftKey);"/> <command id="cmd_zotero_newStandaloneNote" oncommand="ZoteroPane_Local.newNote(event.shiftKey);"/>
<command id="cmd_zotero_newChildNote" oncommand="ZoteroPane_Local.newChildNote(event.shiftKey);"/> <command id="cmd_zotero_newChildNote" oncommand="ZoteroPane_Local.newChildNote(event.shiftKey);"/>
<!-- Keep in sync with browser.js::scrapeThisPage(), until that calls this directly -->
<command id="cmd_zotero_newItemFromCurrentPage" oncommand="ZoteroPane.addItemFromPage('temporaryPDFHack', event.shiftKey ? !Zotero.Prefs.get('automaticSnapshots') : null)"/>
</commandset> </commandset>
<popup id="contentAreaContextMenu">
<menu id="zotero-content-area-context-menu" label="Zotero">
<menupopup>
<menuitem id="zotero-context-item-from-page" class="menu-iconic"
label="&zotero.toolbar.newItemFromPage.label;"
command="cmd_zotero_newItemFromCurrentPage"/>
<menuitem id="zotero-context-add-to-current-note" class="menu-iconic"
label="&zotero.contextMenu.addTextToCurrentNote;" hidden="true"
oncommand="ZoteroPane.addSelectedTextToCurrentNote()"/>
<menuitem id="zotero-context-add-to-new-note" class="menu-iconic"
label="&zotero.contextMenu.addTextToNewNote;" hidden="true"
oncommand="ZoteroPane.createItemAndNoteFromSelectedText()"/>
<menuitem id="zotero-context-save-link-as-item" class="menu-iconic"
label="&zotero.contextMenu.saveLinkAsItem;" hidden="true"
oncommand="ZoteroPane.addItemFromURL(window.gContextMenu.linkURL, 'temporaryPDFHack')"/>
<menuitem id="zotero-context-save-image-as-item" class="menu-iconic"
label="&zotero.contextMenu.saveImageAsItem;" hidden="true"
oncommand="ZoteroPane.addItemFromURL(window.gContextMenu.onImage ? (window.gContextMenu.mediaURL ? window.gContextMenu.mediaURL : window.gContextMenu.imageURL) : window.gContextMenu.bgImageURL, 'artwork')"/>
</menupopup>
</menu>
</popup>
<stack id="zotero-pane-stack"> <stack id="zotero-pane-stack">
<!-- Barrier to prevent tabbing into Zotero pane when busy -->
<box id="zotero-pane-tab-catcher-top" hidden="true" align="center" pack="center" style="opacity: 0">
<checkbox/>
</box>
<vbox id="zotero-pane" <vbox id="zotero-pane"
onkeydown="ZoteroPane_Local.handleKeyDown(event, this.id)" onkeydown="ZoteroPane_Local.handleKeyDown(event, this.id)"
onkeyup="ZoteroPane_Local.handleKeyUp(event, this.id)" onkeyup="ZoteroPane_Local.handleKeyUp(event, this.id)"
@ -114,38 +84,12 @@
<menupopup> <menupopup>
<menuitem id="zotero-tb-feed-add-fromURL" label="&zotero.toolbar.feeds.new.fromURL;" <menuitem id="zotero-tb-feed-add-fromURL" label="&zotero.toolbar.feeds.new.fromURL;"
command="cmd_zotero_newFeed_fromURL"/> command="cmd_zotero_newFeed_fromURL"/>
<menuitem id="zotero-tb-feed-add-fromPage" label="&zotero.toolbar.feeds.new.fromPage;"
oncommand="ZoteroPane_Local.newFeedFromPage()" observes="singleFeedMenuitemState"/>
<menu id="zotero-tb-feed-add-fromPage-menu" label="&zotero.toolbar.feeds.new.fromPage;"
observes="multipleFeedsMenuState">
<menupopup oncommand="ZoteroPane_Local.newFeedFromPage(event)"
onpopupshowing="FeedHandler.buildFeedList(event.target)"/>
</menu>
<menuitem id="zotero-tb-feed-add-fromOPML" label="&zotero.toolbar.feeds.new.fromOPML;" <menuitem id="zotero-tb-feed-add-fromOPML" label="&zotero.toolbar.feeds.new.fromOPML;"
oncommand="ZoteroPane_Local.importFeedsFromOPML()"/> oncommand="ZoteroPane_Local.importFeedsFromOPML()"/>
</menupopup> </menupopup>
</menu> </menu>
</menupopup> </menupopup>
</toolbarbutton> </toolbarbutton>
<spacer id="zotero-tb-actions-menu-separator" flex="1" hidden="true"/>
<toolbarbutton id="zotero-tb-actions-menu" class="zotero-tb-button" tooltiptext="&zotero.toolbar.actions.label;" type="menu" hidden="true">
<menupopup id="zotero-tb-actions-popup">
<menuitem id="zotero-tb-actions-import" label="&zotero.toolbar.import.label;" command="cmd_zotero_import"/>
<menuitem id="zotero-tb-actions-import-clipboard" label="&zotero.toolbar.importFromClipboard;" command="cmd_zotero_importFromClipboard"/>
<menuitem id="zotero-tb-actions-export" label="&zotero.toolbar.export.label;" command="cmd_zotero_exportLibrary"/>
<menuitem id="zotero-tb-actions-rtfScan" label="&zotero.toolbar.rtfScan.label;" command="cmd_zotero_rtfScan"/>
<menuitem hidden="true" id="zotero-tb-actions-zeroconf-update"
label="Search for Shared Libraries" oncommand="Zotero.Zeroconf.findInstances()"/>
<menuseparator id="zotero-tb-actions-plugins-separator"/>
<menuitem id="zotero-tb-actions-timeline" label="&zotero.toolbar.timeline.label;" command="cmd_zotero_createTimeline"/>
<menuseparator id="zotero-tb-actions-separator"/>
<menuitem id="zotero-tb-actions-prefs" label="&zotero.toolbar.preferences.label;"
oncommand="ZoteroPane_Local.openPreferences()"/>
<menuitem id="zotero-tb-actions-reportErrors" command="cmd_zotero_reportErrors" disabled="true"/>
<menuitem id="zotero-tb-actions-support" label="&zotero.toolbar.supportAndDocumentation;" oncommand="ZoteroPane.loadURI('http://www.zotero.org/support/', {'metaKey':true, 'shiftKey':true})"/>
<menuitem id="zotero-tb-actions-about" label="&zotero.toolbar.about.label;" oncommand="ZoteroPane_Local.openAboutDialog()"/>
</menupopup>
</toolbarbutton>
</hbox> </hbox>
<hbox id="zotero-items-toolbar" align="center"> <hbox id="zotero-items-toolbar" align="center">
@ -197,8 +141,6 @@
</toolbarbutton> </toolbarbutton>
<toolbarbutton id="zotero-tb-attachment-add" class="zotero-tb-button" tooltiptext="&zotero.items.menu.attach;" type="menu"> <toolbarbutton id="zotero-tb-attachment-add" class="zotero-tb-button" tooltiptext="&zotero.items.menu.attach;" type="menu">
<menupopup onpopupshowing="ZoteroPane_Local.updateAttachmentButtonMenu(this)"> <menupopup onpopupshowing="ZoteroPane_Local.updateAttachmentButtonMenu(this)">
<menuitem class="menuitem-iconic zotero-menuitem-attachments-snapshot standalone-no-display" label="&zotero.items.menu.attach.snapshot;" oncommand="var itemID = ZoteroPane_Local.getSelectedItems()[0].id; ZoteroPane_Local.addAttachmentFromPage(false, itemID)"/>
<menuitem class="menuitem-iconic zotero-menuitem-attachments-web-link standalone-no-display" label="&zotero.items.menu.attach.link;" oncommand="var itemID = ZoteroPane_Local.getSelectedItems()[0].id; ZoteroPane_Local.addAttachmentFromPage(true, itemID)"/>
<menuitem class="menuitem-iconic zotero-menuitem-attachments-web-link" label="&zotero.items.menu.attach.link.uri;" oncommand="var itemID = ZoteroPane_Local.getSelectedItems()[0].id; ZoteroPane_Local.addAttachmentFromURI(true, itemID);"/> <menuitem class="menuitem-iconic zotero-menuitem-attachments-web-link" label="&zotero.items.menu.attach.link.uri;" oncommand="var itemID = ZoteroPane_Local.getSelectedItems()[0].id; ZoteroPane_Local.addAttachmentFromURI(true, itemID);"/>
<menuitem class="menuitem-iconic zotero-menuitem-attachments-file" label="&zotero.items.menu.attach.file;" oncommand="var itemID = ZoteroPane_Local.getSelectedItems()[0].id; ZoteroPane_Local.addAttachmentFromDialog(false, itemID);"/> <menuitem class="menuitem-iconic zotero-menuitem-attachments-file" label="&zotero.items.menu.attach.file;" oncommand="var itemID = ZoteroPane_Local.getSelectedItems()[0].id; ZoteroPane_Local.addAttachmentFromDialog(false, itemID);"/>
<menuitem class="menuitem-iconic zotero-menuitem-attachments-link" label="&zotero.items.menu.attach.fileLink;" oncommand="var itemID = ZoteroPane_Local.getSelectedItems()[0].id; ZoteroPane_Local.addAttachmentFromDialog(true, itemID);" id="zotero-tb-attachment-add-file-link"/> <menuitem class="menuitem-iconic zotero-menuitem-attachments-link" label="&zotero.items.menu.attach.fileLink;" oncommand="var itemID = ZoteroPane_Local.getSelectedItems()[0].id; ZoteroPane_Local.addAttachmentFromDialog(true, itemID);" id="zotero-tb-attachment-add-file-link"/>
@ -305,8 +247,6 @@
<menuitem class="menuitem-iconic zotero-menuitem-attach-note" label="&zotero.items.menu.attach.note;" oncommand="ZoteroPane_Local.newNote(false, this.parentNode.getAttribute('itemKey'))"/> <menuitem class="menuitem-iconic zotero-menuitem-attach-note" label="&zotero.items.menu.attach.note;" oncommand="ZoteroPane_Local.newNote(false, this.parentNode.getAttribute('itemKey'))"/>
<menu class="menu-iconic zotero-menuitem-attach" label="&zotero.items.menu.attach;"> <menu class="menu-iconic zotero-menuitem-attach" label="&zotero.items.menu.attach;">
<menupopup id="zotero-add-attachment-popup"> <menupopup id="zotero-add-attachment-popup">
<menuitem class="menuitem-iconic zotero-menuitem-attachments-snapshot standalone-no-display" label="&zotero.items.menu.attach.snapshot;" oncommand="var itemID = parseInt(this.parentNode.parentNode.parentNode.getAttribute('itemID')); ZoteroPane_Local.addAttachmentFromPage(false, itemID)"/>
<menuitem class="menuitem-iconic zotero-menuitem-attachments-web-link standalone-no-display" label="&zotero.items.menu.attach.link;" oncommand="var itemID = parseInt(this.parentNode.parentNode.parentNode.getAttribute('itemID')); ZoteroPane_Local.addAttachmentFromPage(true, itemID)"/>
<menuitem class="menuitem-iconic zotero-menuitem-attachments-web-link" label="&zotero.items.menu.attach.link.uri;" oncommand="var itemID = parseInt(this.parentNode.parentNode.parentNode.getAttribute('itemID')); ZoteroPane_Local.addAttachmentFromURI(true, itemID);"/> <menuitem class="menuitem-iconic zotero-menuitem-attachments-web-link" label="&zotero.items.menu.attach.link.uri;" oncommand="var itemID = parseInt(this.parentNode.parentNode.parentNode.getAttribute('itemID')); ZoteroPane_Local.addAttachmentFromURI(true, itemID);"/>
<menuitem class="menuitem-iconic zotero-menuitem-attachments-file" label="&zotero.items.menu.attach.file;" oncommand="var itemID = parseInt(this.parentNode.parentNode.parentNode.getAttribute('itemID')); ZoteroPane_Local.addAttachmentFromDialog(false, itemID);"/> <menuitem class="menuitem-iconic zotero-menuitem-attachments-file" label="&zotero.items.menu.attach.file;" oncommand="var itemID = parseInt(this.parentNode.parentNode.parentNode.getAttribute('itemID')); ZoteroPane_Local.addAttachmentFromDialog(false, itemID);"/>
<menuitem class="menuitem-iconic zotero-menuitem-attachments-link" label="&zotero.items.menu.attach.fileLink;" oncommand="var itemID = parseInt(this.parentNode.parentNode.parentNode.getAttribute('itemID')); ZoteroPane_Local.addAttachmentFromDialog(true, itemID);"/> <menuitem class="menuitem-iconic zotero-menuitem-attachments-link" label="&zotero.items.menu.attach.fileLink;" oncommand="var itemID = parseInt(this.parentNode.parentNode.parentNode.getAttribute('itemID')); ZoteroPane_Local.addAttachmentFromDialog(true, itemID);"/>

View file

@ -31,8 +31,6 @@
<!ENTITY zotero.preferences.autoUpdate "Automatically check for updated translators and styles"> <!ENTITY zotero.preferences.autoUpdate "Automatically check for updated translators and styles">
<!ENTITY zotero.preferences.updateNow "Update now"> <!ENTITY zotero.preferences.updateNow "Update now">
<!ENTITY zotero.preferences.reportTranslationFailure "Report broken site translators"> <!ENTITY zotero.preferences.reportTranslationFailure "Report broken site translators">
<!ENTITY zotero.preferences.zoteroDotOrgVersionHeader "Allow zotero.org to customize content based on current Zotero version">
<!ENTITY zotero.preferences.zoteroDotOrgVersionHeader.tooltip "If enabled, the current Zotero version will be included in HTTP requests to zotero.org.">
<!ENTITY zotero.preferences.parseRISRefer "Use Zotero for downloaded BibTeX/RIS/Refer files"> <!ENTITY zotero.preferences.parseRISRefer "Use Zotero for downloaded BibTeX/RIS/Refer files">
<!ENTITY zotero.preferences.automaticTags "Automatically tag items with keywords and subject headings"> <!ENTITY zotero.preferences.automaticTags "Automatically tag items with keywords and subject headings">
<!ENTITY zotero.preferences.trashAutoEmptyDaysPre "Automatically remove items in the trash deleted more than"> <!ENTITY zotero.preferences.trashAutoEmptyDaysPre "Automatically remove items in the trash deleted more than">

View file

@ -41,11 +41,6 @@
<!ENTITY zotero.upgrade.changeLogLink "the changelog"> <!ENTITY zotero.upgrade.changeLogLink "the changelog">
<!ENTITY zotero.upgrade.changeLogAfterLink "to find out what's new."> <!ENTITY zotero.upgrade.changeLogAfterLink "to find out what's new.">
<!ENTITY zotero.contextMenu.addTextToCurrentNote "Add Selection to Zotero Note">
<!ENTITY zotero.contextMenu.addTextToNewNote "Create Zotero Item and Note from Selection">
<!ENTITY zotero.contextMenu.saveLinkAsItem "Save Link As Zotero Item">
<!ENTITY zotero.contextMenu.saveImageAsItem "Save Image As Zotero Item">
<!ENTITY zotero.tabs.info.label "Info"> <!ENTITY zotero.tabs.info.label "Info">
<!ENTITY zotero.tabs.notes.label "Notes"> <!ENTITY zotero.tabs.notes.label "Notes">
<!ENTITY zotero.tabs.attachments.label "Attachments"> <!ENTITY zotero.tabs.attachments.label "Attachments">
@ -92,8 +87,6 @@
<!ENTITY zotero.items.menu.showInLibrary "Show in Library"> <!ENTITY zotero.items.menu.showInLibrary "Show in Library">
<!ENTITY zotero.items.menu.attach.note "Add Note"> <!ENTITY zotero.items.menu.attach.note "Add Note">
<!ENTITY zotero.items.menu.attach "Add Attachment"> <!ENTITY zotero.items.menu.attach "Add Attachment">
<!ENTITY zotero.items.menu.attach.snapshot "Attach Snapshot of Current Page">
<!ENTITY zotero.items.menu.attach.link "Attach Link to Current Page">
<!ENTITY zotero.items.menu.attach.link.uri "Attach Link to URI…"> <!ENTITY zotero.items.menu.attach.link.uri "Attach Link to URI…">
<!ENTITY zotero.items.menu.attach.file "Attach Stored Copy of File…"> <!ENTITY zotero.items.menu.attach.file "Attach Stored Copy of File…">
<!ENTITY zotero.items.menu.attach.fileLink "Attach Link to File…"> <!ENTITY zotero.items.menu.attach.fileLink "Attach Link to File…">
@ -109,7 +102,6 @@
<!ENTITY zotero.toolbar.newItem.label "New Item"> <!ENTITY zotero.toolbar.newItem.label "New Item">
<!ENTITY zotero.toolbar.moreItemTypes.label "More"> <!ENTITY zotero.toolbar.moreItemTypes.label "More">
<!ENTITY zotero.toolbar.newItemFromPage.label "Create Web Page Item from Current Page">
<!ENTITY zotero.toolbar.lookup.label "Add Item(s) by Identifier"> <!ENTITY zotero.toolbar.lookup.label "Add Item(s) by Identifier">
<!ENTITY zotero.toolbar.removeItem.label "Remove Item…"> <!ENTITY zotero.toolbar.removeItem.label "Remove Item…">
<!ENTITY zotero.toolbar.newLibrary.label "New Library"> <!ENTITY zotero.toolbar.newLibrary.label "New Library">
@ -135,7 +127,6 @@
<!ENTITY zotero.toolbar.feeds.new "New Feed"> <!ENTITY zotero.toolbar.feeds.new "New Feed">
<!ENTITY zotero.toolbar.feeds.new.fromURL "From URL…"> <!ENTITY zotero.toolbar.feeds.new.fromURL "From URL…">
<!ENTITY zotero.toolbar.feeds.new.fromPage "From Page…">
<!ENTITY zotero.toolbar.feeds.new.fromOPML "From OPML…"> <!ENTITY zotero.toolbar.feeds.new.fromOPML "From OPML…">
<!ENTITY zotero.toolbar.feeds.refresh "Refresh Feed"> <!ENTITY zotero.toolbar.feeds.refresh "Refresh Feed">
<!ENTITY zotero.toolbar.feeds.edit "Edit Feed…"> <!ENTITY zotero.toolbar.feeds.edit "Edit Feed…">
@ -325,9 +316,6 @@
<!ENTITY zotero.file.choose.label "Choose File…"> <!ENTITY zotero.file.choose.label "Choose File…">
<!ENTITY zotero.file.noneSelected.label "No file selected"> <!ENTITY zotero.file.noneSelected.label "No file selected">
<!ENTITY zotero.downloadManager.label "Save to Zotero">
<!ENTITY zotero.downloadManager.saveToLibrary.description "Attachments cannot be saved to the currently selected library. This item will be saved to your library instead.">
<!ENTITY zotero.attachLink.title "Attach Link to URI"> <!ENTITY zotero.attachLink.title "Attach Link to URI">
<!ENTITY zotero.attachLink.label.link "Link:"> <!ENTITY zotero.attachLink.label.link "Link:">
<!ENTITY zotero.attachLink.label.title "Title:"> <!ENTITY zotero.attachLink.label.title "Title:">

View file

@ -571,18 +571,11 @@ fileTypes.video = Video
fileTypes.presentation = Presentation fileTypes.presentation = Presentation
fileTypes.document = Document fileTypes.document = Document
save.attachment = Saving Snapshot…
save.link = Saving Link…
save.link.error = An error occurred while saving this link.
save.error.cannotMakeChangesToCollection = You cannot make changes to the currently selected collection. save.error.cannotMakeChangesToCollection = You cannot make changes to the currently selected collection.
save.error.cannotAddFilesToCollection = You cannot add files to the currently selected collection. save.error.cannotAddFilesToCollection = You cannot add files to the currently selected collection.
save.error.cannotAddToMyPublications = You cannot save items directly to My Publications. To add items, drag them from elsewhere in your library. save.error.cannotAddToMyPublications = You cannot save items directly to My Publications. To add items, drag them from elsewhere in your library.
save.error.cannotAddToFeed = You cannot save items to feeds. save.error.cannotAddToFeed = You cannot save items to feeds.
ingester.saveToZotero = Save to Zotero
ingester.saveToZoteroUsing = Save to Zotero using "%S"
ingester.saveToZoteroAsWebPageWithSnapshot = Save to Zotero as Web Page (with snapshot)
ingester.saveToZoteroAsWebPageWithoutSnapshot = Save to Zotero as Web Page (without snapshot)
ingester.scraping = Saving Item… ingester.scraping = Saving Item…
ingester.scrapingTo = Saving to ingester.scrapingTo = Saving to
ingester.scrapeComplete = Item Saved ingester.scrapeComplete = Item Saved
@ -591,10 +584,6 @@ ingester.scrapeErrorDescription = An error occurred while saving this item. Chec
ingester.scrapeErrorDescription.linkText = Troubleshooting Translator Issues ingester.scrapeErrorDescription.linkText = Troubleshooting Translator Issues
ingester.scrapeErrorDescription.previousError = The saving process failed due to a previous Zotero error. ingester.scrapeErrorDescription.previousError = The saving process failed due to a previous Zotero error.
ingester.importReferRISDialog.title = Zotero RIS/Refer Import
ingester.importReferRISDialog.text = Do you want to import items from "%1$S" into Zotero?\n\nYou can disable automatic RIS/Refer import in the Zotero preferences.
ingester.importReferRISDialog.checkMsg = Always allow for this site
ingester.importFile.title = Import File ingester.importFile.title = Import File
ingester.importFile.text = Do you want to import the file "%S"? ingester.importFile.text = Do you want to import the file "%S"?
ingester.importFile.intoNewCollection = Import into new collection ingester.importFile.intoNewCollection = Import into new collection
@ -919,9 +908,6 @@ sync.error.passwordNotSet = Password not set
sync.error.invalidLogin = Invalid username or password sync.error.invalidLogin = Invalid username or password
sync.error.invalidLogin.text = The Zotero sync server did not accept your username and password.\n\nPlease check that you have entered your zotero.org login information correctly in the Zotero sync preferences. sync.error.invalidLogin.text = The Zotero sync server did not accept your username and password.\n\nPlease check that you have entered your zotero.org login information correctly in the Zotero sync preferences.
sync.error.enterPassword = Please enter a password. sync.error.enterPassword = Please enter a password.
sync.error.loginManagerInaccessible = Zotero cannot access your login information.
sync.error.checkMasterPassword = If you are using a master password in %S, make sure you have entered it successfully.
sync.error.corruptedLoginManager = This could also be due to a corrupted %1$S logins database. To check, close %1$S, remove cert8.db, key3.db, and logins.json from your %1$S profile directory, and re-enter your Zotero login information in the Sync pane of the Zotero preferences.
sync.error.loginManagerCorrupted1 = Zotero cannot access your login information, possibly due to a corrupted %S logins database. sync.error.loginManagerCorrupted1 = Zotero cannot access your login information, possibly due to a corrupted %S logins database.
sync.error.loginManagerCorrupted2 = Close %1$S, remove cert8.db, key3.db, and logins.json from your %2$S profile directory, and re-enter your Zotero login information in the Sync pane of the Zotero preferences. sync.error.loginManagerCorrupted2 = Close %1$S, remove cert8.db, key3.db, and logins.json from your %2$S profile directory, and re-enter your Zotero login information in the Sync pane of the Zotero preferences.
sync.error.syncInProgress = A sync operation is already in progress. sync.error.syncInProgress = A sync operation is already in progress.
@ -1138,8 +1124,6 @@ standalone.updateMessage = A recommended update is available, but you do not h
connector.name = %S Connector connector.name = %S Connector
connector.error.title = Zotero Connector Error connector.error.title = Zotero Connector Error
connector.standaloneOpen = Your database cannot be accessed because Zotero Standalone is currently open. Please view your items in Zotero Standalone.
connector.loadInProgress = Zotero Standalone was launched but is not accessible. If you experienced an error opening Zotero Standalone, restart Firefox.
firstRunGuidance.authorMenu = Zotero lets you specify editors and translators, too. You can turn an author into an editor or translator by selecting from this menu. firstRunGuidance.authorMenu = Zotero lets you specify editors and translators, too. You can turn an author into an editor or translator by selecting from this menu.
firstRunGuidance.quickFormat = Type a title or author to search for a reference.\n\nAfter you've made your selection, click the bubble or press Ctrl-\u2193 to add page numbers, prefixes, or suffixes. You can also include a page number along with your search terms to add it directly.\n\nYou can edit citations directly in the word processor document. firstRunGuidance.quickFormat = Type a title or author to search for a reference.\n\nAfter you've made your selection, click the bubble or press Ctrl-\u2193 to add page numbers, prefixes, or suffixes. You can also include a page number along with your search terms to add it directly.\n\nYou can edit citations directly in the word processor document.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 788 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 976 B

View file

@ -383,11 +383,6 @@
} }
#zotero-tb-actions-menu
{
list-style-image: url('chrome://zotero/skin/cog.png');
}
#zotero-tb-add #zotero-tb-add
{ {
list-style-image: url('chrome://zotero/skin/toolbar-item-add.png'); list-style-image: url('chrome://zotero/skin/toolbar-item-add.png');
@ -513,11 +508,6 @@
list-style-image: url('chrome://zotero/skin/treeitem-attachment-link.png'); list-style-image: url('chrome://zotero/skin/treeitem-attachment-link.png');
} }
.zotero-menuitem-attachments-snapshot
{
list-style-image: url('chrome://zotero/skin/treeitem-attachment-snapshot.png');
}
.zotero-menuitem-attachments-web-link .zotero-menuitem-attachments-web-link
{ {
list-style-image: url('chrome://zotero/skin/treeitem-attachment-web-link.png'); list-style-image: url('chrome://zotero/skin/treeitem-attachment-web-link.png');
@ -719,41 +709,6 @@
background-image: none; background-image: none;
} }
#zotero-annotate-tb-add
{
list-style-image: url('chrome://zotero/skin/annotate-add.png');
}
#zotero-annotate-tb-collapse
{
list-style-image: url('chrome://zotero/skin/annotate-collapse.png');
}
#zotero-annotate-tb-highlight
{
list-style-image: url('chrome://zotero/skin/annotate-highlight.png');
}
#zotero-annotate-tb-unhighlight
{
list-style-image: url('chrome://zotero/skin/annotate-unhighlight.png');
}
#zotero-annotate-tb-add[tool-active=true]
{
list-style-image: url('chrome://zotero/skin/annotate-add-selected.png');
}
#zotero-annotate-tb-highlight[tool-active=true]
{
list-style-image: url('chrome://zotero/skin/annotate-highlight-selected.png');
}
#zotero-annotate-tb-unhighlight[tool-active=true]
{
list-style-image: url('chrome://zotero/skin/annotate-unhighlight-selected.png');
}
#zotero-toolbar #zotero-toolbar
{ {
visibility: visible !important; visibility: visible !important;
@ -783,7 +738,6 @@
#zotero-tb-collection-add { list-style-image: url('chrome://zotero/skin/toolbar-collection-add@2x.png'); } #zotero-tb-collection-add { list-style-image: url('chrome://zotero/skin/toolbar-collection-add@2x.png'); }
.zotero-menuitem-new-feed { list-style-image: url('chrome://zotero/skin/toolbar-feed-add@2x.png'); } .zotero-menuitem-new-feed { list-style-image: url('chrome://zotero/skin/toolbar-feed-add@2x.png'); }
#zotero-tb-library-add-menu { list-style-image: url('chrome://zotero/skin/library_add@2x.png'); } #zotero-tb-library-add-menu { list-style-image: url('chrome://zotero/skin/library_add@2x.png'); }
#zotero-tb-actions-menu { list-style-image: url('chrome://zotero/skin/cog@2x.png'); }
#zotero-tb-add { list-style-image: url('chrome://zotero/skin/toolbar-item-add@2x.png'); } #zotero-tb-add { list-style-image: url('chrome://zotero/skin/toolbar-item-add@2x.png'); }
#zotero-tb-lookup { list-style-image: url('chrome://zotero/skin/toolbar-lookup@2x.png'); } #zotero-tb-lookup { list-style-image: url('chrome://zotero/skin/toolbar-lookup@2x.png'); }
#zotero-tb-attachment-add { list-style-image: url('chrome://zotero/skin/attach@2x.png'); } #zotero-tb-attachment-add { list-style-image: url('chrome://zotero/skin/attach@2x.png'); }

View file

@ -21,123 +21,6 @@
padding:0; padding:0;
} }
/*
*
* Toolbar icons
*
*/
#zotero-toolbar-buttons[cui-areatype=toolbar] {
height: 24px;
}
#zotero-toolbar-main-button,
#zotero-toolbar-main-button-single {
list-style-image: url("chrome://zotero-platform/content/zotero-z-16px-australis.png");
}
@media (min-resolution: 1.25dppx) {
#zotero-toolbar-main-button,
#zotero-toolbar-main-button-single {
list-style-image: url("chrome://zotero-platform/content/zotero-z-32px-australis.png");
}
}
#zotero-toolbar-save-button,
#zotero-toolbar-save-button-single {
list-style-image: url("chrome://zotero/skin/treeitem-webpage.png");
}
#zotero-toolbar-main-button[cui-areatype="menu-panel"],
#zotero-toolbar-main-button-single[cui-areatype="menu-panel"],
toolbarpaletteitem[place="palette"] #zotero-toolbar-main-button,
toolbarpaletteitem[place="palette"] #zotero-toolbar-main-button-single {
list-style-image: url("chrome://zotero/skin/zotero-z-32px-australis.svg");
}
#zotero-toolbar-save-button[cui-areatype="menu-panel"],
#zotero-toolbar-save-button-single[cui-areatype="menu-panel"],
toolbarpaletteitem[place="palette"] #zotero-toolbar-save-button,
toolbarpaletteitem[place="palette"] #zotero-toolbar-save-button-single {
list-style-image: url("chrome://zotero/skin/treeitem-webpage@2x.png");
}
/* Show single icon for combo buttons in palette */
toolbarpaletteitem[place="palette"] #zotero-toolbar-buttons separator,
toolbarpaletteitem[place="palette"] #zotero-toolbar-buttons #zotero-toolbar-save-button {
display:none;
}
/* Alterations for overflow panel */
#zotero-toolbar-buttons[overflowedItem=true] {
padding: 0 6px;
height: 36px;
}
#zotero-toolbar-main-button-single[overflowedItem=true] .toolbarbutton-text,
#zotero-toolbar-save-button-single[overflowedItem=true] .toolbarbutton-text {
margin-left: 2px !important;
}
#zotero-toolbar-buttons[overflowedItem=true]:not(:hover) {
border: 1px solid transparent;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button {
min-width: unset;
margin-right: 8px;
padding: 0;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button .toolbarbutton-text {
display: none;
margin-left: 1px;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-main-button:hover {
background: unset;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button::before {
content: "";
display: -moz-box;
width: 1px;
height: 18px;
-moz-margin-end: 0px;
background-image: linear-gradient(hsla(210,54%,20%,.2) 0, hsla(210,54%,20%,.2) 18px);
background-clip: padding-box;
background-position: center;
background-repeat: no-repeat;
background-size: 1px 18px;
box-shadow: 0 0 0 1px hsla(0,0%,100%,.2);
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button {
max-width: unset;
margin: 0 0 0 -1px !important;
background: unset;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button toolbarbutton {
margin-left: 8px;
}
#zotero-toolbar-buttons[overflowedItem=true] #zotero-toolbar-save-button > .toolbarbutton-menubutton-dropmarker,
#zotero-toolbar-save-button-single[overflowedItem=true] > .toolbarbutton-menubutton-dropmarker {
padding-left: 3px;
padding-right: 6px;
}
/* Show webpage icon in gray when no translators */
#zotero-toolbar-save-button:not(.translate),
#zotero-toolbar-save-button-single:not(.translate),
#zotero-toolbar-save-button[disabled="true"],
#zotero-toolbar-save-button-single[disabled="true"] {
filter: grayscale(100%);
}
/* End toolbar icons */
/* Bindings */ /* Bindings */
textbox[multiline="true"][type="timed"] textbox[multiline="true"][type="timed"]
{ {
@ -470,7 +353,6 @@ label.zotero-text-link {
/* BEGIN 2X BLOCK -- DO NOT EDIT MANUALLY -- USE 2XIZE */ /* BEGIN 2X BLOCK -- DO NOT EDIT MANUALLY -- USE 2XIZE */
@media (min-resolution: 1.25dppx) { @media (min-resolution: 1.25dppx) {
#zotero-toolbar-save-button,#zotero-toolbar-save-button-single { list-style-image: url("chrome://zotero/skin/treeitem-webpage@2x.png"); }
.zotero-clicky-minus { background: url(chrome://zotero/skin/minus@2x.png) center/auto 18px no-repeat !important; } .zotero-clicky-minus { background: url(chrome://zotero/skin/minus@2x.png) center/auto 18px no-repeat !important; }
.zotero-clicky-plus { background: url(chrome://zotero/skin/plus@2x.png) center/auto 18px no-repeat !important; } .zotero-clicky-plus { background: url(chrome://zotero/skin/plus@2x.png) center/auto 18px no-repeat !important; }
.zotero-clicky-minus:not([disabled=true]):active { background-image: url('chrome://zotero/skin/minus-active@2x.png') !important; } .zotero-clicky-minus:not([disabled=true]):active { background-image: url('chrome://zotero/skin/minus-active@2x.png') !important; }

View file

@ -340,14 +340,6 @@ function ZoteroService() {
makeZoteroContext(false); makeZoteroContext(false);
zContext.Zotero.init(zInitOptions) zContext.Zotero.init(zInitOptions)
.catch(function (e) { .catch(function (e) {
if (e === "ZOTERO_SHOULD_START_AS_CONNECTOR") {
// if Zotero should start as a connector, reload it
return zContext.Zotero.shutdown()
.then(function() {
makeZoteroContext(true);
return zContext.Zotero.init(zInitOptions);
})
}
dump(e + "\n\n"); dump(e + "\n\n");
Components.utils.reportError(e); Components.utils.reportError(e);
if (!zContext.Zotero.startupError) { if (!zContext.Zotero.startupError) {

View file

@ -20,14 +20,11 @@ pref("extensions.zotero.debug.store.submitSize",10000000);
pref("extensions.zotero.debug.store.submitLineLength",10000); pref("extensions.zotero.debug.store.submitLineLength",10000);
pref("extensions.zotero.debug.level",5); pref("extensions.zotero.debug.level",5);
pref("extensions.zotero.automaticScraperUpdates",true); pref("extensions.zotero.automaticScraperUpdates",true);
pref("extensions.zotero.zoteroDotOrgVersionHeader", true);
pref("extensions.zotero.triggerProxyAuthentication", true); pref("extensions.zotero.triggerProxyAuthentication", true);
// Proxy auth URLs should respond successfully to HEAD requests over HTTP and HTTPS (in case of forced HTTPS requests) // Proxy auth URLs should respond successfully to HEAD requests over HTTP and HTTPS (in case of forced HTTPS requests)
pref("extensions.zotero.proxyAuthenticationURLs", "https://www.acm.org,https://www.ebscohost.com,https://www.sciencedirect.com,https://ieeexplore.ieee.org,https://www.jstor.org,http://www.ovid.com,https://link.springer.com,https://www.tandfonline.com"); pref("extensions.zotero.proxyAuthenticationURLs", "https://www.acm.org,https://www.ebscohost.com,https://www.sciencedirect.com,https://ieeexplore.ieee.org,https://www.jstor.org,http://www.ovid.com,https://link.springer.com,https://www.tandfonline.com");
pref("extensions.zotero.browserContentContextMenu", true);
pref("extensions.zotero.openURL.resolver","http://worldcatlibraries.org/registry/gateway"); pref("extensions.zotero.openURL.resolver","http://worldcatlibraries.org/registry/gateway");
pref("extensions.zotero.openURL.version","1.0"); pref("extensions.zotero.openURL.version","1.0");
pref("extensions.zotero.parseEndNoteMIMETypes",true);
pref("extensions.zotero.automaticSnapshots",true); pref("extensions.zotero.automaticSnapshots",true);
pref("extensions.zotero.downloadAssociatedFiles",true); pref("extensions.zotero.downloadAssociatedFiles",true);
pref("extensions.zotero.findPDFs.resolvers", '[]'); pref("extensions.zotero.findPDFs.resolvers", '[]');
@ -179,13 +176,6 @@ pref("extensions.zotero.purge.tags", false);
// Zotero pane persistent data // Zotero pane persistent data
pref("extensions.zotero.pane.persist", ""); pref("extensions.zotero.pane.persist", "");
// Domains allowed to import, separated by a semicolon
pref("extensions.zotero.ingester.allowedSites", "");
// Connector
pref("extensions.zotero.connector.repo.lastCheck.localTime", 0);
pref("extensions.zotero.connector.repo.lastCheck.repoTime", 0);
// Custom file handlers // Custom file handlers
pref("extensions.zotero.fileHandler.pdf", ""); pref("extensions.zotero.fileHandler.pdf", "");

View file

@ -577,8 +577,6 @@ var removeDir = Zotero.Promise.coroutine(function* (dir) {
* any that were set at startup * any that were set at startup
*/ */
async function resetDB(options = {}) { async function resetDB(options = {}) {
// Hack to avoid CustomizableUI warnings in console from icon.js
var toolbarIconAdded = Zotero.toolbarIconAdded;
resetPrefs(); resetPrefs();
if (options.thisArg) { if (options.thisArg) {
@ -593,7 +591,6 @@ async function resetDB(options = {}) {
false, false,
options options
); );
Zotero.toolbarIconAdded = toolbarIconAdded;
await Zotero.Schema.schemaUpdatePromise; await Zotero.Schema.schemaUpdatePromise;
initPDFToolsPath(); initPDFToolsPath();
} }

View file

@ -1,181 +0,0 @@
"use strict";
describe("Zotero_Browser", function () {
var win, collection;
before(function* () {
this.timeout(60000);
yield Zotero.Translators.init();
win = yield loadBrowserWindow();
collection = yield createDataObject('collection');
});
after(function* () {
win.close();
});
afterEach(function () {
Zotero.ProgressWindowSet.closeAll();
})
var waitForTranslateIcon = Zotero.Promise.coroutine(function* () {
var button = win.document.getElementById('zotero-toolbar-save-button');
if (button.classList.contains('translate')) {
return;
}
Zotero.debug("Waiting for translator icon");
do {
yield Zotero.Promise.delay(50);
}
while (!button.classList.contains('translate'));
});
it("should save webpage to current collection", function* () {
var uri = OS.Path.join(getTestDataDirectory().path, "snapshot", "index.html");
var deferred = Zotero.Promise.defer();
win.Zotero_Browser.addDetectCallback(() => deferred.resolve());
win.loadURI(uri);
yield deferred.promise;
yield loadZoteroPane(win);
var collection = yield createDataObject('collection');
var promise = waitForItemEvent('add');
yield win.Zotero_Browser.scrapeThisPage();
var ids = yield promise;
var items = Zotero.Items.get(ids);
assert.lengthOf(items, 1);
assert.equal(Zotero.ItemTypes.getName(items[0].itemTypeID), 'webpage');
assert.isTrue(collection.hasItem(items[0].id));
})
it("should save journal article to current collection", function* () {
var uri = OS.Path.join(
getTestDataDirectory().path, "metadata", "journalArticle-single.html"
);
var deferred = Zotero.Promise.defer();
win.Zotero_Browser.addDetectCallback(() => deferred.resolve());
win.loadURI(uri);
yield deferred.promise;
yield loadZoteroPane(win);
var collection = yield createDataObject('collection');
var promise = waitForItemEvent('add');
yield win.Zotero_Browser.scrapeThisPage();
var ids = yield promise;
var items = Zotero.Items.get(ids);
assert.lengthOf(items, 1);
assert.equal(Zotero.ItemTypes.getName(items[0].itemTypeID), 'journalArticle');
assert.isTrue(collection.hasItem(items[0].id));
})
it("should save book with child note to current collection", function* () {
var uri = OS.Path.join(
getTestDataDirectory().path, "book_and_child_note.ris"
);
var deferred = Zotero.Promise.defer();
win.Zotero_Browser.addDetectCallback(() => deferred.resolve());
win.loadURI(uri);
yield deferred.promise;
// Detection runs twice for local files, so wait for the icon to actually appear
yield waitForTranslateIcon();
yield loadZoteroPane(win);
var collection = yield createDataObject('collection');
var promise = waitForItemEvent('add');
yield win.Zotero_Browser.scrapeThisPage();
var ids = yield promise;
var items = Zotero.Items.get(ids);
assert.lengthOf(items, 2);
assert.equal(Zotero.ItemTypes.getName(items[0].itemTypeID), 'book');
assert.isTrue(collection.hasItem(items[0].id));
assert.equal(Zotero.ItemTypes.getName(items[1].itemTypeID), 'note');
});
it("should save PDF to library root", function* () {
var uri = OS.Path.join(getTestDataDirectory().path, "test.pdf");
var deferred = Zotero.Promise.defer();
win.Zotero_Browser.addDetectCallback(() => deferred.resolve());
win.loadURI(uri);
yield deferred.promise;
yield loadZoteroPane(win);
var promise = waitForItemEvent('add');
yield win.Zotero_Browser.scrapeThisPage();
var ids = yield promise;
var items = Zotero.Items.get(ids);
assert.lengthOf(items, 1);
assert.equal(Zotero.ItemTypes.getName(items[0].itemTypeID), 'attachment');
assert.equal(items[0].getField('title'), 'test.pdf');
assert.equal(items[0].attachmentContentType, 'application/pdf');
assert.equal(Zotero.Attachments.linkModeToName(items[0].attachmentLinkMode), 'imported_url');
});
it("should save PDF to current collection", function* () {
var uri = OS.Path.join(getTestDataDirectory().path, "test.pdf");
var deferred = Zotero.Promise.defer();
win.Zotero_Browser.addDetectCallback(() => deferred.resolve());
win.loadURI(uri);
yield deferred.promise;
yield loadZoteroPane(win);
var collection = yield createDataObject('collection');
var promise = waitForItemEvent('add');
yield win.Zotero_Browser.scrapeThisPage();
var ids = yield promise;
var items = Zotero.Items.get(ids);
assert.lengthOf(items, 1);
assert.equal(Zotero.ItemTypes.getName(items[0].itemTypeID), 'attachment');
assert.isTrue(collection.hasItem(items[0].id));
});
it("shouldn't save webpage to My Publications", function* () {
var uri = OS.Path.join(getTestDataDirectory().path, "snapshot", "index.html");
var deferred = Zotero.Promise.defer();
win.Zotero_Browser.addDetectCallback(() => deferred.resolve());
win.loadURI(uri);
yield deferred.promise;
yield loadZoteroPane(win);
yield win.ZoteroPane.collectionsView.selectByID("P" + Zotero.Libraries.userLibraryID);
var promise = waitForDialog(function (dialog) {
assert.include(
dialog.document.documentElement.textContent,
Zotero.getString('save.error.cannotAddToMyPublications')
);
});
yield win.Zotero_Browser.scrapeThisPage();
yield promise;
})
it("shouldn't save journal article to My Publications", function* () {
var uri = OS.Path.join(
getTestDataDirectory().path, "metadata", "journalArticle-single.html"
);
var deferred = Zotero.Promise.defer();
win.Zotero_Browser.addDetectCallback(() => deferred.resolve());
win.loadURI(uri);
yield deferred.promise;
yield loadZoteroPane(win);
yield win.ZoteroPane.collectionsView.selectByID("P" + Zotero.Libraries.userLibraryID);
var promise = waitForDialog(function (dialog) {
assert.include(
dialog.document.documentElement.textContent,
Zotero.getString('save.error.cannotAddToMyPublications')
);
}, false, 'chrome://zotero/content/progressWindow.xul');
yield win.Zotero_Browser.scrapeThisPage();
yield promise;
})
})

View file

@ -41,7 +41,7 @@ describe("Zotero.QuickCopy", function() {
}) })
it("should handle a chrome URL", function () { it("should handle a chrome URL", function () {
assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('chrome://zotero/content/tab.xul'), quickCopyPref); assert.deepEqual(Zotero.QuickCopy.getFormatFromURL('chrome://zotero/content/foo.xul'), quickCopyPref);
}) })
}) })