This file contains hidden or 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
YUI.add('metas', function (Y, NAME) { | |
Y.applyConfig({ | |
groups: { | |
app: Y.merge((Y.config.groups && Y.config.groups.app) || {}, { | |
modules: { | |
foo: { | |
path: "assets/foo.js", | |
requires: ["node"] | |
}, | |
bar: { |
This file contains hidden or 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
/*jslint anon:true, sloppy:true, nomen:true*/ | |
YUI.add('helperMojit', function(Y, NAME) { | |
function toLinkHelper(title, url) { | |
return "<a href='" + url + "'>" + title.toLowerCase() + "</a>"; | |
} | |
function highlightModuleHelper(mods, highlighted_module) { | |
var mod_names = []; |
This file contains hidden or 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
{ | |
"yui": { | |
"config": { | |
"groups": { | |
"app": { | |
"base": "/static/", | |
"comboBase": "/combo~", | |
"comboSep": "~", | |
"root": "/static/", | |
"combine": true |
This file contains hidden or 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
var HB = require('yui/handlebars').Handlebars; | |
var Y = require('yui/base'); | |
var helpers = { | |
foo: function () { | |
return 2; | |
} | |
}; | |
var t = HB.compile('{{foo}}/{{bar}}/{{#baz}}{{xyz}}{{/baz}}'); |
This file contains hidden or 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
========================= | |
Configuring YUI in Mojito | |
========================= | |
.. _yui_config-intro: | |
Overview | |
======== | |
Mojito allows you to configure the YUI seed file and use YUI groups for dynamically |
This file contains hidden or 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
{ | |
"name": "mojito-mojit-foo", | |
"description": "Mojit Foo Description", | |
"version": "0.1.0", | |
"author": { | |
"name": "Caridy Patino", | |
"email": "[email protected]" | |
}, | |
"yahoo": { | |
"mojito": { |
This file contains hidden or 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
/*jslint node:true*/ | |
'use strict'; | |
var express = require('express'), | |
mojito = require('mojito-server'), | |
locator = require('./locator.js'), | |
config = require('./conf/config'), | |
middleware = require('./lib/middleware'), |
This file contains hidden or 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
place-controller.js | |
handlePlaceCoordinator: function (runtime) { | |
var self = this, | |
place = self.models.get('place'), | |
photos = self.models.get('photos'), | |
placeId = runtime.params.id; | |
if (place.get('id') !== placeId) { |
This file contains hidden or 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
/*jslint node:true, nomen:true, stupid: true */ | |
'use strict'; | |
var Benchmark = require('benchmark').Benchmark, | |
Benchtable = require('benchtable'); | |
function getSuite(testName) { | |
var suite; | |
// enabling benchmark suite |
This file contains hidden or 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
YUI.add('bar', function (Y, NAME) { | |
Y[NAME] = true; | |
console.log(NAME); | |
}, '', {requires: ['baz']}); |