Comparing version 3.0.0 to 3.0.1
/*! | ||
* OOjs v3.0.0 optimised for jQuery | ||
* OOjs v3.0.1 optimised for jQuery | ||
* https://www.mediawiki.org/wiki/OOjs | ||
* | ||
* Copyright 2011-2019 OOjs Team and other contributors. | ||
* Copyright 2011-2020 OOjs Team and other contributors. | ||
* Released under the MIT license | ||
* https://oojs.mit-license.org | ||
* | ||
* Date: 2019-08-28T15:41:06Z | ||
* Date: 2020-02-24T22:36:27Z | ||
*/ | ||
@@ -849,4 +849,3 @@ ( function ( global ) { | ||
* @param {string} event Type of event | ||
* @param {...any} args First in a list of variadic arguments | ||
* passed to event handler (optional) | ||
* @param {...any} [args] Arguments passed to the event handler | ||
* @return {boolean} Whether the event was handled by at least one listener | ||
@@ -909,4 +908,3 @@ */ | ||
* @param {string} event Type of event | ||
* @param {...any} args First in a list of variadic arguments | ||
* passed to event handler (optional) | ||
* @param {...any} [args] Arguments passed to the event handler | ||
* @return {boolean} Whether the event was handled by at least one listener | ||
@@ -1001,3 +999,3 @@ */ | ||
* NOTE: To allow matching call sites with connect(), array values are allowed to contain the | ||
* parameters as well, but only the method name is used to find bindings. Tt is discouraged to | ||
* parameters as well, but only the method name is used to find bindings. It is discouraged to | ||
* have multiple bindings for the same event to the same listener, but if used (and only the | ||
@@ -1057,2 +1055,4 @@ * parameters vary), disconnecting one variation of (event name, event listener, parameters) | ||
OO.initClass( OO.EmitterList ); | ||
/* Events */ | ||
@@ -1059,0 +1059,0 @@ |
@@ -1,3 +0,3 @@ | ||
/*! OOjs v3.0.0 | https://oojs.mit-license.org */ | ||
!function(t){"use strict";var c={},a=c.hasOwnProperty,h=Array.prototype.slice;c.toString;function i(t,e,i){var r,n,o={},s=[];for(r=0,n=e.length;r<n;r++)o[e[r]]=!0;for(r=0,n=t.length;r<n;r++)!!o[t[r]]===i&&s.push(t[r]);return s}c.initClass=function(t){t.static=t.static||{}},c.inheritClass=function(t,e){var i;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");i=t.prototype.constructor,t.super=t.parent=e,t.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),c.initClass(e),t.static=Object.create(e.static)},c.mixinClass=function(t,e){var i;if(!e)throw new Error("mixinClass: Origin is not a function (actually "+e+")");for(i in e.prototype)"constructor"!==i&&a.call(e.prototype,i)&&(t.prototype[i]=e.prototype[i]);if(c.initClass(t),e.static)for(i in e.static)a.call(e.static,i)&&(t.static[i]=e.static[i]);else c.initClass(e)},c.isSubclass=function(t,e){return t===e||t.prototype instanceof e},c.getProp=function(t){var e,i=t;for(e=1;e<arguments.length;e++){if(null==i)return;i=i[arguments[e]]}return i},c.setProp=function(t){var e,i=t;if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-2;e++){if(void 0===i[arguments[e]]&&(i[arguments[e]]={}),Object(i[arguments[e]])!==i[arguments[e]])return;i=i[arguments[e]]}i[arguments[arguments.length-2]]=arguments[arguments.length-1]}},c.deleteProp=function(t){var e,i=t,r=[i];if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-1;e++){if(void 0===i[arguments[e]]||Object(i[arguments[e]])!==i[arguments[e]])return;i=i[arguments[e]],r.push(i)}for(delete i[arguments[e]];1<r.length&&(i=r.pop())&&c.isPlainObject(i)&&!Object.keys(i).length;)delete r[r.length-1][arguments[r.length]]}},c.cloneObject=function(t){var e,i;for(e in i=Object.create(t.constructor.prototype),t)a.call(t,e)&&(i[e]=t[e]);return i},c.getObjectValues=function(t){var e,i;if(t!==Object(t))throw new TypeError("Called on non-object");for(e in i=[],t)a.call(t,e)&&(i[i.length]=t[e]);return i},c.binarySearch=function(t,e,i){for(var r,n,o=0,s=t.length;o<s;)if((n=e(t[r=o+s>>1]))<0)s=r;else{if(!(0<n))return r;o=r+1}return i?s:null},c.compare=function(t,e,i){var r,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(r=t[s]))!==typeof(n=e[s])||("string"===o||"number"===o||"boolean"===o)&&r!==n||r===Object(r)&&!c.compare(r,n,!0)))return!1;return!!i||c.compare(e,t,!0)},c.copy=function(t,e,i){var r,n;if(i&&void 0!==(n=i(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(r in t)n[r]=c.copy(t[r],e,i);return n},c.getHash=function(t){return JSON.stringify(t,c.getHash.keySortReplacer)},c.getHash.keySortReplacer=function(t,e){var i,r,n,o;if(e&&"function"==typeof e.getHashObject&&(e=e.getHashObject()),Array.isArray(e)||Object(e)!==e)return e;for(i={},n=0,o=(r=Object.keys(e).sort()).length;n<o;n+=1)i[r[n]]=e[r[n]];return i},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,i,r,n,o={},s=[];for(t=0,e=arguments.length;t<e;t++)for(r=0,n=(i=arguments[t]).length;r<n;r++)o[i[r]]||(o[i[r]]=!0,s.push(i[r]));return s},c.simpleArrayIntersection=function(t,e){return i(t,e,!0)},c.simpleArrayDifference=function(t,e){return i(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,i){(a.call(t.bindings,e)?t.bindings[e]:t.bindings[e]=[]).push(i)}c.EventEmitter=function(){this.bindings={}},c.initClass(c.EventEmitter),c.EventEmitter.prototype.on=function(t,e,i,r){return o(e,r),n(this,t,{method:e,args:i,context:arguments.length<4?null:r,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,i){var r,n;if(1===arguments.length)return delete this.bindings[t],this;if(o(e,i),!a.call(this.bindings,t)||!this.bindings[t].length)return this;for(arguments.length<3&&(i=null),r=(n=this.bindings[t]).length;r--;)n[r].method===e&&n[r].context===i&&n.splice(r,1);return 0===n.length&&delete this.bindings[t],this},c.EventEmitter.prototype.emit=function(t){var e,i,r,n,o;if(!a.call(this.bindings,t))return!1;for(e=this.bindings[t].slice(),i=h.call(arguments,1),r=0;r<e.length;r++){o="string"==typeof(n=e[r]).method?n.context[n.method]:n.method,n.once&&this.off(t,o);try{o.apply(n.context,n.args?n.args.concat(i):i)}catch(t){setTimeout(function(t){throw t}.bind(null,t))}}return!0},c.EventEmitter.prototype.emitThrow=function(t){var e,i,r,n,o,s;if(!a.call(this.bindings,t))return!1;for(e=this.bindings[t].slice(),i=h.call(arguments,1),r=0;r<e.length;r++){o="string"==typeof(n=e[r]).method?n.context[n.method]:n.method,n.once&&this.off(t,o);try{o.apply(n.context,n.args?n.args.concat(i):i)}catch(t){void 0===s?s=t:setTimeout(function(t){throw t}.bind(null,t))}}if(void 0!==s)throw s;return!0},c.EventEmitter.prototype.connect=function(t,e){var i,r,n;for(n in e)i=e[n],Array.isArray(i)?(r=i.slice(1),i=i[0]):r=[],this.on(n,i,r,t);return this},c.EventEmitter.prototype.disconnect=function(t,e){var i,r,n,o;if(e)for(r in e)n=e[r],Array.isArray(n)&&(n=n[0]),this.off(r,n,t);else for(r in this.bindings)for(i=(o=this.bindings[r]).length;i--;)o[i]&&o[i].context===t&&this.off(r,o[i].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,i,r,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++)(i=this.items[e]).connect&&i.disconnect&&((n={})[o]=["emit",this.aggregateItemEvents[o],i],i.disconnect(this,n));delete this.aggregateItemEvents[o]}if(s)for(this.aggregateItemEvents[o]=s,e=0;e<this.items.length;e++)(i=this.items[e]).connect&&i.disconnect&&((r={})[o]=["emit",s,i],i.connect(this,r))}},c.EmitterList.prototype.addItems=function(t,e){var i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=n(this.items,e),i=0;i<t.length;i++)-1!==(r=this.items.indexOf(t[i]))?(e=this.moveItem(t[i],e),this.emit("move",t[i],e,r)):(e=this.insertItem(t[i],e),this.emit("add",t[i],e)),e++;return this},c.EmitterList.prototype.moveItem=function(t,e){var i=this.items.indexOf(t);if(-1===i)throw new Error("Item cannot be moved, because it is not in the list.");return e=n(this.items,e),this.items.splice(i,1),i<e&&e--,this.items.splice(e,0,t),e},c.EmitterList.prototype.insertItem=function(t,e){var i,r;if(null===t||"object"!=typeof t)throw new Error("Expected object, but item is "+typeof t);if(t.connect&&t.disconnect){for(r in i={},this.aggregateItemEvents)i[r]=["emit",this.aggregateItemEvents[r],t];t.connect(this,i)}return e=n(this.items,e),this.items.splice(e,0,t),e},c.EmitterList.prototype.removeItems=function(t){var e,i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=0;e<t.length;e++)i=t[e],-1!==(r=this.items.indexOf(i))&&(i.connect&&i.disconnect&&i.disconnect(this),this.items.splice(r,1),this.emit("remove",i,r));return this},c.EmitterList.prototype.clearItems=function(){var t,e,i=this.items.splice(0,this.items.length);for(t=0;t<i.length;t++)(e=i[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,i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(i=0;i<t.length;i++)(r=this.findInsertionIndex(t[i]))<=this.items.length&&this.items[r]&&0===this.sortingCallback(this.items[r],t[i])&&this.removeItems(this.items[r]),e=this.insertItem(t[i],r),this.emit("add",t[i],e);return this},c.SortedEmitterList.prototype.findInsertionIndex=function(e){var i=this;return c.binarySearch(this.items,function(t){return i.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 i,r;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(i=0,r=t.length;i<r;i++)this.register(t[i],e)}},c.Registry.prototype.unregister=function(t){var e,i,r;if("string"==typeof t)void 0!==(r=this.lookup(t))&&(delete this.registry[t],this.emit("unregister",t,r));else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(e=0,i=t.length;e<i;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,e){if("function"!=typeof t)throw new Error("constructor must be a function, got "+typeof t);if(arguments.length<=1&&(e=t.static&&t.static.name),"string"!=typeof e||""===e)throw new Error("name must be a non-empty string");c.Factory.super.prototype.register.call(this,e,t)},c.Factory.prototype.unregister=function(t){if("function"==typeof t&&(t=t.static&&t.static.name),"string"!=typeof t||""===t)throw new Error("name must be a non-empty string");c.Factory.super.prototype.unregister.call(this,t)},c.Factory.prototype.create=function(t){var e,i,r=[],n=this.lookup(t);if(!n)throw new Error("No class registered by that name: "+t);for(i=1;i<arguments.length;i++)r.push(arguments[i]);return e=Object.create(n.prototype),n.apply(e,r),e},"undefined"!=typeof module&&module.exports?module.exports=c:t.OO=c}(this); | ||
/*! OOjs v3.0.1 | https://oojs.mit-license.org */ | ||
!function(t){"use strict";var c={},a=c.hasOwnProperty,h=Array.prototype.slice;c.toString;function i(t,e,i){var r,n,o={},s=[];for(r=0,n=e.length;r<n;r++)o[e[r]]=!0;for(r=0,n=t.length;r<n;r++)!!o[t[r]]===i&&s.push(t[r]);return s}c.initClass=function(t){t.static=t.static||{}},c.inheritClass=function(t,e){var i;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");i=t.prototype.constructor,t.super=t.parent=e,t.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),c.initClass(e),t.static=Object.create(e.static)},c.mixinClass=function(t,e){var i;if(!e)throw new Error("mixinClass: Origin is not a function (actually "+e+")");for(i in e.prototype)"constructor"!==i&&a.call(e.prototype,i)&&(t.prototype[i]=e.prototype[i]);if(c.initClass(t),e.static)for(i in e.static)a.call(e.static,i)&&(t.static[i]=e.static[i]);else c.initClass(e)},c.isSubclass=function(t,e){return t===e||t.prototype instanceof e},c.getProp=function(t){var e,i=t;for(e=1;e<arguments.length;e++){if(null==i)return;i=i[arguments[e]]}return i},c.setProp=function(t){var e,i=t;if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-2;e++){if(void 0===i[arguments[e]]&&(i[arguments[e]]={}),Object(i[arguments[e]])!==i[arguments[e]])return;i=i[arguments[e]]}i[arguments[arguments.length-2]]=arguments[arguments.length-1]}},c.deleteProp=function(t){var e,i=t,r=[i];if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-1;e++){if(void 0===i[arguments[e]]||Object(i[arguments[e]])!==i[arguments[e]])return;i=i[arguments[e]],r.push(i)}for(delete i[arguments[e]];1<r.length&&(i=r.pop())&&c.isPlainObject(i)&&!Object.keys(i).length;)delete r[r.length-1][arguments[r.length]]}},c.cloneObject=function(t){var e,i;for(e in i=Object.create(t.constructor.prototype),t)a.call(t,e)&&(i[e]=t[e]);return i},c.getObjectValues=function(t){var e,i;if(t!==Object(t))throw new TypeError("Called on non-object");for(e in i=[],t)a.call(t,e)&&(i[i.length]=t[e]);return i},c.binarySearch=function(t,e,i){for(var r,n,o=0,s=t.length;o<s;)if((n=e(t[r=o+s>>1]))<0)s=r;else{if(!(0<n))return r;o=r+1}return i?s:null},c.compare=function(t,e,i){var r,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(r=t[s]))!==typeof(n=e[s])||("string"===o||"number"===o||"boolean"===o)&&r!==n||r===Object(r)&&!c.compare(r,n,!0)))return!1;return!!i||c.compare(e,t,!0)},c.copy=function(t,e,i){var r,n;if(i&&void 0!==(n=i(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(r in t)n[r]=c.copy(t[r],e,i);return n},c.getHash=function(t){return JSON.stringify(t,c.getHash.keySortReplacer)},c.getHash.keySortReplacer=function(t,e){var i,r,n,o;if(e&&"function"==typeof e.getHashObject&&(e=e.getHashObject()),Array.isArray(e)||Object(e)!==e)return e;for(i={},n=0,o=(r=Object.keys(e).sort()).length;n<o;n+=1)i[r[n]]=e[r[n]];return i},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,i,r,n,o={},s=[];for(t=0,e=arguments.length;t<e;t++)for(r=0,n=(i=arguments[t]).length;r<n;r++)o[i[r]]||(o[i[r]]=!0,s.push(i[r]));return s},c.simpleArrayIntersection=function(t,e){return i(t,e,!0)},c.simpleArrayDifference=function(t,e){return i(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,i){(a.call(t.bindings,e)?t.bindings[e]:t.bindings[e]=[]).push(i)}c.EventEmitter=function(){this.bindings={}},c.initClass(c.EventEmitter),c.EventEmitter.prototype.on=function(t,e,i,r){return o(e,r),n(this,t,{method:e,args:i,context:arguments.length<4?null:r,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,i){var r,n;if(1===arguments.length)return delete this.bindings[t],this;if(o(e,i),!a.call(this.bindings,t)||!this.bindings[t].length)return this;for(arguments.length<3&&(i=null),r=(n=this.bindings[t]).length;r--;)n[r].method===e&&n[r].context===i&&n.splice(r,1);return 0===n.length&&delete this.bindings[t],this},c.EventEmitter.prototype.emit=function(t){var e,i,r,n,o;if(!a.call(this.bindings,t))return!1;for(e=this.bindings[t].slice(),i=h.call(arguments,1),r=0;r<e.length;r++){o="string"==typeof(n=e[r]).method?n.context[n.method]:n.method,n.once&&this.off(t,o);try{o.apply(n.context,n.args?n.args.concat(i):i)}catch(t){setTimeout(function(t){throw t}.bind(null,t))}}return!0},c.EventEmitter.prototype.emitThrow=function(t){var e,i,r,n,o,s;if(!a.call(this.bindings,t))return!1;for(e=this.bindings[t].slice(),i=h.call(arguments,1),r=0;r<e.length;r++){o="string"==typeof(n=e[r]).method?n.context[n.method]:n.method,n.once&&this.off(t,o);try{o.apply(n.context,n.args?n.args.concat(i):i)}catch(t){void 0===s?s=t:setTimeout(function(t){throw t}.bind(null,t))}}if(void 0!==s)throw s;return!0},c.EventEmitter.prototype.connect=function(t,e){var i,r,n;for(n in e)i=e[n],Array.isArray(i)?(r=i.slice(1),i=i[0]):r=[],this.on(n,i,r,t);return this},c.EventEmitter.prototype.disconnect=function(t,e){var i,r,n,o;if(e)for(r in e)n=e[r],Array.isArray(n)&&(n=n[0]),this.off(r,n,t);else for(r in this.bindings)for(i=(o=this.bindings[r]).length;i--;)o[i]&&o[i].context===t&&this.off(r,o[i].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.initClass(c.EmitterList),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,i,r,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++)(i=this.items[e]).connect&&i.disconnect&&((n={})[o]=["emit",this.aggregateItemEvents[o],i],i.disconnect(this,n));delete this.aggregateItemEvents[o]}if(s)for(this.aggregateItemEvents[o]=s,e=0;e<this.items.length;e++)(i=this.items[e]).connect&&i.disconnect&&((r={})[o]=["emit",s,i],i.connect(this,r))}},c.EmitterList.prototype.addItems=function(t,e){var i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=n(this.items,e),i=0;i<t.length;i++)-1!==(r=this.items.indexOf(t[i]))?(e=this.moveItem(t[i],e),this.emit("move",t[i],e,r)):(e=this.insertItem(t[i],e),this.emit("add",t[i],e)),e++;return this},c.EmitterList.prototype.moveItem=function(t,e){var i=this.items.indexOf(t);if(-1===i)throw new Error("Item cannot be moved, because it is not in the list.");return e=n(this.items,e),this.items.splice(i,1),i<e&&e--,this.items.splice(e,0,t),e},c.EmitterList.prototype.insertItem=function(t,e){var i,r;if(null===t||"object"!=typeof t)throw new Error("Expected object, but item is "+typeof t);if(t.connect&&t.disconnect){for(r in i={},this.aggregateItemEvents)i[r]=["emit",this.aggregateItemEvents[r],t];t.connect(this,i)}return e=n(this.items,e),this.items.splice(e,0,t),e},c.EmitterList.prototype.removeItems=function(t){var e,i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=0;e<t.length;e++)i=t[e],-1!==(r=this.items.indexOf(i))&&(i.connect&&i.disconnect&&i.disconnect(this),this.items.splice(r,1),this.emit("remove",i,r));return this},c.EmitterList.prototype.clearItems=function(){var t,e,i=this.items.splice(0,this.items.length);for(t=0;t<i.length;t++)(e=i[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,i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(i=0;i<t.length;i++)(r=this.findInsertionIndex(t[i]))<=this.items.length&&this.items[r]&&0===this.sortingCallback(this.items[r],t[i])&&this.removeItems(this.items[r]),e=this.insertItem(t[i],r),this.emit("add",t[i],e);return this},c.SortedEmitterList.prototype.findInsertionIndex=function(e){var i=this;return c.binarySearch(this.items,function(t){return i.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 i,r;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(i=0,r=t.length;i<r;i++)this.register(t[i],e)}},c.Registry.prototype.unregister=function(t){var e,i,r;if("string"==typeof t)void 0!==(r=this.lookup(t))&&(delete this.registry[t],this.emit("unregister",t,r));else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(e=0,i=t.length;e<i;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,e){if("function"!=typeof t)throw new Error("constructor must be a function, got "+typeof t);if(arguments.length<=1&&(e=t.static&&t.static.name),"string"!=typeof e||""===e)throw new Error("name must be a non-empty string");c.Factory.super.prototype.register.call(this,e,t)},c.Factory.prototype.unregister=function(t){if("function"==typeof t&&(t=t.static&&t.static.name),"string"!=typeof t||""===t)throw new Error("name must be a non-empty string");c.Factory.super.prototype.unregister.call(this,t)},c.Factory.prototype.create=function(t){var e,i,r=[],n=this.lookup(t);if(!n)throw new Error("No class registered by that name: "+t);for(i=1;i<arguments.length;i++)r.push(arguments[i]);return e=Object.create(n.prototype),n.apply(e,r),e},"undefined"!=typeof module&&module.exports?module.exports=c:t.OO=c}(this); | ||
//# sourceMappingURL=oojs.jquery.min.js.map |
/*! | ||
* OOjs v3.0.0 | ||
* OOjs v3.0.1 | ||
* https://www.mediawiki.org/wiki/OOjs | ||
* | ||
* Copyright 2011-2019 OOjs Team and other contributors. | ||
* Copyright 2011-2020 OOjs Team and other contributors. | ||
* Released under the MIT license | ||
* https://oojs.mit-license.org | ||
* | ||
* Date: 2019-08-28T15:41:06Z | ||
* Date: 2020-02-24T22:36:27Z | ||
*/ | ||
@@ -875,4 +875,3 @@ ( function ( global ) { | ||
* @param {string} event Type of event | ||
* @param {...any} args First in a list of variadic arguments | ||
* passed to event handler (optional) | ||
* @param {...any} [args] Arguments passed to the event handler | ||
* @return {boolean} Whether the event was handled by at least one listener | ||
@@ -935,4 +934,3 @@ */ | ||
* @param {string} event Type of event | ||
* @param {...any} args First in a list of variadic arguments | ||
* passed to event handler (optional) | ||
* @param {...any} [args] Arguments passed to the event handler | ||
* @return {boolean} Whether the event was handled by at least one listener | ||
@@ -1027,3 +1025,3 @@ */ | ||
* NOTE: To allow matching call sites with connect(), array values are allowed to contain the | ||
* parameters as well, but only the method name is used to find bindings. Tt is discouraged to | ||
* parameters as well, but only the method name is used to find bindings. It is discouraged to | ||
* have multiple bindings for the same event to the same listener, but if used (and only the | ||
@@ -1083,2 +1081,4 @@ * parameters vary), disconnecting one variation of (event name, event listener, parameters) | ||
OO.initClass( OO.EmitterList ); | ||
/* Events */ | ||
@@ -1085,0 +1085,0 @@ |
@@ -1,3 +0,3 @@ | ||
/*! OOjs v3.0.0 | https://oojs.mit-license.org */ | ||
!function(t){"use strict";var c={},a=c.hasOwnProperty,h=Array.prototype.slice,i=c.toString;function r(t,e,i){var r,n,o={},s=[];for(r=0,n=e.length;r<n;r++)o[e[r]]=!0;for(r=0,n=t.length;r<n;r++)!!o[t[r]]===i&&s.push(t[r]);return s}c.initClass=function(t){t.static=t.static||{}},c.inheritClass=function(t,e){var i;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");i=t.prototype.constructor,t.super=t.parent=e,t.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),c.initClass(e),t.static=Object.create(e.static)},c.mixinClass=function(t,e){var i;if(!e)throw new Error("mixinClass: Origin is not a function (actually "+e+")");for(i in e.prototype)"constructor"!==i&&a.call(e.prototype,i)&&(t.prototype[i]=e.prototype[i]);if(c.initClass(t),e.static)for(i in e.static)a.call(e.static,i)&&(t.static[i]=e.static[i]);else c.initClass(e)},c.isSubclass=function(t,e){return t===e||t.prototype instanceof e},c.getProp=function(t){var e,i=t;for(e=1;e<arguments.length;e++){if(null==i)return;i=i[arguments[e]]}return i},c.setProp=function(t){var e,i=t;if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-2;e++){if(void 0===i[arguments[e]]&&(i[arguments[e]]={}),Object(i[arguments[e]])!==i[arguments[e]])return;i=i[arguments[e]]}i[arguments[arguments.length-2]]=arguments[arguments.length-1]}},c.deleteProp=function(t){var e,i=t,r=[i];if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-1;e++){if(void 0===i[arguments[e]]||Object(i[arguments[e]])!==i[arguments[e]])return;i=i[arguments[e]],r.push(i)}for(delete i[arguments[e]];1<r.length&&(i=r.pop())&&c.isPlainObject(i)&&!Object.keys(i).length;)delete r[r.length-1][arguments[r.length]]}},c.cloneObject=function(t){var e,i;for(e in i=Object.create(t.constructor.prototype),t)a.call(t,e)&&(i[e]=t[e]);return i},c.getObjectValues=function(t){var e,i;if(t!==Object(t))throw new TypeError("Called on non-object");for(e in i=[],t)a.call(t,e)&&(i[i.length]=t[e]);return i},c.binarySearch=function(t,e,i){for(var r,n,o=0,s=t.length;o<s;)if((n=e(t[r=o+s>>1]))<0)s=r;else{if(!(0<n))return r;o=r+1}return i?s:null},c.compare=function(t,e,i){var r,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(r=t[s]))!==typeof(n=e[s])||("string"===o||"number"===o||"boolean"===o)&&r!==n||r===Object(r)&&!c.compare(r,n,!0)))return!1;return!!i||c.compare(e,t,!0)},c.copy=function(t,e,i){var r,n;if(i&&void 0!==(n=i(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(r in t)n[r]=c.copy(t[r],e,i);return n},c.getHash=function(t){return JSON.stringify(t,c.getHash.keySortReplacer)},c.getHash.keySortReplacer=function(t,e){var i,r,n,o;if(e&&"function"==typeof e.getHashObject&&(e=e.getHashObject()),Array.isArray(e)||Object(e)!==e)return e;for(i={},n=0,o=(r=Object.keys(e).sort()).length;n<o;n+=1)i[r[n]]=e[r[n]];return i},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,i,r,n,o={},s=[];for(t=0,e=arguments.length;t<e;t++)for(r=0,n=(i=arguments[t]).length;r<n;r++)o[i[r]]||(o[i[r]]=!0,s.push(i[r]));return s},c.simpleArrayIntersection=function(t,e){return r(t,e,!0)},c.simpleArrayDifference=function(t,e){return r(t,e,!1)},c.isPlainObject=function(t){var e;return!(!t||"[object Object]"!==i.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,i){(a.call(t.bindings,e)?t.bindings[e]:t.bindings[e]=[]).push(i)}c.EventEmitter=function(){this.bindings={}},c.initClass(c.EventEmitter),c.EventEmitter.prototype.on=function(t,e,i,r){return o(e,r),n(this,t,{method:e,args:i,context:arguments.length<4?null:r,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,i){var r,n;if(1===arguments.length)return delete this.bindings[t],this;if(o(e,i),!a.call(this.bindings,t)||!this.bindings[t].length)return this;for(arguments.length<3&&(i=null),r=(n=this.bindings[t]).length;r--;)n[r].method===e&&n[r].context===i&&n.splice(r,1);return 0===n.length&&delete this.bindings[t],this},c.EventEmitter.prototype.emit=function(t){var e,i,r,n,o;if(!a.call(this.bindings,t))return!1;for(e=this.bindings[t].slice(),i=h.call(arguments,1),r=0;r<e.length;r++){o="string"==typeof(n=e[r]).method?n.context[n.method]:n.method,n.once&&this.off(t,o);try{o.apply(n.context,n.args?n.args.concat(i):i)}catch(t){setTimeout(function(t){throw t}.bind(null,t))}}return!0},c.EventEmitter.prototype.emitThrow=function(t){var e,i,r,n,o,s;if(!a.call(this.bindings,t))return!1;for(e=this.bindings[t].slice(),i=h.call(arguments,1),r=0;r<e.length;r++){o="string"==typeof(n=e[r]).method?n.context[n.method]:n.method,n.once&&this.off(t,o);try{o.apply(n.context,n.args?n.args.concat(i):i)}catch(t){void 0===s?s=t:setTimeout(function(t){throw t}.bind(null,t))}}if(void 0!==s)throw s;return!0},c.EventEmitter.prototype.connect=function(t,e){var i,r,n;for(n in e)i=e[n],Array.isArray(i)?(r=i.slice(1),i=i[0]):r=[],this.on(n,i,r,t);return this},c.EventEmitter.prototype.disconnect=function(t,e){var i,r,n,o;if(e)for(r in e)n=e[r],Array.isArray(n)&&(n=n[0]),this.off(r,n,t);else for(r in this.bindings)for(i=(o=this.bindings[r]).length;i--;)o[i]&&o[i].context===t&&this.off(r,o[i].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,i,r,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++)(i=this.items[e]).connect&&i.disconnect&&((n={})[o]=["emit",this.aggregateItemEvents[o],i],i.disconnect(this,n));delete this.aggregateItemEvents[o]}if(s)for(this.aggregateItemEvents[o]=s,e=0;e<this.items.length;e++)(i=this.items[e]).connect&&i.disconnect&&((r={})[o]=["emit",s,i],i.connect(this,r))}},c.EmitterList.prototype.addItems=function(t,e){var i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=n(this.items,e),i=0;i<t.length;i++)-1!==(r=this.items.indexOf(t[i]))?(e=this.moveItem(t[i],e),this.emit("move",t[i],e,r)):(e=this.insertItem(t[i],e),this.emit("add",t[i],e)),e++;return this},c.EmitterList.prototype.moveItem=function(t,e){var i=this.items.indexOf(t);if(-1===i)throw new Error("Item cannot be moved, because it is not in the list.");return e=n(this.items,e),this.items.splice(i,1),i<e&&e--,this.items.splice(e,0,t),e},c.EmitterList.prototype.insertItem=function(t,e){var i,r;if(null===t||"object"!=typeof t)throw new Error("Expected object, but item is "+typeof t);if(t.connect&&t.disconnect){for(r in i={},this.aggregateItemEvents)i[r]=["emit",this.aggregateItemEvents[r],t];t.connect(this,i)}return e=n(this.items,e),this.items.splice(e,0,t),e},c.EmitterList.prototype.removeItems=function(t){var e,i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=0;e<t.length;e++)i=t[e],-1!==(r=this.items.indexOf(i))&&(i.connect&&i.disconnect&&i.disconnect(this),this.items.splice(r,1),this.emit("remove",i,r));return this},c.EmitterList.prototype.clearItems=function(){var t,e,i=this.items.splice(0,this.items.length);for(t=0;t<i.length;t++)(e=i[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,i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(i=0;i<t.length;i++)(r=this.findInsertionIndex(t[i]))<=this.items.length&&this.items[r]&&0===this.sortingCallback(this.items[r],t[i])&&this.removeItems(this.items[r]),e=this.insertItem(t[i],r),this.emit("add",t[i],e);return this},c.SortedEmitterList.prototype.findInsertionIndex=function(e){var i=this;return c.binarySearch(this.items,function(t){return i.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 i,r;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(i=0,r=t.length;i<r;i++)this.register(t[i],e)}},c.Registry.prototype.unregister=function(t){var e,i,r;if("string"==typeof t)void 0!==(r=this.lookup(t))&&(delete this.registry[t],this.emit("unregister",t,r));else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(e=0,i=t.length;e<i;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,e){if("function"!=typeof t)throw new Error("constructor must be a function, got "+typeof t);if(arguments.length<=1&&(e=t.static&&t.static.name),"string"!=typeof e||""===e)throw new Error("name must be a non-empty string");c.Factory.super.prototype.register.call(this,e,t)},c.Factory.prototype.unregister=function(t){if("function"==typeof t&&(t=t.static&&t.static.name),"string"!=typeof t||""===t)throw new Error("name must be a non-empty string");c.Factory.super.prototype.unregister.call(this,t)},c.Factory.prototype.create=function(t){var e,i,r=[],n=this.lookup(t);if(!n)throw new Error("No class registered by that name: "+t);for(i=1;i<arguments.length;i++)r.push(arguments[i]);return e=Object.create(n.prototype),n.apply(e,r),e},"undefined"!=typeof module&&module.exports?module.exports=c:t.OO=c}(this); | ||
/*! OOjs v3.0.1 | https://oojs.mit-license.org */ | ||
!function(t){"use strict";var c={},a=c.hasOwnProperty,h=Array.prototype.slice,i=c.toString;function r(t,e,i){var r,n,o={},s=[];for(r=0,n=e.length;r<n;r++)o[e[r]]=!0;for(r=0,n=t.length;r<n;r++)!!o[t[r]]===i&&s.push(t[r]);return s}c.initClass=function(t){t.static=t.static||{}},c.inheritClass=function(t,e){var i;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");i=t.prototype.constructor,t.super=t.parent=e,t.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),c.initClass(e),t.static=Object.create(e.static)},c.mixinClass=function(t,e){var i;if(!e)throw new Error("mixinClass: Origin is not a function (actually "+e+")");for(i in e.prototype)"constructor"!==i&&a.call(e.prototype,i)&&(t.prototype[i]=e.prototype[i]);if(c.initClass(t),e.static)for(i in e.static)a.call(e.static,i)&&(t.static[i]=e.static[i]);else c.initClass(e)},c.isSubclass=function(t,e){return t===e||t.prototype instanceof e},c.getProp=function(t){var e,i=t;for(e=1;e<arguments.length;e++){if(null==i)return;i=i[arguments[e]]}return i},c.setProp=function(t){var e,i=t;if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-2;e++){if(void 0===i[arguments[e]]&&(i[arguments[e]]={}),Object(i[arguments[e]])!==i[arguments[e]])return;i=i[arguments[e]]}i[arguments[arguments.length-2]]=arguments[arguments.length-1]}},c.deleteProp=function(t){var e,i=t,r=[i];if(!(Object(t)!==t||arguments.length<2)){for(e=1;e<arguments.length-1;e++){if(void 0===i[arguments[e]]||Object(i[arguments[e]])!==i[arguments[e]])return;i=i[arguments[e]],r.push(i)}for(delete i[arguments[e]];1<r.length&&(i=r.pop())&&c.isPlainObject(i)&&!Object.keys(i).length;)delete r[r.length-1][arguments[r.length]]}},c.cloneObject=function(t){var e,i;for(e in i=Object.create(t.constructor.prototype),t)a.call(t,e)&&(i[e]=t[e]);return i},c.getObjectValues=function(t){var e,i;if(t!==Object(t))throw new TypeError("Called on non-object");for(e in i=[],t)a.call(t,e)&&(i[i.length]=t[e]);return i},c.binarySearch=function(t,e,i){for(var r,n,o=0,s=t.length;o<s;)if((n=e(t[r=o+s>>1]))<0)s=r;else{if(!(0<n))return r;o=r+1}return i?s:null},c.compare=function(t,e,i){var r,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(r=t[s]))!==typeof(n=e[s])||("string"===o||"number"===o||"boolean"===o)&&r!==n||r===Object(r)&&!c.compare(r,n,!0)))return!1;return!!i||c.compare(e,t,!0)},c.copy=function(t,e,i){var r,n;if(i&&void 0!==(n=i(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(r in t)n[r]=c.copy(t[r],e,i);return n},c.getHash=function(t){return JSON.stringify(t,c.getHash.keySortReplacer)},c.getHash.keySortReplacer=function(t,e){var i,r,n,o;if(e&&"function"==typeof e.getHashObject&&(e=e.getHashObject()),Array.isArray(e)||Object(e)!==e)return e;for(i={},n=0,o=(r=Object.keys(e).sort()).length;n<o;n+=1)i[r[n]]=e[r[n]];return i},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,i,r,n,o={},s=[];for(t=0,e=arguments.length;t<e;t++)for(r=0,n=(i=arguments[t]).length;r<n;r++)o[i[r]]||(o[i[r]]=!0,s.push(i[r]));return s},c.simpleArrayIntersection=function(t,e){return r(t,e,!0)},c.simpleArrayDifference=function(t,e){return r(t,e,!1)},c.isPlainObject=function(t){var e;return!(!t||"[object Object]"!==i.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,i){(a.call(t.bindings,e)?t.bindings[e]:t.bindings[e]=[]).push(i)}c.EventEmitter=function(){this.bindings={}},c.initClass(c.EventEmitter),c.EventEmitter.prototype.on=function(t,e,i,r){return o(e,r),n(this,t,{method:e,args:i,context:arguments.length<4?null:r,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,i){var r,n;if(1===arguments.length)return delete this.bindings[t],this;if(o(e,i),!a.call(this.bindings,t)||!this.bindings[t].length)return this;for(arguments.length<3&&(i=null),r=(n=this.bindings[t]).length;r--;)n[r].method===e&&n[r].context===i&&n.splice(r,1);return 0===n.length&&delete this.bindings[t],this},c.EventEmitter.prototype.emit=function(t){var e,i,r,n,o;if(!a.call(this.bindings,t))return!1;for(e=this.bindings[t].slice(),i=h.call(arguments,1),r=0;r<e.length;r++){o="string"==typeof(n=e[r]).method?n.context[n.method]:n.method,n.once&&this.off(t,o);try{o.apply(n.context,n.args?n.args.concat(i):i)}catch(t){setTimeout(function(t){throw t}.bind(null,t))}}return!0},c.EventEmitter.prototype.emitThrow=function(t){var e,i,r,n,o,s;if(!a.call(this.bindings,t))return!1;for(e=this.bindings[t].slice(),i=h.call(arguments,1),r=0;r<e.length;r++){o="string"==typeof(n=e[r]).method?n.context[n.method]:n.method,n.once&&this.off(t,o);try{o.apply(n.context,n.args?n.args.concat(i):i)}catch(t){void 0===s?s=t:setTimeout(function(t){throw t}.bind(null,t))}}if(void 0!==s)throw s;return!0},c.EventEmitter.prototype.connect=function(t,e){var i,r,n;for(n in e)i=e[n],Array.isArray(i)?(r=i.slice(1),i=i[0]):r=[],this.on(n,i,r,t);return this},c.EventEmitter.prototype.disconnect=function(t,e){var i,r,n,o;if(e)for(r in e)n=e[r],Array.isArray(n)&&(n=n[0]),this.off(r,n,t);else for(r in this.bindings)for(i=(o=this.bindings[r]).length;i--;)o[i]&&o[i].context===t&&this.off(r,o[i].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.initClass(c.EmitterList),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,i,r,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++)(i=this.items[e]).connect&&i.disconnect&&((n={})[o]=["emit",this.aggregateItemEvents[o],i],i.disconnect(this,n));delete this.aggregateItemEvents[o]}if(s)for(this.aggregateItemEvents[o]=s,e=0;e<this.items.length;e++)(i=this.items[e]).connect&&i.disconnect&&((r={})[o]=["emit",s,i],i.connect(this,r))}},c.EmitterList.prototype.addItems=function(t,e){var i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=n(this.items,e),i=0;i<t.length;i++)-1!==(r=this.items.indexOf(t[i]))?(e=this.moveItem(t[i],e),this.emit("move",t[i],e,r)):(e=this.insertItem(t[i],e),this.emit("add",t[i],e)),e++;return this},c.EmitterList.prototype.moveItem=function(t,e){var i=this.items.indexOf(t);if(-1===i)throw new Error("Item cannot be moved, because it is not in the list.");return e=n(this.items,e),this.items.splice(i,1),i<e&&e--,this.items.splice(e,0,t),e},c.EmitterList.prototype.insertItem=function(t,e){var i,r;if(null===t||"object"!=typeof t)throw new Error("Expected object, but item is "+typeof t);if(t.connect&&t.disconnect){for(r in i={},this.aggregateItemEvents)i[r]=["emit",this.aggregateItemEvents[r],t];t.connect(this,i)}return e=n(this.items,e),this.items.splice(e,0,t),e},c.EmitterList.prototype.removeItems=function(t){var e,i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(e=0;e<t.length;e++)i=t[e],-1!==(r=this.items.indexOf(i))&&(i.connect&&i.disconnect&&i.disconnect(this),this.items.splice(r,1),this.emit("remove",i,r));return this},c.EmitterList.prototype.clearItems=function(){var t,e,i=this.items.splice(0,this.items.length);for(t=0;t<i.length;t++)(e=i[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,i,r;if(Array.isArray(t)||(t=[t]),0===t.length)return this;for(i=0;i<t.length;i++)(r=this.findInsertionIndex(t[i]))<=this.items.length&&this.items[r]&&0===this.sortingCallback(this.items[r],t[i])&&this.removeItems(this.items[r]),e=this.insertItem(t[i],r),this.emit("add",t[i],e);return this},c.SortedEmitterList.prototype.findInsertionIndex=function(e){var i=this;return c.binarySearch(this.items,function(t){return i.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 i,r;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(i=0,r=t.length;i<r;i++)this.register(t[i],e)}},c.Registry.prototype.unregister=function(t){var e,i,r;if("string"==typeof t)void 0!==(r=this.lookup(t))&&(delete this.registry[t],this.emit("unregister",t,r));else{if(!Array.isArray(t))throw new Error("Name must be a string or array, cannot be a "+typeof t);for(e=0,i=t.length;e<i;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,e){if("function"!=typeof t)throw new Error("constructor must be a function, got "+typeof t);if(arguments.length<=1&&(e=t.static&&t.static.name),"string"!=typeof e||""===e)throw new Error("name must be a non-empty string");c.Factory.super.prototype.register.call(this,e,t)},c.Factory.prototype.unregister=function(t){if("function"==typeof t&&(t=t.static&&t.static.name),"string"!=typeof t||""===t)throw new Error("name must be a non-empty string");c.Factory.super.prototype.unregister.call(this,t)},c.Factory.prototype.create=function(t){var e,i,r=[],n=this.lookup(t);if(!n)throw new Error("No class registered by that name: "+t);for(i=1;i<arguments.length;i++)r.push(arguments[i]);return e=Object.create(n.prototype),n.apply(e,r),e},"undefined"!=typeof module&&module.exports?module.exports=c:t.OO=c}(this); | ||
//# sourceMappingURL=oojs.min.js.map |
# OOjs Release History | ||
## v3.0.1 / 2020-02-24 | ||
* EmitterList: Call OO.initClass for consistency with other classes (Thalia Chan) | ||
* EventEmitter: Improve documentation for variadic args (Thalia Chan) | ||
* doc: Fix typo in EventEmitter documentation (Thalia Chan) | ||
* doc: Point to gerrit, not Phabricator Diffusion (James D. Forrester) | ||
* README.md: Drop DavidDM badges, we use LibraryUpgrader now (James D. Forrester) | ||
* build: Updating dependencies (Umherirrender) | ||
* build: Updating https-proxy-agent to 2.2.4 (libraryupgrader) | ||
* build: Update all karma-related tools to latest (James D. Forrester) | ||
* build: Move oldest Internet Explorer Sauce Labs testing to 11 from 10 (James D. Forrester) | ||
## v3.0.0 / 2019-08-26 | ||
@@ -4,0 +15,0 @@ * [BREAKING CHANGE] Update jQuery 3.2.1 -> 3.4.1 (Ed Sanders; James D. Forrester) |
102
package.json
{ | ||
"name": "oojs", | ||
"version": "3.0.0", | ||
"description": "Power for object oriented JavaScript libraries.", | ||
"keywords": [ | ||
"oo", | ||
"oop", | ||
"class", | ||
"inheritance", | ||
"library" | ||
], | ||
"homepage": "https://www.mediawiki.org/wiki/OOjs", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://gerrit.wikimedia.org/r/p/oojs/core" | ||
}, | ||
"license": "MIT", | ||
"main": "dist/oojs.js", | ||
"filename": "oojs.min.js", | ||
"files": [ | ||
"dist/", | ||
"AUTHORS.txt", | ||
"README.md", | ||
"LICENSE-MIT" | ||
], | ||
"scripts": { | ||
"lint": "eslint --cache --report-unused-disable-directives --ext .js,.json .", | ||
"test": "npm run lint && grunt test && qunit tests/node-index.js", | ||
"doc": "grunt doc", | ||
"prepare": "grunt build" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"eslint-config-wikimedia": "0.13.1", | ||
"grunt": "1.0.4", | ||
"grunt-contrib-clean": "2.0.0", | ||
"grunt-contrib-concat": "1.0.1", | ||
"grunt-contrib-uglify": "4.0.0", | ||
"grunt-jsdoc": "2.4.0", | ||
"grunt-karma": "3.0.1", | ||
"jquery": "3.4.1", | ||
"jsdoc-class-hierarchy": "1.1.2", | ||
"jsdoc-wmf-theme": "0.0.3", | ||
"karma": "3.1.4", | ||
"karma-chrome-launcher": "2.2.0", | ||
"karma-coverage": "1.1.2", | ||
"karma-firefox-launcher": "1.1.0", | ||
"karma-qunit": "2.1.0", | ||
"karma-remap-istanbul": "0.6.0", | ||
"karma-sauce-launcher": "1.2.0", | ||
"qunit": "2.9.1" | ||
} | ||
"name": "oojs", | ||
"version": "3.0.1", | ||
"description": "Power for object oriented JavaScript libraries.", | ||
"keywords": [ | ||
"oo", | ||
"oop", | ||
"class", | ||
"inheritance", | ||
"library" | ||
], | ||
"homepage": "https://www.mediawiki.org/wiki/OOjs", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://gerrit.wikimedia.org/r/oojs/core" | ||
}, | ||
"license": "MIT", | ||
"main": "dist/oojs.js", | ||
"filename": "oojs.min.js", | ||
"files": [ | ||
"dist/", | ||
"AUTHORS.txt", | ||
"README.md", | ||
"LICENSE-MIT" | ||
], | ||
"scripts": { | ||
"lint": "eslint --cache --report-unused-disable-directives --ext .js,.json .", | ||
"test": "npm run lint && grunt test && qunit tests/node-index.js", | ||
"doc": "grunt doc", | ||
"prepare": "grunt build" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"eslint-config-wikimedia": "0.15.0", | ||
"grunt": "1.0.4", | ||
"grunt-contrib-clean": "2.0.0", | ||
"grunt-contrib-concat": "1.0.1", | ||
"grunt-contrib-uglify": "4.0.0", | ||
"grunt-jsdoc": "2.4.0", | ||
"grunt-karma": "3.0.2", | ||
"jquery": "3.4.1", | ||
"jsdoc-class-hierarchy": "1.1.2", | ||
"jsdoc-wmf-theme": "0.0.3", | ||
"karma": "4.4.1", | ||
"karma-chrome-launcher": "3.1.0", | ||
"karma-coverage": "2.0.1", | ||
"karma-firefox-launcher": "1.3.0", | ||
"karma-qunit": "4.0.0", | ||
"karma-remap-istanbul": "0.6.0", | ||
"karma-sauce-launcher": "2.0.2", | ||
"qunit": "2.9.3" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
[](https://www.npmjs.com/package/oojs) [](https://david-dm.org/wikimedia/oojs#info=devDependencies) | ||
[](https://www.npmjs.com/package/oojs) | ||
@@ -32,3 +32,3 @@ OOjs | ||
Or clone the repo, `git clone https://phabricator.wikimedia.org/diffusion/GOJS/oojs.git`. | ||
Or clone the repo, `git clone https://gerrit.wikimedia.org/r/oojs/core`. | ||
@@ -35,0 +35,0 @@ ECMAScript 5 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
170634
3220