Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
180 lines (146 sloc) 4.79 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 configData = {
"context":{
},
"binderMap":{
"mainMojit":{
"base":null,
"name":"HTMLMojitBinder",
"action":"index",
"config":{
},
"type":"HTMLMojit",
"viewId":"mainMojit",
"instanceId":"mainMojitA"
},
"rootMojit":{
"base":null,
"name":"TestRootMojitBinder",
"action":"index",
"config":{
},
"type":"mojito.TestRootMojit",
"viewId":"rootMojit",
"instanceId":"rootMojitA"
},
"msgMojit":{
"base":null,
"name":"MsgMojitBinder",
"action":"index",
"config":{
},
"type":"mojito.MsgMojit",
"viewId":"msgMojit",
"instanceId":"msgMojitA"
}
},
"routes":{
"root":{
"verbs":{
"GET":true
},
"path":"/",
"call":"frame.index",
"name":"root",
"params":{
},
"regex":{
},
"query":{
},
"requires":{
},
"ext_match":"^/$",
"int_match":"^$"
},
"msg":{
"verbs":{
"GET":true
},
"path":"/foo",
"call":"foo.bar",
"name":"msg",
"params":{
},
"regex":{
},
"query":{
},
"requires":{
},
"ext_match":"^/foo$",
"int_match":"^$"
}
}
};
// !END TODO!
var app = new Y.App();
new Y.mojito.Builder({configData: configData, appObj: app});
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.Controller.findAllControllers();
alert(Object.keys(stuff));
});
});
</script>
</head>
<body>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.