SlideShare uma empresa Scribd logo
1 de 38
Drupal 6 jQuery and
    JavaScript
     DrupalCampWI, 2009
Matt Butcher
     First web app: 1995

  About a dozen languages

Five books, dozens of articles

     Milkshake problem
2009
2004
What do you get with
 each download of
      jQuery?
Tweet the answer @technosophos and win a book.
Overview
•   JavaScript and its      •   Drupal JavaScript
    evolving place in web       Translations
    applications
                            •   Drupal JavaScript
•   The rise of the             Themes
    JavaScript library
                            •   The future of JavaScript
•   Introducing jQuery          and what it means for
                                CMS systems
•   Drupal Behaviors
JavaScript
A Developer’s History
JavaScript, Circa 2000

• Introduced in Netscape 2.0 and IE 3.0
• Calculators, scrolling status messages, and
  image rollovers
• Left us a sprawling landscape of speciality
  tools
Two Big Changes


•   Dynamic rendering
    engine

•   XMLHttpRequest object
Dynamic Rendering
•   With earlier browsers,
    documents could not be
    modified

•   Modifying the document
    without a page load was
    impossible until Gecko
    and IE 6

•   Programmatic access to
    elements...
Document Object
          Model
•   Standard API for
    accessing HTML or XML
    documents

•   JavaScript support means
    programmatic access to
    any part of the page

•   DOM + Dynamic
    Reflow = Modifiable
    pages
XMLHttpRequest
       (XHR)

• Introduced as a ActiveX component by
  Microsoft
• Purpose: Transfer XML over HTTP without
  requiring a new page load
Web 2.0: Jargon Attack!
•   AJAX: A better acronym     Grrr....
    than XMLHttpRequest?

•   JSON: A better format
    than XML?

•   DOM + AJAX = A new
    wave of web applications

•   AHAH, JSONP, Comet...
The Rise of the
 JavaScript Library
Or, Enough with the one-off scripts already!
The Olden
      Days
  Scripts were simple tools
    designed with a single
     application in mind.

  To use one of these typically
involved hacking at the code to
   apply it to your situation.                    Photo by heyrocker
                                  http://www.flickr.com/photos/heyrocker/417236386/
The Library

• Designed to solve a class of related
  problems
• “Customization” is done through
  configuration files and function calls
• Intended for re-use
The Explosion of
        Libraries
• First there were calendars and image
  rollovers. (Thanks, Macromedia!)
• Libraries took on more sophisticated
  problems, like widgets and drag-and-drop.
• Open Source libraries: Prototype, Ext.js,
  YUI, jQuery....
One of the problems
was just begging for a
      library....
Web 2.0 + JavaScript =
        Icky?
• Hard things:
 • DOM code is powerful, but(t) ugly
 • Event handling was... different.
 • AJAX was... different.
 • Other common tasks were difficult due
    to JavaScript... differences.
The Brilliance
  of jQuery
Provide a wrapper around all of
         the icky stuff.

The wrapper should be simple
        yet robust.
jQueryFeatures
•   Uses CSS 3 Selectors as   •   Event model that spans
    a query language              all major browsers

•   Standard traversal and    •   Transitions and effects
    manipulation functions
                              •   CSS manipulation
•   AJAX library for XML,
    AHAH, JSON                •   Free pony with every
                                  download!
•   Cross-browser utilities
Pony by Xiaphias
      http://en.wikipedia.org/wiki/File:Feralpony.jpg




I lied about the pony
jQuery Idioms

•$
• Factory function
• Chained methods
• Anonymous functions and closures
• Object literals
$: It’s not just for
      Benjamins
$(‘#content div.my-class’);

     $.get(someUrl);
Factories and Chains
    [Insert industrial revolution joke here]



$(‘#content’).children().text(‘Hi’);
Anonymous Functions
        and function (data) {
$.get(someUrl,
               Closures
  console.log(data);
});

var msg = ‘Hello world’;
$(‘#some-button’).click(function (event) {
   alert(msg);
})
Objects, like, Literally

   $(‘#content’).accordion({
     header: ‘h2’,
     change: function () {}
   });
JavaScript and Drupal
      How do they pair?
Working Together
•   jQuery bundled with       •   Autocompletion
    Drupal
                              •   Drag-and-drop
•   JavaScript Behaviors
                              •   AHAH forms
