]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dojo/tests/resources/ApplicationState.js
add Dojo 1.1.1
[eow] / static / dojo-release-1.1.1 / dojo / tests / resources / ApplicationState.js
1 /*
2 ApplicationState is an object that represents the application state.
3 It will be given to dojo.undo.browser to represent the current application state.
4 */
5 ApplicationState = function(stateData, outputDivId, backForwardOutputDivId, bookmarkValue){
6         this.stateData = stateData;
7         this.outputDivId = outputDivId;
8         this.backForwardOutputDivId = backForwardOutputDivId;
9         this.changeUrl = bookmarkValue;
10 }
11
12 ApplicationState.prototype.back = function(){
13         this.showBackForwardMessage("BACK for State Data: " + this.stateData);
14         this.showStateData();
15 }
16
17 ApplicationState.prototype.forward = function(){
18         this.showBackForwardMessage("FORWARD for State Data: " + this.stateData);
19         this.showStateData();
20 }
21
22 ApplicationState.prototype.showStateData = function(){
23         dojo.byId(this.outputDivId).innerHTML += this.stateData + '<br />';
24 }
25
26 ApplicationState.prototype.showBackForwardMessage = function(message){
27         dojo.byId(this.backForwardOutputDivId).innerHTML += message + '<br />';
28 }