Author: ygrego Date: 2015-01-30 16:53:48 +0000 (Fri, 30 Jan 2015) New Revision: 752 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/752 Log: Move of "Class.js" into "js/lib/" directory. Added: oipf/js/lib/Class.js Added: oipf/js/lib/Class.js =================================================================== --- oipf/js/lib/Class.js (rev 0) +++ oipf/js/lib/Class.js 2015-01-30 16:53:48 UTC (rev 752) @@ -0,0 +1,15 @@ +var Class = new Function(); + +Function.prototype.extend = function(proto) { + var parent = this; + + var child = function() { + this.init && this.init.apply(this, arguments); + }; + + child.prototype = proto; + child.prototype.__proto__ = parent.prototype; + child.prototype.super = parent.prototype; + + return child; +};