SlideShare una empresa de Scribd logo
1 de 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!

Más contenido relacionado

La actualidad más candente

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
gmrs81
 
Short intro to JQuery and Modernizr
Short intro to JQuery and ModernizrShort intro to JQuery and Modernizr
Short intro to JQuery and Modernizr
Jussi Pohjolainen
 

La actualidad más candente (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
 

Similar a 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 server
Spike 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 us
OSCON Byrum
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
Anton Narusberg
 

Similar a 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
 

Último

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 

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!