diff --git a/chrome/content/zotero/components/icons.jsx b/chrome/content/zotero/components/icons.jsx
index 2647ba4dd5..909cae95e2 100644
--- a/chrome/content/zotero/components/icons.jsx
+++ b/chrome/content/zotero/components/icons.jsx
@@ -26,7 +26,7 @@ function i(name, svgOrSrc) {
const { className } = this.props
if (typeof svgOrSrc == 'string') {
- if (window.devicePixelRatio >= 0.75) {
+ if (window.devicePixelRatio >= 1.25) {
let parts = svgOrSrc.split('.');
parts[parts.length-2] = parts[parts.length-2] + '@2x';
svgOrSrc = parts.join('.')
diff --git a/chrome/content/zotero/include.js b/chrome/content/zotero/include.js
index 45e4fd4973..fcb0858de6 100644
--- a/chrome/content/zotero/include.js
+++ b/chrome/content/zotero/include.js
@@ -7,4 +7,9 @@ var Zotero = Components.classes['@zotero.org/Zotero;1']
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;
-Components.utils.import('resource://zotero/require.js');
\ No newline at end of file
+// Components.utils.import('resource://zotero/require.js');
+// Not using Cu.import here since we don't want the require module to be cached
+// for includes within ZoteroPane or other code, where we want the window instance available to modules.
+Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
+ .getService(Components.interfaces.mozIJSSubScriptLoader)
+ .loadSubScript('resource://zotero/require.js');
diff --git a/chrome/content/zotero/standalone/standalone.xul b/chrome/content/zotero/standalone/standalone.xul
index ad04b99844..ff548bee21 100644
--- a/chrome/content/zotero/standalone/standalone.xul
+++ b/chrome/content/zotero/standalone/standalone.xul
@@ -46,7 +46,8 @@
windowtype="navigator:browser"
title="&brandShortName;"
width="1000" height="600"
- persist="screenX screenY width height sizemode">
+ persist="screenX screenY width height sizemode">
+
diff --git a/components/zotero-service.js b/components/zotero-service.js
index d30268ad90..39d0426052 100644
--- a/components/zotero-service.js
+++ b/components/zotero-service.js
@@ -152,7 +152,13 @@ var isFirstLoadThisSession = true;
var zContext = null;
var initCallbacks = [];
var zInitOptions = {};
-Components.utils.import('resource://zotero/require.js');
+
+// Components.utils.import('resource://zotero/require.js');
+// Not using Cu.import here since we don't want the require module to be cached
+// for includes within ZoteroPane or other code, where we want the window instance available to modules.
+Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
+ .getService(Components.interfaces.mozIJSSubScriptLoader)
+ .loadSubScript('resource://zotero/require.js');
ZoteroContext = function() {}
ZoteroContext.prototype = {
diff --git a/resource/concurrentCaller.js b/resource/concurrentCaller.js
index 87c3d12d1e..5500b8c6c4 100644
--- a/resource/concurrentCaller.js
+++ b/resource/concurrentCaller.js
@@ -26,7 +26,12 @@
EXPORTED_SYMBOLS = ["ConcurrentCaller"];
if (!(typeof process === 'object' && process + '' === '[object process]')) {
- Components.utils.import('resource://zotero/require.js');
+ // Components.utils.import('resource://zotero/require.js');
+ // Not using Cu.import here since we don't want the require module to be cached
+ // for includes within ZoteroPane or other code where we want the window instance available to modules.
+ Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
+ .getService(Components.interfaces.mozIJSSubScriptLoader)
+ .loadSubScript('resource://zotero/require.js');
var Promise = require('resource://zotero/bluebird.js');
} else {
Promise = require('bluebird');
diff --git a/resource/require.js b/resource/require.js
index d0c51069f4..103b16783d 100644
--- a/resource/require.js
+++ b/resource/require.js
@@ -1,63 +1,64 @@
'use strict';
-var Zotero;
-
-var EXPORTED_SYMBOLS = ['require'];
-
var require = (function() {
+ var win, Zotero;
var { Loader, Require, Module } = Components.utils.import('resource://gre/modules/commonjs/toolkit/loader.js');
var requirer = Module('/', '/');
var _runningTimers = {};
- var win = {};
+ if (typeof window != 'undefined') {
+ win = window;
+ } else {
+ win = {};
- win.setTimeout = function (func, ms) {
- var id = Math.floor(Math.random() * (1000000000000 - 1)) + 1
- var useMethodjit = Components.utils.methodjit;
- var timer = Components.classes["@mozilla.org/timer;1"]
- .createInstance(Components.interfaces.nsITimer);
- timer.initWithCallback({"notify":function() {
- // Remove timer from object so it can be garbage collected
- delete _runningTimers[id];
-
- // Execute callback function
- try {
- func();
- } catch(err) {
- // Rethrow errors that occur so that they appear in the error
- // console with the appropriate name and line numbers. While the
- // the errors appear without this, the line numbers get eaten.
- var scriptError = Components.classes["@mozilla.org/scripterror;1"]
- .createInstance(Components.interfaces.nsIScriptError);
- scriptError.init(
- err.message || err.toString(),
- err.fileName || err.filename || null,
- null,
- err.lineNumber || null,
- null,
- scriptError.errorFlag,
- 'component javascript'
- );
- Components.classes["@mozilla.org/consoleservice;1"]
- .getService(Components.interfaces.nsIConsoleService)
- .logMessage(scriptError);
- typeof Zotero !== 'undefined' && Zotero.debug(err.stack, 1);
+ win.setTimeout = function (func, ms) {
+ var id = Math.floor(Math.random() * (1000000000000 - 1)) + 1
+ var useMethodjit = Components.utils.methodjit;
+ var timer = Components.classes["@mozilla.org/timer;1"]
+ .createInstance(Components.interfaces.nsITimer);
+ timer.initWithCallback({"notify":function() {
+ // Remove timer from object so it can be garbage collected
+ delete _runningTimers[id];
+
+ // Execute callback function
+ try {
+ func();
+ } catch(err) {
+ // Rethrow errors that occur so that they appear in the error
+ // console with the appropriate name and line numbers. While the
+ // the errors appear without this, the line numbers get eaten.
+ var scriptError = Components.classes["@mozilla.org/scripterror;1"]
+ .createInstance(Components.interfaces.nsIScriptError);
+ scriptError.init(
+ err.message || err.toString(),
+ err.fileName || err.filename || null,
+ null,
+ err.lineNumber || null,
+ null,
+ scriptError.errorFlag,
+ 'component javascript'
+ );
+ Components.classes["@mozilla.org/consoleservice;1"]
+ .getService(Components.interfaces.nsIConsoleService)
+ .logMessage(scriptError);
+ typeof Zotero !== 'undefined' && Zotero.debug(err.stack, 1);
+ }
+ }}, ms, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
+ _runningTimers[id] = timer;
+ return id;
+ };
+
+ win.clearTimeout = function (id) {
+ var timer = _runningTimers[id];
+ if (timer) {
+ timer.cancel();
}
- }}, ms, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
- _runningTimers[id] = timer;
- return id;
- };
-
- win.clearTimeout = function (id) {
- var timer = _runningTimers[id];
- if (timer) {
- timer.cancel();
- }
- delete _runningTimers[id];
- };
+ delete _runningTimers[id];
+ };
- win.debug = function (msg) {
- dump(msg + "\n\n");
- };
+ win.debug = function (msg) {
+ dump(msg + "\n\n");
+ };
+ }
function getZotero() {
if (typeof Zotero === 'undefined') {
@@ -70,7 +71,7 @@ var require = (function() {
}
var cons;
- if (typeof console !== 'undefined') {
+ if (typeof win.console !== 'undefined') {
cons = console;
}
if (!cons) {
@@ -80,16 +81,14 @@ var require = (function() {
}
}
let globals = {
- document: typeof document !== 'undefined' && document || {},
+ window: win,
+ document: typeof win.document !== 'undefined' && win.document || {},
console: cons,
- navigator: typeof navigator !== 'undefined' && navigator || {},
+ navigator: typeof win.navigator !== 'undefined' && win.navigator || {},
setTimeout: win.setTimeout,
clearTimeout: win.clearTimeout,
};
Object.defineProperty(globals, 'Zotero', { get: getZotero });
- Object.defineProperty(globals, 'window', { get: function() {
- return typeof window != 'undefined' ? window : win;
- } });
var loader = Loader({
id: 'zotero/require',
paths: {
@@ -100,4 +99,4 @@ var require = (function() {
});
return Require(loader, requirer);
-})();
\ No newline at end of file
+})();
diff --git a/scss/components/_button.scss b/scss/components/_button.scss
index d12a11d7a4..ebd158a191 100644
--- a/scss/components/_button.scss
+++ b/scss/components/_button.scss
@@ -28,9 +28,10 @@
&:last-child {
margin-right: -5px;
}
- }
- svg, img {
- vertical-align: middle;
+ svg, img {
+ vertical-align: middle;
+ width: 16px;
+ }
}
span.menu-marker {
-moz-appearance: toolbarbutton-dropdown;