HTML 5 BOOTCAMP
NEW BAMBOO

Laurie Young   Ismael Celis
@wildfalcon      @ismasan
PROCESS - HANDLED
     with a sword!
www.flickr.com/photos/sprengben
TIMETABLE

Quick Summary - Why HTML 5

  What is HTML 5 - A Tour

     Write Some Code
WEB DEVELOPERS?
WEB DEVELOPERS?




 www.flickr.com/ivanwalsh
WEB DEVELOPERS?
WEB DEVELOPERS?
WHAT ABOUT FLASH

          Flash has some issues:
      •     Vendor Specific
      •      Licence Costs
      •    Mobile Performance
      •         No iOS
WHAT IS HTML 5
NEW TAGS (BORING)

     <section>
     <article>
      <header>
        <nav>
       <audio>
       <video>
NEW JAVASCRIPT APIS
• Cross-document messaging     • Directories and Filesystem
• Web workers                  • Web Sockets
• Canvas                       • Browser history
• LocalStorage                   management
• Web SQL Database             • Geolocation
• Indexed Database API         • Drag-and-drop
• Directories and Filesystem   • File API
• Web Sockets                  • File Writer
• Device Orientation           • Desktop Notifications
http://daftpunk.themaninblue.com/
http://slides.html5rocks.com/#indexed-db
http://olivernn.github.com/flipper/
https://github.com/wildfalcon/Photo-Pinboard
http://eyas.local:4000/foo/pinboard
NOW WRITE SOME CODE
SET UP TEAMS
DRAG AND DROP FILES
To Drag and Drop Files
var stopPropagation = function(event){
  event.stopPropagation();
  event.preventDefault();
}

document.addEventListener('dragenter', stopPropagation, false);
document.addEventListener('dragexit', stopPropagation, false);
document.addEventListener('dragover', stopPropagation, false);
document.addEventListener('drop', function (event) {
 // your code here
 // files available as event.dataTransfer.files
});



            To Read Files (Asynchronously)
 var fileReader = new FileReader();
 fileReader.onloadend = function(event){
      // Your code
      // (file data is in event.target.result)
 }
 fileReader.readAsDataURL(file);

                           http://bit.ly/jxtJWh
LOCAL STORAGE
LOCAL STORAGE


 • Key-Value store
 • String data
 • Effective 5mb limit
LOCAL STORAGE API

          To save a value
   localStorage.setItem(key, value)


         To read a value
var value = localStorage.getItem(key)


          To count items
   var count = localStorage.length


         http://bit.ly/mlW8sk
WEB SOCKETS
Web Socket Server




Web Browsers
To Open a Web Socket
socket = new WebSocket("ws://10.21.6.87:8080/channel");


                     To React to a Message
             socket.onmessage = function(event) {
              // your code
              event.data ...
             }

                       To Send a Message
                      socket.send("a string")

                        http://bit.ly/mMerem
PUSHER




         http://pusher.com
CODE STRUCTURE
http://bit.ly/mjc1mG
DISCUSSION
THE END
               Code can be found at
https://github.com/ismasan/websockets_examples


            http://diveintohtml5.org
          http://slides.html5rocks.com
            http://www.pusher.com

       https://gist.github.com/299789

Html 5 boot camp

Editor's Notes

  • #2 \n
  • #3 We are from new bamboo\n\n* Rails Dev Shop\n* London\n\n\n\n
  • #4 We are mostly happy with our process now\n\nPull out a sword, throw it away\n
  • #5 Now:\n* Cooler stuff\n* Next generation of apps\n* More customers are wanting this\n\nThis means:\n* We get to explore\n* Innovate\n* Create new ways to do this\n* We have a lot of hack days, where we try and learn how (awesome)\n\n
  • #6 Short Intro\nSome HTML 5 examples\nThen we will write to some code\n
  • #7 SHOW OF HANDS - how many web developers here?\n\n\n
  • #8 \ndesktop like applications are becoming more and more demanded\n\nGmail\nGoogle Docs\nand a host more\n
  • #9 Gmail\n\n
  • #10 Google Docs\nand a host more\n
  • #11 Lots of custom (hacked) solutions for\n * Drag and Drop\n * Form Validations\n * Web Push (comet)\n\nMeans:\n* no browser support / optimisation\n* Slow implementations\n* inconsistent UI for users\n\nCRAP EXPERIENCE\n
  • #12 Some people turned to flash\n\nbut its vendor specific\nexpensive\nperforms badly on mobile clients\nnot at all on the iphone\n
  • #13 Big companies (Google, Microsoft, Apple) all were interested in solving this problem fr\n
  • #14 HTML 5 was born. \n\n
  • #15 HTML 5 is a bad term, strictly speaking it means a new version of html, with additional tags\n\nBut its used to also refer to a lot of Javascript APIs\n\n\n
  • #16 &amp;#x201C;Official&amp;#x201D; HTML5 is a list of new tags\n\n
  • #17 More interestingly\n\nThe canvas element\nTimed media playback\nDrag-and-drop\nCross-document messaging\nBrowser history management\nGeolocation\nWeb SQL Database, a local SQL Database.[34]\nThe Indexed Database API, an indexed hierarchical key-value store (formerly WebSimpleDB).[35]\nFile API, Handle file uploads and file manipulation.[36]\nDirectories and System. This API is intended to satisfy client-side-storage use cases not well served by databases.[37]\nFile Writer. An API for writing to files from web applications.[38\n\n
  • #18 Some examples\n
  • #19 \n
  • #20 \n
  • #21 \n
  • #22 \n
  • #23 \n
  • #24 Get into teams\neach team will need\n * Chrome 12\n * a server than can serve a html and a javascript file over http\n * a html file that imports a javascript page\n * someone with basic javascript skills\n
  • #25 25 minutes to be able to drag files from your desktop, into your browser\n
  • #26 \n
  • #27 \n
  • #28 talk about what is local storage\n\n* (shouldn&amp;#x2019;t be used for binary data, we will now though)\n* (configurable on opera)\n
  • #29 \n
  • #30 \n
  • #31 \n
  • #32 \n
  • #33 \n
  • #34 \n
  • #35 \n
  • #36 \n
  • #37 \n