adding a compatibility.js as a single source to define all fallback function declarations
This commit is contained in:
parent
a03d70209f
commit
8877087b57
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
//https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind
|
||||||
|
if (!Function.prototype.bind) {
|
||||||
|
Function.prototype.bind = function (oThis) {
|
||||||
|
if (typeof this !== "function") {
|
||||||
|
// closest thing possible to the ECMAScript 5 internal IsCallable function
|
||||||
|
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
|
||||||
|
}
|
||||||
|
|
||||||
|
var aArgs = Array.prototype.slice.call(arguments, 1),
|
||||||
|
fToBind = this,
|
||||||
|
fNOP = function () {},
|
||||||
|
fBound = function () {
|
||||||
|
return fToBind.apply(this instanceof fNOP && oThis
|
||||||
|
? this
|
||||||
|
: oThis,
|
||||||
|
aArgs.concat(Array.prototype.slice.call(arguments)));
|
||||||
|
};
|
||||||
|
|
||||||
|
fNOP.prototype = this.prototype;
|
||||||
|
fBound.prototype = new fNOP();
|
||||||
|
|
||||||
|
return fBound;
|
||||||
|
};
|
||||||
|
}
|
|
@ -278,6 +278,7 @@ class OC {
|
||||||
OC_Util::addScript("jquery-showpassword");
|
OC_Util::addScript("jquery-showpassword");
|
||||||
OC_Util::addScript("jquery.infieldlabel");
|
OC_Util::addScript("jquery.infieldlabel");
|
||||||
OC_Util::addScript("jquery-tipsy");
|
OC_Util::addScript("jquery-tipsy");
|
||||||
|
OC_Util::addScript("compatibility");
|
||||||
OC_Util::addScript("oc-dialogs");
|
OC_Util::addScript("oc-dialogs");
|
||||||
OC_Util::addScript("js");
|
OC_Util::addScript("js");
|
||||||
OC_Util::addScript("eventsource");
|
OC_Util::addScript("eventsource");
|
||||||
|
|
Loading…
Reference in New Issue