SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Downloaden Sie, um offline zu lesen
A Mobile App
                Development Toolkit
                Rebecca Murphey & Dan Imal
                Boston Front End Developer Meetup
                January 2012



Tuesday, January 24, 12
Rebecca Murphey
                          Lead JavaScript Developer
                          @rmurphey

                          Dan Imal
                          Senior User Experience Developer
                          @mrdanimal



Tuesday, January 24, 12
Tuesday, January 24, 12
linkage
                mulberry.toura.com
                bit.ly/toura-mulberry
                bit.ly/toura-mulberry-demos




Tuesday, January 24, 12
Tuesday, January 24, 12
Tuesday, January 24, 12
command line tools
                scaffold your app and
                generate skeleton
                 les for the pieces
                you’ll need
                application code
                harness a powerful
                CSS and JavaScript
                framework to develop
                rich interfaces
                app builder
                generates production-
                ready builds for
                Android, iOS (mobile
                web is on the way)


Tuesday, January 24, 12
Callback
               Cordova


Tuesday, January 24, 12
$ mulberry scaffold recipes




Tuesday, January 24, 12
Tuesday, January 24, 12
Tuesday, January 24, 12
$ mulberry generate




Tuesday, January 24, 12
dramatic pause.




Tuesday, January 24, 12
Tuesday, January 24, 12
create content with
                          yaml, markdown & html




Tuesday, January 24, 12
create functionality with javascript




Tuesday, January 24, 12
create styles with css & sass




Tuesday, January 24, 12
Tuesday, January 24, 12
$ mulberry serve




Tuesday, January 24, 12
ohai sane development tools.




Tuesday, January 24, 12
$ mulberry test




Tuesday, January 24, 12
Tuesday, January 24, 12
Tuesday, January 24, 12
$ mulberry deploy




Tuesday, January 24, 12
it’s just javascript.
                (ok, and some haml, yaml, & sass.)




Tuesday, January 24, 12
todos:
                            capabilities:
                            - name: PageTodos
                            screens:
                              - name: index
                                regions:
                                  - components:
                                     - custom.TodoForm
                                  - className: list
                                    scrollable: true
                                    components:
                                     - custom.TodoList
                                  - components:
                                     - custom.TodoTools




                          NB: You can define this with JavaScript, too,
                          using toura.pageDef(‘todos’, { ... }).




Tuesday, January 24, 12
$YOURAPP/javascript/routes.js

        mulberry.page('/todos', {
          name : 'Todos',
          pageDef : 'todos'
        }, true);

        mulberry.page('/completed', {
          name : 'Completed',
          pageDef : 'completed'
        });




                                        #/todos   #/completed

Tuesday, January 24, 12
$YOURAPP/javascript/components/TodoForm.js


           mulberry.component('TodoForm', {
             componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'),

               init : function() {
                 this.connect(this.domNode, 'submit', function(e) {
                   e.preventDefault();

                      var description = dojo.trim(this.descriptionInput.value),
                          item;

                      if (!description) { return; }

                      item = { description : description };
                      this.domNode.reset();
                      this.onAdd(item);
                    });
               },

             onAdd : function(item) { }
           });




Tuesday, January 24, 12
$YOURAPP/javascript/components/TodoForm/TodoForm.haml

                 %form.component.todo-form
                   %input{ placeholder : 'New todo', dojoAttachPoint : 'descriptionInput' }
                   %button{ dojoAttachPoint : 'saveButton' } Add




Tuesday, January 24, 12
$YOURAPP/javascript/stores/todos.js

                mulberry.store('todos', {
                  model : 'Todo',

                    finish : function(id) {
                       this.invoke(id, 'finish');
                    },

                  unfinish : function(id) {
                    this.invoke(id, 'unfinish');
                  }
                });




Tuesday, January 24, 12
$YOURAPP/javascript/models/Todo.js

                mulberry.model('Todo', {
                  complete : false,

                    finish : function() {
                       this.set('complete', true);
                    },

                  unfinish : function() {
                    this.set('complete', false);
                  }
                });