•   JavaScript Translations
                              •   Progress meters and
•   Numerous utility              dynamic upload
    functions
                              •   Batch processing
•   JavaScript theming
                              •   Buzzr, anyone?
Drupal Behaviors
•   Assign an action to an
    element.

    •   Drupal takes care of
        initializing when the
        page loads.

    •   AJAX and other
        events may re-
        initialize.
JavaScript
   Translations
 Static (application) text that
appears in JavaScript code can
be translated to any supported
           language.
JavaScript Themes

            •   Server theming:
                PHP templates.

            •   JavaScript
                theming: jQuery.

            •   Both use theme
                functions.
Drupal Autocomplete,
Drag and Drop, AHAH
The Future of
  JavaScript
Three Key Technologies
•   Canvas: Draw on the
    canvas with JavaScript.

•   Workers: Direct access
    to threads means
    JavaScript can do work
    in the background.

•   Databases: Local storage
    and SQL databases in
    JavaScript. No, really.
What will Drupal look
        like?
•   Inline image editors       •   Local caches of data to
                                   ease server load
•   Robust drawing inside of
    pages                      •   Stateful clients that
                                   remember where they
•   Larger amounts of              were on a site
    processing done on the
    client                     •   Bottom line: A new era
                                   of client interactivity
•   Events generated by            may be just around the
                                   corner.
    background computation
The Recap
• JavaScript has come a long way from its
  image rollover and scrolling status message
  days.
• Drupal JavaScript libraries mean we can
  build more, faster, cheaper.
• Future technologies are building on the
  web-as-application-platform paradigm.
The Browser Goes
      Blue Collar
        The browser of the future is
a universal application platform for a certain
       class of network applications.

For the first time, the browser may define the
   application, and the servers will play an
                 auxiliary role.
Questions?

               Matt Butcher
Twitter: http://twitter.com/technosophos
      Email: butcher@palantir.net
     Blog: http://technosophos.com

Mais conteúdo relacionado

Mais procurados

From nothing to a video under 2 seconds / Mikhail Sychev (YouTube)
From nothing to a video under 2 seconds / Mikhail Sychev  (YouTube)From nothing to a video under 2 seconds / Mikhail Sychev  (YouTube)
From nothing to a video under 2 seconds / Mikhail Sychev (YouTube)Ontico
 
Unobtrusive js
Unobtrusive jsUnobtrusive js
Unobtrusive jsbretticus
 
Java script202
Java script202Java script202
Java script202Wasiq Zia
 
Building an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stackBuilding an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stackdivyapisces
 
Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)Ontico
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Webphilogb
 
Evolution of a cloud start up: From C# to Node.js
Evolution of a cloud start up: From C# to Node.jsEvolution of a cloud start up: From C# to Node.js
Evolution of a cloud start up: From C# to Node.jsSteve Jamieson
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsMongoDB
 
Starting from Scratch with the MEAN Stack
Starting from Scratch with the MEAN StackStarting from Scratch with the MEAN Stack
Starting from Scratch with the MEAN StackMongoDB
 
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB
 
Building Real World Application with Azure
Building Real World Application with AzureBuilding Real World Application with Azure
Building Real World Application with Azuredivyapisces
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?Balajihope
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...Hariharan Ganesan
 
Grokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with CouchbaseGrokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with CouchbaseOliver N
 
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...Codemotion
 
Visualize your graph database
Visualize your graph databaseVisualize your graph database
Visualize your graph databaseMichael Hackstein
 
Modern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On RailsModern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On RailsRobert Glaser
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraKishore Chandra
 

Mais procurados (20)

From nothing to a video under 2 seconds / Mikhail Sychev (YouTube)
From nothing to a video under 2 seconds / Mikhail Sychev  (YouTube)From nothing to a video under 2 seconds / Mikhail Sychev  (YouTube)
From nothing to a video under 2 seconds / Mikhail Sychev (YouTube)
 
Unobtrusive js
Unobtrusive jsUnobtrusive js
Unobtrusive js
 
Java script202
Java script202Java script202
Java script202
 
Next generation Graphics: SVG
Next generation Graphics: SVGNext generation Graphics: SVG
Next generation Graphics: SVG
 
Building an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stackBuilding an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stack
 
Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
 
