SlideShare a Scribd company logo
1 of 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!

More Related Content

What's hot

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
 

What's hot (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 to 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
 

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

Recently uploaded

Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
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
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 

Recently uploaded (20)

Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
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)
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 

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!