]>
git.wh0rd.org - tt-rss.git/blob - lib/dijit/_base/typematic.js
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
8 if(!dojo
._hasResource
["dijit._base.typematic"]){
9 dojo
._hasResource
["dijit._base.typematic"]=true;
10 dojo
.provide("dijit._base.typematic");
11 dijit
.typematic
={_fireEventAndReload:function(){
13 this._callback(++this._count
,this._node
,this._evt
);
14 this._currentTimeout
=Math
.max(this._currentTimeout
<0?this._initialDelay
:(this._subsequentDelay
>1?this._subsequentDelay
:Math
.round(this._currentTimeout
*this._subsequentDelay
)),this._minDelay
);
15 this._timer
=setTimeout(dojo
.hitch(this,"_fireEventAndReload"),this._currentTimeout
);
16 },trigger:function(_1
,_2
,_3
,_4
,_5
,_6
,_7
,_8
){
19 this._initialDelay
=_7
||500;
20 this._subsequentDelay
=_6
||0.9;
21 this._minDelay
=_8
||10;
25 this._currentTimeout
=-1;
27 this._callback
=dojo
.hitch(_2
,_4
);
28 this._fireEventAndReload();
29 this._evt
=dojo
.mixin({faux
:true},_1
);
33 clearTimeout(this._timer
);
37 this._callback(-1,this._node
,this._evt
);
40 },addKeyListener:function(_9
,_a
,_b
,_c
,_d
,_e
,_f
){
42 _a
.charOrCode
=_a
.keyCode
;
43 dojo
.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");
46 _a
.charOrCode
=String
.fromCharCode(_a
.charCode
);
47 dojo
.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");
50 return [dojo
.connect(_9
,"onkeypress",this,function(evt
){
51 if(evt
.charOrCode
==_a
.charOrCode
&&(_a
.ctrlKey
===undefined||_a
.ctrlKey
==evt
.ctrlKey
)&&(_a
.altKey
===undefined||_a
.altKey
==evt
.altKey
)&&(_a
.metaKey
===undefined||_a
.metaKey
==(evt
.metaKey
||false))&&(_a
.shiftKey
===undefined||_a
.shiftKey
==evt
.shiftKey
)){
53 dijit
.typematic
.trigger(evt
,_b
,_9
,_c
,_a
,_d
,_e
,_f
);
55 if(dijit
.typematic
._obj
==_a
){
56 dijit
.typematic
.stop();
59 }),dojo
.connect(_9
,"onkeyup",this,function(evt
){
60 if(dijit
.typematic
._obj
==_a
){
61 dijit
.typematic
.stop();
64 },addMouseListener:function(_10
,_11
,_12
,_13
,_14
,_15
){
66 return [dc(_10
,"mousedown",this,function(evt
){
68 dijit
.typematic
.trigger(evt
,_11
,_10
,_12
,_10
,_13
,_14
,_15
);
69 }),dc(_10
,"mouseup",this,function(evt
){
71 dijit
.typematic
.stop();
72 }),dc(_10
,"mouseout",this,function(evt
){
74 dijit
.typematic
.stop();
75 }),dc(_10
,"mousemove",this,function(evt
){
77 }),dc(_10
,"dblclick",this,function(evt
){
80 dijit
.typematic
.trigger(evt
,_11
,_10
,_12
,_10
,_13
,_14
,_15
);
81 setTimeout(dojo
.hitch(this,dijit
.typematic
.stop
),50);
84 },addListener:function(_16
,_17
,_18
,_19
,_1a
,_1b
,_1c
,_1d
){
85 return this.addKeyListener(_17
,_18
,_19
,_1a
,_1b
,_1c
,_1d
).concat(this.addMouseListener(_16
,_19
,_1a
,_1b
,_1c
,_1d
));