]>
jfr.im git - irc/quakenet/qwebirc.git/blob - js/irc/commandhistory.js
5577b09bc52da9d75296455e56fd87de68b05460
1 var CommandHistory
= new Class({
6 initialize: function(options
) {
7 this.setOptions(options
);
12 addLine: function(line
) {
13 this.data
.unshift(line
);
16 if(this.data
.length
> this.options
.lines
)
19 prevLine: function() {
20 if(this.position
== 0)
22 this.position
= this.position
- 1;
24 return this.data
[this.position
];
26 nextLine: function() {
27 if(this.position
>= this.data
.length
)
29 this.position
= this.position
+ 1;
31 return this.data
[this.position
];