Tuesday, January 24, 12
@touradev @rmurphey @mrdanimal
                mulberry.toura.com
                bit.ly/toura-mulberry
                bit.ly/toura-mulberry-demos


Tuesday, January 24, 12
Tuesday, January 24, 12
routes manage high-level application state
                components receive and render data,
                and react to user input
                capabilities provide data to components,
                and broker communications between them
                page de nitions reusable groupings
                of components and capabilities
                stores persist data on the device, make that
                data query-able, and return model instances


Tuesday, January 24, 12
routes manage high-level application state




Tuesday, January 24, 12
$YOURAPP/javascript/routes.js

        mulberry.page('/todos', {
          name : 'Todos',
          pageDef : 'todos'
        }, true);

        mulberry.page('/completed', {
          name : 'Completed',
          pageDef : 'completed'
        });




                                        #/todos   #/completed

Tuesday, January 24, 12
stores persist data on the device, make that
                data query-able, and return model instances




Tuesday, January 24, 12
$YOURAPP/javascript/stores/todos.js

                      mulberry.store('todos', {
                        model : 'Todo',

                          finish : function(id) {
                             this.invoke(id, 'finish');
                          },

                        unfinish : function(id) {
                          this.invoke(id, 'unfinish');
                        }
                      });




Tuesday, January 24, 12
page de nitions reusable groupings
                of components and capabilities




Tuesday, January 24, 12
todos:
                            capabilities:
                            - name: PageTodos
                            screens:
                              - name: index
                                regions:
                                  - components:
                                     - custom.TodoForm
                                  - className: list
                                    scrollable: true
                                    components:
                                     - custom.TodoList
                                  - components:
                                     - custom.TodoTools




                          NB: You can define this with JavaScript, too,
                          using toura.pageDef(‘todos’, { ... }).




Tuesday, January 24, 12
components receive and render data,
                and react to user input




Tuesday, January 24, 12
$YOURAPP/javascript/components/TodoForm.js


           mulberry.component('TodoForm', {
             componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'),

               init : function() {
                 this.connect(this.domNode, 'submit', function(e) {
                   e.preventDefault();

                      var description = dojo.trim(this.descriptionInput.value),
                          item;

                      if (!description) { return; }

                      item = { description : description };
                      this.domNode.reset();
                      this.onAdd(item);
                    });
               },

             onAdd : function(item) { }
           });




Tuesday, January 24, 12
$YOURAPP/javascript/components/TodoForm/TodoForm.haml

                 %form.component.todo-form
                   %input{ placeholder : 'New todo', dojoAttachPoint : 'descriptionInput' }
                   %button{ dojoAttachPoint : 'saveButton' } Add




Tuesday, January 24, 12
$YOURAPP/javascript/components/TodoForm.js


           mulberry.component('TodoForm', {
             componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'),

               init : function() {
                 this.connect(this.domNode, 'submit', function(e) {
                   e.preventDefault();

                      var description = dojo.trim(this.descriptionInput.value),
                          item;

                      if (!description) { return; }

                      item = { description : description };
                      this.domNode.reset();
                      this.onAdd(item);
                    });
               },

             onAdd : function(item) { }
           });




Tuesday, January 24, 12
capabilities provide data to components,
                and broker communications between them




