remove mootools components

This commit is contained in:
Ezequiel Bergamaschi 2014-12-26 18:09:30 -03:00
parent 3ee4bdd019
commit 8c807398a4
4 changed files with 10 additions and 130 deletions

View File

@ -458,7 +458,7 @@ mindplot.Topic = new Class({
setText:function (text) { setText:function (text) {
// Avoid empty nodes ... // Avoid empty nodes ...
if (!text || text.trim().length == 0) { if (!text || $.trim(text).length == 0) {
text = null; text = null;
} }

View File

@ -44,22 +44,6 @@
} }
return typeof i; return typeof i;
}; };
var j = this.instanceOf = function (t, i) {
if (t == null) {
return false;
}
var s = t.$constructor || t.constructor;
while (s) {
if (s === i) {
return true;
}
s = s.parent;
}
if (!t.hasOwnProperty) {
return false;
}
return t instanceof i;
};
var f = this.Function; var f = this.Function;
var p = true; var p = true;
for (var k in {toString: 1}) { for (var k in {toString: 1}) {
@ -92,32 +76,6 @@
return this; return this;
}; };
}; };
f.prototype.overloadGetter = function (s) {
var i = this;
return function (u) {
var v, t;
if (typeof u != "string") {
v = u;
} else {
if (arguments.length > 1) {
v = arguments;
} else {
if (s) {
v = [u];
}
}
}
if (v) {
t = {};
for (var w = 0; w < v.length; w++) {
t[v[w]] = i.call(this, v[w]);
}
} else {
t = i.call(this, u);
}
return t;
};
};
f.prototype.extend = function (i, s) { f.prototype.extend = function (i, s) {
this[i] = s; this[i] = s;
}.overloadSetter(); }.overloadSetter();
@ -125,24 +83,12 @@
this.prototype[i] = s; this.prototype[i] = s;
}.overloadSetter(); }.overloadSetter();
var n = Array.prototype.slice; var n = Array.prototype.slice;
f.from = function (i) {
return (o(i) == "function") ? i : function () {
return i;
};
};
Array.from = function (i) { Array.from = function (i) {
if (i == null) { if (i == null) {
return []; return [];
} }
return (a.isEnumerable(i) && typeof i != "string") ? (o(i) == "array") ? i : n.call(i) : [i]; return (a.isEnumerable(i) && typeof i != "string") ? (o(i) == "array") ? i : n.call(i) : [i];
}; };
Number.from = function (s) {
var i = parseFloat(s);
return isFinite(i) ? i : null;
};
String.from = function (i) {
return i + "";
};
f.implement({ f.implement({
hide: function () { hide: function () {
this.$hidden = true; this.$hidden = true;
@ -286,16 +232,6 @@
return this; return this;
} }
}); });
var l = function (i) {
switch (o(i)) {
case"array":
return i.clone();
case"object":
return Object.clone(i);
default:
return i;
}
};
Array.implement("clone", function () { Array.implement("clone", function () {
var s = this.length, t = new Array(s); var s = this.length, t = new Array(s);
while (s--) { while (s--) {
@ -358,16 +294,9 @@
return (c++).toString(36); return (c++).toString(36);
}); });
})(); })();
Array.implement({ Array.implement({
every: function (c, d) { filter: function (d, f) {
for (var b = 0, a = this.length >>> 0;
b < a; b++) {
if ((b in this) && !c.call(d, this[b], b, this)) {
return false;
}
}
return true;
}, filter: function (d, f) {
var c = []; var c = [];
for (var e, b = 0, a = this.length >>> 0; b < a; b++) { for (var e, b = 0, a = this.length >>> 0; b < a; b++) {
if (b in this) { if (b in this) {
@ -406,29 +335,6 @@ Array.implement({
return this.filter(function (a) { return this.filter(function (a) {
return a != null; return a != null;
}); });
}, invoke: function (a) {
var b = Array.slice(arguments, 1);
return this.map(function (c) {
return c[a].apply(c, b);
});
}, associate: function (c) {
var d = {}, b = Math.min(this.length, c.length);
for (var a = 0; a < b; a++) {
d[c[a]] = this[a];
}
return d;
}, link: function (c) {
var a = {};
for (var e = 0, b = this.length; e < b; e++) {
for (var d in c) {
if (c[d](this[e])) {
a[d] = this[e];
delete c[d];
break;
}
}
}
return a;
}, contains: function (a, b) { }, contains: function (a, b) {
return this.indexOf(a, b) != -1; return this.indexOf(a, b) != -1;
}, append: function (a) { }, append: function (a) {
@ -436,18 +342,11 @@ Array.implement({
return this; return this;
}, getLast: function () { }, getLast: function () {
return (this.length) ? this[this.length - 1] : null; return (this.length) ? this[this.length - 1] : null;
}, getRandom: function () {
return (this.length) ? this[Number.random(0, this.length - 1)] : null;
}, include: function (a) { }, include: function (a) {
if (!this.contains(a)) { if (!this.contains(a)) {
this.push(a); this.push(a);
} }
return this; return this;
}, combine: function (c) {
for (var b = 0, a = c.length; b < a; b++) {
this.include(c[b]);
}
return this;
}, erase: function (b) { }, erase: function (b) {
for (var a = this.length; a--;) { for (var a = this.length; a--;) {
if (this[a] === b) { if (this[a] === b) {
@ -495,34 +394,13 @@ String.implement({
return ((typeOf(a) == "regexp") ? a : new RegExp("" + a, b)).test(this); return ((typeOf(a) == "regexp") ? a : new RegExp("" + a, b)).test(this);
}, contains: function (a, b) { }, contains: function (a, b) {
return (b) ? (b + this + b).indexOf(b + a + b) > -1 : String(this).indexOf(a) > -1; return (b) ? (b + this + b).indexOf(b + a + b) > -1 : String(this).indexOf(a) > -1;
}, trim: function () {
return String(this).replace(/^\s+|\s+$/g, "");
}, clean: function () {
return String(this).replace(/\s+/g, " ").trim();
}, camelCase: function () {
return String(this).replace(/-\D/g, function (a) {
return a.charAt(1).toUpperCase();
});
}, hyphenate: function () {
return String(this).replace(/[A-Z]/g, function (a) {
return ("-" + a.charAt(0).toLowerCase());
});
}, capitalize: function () { }, capitalize: function () {
return String(this).replace(/\b[a-z]/g, function (a) { return String(this).replace(/\b[a-z]/g, function (a) {
return a.toUpperCase(); return a.toUpperCase();
}); });
}, escapeRegExp: function () {
return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1");
}, rgbToHex: function (b) { }, rgbToHex: function (b) {
var a = String(this).match(/\d{1,3}/g); var a = String(this).match(/\d{1,3}/g);
return (a) ? a.rgbToHex(b) : null; return (a) ? a.rgbToHex(b) : null;
}, substitute: function (a, b) {
return String(this).replace(b || (/\\?\{([^{}]+)\}/g), function (d, c) {
if (d.charAt(0) == "\\") {
return d.slice(1);
}
return (a[c] != null) ? a[c] : "";
});
} }
}); });
Function.implement({ Function.implement({
@ -549,8 +427,9 @@ Function.implement({
}; };
}, delay: function (b, c, a) { }, delay: function (b, c, a) {
return setTimeout(this.pass((a == null ? [] : a), c), b); return setTimeout(this.pass((a == null ? [] : a), c), b);
}, }
}); });
Number.alias("each", "times"); Number.alias("each", "times");
(function (b) { (function (b) {
var a = {}; var a = {};
@ -563,6 +442,7 @@ Number.alias("each", "times");
}); });
Number.implement(a); Number.implement(a);
})(["abs", "acos", "asin", "atan", "atan2", "ceil", "cos", "exp", "floor", "log", "max", "min", "pow", "sin", "sqrt", "tan"]); })(["abs", "acos", "asin", "atan", "atan2", "ceil", "cos", "exp", "floor", "log", "max", "min", "pow", "sin", "sqrt", "tan"]);
(function () { (function () {
var a = this.Class = new Type("Class", function (h) { var a = this.Class = new Type("Class", function (h) {
if (instanceOf(h, Function)) { if (instanceOf(h, Function)) {
@ -665,4 +545,4 @@ Number.alias("each", "times");
}, this); }, this);
} }
}; };
})(); })();

View File

@ -36,7 +36,7 @@ mindplot.model.FeatureModel = new Class({
this._attributes = {}; this._attributes = {};
// Create type method ... // Create type method ...
this['is' + type.camelCase() + 'Model'] = function () { this['is' + $.camelCase(type) + 'Model'] = function () {
return true; return true;
}; };
}, },
@ -73,4 +73,4 @@ mindplot.model.FeatureModel = new Class({
getType:function () { getType:function () {
return this._type; return this._type;
} }
}); });

View File

@ -85,7 +85,7 @@ mindplot.widget.LinkEditor = new Class({
if(me.checkURL(input.val())){ if(me.checkURL(input.val())){
me.cleanError(); me.cleanError();
var inputValue = input.val(); var inputValue = input.val();
if (inputValue != null && inputValue.trim() != "") { if (inputValue != null && $.trim(inputValue) != "") {
model.setValue(inputValue); model.setValue(inputValue);
} }
me.close(); me.close();