Evolution of a cloud start up: From C# to Node.js
Evolution of a cloud start up: From C# to Node.jsEvolution of a cloud start up: From C# to Node.js
Evolution of a cloud start up: From C# to Node.js
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
 
Starting from Scratch with the MEAN Stack
Starting from Scratch with the MEAN StackStarting from Scratch with the MEAN Stack
Starting from Scratch with the MEAN Stack
 
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
 
Building Real World Application with Azure
Building Real World Application with AzureBuilding Real World Application with Azure
Building Real World Application with Azure
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
 
Grokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with CouchbaseGrokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with Couchbase
 
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...
Tech Webinar: Offline First: Creare un'app Phonegap che funzioni offline e si...
 
Azkaban
AzkabanAzkaban
Azkaban
 
Visualize your graph database
Visualize your graph databaseVisualize your graph database
Visualize your graph database
 
Modern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On RailsModern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On Rails
 
Meanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore ChandraMeanstack Introduction by Kishore Chandra
Meanstack Introduction by Kishore Chandra
 

Destaque

Network For Good State Portal Option Proposal
Network For Good State Portal Option ProposalNetwork For Good State Portal Option Proposal
Network For Good State Portal Option Proposalstaciemann
 
Pto P Fundraising Six Degrees N T E N (5)
Pto P  Fundraising  Six Degrees  N T E N (5)Pto P  Fundraising  Six Degrees  N T E N (5)
Pto P Fundraising Six Degrees N T E N (5)staciemann
 
Web 2.0 Man Ynet 1007
Web 2.0 Man Ynet 1007Web 2.0 Man Ynet 1007
Web 2.0 Man Ynet 1007staciemann
 
Robin Hood Marketing
Robin Hood MarketingRobin Hood Marketing
Robin Hood Marketingstaciemann
 
Drupal 6 FormAPI Presentation
Drupal 6 FormAPI PresentationDrupal 6 FormAPI Presentation
Drupal 6 FormAPI PresentationBoldSource
 
Drupal 6 Site Building II
Drupal 6 Site Building IIDrupal 6 Site Building II
Drupal 6 Site Building IIColleen Carroll
 
Drupal 6 Site Building 1
Drupal 6 Site Building 1Drupal 6 Site Building 1
Drupal 6 Site Building 1Colleen Carroll
 
Drupal 6 Theme Functions
Drupal 6 Theme FunctionsDrupal 6 Theme Functions
Drupal 6 Theme FunctionsBoldSource
 
QueryPath, Mash-ups, and Web Services
QueryPath, Mash-ups, and Web ServicesQueryPath, Mash-ups, and Web Services
QueryPath, Mash-ups, and Web ServicesMatt Butcher
 

Destaque (12)

Network For Good State Portal Option Proposal
Network For Good State Portal Option ProposalNetwork For Good State Portal Option Proposal
Network For Good State Portal Option Proposal
 
Pto P Fundraising Six Degrees N T E N (5)
Pto P  Fundraising  Six Degrees  N T E N (5)Pto P  Fundraising  Six Degrees  N T E N (5)
Pto P Fundraising Six Degrees N T E N (5)
 
Doing REST Right
Doing REST RightDoing REST Right
Doing REST Right
 
Web 2.0 Man Ynet 1007
Web 2.0 Man Ynet 1007Web 2.0 Man Ynet 1007
Web 2.0 Man Ynet 1007
 
Robin Hood Marketing
Robin Hood MarketingRobin Hood Marketing
Robin Hood Marketing
 
Ultra Solutions
Ultra SolutionsUltra Solutions
Ultra Solutions
 
Drupal 6 FormAPI Presentation
Drupal 6 FormAPI PresentationDrupal 6 FormAPI Presentation
Drupal 6 FormAPI Presentation
 
Drupal 6 Site Building II
Drupal 6 Site Building IIDrupal 6 Site Building II
Drupal 6 Site Building II
 
Drupal 6 Site Building 1
Drupal 6 Site Building 1Drupal 6 Site Building 1
Drupal 6 Site Building 1
 
Drupal 6 Theme Functions
Drupal 6 Theme FunctionsDrupal 6 Theme Functions
Drupal 6 Theme Functions
 
QueryPath, Mash-ups, and Web Services
QueryPath, Mash-ups, and Web ServicesQueryPath, Mash-ups, and Web Services
QueryPath, Mash-ups, and Web Services
 
