I am not an expert with classes and objects and I would like to understand this structure from Brian Kirchoff (see the attached text file coming from the site niceEditor )
Then bkClass.extend is used along the script to build the Editor...Code:var bkExtend = function(){ var args = arguments; if (args.length == 1) args = [this, args[0]]; for (var prop in args[1]) args[0][prop] = args[1][prop]; return args[0]; }; function bkClass() { };// One empty class bkClass.prototype.construct = function() {};// With one empty function construc bkClass.extend = function(def) { var classDef = function() { if (arguments[0] !== bkClass) { return this.construct.apply(this, arguments); } }; var proto = new this(bkClass); bkExtend(proto,def); classDef.prototype = proto; classDef.extend = this.extend; return classDef; };


Reply With Quote
Bookmarks