Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-
The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-
-/**
-* Global MinionJS Object with Static methods.
-*
-* @namespace
-*/
-
-/*
- TODO:
- - Multiple inheritance
- - Independent library support, i.e. ability to do minion.require("minion.libs.jquery") to load jquery
- - __preDefine method on Classes, takes 1 argument, a callback that gets called once __preDefine does all it needs to do
-*/
-
-var minion = (function (root) {
-
- "use strict";
-
- // If Array.indexOf is not defined, let's define it.
- Array.prototype.indexOf = Array.prototype.indexOf || function (a, b) {
- if (!this.length || !(this instanceof Array) || arguments.length < 1) {
- return -1;
- }
-
- b = b || 0;
-
- if (b >= this.length) {
- return -1;
- }
-
- while (b < this.length) {
- if (this[b] === a) {
- return b;
- }
- b += 1;
- }
- return -1;
- };
-
- var _classMappings = [];
- var _aliases = ["minion"];
-
- var _separator = ".";
- var _class_path = "";
- var _file_suffix = "";
-
- var _initialized;
-
- var _loadQueue = [];
- var _extendQueue = [];
-
- var _waitID;
- var _waitingForLoad = [];
- var _loadedFiles = [];
- var _notificationManager;
- var _waitInterval = 500;
-
- var _isNode = (typeof window === "undefined");
-
- var _root = root;
- var _ns = {};
- var _errorTimeout = 1e4;
-
- /**
- * @exports _minion as minion
- * @class
- */
- var _minion = {};
-
- /*================= HELPER FUNCTIONS =================*/
-
- /** @private */
- var _isArray = Array._isArray || function (a) {
- return a instanceof Array;
- };
-
- /** @private */
- var _isObject = function (obj) {
- return typeof obj === "object";
- };
-
- /** @private */
- var _isString = function (s) {
- return typeof s === 'string' || s instanceof String;
- };
-
- /** @private */
- var _isFunction = function (fn) {
- return typeof fn === "function";
- };
-
- /** @private */
- var _strToArray = function (s) {
- return (!_isArray(s)) ? [s] : s;
- };
-
- /** @private */
- var _concatArray = function (a, b, forceUnique) {
- b = b || [];
- if(!forceUnique){
- return a || [].concat(b);
- }
-
- // Force unique values
- b = [].concat(b);
- a = a || [];
-
- for(var i = 0, l = a.length; i < l; i += 1){
- if(b.indexOf(a[i]) < 0){
- b[b.length] = a[i];
- }
- }
-
- return b;
- };
-
- /** @private */
- var _copyToNS = function(o1,o2){
- for (var i in o1) {
- if(o1.hasOwnProperty(i)){
- o2[i] = o1[i];
- }
- }
- };
-
- /** @private */
- var _removeFromNS = function(o1,o2){
- for (var i in o1) {
- if(o1.hasOwnProperty(i)){
- o2[i] = null;
- delete o2[i];
- }
- }
- };
-
-
- // Recursively checks dependencies
- /** @private */
- var _areDependenciesLoaded = function (o) {
- o = _minion.get(o, false);
- var i;
-
- if (!o.__isDefined) {
- return false;
- }
- if (o.__dependencies) {
- for (i = 0; i < o.__dependencies.length; i += 1) {
- if (!_areDependenciesLoaded(o.__dependencies[i])) {
- return false;
- }
- }
- }
- return true;
- };
-
- /** @private */
- var _checkLoadQueue = function () {
- var i, j, q, dependenciesLoaded, classes, classesArray;
- q = {};
- classes = {};
- classesArray = [];
-
- for (i = _loadQueue.length - 1; i >= 0; i --) {
-
- q = _loadQueue[i];
- dependenciesLoaded = true;
-
- for (j = 0; j < q.c.length; j ++) {
- dependenciesLoaded = _areDependenciesLoaded(q.c[j]);
- if (!dependenciesLoaded) {
- break;
- }
- }
-
- if (dependenciesLoaded) {
- if (q.cb) {
- q.cb.apply(_root, _minion.get(q.c));
- }
- _loadQueue.splice(i, 1);
- }
- }
- };
-
- /** @private */
- var _checkExtendQueue = function () {
- var eq = _extendQueue;
- var i, superClass, ns, id;
-
- for (i = eq.length - 1; i >= 0; i --) {
-
- ns = eq[i].split(_separator);
- id = ns.splice(ns.length - 1, 1)[0];
- ns = _minion.get(ns.join(_separator), false);
-
- if (ns[id].__toExtend) {
- superClass = _minion.get(ns[id].__extendedFrom, false);
- if (superClass.__isDefined) {
-
- ns[id].__toExtend = false;
- delete ns[id].__toExtend;
-
- ns[id] = _minion.extend(ns[id].__extendedFrom, ns[id]);
-
- eq.splice(i, 1);
- setTimeout(_checkExtendQueue, 0);
- return;
- }
- }
- }
- _checkLoadQueue();
- };
-
- /** @private */
- var _checkWaitQueue = function () {
-
- var w = _waitingForLoad;
- var i, o;
-
- if (_waitID) {
- clearTimeout(_waitID);
- }
-
- for (i = 0; i < w.length; i += 1) {
- o = w[i];
- o.e += 50;
-
- if (_minion.isDefined(o.c)) {
- o.s.onload();
- }
-
- else if (o.e >= _errorTimeout) {
- o.s.onerror();
- }
- }
-
- if (w.length > 0) {
- _waitID = setTimeout(_checkWaitQueue, _waitInterval);
- }
- };
-
- /**
- * Injects a Script tag into the DOM
- *
- * @param f The path of the file to inject.
- * @param c The class which maps to the file we are injecting.
- * @private
- */
-
- var _inject = function(f, c) {
-
- var doc = document;
- var body = "body";
-
- var injectObj, script;
-
- if (!doc[body]) {
- return setTimeout(function(){
- _inject(f,c);
- }, 0);
- }
-
- script = doc.createElement("script");
- script.async = true;
-
- injectObj = {
- f : f, // File
- c : c, // Class
- e : 0, // Elapsed Time
- s : script // Script
- };
-
- _waitingForLoad.push(injectObj);
-
- /** @ignore */
- script.onreadystatechange = /** @ignore */ script.onload = function (e) {
- if (_minion.isDefined(c)) {
- injectObj.s.onload = injectObj.s.onreadystatechange = null;
- injectObj.s.onerror = null;
- _waitingForLoad.splice(_waitingForLoad.indexOf(injectObj), 1);
- }
- };
-
- /** @ignore */
- script.onerror = function (e) {
- injectObj.s.onerror = null;
- _waitingForLoad.splice(_waitingForLoad.indexOf(injectObj), 1);
- throw new Error(injectObj.c + " failed to load. Attempted to load from file: " + injectObj.f);
- };
-
- script.src = f;
-
- // Append the script to the document body
- doc[body].appendChild(script);
- };
-
- /**
- * Does all the loading of JS files
- *
- * @param q The queue to be loaded
- * @private
- */
-
- var _load = function (q) {
-
- _loadQueue.push(q);
-
- for (var i = 0; i < q.f.length; i += 1) {
-
- if(_isNode){
- require(q.f[i]);
- }
- else{
- _inject(q.f[i], q.c[i]);
- }
- }
-
- /*
- If the load times out, fire onerror after the time defined by _errorTimeout (default is 10 seconds)
- (can be changed through minion.config({minion.errorTimeout : ms});
- */
- _waitID = setTimeout(_checkWaitQueue, _waitInterval);
- };
-
- /**
- * Used by minion.get() and minion.define().
- * Get the namespace/Class, or creates it if it does not exist. Also optionally creates Objects in the specified namepsace.
- *
- * @param {String|Object}id The fully qualified namespace.
- * @param {Boolean} autoCreate Whether or not to create a blank object if the namespace does not yet exist.
- * @param {Object} [definitions] An object of class definitions which will be added to the namespace.
- * @returns {Object} The object that represents the fully qualified namespace passed in as the first argument.
- * @private
- */
-
- var _namespace = function (id, autoCreate, definitions) {
- id = id || "";
- definitions = definitions || false;
-
- var ns = _ns;
- var i;
-
- if (id && !_isObject(id) && !_isFunction(id)) {
- var parts = id.split(_separator);
-
- if (_aliases.indexOf(parts[0]) > -1) {
- ns = _minion;
- parts.splice(0,1);
- }
-
- for (i = 0; i < parts.length; i += 1) {
- if (!ns[parts[i]]) {
- if (autoCreate) {
- ns[parts[i]] = {};
- }
- else{
- return false;
- }
- }
- ns = ns[parts[i]];
- }
- }
-
- else if (id !== "") {
- ns = id;
- }
- else{
- return false;
- }
-
- if (definitions) {
-
- definitions.require = _concatArray(definitions.require);
- var cr = definitions.require;
-
- for (var className in definitions) {
-
- if (className !== "require") {
-
- var qualifiedName = id + _separator + className;
- var c = definitions[className];
-
- if (c.__extendedFrom) {
- cr.push(c.__extendedFrom);
- }
-
- if (c.__toExtend) {
- if (_extendQueue.indexOf(qualifiedName) < 0) {
- _extendQueue.push(qualifiedName);
- }
- }
-
- c.__static = c.__static || {};
-
- c.__nsID = id;
- c.__ns = ns;
- c.__class = className;
-
- if (cr.length > 0) {
- c.__dependencies = _concatArray(c.__dependencies, cr, true);
- _minion.require(cr);
- }
-
- if (_minion.isDefined(c) && c.prototype) {
- var proto = c.prototype;
- proto.__nsID = id;
- proto.__ns = ns;
- proto.__class = className;
-
- if (cr.length > 0) {
- proto.__dependencies = _concatArray(proto.__dependencies, cr, true);
- }
- }
-
- ns[className] = c;
- }
- }
- }
-
- return ns;
- };
-
- /*================= END OF HELPER FUNCTIONS =================*/
-
-
- /**
- * Configure minion.
- *
- * @public
- * @param {Object} configObj Configuration object, possible properties are : classPath, separator and fileSuffix
- */
-
- _minion.configure = function (configObj) {
-
- configObj = configObj || {};
-
- _class_path = configObj.classPath || _class_path;
- _class_path = (_class_path.lastIndexOf("/") === _class_path.length - 1) ? _class_path : _class_path + "/";
-
- _separator = configObj.separator || _separator;
- _file_suffix = configObj.fileSuffix || _file_suffix;
-
- if(configObj.paths){
- for(var i = 0; i < configObj.paths.length; i ++){
- var m = configObj.paths[i];
- _minion.provides(m.file, m.classes);
- }
- }
-
- _initialized = true;
- };
-
- /**
- * Alias minion under a different namespace. I.e. var woot = minion.alias("woot");
- *
- * @public
- * @param {String} alias The name of the namespace to alias minion under.
- */
-
- _minion.alias = function (alias) {
- _aliases.push(alias);
- return _minion;
- };
-
- /**
- * Gets the object by it's fully qualified identifier.
- *
- * @public
- * @param {String} id The identifier to get
- * @returns {Object|Boolean} The object that represents the identifier or false if it has not yet been defined.
- */
-
- _minion.get = function (id) {
- if(!_isArray(id)){
- return _namespace(id, false);
- }
- else{
- var classes = _minion.use(id, {});
- var classesArray = [];
-
- for (var c in classes) {
- if(classes.hasOwnProperty(c)) {
- classesArray.push(classes[c]);
- }
- }
-
- return classesArray;
- }
- };
-
- /**
- * Defines Classes under the given namespace.
- *
- * @public
- * @param {String} id The namespace to define the Classes under.
- * @param {Object} [definitions] An object of class definitions which will be added to the namespace
- * @returns {Object} The object that represents the namespace passed in as the first argument.
- */
- _minion.define = function (id, definitions) {
- var r = _namespace(id, true, definitions);
- _checkExtendQueue();
- return r;
- };
-
- /**
- * Gets the URL for a given identifier.
- *
- * @public
- * @param {String} id The fully qualified name to look up.
- * @returns {String} The URL of the file that maps to the fully qualified name.
- */
-
- _minion.getURL = function (id) {
-
- if (_classMappings[id]) {
- return _classMappings[id];
- }
-
- var isDir = id.indexOf("*") > -1;
- id = isDir ? id.replace(".*", "") : id;
- var url = _class_path + id.replace(new RegExp('\\' + _separator, 'g'), '/') + (isDir ? "" : '.js') + ((_file_suffix) ? "?" + _file_suffix : "");
-
- return url;
- };
-
- /**
- * Checks to see whether the given fully qualified name or Object is defined as a minion class. (Checks for .__isDefined)
- * NOTE: Classes that have not yet loaded all of their dependencies, will return FALSE for this check.
- *
- * @public
- * @param {String|Object} id The fully qualfied class name, or an Object.
- * @returns {Boolean} Whether or not this is defined.
- */
-
- _minion.isDefined = function (id) {
- id = (!_isObject(id) && !_isFunction(id)) ? _namespace(id, false) : id;
- return (id) ? id.__isDefined : false;
- };
-
- /**
- * Extends a given class asynchronously.
- *
- * @public
- * @param {String} id The fully qualified name of the Class you want to extend.
- * @param {Object} obj A new Class Object
- * @returns {Object} The extended Class, or, if still waiting on dependencies, the original Object with a few more properties for internal minion use.
- */
-
- _minion.extend = function (id, obj) {
-
- // If the Class exists and is a minion class, then return the extended object.
- if (_minion.isDefined(id)) {
- obj = _minion.get(id).__extend(obj);
- }
- else{
- obj.__toExtend = true;
- }
-
- obj.__extendedFrom = id;
-
- return obj;
- };
-
- /**
- * Tells minion that filePath provides the class definitions for these classes.
- * Useful in cases where you group specific things into minfiied js files.
- *
- * @public
- * @param {String} file The path of a JS file.
- * @param {String|Array} definitions Fully qualfiied name(s) of class(es)
- */
-
- _minion.provides = function (file, definitions) {
-
- // If classes is a String, create an array
- definitions = _strToArray(definitions);
-
- // If the file is not absolute, prepend the _class_path
- //file = (!new RegExp("(http://|/)[^ :]+").test(file)) ? _class_path + file : file;
-
- for (var i = 0; i < definitions.length; i += 1) {
- _classMappings[definitions[i]] = file;
- }
- };
-
- /**
- * Asyncrhonously loads in js files for the classes specified.
- * If the classes have already been loaded, or are already defined, the callback function is invoked immediately.
- *
- * @public
- * @param {String|Array} ids The fully qualified name(s) of the class(es) to load.
- * @param {Function} callback The function to call once all classes (and their dependencies) have been loaded.
- */
-
- _minion.require = function (ids, callback) {
- if (!_initialized) {
- _minion.configure();
- }
-
- ids = _strToArray(ids);
-
- var fileList = [];
- var classList = [];
-
- for (var i = 0; i < ids.length; i ++) {
-
- var id = ids[i];
- var file = _minion.getURL(id);
- var get = _minion.get(id);
-
- classList.push(id);
-
- if ((_loadedFiles.indexOf(file) < 0) && !_minion.get(id)) {
- fileList.push(file);
- _loadedFiles.push(file);
- }
- }
-
- if (fileList.length > 0) {
-
- var q = {
- f : fileList,
- c : classList,
- cb : callback
- };
-
- //_load(q);
- setTimeout(function(){_load(q);}, 0);
- }
-
- else if (callback) {
- callback.apply(_root, _minion.get(ids));
- }
- };
-
- /**
- * Copies an array of classes (by their fully qualified names) to the specified object/scope.
- *
- * By calling minion.use("test.Example", obj), you will be able to refer to test.Example as just obj.Example.
- *
- * Identifiers can contain the* wildcard character as its last segment (eg: test.*)
- * which will import all Classes under the given namespace.
- *
- * @public
- * @param {String|Array} ids The fully qualfiied name(s) to import into the global namespace.
- * @param {Object=[root]} The scope to use.
- * @returns {Object} Returns the object passed in as the second argument, with the classes passed in as the first argument as properties.
- */
-
- _minion.use = function (ids, scope) {
-
- ids = ids || [];
- ids = _strToArray(ids);
- scope = scope || _ns;
-
- if (scope === _ns) {
- _minion.unuse();
- }
-
- var i, id, obj, ns, n;
-
- for (i = 0; i < ids.length; i += 1) {
-
- id = ids[i];
-
- obj = _minion.get(id, true);
- ns = id.split(_separator);
- id = ns.splice(ns.length - 1, 1)[0];
- ns = _minion.get(ns.join(_separator), false);
-
- if (id === '*') {
- // injects all ids under namespace into the root namespace
- for (n in ns) {
- if(ns.hasOwnProperty(n)){
- scope[n] = ns[n];
- }
- }
- }
- else{
- // injects this id into the root namespace
- if (ns[id]) {
- scope[id] = ns[id];
- }
- }
- }
-
- return scope;
- };
-
- /** @private */
- _minion.enableNotifications = function () {
- if (_minion.isDefined("minion.NotificationManager")) {
- if (!_notificationManager) {
- _notificationManager = new (minion.get("minion.NotificationManager"))();
-
- /** @private */
- _minion.subscribe = function () {
- _notificationManager.subscribe.apply(_notificationManager, arguments);
- };
-
- /** @private */
- _minion.unsubscribe = function () {
- _notificationManager.unsubscribe.apply(_notificationManager, arguments);
- };
-
- /** @private */
- _minion.publish = function () {
- _notificationManager.publish.apply(_notificationManager, arguments);
- };
-
- /** @private */
- _minion.holdNotification = function () {
- _notificationManager.holdNotification.apply(_notificationManager, arguments);
- };
-
- /** @private */
- _minion.releaseNotification = function () {
- _notificationManager.releaseNotification.apply(_notificationManager, arguments);
- };
-
- /** @private */
- _minion.cancelNotification = function () {
- _notificationManager.cancelNotification.apply(_notificationManager, arguments);
- };
- }
- }
- };
-
- /*
- Define minion as an AMD module, if define is defined (and has .amd as a property)
- */
- if (typeof _root.define === "function" && _root.define.amd) {
- _root.define([], function () {
- return _minion;
- });
- }
-
- // Export for node
- if (_isNode){
- module.exports = _minion;
- }
-
- return _minion;
-
-})(this);(function(){
-
- "use strict";
-
- //* @ignore */
- minion.define("minion", {
-
- /**
- * The minion Base Class
- * Classical JavaScript Inheritance (or an attempt thereof)
- * minion.Class is the ONLY Class to extend this directly, do not directly extend this Class.
- * Largely taken from: http://ejohn.org/blog/simple-javascript-inheritance/
- * @ignore */
-
- __BaseClass__ : (function() {
-
- /*
- Attempts to shallow copy objects, so as to not have a bunch of references lying around in object instances
- Otherwise, it is bad news bears doing something like this.nArray.push() in a Class method
- because it modifies nArray on prototype, and thus any other instances of said Class
- */
- var _copy = function (obj) {
- var i, attr, c;
-
- // Null, undefined, number, boolean, string, function all get returned immediately, no need to copy them.
- if (!obj || typeof obj !== "object") {
- return obj;
- }
-
- if (obj instanceof Date) {
- return new Date().setTime(obj.getTime());
- }
-
- if (obj instanceof Array) {
- return obj.concat();
- }
-
- if (typeof obj === "object") {
- c = {};
- for (attr in obj) {
- if (obj.hasOwnProperty(attr)) {
- c[attr] = obj[attr];
- }
- }
- return c;
- }
- // If it fails, just return the original object.
- return obj;
- };
-
- var _createSuperFunction = function (fn, superFn) {
- return function() {
- var tmp = this.__super || null;
-
- // Reference the prototypes method, as super temporarily
- this.__super = superFn;
-
- var ret = fn.apply(this, arguments);
-
- // Reset this.__super
- if(tmp){this.__super = tmp;}
- else{this.__super = null; delete this.__super;}
- return ret;
- };
- };
-
- // Checks the function contents to see if it has a reference to __super
- var _doesCallSuper = /xyz/.test(function(){var xyz;}) ? /\b__super\b/ : /.*/;
-
- /** @ignore */
- var _baseClass = function(){};
-
- _baseClass.__isDefined = true;
-
- /** @ignore */
- _baseClass.__extend = function(obj) {
-
- // By passing "__no_init__" as the first argument, we skip calling the constructor and other initialization;
- var This = this;
- var _proto = new This("__no_init__");
- var _perInstanceProps = {};
- var _this = this;
-
- // Copy the object's properties onto the prototype
- for(var name in obj) {
-
- if(obj.hasOwnProperty(name)) {
-
- if(name !== "__static"){
- // If we're overwriting an existing function that calls this.__super, do a little super magic.
- if(typeof obj[name] === "function" && typeof _proto[name] === "function" && _doesCallSuper.test(obj[name])){
- _proto[name] = _createSuperFunction(obj[name], _proto[name]);
- }
- else{
- _proto[name] = obj[name];
- }
- }
-
- /*
- If it's an array or an object, we need to make a per instance copy of these values, so as to not affect other
- instances when dealing with Arrays or Objects.
- */
- else if (typeof obj[name] === "object" && name.indexOf("__") !== 0) {
- _perInstanceProps[name] = obj[name];
- }
- }
- }
-
- var _class = function() {
-
- if(arguments[0] !== "__no_init__"){
-
- /*
- Handy for referencing dependencies. If a Class requires example.Test, then you can reference said class
- in any method by this.__imports.Test;
-
- This method is preferred over this.use_dependencies(), as you have to explicitly call this.unuse_dependencies()
- to be responsible, at the end of every method.
- */
- if(!_class.prototype.hasOwnProperty("__imports")){
- _class.prototype.__imports = minion.use(this.__dependencies, {});
- }
-
- if(!this.__preInit){
-
- for (var attr in _perInstanceProps) {
- if (_perInstanceProps.hasOwnProperty(attr)) {
- this[attr] = _copy(_perInstanceProps[attr]);
- }
- }
-
- // All real construction is actually done in the init method
- return this.init.apply(this, arguments);
- }
-
- else{
- return this.__preInit.apply(this, arguments);
- }
-
- }
- };
-
- // Set the prototype and Constructor accordingly.
- _class.prototype = _proto;
- //* @ignore */
- _class.prototype.constructor = _class;
-
- // Expose the extend method
- //* @ignore */
- _class.__extend = _baseClass.__extend;
-
- _class.prototype.__extend = (function(scope, fn){
- return function(){
- return fn.apply(scope, arguments);
- };
- })(_class, _class.__extend);
-
- /*
- Custom minion properties, anything beginning with an __ on a Class or instance, is populated and used by minion.
- The "__" prefix is used to avoid naming conflictions with developers, and allows
- us to not have to impose a list of reserved words on developers.
- */
-
- _class.__ns = obj.__ns || "";
- _class.__nsID = obj.__nsID || "";
- _class.__class = obj.__class || "";
- _class.__dependencies = obj.__dependencies || [];
-
- /*
- Add all static methods and properties that are defined in the __static object.
- Only write to it if it doesn't already exist, to disable overwriting things we actually need for minion by malicious or
- plain bad code.
- */
- var prop;
-
- if(obj.__static){
- _class.__static = _class.__static || {};
- for(prop in obj.__static){
- if(!_class[prop]){
- _class[prop] = obj.__static[prop];
- _class.__static[prop] = obj.__static[prop];
- }
- }
- _class.__static = obj.__static;
- }
-
- if(this.__static){
- _class.__static = _class.__static || {};
- for(prop in this.__static){
- if(!_class[prop]){
- _class[prop] = this.__static[prop];
- _class.__static[prop] = this.__static[prop];
- }
- }
- }
-
- if(_class.__static.__isStatic){
-
- var StaticClass = _class;
- var s = new StaticClass();
-
- s.__static = _class.__static;
-
- for(prop in _class.__static){
- s[prop] = _class.__static[prop];
- }
-
- return s;
- }
-
- return _class;
- };
-
- return _baseClass;
-
- })()
- });
-
-})();(function(){
-
- "use strict";
-
- minion.define("minion", {
-
- /** @lends minion.Class# */
-
- Class : minion.extend("minion.__BaseClass__", {
-
- __static : {
- __isDefined: true
- },
-
- /**
- *
- * The base minion Class. All Classes are required to be descendants
- * of this class, either directly, or indirectly.
- *
- * @constructs
- */
- init: function(){
- if(!this._interestHandlers){
- this._interestHandlers = [];
- }
- },
-
- /**
- * Local version of window.setTimeout that keeps scope of this.
- *
- * @returns {Number} A timeout ID
- */
- setTimeout : function(func, delay){
- return setTimeout(this.proxy(func), delay);
- },
-
- /**
- * Local version of window.setInterval that keeps scope of this.
- *
- * @returns {Number} An interval ID
- */
- setInterval : function(func, delay){
- return setInterval(this.proxy(func), delay);
- },
-
- /**
- * Shorthand for func.bind(this)
- * or rather, $.proxy(func, this) in jQuery terms
- *
- * @returns {Function} The proxied function
- */
- proxy : function(func){
- var bind = function (context) {
- if (!context) {return this;}
- var this_ = this;
- return function() {
- return this_.apply(context, Array.prototype.slice.call(arguments));
- };
- };
-
- return bind.call(func, this);
- },
-
- /**
- * Subscribes to a notification.
- *
- * @public
- * @param {String} name The name of the Notification you are subscribing to.
- * @param {Function} handler A function to be called upon receiving the given Notification.
- */
-
- subscribe : function(name, handler, priority){
- if(!this._interestHandlers){
- this._interestHandlers = [];
- }
- if(handler && !this._interestHandlers[name]){
- minion.subscribe(this, name, priority);
- this._interestHandlers[name] = handler;
- }
- },
-
- /**
- * Unsubscribes from a notification.
- *
- * @public
- * @param {String} name The name of the Notification you are unsubscribing from.
- */
-
- unsubscribe : function(name){
- if(this._interestHandlers && this._interestHandlers[name]){
- this._interestHandlers[name] = null;
- delete this._interestHandlers[name];
- }
- minion.unsubscribe(this, name);
- },
-
- /**
- * Unsubscribes from all notifications registered via this.subscribe();
- */
-
- unsubscribeAll : function(){
- for(var interest in this._interestHandlers){
- if(this._interestHandlers.hasOwnProperty(interest)){
- this.unsubscribe(interest);
- }
- }
- this._interestHandlers = [];
- },
-
- /**
- * Publishes a notification with the specified data.
- *
- * @param {String} name The name of the Notification you are publishing.
- * @param {Object} data An object of data you want to send with the Notification.
- * @param {Function} callback A callback function to be invoked if Notification.respond() is called
- */
-
- publish : function(name, data, callback){
- minion.publish(name, data, this, callback);
- },
-
- /** @ignore */
- handleNotification : function(n){
- var handler = this._interestHandlers[n.name];
- if(handler){
- this.proxy(handler)(n);
- }
- }
-
- })
- });
-
-})(); (function(){
-
- "use strict";
-
- minion.define("minion", {
-
- /** @lends minion.Singleton# */
-
- Singleton : minion.extend("minion.Class", {
-
- /**
- *
- * A way to easily implement Singletons.
- *
- * @constructs
- * @extends minion.Class
- */
- init : function(){
-
- },
-
- /** @ignore */
- __preInit : function(){
- if(this.constructor.__instance){
- return this.constructor.__instance;
- }
-
- this.init.apply(this, arguments);
-
- this.constructor.__instance = this;
- return this.constructor.__instance;
- },
-
- /** @ignore */
- __static : {
-
- /** @lends minion.Singleton# */
- __isSingleton: true,
-
- /**
- *
- * Returns the instance of this Singleton. If this Class has not yet been instantiated, creates a new instance and returns that.
- * Otherwise, it returns the already existing reference.
- *
- * @memberOf minion.Singleton#
- */
- getInstance : function(){
- if(!this.__instance){
- var This = this;
- this.__instance = new This();
- return this.__instance;
- }
- return this.__instance;
- }
- }
-
- })
- });
-
-})();(function(){
-
- "use strict";
-
- minion.define("minion", {
-
- /** @lends minion.Static# */
-
- Static : minion.extend("minion.Singleton", {
-
- __static : {
- __isDefined : true,
- __isStatic : true
-
- },
-
- /**
- *
- * A way to easily implement Static Classes.
- *
- * @constructs
- * @extends minion.Singleton
- */
- init : function(){
-
- }
-
- })
- });
-
-})();(function(){
-
- "use strict";
-
- minion.define("minion", {
-
- /** @lends minion.Notification# */
-
- Notification : minion.extend("minion.Class", {
-
- data : {},
- name : "",
- dispatcher : null,
- status : 0, // 0 : Closed; 1 : Pending; 2 : Hold
- pointer : 0,
- callback : null,
-
- /**
- *
- * Notifications are the backbone of Minion's pub/sub model.
- * You should not have to construct Notification's directly, as the publish() method does this for you.
- *
- * @constructs
- * @param {String} name The name of the Notification.
- * @param {Object} data An object of data associated with the Notification.
- * @param {Function} callback A callback function. This gets invoked by calling Notification.respond();
- */
- init : function(name, data, callback) {
- this.name = name;
- this.data = data;
- this.callback = callback;
- },
-
- /**
- *
- * Holds a notification. Useful if you want to do other things before other instances receive this Notification,
- *
- * @public
- */
- hold : function() {
- this.status = 2;
- },
-
- /**
- *
- * Releases a Notification, call this at some point after hold();
- *
- * @public
- */
-
- release : function() {
- this.status = 1;
- minion.releaseNotification(this);
- },
-
- /**
- *
- * Cancels a Notification, any instances interested in this Notification higher up the chain will not receive it.
- *
- * @public
- */
-
- cancel : function() {
- minion.cancelNotification(this);
-
- this.data = {};
- this.name = "";
- this.status = 0;
- this.pointer = 0;
- this.dispatcher = null;
- this.callback = null;
- },
-
- /**
- *
- * Dispatches a Notification. You will rarely ever construct or call dispatch() on Notifications directly, as the publish() method handles all of this.
- *
- * @param {Object} obj An Object referencing what is dispatching this Notification.
- * @public
- */
-
- dispatch : function(obj) {
- this.status = 1;
- this.pointer = 0;
- this.dispatcher = obj;
-
- minion.publish(this);
- },
-
- /**
- *
- * Responds to a Notification. Pretty much just calls the callback function that is passed when constructing a new function.
- *
- * @public
- */
-
- respond : function () {
- if(this.callback) {
- this.callback.apply(typeof this.dispatcher == "object" ? this.dispatcher : this, arguments);
- this.callback = null;
- this.cancel();
- }
- }
- })
- });
-
-
- minion.define("minion", {
-
- /*
- This Class handles all the nitty gritty Notification stuff.
- TODO: Be nice and add some comments for other people :)
- */
-
- require : [
- "minion.Notification"
- ],
-
- NotificationManager : minion.extend("minion.Singleton", {
-
- _pendingNotifications: [],
- _pendingNotificationNames : [],
- _interests: {},
- _removeQueue: [],
-
- subscribe : function(obj, name, priority) {
-
- priority = isNaN(priority) ? -1 : priority;
- this._interests[name] = this._interests[name] || [];
-
- if(priority <= -1 || priority >= this._interests[name].length){
- this._interests[name].push(obj);
- }
- else{
- this._interests[name].splice(priority, 0, obj);
- }
- },
-
- unsubscribe : function(obj, name){
- if(name instanceof Array){
- for(var i = 0; i < name.length; i ++){
- this.unsubscribe(obj, name[i]);
- }
- return;
- }
- var objIndex = this._interests[name].indexOf(obj);
- if(obj && objIndex > -1){
-
- if(this._pendingNotificationNames.indexOf(name) > -1) {
- var rq = this._removeQueue[name] = this._removeQueue[name] || [];
- rq.push(obj);
- }
- else{
- this._interests[name].splice(objIndex, 1);
- }
- }
- },
-
- publish : function(notification, data, obj, callback){
-
- if(!(notification instanceof this.__imports.Notification)){
- notification = new this.__imports.Notification(notification, data, callback);
- notification.status = 1;
- notification.pointer = 0;
- notification.dispatcher = obj;
- }
-
- var name = notification.name;
-
- if(this._interests[name]){
- this._pendingNotifications.push(notification);
- this._pendingNotificationNames.push(name);
- this._notifyObjects(notification);
- }
- },
-
- _notifyObjects : function(notification){
-
- var name = notification.name;
-
- while(notification.pointer < this._interests[name].length) {
- if(notification.status === 1){
- if(this._interests[name][notification.pointer].handleNotification){
- this._interests[name][notification.pointer].handleNotification(notification);
- }
- notification.pointer ++;
- }
- else{
- return;
- }
- }
-
- if(notification.status === 1 && !notification.callback) {
- this.cancelNotification(notification);
- }
- },
-
- getNotification : function(name) {
- for(var i = 0; i < this._pendingNotifications.length; i ++){
- if(this._pendingNotifications[i].name === name){
- return this._pendingNotifications[i];
- }
- }
- },
-
- releaseNotification : function(notification){
- notification.status = 1;
- if(this._pendingNotifications.indexOf(notification) > -1){
- this._notifyObjects(notification);
- }
- },
-
- cancelNotification : function(notification){
- if(notification){
-
- var name = notification.name;
-
- this._pendingNotifications.splice(this._pendingNotifications.indexOf(notification), 1);
-
- notification.status = 0;
-
- if(this._removeQueue[name]){
- for(var i = 0; i < this._removeQueue.length; i ++){
- this.unsubscribe(this._removeQueue[name][i], name);
- }
- this._removeQueue[name] = null;
- delete this._removeQueue[name];
- }
-
- notification = null;
- }
- }
-
- })
-
- });
-
- minion.enableNotifications();
-
-})();
diff --git a/dist/minion-1.4.4.js b/dist/minion-1.4.4.js
index e8c719e..b1648ad 100644
--- a/dist/minion-1.4.4.js
+++ b/dist/minion-1.4.4.js
@@ -5,7 +5,7 @@
* (c) 2011, Taka Kojima
* Licensed under the MIT License
*
- * Date: Sat Jan 21 23:51:10 2012 -0800
+ * Date: Sat Feb 4 07:13:18 2012 -0800
*/
/**
@@ -1125,7 +1125,7 @@ var minion = (function (root) {
})
});
-})(); (function(){
+})();(function(){
"use strict";
diff --git a/dist/minion-1.4.4.min.js b/dist/minion-1.4.4.min.js
index eefef99..a16a9c9 100644
--- a/dist/minion-1.4.4.min.js
+++ b/dist/minion-1.4.4.min.js
@@ -5,6 +5,6 @@
* (c) 2011, Taka Kojima
* Licensed under the MIT License
*
- * Date: Sat Jan 21 23:51:10 2012 -0800
+ * Date: Sat Feb 4 07:13:18 2012 -0800
*/
- var minion=function(a){"use strict",Array.prototype.indexOf=Array.prototype.indexOf||function(a,b){if(!!this.length&&this instanceof Array&&arguments.length>=1){b=b||0;if(b=0;a--){c=h[a],d=!0;for(b=0;b=0;b--){e=a[b].split(d),f=e.splice(e.length-1,1)[0],e=s.get(e.join(d),!1);if(e[f].__toExtend){c=s.get(e[f].__extendedFrom,!1);if(c.__isDefined){e[f].__toExtend=!1,delete e[f].__toExtend,e[f]=s.extend(e[f].__extendedFrom,e[f]),a.splice(b,1),setTimeout(D,0);return}}}C()},E=function(){var a=k,b,c;j&&clearTimeout(j);for(b=0;b=r&&c.s.onerror();a.length>0&&(j=setTimeout(E,n))},F=function(a,b){var c=document,d="body",e,f;if(!c[d])return setTimeout(function(){F(a,b)},0);f=c.createElement("script"),f.async=!0,e={f:a,c:b,e:0,s:f},k.push(e),f.onreadystatechange=f.onload=function(a){s.isDefined(b)&&(e.s.onload=e.s.onreadystatechange=null,e.s.onerror=null,k.splice(k.indexOf(e),1))},f.onerror=function(a){throw e.s.onerror=null,k.splice(k.indexOf(e),1),Error(e.c+" failed to load. Attempted to load from file: "+e.f)},f.src=a,c[d].appendChild(f)},G=function(a){h.push(a);for(var b=0;b-1&&(f=s,h.splice(0,1));for(g=0;g0&&(m.__dependencies=y(m.__dependencies,j,!0),s.require(j));if(s.isDefined(m)&&m.prototype){var n=m.prototype;n.__nsID=a,n.__ns=f,n.__class=k,j.length>0&&(n.__dependencies=y(n.__dependencies,j,!0))}f[k]=m}}return f};return s.configure=function(a){a=a||{},e=a.classPath||e,e=e.lastIndexOf("/")===e.length-1?e:e+"/",d=a.separator||d,f=a.fileSuffix||f;if(a.paths)for(var b=0;b-1;a=c?a.replace(".*",""):a;var g=e+a.replace(RegExp("\\"+d,"g"),"/")+(c?"":".js")+(f?"?"+f:"");return g},s.isDefined=function(a){return a=!u(a)&&!w(a)?H(a,!1):a,a?a.__isDefined:!1},s.extend=function(a,b){return s.isDefined(a)?b=s.get(a).__extend(b):b.__toExtend=!0,b.__extendedFrom=a,b},s.provides=function(a,c){c=x(c);for(var d=0;d0){var j={f:c,c:d,cb:b};setTimeout(function(){G(j)},0)}else b&&b.apply(p,s.get(a))},s.use=function(a,b){a=a||[],a=x(a),b=b||q,b===q&&s.unuse();var c,e,f,g,h;for(c=0;c-1&&c-1)if(this._pendingNotificationNames.indexOf(b)>-1){var e=this._removeQueue[b]=this._removeQueue[b]||[];e.push(a)}else this._interests[b].splice(d,1)},publish:function(a,b,c,d){a instanceof this.__imports.Notification||(a=new this.__imports.Notification(a,b,d),a.status=1,a.pointer=0,a.dispatcher=c);var e=a.name;this._interests[e]&&(this._pendingNotifications.push(a),this._pendingNotificationNames.push(e),this._notifyObjects(a))},_notifyObjects:function(a){var b=a.name;while(a.pointer-1&&this._notifyObjects(a)},cancelNotification:function(a){if(a){var b=a.name;this._pendingNotifications.splice(this._pendingNotifications.indexOf(a),1),a.status=0;if(this._removeQueue[b]){for(var c=0;c=1){b=b||0;if(b=0;a--){c=h[a],d=!0;for(b=0;b=0;b--){e=a[b].split(d),f=e.splice(e.length-1,1)[0],e=s.get(e.join(d),!1);if(e[f].__toExtend){c=s.get(e[f].__extendedFrom,!1);if(c.__isDefined){e[f].__toExtend=!1,delete e[f].__toExtend,e[f]=s.extend(e[f].__extendedFrom,e[f]),a.splice(b,1),setTimeout(D,0);return}}}C()},E=function(){var a=k,b,c;j&&clearTimeout(j);for(b=0;b=r&&c.s.onerror();a.length>0&&(j=setTimeout(E,n))},F=function(a,b){var c=document,d="body",e,f;if(!c[d])return setTimeout(function(){F(a,b)},0);f=c.createElement("script"),f.async=!0,e={f:a,c:b,e:0,s:f},k.push(e),f.onreadystatechange=f.onload=function(a){s.isDefined(b)&&(e.s.onload=e.s.onreadystatechange=null,e.s.onerror=null,k.splice(k.indexOf(e),1))},f.onerror=function(a){throw e.s.onerror=null,k.splice(k.indexOf(e),1),Error(e.c+" failed to load. Attempted to load from file: "+e.f)},f.src=a,c[d].appendChild(f)},G=function(a){h.push(a);for(var b=0;b-1&&(f=s,h.splice(0,1));for(g=0;g0&&(m.__dependencies=y(m.__dependencies,j,!0),s.require(j));if(s.isDefined(m)&&m.prototype){var n=m.prototype;n.__nsID=a,n.__ns=f,n.__class=k,j.length>0&&(n.__dependencies=y(n.__dependencies,j,!0))}f[k]=m}}return f};return s.configure=function(a){a=a||{},e=a.classPath||e,e=e.lastIndexOf("/")===e.length-1?e:e+"/",d=a.separator||d,f=a.fileSuffix||f;if(a.paths)for(var b=0;b-1;a=c?a.replace(".*",""):a;var g=e+a.replace(RegExp("\\"+d,"g"),"/")+(c?"":".js")+(f?"?"+f:"");return g},s.isDefined=function(a){return a=!u(a)&&!w(a)?H(a,!1):a,a?a.__isDefined:!1},s.extend=function(a,b){return s.isDefined(a)?b=s.get(a).__extend(b):b.__toExtend=!0,b.__extendedFrom=a,b},s.provides=function(a,c){c=x(c);for(var d=0;d0){var j={f:c,c:d,cb:b};setTimeout(function(){G(j)},0)}else b&&b.apply(p,s.get(a))},s.use=function(a,b){a=a||[],a=x(a),b=b||q,b===q&&s.unuse();var c,e,f,g,h;for(c=0;c-1&&c-1)if(this._pendingNotificationNames.indexOf(b)>-1){var e=this._removeQueue[b]=this._removeQueue[b]||[];e.push(a)}else this._interests[b].splice(d,1)},publish:function(a,b,c,d){a instanceof this.__imports.Notification||(a=new this.__imports.Notification(a,b,d),a.status=1,a.pointer=0,a.dispatcher=c);var e=a.name;this._interests[e]&&(this._pendingNotifications.push(a),this._pendingNotificationNames.push(e),this._notifyObjects(a))},_notifyObjects:function(a){var b=a.name;while(a.pointer-1&&this._notifyObjects(a)},cancelNotification:function(a){if(a){var b=a.name;this._pendingNotifications.splice(this._pendingNotifications.indexOf(a),1),a.status=0;if(this._removeQueue[b]){for(var c=0;c=1){b=b||0;if(b=0;a--){c=h[a],d=!0;for(b=0;b=0;b--){e=a[b].split(d),f=e.splice(e.length-1,1)[0],e=s.get(e.join(d),!1);if(e[f].__toExtend){c=s.get(e[f].__extendedFrom,!1);if(c.__isDefined){e[f].__toExtend=!1,delete e[f].__toExtend,e[f]=s.extend(e[f].__extendedFrom,e[f]),a.splice(b,1),setTimeout(D,0);return}}}C()},E=function(){var a=k,b,c;j&&clearTimeout(j);for(b=0;b=r&&c.s.onerror();a.length>0&&(j=setTimeout(E,n))},F=function(a,b){var c=document,d="body",e,f;if(!c[d])return setTimeout(function(){F(a,b)},0);f=c.createElement("script"),f.async=!0,e={f:a,c:b,e:0,s:f},k.push(e),f.onreadystatechange=f.onload=function(a){s.isDefined(b)&&(e.s.onload=e.s.onreadystatechange=null,e.s.onerror=null,k.splice(k.indexOf(e),1))},f.onerror=function(a){throw e.s.onerror=null,k.splice(k.indexOf(e),1),Error(e.c+" failed to load. Attempted to load from file: "+e.f)},f.src=a,c[d].appendChild(f)},G=function(a){h.push(a);for(var b=0;b-1&&(f=s,h.splice(0,1));for(g=0;g0&&(m.__dependencies=y(m.__dependencies,j,!0),s.require(j));if(s.isDefined(m)&&m.prototype){var n=m.prototype;n.__nsID=a,n.__ns=f,n.__class=k,j.length>0&&(n.__dependencies=y(n.__dependencies,j,!0))}f[k]=m}}return f};return s.configure=function(a){a=a||{},e=a.classPath||e,e=e.lastIndexOf("/")===e.length-1?e:e+"/",d=a.separator||d,f=a.fileSuffix||f;if(a.paths)for(var b=0;b-1;a=c?a.replace(".*",""):a;var g=e+a.replace(RegExp("\\"+d,"g"),"/")+(c?"":".js")+(f?"?"+f:"");return g},s.isDefined=function(a){return a=!u(a)&&!w(a)?H(a,!1):a,a?a.__isDefined:!1},s.extend=function(a,b){return s.isDefined(a)?b=s.get(a).__extend(b):b.__toExtend=!0,b.__extendedFrom=a,b},s.provides=function(a,c){c=x(c);for(var d=0;d0){var j={f:c,c:d,cb:b};setTimeout(function(){G(j)},0)}else b&&b.apply(p,s.get(a))},s.use=function(a,b){a=a||[],a=x(a),b=b||q,b===q&&s.unuse();var c,e,f,g,h;for(c=0;c-1&&c-1)if(this._pendingNotificationNames.indexOf(b)>-1){var e=this._removeQueue[b]=this._removeQueue[b]||[];e.push(a)}else this._interests[b].splice(d,1)},publish:function(a,b,c,d){a instanceof this.__imports.Notification||(a=new this.__imports.Notification(a,b,d),a.status=1,a.pointer=0,a.dispatcher=c);var e=a.name;this._interests[e]&&(this._pendingNotifications.push(a),this._pendingNotificationNames.push(e),this._notifyObjects(a))},_notifyObjects:function(a){var b=a.name;while(a.pointer-1&&this._notifyObjects(a)},cancelNotification:function(a){if(a){var b=a.name;this._pendingNotifications.splice(this._pendingNotifications.indexOf(a),1),a.status=0;if(this._removeQueue[b]){for(var c=0;c=1){b=b||0;if(b=0;a--){c=h[a],d=!0;for(b=0;b=0;b--){e=a[b].split(d),f=e.splice(e.length-1,1)[0],e=s.get(e.join(d),!1);if(e[f].__toExtend){c=s.get(e[f].__extendedFrom,!1);if(c.__isDefined){e[f].__toExtend=!1,delete e[f].__toExtend,e[f]=s.extend(e[f].__extendedFrom,e[f]),a.splice(b,1),setTimeout(D,0);return}}}C()},E=function(){var a=k,b,c;j&&clearTimeout(j);for(b=0;b=r&&c.s.onerror();a.length>0&&(j=setTimeout(E,n))},F=function(a,b){var c=document,d="body",e,f;if(!c[d])return setTimeout(function(){F(a,b)},0);f=c.createElement("script"),f.async=!0,e={f:a,c:b,e:0,s:f},k.push(e),f.onreadystatechange=f.onload=function(a){s.isDefined(b)&&(e.s.onload=e.s.onreadystatechange=null,e.s.onerror=null,k.splice(k.indexOf(e),1))},f.onerror=function(a){throw e.s.onerror=null,k.splice(k.indexOf(e),1),Error(e.c+" failed to load. Attempted to load from file: "+e.f)},f.src=a,c[d].appendChild(f)},G=function(a){h.push(a);for(var b=0;b-1&&(f=s,h.splice(0,1));for(g=0;g0&&(m.__dependencies=y(m.__dependencies,j,!0),s.require(j));if(s.isDefined(m)&&m.prototype){var n=m.prototype;n.__nsID=a,n.__ns=f,n.__class=k,j.length>0&&(n.__dependencies=y(n.__dependencies,j,!0))}f[k]=m}}return f};return s.configure=function(a){a=a||{},e=a.classPath||e,e=e.lastIndexOf("/")===e.length-1?e:e+"/",d=a.separator||d,f=a.fileSuffix||f;if(a.paths)for(var b=0;b-1;a=c?a.replace(".*",""):a;var g=e+a.replace(RegExp("\\"+d,"g"),"/")+(c?"":".js")+(f?"?"+f:"");return g},s.isDefined=function(a){return a=!u(a)&&!w(a)?H(a,!1):a,a?a.__isDefined:!1},s.extend=function(a,b){return s.isDefined(a)?b=s.get(a).__extend(b):b.__toExtend=!0,b.__extendedFrom=a,b},s.provides=function(a,c){c=x(c);for(var d=0;d0){var j={f:c,c:d,cb:b};setTimeout(function(){G(j)},0)}else b&&b.apply(p,s.get(a))},s.use=function(a,b){a=a||[],a=x(a),b=b||q,b===q&&s.unuse();var c,e,f,g,h;for(c=0;c-1&&c-1)if(this._pendingNotificationNames.indexOf(b)>-1){var e=this._removeQueue[b]=this._removeQueue[b]||[];e.push(a)}else this._interests[b].splice(d,1)},publish:function(a,b,c,d){a instanceof this.__imports.Notification||(a=new this.__imports.Notification(a,b,d),a.status=1,a.pointer=0,a.dispatcher=c);var e=a.name;this._interests[e]&&(this._pendingNotifications.push(a),this._pendingNotificationNames.push(e),this._notifyObjects(a))},_notifyObjects:function(a){var b=a.name;while(a.pointer-1&&this._notifyObjects(a)},cancelNotification:function(a){if(a){var b=a.name;this._pendingNotifications.splice(this._pendingNotifications.indexOf(a),1),a.status=0;if(this._removeQueue[b]){for(var c=0;cthis.
- *
- * @returns {Number} A timeout ID
*/
setTimeout : function(func, delay){
return setTimeout(this.proxy(func), delay);
@@ -36,18 +32,14 @@
/**
* Local version of window.setInterval that keeps scope of this.
- *
- * @returns {Number} An interval ID
*/
setInterval : function(func, delay){
return setInterval(this.proxy(func), delay);
},
/**
- * Shorthand for func.bind(this)
- * or rather, $.proxy(func, this) in jQuery terms
- *
- * @returns {Function} The proxied function
+ * Shorthand for func.bind(this)
+ * or rather, $.proxy(func, this) in jQuery terms
*/
proxy : function(func){
var bind = function (context) {
@@ -63,10 +55,6 @@
/**
* Subscribes to a notification.
- *
- * @public
- * @param {String} name The name of the Notification you are subscribing to.
- * @param {Function} handler A function to be called upon receiving the given Notification.
*/
subscribe : function(name, handler, priority){
@@ -81,9 +69,6 @@
/**
* Unsubscribes from a notification.
- *
- * @public
- * @param {String} name The name of the Notification you are unsubscribing from.
*/
unsubscribe : function(name){
@@ -109,17 +94,12 @@
/**
* Publishes a notification with the specified data.
- *
- * @param {String} name The name of the Notification you are publishing.
- * @param {Object} data An object of data you want to send with the Notification.
- * @param {Function} callback A callback function to be invoked if Notification.respond() is called
*/
publish : function(name, data, callback){
minion.publish(name, data, this, callback);
},
- /** @ignore */
handleNotification : function(n){
var handler = this._interestHandlers[n.name];
if(handler){
diff --git a/src/minion.header.js b/lib/minion.header.js
similarity index 69%
rename from src/minion.header.js
rename to lib/minion.header.js
index e99df3a..735589f 100644
--- a/src/minion.header.js
+++ b/lib/minion.header.js
@@ -2,7 +2,7 @@
* minion.JS v@VERSION
* http://minion.org
*
- * (c) 2011, Taka Kojima
+ * (c) 2012, Taka Kojima (taka@gigafied.com)
* Licensed under the MIT License
*
* Date: @DATE
diff --git a/lib/minion.js b/lib/minion.js
new file mode 100644
index 0000000..a08e7dd
--- /dev/null
+++ b/lib/minion.js
@@ -0,0 +1,16 @@
+/*
+ Yes, we're assigning "minion" as a global var. Deal with it, it solves more issues than it creates doing it this way.
+ The reason being, as a huge part of Minion is working in the browser, minion is a global var in the browser.
+ Thus, it carries over into node.js.
+*/
+
+module.exports = minion = require("./minion.main.js");
+
+require("./minion.baseclass.js");
+require("./minion.class.js");
+require("./minion.singleton.js");
+require("./minion.static.js");
+require("./minion.notifications.js");
+require("./minion.node.js");
+
+minion.build();
\ No newline at end of file
diff --git a/src/minion.main.js b/lib/minion.main.js
similarity index 79%
rename from src/minion.main.js
rename to lib/minion.main.js
index b66dfd0..f134efa 100755
--- a/src/minion.main.js
+++ b/lib/minion.main.js
@@ -34,6 +34,8 @@ THE SOFTWARE.
TODO:
- Multiple inheritance
- Independent library support, i.e. ability to do minion.require("minion.libs.jquery") to load jquery
+ - AMD Compliant?
+ - minion.provides("namespace.*");
- __preDefine method on Classes, takes 1 argument, a callback that gets called once __preDefine does all it needs to do
*/
@@ -86,40 +88,30 @@ var minion = (function (root) {
var _ns = {};
var _errorTimeout = 1e4;
- /**
- * @exports _minion as minion
- * @class
- */
var _minion = {};
/*================= HELPER FUNCTIONS =================*/
- /** @private */
var _isArray = Array._isArray || function (a) {
return a instanceof Array;
};
- /** @private */
var _isObject = function (obj) {
return typeof obj === "object";
};
- /** @private */
var _isString = function (s) {
return typeof s === 'string' || s instanceof String;
};
- /** @private */
var _isFunction = function (fn) {
return typeof fn === "function";
};
- /** @private */
var _strToArray = function (s) {
return (!_isArray(s)) ? [s] : s;
};
- /** @private */
var _concatArray = function (a, b, forceUnique) {
b = b || [];
if(!forceUnique){
@@ -139,7 +131,6 @@ var minion = (function (root) {
return b;
};
- /** @private */
var _copyToNS = function(o1,o2){
for (var i in o1) {
if(o1.hasOwnProperty(i)){
@@ -148,7 +139,6 @@ var minion = (function (root) {
}
};
- /** @private */
var _removeFromNS = function(o1,o2){
for (var i in o1) {
if(o1.hasOwnProperty(i)){
@@ -160,7 +150,7 @@ var minion = (function (root) {
// Recursively checks dependencies
- /** @private */
+
var _areDependenciesLoaded = function (o) {
o = _minion.get(o, false);
var i;
@@ -178,7 +168,7 @@ var minion = (function (root) {
return true;
};
- /** @private */
+
var _checkLoadQueue = function () {
var i, j, q, dependenciesLoaded, classes, classesArray;
q = {};
@@ -206,7 +196,7 @@ var minion = (function (root) {
}
};
- /** @private */
+
var _checkExtendQueue = function () {
var eq = _extendQueue;
var i, superClass, ns, id;
@@ -235,7 +225,7 @@ var minion = (function (root) {
_checkLoadQueue();
};
- /** @private */
+
var _checkWaitQueue = function () {
var w = _waitingForLoad;
@@ -265,10 +255,6 @@ var minion = (function (root) {
/**
* Injects a Script tag into the DOM
- *
- * @param f The path of the file to inject.
- * @param c The class which maps to the file we are injecting.
- * @private
*/
var _inject = function(f, c) {
@@ -296,7 +282,6 @@ var minion = (function (root) {
_waitingForLoad.push(injectObj);
- /** @ignore */
script.onreadystatechange = /** @ignore */ script.onload = function (e) {
if (_minion.isDefined(c)) {
injectObj.s.onload = injectObj.s.onreadystatechange = null;
@@ -305,7 +290,6 @@ var minion = (function (root) {
}
};
- /** @ignore */
script.onerror = function (e) {
injectObj.s.onerror = null;
_waitingForLoad.splice(_waitingForLoad.indexOf(injectObj), 1);
@@ -320,9 +304,6 @@ var minion = (function (root) {
/**
* Does all the loading of JS files
- *
- * @param q The queue to be loaded
- * @private
*/
var _load = function (q) {
@@ -349,12 +330,6 @@ var minion = (function (root) {
/**
* Used by minion.get() and minion.define().
* Get the namespace/Class, or creates it if it does not exist. Also optionally creates Objects in the specified namepsace.
- *
- * @param {String|Object}id The fully qualified namespace.
- * @param {Boolean} autoCreate Whether or not to create a blank object if the namespace does not yet exist.
- * @param {Object} [definitions] An object of class definitions which will be added to the namespace.
- * @returns {Object} The object that represents the fully qualified namespace passed in as the first argument.
- * @private
*/
var _namespace = function (id, autoCreate, definitions) {
@@ -449,9 +424,6 @@ var minion = (function (root) {
/**
* Configure minion.
- *
- * @public
- * @param {Object} configObj Configuration object, possible properties are : classPath, separator and fileSuffix
*/
_minion.configure = function (configObj) {
@@ -476,9 +448,6 @@ var minion = (function (root) {
/**
* Alias minion under a different namespace. I.e. var woot = minion.alias("woot");
- *
- * @public
- * @param {String} alias The name of the namespace to alias minion under.
*/
_minion.alias = function (alias) {
@@ -488,10 +457,6 @@ var minion = (function (root) {
/**
* Gets the object by it's fully qualified identifier.
- *
- * @public
- * @param {String} id The identifier to get
- * @returns {Object|Boolean} The object that represents the identifier or false if it has not yet been defined.
*/
_minion.get = function (id) {
@@ -514,11 +479,6 @@ var minion = (function (root) {
/**
* Defines Classes under the given namespace.
- *
- * @public
- * @param {String} id The namespace to define the Classes under.
- * @param {Object} [definitions] An object of class definitions which will be added to the namespace
- * @returns {Object} The object that represents the namespace passed in as the first argument.
*/
_minion.define = function (id, definitions) {
var r = _namespace(id, true, definitions);
@@ -528,10 +488,6 @@ var minion = (function (root) {
/**
* Gets the URL for a given identifier.
- *
- * @public
- * @param {String} id The fully qualified name to look up.
- * @returns {String} The URL of the file that maps to the fully qualified name.
*/
_minion.getURL = function (id) {
@@ -548,12 +504,8 @@ var minion = (function (root) {
};
/**
- * Checks to see whether the given fully qualified name or Object is defined as a minion class. (Checks for .__isDefined)
+ * Checks to see whether the given fully qualified name or Object is defined as a minion class. (Checks for .__isDefined)
* NOTE: Classes that have not yet loaded all of their dependencies, will return FALSE for this check.
- *
- * @public
- * @param {String|Object} id The fully qualfied class name, or an Object.
- * @returns {Boolean} Whether or not this is defined.
*/
_minion.isDefined = function (id) {
@@ -563,11 +515,6 @@ var minion = (function (root) {
/**
* Extends a given class asynchronously.
- *
- * @public
- * @param {String} id The fully qualified name of the Class you want to extend.
- * @param {Object} obj A new Class Object
- * @returns {Object} The extended Class, or, if still waiting on dependencies, the original Object with a few more properties for internal minion use.
*/
_minion.extend = function (id, obj) {
@@ -588,10 +535,6 @@ var minion = (function (root) {
/**
* Tells minion that filePath provides the class definitions for these classes.
* Useful in cases where you group specific things into minfiied js files.
- *
- * @public
- * @param {String} file The path of a JS file.
- * @param {String|Array} definitions Fully qualfiied name(s) of class(es)
*/
_minion.provides = function (file, definitions) {
@@ -610,10 +553,6 @@ var minion = (function (root) {
/**
* Asyncrhonously loads in js files for the classes specified.
* If the classes have already been loaded, or are already defined, the callback function is invoked immediately.
- *
- * @public
- * @param {String|Array} ids The fully qualified name(s) of the class(es) to load.
- * @param {Function} callback The function to call once all classes (and their dependencies) have been loaded.
*/
_minion.require = function (ids, callback) {
@@ -664,11 +603,6 @@ var minion = (function (root) {
*
* Identifiers can contain the* wildcard character as its last segment (eg: test.*)
* which will import all Classes under the given namespace.
- *
- * @public
- * @param {String|Array} ids The fully qualfiied name(s) to import into the global namespace.
- * @param {Object=[root]} The scope to use.
- * @returns {Object} Returns the object passed in as the second argument, with the classes passed in as the first argument as properties.
*/
_minion.use = function (ids, scope) {
@@ -711,38 +645,38 @@ var minion = (function (root) {
return scope;
};
- /** @private */
+
_minion.enableNotifications = function () {
if (_minion.isDefined("minion.NotificationManager")) {
if (!_notificationManager) {
_notificationManager = new (minion.get("minion.NotificationManager"))();
- /** @private */
+
_minion.subscribe = function () {
_notificationManager.subscribe.apply(_notificationManager, arguments);
};
- /** @private */
+
_minion.unsubscribe = function () {
_notificationManager.unsubscribe.apply(_notificationManager, arguments);
};
- /** @private */
+
_minion.publish = function () {
_notificationManager.publish.apply(_notificationManager, arguments);
};
- /** @private */
+
_minion.holdNotification = function () {
_notificationManager.holdNotification.apply(_notificationManager, arguments);
};
- /** @private */
+
_minion.releaseNotification = function () {
_notificationManager.releaseNotification.apply(_notificationManager, arguments);
};
- /** @private */
+
_minion.cancelNotification = function () {
_notificationManager.cancelNotification.apply(_notificationManager, arguments);
};
diff --git a/lib/minion.node.js b/lib/minion.node.js
new file mode 100644
index 0000000..d6b2757
--- /dev/null
+++ b/lib/minion.node.js
@@ -0,0 +1,12 @@
+/*
+ Only included in the node.js version of minion. Provides the build() + watch() methods.
+ Can be called programatically or via the cli `minion build [options]`
+*/
+
+minion.build = function (opts, cb) {
+
+}
+
+minion.watch = function (opts, cb) {
+
+}
\ No newline at end of file
diff --git a/src/minion.notifications.js b/lib/minion.notifications.js
similarity index 90%
rename from src/minion.notifications.js
rename to lib/minion.notifications.js
index 92c326b..2f7f72d 100644
--- a/src/minion.notifications.js
+++ b/lib/minion.notifications.js
@@ -4,8 +4,6 @@
minion.define("minion", {
- /** @lends minion.Notification# */
-
Notification : minion.extend("minion.Class", {
data : {},
@@ -19,11 +17,6 @@
*
* Notifications are the backbone of Minion's pub/sub model.
* You should not have to construct Notification's directly, as the publish() method does this for you.
- *
- * @constructs
- * @param {String} name The name of the Notification.
- * @param {Object} data An object of data associated with the Notification.
- * @param {Function} callback A callback function. This gets invoked by calling Notification.respond();
*/
init : function(name, data, callback) {
this.name = name;
@@ -34,18 +27,13 @@
/**
*
* Holds a notification. Useful if you want to do other things before other instances receive this Notification,
- *
- * @public
*/
hold : function() {
this.status = 2;
},
/**
- *
* Releases a Notification, call this at some point after hold();
- *
- * @public
*/
release : function() {
@@ -54,10 +42,7 @@
},
/**
- *
* Cancels a Notification, any instances interested in this Notification higher up the chain will not receive it.
- *
- * @public
*/
cancel : function() {
@@ -72,11 +57,7 @@
},
/**
- *
* Dispatches a Notification. You will rarely ever construct or call dispatch() on Notifications directly, as the publish() method handles all of this.
- *
- * @param {Object} obj An Object referencing what is dispatching this Notification.
- * @public
*/
dispatch : function(obj) {
@@ -109,7 +90,6 @@
/*
This Class handles all the nitty gritty Notification stuff.
- TODO: Be nice and add some comments for other people :)
*/
require : [
diff --git a/src/minion.singleton.js b/lib/minion.singleton.js
similarity index 79%
rename from src/minion.singleton.js
rename to lib/minion.singleton.js
index dc2559b..56c8bc5 100644
--- a/src/minion.singleton.js
+++ b/lib/minion.singleton.js
@@ -1,25 +1,18 @@
- (function(){
+(function(){
"use strict";
minion.define("minion", {
- /** @lends minion.Singleton# */
-
Singleton : minion.extend("minion.Class", {
/**
- *
* A way to easily implement Singletons.
- *
- * @constructs
- * @extends minion.Class
*/
init : function(){
},
- /** @ignore */
__preInit : function(){
if(this.constructor.__instance){
return this.constructor.__instance;
@@ -31,18 +24,14 @@
return this.constructor.__instance;
},
- /** @ignore */
__static : {
- /** @lends minion.Singleton# */
__isSingleton: true,
/**
*
* Returns the instance of this Singleton. If this Class has not yet been instantiated, creates a new instance and returns that.
* Otherwise, it returns the already existing reference.
- *
- * @memberOf minion.Singleton#
*/
getInstance : function(){
if(!this.__instance){
diff --git a/src/minion.static.js b/lib/minion.static.js
similarity index 74%
rename from src/minion.static.js
rename to lib/minion.static.js
index 25c1423..647f2a1 100644
--- a/src/minion.static.js
+++ b/lib/minion.static.js
@@ -4,8 +4,6 @@
minion.define("minion", {
- /** @lends minion.Static# */
-
Static : minion.extend("minion.Singleton", {
__static : {
@@ -15,11 +13,7 @@
},
/**
- *
* A way to easily implement Static Classes.
- *
- * @constructs
- * @extends minion.Singleton
*/
init : function(){
diff --git a/lib/version.txt b/lib/version.txt
new file mode 100644
index 0000000..e1df5de
--- /dev/null
+++ b/lib/version.txt
@@ -0,0 +1 @@
+1.4.4
\ No newline at end of file
diff --git a/package.json b/package.json
index 94ea0ce..a2092c7 100644
--- a/package.json
+++ b/package.json
@@ -2,11 +2,12 @@
"name": "minion",
"version": "1.4.4",
"description": "Cross-Platform & Cross-Browser JavaScript Inheritance.",
- "main": "./bin/minion.js",
+ "main": "./lib/minion.js",
"directories": {
"lib": "lib",
"test": "test",
- "examples": "examples",
+ "docs": "docs",
+ "dist": "dist",
"bin": "bin"
},
"bin": {
@@ -14,10 +15,11 @@
},
"dependencies": {
"optimist": "0.3.x",
+ "ansi-color": "0.2.x"
+ },
+ "devDependencies" : {
"uglify-js": "1.2.x",
- "jsdoc-toolkit": "0.0.x",
- "ansi-color": "0.2.x",
- "jshint": "0.5.x"
+ "jshint": "0.5.x"
},
"repository": {
"type": "git",
diff --git a/readme.md b/readme.md
index f0e6706..f231de3 100755
--- a/readme.md
+++ b/readme.md
@@ -1,13 +1,6 @@
## MinionJS - Cross-Platform & Cross-Browser JavaScript Classical Inheritance
-The goal of MinionJS is to provide easy-to-use, easy-to-learn classical inheritance for JavaScript.
-
-MinionJS enables you to easily namespace, create and extend custom classes.
-
-MinionJS handles all the nitty-gritty, so you can focus on the important stuff, like ironing out the final details of your plan for global domination.
-
-## Examples
-
+MinionJS provides easy-to-use, easy-to-learn classical inheritance for JavaScript. Easily namespace, create and extend custom classes!
#### Defining a Class:
@@ -41,9 +34,12 @@ MinionJS handles all the nitty-gritty, so you can focus on the important stuff,
})
-That's the core of Minion, it's that simple. There's a bit more you can do obviously, but we wanted to give you an idea of
-what you can do with MinionJS in under 20 lines of code. See [Getting Started](https://github.com/gigafied/minion/blob/master/getting_started.md) to dive in deeper.
+That's the core of Minion, it's that simple.
+## Getting Started
+
+https://github.com/gigafied/minion/blob/master/docs/getting_started.md
+n/docs/
####Videos:
- [Overview](http://www.screenr.com/wOas)
@@ -62,7 +58,7 @@ what you can do with MinionJS in under 20 lines of code. See [Getting Started](h
- MinionJS does all this, all while sporting a tiny footprint of 3.8k (minified and gzipped).
-#### Currently Supported:
+####Currently Supported:
- Node.js
- IE 7+
@@ -84,24 +80,6 @@ what you can do with MinionJS in under 20 lines of code. See [Getting Started](h
- MinionJS does not touch native JavaScript prototypes. I.E. no Object.prototype.someSuperAwesomeMethod___weThink();
- Damage Control. No global pollution (by default). All classes reside under the minion namespace. This is good, trust us.
-
-## Getting Started
-
-https://github.com/gigafied/minion/blob/master/getting_started.md
-
-## Documentation
-
-JSDocs available at: http://gigafied.github.com/minion/docs/
-
-
-## Contributing
-
-We want you to contribute. Fork the project, issue a pull request. Ideally, if you are adressing a specific issue, please create an issue in GitHub and reference that issue in your commits.
-Write a Unit Test for your fix, so that we can be sure any future updates don't undo all your hard work :)
-
-We'd love to support more platforms. There is very, very little platform detection in Minion's source code. (This is a good thing, we want to keep it this way).
-Getting it to work on other platforms should be relatively simple, so feel free to lend a hand!
-
## License
(c) 2011 Taka Kojima (the "Author").
diff --git a/src/jsdoc-conf.json b/src/jsdoc-conf.json
deleted file mode 100644
index 33da7fe..0000000
--- a/src/jsdoc-conf.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- // source files to use
- _: [
- 'bin/minion.js'
- ],
-
- // document all functions, even uncommented ones
- a: true,
-
- // including those marked @private
- p: false,
-
- // some extra variables I want to include
- D: {
- "author": "Taka Kojima (taka.kojima@ff0000.com)",
- "name": "minion",
- "homepage": "https://github.com/gigafied/minion",
- "repository": "git@github.com:gigafied/minion.git",
- "noGlobal": "true"
- },
-
- // use this directory as the output directory
- d: "gh-pages/docs",
-
- // use this template
- t: "src/minion-jsdoc-template"
-}
diff --git a/src/minion-jsdoc-template/README.md b/src/minion-jsdoc-template/README.md
deleted file mode 100755
index 6f5f204..0000000
--- a/src/minion-jsdoc-template/README.md
+++ /dev/null
@@ -1,191 +0,0 @@
-WARNING: this template is still under development and it might change every so
-often.
-
-jsdoc-simple
-============
-
-jsdoc-simple is a modified jsdoc toolkit (Version 2) template with support for
-additional documentation.
-
-## Features ##
-
-- Very simple and readable layout.
-- Support for additional files and resources.
-- Scripts and CSS-Files in additional Resource files will be copied.
- automatically. So one can develop and test examples indiviually and easily
- create a self contained documentation.
-- Support for Markdown Resource files.
-- Markdown processing for Class-, Method-, Property-, Event-descriptions.
-- Dynamically filterable (using regular expressions) symbol index.
-- 'cssFile' user-defined option that allows the use of a different css file for
- the documentation's styling.
-
-An example javascript library using jsdoc-simple can be found at: [http://github.com/urso/qc.js](http://github.com/urso/qc.js)
-
-[Screenshots](http://github.com/urso/jsdoc-simple/wiki/Screenshots)
-
-## Install ##
-
-The whole template directory must be copied as is into jsdoc's template
-directory.
-
-## Usage ##
-
-In order to use 'jsdoc-simple' you have to tell jsdoc toolkit to use it via
-the '-t' flag when calling jsdoc or prepare a jsdoc toolkit configuration file
-with option 't:' set to the template's directory.
-
-### Static Documentation ###
-
-You also may want to add some static documentation to the generated
-documentation. To do so create a jsdoc toolkit configuration file and add the
-option 'docs:' with the field 'content' being an array of files to add and
-the optional field 'preprocess'.
-
-Every Entry in the 'content' array MUST be an object having the fields 'src'
-and 'title' plus the optional field 'preprocess'.
-
-The 'preprocess' field MUST be a shell command to be execute on the 'src'
-file. It is assumed that the command will read the file's content from stdin
-and print its outcome to stdout.
-
-For example this will add the files intro.pdc and tutorial.pdc to the
-documentation, which are preprocessed using pandoc (Haskell based markdown
-program) :
-
- {
- d: 'docs', // output directory 'docs'
- a: false, // do not show all symbols
- docs: {
- preprocess: 'pandoc', // preprocess all files with pandoc
- content: [ {src:'docsrc/intro.pdc',
- title: 'Introduction' },
- {src:'docsrc/tutorial.pdc',
- title: 'Tutorial'}
- ]
- }
- }
-
-In the following example only the file intro.pdc is preprocessed using pandoc:
-
- {
- d: 'docs', // output directory 'docs'
- a: false, // do not show all symbols
- docs: {
- content: [ {src:'docsrc/intro.pdc',
- preprocess: 'pandoc', // preprocess only this file with pandoc
- title: 'Introduction' },
- {src:'docsrc/tutorial.html',
- title: 'Tutorial'}
- ]
- }
- }
-
-When using a global preprocessor for all documentations and a local one for a
-file, the latter one is chosen for that file only whereas all others are
-preprocessed using the former one.
-
-Creating the documentation then will be as easy as (with \*nix shell):
-
- $ run.sh -c='jsdoc.conf' -t="$JSDOCDIR/templates/jsdoc-simple" src
-
-### Choosing a different default CSS file ###
-
-jsdoc-simple gives you the ability to modify the CSS file that is used to style
-the generated documentation. By default, the default.css file found within the
-static folder is used. To use a different CSS file, you MUST add the desired
-css file to the jsdoc-simple static folder and then define the 'cssFile' option
-in one of two ways:
-
-On the command line:
-
- run.sh -c='jsdoc.conf' -t="$JSDOCDIR/templates/jsdoc-simple" -D="cssFile:myCssFile.css"
-
-In a configuration file:
-
- {
- d: 'docs', // output directory 'docs'
- a: false, // do not show all symbols
- D: {
- cssFile: 'myCssFile.css'
- }
- }
-
-**NOTE:** The value for 'cssFile' should be given without any path prefix as
-it's value is already rooted within the static folder.
-
-## Handling additional Resources ##
-
-When supplying further documentation to add to the final document you may want
-to add further resources like images, css files or even script files for
-showcasing. To do so, the 'docs' field in the jsdoc configuration file
-supports a 'resources' field, which must be an Array of File and Directory
-paths to copy.
-
-For example:
-
- {
- d: 'docs', // output directory 'docs'
- a: false, // do not show all symbols
- docs: {
- resources: ['docsrc/images'],
- content: [ {src:'docsrc/intro.html',
- title: 'Introduction' },
- {src:'docsrc/tutorial.html',
- title: 'Tutorial'}
- ]
- }
- }
-
-If the additional documentation sports a valid html file with header and body,
-this file will be processed as follows:
-
-- get body-Element of the file and copy its inner content to the final output
- file
-
-- get header-Element and analyze tags:
- - for every 'script' or 'link' tag the src/href attribute is
- adjusted to the file the source was copied to
- - for every 'script' or 'link' tag all files named in the src/href
- attribute are automatically copied to the documentation directory
- - automatically adjust path of output copied resources if needed
- - copy html header into template
-
-Thus when writing JavaScript libraries for example you may showcase using the
-relative path to your source file directory and still test it without
-rebuilding the documentation. When building the documentation your library
-will be copied then into the final output, such that your examples will still
-work and the whole documentation is self contained and can be redistributed
-without the original sources.
-
-Furthermore if a markdown file is given (any file ending with .mk or .markdown)
-but no preprocessor, the file is automatically converted to html.
-
-## Using the Symbol Index ##
-
-The Symbol index page features a text field used for filtering. When filtering
-the content of this text field is interpreted as a regular expression. Thus
-typing the expression "a|b|c" will find all symbols starting with a or b or c.
-Furthermore the regular expression is interpreted to be case insensitive. But
-if you have symbolic names using special characters like '$' proper escaping
-is needed. Meaning that if you want to filter all symbols starting with '$'
-you have to type "\$".
-
-## Credits ##
-
-- JavaScript HTML Parser:
- HTML Parser By John Resig (ejohn.org)
- Original code by Erik Arvidsson, Mozilla Public License
- http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
-
-- [MooTools 1.2.4 Server](http://mootools.net/developers/):
- authors: The MooTools production team
-
-- [JSDom](http://github.com/urso/jsdom):
- JavaScript DOM duck typing classes for non browser environments
-
-- [Showdown](http://attacklab.net/showdown/):
- Markdown for JavaScript
-
-- [cssFile option functionality](https://github.com/cobhimself): Collin
- Brooks
diff --git a/src/minion-jsdoc-template/allclasses.tmpl b/src/minion-jsdoc-template/allclasses.tmpl
deleted file mode 100755
index d932b82..0000000
--- a/src/minion-jsdoc-template/allclasses.tmpl
+++ /dev/null
@@ -1,17 +0,0 @@
-
-