Use zotero/translate and zotero/utilities for shared code
This commit is contained in:
parent
c929055571
commit
7814efcfe2
19 changed files with 337 additions and 527 deletions
|
@ -38,26 +38,29 @@ const xpcomFilesAll = [
|
|||
'intl',
|
||||
'prefs',
|
||||
'dataDirectory',
|
||||
'date',
|
||||
'debug',
|
||||
'error',
|
||||
'utilities',
|
||||
'utilities/date',
|
||||
'utilities/utilities',
|
||||
'utilities/utilities_item',
|
||||
'utilities/openurl',
|
||||
'utilities/xregexp-all',
|
||||
'utilities/xregexp-unicode-zotero',
|
||||
'utilities_internal',
|
||||
'translate/src/utilities_translate',
|
||||
'file',
|
||||
'http',
|
||||
'mimeTypeHandler',
|
||||
'openurl',
|
||||
'pdfWorker/manager',
|
||||
'ipc',
|
||||
'profile',
|
||||
'progressWindow',
|
||||
'proxy',
|
||||
'translation/translate',
|
||||
'translate/src/translation/translate',
|
||||
'translate/src/translator',
|
||||
'translate/src/tlds',
|
||||
'translation/translate_firefox',
|
||||
'translation/translator',
|
||||
'translation/tlds',
|
||||
'isbn',
|
||||
'utilities_translate'
|
||||
];
|
||||
|
||||
/** XPCOM files to be loaded only for local translation and DB access **/
|
||||
|
@ -275,23 +278,11 @@ function makeZoteroContext(isConnector) {
|
|||
// 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
|
||||
'xregexp-all',
|
||||
'xregexp-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, 'utf-8');
|
||||
subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/utilities/" + xregexpFiles[i] + ".js", zContext, 'utf-8');
|
||||
}
|
||||
|
||||
// Load remaining xpcomFiles
|
||||
|
@ -324,14 +315,13 @@ function makeZoteroContext(isConnector) {
|
|||
'rdf/uri',
|
||||
'rdf/term',
|
||||
'rdf/identity',
|
||||
'rdf/match',
|
||||
'rdf/n3parser',
|
||||
'rdf/rdfparser',
|
||||
'rdf/serialize'
|
||||
];
|
||||
zContext.Zotero.RDF = {Zotero:zContext.Zotero};
|
||||
for (var i=0; i<rdfXpcomFiles.length; i++) {
|
||||
subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/" + rdfXpcomFiles[i] + ".js", zContext.Zotero.RDF, 'utf-8');
|
||||
subscriptLoader.loadSubScript("chrome://zotero/content/xpcom/translate/src/" + rdfXpcomFiles[i] + ".js", zContext.Zotero.RDF, 'utf-8');
|
||||
}
|
||||
|
||||
if(isStandalone()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue