]> git.wh0rd.org - tt-rss.git/blobdiff - lib/dojo/router/RouterBase.js
lib: Upgrade Dojo and Dijit from 1.8.3 to 1.12.1
[tt-rss.git] / lib / dojo / router / RouterBase.js
index 3862884a2a091dbc5ab39cd141c3514f64580642..31b9c8c8c0ae318be9d0d49b147557e2ca5fade7 100644 (file)
@@ -1,8 +1,8 @@
 /*
-       Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
+       Copyright (c) 2004-2016, The JS Foundation All Rights Reserved.
        Available via Academic Free License >= 2.1 OR the modified BSD license.
        see: http://dojotoolkit.org/license for details
 */
 
 //>>built
-define("dojo/router/RouterBase",["dojo/_base/declare","dojo/hash","dojo/topic"],function(_1,_2,_3){var _4;if(String.prototype.trim){_4=function(_5){return _5.trim();};}else{_4=function(_6){return _6.replace(/^\s\s*/,"").replace(/\s\s*$/,"");};}function _7(_8,_9,_a){var _b,_c,_d,_e,i,l;_b=this.callbackQueue;_c=false;_d=false;_e={stopImmediatePropagation:function(){_c=true;},preventDefault:function(){_d=true;},oldPath:_9,newPath:_a,params:_8};for(i=0,l=_b.length;i<l;++i){if(!_c){_b[i](_e);}}return !_d;};var _f=_1(null,{_routes:null,_routeIndex:null,_started:false,_currentPath:"",idMatch:/:(\w[\w\d]*)/g,idReplacement:"([^\\/]+)",globMatch:/\*(\w[\w\d]*)/,globReplacement:"(.+)",constructor:function(_10){this._routes=[];this._routeIndex={};for(var i in _10){if(_10.hasOwnProperty(i)){this[i]=_10[i];}}},register:function(_11,_12){return this._registerRoute(_11,_12);},registerBefore:function(_13,_14){return this._registerRoute(_13,_14,true);},go:function(_15,_16){var _17;_15=_4(_15);_17=this._handlePathChange(_15);if(_17){_2(_15,_16);}return _17;},startup:function(){if(this._started){return;}var _18=this;this._started=true;this._handlePathChange(_2());_3.subscribe("/dojo/hashchange",function(){_18._handlePathChange.apply(_18,arguments);});},_handlePathChange:function(_19){var i,j,li,lj,_1a,_1b,_1c,_1d,_1e,_1f=this._routes,_20=this._currentPath;if(!this._started||_19===_20){return _1c;}_1c=true;for(i=0,li=_1f.length;i<li;++i){_1a=_1f[i];_1b=_1a.route.exec(_19);if(_1b){if(_1a.parameterNames){_1d=_1a.parameterNames;_1e={};for(j=0,lj=_1d.length;j<lj;++j){_1e[_1d[j]]=_1b[j+1];}}else{_1e=_1b.slice(1);}_1c=_1a.fire(_1e,_20,_19);}}if(_1c){this._currentPath=_19;}return _1c;},_convertRouteToRegExp:function(_21){_21=_21.replace(this.idMatch,this.idReplacement);_21=_21.replace(this.globMatch,this.globReplacement);_21="^"+_21+"$";return new RegExp(_21);},_getParameterNames:function(_22){var _23=this.idMatch,_24=this.globMatch,_25=[],_26;_23.lastIndex=0;while((_26=_23.exec(_22))!==null){_25.push(_26[1]);}if((_26=_24.exec(_22))!==null){_25.push(_26[1]);}return _25.length>0?_25:null;},_indexRoutes:function(){var i,l,_27,_28,_29=this._routes;_28=this._routeIndex={};for(i=0,l=_29.length;i<l;++i){_27=_29[i];_28[_27.route]=i;}},_registerRoute:function(_2a,_2b,_2c){var _2d,_2e,_2f,_30,_31,_32=this,_33=this._routes,_34=this._routeIndex;_2d=this._routeIndex[_2a];_2e=typeof _2d!=="undefined";if(_2e){_2f=_33[_2d];}if(!_2f){_2f={route:_2a,callbackQueue:[],fire:_7};}_30=_2f.callbackQueue;if(typeof _2a=="string"){_2f.parameterNames=this._getParameterNames(_2a);_2f.route=this._convertRouteToRegExp(_2a);}if(_2c){_30.unshift(_2b);}else{_30.push(_2b);}if(!_2e){_2d=_33.length;_34[_2a]=_2d;_33.push(_2f);}_31=false;return {remove:function(){var i,l;if(_31){return;}for(i=0,l=_30.length;i<l;++i){if(_30[i]===_2b){_30.splice(i,1);}}if(_30.length===0){_33.splice(_2d,1);_32._indexRoutes();}_31=true;},register:function(_35,_36){return _32.register(_2a,_35,_36);}};}});return _f;});
\ No newline at end of file
+define("dojo/router/RouterBase",["dojo/_base/declare","dojo/hash","dojo/topic"],function(_1,_2,_3){var _4;if(String.prototype.trim){_4=function(_5){return _5.trim();};}else{_4=function(_6){return _6.replace(/^\s\s*/,"").replace(/\s\s*$/,"");};}function _7(_8,_9,_a){var _b,_c,_d,_e,_f,i,l;_b=this.callbackQueue;_c=false;_d=false;_e={stopImmediatePropagation:function(){_c=true;},preventDefault:function(){_d=true;},oldPath:_9,newPath:_a,params:_8};_f=[_e];if(_8 instanceof Array){_f=_f.concat(_8);}else{for(var key in _8){_f.push(_8[key]);}}for(i=0,l=_b.length;i<l;++i){if(!_c){_b[i].apply(null,_f);}}return !_d;};var _10=_1(null,{_routes:null,_routeIndex:null,_started:false,_currentPath:"",idMatch:/:(\w[\w\d]*)/g,idReplacement:"([^\\/]+)",globMatch:/\*(\w[\w\d]*)/,globReplacement:"(.+)",constructor:function(_11){this._routes=[];this._routeIndex={};for(var i in _11){if(_11.hasOwnProperty(i)){this[i]=_11[i];}}},register:function(_12,_13){return this._registerRoute(_12,_13);},registerBefore:function(_14,_15){return this._registerRoute(_14,_15,true);},go:function(_16,_17){var _18;if(typeof _16!=="string"){return false;}_16=_4(_16);_18=this._handlePathChange(_16);if(_18){_2(_16,_17);}return _18;},startup:function(_19){if(this._started){return;}var _1a=this,_1b=_2();this._started=true;this._hashchangeHandle=_3.subscribe("/dojo/hashchange",function(){_1a._handlePathChange.apply(_1a,arguments);});if(!_1b){this.go(_19,true);}else{this._handlePathChange(_1b);}},destroy:function(){if(this._hashchangeHandle){this._hashchangeHandle.remove();}this._routes=null;this._routeIndex=null;},_handlePathChange:function(_1c){var i,j,li,lj,_1d,_1e,_1f,_20,_21,_22=this._routes,_23=this._currentPath;if(!this._started||_1c===_23){return _1f;}_1f=true;for(i=0,li=_22.length;i<li;++i){_1d=_22[i];_1e=_1d.route.exec(_1c);if(_1e){if(_1d.parameterNames){_20=_1d.parameterNames;_21={};for(j=0,lj=_20.length;j<lj;++j){_21[_20[j]]=_1e[j+1];}}else{_21=_1e.slice(1);}_1f=_1d.fire(_21,_23,_1c);}}if(_1f){this._currentPath=_1c;}return _1f;},_convertRouteToRegExp:function(_24){_24=_24.replace(this.idMatch,this.idReplacement);_24=_24.replace(this.globMatch,this.globReplacement);_24="^"+_24+"$";return new RegExp(_24);},_getParameterNames:function(_25){var _26=this.idMatch,_27=this.globMatch,_28=[],_29;_26.lastIndex=0;while((_29=_26.exec(_25))!==null){_28.push(_29[1]);}if((_29=_27.exec(_25))!==null){_28.push(_29[1]);}return _28.length>0?_28:null;},_indexRoutes:function(){var i,l,_2a,_2b,_2c=this._routes;_2b=this._routeIndex={};for(i=0,l=_2c.length;i<l;++i){_2a=_2c[i];_2b[_2a.route]=i;}},_registerRoute:function(_2d,_2e,_2f){var _30,_31,_32,_33,_34,_35=this,_36=this._routes,_37=this._routeIndex;_30=this._routeIndex[_2d];_31=typeof _30!=="undefined";if(_31){_32=_36[_30];}if(!_32){_32={route:_2d,callbackQueue:[],fire:_7};}_33=_32.callbackQueue;if(typeof _2d=="string"){_32.parameterNames=this._getParameterNames(_2d);_32.route=this._convertRouteToRegExp(_2d);}if(_2f){_33.unshift(_2e);}else{_33.push(_2e);}if(!_31){_30=_36.length;_37[_2d]=_30;_36.push(_32);}_34=false;return {remove:function(){var i,l;if(_34){return;}for(i=0,l=_33.length;i<l;++i){if(_33[i]===_2e){_33.splice(i,1);}}if(_33.length===0){_36.splice(_30,1);_35._indexRoutes();}_34=true;},register:function(_38,_39){return _35.register(_2d,_38,_39);}};}});return _10;});
\ No newline at end of file