rem:  this.notifyMoveDone = function() { if (this.moveDone) { this.moveDone(); } }  this.saveMove = function(moveinfo) { this.moves[this.moveIndex++] = moveinfo; };  this.setMoveInfo = function(moveinfo) { if (this.moveIndex == 0) return null; this.moves[this.moveIndex-1] = moveinfo; }  this.getMoveInfo = function() { if (this.moveIndex == 0) return null; return this.moves[this.moveIndex-1]; }  this.undoMove = function() { if (this.moveIndex == 0) return; this.moveIndex--; var mi = this.moves[this.moveIndex]; mi.undo(); };  this.redoMove = function() { if (this.moveIndex == this.moves.length) return; var mi = this.moves[this.moveIndex++]; mi.redo(); };  this.handleEvent = function(evt) { var keycode = evt.keyCode ? evt.keyCode : evt.charCode ? evt.charCode : evt.which ? evt.which : void 0; var key = String.fromCharCode(keycode); if ((key == "z") || (key == "Z")) { this.undoMove(); } else if ((key == "r") || (key == "R")) { this.redoMove(); } else if (key == "?") { showHelp(); } }   
context: function Board(boardGroup, moveGroup) {  this.doc = boardGroup.getOwnerDocument();  this.root = this.doc.getRootElement();  this.boardGroup = boardGroup;  this.moveGroup = moveGroup;  this.thePiles = new Array();  this.moves = new Array();  this.moveIndex = 0;  this.root.addEventListener("keypress", this, false);  this.setNotifyMoveDone = function(moveDone) {    this.moveDone = moveDone;  }  this.notifyMoveDone = function() {    if (this.moveDone) {      this.moveDone();    }  }  this.saveMove = function(moveinfo) {    this.moves[this.moveIndex++] = moveinfo;  };  this.setMoveInfo = function(moveinfo) {    if (this.moveIndex == 0) return null;    this.moves[this.moveIndex-1] = moveinfo;  }  this.getMoveInfo = function() {    if (this.moveIndex == 0) return null;    return this.moves[this.moveIndex-1];  }  this.undoMove = function() {    if (this.moveIndex == 0)      return;    this.moveIndex--;    var mi = this.moves[this.moveIndex];    mi.undo();  };  this.redoMove = function() {    if (this.moveIndex == this.moves.length)      return;    var mi = this.moves[this.moveIndex++];    mi.redo();  };  this.handleEvent = function(evt) {    var keycode = evt.keyCode ? evt.keyCode :      evt.charCode ? evt.charCode :      evt.which ? evt.which : void 0;    var key = String.fromCharCode(keycode);    if ((key == "z") || (key == "Z")) {      this.undoMove();    } else if ((key == "r") || (key == "R")) {      this.redoMove();    }    else if (key == "?") {      showHelp();    }  }}
meta: 1407	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1407/2c46850987c1b7c044d71489fa0fa367c5fa768a/board.js/buggy/samples/solitaire/script/board.js