]> git.wh0rd.org - tt-rss.git/blob - lib/dojo/AdapterRegistry.js
302a5ec653e782b8f639426ce724f95ee5f73e55
[tt-rss.git] / lib / dojo / AdapterRegistry.js
1 /*
2 Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
3 Available via Academic Free License >= 2.1 OR the modified BSD license.
4 see: http://dojotoolkit.org/license for details
5 */
6
7 //>>built
8 define("dojo/AdapterRegistry",["./_base/kernel","./_base/lang"],function(_1,_2){var _3=_1.AdapterRegistry=function(_4){this.pairs=[];this.returnWrappers=_4||false;};_2.extend(_3,{register:function(_5,_6,_7,_8,_9){this.pairs[((_9)?"unshift":"push")]([_5,_6,_7,_8]);},match:function(){for(var i=0;i<this.pairs.length;i++){var _a=this.pairs[i];if(_a[1].apply(this,arguments)){if((_a[3])||(this.returnWrappers)){return _a[2];}else{return _a[2].apply(this,arguments);}}}throw new Error("No match found");},unregister:function(_b){for(var i=0;i<this.pairs.length;i++){var _c=this.pairs[i];if(_c[0]==_b){this.pairs.splice(i,1);return true;}}return false;}});return _3;});