Initial commit

This commit is contained in:
Fabrice Ecaille
2013-09-25 18:26:19 +02:00
commit 883157e3a6
22 changed files with 3271 additions and 0 deletions

24
js/tools.js Normal file
View File

@@ -0,0 +1,24 @@
function heriter(destination, source) {
function initClassIfNecessary(obj) {
if( typeof obj["_super"] == "undefined" ) {
obj["_super"] = function() {
var methodName = arguments[0];
var parameters = arguments[1];
this["__parent_methods"][methodName].apply(this, parameters);
}
}
if( typeof obj["__parent_methods"] == "undefined" ) {
obj["__parent_methods"] = {};
}
}
for (var element in source) {
if( typeof destination[element] != "undefined" ) {
initClassIfNecessary(destination);
destination["__parent_methods"][element] = source[element];
} else {
destination[element] = source[element];
}
}
}