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

Commit

Permalink
merge archetype app/hybrid from develop
Browse files Browse the repository at this point in the history
TODO checked for 0.5.x?
  • Loading branch information
Isao Yagi committed Nov 27, 2012
1 parent 150e4bc commit b5666ce
Show file tree
Hide file tree
Showing 16 changed files with 590 additions and 0 deletions.
39 changes: 39 additions & 0 deletions lib/app/archetypes/app/hybrid/application.json.hb
@@ -0,0 +1,39 @@
[
{
"settings": [ "master" ],

"appPort": "{{port}}",

"specs": {
"frame": {
"base": "top_frame"
}
},

"staticHandling": {
"appName": "yahoo.application.{{name}}",
"prefix": "yahoo.application.{{name}}"
},

"builds": {
"hybridapp": {
"forceRelativePaths": true,
"urls": ["/yahoo.application.{{name}}/index.html"],
"packages": {
"yahoo.libs.yui": "*"
}
}
}
},

{
"settings": ["build:debug"],

"yui": {
"dependencyCalculations": "precomputed",
"base": "/yahoo.libs.yui/",
"url": "$$yui.base$$yui/yui-debug.js",
"loader": "loader/loader-debug.js"
}
}
]
Binary file added lib/app/archetypes/app/hybrid/assets/favicon.ico
Binary file not shown.
189 changes: 189 additions & 0 deletions lib/app/archetypes/app/hybrid/dimensions.json
@@ -0,0 +1,189 @@
[
{
"dimensions": [
{
"runtime": {
"common": {
"client": null,
"server": null
}
}
},
{
"device": {
"android": null,
"blackberry": null,
"iemobile": null,
"iphone": null,
"ipad": null,
"kindle": null,
"opera-mini": null,
"palm": null
}
},
{
"environment": {
"development": {
"dev": null,
"test": null
},
"production": {
"stage": null,
"prod": null
}
}
},
{
"build": {
"debug": null,
"release": null
}
},
{
"lang": {
"ar": {
"ar-JO": null,
"ar-MA": null,
"ar-SA": null,
"ar-EG": null
},
"bn": {
"bn-IN": null
},
"ca": {
"ca-ES": null
},
"cs": {
"cs-CZ": null
},
"da": {
"da-DK": null
},
"de": {
"de-AT": null,
"de-DE": null
},
"el": {
"el-GR": null
},
"en": {
"en-AU": null,
"en-BG": null,
"en-CA": null,
"en-GB": null,
"en-GY": null,
"en-HK": null,
"en-IE": null,
"en-IN": null,
"en-MY": null,
"en-NZ": null,
"en-PH": null,
"en-SG": null,
"en-US": null,
"en-ZA": null
},
"es": {
"es-AR": null,
"es-BO": null,
"es-CL": null,
"es-CO": null,
"es-EC": null,
"es-ES": null,
"es-MX": null,
"es-PE": null,
"es-PY": null,
"es-US": null,
"es-UY": null,
"es-VE": null
},
"fi": {
"fi-FI": null
},
"fr": {
"fr-BE": null,
"fr-CA": null,
"fr-FR": null,
"fr-GF": null
},
"hi": {
"hi-IN": null
},
"hu": {
"hu-HU": null
},
"id": {
"id-ID": null
},
"it": {
"it-IT": null
},
"ja": {
"ja-JP": null
},
"kn": {
"kn-IN": null
},
"ko": {
"ko-KR": null
},
"ml": {
"ml-IN": null
},
"mr": {
"mr-IN": null
},
"ms": {
"ms-MY": null
},
"nb": {
"nb-NO": null
},
"nl": {
"nl-BE": null,
"nl-NL": null,
"nl-SR": null
},
"pl": {
"pl-PL": null
},
"pt": {
"pt-BR": null
},
"ro": {
"ro-RO": null
},
"ru": {
"ru-RU": null
},
"sv": {
"sv-SE": null
},
"ta": {
"ta-IN": null
},
"te": {
"te-IN": null
},
"th": {
"th-TH": null
},
"tr": {
"tr-TR": null
},
"vi": {
"vi-VN": null
},
"zh": {
"zh-Hans": {
"zh-Hans-CN": null
},
"zh-Hant": {
"zh-Hant-HK": null,
"zh-Hant-TW": null
}
}
}
}
]
}
]
@@ -0,0 +1,2 @@
dt { font-weight: bold; }
.sel { background-color: #FF4; }
57 changes: 57 additions & 0 deletions lib/app/archetypes/app/hybrid/mojits/top_frame/binders/index.js.hb
@@ -0,0 +1,57 @@
/*
* Copyright (c) 2012 Yahoo! Inc. All rights reserved.
*/
/*jslint anon:true, sloppy:true, nomen:true*/
YUI.add('top_frameBinderIndex', function(Y, NAME) {

/**
* The top_frameBinderIndex module.
*
* @module top_frameBinderIndex
*/

/**
* Constructor for the top_frameBinderIndex class.
*
* @class top_frameBinderIndex
* @constructor
*/
Y.namespace('mojito.binders')[NAME] = {

/**
* Binder initialization method, invoked after all binders on the page
* have been constructed.
*/
init: function(mojitProxy) {
this.mojitProxy = mojitProxy;
},

/**
* The binder method, invoked to allow the mojit to attach DOM event
* handlers.
*
* @param node {Node} The DOM node to which this mojit is attached.
*/
bind: function(node) {
var me = this;
this.node = node;
/**
* Example code for the bind method:
*
* node.all('dt').on('mouseenter', function(evt) {
* var dd = '#dd_' + evt.target.get('text');
* me.node.one(dd).addClass('sel');
*
* });
* node.all('dt').on('mouseleave', function(evt) {
*
* var dd = '#dd_' + evt.target.get('text');
* me.node.one(dd).removeClass('sel');
*
* });
*/
}

};

}, '0.0.1', {requires: ['event-mouseenter', 'mojito-client']});
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2012 Yahoo! Inc. All rights reserved.
*/
/*jslint anon:true, sloppy:true, nomen:true*/
YUI.add('top_frame', function(Y, NAME) {

/**
* The top_frame module.
*
* @module top_frame
*/

/**
* Constructor for the Controller class.
*
* @class Controller
* @constructor
*/
Y.namespace('mojito.controllers')[NAME] = {

init: function(config) {
this.config = config;
},

/**
* Method corresponding to the 'index' action.
*
* @param ac {Object} The ActionContext that provides access
* to the Mojito API.
*/
index: function(ac) {
ac.models.top_frameModelFoo.getData(function(err, data) {
if (err) {
return ac.error(err);
}

ac.done({
status: 'Mojito is working.',
data: data
});
});
}

};

}, '0.0.1', {requires: ['mojito', 'top_frameModelFoo']});
@@ -0,0 +1,5 @@
[
{
"settings": [ "master" ]
}
]
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2012 Yahoo! Inc. All rights reserved.
*/
/*jslint anon:true, sloppy:true, nomen:true*/
YUI.add('top_frameModelFoo', function(Y, NAME) {

/**
* The top_frameModelFoo module.
*
* @module top_frame
*/

/**
* Constructor for the top_frameModelFoo class.
*
* @class top_frameModelFoo
* @constructor
*/
Y.namespace('mojito.models')[NAME] = {

init: function(config) {
this.config = config;
},

/**
* Method that will be invoked by the mojit controller to obtain data.
*
* @param callback {function(err,data)} The callback function to call when the
* data has been retrieved.
*/
getData: function(callback) {
callback(null, { some: 'data' });
}

};

}, '0.0.1', {requires: []});

0 comments on commit b5666ce

Please sign in to comment.