Dundee University HackU 2013 - Mojito

S
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!
1 sur 14

Recommandé

webstudy jquery par
webstudy jquerywebstudy jquery
webstudy jquerySeungho Han
999 vues20 diapositives
Going with style: Themes and apps for Magento Go par
Going with style: Themes and apps for Magento GoGoing with style: Themes and apps for Magento Go
Going with style: Themes and apps for Magento GoX.commerce
960 vues24 diapositives
Magento Dependency Injection par
Magento Dependency InjectionMagento Dependency Injection
Magento Dependency InjectionAnton Kril
995 vues31 diapositives
Php if par
Php ifPhp if
Php ifnurhardianti98
11 vues2 diapositives
Jquery.Tmpl par
Jquery.TmplJquery.Tmpl
Jquery.TmplLearningTech
899 vues21 diapositives
Require js and Magento2 par
Require js and Magento2Require js and Magento2
Require js and Magento2Irene Iaccio
947 vues38 diapositives

Contenu connexe

Tendances

Canjs par
CanjsCanjs
CanjsCherif Bouchelaghem
1.5K vues67 diapositives
Coisas para o blog par
Coisas para o blogCoisas para o blog
Coisas para o blogkarininhamiss
123 vues1 diapositive
PHPConf-TW 2012 # Twig par
PHPConf-TW 2012 # TwigPHPConf-TW 2012 # Twig
PHPConf-TW 2012 # TwigWake Liu
2.3K vues29 diapositives
Drupal Security par
Drupal SecurityDrupal Security
Drupal SecurityRan Bar-Zik
1.4K vues27 diapositives
Canjs par
CanjsCanjs
Canjsbitovi
5.9K vues28 diapositives
jQuery 實戰經驗講座 par
jQuery 實戰經驗講座jQuery 實戰經驗講座
jQuery 實戰經驗講座Jace Ju
1.3K vues55 diapositives

Tendances(19)

PHPConf-TW 2012 # Twig par Wake Liu
PHPConf-TW 2012 # TwigPHPConf-TW 2012 # Twig
PHPConf-TW 2012 # Twig
Wake Liu2.3K vues
Canjs par bitovi
CanjsCanjs
Canjs
bitovi5.9K vues
jQuery 實戰經驗講座 par Jace Ju
jQuery 實戰經驗講座jQuery 實戰經驗講座
jQuery 實戰經驗講座
Jace Ju1.3K vues
Optimizing Angular Performance in Enterprise Single Page Apps par Morgan Stone
Optimizing Angular Performance in Enterprise Single Page AppsOptimizing Angular Performance in Enterprise Single Page Apps
Optimizing Angular Performance in Enterprise Single Page Apps
Morgan Stone712 vues
Building an End-to-End AngularJS Application par Dan Wahlin
Building an End-to-End AngularJS ApplicationBuilding an End-to-End AngularJS Application
Building an End-to-End AngularJS Application
Dan Wahlin11.9K vues
Ejemplo para modificar el enlace de prezi para presentarlo en wordpress par gmrs81
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
gmrs8122 vues
Angular JS Routing par kennystoltz
Angular JS RoutingAngular JS Routing
Angular JS Routing
kennystoltz6.7K vues

Similaire à Dundee University HackU 2013 - Mojito

Introducing Rendr: Run your Backbone.js apps on the client and server par
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
39.7K vues82 diapositives
Jsf par
JsfJsf
JsfAnis Bouhachem Djer
1.1K vues40 diapositives
Big Data for each one of us par
Big Data for each one of usBig Data for each one of us
Big Data for each one of usOSCON Byrum
2.1K vues41 diapositives
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014 par
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014FalafelSoftware
957 vues29 diapositives
Opencast Admin UI - Introduction to developing using AngularJS par
Opencast Admin UI - Introduction to developing using AngularJSOpencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJSbuttyx
556 vues27 diapositives
AngularJS and SPA par
AngularJS and SPAAngularJS and SPA
AngularJS and SPALorenzo Dematté
1.3K vues38 diapositives

Similaire à Dundee University HackU 2013 - Mojito(20)

