SlideShare une entreprise Scribd logo
1  sur  14
Yahoo! Mojito




            Neha Thaker
                 Yahoo!
What is Mojito?

• Mojito is a model-view-controller (MVC) application
  framework .
• Built on YUI 3
• Written in JavaScript
• Cross-Platform Apps
Why Mojito?

•   One Language
•   Two Runtimes
•   Views for Different Devices
•   Progressive Enhancement
•   Localization and Internationalization
What is Mojito
MVC Framework for Server + Client in One Language
Mojito Architecture
Mojito Applications
Creating a Mojito application
• Use the command-line tool mojito.
  – $ mojito create app <mojito_app>


• Create a mojit
  – $ mojito create mojit <mojito_app>
Application Directory Structure
[mojito_app]/
|-- application.json
|-- assets/
      -- favicon.icon
|-- yui_modules/
      -- *.{affinity}.js
|-- index.js
|-- mojits/
      -- [mojit_name]
               -- assets/
               -- yui_modules/
                           `-- *.{affinity}.js
               -- binders/
                           -- {view_name}.js
                -- controller.{affinity}.js
               -- defaults.json
               -- definition.json
               -- lang/
                           -- {mojit_name}_{lang}.js
               -- models/
                           -- {model_name}.{affinity}.js
               -- tests/
                           -- yui_modules/
                                       `-- {module_name}.{affinity}-tests.js
                           -- controller.{affinity}-tests.js
                           `-- models/
                                       -- {model_name}.{affinity}-tests.js
               -- views/
                           -- {view_name}.{view_engine}.html
                           -- {view_name}.{device}.{view_engine}.html
|-- package.json
|-- routes.json
|-- server.js
Configuration
application.json
{ "settings": [ "device:android" ], "selector": "android"
},
 { "settings": [ "device:blackberry" ], "selector":
"blackberry" },
 { "settings": [ "device:iphone" ], "selector": "iphone" }
routes.json
[ { "settings": [ "master" ], "simple": { "verbs": ["get"],
"path": "/", "call": "simple.index" } } ]
controller.server.js
YUI.add('simple', function(Y, NAME) {
  Y.namespace('mojito.controllers')[NAME] = {
       index: function(ac) {
          var today = new Date(),
          data = {
              type : 'simple',
              time : { hours: today.getHours()%12, minutes: today.getMinutes()<10 ? "0" +
today.getMinutes() : today.getMinutes(), period: today.getHours()>=12 ? "p.m." : "a.m."},
              show : true, hide : false,
              list : [{id: 2}, {id: 1}, {id: 3} ],
              hole : null,
              html : "<h3 style='color:red;'>simple html</h3>”
           }; ac.done(data);
        }
    };
 }, '0.0.1', {requires: []});
views/index.hb.html
<div id="{{mojit_view_id}}" class="mojit">
    <h2 style="color: #606; font-weight:bold;">Simple View</h2>
    <div>type: {{type}}</div>
    <div>time: {{#time}}{{hours}}:{{minutes}} {{period}}{{/time}}</div>
    <div>show: {{#show}}{{type}}{{/show}}</div>
    <div>hide: {{#hide}}{{type}}{{/hide}}</div>
    <div>no show: {{^show}}{{type}}{{/show}}</div>
    <div>no hide: {{^hide}}{{type}}{{/hide}}</div>
    <div>list: {{#list}}{{id}}{{/list}}</div>
    <div>hole: {{^hole}}no list{{/hole}}</div>
    <div>html: {{{html}}}</div>
</div>
Products built on Mojito

• AT&T Uverse app
• Yahoo!
  – Yahoo! Axis A search browser that provides a
    completely new way to search and browse the web.
  – Livestand – A personalized living magazine
  – Yahoo! Fantasy Finance –A stock trading game
  – Citizen Sports – Fantasy Premier League Football game
  – Search Direct – A search feature delivering rich
    components from Yahoo! Products.
Why Mojito?
• One language
• Device aware
• Use any library (jQuery, bootstrap, Dojo …)
  – With YUI
• Context aware
  – Server
  – Client
  – Universal!
Join the Mojito community!
          Thanks!

Contenu connexe

Tendances

PHPConf-TW 2012 # Twig
PHPConf-TW 2012 # TwigPHPConf-TW 2012 # Twig
PHPConf-TW 2012 # TwigWake Liu
 
jQuery 實戰經驗講座
jQuery 實戰經驗講座jQuery 實戰經驗講座
jQuery 實戰經驗講座Jace Ju
 
Optimizing Angular Performance in Enterprise Single Page Apps
Optimizing Angular Performance in Enterprise Single Page AppsOptimizing Angular Performance in Enterprise Single Page Apps
Optimizing Angular Performance in Enterprise Single Page AppsMorgan Stone
 
Building an End-to-End AngularJS Application
Building an End-to-End AngularJS ApplicationBuilding an End-to-End AngularJS Application
Building an End-to-End AngularJS ApplicationDan Wahlin
 
Typical customization pitfalls in Magento 2
Typical customization pitfalls in Magento 2Typical customization pitfalls in Magento 2
Typical customization pitfalls in Magento 2Magecom UK Limited
 
Ejemplo para modificar el enlace de prezi para presentarlo en wordpress
Ejemplo para modificar el enlace de prezi para presentarlo en wordpressEjemplo para modificar el enlace de prezi para presentarlo en wordpress
Ejemplo para modificar el enlace de prezi para presentarlo en wordpressgmrs81
 
Angular JS Routing
Angular JS RoutingAngular JS Routing
Angular JS Routingkennystoltz
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and ModernizrJussi Pohjolainen
 

Tendances (19)

Canjs
CanjsCanjs
Canjs
 
Coisas para o blog
Coisas para o blogCoisas para o blog
Coisas para o blog
 
PHPConf-TW 2012 # Twig
PHPConf-TW 2012 # TwigPHPConf-TW 2012 # Twig
PHPConf-TW 2012 # Twig
 
Drupal Security
Drupal SecurityDrupal Security
Drupal Security
 
Canjs
CanjsCanjs
Canjs
 
jQuery 實戰經驗講座
jQuery 實戰經驗講座jQuery 實戰經驗講座
jQuery 實戰經驗講座
 
Optimizing Angular Performance in Enterprise Single Page Apps
Optimizing Angular Performance in Enterprise Single Page AppsOptimizing Angular Performance in Enterprise Single Page Apps
Optimizing Angular Performance in Enterprise Single Page Apps
 
Building an End-to-End AngularJS Application
Building an End-to-End AngularJS ApplicationBuilding an End-to-End AngularJS Application
Building an End-to-End AngularJS Application
 
Typical customization pitfalls in Magento 2
Typical customization pitfalls in Magento 2Typical customization pitfalls in Magento 2
Typical customization pitfalls in Magento 2
 
Trabajo
TrabajoTrabajo
Trabajo
 
History frame
History frameHistory frame
History frame
 
Div id
Div idDiv id
Div id
 
Ror rails 2
Ror   rails 2Ror   rails 2
Ror rails 2
 
Ejemplo para modificar el enlace de prezi para presentarlo en wordpress
Ejemplo para modificar el enlace de prezi para presentarlo en wordpressEjemplo para modificar el enlace de prezi para presentarlo en wordpress
Ejemplo para modificar el enlace de prezi para presentarlo en wordpress
 
Angular JS Routing
Angular JS RoutingAngular JS Routing
Angular JS Routing
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and Modernizr
 
Get AngularJS Started!
Get AngularJS Started!Get AngularJS Started!
Get AngularJS Started!
 
RequireJS
RequireJSRequireJS
RequireJS
 
Font size
Font sizeFont size
Font size
 

Similaire à Dundee University HackU 2013 - Mojito

Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverSpike Brehm
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of usOSCON Byrum
 
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014FalafelSoftware
 
Opencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJSOpencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJSbuttyx
 
Angular.js Fundamentals
Angular.js FundamentalsAngular.js Fundamentals
Angular.js FundamentalsMark
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basicsAnton Narusberg
 
Zend Framework 2 - Basic Components
Zend Framework 2  - Basic ComponentsZend Framework 2  - Basic Components
Zend Framework 2 - Basic ComponentsMateusz Tymek
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSmurtazahaveliwala
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IVisual Engineering
 
Aurelia Meetup Paris
Aurelia Meetup ParisAurelia Meetup Paris
Aurelia Meetup ParisAhmed Radjdi
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedStéphane Bégaudeau
 

Similaire à Dundee University HackU 2013 - Mojito (20)

Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and server
 
Jsf
JsfJsf
Jsf
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of us
 
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
 
Opencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJSOpencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJS
 
AngularJS and SPA
AngularJS and SPAAngularJS and SPA
AngularJS and SPA
 
Angular.js Fundamentals
Angular.js FundamentalsAngular.js Fundamentals
Angular.js Fundamentals
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
 
Zend Framework 2 - Basic Components
Zend Framework 2  - Basic ComponentsZend Framework 2  - Basic Components
Zend Framework 2 - Basic Components
 
The Rails Way
The Rails WayThe Rails Way
The Rails Way
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
 
Backbone js
Backbone jsBackbone js
Backbone js
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte I
 
Aurelia Meetup Paris
Aurelia Meetup ParisAurelia Meetup Paris
Aurelia Meetup Paris
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
 
Built in filters
Built in filtersBuilt in filters
Built in filters
 
AngularJS On-Ramp
AngularJS On-RampAngularJS On-Ramp
AngularJS On-Ramp
 
Expressを使ってみた
Expressを使ってみたExpressを使ってみた
Expressを使ってみた
 
Stripes Framework
Stripes FrameworkStripes Framework
Stripes Framework
 

Dernier

AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxJanEmmanBrigoli
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxElton John Embodo
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 

Dernier (20)

AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 

Dundee University HackU 2013 - Mojito

  • 1. Yahoo! Mojito Neha Thaker Yahoo!
  • 2. What is Mojito? • Mojito is a model-view-controller (MVC) application framework . • Built on YUI 3 • Written in JavaScript • Cross-Platform Apps
  • 3. Why Mojito? • One Language • Two Runtimes • Views for Different Devices • Progressive Enhancement • Localization and Internationalization
  • 4. What is Mojito MVC Framework for Server + Client in One Language
  • 7. Creating a Mojito application • Use the command-line tool mojito. – $ mojito create app <mojito_app> • Create a mojit – $ mojito create mojit <mojito_app>
  • 8. Application Directory Structure [mojito_app]/ |-- application.json |-- assets/ -- favicon.icon |-- yui_modules/ -- *.{affinity}.js |-- index.js |-- mojits/ -- [mojit_name] -- assets/ -- yui_modules/ `-- *.{affinity}.js -- binders/ -- {view_name}.js -- controller.{affinity}.js -- defaults.json -- definition.json -- lang/ -- {mojit_name}_{lang}.js -- models/ -- {model_name}.{affinity}.js -- tests/ -- yui_modules/ `-- {module_name}.{affinity}-tests.js -- controller.{affinity}-tests.js `-- models/ -- {model_name}.{affinity}-tests.js -- views/ -- {view_name}.{view_engine}.html -- {view_name}.{device}.{view_engine}.html |-- package.json |-- routes.json |-- server.js
  • 9. Configuration application.json { "settings": [ "device:android" ], "selector": "android" }, { "settings": [ "device:blackberry" ], "selector": "blackberry" }, { "settings": [ "device:iphone" ], "selector": "iphone" } routes.json [ { "settings": [ "master" ], "simple": { "verbs": ["get"], "path": "/", "call": "simple.index" } } ]
  • 10. controller.server.js YUI.add('simple', function(Y, NAME) { Y.namespace('mojito.controllers')[NAME] = { index: function(ac) { var today = new Date(), data = { type : 'simple', time : { hours: today.getHours()%12, minutes: today.getMinutes()<10 ? "0" + today.getMinutes() : today.getMinutes(), period: today.getHours()>=12 ? "p.m." : "a.m."}, show : true, hide : false, list : [{id: 2}, {id: 1}, {id: 3} ], hole : null, html : "<h3 style='color:red;'>simple html</h3>” }; ac.done(data); } }; }, '0.0.1', {requires: []});
  • 11. views/index.hb.html <div id="{{mojit_view_id}}" class="mojit"> <h2 style="color: #606; font-weight:bold;">Simple View</h2> <div>type: {{type}}</div> <div>time: {{#time}}{{hours}}:{{minutes}} {{period}}{{/time}}</div> <div>show: {{#show}}{{type}}{{/show}}</div> <div>hide: {{#hide}}{{type}}{{/hide}}</div> <div>no show: {{^show}}{{type}}{{/show}}</div> <div>no hide: {{^hide}}{{type}}{{/hide}}</div> <div>list: {{#list}}{{id}}{{/list}}</div> <div>hole: {{^hole}}no list{{/hole}}</div> <div>html: {{{html}}}</div> </div>
  • 12. Products built on Mojito • AT&T Uverse app • Yahoo! – Yahoo! Axis A search browser that provides a completely new way to search and browse the web. – Livestand – A personalized living magazine – Yahoo! Fantasy Finance –A stock trading game – Citizen Sports – Fantasy Premier League Football game – Search Direct – A search feature delivering rich components from Yahoo! Products.
  • 13. Why Mojito? • One language • Device aware • Use any library (jQuery, bootstrap, Dojo …) – With YUI • Context aware – Server – Client – Universal!
  • 14. Join the Mojito community! Thanks!