Proximity Marketing
Proximity MarketingProximity Marketing
Proximity Marketing
 

Semelhante a Drupal 6 JavaScript and jQuery

How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for youSimon Willison
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesSimon Willison
 
Web Development: The Next Five Years
Web Development: The Next Five YearsWeb Development: The Next Five Years
Web Development: The Next Five Yearssneeu
 
JavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureJavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureSimon Willison
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?jbandi
 
Devfest09 Cschalk Gwt
Devfest09 Cschalk GwtDevfest09 Cschalk Gwt
Devfest09 Cschalk GwtChris Schalk
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWebDave Bouwman
 
Openness In The Era Of Social Web
Openness In The Era Of Social WebOpenness In The Era Of Social Web
Openness In The Era Of Social WebChris Messina
 
Dconrails Gecco Presentation
Dconrails Gecco PresentationDconrails Gecco Presentation
Dconrails Gecco PresentationJuan J. Merelo
 
Introduction to the wonderful world of JavaScript
Introduction to the wonderful world of JavaScriptIntroduction to the wonderful world of JavaScript
Introduction to the wonderful world of JavaScriptJakob Torp
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologiesgeorge.james
 
qooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkqooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkecker
 
Javascript Dependency Management
Javascript Dependency ManagementJavascript Dependency Management
Javascript Dependency ManagementSean Duncan
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Libraryjeresig
 

Semelhante a Drupal 6 JavaScript and jQuery (20)

How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for you
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
 
Web 2.0 & Ajax Basics
Web 2.0 & Ajax BasicsWeb 2.0 & Ajax Basics
Web 2.0 & Ajax Basics
 
Web Development: The Next Five Years
Web Development: The Next Five YearsWeb Development: The Next Five Years
Web Development: The Next Five Years
 
JavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureJavaScript Libraries: The Big Picture
JavaScript Libraries: The Big Picture
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
wt mod3.pdf
wt mod3.pdfwt mod3.pdf
wt mod3.pdf
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?
 
Devfest09 Cschalk Gwt
Devfest09 Cschalk GwtDevfest09 Cschalk Gwt
Devfest09 Cschalk Gwt
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
 
Openness In The Era Of Social Web
Openness In The Era Of Social WebOpenness In The Era Of Social Web
Openness In The Era Of Social Web
 
Dconrails Gecco Presentation
Dconrails Gecco PresentationDconrails Gecco Presentation
Dconrails Gecco Presentation
 
Jquery
JqueryJquery
Jquery
 
Introduction to the wonderful world of JavaScript
Introduction to the wonderful world of JavaScriptIntroduction to the wonderful world of JavaScript
Introduction to the wonderful world of JavaScript
 
Ajax World West
Ajax World WestAjax World West
Ajax World West
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
 
qooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkqooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Framework
 
Javascript Dependency Management
Javascript Dependency ManagementJavascript Dependency Management
Javascript Dependency Management
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
 

