Comparing version 2.2.1 to 2.2.2
/*! | ||
* OOjs v2.2.1 optimised for jQuery | ||
* OOjs v2.2.2 optimised for jQuery | ||
* https://www.mediawiki.org/wiki/OOjs | ||
@@ -9,3 +9,3 @@ * | ||
* | ||
* Date: 2018-06-14T17:19:33Z | ||
* Date: 2018-06-14T20:13:14Z | ||
*/ | ||
@@ -12,0 +12,0 @@ ( function ( global ) { |
@@ -1,3 +0,3 @@ | ||
/*! OOjs v2.2.1 | https://oojs.mit-license.org */ | ||
/*! OOjs v2.2.2 | https://oojs.mit-license.org */ | ||
!function(t){"use strict";var c={},a=c.hasOwnProperty;c.toString;function r(t,e,r){var i,n,o={},s=[];for(i=0,n=e.length;i<n;i++)o[e[i]]=!0;for(i=0,n=t.length;i<n;i++)!!o[t[i]]===r&&s.push(t[i]);return s}c.initClass=function(t){t.static=t.static||{}},c.inheritClass=function(t,e){var r;if(!e)throw new Error("inheritClass: Origin is not a function (actually "+e+")");if(t.prototype instanceof e)throw new Error("inheritClass: Target already inherits from origin");r=t.prototype.constructor,t.super=t.parent=e,t.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c.initClass(e),t.static=Object.create(e.static)},c.mixinClass=function(t,e){var r;if(!e)throw new Error("mixinClass: Origin is not a function (actually "+e+")");for(r in e.prototype)"constructor"!==r&&a.call(e.prototype,r)&&(t.prototype[r]=e.prototype[r]);if(c.initClass(t),e.static)for(r in e.static)a.call(e.static,r)&&(t.static[r]=e.static[r]);else c.initClass(e)},c.isSubclass=function(t,e){return t===e||t.prototype instanceof e},c.getProp=function(t){var e,r=t;for(e=1;e<arguments.length;e++){if(null==r)return;r=r[arguments[e]]}return r},c.setProp=function(t){var e,r=t;if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-2;e++){if(void 0===r[arguments[e]]&&(r[arguments[e]]={}),Object(r[arguments[e]])!==r[arguments[e]])return;r=r[arguments[e]]}r[arguments[arguments.length-2]]=arguments[arguments.length-1]}},c.deleteProp=function(t){var e,r=t,i=[r];if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-1;e++){if(void 0===r[arguments[e]]||Object(r[arguments[e]])!==r[arguments[e]])return;r=r[arguments[e]],i.push(r)}for(delete r[arguments[e]];1<i.length&&(r=i.pop())&&c.isPlainObject(r)&&!Object.keys(r).length;)delete i[i.length-1][arguments[i.length]]}},c.cloneObject=function(t){var e,r;for(e in r=Object.create(t.constructor.prototype),t)a.call(t,e)&&(r[e]=t[e]);return r},c.getObjectValues=function(t){var e,r;if(t!==Object(t))throw new TypeError("Called on non-object");for(e in r=[],t)a.call(t,e)&&(r[r.length]=t[e]);return r},c.binarySearch=function(t,e,r){for(var i,n,o=0,s=t.length;o<s;)if((n=e(t[i=o+s>>1]))<0)s=i;else{if(!(0<n))return i;o=i+1}return r?s:null},c.compare=function(t,e,r){var i,n,o,s;if(t===e)return!0;if(e=e||{},"number"==typeof(t=t||{}).nodeType&&"function"==typeof t.isEqualNode)return t.isEqualNode(e);for(s in t)if(a.call(t,s)&&void 0!==t[s]&&t[s]!==e[s]&&((o=typeof(i=t[s]))!==typeof(n=e[s])||("string"===o||"number"===o||"boolean"===o)&&i!==n||i===Object(i)&&!c.compare(i,n,!0)))return!1;return!!r||c.compare(e,t,!0)},c.copy=function(t,e,r){var i,n;if(r&&void 0!==(n=r(t)))return n;if(Array.isArray(t))n=new Array(t.length);else{if(t&&"function"==typeof t.clone)return e?e(t.clone()):t.clone();if(t&&"function"==typeof t.cloneNode)return e?e(t.cloneNode(!0)):t.cloneNode(!0);if(!c.isPlainObject(t))return e?e(t):t;n={}}for(i in t)n[i]=c.copy(t[i],e,r);return n},c.getHash=function(t){return JSON.stringify(t,c.getHash.keySortReplacer)},c.getHash.keySortReplacer=function(t,e){var r,i,n,o;if(e&&"function"==typeof e.getHashObject&&(e=e.getHashObject()),Array.isArray(e)||Object(e)!==e)return e;for(r={},n=0,o=(i=Object.keys(e).sort()).length;n<o;n+=1)r[i[n]]=e[i[n]];return r},c.unique=function(t){return t.reduce(function(t,e){return-1===t.indexOf(e)&&t.push(e),t},[])},c.simpleArrayUnion=function(){var t,e,r,i,n,o={},s=[];for(t=0,e=arguments.length;t<e;t++)for(i=0,n=(r=arguments[t]).length;i<n;i++)o[r[i]]||(o[r[i]]=!0,s.push(r[i]));return s},c.simpleArrayIntersection=function(t,e){return r(t,e,!0)},c.simpleArrayDifference=function(t,e){return r(t,e,!1)},c.isPlainObject=$.isPlainObject,function(){function o(t,e){if("string"==typeof t){if(null==e)throw new Error('Method name "'+t+'" has no context.');if("function"!=typeof e[t])throw new Error('Property "'+t+'" is not a function')}else if("function"!=typeof t)throw new Error("Invalid callback. Function or method name expected.")}function n(t,e,r){(a.call(t.bindings,e)?t.bindings[e]:t.bindings[e]=[]).push(r)}c.EventEmitter=function(){this.bindings={}},c.initClass(c.EventEmitter),c.EventEmitter.prototype.on=function(t,e,r,i){return o(e,i),n(this,t,{method:e,args:r,context:arguments.length<4?null:i,once:!1}),this},c.EventEmitter.prototype.once=function(t,e){return o(e),n(this,t,{method:e,args:void 0,context:null,once:!0}),this},c.EventEmitter.prototype.off=function(t,e,r){var i,n;if(1===arguments.length)return delete this.bindings[t],this;if(o(e,r),!a.call(this.bindings,t)||!this.bindings[t].length)return this;for(arguments.length<3&&(r=null),i=(n=this.bindings[t]).length;i--;)n[i].method===e&&n[i].context===r&&n.splice(i,1);return 0===n.length&&delete this.bindings[t],this},c.EventEmitter.prototype.emit=function(t){var e,r,i,n,o,s=[];if(a.call(this.bindings,t)){for(n=this.bindings[t].slice(),e=1,r=arguments.length;e<r;e++)s.push(arguments[e]);for(e=0,r=n.length;e<r;e++)o="string"==typeof(i=n[e]).method?i.context[i.method]:i.method,i.once&&this.off(t,o),o.apply(i.context,i.args?i.args.concat(s):s);return!0}return!1},c.EventEmitter.prototype.connect=function(t,e){var r,i,n;for(n in e)r=e[n],Array.isArray(r)?(i=r.slice(1),r=r[0]):i=[],this.on(n,r,i,t);return this},c.EventEmitter.prototype.disconnect=function(t,e){var r,i,n,o;if(e)for(i in e)n=e[i],Array.isArray(n)&&(n=n[0]),this.off(i,n,t);else for(i in this.bindings)for(r=(o=this.bindings[i]).length;r--;)o[r]&&o[r].context===t&&this.off(i,o[r].method,t);return this}}(),function(){function n(t,e){return void 0===e||e<0||e>=t.length?t.length:e}c.EmitterList=function(){this.items=[],this.aggregateItemEvents={}},c.EmitterList.prototype.getItems=function(){return this.items.slice(0)},c.EmitterList.prototype.getItemIndex=function(t){return this.items.indexOf(t)},c.EmitterList.prototype.getItemCount=function(){return this.items.length},c.EmitterList.prototype.isEmpty=function(){return!this.items.length},c.EmitterList.prototype.aggregate=function(t){var e,r,i,n,o,s;for(o in t){if(s=t[o],Object.prototype.hasOwnProperty.call(this.aggregateItemEvents,o)){if(s)throw new Error("Duplicate item event aggregation for "+o);for(e=0;e<this.items.length;e++)(r=this.items[e]).connect&&r.disconnect&&((n={})[o]=["emit",this.aggregateItemEvents[o],r],r.disconnect(this,n));delete this.aggregateItemEvents[o]}if(s)for(this.aggregateItemEvents[o]=s,e=0;e<this.items.length;e++)(r=this.items[e]).connect&&r.disconnect&&((i={})[o]=["emit",s,r],r.connect(this,i))}},c.EmitterList.prototype.addItems=function(t,e){var r,i;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=n(this.items,e),r=0;r<t.length;r++)-1!==(i=this.items.indexOf(t[r]))?(e=this.moveItem(t[r],e),this.emit("move",t[r],e,i)):(e=this.insertItem(t[r],e),this.emit("add",t[r],e)),e++;return this},c.EmitterList.prototype.moveItem=function(t,e){var r=this.items.indexOf(t);if(-1===r)throw new Error("Item cannot be moved, because it is not in the list.");return e=n(this.items,e),this.items.splice(r,1),r<e&&e--,this.items.splice(e,0,t),e},c.EmitterList.prototype.insertItem=function(t,e){var r,i;if(t.connect&&t.disconnect){for(i in r={},this.aggregateItemEvents)r[i]=["emit",this.aggregateItemEvents[i],t];t.connect(this,r)}return e=n(this.items,e),this.items.splice(e,0,t),e},c.EmitterList.prototype.removeItems=function(t){var e,r,i;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=0;e<t.length;e++)r=t[e],-1!==(i=this.items.indexOf(r))&&(r.connect&&r.disconnect&&r.disconnect(this),this.items.splice(i,1),this.emit("remove",r,i));return this},c.EmitterList.prototype.clearItems=function(){var t,e,r=this.items.splice(0,this.items.length);for(t=0;t<r.length;t++)(e=r[t]).connect&&e.disconnect&&e.disconnect(this);return this.emit("clear"),this}}(),c.SortedEmitterList=function(t){c.EmitterList.call(this),this.sortingCallback=t,this.aggregate({sortChange:"itemSortChange"}),this.connect(this,{itemSortChange:"onItemSortChange"})},c.mixinClass(c.SortedEmitterList,c.EmitterList),c.SortedEmitterList.prototype.onItemSortChange=function(t){this.removeItems(t),this.addItems(t)},c.SortedEmitterList.prototype.setSortingCallback=function(t){var e=this.getItems();this.sortingCallback=t,this.clearItems(),this.addItems(e)},c.SortedEmitterList.prototype.addItems=function(t){var e,r,i;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(r=0;r<t.length;r++)(i=this.findInsertionIndex(t[r]))<=this.items.length&&this.items[i]&&0===this.sortingCallback(this.items[i],t[r])&&this.removeItems(this.items[i]),e=this.insertItem(t[r],i),this.emit("add",t[r],e);return this},c.SortedEmitterList.prototype.findInsertionIndex=function(e){var r=this;return c.binarySearch(this.items,function(t){return r.sortingCallback(e,t)},!0)},c.Registry=function(){c.EventEmitter.call(this),this.registry={}},c.mixinClass(c.Registry,c.EventEmitter),c.Registry.prototype.register=function(t,e){var r,i;if("string"==typeof t)this.registry[t]=e,this.emit("register",t,e);else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(r=0,i=t.length;r<i;r++)this.register(t[r],e)}},c.Registry.prototype.unregister=function(t){var e,r,i;if("string"==typeof t)void 0!==(i=this.lookup(t))&&(delete this.registry[t],this.emit("unregister",t,i));else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(e=0,r=t.length;e<r;e++)this.unregister(t[e])}},c.Registry.prototype.lookup=function(t){if(a.call(this.registry,t))return this.registry[t]},c.Factory=function(){c.Factory.super.call(this)},c.inheritClass(c.Factory,c.Registry),c.Factory.prototype.register=function(t){var e;if("function"!=typeof t)throw new Error("constructor must be a function, cannot be a "+typeof t);if("string"!=typeof(e=t.static&&t.static.name)||""===e)throw new Error("Name must be a string and must not be empty");c.Factory.super.prototype.register.call(this,e,t)},c.Factory.prototype.unregister=function(t){var e;if("function"!=typeof t)throw new Error("constructor must be a function, cannot be a "+typeof t);if("string"!=typeof(e=t.static&&t.static.name)||""===e)throw new Error("Name must be a string and must not be empty");c.Factory.super.prototype.unregister.call(this,e)},c.Factory.prototype.create=function(t){var e,r,i=[],n=this.lookup(t);if(!n)throw new Error("No class registered by that name: "+t);for(r=1;r<arguments.length;r++)i.push(arguments[r]);return e=Object.create(n.prototype),n.apply(e,i),e},"undefined"!=typeof module&&module.exports?module.exports=c:t.OO=c}(this); | ||
//# sourceMappingURL=oojs.jquery.min.js.map |
/*! | ||
* OOjs v2.2.1 | ||
* OOjs v2.2.2 | ||
* https://www.mediawiki.org/wiki/OOjs | ||
@@ -9,3 +9,3 @@ * | ||
* | ||
* Date: 2018-06-14T17:19:33Z | ||
* Date: 2018-06-14T20:13:14Z | ||
*/ | ||
@@ -12,0 +12,0 @@ ( function ( global ) { |
@@ -1,3 +0,3 @@ | ||
/*! OOjs v2.2.1 | https://oojs.mit-license.org */ | ||
/*! OOjs v2.2.2 | https://oojs.mit-license.org */ | ||
!function(t){"use strict";var c={},a=c.hasOwnProperty,r=c.toString;function i(t,e,r){var i,n,o={},s=[];for(i=0,n=e.length;i<n;i++)o[e[i]]=!0;for(i=0,n=t.length;i<n;i++)!!o[t[i]]===r&&s.push(t[i]);return s}c.initClass=function(t){t.static=t.static||{}},c.inheritClass=function(t,e){var r;if(!e)throw new Error("inheritClass: Origin is not a function (actually "+e+")");if(t.prototype instanceof e)throw new Error("inheritClass: Target already inherits from origin");r=t.prototype.constructor,t.super=t.parent=e,t.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c.initClass(e),t.static=Object.create(e.static)},c.mixinClass=function(t,e){var r;if(!e)throw new Error("mixinClass: Origin is not a function (actually "+e+")");for(r in e.prototype)"constructor"!==r&&a.call(e.prototype,r)&&(t.prototype[r]=e.prototype[r]);if(c.initClass(t),e.static)for(r in e.static)a.call(e.static,r)&&(t.static[r]=e.static[r]);else c.initClass(e)},c.isSubclass=function(t,e){return t===e||t.prototype instanceof e},c.getProp=function(t){var e,r=t;for(e=1;e<arguments.length;e++){if(null==r)return;r=r[arguments[e]]}return r},c.setProp=function(t){var e,r=t;if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-2;e++){if(void 0===r[arguments[e]]&&(r[arguments[e]]={}),Object(r[arguments[e]])!==r[arguments[e]])return;r=r[arguments[e]]}r[arguments[arguments.length-2]]=arguments[arguments.length-1]}},c.deleteProp=function(t){var e,r=t,i=[r];if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-1;e++){if(void 0===r[arguments[e]]||Object(r[arguments[e]])!==r[arguments[e]])return;r=r[arguments[e]],i.push(r)}for(delete r[arguments[e]];1<i.length&&(r=i.pop())&&c.isPlainObject(r)&&!Object.keys(r).length;)delete i[i.length-1][arguments[i.length]]}},c.cloneObject=function(t){var e,r;for(e in r=Object.create(t.constructor.prototype),t)a.call(t,e)&&(r[e]=t[e]);return r},c.getObjectValues=function(t){var e,r;if(t!==Object(t))throw new TypeError("Called on non-object");for(e in r=[],t)a.call(t,e)&&(r[r.length]=t[e]);return r},c.binarySearch=function(t,e,r){for(var i,n,o=0,s=t.length;o<s;)if((n=e(t[i=o+s>>1]))<0)s=i;else{if(!(0<n))return i;o=i+1}return r?s:null},c.compare=function(t,e,r){var i,n,o,s;if(t===e)return!0;if(e=e||{},"number"==typeof(t=t||{}).nodeType&&"function"==typeof t.isEqualNode)return t.isEqualNode(e);for(s in t)if(a.call(t,s)&&void 0!==t[s]&&t[s]!==e[s]&&((o=typeof(i=t[s]))!==typeof(n=e[s])||("string"===o||"number"===o||"boolean"===o)&&i!==n||i===Object(i)&&!c.compare(i,n,!0)))return!1;return!!r||c.compare(e,t,!0)},c.copy=function(t,e,r){var i,n;if(r&&void 0!==(n=r(t)))return n;if(Array.isArray(t))n=new Array(t.length);else{if(t&&"function"==typeof t.clone)return e?e(t.clone()):t.clone();if(t&&"function"==typeof t.cloneNode)return e?e(t.cloneNode(!0)):t.cloneNode(!0);if(!c.isPlainObject(t))return e?e(t):t;n={}}for(i in t)n[i]=c.copy(t[i],e,r);return n},c.getHash=function(t){return JSON.stringify(t,c.getHash.keySortReplacer)},c.getHash.keySortReplacer=function(t,e){var r,i,n,o;if(e&&"function"==typeof e.getHashObject&&(e=e.getHashObject()),Array.isArray(e)||Object(e)!==e)return e;for(r={},n=0,o=(i=Object.keys(e).sort()).length;n<o;n+=1)r[i[n]]=e[i[n]];return r},c.unique=function(t){return t.reduce(function(t,e){return-1===t.indexOf(e)&&t.push(e),t},[])},c.simpleArrayUnion=function(){var t,e,r,i,n,o={},s=[];for(t=0,e=arguments.length;t<e;t++)for(i=0,n=(r=arguments[t]).length;i<n;i++)o[r[i]]||(o[r[i]]=!0,s.push(r[i]));return s},c.simpleArrayIntersection=function(t,e){return i(t,e,!0)},c.simpleArrayDifference=function(t,e){return i(t,e,!1)},c.isPlainObject=function(t){var e;return!(!t||"[object Object]"!==r.call(t))&&(!(e=Object.getPrototypeOf(t))||a.call(e,"isPrototypeOf"))},function(){function o(t,e){if("string"==typeof t){if(null==e)throw new Error('Method name "'+t+'" has no context.');if("function"!=typeof e[t])throw new Error('Property "'+t+'" is not a function')}else if("function"!=typeof t)throw new Error("Invalid callback. Function or method name expected.")}function n(t,e,r){(a.call(t.bindings,e)?t.bindings[e]:t.bindings[e]=[]).push(r)}c.EventEmitter=function(){this.bindings={}},c.initClass(c.EventEmitter),c.EventEmitter.prototype.on=function(t,e,r,i){return o(e,i),n(this,t,{method:e,args:r,context:arguments.length<4?null:i,once:!1}),this},c.EventEmitter.prototype.once=function(t,e){return o(e),n(this,t,{method:e,args:void 0,context:null,once:!0}),this},c.EventEmitter.prototype.off=function(t,e,r){var i,n;if(1===arguments.length)return delete this.bindings[t],this;if(o(e,r),!a.call(this.bindings,t)||!this.bindings[t].length)return this;for(arguments.length<3&&(r=null),i=(n=this.bindings[t]).length;i--;)n[i].method===e&&n[i].context===r&&n.splice(i,1);return 0===n.length&&delete this.bindings[t],this},c.EventEmitter.prototype.emit=function(t){var e,r,i,n,o,s=[];if(a.call(this.bindings,t)){for(n=this.bindings[t].slice(),e=1,r=arguments.length;e<r;e++)s.push(arguments[e]);for(e=0,r=n.length;e<r;e++)o="string"==typeof(i=n[e]).method?i.context[i.method]:i.method,i.once&&this.off(t,o),o.apply(i.context,i.args?i.args.concat(s):s);return!0}return!1},c.EventEmitter.prototype.connect=function(t,e){var r,i,n;for(n in e)r=e[n],Array.isArray(r)?(i=r.slice(1),r=r[0]):i=[],this.on(n,r,i,t);return this},c.EventEmitter.prototype.disconnect=function(t,e){var r,i,n,o;if(e)for(i in e)n=e[i],Array.isArray(n)&&(n=n[0]),this.off(i,n,t);else for(i in this.bindings)for(r=(o=this.bindings[i]).length;r--;)o[r]&&o[r].context===t&&this.off(i,o[r].method,t);return this}}(),function(){function n(t,e){return void 0===e||e<0||e>=t.length?t.length:e}c.EmitterList=function(){this.items=[],this.aggregateItemEvents={}},c.EmitterList.prototype.getItems=function(){return this.items.slice(0)},c.EmitterList.prototype.getItemIndex=function(t){return this.items.indexOf(t)},c.EmitterList.prototype.getItemCount=function(){return this.items.length},c.EmitterList.prototype.isEmpty=function(){return!this.items.length},c.EmitterList.prototype.aggregate=function(t){var e,r,i,n,o,s;for(o in t){if(s=t[o],Object.prototype.hasOwnProperty.call(this.aggregateItemEvents,o)){if(s)throw new Error("Duplicate item event aggregation for "+o);for(e=0;e<this.items.length;e++)(r=this.items[e]).connect&&r.disconnect&&((n={})[o]=["emit",this.aggregateItemEvents[o],r],r.disconnect(this,n));delete this.aggregateItemEvents[o]}if(s)for(this.aggregateItemEvents[o]=s,e=0;e<this.items.length;e++)(r=this.items[e]).connect&&r.disconnect&&((i={})[o]=["emit",s,r],r.connect(this,i))}},c.EmitterList.prototype.addItems=function(t,e){var r,i;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=n(this.items,e),r=0;r<t.length;r++)-1!==(i=this.items.indexOf(t[r]))?(e=this.moveItem(t[r],e),this.emit("move",t[r],e,i)):(e=this.insertItem(t[r],e),this.emit("add",t[r],e)),e++;return this},c.EmitterList.prototype.moveItem=function(t,e){var r=this.items.indexOf(t);if(-1===r)throw new Error("Item cannot be moved, because it is not in the list.");return e=n(this.items,e),this.items.splice(r,1),r<e&&e--,this.items.splice(e,0,t),e},c.EmitterList.prototype.insertItem=function(t,e){var r,i;if(t.connect&&t.disconnect){for(i in r={},this.aggregateItemEvents)r[i]=["emit",this.aggregateItemEvents[i],t];t.connect(this,r)}return e=n(this.items,e),this.items.splice(e,0,t),e},c.EmitterList.prototype.removeItems=function(t){var e,r,i;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=0;e<t.length;e++)r=t[e],-1!==(i=this.items.indexOf(r))&&(r.connect&&r.disconnect&&r.disconnect(this),this.items.splice(i,1),this.emit("remove",r,i));return this},c.EmitterList.prototype.clearItems=function(){var t,e,r=this.items.splice(0,this.items.length);for(t=0;t<r.length;t++)(e=r[t]).connect&&e.disconnect&&e.disconnect(this);return this.emit("clear"),this}}(),c.SortedEmitterList=function(t){c.EmitterList.call(this),this.sortingCallback=t,this.aggregate({sortChange:"itemSortChange"}),this.connect(this,{itemSortChange:"onItemSortChange"})},c.mixinClass(c.SortedEmitterList,c.EmitterList),c.SortedEmitterList.prototype.onItemSortChange=function(t){this.removeItems(t),this.addItems(t)},c.SortedEmitterList.prototype.setSortingCallback=function(t){var e=this.getItems();this.sortingCallback=t,this.clearItems(),this.addItems(e)},c.SortedEmitterList.prototype.addItems=function(t){var e,r,i;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(r=0;r<t.length;r++)(i=this.findInsertionIndex(t[r]))<=this.items.length&&this.items[i]&&0===this.sortingCallback(this.items[i],t[r])&&this.removeItems(this.items[i]),e=this.insertItem(t[r],i),this.emit("add",t[r],e);return this},c.SortedEmitterList.prototype.findInsertionIndex=function(e){var r=this;return c.binarySearch(this.items,function(t){return r.sortingCallback(e,t)},!0)},c.Registry=function(){c.EventEmitter.call(this),this.registry={}},c.mixinClass(c.Registry,c.EventEmitter),c.Registry.prototype.register=function(t,e){var r,i;if("string"==typeof t)this.registry[t]=e,this.emit("register",t,e);else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(r=0,i=t.length;r<i;r++)this.register(t[r],e)}},c.Registry.prototype.unregister=function(t){var e,r,i;if("string"==typeof t)void 0!==(i=this.lookup(t))&&(delete this.registry[t],this.emit("unregister",t,i));else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(e=0,r=t.length;e<r;e++)this.unregister(t[e])}},c.Registry.prototype.lookup=function(t){if(a.call(this.registry,t))return this.registry[t]},c.Factory=function(){c.Factory.super.call(this)},c.inheritClass(c.Factory,c.Registry),c.Factory.prototype.register=function(t){var e;if("function"!=typeof t)throw new Error("constructor must be a function, cannot be a "+typeof t);if("string"!=typeof(e=t.static&&t.static.name)||""===e)throw new Error("Name must be a string and must not be empty");c.Factory.super.prototype.register.call(this,e,t)},c.Factory.prototype.unregister=function(t){var e;if("function"!=typeof t)throw new Error("constructor must be a function, cannot be a "+typeof t);if("string"!=typeof(e=t.static&&t.static.name)||""===e)throw new Error("Name must be a string and must not be empty");c.Factory.super.prototype.unregister.call(this,e)},c.Factory.prototype.create=function(t){var e,r,i=[],n=this.lookup(t);if(!n)throw new Error("No class registered by that name: "+t);for(r=1;r<arguments.length;r++)i.push(arguments[r]);return e=Object.create(n.prototype),n.apply(e,i),e},"undefined"!=typeof module&&module.exports?module.exports=c:t.OO=c}(this); | ||
//# sourceMappingURL=oojs.min.js.map |
# OOjs Release History | ||
## v2.2.2 / 2018-06-14 | ||
* build: Add AUTHORS.txt back to package root (Timo Tijhof) | ||
* build: Remove text files from dist/ (Timo Tijhof) | ||
## v2.2.1 / 2018-06-14 | ||
@@ -4,0 +8,0 @@ * build: Re-enable 'no-unused-vars' eslint rule (Timo Tijhof) |
{ | ||
"name": "oojs", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Power for object oriented JavaScript libraries.", | ||
@@ -22,2 +22,4 @@ "keywords": [ | ||
"dist/", | ||
"AUTHORS.txt", | ||
"README.md", | ||
"LICENSE-MIT" | ||
@@ -36,3 +38,2 @@ ], | ||
"grunt-contrib-concat": "1.0.1", | ||
"grunt-contrib-copy": "1.0.0", | ||
"grunt-contrib-uglify": "3.3.0", | ||
@@ -39,0 +40,0 @@ "grunt-contrib-watch": "1.0.0", |
@@ -74,3 +74,3 @@ [](https://www.npmjs.com/package/oojs) [](https://david-dm.org/wikimedia/oojs#info=devDependencies) | ||
# Ensure tests pass | ||
$ npm install && npm test | ||
$ npm install-test | ||
@@ -77,0 +77,0 @@ # Avoid using "npm version patch" because that creates |
17
158408
11