This repository has been archived by the owner on Oct 30, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pulling in missing example application
- Loading branch information
Showing
11 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[{ | ||
"settings": [ "master" ], | ||
|
||
"specs": { | ||
"myBase": { | ||
"type": "HTMLFrameMojit", | ||
"config": { | ||
"deploy": true, | ||
"child": { | ||
"type": "myMojit" | ||
} | ||
} | ||
} | ||
} | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
|
||
}; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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']}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
21
examples/simple/part8/mojits/myMojit/lang/myMojit_en-US.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
21
examples/simple/part8/mojits/myMojit/models/model.server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
}; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<h1>{{title}}</h1> | ||
<div id="{{mojit_guid}}"> | ||
{{msg}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Start the Mojito application; | ||
|
||
> mojito start | ||
Then view in a browser; | ||
|
||
http://localhost:8666/ | ||
|
||
You can click on the text. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[{ | ||
"settings": [ "master" ], | ||
|
||
"index": { | ||
"verbs": ["get"], | ||
"path": "/", | ||
"call": "myBase.index" | ||
} | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}); |