You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
943 B
40 lines
943 B
/**
|
|
* fixed trim
|
|
* @param {type} undefined
|
|
* @returns {undefined}
|
|
*/
|
|
(function(undefined) {
|
|
if (String.prototype.trim === undefined) { // fix for iOS 3.2
|
|
String.prototype.trim = function() {
|
|
return this.replace(/^\s+|\s+$/g, '');
|
|
};
|
|
}
|
|
Object.setPrototypeOf = Object.setPrototypeOf || function(obj, proto) {
|
|
obj['__proto__'] = proto;
|
|
return obj;
|
|
};
|
|
|
|
})();
|
|
/**
|
|
* fixed CustomEvent
|
|
*/
|
|
(function() {
|
|
if (typeof window.CustomEvent === 'undefined') {
|
|
function CustomEvent(event, params) {
|
|
params = params || {
|
|
bubbles: false,
|
|
cancelable: false,
|
|
detail: undefined
|
|
};
|
|
var evt = document.createEvent('Events');
|
|
var bubbles = true;
|
|
for (var name in params) {
|
|
(name === 'bubbles') ? (bubbles = !!params[name]) : (evt[name] = params[name]);
|
|
}
|
|
evt.initEvent(event, bubbles, true);
|
|
return evt;
|
|
};
|
|
CustomEvent.prototype = window.Event.prototype;
|
|
window.CustomEvent = CustomEvent;
|
|
}
|
|
})(); |