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
| /** @jsx React.DOM */ | |
| var MyComponent = React.createClass({ | |
| render: function() { | |
| // Defaults in case the props are undefined. We'll have a solution for this | |
| // soon that is less awkward. | |
| var perMinute = this.props.perMinute || '-'; | |
| var perDay = this.props.perDay || '-'; | |
| return ( | |
| <div> | |
| <h3>Clickouts</h3> |
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
| function _render(name, data) { | |
| var ViewClass = Y.Views[Y.PNUtil.classify(name + '-view')] || Y.BaseView, | |
| foo = new ViewClass({ | |
| locals: data | |
| }); | |
| foo.render(); | |
| _expressRender(req.app.set('hack-layout'), { | |
| viewName: name, | |
| // TODO this belong to the render engine | |
| viewOutlet: function () { |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://documentcloud.github.io/underscore/underscore-min.js"></script> | |
| <script src="http://documentcloud.github.io/backbone/backbone-min.js"></script> | |
| <meta name="description" content="Test driving jQuery" /> | |
| <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css" /> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script> | |
| <meta charset=utf-8 /> |
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
| // Definition | |
| define('newsModel', [ 'Y.Model', 'Y.Models.DefaultModel'], function (newsModel) { | |
| // create the newsModel object | |
| var factory = function () { | |
| return { | |
| newsModel = Y.Base.create(xxx), | |
| init: function () { } | |
| }; | |
| }; |
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
| exportcsv: function (ac) { | |
| ac.model.get('mydb').fetch(function (err, data) { | |
| var csv = convert2csv(data); // csv is of type string | |
| ac.http.addHeader('content-type', 'application/vnd.ms-excel'); | |
| ac.http.addHeader("content-disposition", "attachment; filename=export"); | |
| ac.done(csv); | |
| }); |
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
| /* | |
| * Copyright (c) 2013, Yahoo! Inc. All rights reserved. | |
| * Copyrights licensed under the New BSD License. | |
| * See the accompanying LICENSE file for terms. | |
| */ | |
| /*jslint node: true, nomen: true */ | |
| "use strict"; |
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
| { | |
| // foo, get#foo-index | |
| "foo": { | |
| "path": "/foo", | |
| "verbs": [ "get" ], | |
| "call": "foo.index", | |
| "params": { src: "/foo" } | |
| }, | |
| // bar, get#foo-index | |
| "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
| { | |
| foo: { | |
| call: "foo.index", | |
| path: "/foo", | |
| verbs: [ "get" ] | |
| }, | |
| bar: { | |
| call: "foo.index", | |
| path: "/bar", | |
| verbs: [ "post" ] |
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
| "routes": { | |
| "homepage": { | |
| "path": "/", | |
| "method": "get", | |
| "keys": [], | |
| "regexp": {}, | |
| "annotations": { | |
| "name": "homepage", | |
| "dispatch": { | |
| "call": "home.index", |
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
| copy: function(oldObj) { | |
| var newObj, | |
| key, | |
| len, | |
| type, | |
| copy = Y.mojito.util.copy; | |
| if (!oldObj) { | |
| return oldObj; | |
| } |