]>
jfr.im git - irc/quakenet/qwebirc.git/blob - js/irc/commandhistory.js
175ac19b6e9504ecc96815e3027d2e9d9d6420ae
1 var CommandHistory
= new Class({
6 initialize: function(options
) {
7 this.setOptions(options
);
12 addLine: function(line
, moveUp
) {
13 if((this.data
.length
== 0) || (line
!= this.data
[0]))
14 this.data
.unshift(line
);
22 if(this.data
.length
> this.options
.lines
)
26 if(this.data
.length
== 0)
29 if(this.position
>= this.data
.length
)
32 this.position
= this.position
+ 1;
34 return this.data
[this.position
];
36 downLine: function() {
37 if(this.position
== -1)
40 this.position
= this.position
- 1;
42 if(this.position
== -1)
45 return this.data
[this.position
];