You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
3.1 KiB
85 lines
3.1 KiB
<html> |
|
<head> |
|
<script language="JavaScript" type="text/javascript"> |
|
// Dojo configuration |
|
djConfig = { |
|
//debugAtAllCosts: true, //Don't normally need this in applications. |
|
isDebug: true, |
|
dojoIframeHistoryUrl: "../../iframe_history.html", //for xdomain |
|
preventBackButtonFix: false |
|
}; |
|
</script> |
|
<script language="JavaScript" type="text/javascript" src="../../dojo.js"></script> |
|
<script language="JavaScript" type="text/javascript" src="browser/ApplicationState.js"></script> |
|
<script language="JavaScript" type="text/javascript"> |
|
dojo.require("dojo.lang.common"); |
|
dojo.require("dojo.undo.browser"); |
|
dojo.require("dojo.io.*"); |
|
//dojo.hostenv.writeIncludes(); //Don't normally need this in applications. |
|
|
|
var data = { |
|
link0: "This is the initial state (page first loaded)", |
|
link1: "This is data for link 1", |
|
link2: "This is data for link 2", |
|
link3: "This is data for link 3", |
|
link4: "This is data for link 4", |
|
link5: "This is data for link 5", |
|
link6: "This is data for link 6", |
|
link7: "This is data for link 7" |
|
}; |
|
|
|
function goNav(id){ |
|
var appState = new ApplicationState(data[id], "output", "dataOutput"); |
|
appState.showStateData(); |
|
dojo.undo.browser.addToHistory(appState); |
|
} |
|
|
|
dojo.addOnLoad(function(){ |
|
var appState = new ApplicationState(data["link0"], "output", "dataOutput"); |
|
appState.showStateData(); |
|
dojo.undo.browser.setInitialState(appState); |
|
}); |
|
</script> |
|
</head> |
|
<body> |
|
<div style="padding-bottom: 20px; width: 100%; border-bottom: 1px solid gray"> |
|
<h3>dojo.undo.browser test</h3> |
|
|
|
See the Dojo Book entry for |
|
<a href="http://manual.dojotoolkit.org/WikiHome/DojoDotBook/DocFn1">Back Button and Bookmarking</a>. |
|
|
|
<p>This page tests the dojo.undo.browser back/forward code. It <b>does not</b> |
|
use dojo.io.bind() or the bookmarking facility of dojo.undow.browser. For that test, |
|
see <a href="test_browser_bookmark.html">test_browser_bookmark.html</a>.</p> |
|
|
|
<p>The buttons that start with "Link" on them don't use any dojo.io.bind() calls, |
|
just JS data already in the page.</p> |
|
|
|
<ul> |
|
<li>Don't test this page using local disk for MSIE. MSIE will not |
|
create a history list for iframe_history.html if served from a file: |
|
URL. Serve the test pages from a web server to test in that browser.</li> |
|
<li>Safari 2.0.3+ (and probably 1.3.2+): Only the back button works OK |
|
(not the forward button).</li> |
|
<li>Opera 8.5.3: Does not work.</li> |
|
<li>Konqueror: Unknown. The latest may have Safari's behavior.</li> |
|
</ul> |
|
</div> |
|
<div style="float:left; padding: 20px"> |
|
<button onclick="goNav('link1')">Link 1</button><br /> |
|
<button onclick="goNav('link2')">Link 2</button><br /> |
|
<button onclick="goNav('link3')">Link 3</button><br /> |
|
<button onclick="goNav('link4')">Link 4</button><br /> |
|
<button onclick="goNav('link5')">Link 5</button><br /> |
|
<button onclick="goNav('link6')">Link 6</button><br /> |
|
<button onclick="goNav('link7')">Link 7</button><br /> |
|
</div> |
|
<div style="float: left; padding: 20px"> |
|
<b>Data Output:</b><br /> |
|
<div id="output"></div> |
|
<hr /> |
|
<i>Back/Forward Info:</i><br /> |
|
<div id="dataOutput"></div> |
|
</div> |
|
</body> |
|
</html>
|
|
|