Último

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
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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
 
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
 
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
 
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
 
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
 
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 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
🐬 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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

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
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
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
 
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
 
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
 
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
 
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 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Drupal 6 JavaScript and jQuery

  • 1. Drupal 6 jQuery and JavaScript DrupalCampWI, 2009
  • 2. Matt Butcher First web app: 1995 About a dozen languages Five books, dozens of articles Milkshake problem
  • 4. What do you get with each download of jQuery? Tweet the answer @technosophos and win a book.
  • 5. Overview • JavaScript and its • Drupal JavaScript evolving place in web Translations applications • Drupal JavaScript • The rise of the Themes JavaScript library • The future of JavaScript • Introducing jQuery and what it means for CMS systems • Drupal Behaviors
  • 7. JavaScript, Circa 2000 • Introduced in Netscape 2.0 and IE 3.0 • Calculators, scrolling status messages, and image rollovers • Left us a sprawling landscape of speciality tools
  • 8. Two Big Changes • Dynamic rendering engine • XMLHttpRequest object
  • 9. Dynamic Rendering • With earlier browsers, documents could not be modified • Modifying the document without a page load was impossible until Gecko and IE 6 • Programmatic access to elements...
  • 10. Document Object Model • Standard API for accessing HTML or XML documents • JavaScript support means programmatic access to any part of the page • DOM + Dynamic Reflow = Modifiable pages
  • 11. XMLHttpRequest (XHR) • Introduced as a ActiveX component by Microsoft • Purpose: Transfer XML over HTTP without requiring a new page load
  • 12. Web 2.0: Jargon Attack! • AJAX: A better acronym Grrr.... than XMLHttpRequest? • JSON: A better format than XML? • DOM + AJAX = A new wave of web applications • AHAH, JSONP, Comet...
  • 13. The Rise of the JavaScript Library Or, Enough with the one-off scripts already!
  • 14. The Olden Days Scripts were simple tools designed with a single application in mind. To use one of these typically involved hacking at the code to apply it to your situation. Photo by heyrocker http://www.flickr.com/photos/heyrocker/417236386/
  • 15. The Library • Designed to solve a class of related problems • “Customization” is done through configuration files and function calls • Intended for re-use
  • 16. The Explosion of Libraries • First there were calendars and image rollovers. (Thanks, Macromedia!) • Libraries took on more sophisticated problems, like widgets and drag-and-drop. • Open Source libraries: Prototype, Ext.js, YUI, jQuery....
  • 17. One of the problems was just begging for a library....
  • 18. Web 2.0 + JavaScript = Icky? • Hard things: • DOM code is powerful, but(t) ugly • Event handling was... different. • AJAX was... different. • Other common tasks were difficult due to JavaScript... differences.
  • 19. The Brilliance of jQuery Provide a wrapper around all of the icky stuff. The wrapper should be simple yet robust.
  • 20. jQueryFeatures • Uses CSS 3 Selectors as • Event model that spans a query language all major browsers • Standard traversal and • Transitions and effects manipulation functions • CSS manipulation • AJAX library for XML, AHAH, JSON • Free pony with every download! • Cross-browser utilities
  • 21. Pony by Xiaphias http://en.wikipedia.org/wiki/File:Feralpony.jpg I lied about the pony
  • 22. jQuery Idioms •$ • Factory function • Chained methods • Anonymous functions and closures • Object literals
  • 23. $: It’s not just for Benjamins $(‘#content div.my-class’); $.get(someUrl);
  • 24. Factories and Chains [Insert industrial revolution joke here] $(‘#content’).children().text(‘Hi’);
  • 25. Anonymous Functions and function (data) { $.get(someUrl, Closures console.log(data); }); var msg = ‘Hello world’; $(‘#some-button’).click(function (event) { alert(msg); })
  • 26. Objects, like, Literally $(‘#content’).accordion({ header: ‘h2’, change: function () {} });
  • 27. JavaScript and Drupal How do they pair?
  • 28. Working Together • jQuery bundled with • Autocompletion Drupal • Drag-and-drop • JavaScript Behaviors • AHAH forms • JavaScript Translations • Progress meters and • Numerous utility dynamic upload functions • Batch processing • JavaScript theming • Buzzr, anyone?
  • 29. Drupal Behaviors • Assign an action to an element. • Drupal takes care of initializing when the page loads. • AJAX and other events may re- initialize.
  • 30. JavaScript Translations Static (application) text that appears in JavaScript code can be translated to any supported language.
  • 31. JavaScript Themes • Server theming: PHP templates. • JavaScript theming: jQuery. • Both use theme functions.
  • 33. The Future of JavaScript
  • 34. Three Key Technologies • Canvas: Draw on the canvas with JavaScript. • Workers: Direct access to threads means JavaScript can do work in the background. • Databases: Local storage and SQL databases in JavaScript. No, really.
  • 35. What will Drupal look like? • Inline image editors • Local caches of data to ease server load • Robust drawing inside of pages • Stateful clients that remember where they • Larger amounts of were on a site processing done on the client • Bottom line: A new era of client interactivity • Events generated by may be just around the corner. background computation
  • 36. The Recap • JavaScript has come a long way from its image rollover and scrolling status message days. • Drupal JavaScript libraries mean we can build more, faster, cheaper. • Future technologies are building on the web-as-application-platform paradigm.
  • 37. The Browser Goes Blue Collar The browser of the future is a universal application platform for a certain class of network applications. For the first time, the browser may define the application, and the servers will play an auxiliary role.
  • 38. Questions? Matt Butcher Twitter: http://twitter.com/technosophos Email: butcher@palantir.net Blog: http://technosophos.com

Notas do Editor