Merge branch '3.0'
Conflicts: chrome/content/zotero/recognizePDF.js chrome/content/zotero/xpcom/utilities.js
This commit is contained in:
commit
dbf2bc265f
11 changed files with 2540 additions and 30 deletions
|
@ -197,23 +197,41 @@ function makeZoteroContext(isConnector) {
|
|||
zContext.Zotero = function() {};
|
||||
}
|
||||
|
||||
var subscriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader);
|
||||
|
||||
// Load zotero.js first
|
||||
Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader)
|
||||
.loadSubScript("chrome://zotero/content/xpcom/" + xpcomFilesAll[0] + ".js", zContext);
|
||||
subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/" + xpcomFilesAll[0] + ".js", zContext);
|
||||
|
||||
// Load CiteProc into Zotero.CiteProc namespace
|
||||
zContext.Zotero.CiteProc = {"Zotero":zContext.Zotero};
|
||||
Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader)
|
||||
.loadSubScript("chrome://zotero/content/xpcom/citeproc.js", zContext.Zotero.CiteProc);
|
||||
subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/citeproc.js", zContext.Zotero.CiteProc);
|
||||
|
||||
// Load XRegExp object into Zotero.XRegExp
|
||||
const xregexpFiles = [
|
||||
/**Core functions**/
|
||||
'xregexp',
|
||||
|
||||
/**Addons**/
|
||||
'addons/build', //adds ability to "build regular expressions using named subpatterns, for readability and pattern reuse"
|
||||
'addons/matchrecursive', //adds ability to "match recursive constructs using XRegExp pattern strings as left and right delimiters"
|
||||
|
||||
/**Unicode support**/
|
||||
'addons/unicode/unicode-base', //required for all other unicode packages. Adds \p{Letter} category
|
||||
|
||||
//'addons/unicode/unicode-blocks', //adds support for all Unicode blocks (e.g. InArabic, InCyrillic_Extended_A, etc.)
|
||||
'addons/unicode/unicode-categories', //adds support for all Unicode categories (e.g. Punctuation, Lowercase_Letter, etc.)
|
||||
//'addons/unicode/unicode-properties', //adds Level 1 Unicode properties (e.g. Uppercase, White_Space, etc.)
|
||||
//'addons/unicode/unicode-scripts' //adds support for all Unicode scripts (e.g. Gujarati, Cyrillic, etc.)
|
||||
'addons/unicode/unicode-zotero' //adds support for some Unicode categories used in Zotero
|
||||
];
|
||||
for (var i=0; i<xregexpFiles.length; i++) {
|
||||
subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/xregexp/" + xregexpFiles[i] + ".js", zContext);
|
||||
}
|
||||
|
||||
// Load remaining xpcomFiles
|
||||
for (var i=1; i<xpcomFilesAll.length; i++) {
|
||||
try {
|
||||
Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader)
|
||||
.loadSubScript("chrome://zotero/content/xpcom/" + xpcomFilesAll[i] + ".js", zContext);
|
||||
subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/" + xpcomFilesAll[i] + ".js", zContext);
|
||||
}
|
||||
catch (e) {
|
||||
Components.utils.reportError("Error loading " + xpcomFilesAll[i] + ".js", zContext);
|
||||
|
@ -224,9 +242,7 @@ function makeZoteroContext(isConnector) {
|
|||
// Load xpcomFiles for specific mode
|
||||
for each(var xpcomFile in (isConnector ? xpcomFilesConnector : xpcomFilesLocal)) {
|
||||
try {
|
||||
Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader)
|
||||
.loadSubScript("chrome://zotero/content/xpcom/" + xpcomFile + ".js", zContext);
|
||||
subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/" + xpcomFile + ".js", zContext);
|
||||
}
|
||||
catch (e) {
|
||||
Components.utils.reportError("Error loading " + xpcomFile + ".js", zContext);
|
||||
|
@ -247,22 +263,16 @@ function makeZoteroContext(isConnector) {
|
|||
];
|
||||
zContext.Zotero.RDF = {Zotero:zContext.Zotero};
|
||||
for (var i=0; i<rdfXpcomFiles.length; i++) {
|
||||
Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader)
|
||||
.loadSubScript("chrome://zotero/content/xpcom/" + rdfXpcomFiles[i] + ".js", zContext.Zotero.RDF);
|
||||
subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/" + rdfXpcomFiles[i] + ".js", zContext.Zotero.RDF);
|
||||
}
|
||||
|
||||
if(isStandalone()) {
|
||||
// If isStandalone, load standalone.js
|
||||
Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader)
|
||||
.loadSubScript("chrome://zotero/content/xpcom/standalone.js", zContext);
|
||||
subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/standalone.js", zContext);
|
||||
}
|
||||
|
||||
// load nsTransferable (query: do we still use this?)
|
||||
Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader)
|
||||
.loadSubScript("chrome://global/content/nsTransferable.js", zContext);
|
||||
subscriptLoader.loadSubScript("chrome://global/content/nsTransferable.js", zContext);
|
||||
|
||||
// add connector-related properties
|
||||
zContext.Zotero.isConnector = isConnector;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue