this.setOptions(options);
this.data = [];
- this.position = -1;
+ this.position = 0;
},
- addLine: function(line) {
- this.data.unshift(line);
- this.position = -1;
+ addLine: function(line, moveUp) {
+ if((this.data.length == 0) || (line != this.data[0]))
+ this.data.unshift(line);
+
+ if(moveUp) {
+ this.position = 0;
+ } else {
+ this.position = -1;
+ }
if(this.data.length > this.options.lines)
this.data.pop();
},
- prevLine: function() {
- if(this.position == 0)
+ upLine: function() {
+ if(this.data.length == 0)
return null;
- this.position = this.position - 1;
-
- return this.data[this.position];
- },
- nextLine: function() {
+
if(this.position >= this.data.length)
return null;
+
this.position = this.position + 1;
+ return this.data[this.position];
+ },
+ downLine: function() {
+ if(this.position == -1)
+ return null;
+
+ this.position = this.position - 1;
+
+ if(this.position == -1)
+ return null;
+
return this.data[this.position];
}
});
"This software contains the following third party portions:",
"- MooTools v1.2 --- Copyright (C) 2006-2008 Valerio Proietti, MIT license.",
"",
- "Thank you for flying QuakeNet.",
+ "Thank you for flying QuakeNet!",
"",
];