]> git.wh0rd.org - tt-rss.git/blobdiff - lib/dijit/_PaletteMixin.js
lib: Upgrade Dojo and Dijit from 1.8.3 to 1.12.1
[tt-rss.git] / lib / dijit / _PaletteMixin.js
index a12855d1256f55b30c2f562c0a36549fb59e5ace..0b88a08d56e1516c77d05abfd12d348b9d854f66 100644 (file)
@@ -1,98 +1,2 @@
-/*
-       Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
-       Available via Academic Free License >= 2.1 OR the modified BSD license.
-       see: http://dojotoolkit.org/license for details
-*/
-
-
-if(!dojo._hasResource["dijit._PaletteMixin"]){
-dojo._hasResource["dijit._PaletteMixin"]=true;
-dojo.provide("dijit._PaletteMixin");
-dojo.require("dijit._CssStateMixin");
-dojo.declare("dijit._PaletteMixin",[dijit._CssStateMixin],{defaultTimeout:500,timeoutChangeRate:0.9,value:null,_selectedCell:-1,tabIndex:"0",cellClass:"dijitPaletteCell",dyeClass:"",_preparePalette:function(_1,_2){
-this._cells=[];
-var _3=this._blankGif;
-var _4=dojo.getObject(this.dyeClass);
-for(var _5=0;_5<_1.length;_5++){
-var _6=dojo.create("tr",{tabIndex:"-1"},this.gridNode);
-for(var _7=0;_7<_1[_5].length;_7++){
-var _8=_1[_5][_7];
-if(_8){
-var _9=new _4(_8);
-var _a=dojo.create("td",{"class":this.cellClass,tabIndex:"-1",title:_2[_8]});
-_9.fillCell(_a,_3);
-this.connect(_a,"ondijitclick","_onCellClick");
-this._trackMouseState(_a,this.cellClass);
-dojo.place(_a,_6);
-_a.index=this._cells.length;
-this._cells.push({node:_a,dye:_9});
-}
-}
-}
-this._xDim=_1[0].length;
-this._yDim=_1.length;
-var _b={UP_ARROW:-this._xDim,DOWN_ARROW:this._xDim,RIGHT_ARROW:this.isLeftToRight()?1:-1,LEFT_ARROW:this.isLeftToRight()?-1:1};
-for(var _c in _b){
-this._connects.push(dijit.typematic.addKeyListener(this.domNode,{charOrCode:dojo.keys[_c],ctrlKey:false,altKey:false,shiftKey:false},this,function(){
-var _d=_b[_c];
-return function(_e){
-this._navigateByKey(_d,_e);
-};
-}(),this.timeoutChangeRate,this.defaultTimeout));
-}
-},postCreate:function(){
-this.inherited(arguments);
-this._setCurrent(this._cells[0].node);
-},focus:function(){
-dijit.focus(this._currentFocus);
-},_onCellClick:function(_f){
-var _10=_f.currentTarget,_11=this._getDye(_10).getValue();
-this._setCurrent(_10);
-setTimeout(dojo.hitch(this,function(){
-dijit.focus(_10);
-this._setValueAttr(_11,true);
-}));
-dojo.removeClass(_10,"dijitPaletteCellHover");
-dojo.stopEvent(_f);
-},_setCurrent:function(_12){
-if("_currentFocus" in this){
-dojo.attr(this._currentFocus,"tabIndex","-1");
-}
-this._currentFocus=_12;
-if(_12){
-dojo.attr(_12,"tabIndex",this.tabIndex);
-}
-},_setValueAttr:function(_13,_14){
-this.value=null;
-if(this._selectedCell>=0){
-dojo.removeClass(this._cells[this._selectedCell].node,"dijitPaletteCellSelected");
-}
-this._selectedCell=-1;
-if(_13){
-for(var i=0;i<this._cells.length;i++){
-if(_13==this._cells[i].dye.getValue()){
-this._selectedCell=i;
-this.value=_13;
-dojo.addClass(this._cells[i].node,"dijitPaletteCellSelected");
-if(_14||_14===undefined){
-this.onChange(_13);
-}
-break;
-}
-}
-}
-},onChange:function(_15){
-},_navigateByKey:function(_16,_17){
-if(_17==-1){
-return;
-}
-var _18=this._currentFocus.index+_16;
-if(_18<this._cells.length&&_18>-1){
-var _19=this._cells[_18].node;
-this._setCurrent(_19);
-setTimeout(dojo.hitch(dijit,"focus",_19),0);
-}
-},_getDye:function(_1a){
-return this._cells[_1a.index].dye;
-}});
-}
+//>>built
+define("dijit/_PaletteMixin",["dojo/_base/declare","dojo/dom-attr","dojo/dom-class","dojo/dom-construct","dojo/keys","dojo/_base/lang","dojo/on","./_CssStateMixin","./a11yclick","./focus","./typematic"],function(_1,_2,_3,_4,_5,_6,on,_7,_8,_9,_a){var _b=_1("dijit._PaletteMixin",_7,{defaultTimeout:500,timeoutChangeRate:0.9,value:"",_selectedCell:-1,tabIndex:"0",cellClass:"dijitPaletteCell",dyeClass:null,_dyeFactory:function(_c){var _d=typeof this.dyeClass=="string"?_6.getObject(this.dyeClass):this.dyeClass;return new _d(_c);},_preparePalette:function(_e,_f){this._cells=[];var url=this._blankGif;this.own(on(this.gridNode,_8,_6.hitch(this,"_onCellClick")));for(var row=0;row<_e.length;row++){var _10=_4.create("tr",{tabIndex:"-1",role:"row"},this.gridNode);for(var col=0;col<_e[row].length;col++){var _11=_e[row][col];if(_11){var _12=this._dyeFactory(_11,row,col,_f[_11]);var _13=_4.create("td",{"class":this.cellClass,tabIndex:"-1",title:_f[_11],role:"gridcell"},_10);_12.fillCell(_13,url);_13.idx=this._cells.length;this._cells.push({node:_13,dye:_12});}}}this._xDim=_e[0].length;this._yDim=_e.length;var _14={UP_ARROW:-this._xDim,DOWN_ARROW:this._xDim,RIGHT_ARROW:this.isLeftToRight()?1:-1,LEFT_ARROW:this.isLeftToRight()?-1:1};for(var key in _14){this.own(_a.addKeyListener(this.domNode,{keyCode:_5[key],ctrlKey:false,altKey:false,shiftKey:false},this,function(){var _15=_14[key];return function(_16){this._navigateByKey(_15,_16);};}(),this.timeoutChangeRate,this.defaultTimeout));}},postCreate:function(){this.inherited(arguments);this._setCurrent(this._cells[0].node);},focus:function(){_9.focus(this._currentFocus);},_onCellClick:function(evt){var _17=evt.target;while(_17.tagName!="TD"){if(!_17.parentNode||_17==this.gridNode){return;}_17=_17.parentNode;}var _18=this._getDye(_17).getValue();this._setCurrent(_17);_9.focus(_17);this._setValueAttr(_18,true);evt.stopPropagation();evt.preventDefault();},_setCurrent:function(_19){if("_currentFocus" in this){_2.set(this._currentFocus,"tabIndex","-1");}this._currentFocus=_19;if(_19){_2.set(_19,"tabIndex",this.tabIndex);}},_setValueAttr:function(_1a,_1b){if(this._selectedCell>=0){_3.remove(this._cells[this._selectedCell].node,this.cellClass+"Selected");}this._selectedCell=-1;if(_1a){for(var i=0;i<this._cells.length;i++){if(_1a==this._cells[i].dye.getValue()){this._selectedCell=i;_3.add(this._cells[i].node,this.cellClass+"Selected");break;}}}this._set("value",this._selectedCell>=0?_1a:null);if(_1b||_1b===undefined){this.onChange(_1a);}},onChange:function(){},_navigateByKey:function(_1c,_1d){if(_1d==-1){return;}var _1e=this._currentFocus.idx+_1c;if(_1e<this._cells.length&&_1e>-1){var _1f=this._cells[_1e].node;this._setCurrent(_1f);this.defer(_6.hitch(_9,"focus",_1f));}},_getDye:function(_20){return this._cells[_20.idx].dye;}});return _b;});
\ No newline at end of file