Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
pulling in missing example application
Browse files Browse the repository at this point in the history
  • Loading branch information
drewfish committed May 27, 2012
1 parent 9368ef6 commit a819c14
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/simple/part8/application.json
@@ -0,0 +1,15 @@
[{
"settings": [ "master" ],

"specs": {
"myBase": {
"type": "HTMLFrameMojit",
"config": {
"deploy": true,
"child": {
"type": "myMojit"
}
}
}
}
}]
23 changes: 23 additions & 0 deletions examples/simple/part8/index.js
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/


/*jslint anon:true, sloppy:true, nomen:true, node:true*/


process.chdir(__dirname);


/**
* @param {object} config The configuration object containing processing params.
* @param {object} token Token used to identify the application.
*/
module.exports = function(config, token) {
var app = require('./server.js');

// Signal the application is ready, providing the token and app references.
process.emit('application-ready', token, app);
};
18 changes: 18 additions & 0 deletions examples/simple/part8/mojits/myMojit/binders/index.js
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/

YUI.add('myMojitBinder', function(Y, NAME) {

Y.namespace('mojito.binders')[NAME] = {

handleClick: function(event){

alert(event.currentTarget.getContent());
}

};

});
21 changes: 21 additions & 0 deletions examples/simple/part8/mojits/myMojit/controller.server.js
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/

YUI.add('myMojit', function(Y) {

Y.mojito.controller = {

index: function(ac) {

ac.models.message.get(function(data){

data.title = ac.intl.lang('TITLE');

ac.done(data);
});
}
};
}, '0.0.1', {requires: ['mojito-intl-addon']});
21 changes: 21 additions & 0 deletions examples/simple/part8/mojits/myMojit/lang/myMojit.js
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/

/*globals YUI */
YUI.add("lang/myMojit", function (Y) {

Y.Intl.add(

"myMojit",
"en",

{
TITLE: "My Mojit"
}

);

}, "0.0.1", { requires: ['intl'] });
21 changes: 21 additions & 0 deletions examples/simple/part8/mojits/myMojit/lang/myMojit_en-US.js
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/

/*globals YUI */
YUI.add("lang/myMojit_en-US", function (Y) {

Y.Intl.add(

"myMojit",
"en-US",

{
TITLE: "My Mojit in the US"
}

);

}, "0.0.1", { requires: ['intl'] });
21 changes: 21 additions & 0 deletions examples/simple/part8/mojits/myMojit/models/model.server.js
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/

YUI.add('myMojitModel', function(Y) {

Y.mojito.models.message = {

get: function(callback) {

var data = {
msg: 'Mojito is Working.'
};

callback(data);
}
};

});
4 changes: 4 additions & 0 deletions examples/simple/part8/mojits/myMojit/views/index.mu.html
@@ -0,0 +1,4 @@
<h1>{{title}}</h1>
<div id="{{mojit_guid}}">
{{msg}}
</div>
9 changes: 9 additions & 0 deletions examples/simple/part8/readme.md
@@ -0,0 +1,9 @@
Start the Mojito application;

> mojito start
Then view in a browser;

http://localhost:8666/

You can click on the text.
9 changes: 9 additions & 0 deletions examples/simple/part8/routes.json
@@ -0,0 +1,9 @@
[{
"settings": [ "master" ],

"index": {
"verbs": ["get"],
"path": "/",
"call": "myBase.index"
}
}]
7 changes: 7 additions & 0 deletions examples/simple/part8/server.js
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/

module.exports = require('mojito').createServer({dir:__dirname});

0 comments on commit a819c14

Please sign in to comment.