Introducing Rendr: Run your Backbone.js apps on the client and server par Spike Brehm
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 Brehm39.7K vues
Big Data for each one of us par OSCON Byrum
Big Data for each one of usBig Data for each one of us
Big Data for each one of us
OSCON Byrum2.1K vues
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014 par FalafelSoftware
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
FalafelSoftware957 vues
Opencast Admin UI - Introduction to developing using AngularJS par buttyx
Opencast Admin UI - Introduction to developing using AngularJSOpencast Admin UI - Introduction to developing using AngularJS
Opencast Admin UI - Introduction to developing using AngularJS
buttyx556 vues
Angular.js Fundamentals par Mark
Angular.js FundamentalsAngular.js Fundamentals
Angular.js Fundamentals
Mark 2.1K vues
Zend Framework 2 - Basic Components par Mateusz Tymek
Zend Framework 2  - Basic ComponentsZend Framework 2  - Basic Components
Zend Framework 2 - Basic Components
Mateusz Tymek5K vues
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS par murtazahaveliwala
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
AngularJS 101 - Everything you need to know to get started par Stéphane Bégaudeau
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

Dernier

ppt_dunarea.pptx par
ppt_dunarea.pptxppt_dunarea.pptx
ppt_dunarea.pptxvvvgeorgevvv
68 vues5 diapositives
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating... par
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...Taste
39 vues34 diapositives
MercerJesse3.0.pdf par
MercerJesse3.0.pdfMercerJesse3.0.pdf
MercerJesse3.0.pdfjessemercerail
183 vues6 diapositives
Essay On Econ par
Essay On EconEssay On Econ
Essay On EconAshley Fisher
121 vues89 diapositives
Introduction to AERO Supply Chain - #BEAERO Trainning program par
Introduction to AERO Supply Chain  - #BEAERO Trainning programIntroduction to AERO Supply Chain  - #BEAERO Trainning program
Introduction to AERO Supply Chain - #BEAERO Trainning programGuennoun Wajih
135 vues78 diapositives
Pharmaceutical Analysis PPT (BP 102T) par
Pharmaceutical Analysis PPT (BP 102T) Pharmaceutical Analysis PPT (BP 102T)
Pharmaceutical Analysis PPT (BP 102T) yakshpharmacy009
118 vues29 diapositives

Dernier(20)

Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating... par Taste
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Taste39 vues
Introduction to AERO Supply Chain - #BEAERO Trainning program par Guennoun Wajih
Introduction to AERO Supply Chain  - #BEAERO Trainning programIntroduction to AERO Supply Chain  - #BEAERO Trainning program
Introduction to AERO Supply Chain - #BEAERO Trainning program
Guennoun Wajih135 vues
11.30.23A Poverty and Inequality in America.pptx par mary850239
11.30.23A Poverty and Inequality in America.pptx11.30.23A Poverty and Inequality in America.pptx
11.30.23A Poverty and Inequality in America.pptx
mary850239228 vues
Education of marginalized and socially disadvantages segments.pptx par GarimaBhati5
Education of marginalized and socially disadvantages segments.pptxEducation of marginalized and socially disadvantages segments.pptx
Education of marginalized and socially disadvantages segments.pptx
GarimaBhati552 vues
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37 par MysoreMuleSoftMeetup
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
INT-244 Topic 6b Confucianism par S Meyer
INT-244 Topic 6b ConfucianismINT-244 Topic 6b Confucianism
INT-244 Topic 6b Confucianism
S Meyer51 vues
UNIT NO 13 ORGANISMS AND POPULATION.pptx par Madhuri Bhande
UNIT NO 13 ORGANISMS AND POPULATION.pptxUNIT NO 13 ORGANISMS AND POPULATION.pptx
UNIT NO 13 ORGANISMS AND POPULATION.pptx
Madhuri Bhande48 vues
JQUERY.pdf par ArthyR3
JQUERY.pdfJQUERY.pdf
JQUERY.pdf
ArthyR3114 vues
ANGULARJS.pdf par ArthyR3
ANGULARJS.pdfANGULARJS.pdf
ANGULARJS.pdf
ArthyR354 vues
GSoC 2024 .pdf par ShabNaz2
GSoC 2024 .pdfGSoC 2024 .pdf
GSoC 2024 .pdf
ShabNaz245 vues

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!