SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
3.7.2012 (                 : 20.3.2012)

A Backbone.js Tutorial for the
Impatient
     Part 1: How to Get Your Hands Dirt with
     Backbone.js in 5 Minutes




 B : Jaakko Salonen (@jsalonen)

 I     :M   C   A       &S       C         .S                   .

 P                  QuickSlides <https://github.com/airport h/QuickSlides>
Prerequisites
  R         :


  D    '                                      ,


 Node.js

  U                                               -


  G                 ://       .       /

 Git

  U                                                   .
  G                 ://   -       .       /

 D     ?N       '
Creating our project
  W      B
               ( '    )
  I


 C               :
 gtcoehts/gtu.o/baynbcbn-olrlt.i mpoet
  i ln tp:/ihbcmtrne/akoebiepaegt yrjc
 c mpoet
  d yrjc
 nd bidsre
  oe ul evr


  D     .i
         gt

  O           :8000

 IT'S ALIVE
Routers
     L '                             :

 I             R            apmdlseapej:
                            p/oue/ ml.s

     EapeRue =Bcbn.otretn(
     xml.otr   akoeRue.xed{
      rue:{
       ots
        ":"ne"
         " idx
       ,

      idx fnto( {
       ne: ucin)
       $'mi'.tl'h>el Wrd/1';
        (#an)hm(<1Hlo ol<h>)

     );


 H                          p/anj:
                            apmi.s

     iiilz:fnto( {
     ntaie ucin)
      ti.xmlRue =nwEapeRue(;
       hseapeotr  e xml.otr)
     ,



Building and validating
 B                          :
     nd bid
     oe ul


 I                 ,             tot ros.
                            Dn, ihu err.
                            oe

 S                              :
     nd bidsre
     oe ul evr


 C                     .R
           .
Views
 I                      DOM,     '
           .

 M        apmdlseapej (
          p/oue/ ml.s                 i d ):
                                       ne
     idx fnto( {
     ne: ucin)
      vridx=nwEapeVesIdx)
       a ne  e xml.iw.ne(;
      idxrne(;
       ne.edr)


     EapeVesIdx=Bcbn.iwetn(
     xml.iw.ne      akoeVe.xed{
      e:'mi'
       l #an,
      tmlt:"p/epae/ne.tl,
       epae aptmltsidxhm"
      rne:fnto( {
       edr ucin)
        vrve =ti;
         a iw   hs
        nmsaefthepaeti.epae fnto(ml {
         aepc.ecTmlt(hstmlt, ucintp)
          ve.linrTL=tp(nm:'ol')
           iwe.neHM   ml{ae wrd ;
         );

     );


 aptmltsid .tl
  p/epae/ne hm

     <1Hlo<=nm % fo aptmlt/ne.tl<h>
     h>el % ae > rm p/epaeidxhm!/1


 N                  (        '           )
Refactoring to Support Multiple
Pages (1/2)
 A    W
 apmdlseapej:
  p/oue/ ml.s

     EapeWbae=Bcbn.oe.xed{
     xml.epg    akoeMdletn(
      dfut:{
       eals
       tte 'nild,
        il: Utte'
       cnet 'ocnet
        otn: N otn'

     );


 A                :
     "pgi" "ne"
     :aed: idx


 A               id
                  ne   :

     idx fnto(aed {
     ne: ucinpgi)
      i(aed==udfnd {
       fpgi = neie)
       pgi =1
        aed  ;

      vridx=nwEapeVesIdx)
       a ne  e xml.iw.ne(;
      idxmdl=nwEapeWbae{i' pgi )
       ne.oe   e xml.epg('d: aed ;
      idxrne(;
       ne.edr)



 (        ...)
Refactoring to Support Multiple
Pages (2/2)
 P  W                  rne (
                       edr
 apmdlseapej)
  p/oue/ ml.s

 ve.linrTL=tp(iwmdltJO()
 iwe.neHM   mlve.oe.oSN);


 A            p/epae/ne hm:
             aptmltsid .tl

 <1HloPg #% i %!/1
 h>el ae <= d ><h>


 D   !T       URLS             :

     ://   :8000/
     ://   :8000/1
     ://   :8000/#99
Managing Models with a
Collection
 A                        (
 a p m d l s e a p e j ):
  p/oue/ ml.s

 EapeWbae =Bcbn.olcinetn(
 xml.epgs   akoeCleto.xed{
  mdl EapeWbae
   oe: xml.epg,
  /lcltrg:nwwno.tr(Wbae" / cmetfrnw
   /oaSoae e idwSoe"epgs) / omn o o
 );


 R       id
          ne   R        (   ):

 i(aed==udfnd {
 fpgi = neie)
  pgi =1
   aed  ;


 vrwbae =nwEapeWbae(;
 a epgs   e xml.epgs)
 /wbae.ec(;/ cmetfrnw
 /epgsfth) / omn o o
 vrti_ae=wbae.e(aed;
 a hspg    epgsgtpgi)

 i(ti_ae==udfnd){
 f hspg = neie
  ti_ae=nwEapeWbae{d pgi )
   hspg  e xml.epg(i: aed ;
  wbae.d(hspg)
   epgsadti_ae;
  /ti_aesv(;/ cmetfrnw
   /hspg.ae) / omn o o


 vridx=nwEapeVesIdx)
 a ne   e xml.iw.ne(;
 idxmdl=ti_ae
 ne.oe   hspg;
 idxrne(;
 ne.edr)


 T   (              )
Persisting Models with HTML5
localStorage
  G   bcbn.oaSoaej
      akoelcltrg.s
       . /  /B  .  S                     :
  S
  ast/slb/akoelcltrg.s
   sesj/isbcbn.oaSoaej

 A                  c n i . s(
                     ofgj             bcbn
                                       akoe
        ):
 "akoelcltrg" ".ast/slb/akoelcltrg"
 bcbn.oaSoae: ./sesj/isbcbn.oaSoae,

 ..
 .

 bcbn.oaSoae {
 akoelcltrg:
  dp:[uebcbn" "s!nesoe]
   es "s!akoe, ueudrcr",
  atc:"akoe
   tah Bcbn"
 ,


 apmdlseapej
  p/oue/ ml.s                        dfn (
                                      eie
    u e b c b n " ):
   "s!akoe,

 "s!akoelcltrg"
 uebcbn.oaSoae


 Uncomment lines from previous slide

 B                                           S
               .R    . .   F     :
 cnoedrlcltrg)
 osl.i(oaSoae;
Adding Flesh - Edit Content
 N             (      ),
        .

 aptmltsid .tl
  p/epae/ne hm

 <1cas"aette>% tte% (<=i %)/1
 h ls=pg-il"<= il > #% d ><h>
 <i cas"aecnet>
 dv ls=pg-otn"
  <i cas"dtrhde"
   dv ls=eio idn>
   <>txae rw=2"cl=8"<txae>/>
    p<etra os"5 os"0>/etra<p
   <>ipttp=sbi"vle"ae>/nu>/>
    p<nu ye"umt au=Sv"<ipt<p
  <dv
   /i>
  <i cas"edrd>% cnet%<dv
   dv ls=rnee"<= otn >/i>
 <dv
 /i>


 apmdlseapej
  p/oue/ ml.s
 EapeVesId :
   ml.i .ne

 eet:{
 vns
  "lc .aecnet.edrd:"dtotn"
   cik pg-otn rnee" eiCnet
 ,
 eiCnet fnto( {
 dtotn: ucin)
  vrcnet=ti.oe.e(cnet)
   a otn  hsmdlgt'otn';
  $'pg-otn .edrd)hd(;
   (.aecnet rnee'.ie)
  $'pg-otn .dtr)rmvCas'idn)
   (.aecnet eio'.eoels(hde';
  $'pg-otn .dtrtxae'.tlcnet;
   (.aecnet eio etra)hm(otn)
 ,
Adding Flesh - Save Edited
Content
 apmdlseapej
  p/oue/ ml.s

 eet:{
 vns
  ..
   .
  "lc .aecnet.dtripttp=sbi'" "aeotn"
   cik pg-otn eio nu[ye'umt]: svCnet
 ,
 ..
 .
 svCnet fnto( {
 aeotn: ucin)
  vrcnet=$'pg-otn .dtrtxae'.a(;
   a otn  (.aecnet eio etra)vl)
  ti.oe.e(cnet,cnet;
   hsmdlst'otn' otn)
  ti.oe.ae)
   hsmdlsv(;

  $'pg-otn .dtr)adls(hde';
   (.aecnet eio'.dCas'idn)
  $'pg-otn .dtrtxae'.tl')
   (.aecnet eio etra)hm(';
  $'pg-otn .edrd)rmvCas'idn)
   (.aecnet rnee'.eoels(hde';

  ti.edr)
   hsrne(;
E e Cand - Markdown
Renderer Hook-up (1/2)
 L '              .   ( J   S   M
       )

 G          (
 . / s t / s l b / h d n j ):
  .aesj/isso o .s
 hts/gtu.o/ihbgtu-lvrdmrdw/lbg-ae/cit/hw
 tp:/ihbcmgtu/ihbfaoe-akonbo/hpgssrpsso


 apcni.s
  p/ofgj

 sodw:".ast/slb/hwon,
 hwon ./sesj/issodw"

 ue {
 s:
  ..
   .
  sodw:{
   hwon
    atc:"hwon
     tah Sodw"
E e Cand - Markdown
Renderer Hook-up (2/2)
 apmdlseapej
  p/oue/ ml.s

 "s!akoe,
 uebcbn"
 "s!hwon
 uesodw"

 ..
 .

 fnto(aepc,Bcbn,Sodw){
 ucinnmsae akoe hwon


 N                :

 aptmltsid .tl
  p/epae/ne hm

 <i cas"edrd>
 dv ls=rnee"
  < vrcnetr=nwSodw.ovre(;%
   % a ovre  e hwoncnetr) >
  <=cnetrmkHm(otn)%
   % ovre.aetlcnet >
 <dv
 /i>
Building for production
 R             (                    ):
 nd bid
 oe ul


 C                         .F            ,   :
 nd bid-hl
 oe ul -ep


 B             :
 nd bidrlae
 oe ul ees


 R                              :
 nd bidsre:ees
 oe ul evrrlae


 YSlow gives us Grade A (overall performance score 94)
See ou in Part 2
 Thank ou!
 J      S
     U e i e (@j a    e )f   e i   (f   e
     ecei e da e !)

Weitere ähnliche Inhalte

Was ist angesagt?

谈A国古代!%,%o现代l实现
谈A国古代!%,%o现代l实现谈A国古代!%,%o现代l实现
谈A国古代!%,%o现代l实现sugeladi
 
JavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooJavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooYasuharu Nakano
 
One page app with AngularJS
One page app with AngularJSOne page app with AngularJS
One page app with AngularJSAdam Štipák
 
WordPressでIoTをはじめよう
WordPressでIoTをはじめようWordPressでIoTをはじめよう
WordPressでIoTをはじめようYuriko IKEDA
 
Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)Oleg Zinchenko
 
Oliver Pirate Project
Oliver Pirate ProjectOliver Pirate Project
Oliver Pirate ProjectJoan Bennett
 
Танки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_ЯндексеТанки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_ЯндексеYandex
 
Ember background basics
Ember background basicsEmber background basics
Ember background basicsPhilipp Fehre
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensionserwanl
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015Phillip Trelford
 
Create Custom Post Type Plugin
Create Custom Post Type PluginCreate Custom Post Type Plugin
Create Custom Post Type PluginJan Wilson
 
Javascript Common Mistakes
Javascript Common MistakesJavascript Common Mistakes
Javascript Common Mistakes동수 장
 
Python パッケージ構成
Python パッケージ構成Python パッケージ構成
Python パッケージ構成kei10in
 
Essentials and Impactful Features of ES6
Essentials and Impactful Features of ES6Essentials and Impactful Features of ES6
Essentials and Impactful Features of ES6Riza Fahmi
 
Clojurescript up and running
Clojurescript up and runningClojurescript up and running
Clojurescript up and runningTimo Sulg
 

Was ist angesagt? (20)

谈A国古代!%,%o现代l实现
谈A国古代!%,%o现代l实现谈A国古代!%,%o现代l实现
谈A国古代!%,%o现代l实现
 
JavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring RooJavaOne2010 Groovy/Spring Roo
JavaOne2010 Groovy/Spring Roo
 
One page app with AngularJS
One page app with AngularJSOne page app with AngularJS
One page app with AngularJS
 
Purpose
PurposePurpose
Purpose
 
2008 june 9
2008 june 92008 june 9
2008 june 9
 
WordPressでIoTをはじめよう
WordPressでIoTをはじめようWordPressでIoTをはじめよう
WordPressでIoTをはじめよう
 
Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)Keep It Simple Security (Symfony cafe 28-01-2016)
Keep It Simple Security (Symfony cafe 28-01-2016)
 
Oliver Pirate Project
Oliver Pirate ProjectOliver Pirate Project
Oliver Pirate Project
 
Танки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_ЯндексеТанки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Танки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
 
Ember background basics
Ember background basicsEmber background basics
Ember background basics
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensions
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015
 
Create Custom Post Type Plugin
Create Custom Post Type PluginCreate Custom Post Type Plugin
Create Custom Post Type Plugin
 
Javascript Common Mistakes
Javascript Common MistakesJavascript Common Mistakes
Javascript Common Mistakes
 
Python パッケージ構成
Python パッケージ構成Python パッケージ構成
Python パッケージ構成
 
Essentials and Impactful Features of ES6
Essentials and Impactful Features of ES6Essentials and Impactful Features of ES6
Essentials and Impactful Features of ES6
 
Clojurescript up and running
Clojurescript up and runningClojurescript up and running
Clojurescript up and running
 
Shell and perl scripting classes in mumbai
Shell and perl scripting classes in mumbaiShell and perl scripting classes in mumbai
Shell and perl scripting classes in mumbai
 
Alu car
Alu carAlu car
Alu car
 
Javascript: The Important Bits
Javascript: The Important BitsJavascript: The Important Bits
Javascript: The Important Bits
 

Ähnlich wie A Backbone.js Tutorial for the Impatient - Part 1

Angular.js + Rails at WeWork or: The Accidental Feature
Angular.js + Rails at WeWork or: The Accidental FeatureAngular.js + Rails at WeWork or: The Accidental Feature
Angular.js + Rails at WeWork or: The Accidental FeatureJonathan Magen
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleAri Lerner
 
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...Ari Lerner
 
Theme Development and Customization
Theme Development and CustomizationTheme Development and Customization
Theme Development and CustomizationAniket Pant
 
Automated tests - facts and myths
Automated tests - facts and mythsAutomated tests - facts and myths
Automated tests - facts and mythsWojciech Sznapka
 
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best PracticesJohannes Hoppe
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSPat Cito
 
Making the most of 2.2
Making the most of 2.2Making the most of 2.2
Making the most of 2.2markstory
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsHeroku
 
Tercera parte parte del Cuaderno de Ingles
Tercera parte parte del Cuaderno de InglesTercera parte parte del Cuaderno de Ingles
Tercera parte parte del Cuaderno de InglesRicardo Aguilar
 
SecureSocial - Authentication for Play Framework
SecureSocial - Authentication for Play FrameworkSecureSocial - Authentication for Play Framework
SecureSocial - Authentication for Play Frameworkjaliss
 
Building modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaBuilding modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaAlexander Gyoshev
 
Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaTony Fabeen
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scriptingTony Fabeen
 
Hubot: a look inside our robot friend
Hubot: a look inside our robot friendHubot: a look inside our robot friend
Hubot: a look inside our robot friendajacksified
 
Front End Dependency Management at CascadiaJS
Front End Dependency Management at CascadiaJSFront End Dependency Management at CascadiaJS
Front End Dependency Management at CascadiaJSJoe Sepi
 
WordPress in 30 minutes
WordPress in 30 minutesWordPress in 30 minutes
WordPress in 30 minutesOwen Winkler
 

Ähnlich wie A Backbone.js Tutorial for the Impatient - Part 1 (20)

Angular.js + Rails at WeWork or: The Accidental Feature
Angular.js + Rails at WeWork or: The Accidental FeatureAngular.js + Rails at WeWork or: The Accidental Feature
Angular.js + Rails at WeWork or: The Accidental Feature
 
Starting out with Ember.js
Starting out with Ember.jsStarting out with Ember.js
Starting out with Ember.js
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at Google
 
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...
How to create a 3.2 billion dollar business in 20 minutes: combining AngularJ...
 
Theme Development and Customization
Theme Development and CustomizationTheme Development and Customization
Theme Development and Customization
 
Automated tests - facts and myths
Automated tests - facts and mythsAutomated tests - facts and myths
Automated tests - facts and myths
 
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Making the most of 2.2
Making the most of 2.2Making the most of 2.2
Making the most of 2.2
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku Secrets
 
JavaFX, because you're worth it
JavaFX, because you're worth itJavaFX, because you're worth it
JavaFX, because you're worth it
 
Tercera parte parte del Cuaderno de Ingles
Tercera parte parte del Cuaderno de InglesTercera parte parte del Cuaderno de Ingles
Tercera parte parte del Cuaderno de Ingles
 
SecureSocial - Authentication for Play Framework
SecureSocial - Authentication for Play FrameworkSecureSocial - Authentication for Play Framework
SecureSocial - Authentication for Play Framework
 
Building modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and javaBuilding modern web apps with html5, javascript, and java
Building modern web apps with html5, javascript, and java
 
Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with Lua
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
 
Hubot: a look inside our robot friend
Hubot: a look inside our robot friendHubot: a look inside our robot friend
Hubot: a look inside our robot friend
 
Ff to-fp
Ff to-fpFf to-fp
Ff to-fp
 
Front End Dependency Management at CascadiaJS
Front End Dependency Management at CascadiaJSFront End Dependency Management at CascadiaJS
Front End Dependency Management at CascadiaJS
 
WordPress in 30 minutes
WordPress in 30 minutesWordPress in 30 minutes
WordPress in 30 minutes
 

Kürzlich hochgeladen

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 
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
 
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
 
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
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Kürzlich hochgeladen (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
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...
 
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
 
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
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

A Backbone.js Tutorial for the Impatient - Part 1

  • 1. 3.7.2012 ( : 20.3.2012) A Backbone.js Tutorial for the Impatient Part 1: How to Get Your Hands Dirt with Backbone.js in 5 Minutes B : Jaakko Salonen (@jsalonen) I :M C A &S C .S . P QuickSlides <https://github.com/airport h/QuickSlides>
  • 2. Prerequisites R : D ' , Node.js U - G :// . / Git U . G :// - . / D ?N '
  • 3. Creating our project W B ( ' ) I C : gtcoehts/gtu.o/baynbcbn-olrlt.i mpoet i ln tp:/ihbcmtrne/akoebiepaegt yrjc c mpoet d yrjc nd bidsre oe ul evr D .i gt O :8000 IT'S ALIVE
  • 4. Routers L ' : I R apmdlseapej: p/oue/ ml.s EapeRue =Bcbn.otretn( xml.otr akoeRue.xed{ rue:{ ots ":"ne" " idx , idx fnto( { ne: ucin) $'mi'.tl'h>el Wrd/1'; (#an)hm(<1Hlo ol<h>) ); H p/anj: apmi.s iiilz:fnto( { ntaie ucin) ti.xmlRue =nwEapeRue(; hseapeotr e xml.otr) , Building and validating B : nd bid oe ul I , tot ros. Dn, ihu err. oe S : nd bidsre oe ul evr C .R .
  • 5. Views I DOM, ' . M apmdlseapej ( p/oue/ ml.s i d ): ne idx fnto( { ne: ucin) vridx=nwEapeVesIdx) a ne e xml.iw.ne(; idxrne(; ne.edr) EapeVesIdx=Bcbn.iwetn( xml.iw.ne akoeVe.xed{ e:'mi' l #an, tmlt:"p/epae/ne.tl, epae aptmltsidxhm" rne:fnto( { edr ucin) vrve =ti; a iw hs nmsaefthepaeti.epae fnto(ml { aepc.ecTmlt(hstmlt, ucintp) ve.linrTL=tp(nm:'ol') iwe.neHM ml{ae wrd ; ); ); aptmltsid .tl p/epae/ne hm <1Hlo<=nm % fo aptmlt/ne.tl<h> h>el % ae > rm p/epaeidxhm!/1 N ( ' )
  • 6. Refactoring to Support Multiple Pages (1/2) A W apmdlseapej: p/oue/ ml.s EapeWbae=Bcbn.oe.xed{ xml.epg akoeMdletn( dfut:{ eals tte 'nild, il: Utte' cnet 'ocnet otn: N otn' ); A : "pgi" "ne" :aed: idx A id ne : idx fnto(aed { ne: ucinpgi) i(aed==udfnd { fpgi = neie) pgi =1 aed ; vridx=nwEapeVesIdx) a ne e xml.iw.ne(; idxmdl=nwEapeWbae{i' pgi ) ne.oe e xml.epg('d: aed ; idxrne(; ne.edr) ( ...)
  • 7. Refactoring to Support Multiple Pages (2/2) P W rne ( edr apmdlseapej) p/oue/ ml.s ve.linrTL=tp(iwmdltJO() iwe.neHM mlve.oe.oSN); A p/epae/ne hm: aptmltsid .tl <1HloPg #% i %!/1 h>el ae <= d ><h> D !T URLS : :// :8000/ :// :8000/1 :// :8000/#99
  • 8. Managing Models with a Collection A ( a p m d l s e a p e j ): p/oue/ ml.s EapeWbae =Bcbn.olcinetn( xml.epgs akoeCleto.xed{ mdl EapeWbae oe: xml.epg, /lcltrg:nwwno.tr(Wbae" / cmetfrnw /oaSoae e idwSoe"epgs) / omn o o ); R id ne R ( ): i(aed==udfnd { fpgi = neie) pgi =1 aed ; vrwbae =nwEapeWbae(; a epgs e xml.epgs) /wbae.ec(;/ cmetfrnw /epgsfth) / omn o o vrti_ae=wbae.e(aed; a hspg epgsgtpgi) i(ti_ae==udfnd){ f hspg = neie ti_ae=nwEapeWbae{d pgi ) hspg e xml.epg(i: aed ; wbae.d(hspg) epgsadti_ae; /ti_aesv(;/ cmetfrnw /hspg.ae) / omn o o vridx=nwEapeVesIdx) a ne e xml.iw.ne(; idxmdl=ti_ae ne.oe hspg; idxrne(; ne.edr) T ( )
  • 9. Persisting Models with HTML5 localStorage G bcbn.oaSoaej akoelcltrg.s . / /B . S : S ast/slb/akoelcltrg.s sesj/isbcbn.oaSoaej A c n i . s( ofgj bcbn akoe ): "akoelcltrg" ".ast/slb/akoelcltrg" bcbn.oaSoae: ./sesj/isbcbn.oaSoae, .. . bcbn.oaSoae { akoelcltrg: dp:[uebcbn" "s!nesoe] es "s!akoe, ueudrcr", atc:"akoe tah Bcbn" , apmdlseapej p/oue/ ml.s dfn ( eie u e b c b n " ): "s!akoe, "s!akoelcltrg" uebcbn.oaSoae Uncomment lines from previous slide B S .R . . F : cnoedrlcltrg) osl.i(oaSoae;
  • 10. Adding Flesh - Edit Content N ( ), . aptmltsid .tl p/epae/ne hm <1cas"aette>% tte% (<=i %)/1 h ls=pg-il"<= il > #% d ><h> <i cas"aecnet> dv ls=pg-otn" <i cas"dtrhde" dv ls=eio idn> <>txae rw=2"cl=8"<txae>/> p<etra os"5 os"0>/etra<p <>ipttp=sbi"vle"ae>/nu>/> p<nu ye"umt au=Sv"<ipt<p <dv /i> <i cas"edrd>% cnet%<dv dv ls=rnee"<= otn >/i> <dv /i> apmdlseapej p/oue/ ml.s EapeVesId : ml.i .ne eet:{ vns "lc .aecnet.edrd:"dtotn" cik pg-otn rnee" eiCnet , eiCnet fnto( { dtotn: ucin) vrcnet=ti.oe.e(cnet) a otn hsmdlgt'otn'; $'pg-otn .edrd)hd(; (.aecnet rnee'.ie) $'pg-otn .dtr)rmvCas'idn) (.aecnet eio'.eoels(hde'; $'pg-otn .dtrtxae'.tlcnet; (.aecnet eio etra)hm(otn) ,
  • 11. Adding Flesh - Save Edited Content apmdlseapej p/oue/ ml.s eet:{ vns .. . "lc .aecnet.dtripttp=sbi'" "aeotn" cik pg-otn eio nu[ye'umt]: svCnet , .. . svCnet fnto( { aeotn: ucin) vrcnet=$'pg-otn .dtrtxae'.a(; a otn (.aecnet eio etra)vl) ti.oe.e(cnet,cnet; hsmdlst'otn' otn) ti.oe.ae) hsmdlsv(; $'pg-otn .dtr)adls(hde'; (.aecnet eio'.dCas'idn) $'pg-otn .dtrtxae'.tl') (.aecnet eio etra)hm('; $'pg-otn .edrd)rmvCas'idn) (.aecnet rnee'.eoels(hde'; ti.edr) hsrne(;
  • 12. E e Cand - Markdown Renderer Hook-up (1/2) L ' . ( J S M ) G ( . / s t / s l b / h d n j ): .aesj/isso o .s hts/gtu.o/ihbgtu-lvrdmrdw/lbg-ae/cit/hw tp:/ihbcmgtu/ihbfaoe-akonbo/hpgssrpsso apcni.s p/ofgj sodw:".ast/slb/hwon, hwon ./sesj/issodw" ue { s: .. . sodw:{ hwon atc:"hwon tah Sodw"
  • 13. E e Cand - Markdown Renderer Hook-up (2/2) apmdlseapej p/oue/ ml.s "s!akoe, uebcbn" "s!hwon uesodw" .. . fnto(aepc,Bcbn,Sodw){ ucinnmsae akoe hwon N : aptmltsid .tl p/epae/ne hm <i cas"edrd> dv ls=rnee" < vrcnetr=nwSodw.ovre(;% % a ovre e hwoncnetr) > <=cnetrmkHm(otn)% % ovre.aetlcnet > <dv /i>
  • 14. Building for production R ( ): nd bid oe ul C .F , : nd bid-hl oe ul -ep B : nd bidrlae oe ul ees R : nd bidsre:ees oe ul evrrlae YSlow gives us Grade A (overall performance score 94)
  • 15. See ou in Part 2 Thank ou! J S U e i e (@j a e )f e i (f e ecei e da e !)