Reset, reset

This commit is contained in:
2018-04-28 17:13:56 +10:00
parent 63d1e21b9a
commit 5eb4d7ee4f
124 changed files with 0 additions and 5899 deletions

View File

@ -1,32 +0,0 @@
HTMLElement.prototype.removeClass || (HTMLElement.prototype.removeClass = function(remove) {
var newClassName = "";
var i;
var classes = this.className.split(" ");
for(i = 0; i < classes.length; i++) {
if(classes[i] !== remove) {
newClassName += classes[i] + " ";
}
}
this.className = newClassName;
});
HTMLElement.prototype.hasClass || (HTMLElement.prototype.hasClass = function(cls) {
return (' ' + this.className + ' ').indexOf(' ' + cls + ' ') > -1;
});
HTMLElement.prototype.addClass || (HTMLElement.prototype.addClass = function(add) {
if(this.hasClass(add)) return;
this.className += ' ' + add;
});
HTMLElement.prototype.toggleClass || (HTMLElement.prototype.toggleClass = function(clazz) {
if(this.hasClass(clazz)) {
this.removeClass(clazz);
} else {
this.addClass(clazz);
}
});
HTMLElement.prototype.remove || (HTMLElement.prototype.remove = function() {
this.parentElement.removeChild(this);
});

View File

@ -1,37 +0,0 @@
'use strict';
Object.isUndefined = Object.isUndefined || function(v) {
return typeof v === typeof undefined;
}
Object.isDefined = Object.isDefined || function(v) {
return !Object.isUndefined(v);
}
Object.isBoolean = Object.isBoolean || function(v) {
return Object.isDefined(v) && typeof v === 'boolean';
}
Object.merge = Object.merge || function(left_most, right_most) {
let d = {};
var left_keys = Object.keys(left_most);
for(var i = 0 ; i < left_keys.length; i++) {
var k = left_keys[i];
if(typeof right_most[k] !== typeof undefined) continue;
d[k] = left_most[k];
}
var right_keys = Object.keys(right_most);
for(var i = 0; i < right_keys.length; i++) {
var k = right_keys[i];
d[k] = right_most[k];
}
return d;
}
Object.extendClass = Object.extendClass || function(super_class,new_methods) {
return Object.assign(Object.assign({}, super_class), new_methods);
}
module.exports = Object;