Remove obsolete code for old Firefox versions
This commit is contained in:
parent
3bf82a4d4d
commit
6f6ce33377
|
@ -1071,9 +1071,6 @@
|
||||||
<body>
|
<body>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
var sbo = document.getAnonymousNodes(this)[0].boxObject;
|
var sbo = document.getAnonymousNodes(this)[0].boxObject;
|
||||||
if (Zotero.platformMajorVersion < 36) {
|
|
||||||
sbo.QueryInterface(Components.interfaces.nsIScrollBoxObject);
|
|
||||||
}
|
|
||||||
sbo.ensureElementIsVisible(elem);
|
sbo.ensureElementIsVisible(elem);
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1019,9 +1019,6 @@
|
||||||
<body>
|
<body>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
var sbo = document.getAnonymousNodes(this)[0].boxObject;
|
var sbo = document.getAnonymousNodes(this)[0].boxObject;
|
||||||
if (Zotero.platformMajorVersion < 36) {
|
|
||||||
sbo.QueryInterface(Components.interfaces.nsIScrollBoxObject);
|
|
||||||
}
|
|
||||||
sbo.ensureElementIsVisible(elem);
|
sbo.ensureElementIsVisible(elem);
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -268,18 +268,9 @@ var Zotero_Browser = new function() {
|
||||||
function(e) { Zotero_Browser.resize(e) }, false);
|
function(e) { Zotero_Browser.resize(e) }, false);
|
||||||
// Resize on text zoom changes
|
// Resize on text zoom changes
|
||||||
|
|
||||||
// Fx2
|
|
||||||
var reduce = document.getElementById('cmd_textZoomReduce');
|
|
||||||
if (reduce) {
|
|
||||||
var enlarge = document.getElementById('cmd_textZoomEnlarge');
|
|
||||||
var reset = document.getElementById('cmd_textZoomReset');
|
|
||||||
}
|
|
||||||
// Fx3
|
|
||||||
else {
|
|
||||||
var reduce = document.getElementById('cmd_fullZoomReduce');
|
var reduce = document.getElementById('cmd_fullZoomReduce');
|
||||||
var enlarge = document.getElementById('cmd_fullZoomEnlarge');
|
var enlarge = document.getElementById('cmd_fullZoomEnlarge');
|
||||||
var reset = document.getElementById('cmd_fullZoomReset');
|
var reset = document.getElementById('cmd_fullZoomReset');
|
||||||
}
|
|
||||||
|
|
||||||
if(reduce) reduce.addEventListener("command",
|
if(reduce) reduce.addEventListener("command",
|
||||||
function(e) { Zotero_Browser.resize(e) }, false);
|
function(e) { Zotero_Browser.resize(e) }, false);
|
||||||
|
|
|
@ -44,7 +44,6 @@ var Zotero_Charset_Menu = new function() {
|
||||||
|
|
||||||
var charsets = [];
|
var charsets = [];
|
||||||
|
|
||||||
if(Zotero.platformMajorVersion >= 32) {
|
|
||||||
Components.utils.import("resource://gre/modules/CharsetMenu.jsm");
|
Components.utils.import("resource://gre/modules/CharsetMenu.jsm");
|
||||||
var cmData = CharsetMenu.getData();
|
var cmData = CharsetMenu.getData();
|
||||||
for (let charsetList of [cmData.pinnedCharsets, cmData.otherCharsets]) {
|
for (let charsetList of [cmData.pinnedCharsets, cmData.otherCharsets]) {
|
||||||
|
@ -68,38 +67,6 @@ var Zotero_Charset_Menu = new function() {
|
||||||
{"label":"Western (IBM-850)", "value":"IBM850"},
|
{"label":"Western (IBM-850)", "value":"IBM850"},
|
||||||
{"label":"Western (MacRoman)", "value":"macintosh"}
|
{"label":"Western (MacRoman)", "value":"macintosh"}
|
||||||
]);
|
]);
|
||||||
} else {
|
|
||||||
var charsetConverter = Components.classes["@mozilla.org/charset-converter-manager;1"].
|
|
||||||
getService(Components.interfaces.nsICharsetConverterManager);
|
|
||||||
var ccCharsets = charsetConverter.getEncoderList();
|
|
||||||
// add charsets to popup in order
|
|
||||||
while(ccCharsets.hasMore()) {
|
|
||||||
var charset = ccCharsets.getNext();
|
|
||||||
try {
|
|
||||||
var label = charsetConverter.getCharsetTitle(charset);
|
|
||||||
} catch(e) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var isUTF16 = charset.length >= 6 && charset.substr(0, 6) == "UTF-16";
|
|
||||||
|
|
||||||
// Show UTF-16 element appropriately depending on exportMenu
|
|
||||||
if(isUTF16 && exportMenu == (charset == "UTF-16") ||
|
|
||||||
(!exportMenu && charset == "UTF-32LE")) {
|
|
||||||
continue;
|
|
||||||
} else if(charset == "x-mac-roman") {
|
|
||||||
// use the IANA name
|
|
||||||
charset = "macintosh";
|
|
||||||
} else if(!exportMenu && charset == "UTF-32BE") {
|
|
||||||
label = "Unicode (UTF-32)";
|
|
||||||
charset = "UTF-32";
|
|
||||||
}
|
|
||||||
charsets.push({
|
|
||||||
"label":label,
|
|
||||||
"value":charset
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for(var i=0; i<charsets.length; i++) {
|
for(var i=0; i<charsets.length; i++) {
|
||||||
var charset = charsets[i].value,
|
var charset = charsets[i].value,
|
||||||
|
|
|
@ -245,7 +245,7 @@ Zotero.OpenURL = new function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _cloneIfNecessary(obj1, obj2) {
|
function _cloneIfNecessary(obj1, obj2) {
|
||||||
if(Zotero.isFx && !Zotero.isBookmarklet && Zotero.platformMajorVersion >= 32) {
|
if (Zotero.isFx && !Zotero.isBookmarklet) {
|
||||||
return Components.utils.cloneInto(obj1, obj2);
|
return Components.utils.cloneInto(obj1, obj2);
|
||||||
}
|
}
|
||||||
return obj1;
|
return obj1;
|
||||||
|
|
|
@ -429,7 +429,7 @@ Zotero.Translate.Sandbox = {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if(Zotero.isFx && Zotero.platformMajorVersion >= 33) {
|
if (Zotero.isFx) {
|
||||||
for(var i in safeTranslator) {
|
for(var i in safeTranslator) {
|
||||||
if (typeof(safeTranslator[i]) === "function") {
|
if (typeof(safeTranslator[i]) === "function") {
|
||||||
safeTranslator[i] = translate._sandboxManager._makeContentForwarder(function(func) {
|
safeTranslator[i] = translate._sandboxManager._makeContentForwarder(function(func) {
|
||||||
|
|
|
@ -407,7 +407,6 @@ Zotero.Translate.SandboxManager = function(sandboxLocation) {
|
||||||
var expr = "(function(x) { return function() { this.args = arguments; return Function.prototype.apply.call(x, this); }.bind({}); })";
|
var expr = "(function(x) { return function() { this.args = arguments; return Function.prototype.apply.call(x, this); }.bind({}); })";
|
||||||
this._makeContentForwarder = Components.utils.evalInSandbox(expr, sandbox);
|
this._makeContentForwarder = Components.utils.evalInSandbox(expr, sandbox);
|
||||||
|
|
||||||
if (Zotero.platformMajorVersion >= 35) {
|
|
||||||
var _proxy = Components.utils.evalInSandbox('(function (target, x, overrides) {'+
|
var _proxy = Components.utils.evalInSandbox('(function (target, x, overrides) {'+
|
||||||
' return new Proxy(x, ProxyHandler(target, overrides));'+
|
' return new Proxy(x, ProxyHandler(target, overrides));'+
|
||||||
'})', sandbox);
|
'})', sandbox);
|
||||||
|
@ -454,9 +453,6 @@ Zotero.Translate.SandboxManager = function(sandboxLocation) {
|
||||||
};
|
};
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
this.wrap = Zotero.Translate.DOMWrapper.wrap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Zotero.Translate.SandboxManager.prototype = {
|
Zotero.Translate.SandboxManager.prototype = {
|
||||||
|
@ -490,7 +486,6 @@ Zotero.Translate.SandboxManager.prototype = {
|
||||||
var isObject = typeof object[localKey] === "object";
|
var isObject = typeof object[localKey] === "object";
|
||||||
if(isFunction || isObject) {
|
if(isFunction || isObject) {
|
||||||
if(isFunction) {
|
if(isFunction) {
|
||||||
if (Zotero.platformMajorVersion >= 33) {
|
|
||||||
attachTo[localKey] = this._makeContentForwarder(function() {
|
attachTo[localKey] = this._makeContentForwarder(function() {
|
||||||
var args = Array.prototype.slice.apply(this.args.wrappedJSObject || this.args);
|
var args = Array.prototype.slice.apply(this.args.wrappedJSObject || this.args);
|
||||||
for(var i = 0; i<args.length; i++) {
|
for(var i = 0; i<args.length; i++) {
|
||||||
|
@ -502,13 +497,6 @@ Zotero.Translate.SandboxManager.prototype = {
|
||||||
if(passAsFirstArgument) args.unshift(passAsFirstArgument);
|
if(passAsFirstArgument) args.unshift(passAsFirstArgument);
|
||||||
return me.copyObject(object[localKey].apply(object, args));
|
return me.copyObject(object[localKey].apply(object, args));
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
attachTo[localKey] = function() {
|
|
||||||
var args = Array.prototype.slice.apply(arguments);
|
|
||||||
if(passAsFirstArgument) args.unshift(passAsFirstArgument);
|
|
||||||
return me.copyObject(object[localKey].apply(object, args));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
attachTo[localKey] = new sandbox.Object();
|
attachTo[localKey] = new sandbox.Object();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1871,7 +1871,7 @@ Zotero.Utilities = {
|
||||||
item.setCreator(item.getCreators().length, creator);
|
item.setCreator(item.getCreators().length, creator);
|
||||||
} else {
|
} else {
|
||||||
creator.creatorType = Zotero.CreatorTypes.getName(creatorTypeID);
|
creator.creatorType = Zotero.CreatorTypes.getName(creatorTypeID);
|
||||||
if(Zotero.isFx && !Zotero.isBookmarklet && Zotero.platformMajorVersion >= 32) {
|
if (Zotero.isFx && !Zotero.isBookmarklet) {
|
||||||
creator = Components.utils.cloneInto(creator, item);
|
creator = Components.utils.cloneInto(creator, item);
|
||||||
}
|
}
|
||||||
item.creators.push(creator);
|
item.creators.push(creator);
|
||||||
|
|
|
@ -1618,15 +1618,6 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
|
||||||
.getService(Components.interfaces.nsILocaleService);
|
.getService(Components.interfaces.nsILocaleService);
|
||||||
var appLocale = localeService.getApplicationLocale();
|
var appLocale = localeService.getApplicationLocale();
|
||||||
|
|
||||||
// Use nsICollation before Fx30
|
|
||||||
if (Zotero.platformMajorVersion < 30) {
|
|
||||||
var localeService = Components.classes["@mozilla.org/intl/nslocaleservice;1"]
|
|
||||||
.getService(Components.interfaces.nsILocaleService);
|
|
||||||
var collationFactory = Components.classes["@mozilla.org/intl/collation-factory;1"]
|
|
||||||
.getService(Components.interfaces.nsICollationFactory);
|
|
||||||
return this.collation = collationFactory.CreateCollation(appLocale);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var locale = appLocale.getCategory('NSILOCALE_COLLATE');
|
var locale = appLocale.getCategory('NSILOCALE_COLLATE');
|
||||||
// Extract a valid language tag
|
// Extract a valid language tag
|
||||||
|
|
|
@ -505,12 +505,4 @@ ZoteroCommandLineHandler.prototype.__defineGetter__("Zotero", function() {
|
||||||
return zContext.Zotero;
|
return zContext.Zotero;
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* XPCOMUtils.generateNSGetFactory was introduced in Mozilla 2 (Firefox 4).
|
|
||||||
* XPCOMUtils.generateNSGetModule is for Mozilla 1.9.2 (Firefox 3.6).
|
|
||||||
*/
|
|
||||||
if (XPCOMUtils.generateNSGetFactory) {
|
|
||||||
var NSGetFactory = XPCOMUtils.generateNSGetFactory([ZoteroService, ZoteroCommandLineHandler]);
|
var NSGetFactory = XPCOMUtils.generateNSGetFactory([ZoteroService, ZoteroCommandLineHandler]);
|
||||||
} else {
|
|
||||||
var NSGetModule = XPCOMUtils.generateNSGetModule([ZoteroService, ZoteroCommandLineHandler]);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user