Tuesday, January 24, 12
mulberry.capability('PageTodos', {
            todos:
                                              requirements : {
              capabilities:
                                                 todoList : 'custom.TodoList',
              - name: PageTodos
                                                 todoForm : 'custom.TodoForm',
              screens:
                                                 todoTools : 'custom.TodoTools'
                - name: index
                                              },
                  regions:
                    - components:
                                              connects : [
                       - custom.TodoForm
                                                 [ 'todoForm', 'onAdd', '_add' ],
                    - className: list
                                                 [ 'todoList', 'onComplete', '_complete' ],
                      scrollable: true
                                                 [ 'todoList', 'onDelete', '_delete' ],
                      components:
                                                 [ 'todoTools', 'onCompleteAll', '_completeAll' ]
                       - custom.TodoList
                                              ],
                    - components:
                       - custom.TodoTools
                                              init : function() {
                                                 this.todos = client.stores.todos;
                                                 this._updateList();
                                              },

                                              _add : function(item) {
                                                 this.todos.add(item);
                                                 this._updateList();
                                              },

                                             _delete : function(id) {
                                                 this.todos.remove(id);
                                                 this._updateList();
                                              },


Tuesday, January 24, 12                       _complete : function(id) {
mulberry.capability('PageTodos', {
            todos:
                                              requirements : {
              capabilities:
                                                 todoList : 'custom.TodoList',
              - name: PageTodos
                                                 todoForm : 'custom.TodoForm',
              screens:
                                                 todoTools : 'custom.TodoTools'
                - name: index
                                              },
                  regions:
                    - components:
                                              connects : [
                       - custom.TodoForm
                                                 [ 'todoForm', 'onAdd', '_add' ],
                    - className: list
                                                 [ 'todoList', 'onComplete', '_complete' ],
                      scrollable: true
                                                 [ 'todoList', 'onDelete', '_delete' ],
                      components:
                                                 [ 'todoTools', 'onCompleteAll', '_completeAll' ]
                       - custom.TodoList
                                              ],
                    - components:
                       - custom.TodoTools
                                              init : function() {
                                                 this.todos = client.stores.todos;
                                                 this._updateList();
                                              },

                                              _add : function(item) {
                                                 this.todos.add(item);
                                                 this._updateList();
                                              },

                                             _delete : function(id) {
                                                 this.todos.remove(id);
                                                 this._updateList();
                                              },


Tuesday, January 24, 12                       _complete : function(id) {
mulberry.capability('PageTodos', {
            todos:
                                              requirements : {
              capabilities:
                                                 todoList : 'custom.TodoList',
              - name: PageTodos
                                                 todoForm : 'custom.TodoForm',
              screens:
                                                 todoTools : 'custom.TodoTools'
                - name: index
                                              },
                  regions:
                    - components:
                                              connects : [
                       - custom.TodoForm
                                                 [ 'todoForm', 'onAdd', '_add' ],
                    - className: list
                                                 [ 'todoList', 'onComplete', '_complete' ],
                      scrollable: true
                                                 [ 'todoList', 'onDelete', '_delete' ],
                      components:
                                                 [ 'todoTools', 'onCompleteAll', '_completeAll' ]
                       - custom.TodoList
                                              ],
                    - components:
                       - custom.TodoTools
                                              init : function() {
                                                 this.todos = client.stores.todos;
                                                 this._updateList();
                                              },

                                              _add : function(item) {
                                                 this.todos.add(item);
                                                 this._updateList();
                                              },

                                             _delete : function(id) {
                                                 this.todos.remove(id);
                                                 this._updateList();
                                              },


Tuesday, January 24, 12                       _complete : function(id) {

Weitere ähnliche Inhalte

Andere mochten auch

Proyectos Tecnológicos
Proyectos TecnológicosProyectos Tecnológicos
Proyectos Tecnológicosguestd0064fb
 
Tecnologia cuarto
Tecnologia cuartoTecnologia cuarto
Tecnologia cuartoLeonel47
 
Influencia de la_tecnologia_en_la_sociedad
Influencia de la_tecnologia_en_la_sociedadInfluencia de la_tecnologia_en_la_sociedad
Influencia de la_tecnologia_en_la_sociedadKagomeNekosawa
 
Introduction to Business Strategy Development & Strategy Execution
Introduction to Business Strategy Development & Strategy ExecutionIntroduction to Business Strategy Development & Strategy Execution
Introduction to Business Strategy Development & Strategy ExecutionFlevy.com Best Practices
 
Proyecto Tecnologico Para 4° Y 5° De Primaria
Proyecto Tecnologico Para 4° Y 5° De PrimariaProyecto Tecnologico Para 4° Y 5° De Primaria
Proyecto Tecnologico Para 4° Y 5° De Primariaguestc14d1b
 
Ejemplo de un proyecto de tecnología
Ejemplo de un proyecto de tecnologíaEjemplo de un proyecto de tecnología
Ejemplo de un proyecto de tecnologíaGabriel Diaz
 
Secuencia didáctica Tecnología-herramientas manuales 1º grado
Secuencia didáctica Tecnología-herramientas manuales 1º gradoSecuencia didáctica Tecnología-herramientas manuales 1º grado
Secuencia didáctica Tecnología-herramientas manuales 1º gradoLaura Soluaga
 
Proyecto Reciclaje
Proyecto ReciclajeProyecto Reciclaje
Proyecto Reciclajealetopher94
 

Andere mochten auch (11)

Proyectos Tecnológicos
Proyectos TecnológicosProyectos Tecnológicos
Proyectos Tecnológicos
 
Tecnologia cuarto
Tecnologia cuartoTecnologia cuarto
Tecnologia cuarto
 
Influencia de la_tecnologia_en_la_sociedad
Influencia de la_tecnologia_en_la_sociedadInfluencia de la_tecnologia_en_la_sociedad
Influencia de la_tecnologia_en_la_sociedad
 
Introduction to Business Strategy Development & Strategy Execution
Introduction to Business Strategy Development & Strategy ExecutionIntroduction to Business Strategy Development & Strategy Execution
Introduction to Business Strategy Development & Strategy Execution
 
Proyecto Tecnologico Para 4° Y 5° De Primaria
Proyecto Tecnologico Para 4° Y 5° De PrimariaProyecto Tecnologico Para 4° Y 5° De Primaria
Proyecto Tecnologico Para 4° Y 5° De Primaria
 
Proyecto Tecnologico
Proyecto TecnologicoProyecto Tecnologico
Proyecto Tecnologico
 
Ejemplo de un proyecto de tecnología
Ejemplo de un proyecto de tecnologíaEjemplo de un proyecto de tecnología
Ejemplo de un proyecto de tecnología
 
Proyecto de reciclaje 2014
Proyecto de reciclaje 2014Proyecto de reciclaje 2014
Proyecto de reciclaje 2014
 
Secuencia didáctica Tecnología-herramientas manuales 1º grado
Secuencia didáctica Tecnología-herramientas manuales 1º gradoSecuencia didáctica Tecnología-herramientas manuales 1º grado
Secuencia didáctica Tecnología-herramientas manuales 1º grado
 
Proyecto Reciclaje
Proyecto ReciclajeProyecto Reciclaje
Proyecto Reciclaje
 
PROYECTO RECICLAR PARA CREAR ARTE
PROYECTO RECICLAR PARA CREAR ARTEPROYECTO RECICLAR PARA CREAR ARTE
PROYECTO RECICLAR PARA CREAR ARTE
 

Ähnlich wie Getting Started with Mulberry

jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptGuy Royse
 
JQuery In Drupal
JQuery In DrupalJQuery In Drupal
JQuery In Drupalkatbailey
 
JavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to knowJavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to knowkatbailey
 
JavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to knowJavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to knowWork at Play
 
Kharkivpy#3: Javascript and Python backend
Kharkivpy#3: Javascript and Python backendKharkivpy#3: Javascript and Python backend
Kharkivpy#3: Javascript and Python backendMax Klymyshyn
 
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQueryJavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuerykatbailey
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebJames Rakich
 
Mobile Day - React Native
Mobile Day - React NativeMobile Day - React Native
Mobile Day - React NativeSoftware Guru
 
Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalystsvilen.ivanov
 
Drupal & javascript
Drupal & javascriptDrupal & javascript
Drupal & javascriptAlmog Baku
 
Rails Model Basics
Rails Model BasicsRails Model Basics
Rails Model BasicsJames Gray
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript FrameworkAll Things Open
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteDr Nic Williams
 
Beyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance JavascriptBeyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance Javascriptaglemann
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
Introduction To Ruby On Rails
Introduction To Ruby On RailsIntroduction To Ruby On Rails
Introduction To Ruby On RailsSteve Keener
 
Drupal Javascript for developers
Drupal Javascript for developersDrupal Javascript for developers
Drupal Javascript for developersDream Production AG
 

Ähnlich wie Getting Started with Mulberry (20)

jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 
JQuery In Drupal
JQuery In DrupalJQuery In Drupal
JQuery In Drupal
 
JavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to knowJavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to know
 
JavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to knowJavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to know
 
Kharkivpy#3: Javascript and Python backend
Kharkivpy#3: Javascript and Python backendKharkivpy#3: Javascript and Python backend
Kharkivpy#3: Javascript and Python backend
 
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQueryJavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuery
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Mobile Day - React Native
Mobile Day - React NativeMobile Day - React Native
Mobile Day - React Native
 
Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalyst
 
Drupal & javascript
Drupal & javascriptDrupal & javascript
Drupal & javascript
 
WebGL and three.js
WebGL and three.jsWebGL and three.js
WebGL and three.js
 
Rails Model Basics
Rails Model BasicsRails Model Basics
Rails Model Basics
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - Keynote
 
Beyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance JavascriptBeyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance Javascript
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Introduction To Ruby On Rails
Introduction To Ruby On RailsIntroduction To Ruby On Rails
Introduction To Ruby On Rails
 
Drupal Javascript for developers
Drupal Javascript for developersDrupal Javascript for developers
Drupal Javascript for developers
 

Mehr von Rebecca Murphey

Beyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS AppsBeyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS AppsRebecca Murphey
 
DojoConf: Building Large Apps
DojoConf: Building Large AppsDojoConf: Building Large Apps
DojoConf: Building Large AppsRebecca Murphey
 
Lessons from-a-rewrite-gotham
Lessons from-a-rewrite-gothamLessons from-a-rewrite-gotham
Lessons from-a-rewrite-gothamRebecca Murphey
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryRebecca Murphey
 
Functionality Focused Code Organization
Functionality Focused Code OrganizationFunctionality Focused Code Organization
Functionality Focused Code OrganizationRebecca Murphey
 
Delivering a Responsive UI
Delivering a Responsive UIDelivering a Responsive UI
Delivering a Responsive UIRebecca Murphey
 

Mehr von Rebecca Murphey (13)

Beyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS AppsBeyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS Apps
 
BVJS
BVJSBVJS
BVJS
 
Introducing Mulberry
Introducing MulberryIntroducing Mulberry
Introducing Mulberry
 
DojoConf: Building Large Apps
DojoConf: Building Large AppsDojoConf: Building Large Apps
DojoConf: Building Large Apps
 
Lessons from-a-rewrite-gotham
Lessons from-a-rewrite-gothamLessons from-a-rewrite-gotham
Lessons from-a-rewrite-gotham
 
Lessons from a Rewrite
Lessons from a RewriteLessons from a Rewrite
Lessons from a Rewrite
 
Modern JavaScript
Modern JavaScriptModern JavaScript
Modern JavaScript
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQuery
 
Functionality Focused Code Organization
Functionality Focused Code OrganizationFunctionality Focused Code Organization
Functionality Focused Code Organization
 
The jQuery Divide
The jQuery DivideThe jQuery Divide
The jQuery Divide
 
Delivering a Responsive UI
Delivering a Responsive UIDelivering a Responsive UI
Delivering a Responsive UI
 
Dojo Confessions
Dojo ConfessionsDojo Confessions
Dojo Confessions
 
Jquery Fundamentals
Jquery FundamentalsJquery Fundamentals
Jquery Fundamentals
 

Kürzlich hochgeladen

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Kürzlich hochgeladen (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Getting Started with Mulberry

  • 1. A Mobile App Development Toolkit Rebecca Murphey & Dan Imal Boston Front End Developer Meetup January 2012 Tuesday, January 24, 12
  • 2. Rebecca Murphey Lead JavaScript Developer @rmurphey Dan Imal Senior User Experience Developer @mrdanimal Tuesday, January 24, 12
  • 4. linkage mulberry.toura.com bit.ly/toura-mulberry bit.ly/toura-mulberry-demos Tuesday, January 24, 12
  • 7. command line tools scaffold your app and generate skeleton les for the pieces you’ll need application code harness a powerful CSS and JavaScript framework to develop rich interfaces app builder generates production- ready builds for Android, iOS (mobile web is on the way) Tuesday, January 24, 12
  • 8. Callback Cordova Tuesday, January 24, 12
  • 9. $ mulberry scaffold recipes Tuesday, January 24, 12
  • 15. create content with yaml, markdown & html Tuesday, January 24, 12
  • 16. create functionality with javascript Tuesday, January 24, 12
  • 17. create styles with css & sass Tuesday, January 24, 12
  • 19. $ mulberry serve Tuesday, January 24, 12
  • 20. ohai sane development tools. Tuesday, January 24, 12
  • 21. $ mulberry test Tuesday, January 24, 12
  • 24. $ mulberry deploy Tuesday, January 24, 12
  • 25. it’s just javascript. (ok, and some haml, yaml, & sass.) Tuesday, January 24, 12
  • 26. todos: capabilities: - name: PageTodos screens: - name: index regions: - components: - custom.TodoForm - className: list scrollable: true components: - custom.TodoList - components: - custom.TodoTools NB: You can define this with JavaScript, too, using toura.pageDef(‘todos’, { ... }). Tuesday, January 24, 12
  • 27. $YOURAPP/javascript/routes.js mulberry.page('/todos', { name : 'Todos', pageDef : 'todos' }, true); mulberry.page('/completed', { name : 'Completed', pageDef : 'completed' }); #/todos #/completed Tuesday, January 24, 12
  • 28. $YOURAPP/javascript/components/TodoForm.js mulberry.component('TodoForm', { componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'), init : function() { this.connect(this.domNode, 'submit', function(e) { e.preventDefault(); var description = dojo.trim(this.descriptionInput.value), item; if (!description) { return; } item = { description : description }; this.domNode.reset(); this.onAdd(item); }); }, onAdd : function(item) { } }); Tuesday, January 24, 12
  • 29. $YOURAPP/javascript/components/TodoForm/TodoForm.haml %form.component.todo-form %input{ placeholder : 'New todo', dojoAttachPoint : 'descriptionInput' } %button{ dojoAttachPoint : 'saveButton' } Add Tuesday, January 24, 12
  • 30. $YOURAPP/javascript/stores/todos.js mulberry.store('todos', { model : 'Todo', finish : function(id) { this.invoke(id, 'finish'); }, unfinish : function(id) { this.invoke(id, 'unfinish'); } }); Tuesday, January 24, 12
  • 31. $YOURAPP/javascript/models/Todo.js mulberry.model('Todo', { complete : false, finish : function() { this.set('complete', true); }, unfinish : function() { this.set('complete', false); } }); Tuesday, January 24, 12
  • 32. @touradev @rmurphey @mrdanimal mulberry.toura.com bit.ly/toura-mulberry bit.ly/toura-mulberry-demos Tuesday, January 24, 12
  • 34. routes manage high-level application state components receive and render data, and react to user input capabilities provide data to components, and broker communications between them page de nitions reusable groupings of components and capabilities stores persist data on the device, make that data query-able, and return model instances Tuesday, January 24, 12
  • 35. routes manage high-level application state Tuesday, January 24, 12
  • 36. $YOURAPP/javascript/routes.js mulberry.page('/todos', { name : 'Todos', pageDef : 'todos' }, true); mulberry.page('/completed', { name : 'Completed', pageDef : 'completed' }); #/todos #/completed Tuesday, January 24, 12
  • 37. stores persist data on the device, make that data query-able, and return model instances Tuesday, January 24, 12
  • 38. $YOURAPP/javascript/stores/todos.js mulberry.store('todos', { model : 'Todo', finish : function(id) { this.invoke(id, 'finish'); }, unfinish : function(id) { this.invoke(id, 'unfinish'); } }); Tuesday, January 24, 12
  • 39. page de nitions reusable groupings of components and capabilities Tuesday, January 24, 12
  • 40. todos: capabilities: - name: PageTodos screens: - name: index regions: - components: - custom.TodoForm - className: list scrollable: true components: - custom.TodoList - components: - custom.TodoTools NB: You can define this with JavaScript, too, using toura.pageDef(‘todos’, { ... }). Tuesday, January 24, 12
  • 41. components receive and render data, and react to user input Tuesday, January 24, 12
  • 42. $YOURAPP/javascript/components/TodoForm.js mulberry.component('TodoForm', { componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'), init : function() { this.connect(this.domNode, 'submit', function(e) { e.preventDefault(); var description = dojo.trim(this.descriptionInput.value), item; if (!description) { return; } item = { description : description }; this.domNode.reset(); this.onAdd(item); }); }, onAdd : function(item) { } }); Tuesday, January 24, 12
  • 43. $YOURAPP/javascript/components/TodoForm/TodoForm.haml %form.component.todo-form %input{ placeholder : 'New todo', dojoAttachPoint : 'descriptionInput' } %button{ dojoAttachPoint : 'saveButton' } Add Tuesday, January 24, 12
  • 44. $YOURAPP/javascript/components/TodoForm.js mulberry.component('TodoForm', { componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'), init : function() { this.connect(this.domNode, 'submit', function(e) { e.preventDefault(); var description = dojo.trim(this.descriptionInput.value), item; if (!description) { return; } item = { description : description }; this.domNode.reset(); this.onAdd(item); }); }, onAdd : function(item) { } }); Tuesday, January 24, 12
  • 45. capabilities provide data to components, and broker communications between them Tuesday, January 24, 12
  • 46. mulberry.capability('PageTodos', { todos: requirements : { capabilities: todoList : 'custom.TodoList', - name: PageTodos todoForm : 'custom.TodoForm', screens: todoTools : 'custom.TodoTools' - name: index }, regions: - components: connects : [ - custom.TodoForm [ 'todoForm', 'onAdd', '_add' ], - className: list [ 'todoList', 'onComplete', '_complete' ], scrollable: true [ 'todoList', 'onDelete', '_delete' ], components: [ 'todoTools', 'onCompleteAll', '_completeAll' ] - custom.TodoList ], - components: - custom.TodoTools init : function() { this.todos = client.stores.todos; this._updateList(); }, _add : function(item) { this.todos.add(item); this._updateList(); }, _delete : function(id) { this.todos.remove(id); this._updateList(); }, Tuesday, January 24, 12 _complete : function(id) {
  • 47. mulberry.capability('PageTodos', { todos: requirements : { capabilities: todoList : 'custom.TodoList', - name: PageTodos todoForm : 'custom.TodoForm', screens: todoTools : 'custom.TodoTools' - name: index }, regions: - components: connects : [ - custom.TodoForm [ 'todoForm', 'onAdd', '_add' ], - className: list [ 'todoList', 'onComplete', '_complete' ], scrollable: true [ 'todoList', 'onDelete', '_delete' ], components: [ 'todoTools', 'onCompleteAll', '_completeAll' ] - custom.TodoList ], - components: - custom.TodoTools init : function() { this.todos = client.stores.todos; this._updateList(); }, _add : function(item) { this.todos.add(item); this._updateList(); }, _delete : function(id) { this.todos.remove(id); this._updateList(); }, Tuesday, January 24, 12 _complete : function(id) {
  • 48. mulberry.capability('PageTodos', { todos: requirements : { capabilities: todoList : 'custom.TodoList', - name: PageTodos todoForm : 'custom.TodoForm', screens: todoTools : 'custom.TodoTools' - name: index }, regions: - components: connects : [ - custom.TodoForm [ 'todoForm', 'onAdd', '_add' ], - className: list [ 'todoList', 'onComplete', '_complete' ], scrollable: true [ 'todoList', 'onDelete', '_delete' ], components: [ 'todoTools', 'onCompleteAll', '_completeAll' ] - custom.TodoList ], - components: - custom.TodoTools init : function() { this.todos = client.stores.todos; this._updateList(); }, _add : function(item) { this.todos.add(item); this._updateList(); }, _delete : function(id) { this.todos.remove(id); this._updateList(); }, Tuesday, January 24, 12 _complete : function(id) {