Find file
Fetching contributors…
Cannot retrieve contributors at this time
97 lines (76 sloc) 2.74 KB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- ================================================================= -->
<!--
NAME: index.html
AUTH: William J Edney (wje)
NOTE: Copyright (C) 2012 Yahoo! Inc.
-->
<!-- ================================================================= -->
<html>
<head>
<title>A Mojito / YAF integration test project</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
#Message
{
position: absolute;
border: solid 1px black;
left: 10%;
right: 10%;
bottom: 0px;
height: 2em;
}
.mojit
{
border: solid 1px black;
}
</style>
<!-- The fully minified version of YUI -->
<script type="text/javascript"
src="http://yui.yahooapis.com/3.7.2/build/yui/yui-min.js"></script>
<!-- The debug version of YUI -->
<!--
<script type="text/javascript">
// Put YUI in debug mode so that we can step through it.
YUI_config = {filter: 'debug', useConsoleOutput: true};
</script>
<script type="text/javascript" src="http://yui.yahooapis.com/3.7.2/build/yui/yui-debug.js"></script>
-->
<script type="text/javascript" src="./lib/mojito-yaf.js"></script>
<script type="text/javascript" src="./lib/mojits/HTMLMojit/controller.client.js"></script>
<script type="text/javascript" src="./tests/test-dispatch.js"></script>
<script type="text/javascript" src="./tests/mojits/TestRootMojit/controller.client.js"></script>
<script type="text/javascript" src="./tests/mojits/MsgMojit/controller.client.js"></script>
<script type="text/javascript">
YUI().use('mojito-yaf', 'HTMLMojit', 'TestRootMojit', 'MsgMojit', function (Y) {
// ---
// !TODO! Hardcoded data in lieu of application.json / routes.json
// This is a hack for this test!
var instanceMap = {
'mainMojit' : 'mojito.HTMLMojit',
'rootMojit' : 'mojito.TestRootMojit',
'msgMojit' : 'mojito.MsgMojit'
};
// !END TODO!
var app = new Y.mojito.App({instData: instanceMap});
app.navigate('/');
// ---
Y.one('#navigateButton').on('click',
function () {
app.navigate('/msgMojit:index');
});
Y.one('#goToFooRoute').on('click',
function () {
app.navigate('/foo');
});
Y.one('#alertAllMojits').on('click',
function () {
var stuff = Y.mojito.Mojit.findAllMojits();
alert(Object.keys(stuff));
});
});
</script>
</head>
<body>
</body>
</html>