]> git.wh0rd.org - tt-rss.git/blob - lib/dojo/AdapterRegistry.js
add dijit/dojo stuff; initial ui mockup
[tt-rss.git] / lib / dojo / AdapterRegistry.js
1 /*
2 Copyright (c) 2004-2010, 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
8 if(!dojo._hasResource["dojo.AdapterRegistry"]){
9 dojo._hasResource["dojo.AdapterRegistry"]=true;
10 dojo.provide("dojo.AdapterRegistry");
11 dojo.AdapterRegistry=function(_1){
12 this.pairs=[];
13 this.returnWrappers=_1||false;
14 };
15 dojo.extend(dojo.AdapterRegistry,{register:function(_2,_3,_4,_5,_6){
16 this.pairs[((_6)?"unshift":"push")]([_2,_3,_4,_5]);
17 },match:function(){
18 for(var i=0;i<this.pairs.length;i++){
19 var _7=this.pairs[i];
20 if(_7[1].apply(this,arguments)){
21 if((_7[3])||(this.returnWrappers)){
22 return _7[2];
23 }else{
24 return _7[2].apply(this,arguments);
25 }
26 }
27 }
28 throw new Error("No match found");
29 },unregister:function(_8){
30 for(var i=0;i<this.pairs.length;i++){
31 var _9=this.pairs[i];
32 if(_9[0]==_8){
33 this.pairs.splice(i,1);
34 return true;
35 }
36 }
37 return false;
38 }});
39 }