aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojo/tests/resources/ApplicationState.js
blob: a25e7ff85ed6d14687b24faab3fd7879446aec2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
ApplicationState is an object that represents the application state.
It will be given to dojo.undo.browser to represent the current application state.
*/
ApplicationState = function(stateData, outputDivId, backForwardOutputDivId, bookmarkValue){
	this.stateData = stateData;
	this.outputDivId = outputDivId;
	this.backForwardOutputDivId = backForwardOutputDivId;
	this.changeUrl = bookmarkValue;
}

ApplicationState.prototype.back = function(){
	this.showBackForwardMessage("BACK for State Data: " + this.stateData);
	this.showStateData();
}

ApplicationState.prototype.forward = function(){
	this.showBackForwardMessage("FORWARD for State Data: " + this.stateData);
	this.showStateData();
}

ApplicationState.prototype.showStateData = function(){
	dojo.byId(this.outputDivId).innerHTML += this.stateData + '<br />';
}

ApplicationState.prototype.showBackForwardMessage = function(message){
	dojo.byId(this.backForwardOutputDivId).innerHTML += message + '<br />';
}