SlideShare une entreprise Scribd logo
1  sur  14
Télécharger pour lire hors ligne
Drupal DOMinate
Stories of masochism on the front end
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
Agenda
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
Worst Practices
Best Practices
Drupal.behaviors{}
Drupal.settings{}
Questions
Don’t hack core
If I update jQuery versions it works it doesn’t work!
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
Stories from the front-end lines
Better/Best Practices
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
jQuery Update module
http://drupal.org/project/jquery_update
Using closure
http://drupal.org/project/jqmulti
Drupal DOM object
Whip out your web inspector, firebug, dev tool flavor and take a peek
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
Drupal {}
Drupal.settings{}
Drupal.theme()
Drupal.locale{}
Drupal.behaviors{}
Drupal.js
Let’s have a read
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'locale': {} };
Drupal.behaviors
Man I wish I knew that before
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
Drupal.behaviors
Man I wish I knew that before
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
So how should I load my script on the page?
Drupal.behaviors
Man I wish I knew that before
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
Drupal.behaviors
Man I wish I knew that before
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
Drupal.attachBehaviors();
Drupal.behaviors
Man I wish I knew that before
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
$(“#element”).doSomething();
$(“#element:not(.processed)”).addClass(‘processed’).doSomething();
vs
Drupal.settings
Another way of using drupal_add_js
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
Drupal.settings
Another way of using drupal_add_js
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
Sources
Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
http://api.drupal.org/api/drupal/developer!topics!
javascript_startup_guide.html/6
http://drupal.org/node/304258
http://drupal.org/project/jqmulti
https://drupal.org/node/121997

Contenu connexe

Tendances

Contribution & Confidence, All Things Open Keynote
Contribution & Confidence, All Things Open KeynoteContribution & Confidence, All Things Open Keynote
Contribution & Confidence, All Things Open KeynoteRachel Andrew
 
Building Gutenberg Applications & WebOPS Case Study
Building Gutenberg Applications & WebOPS Case StudyBuilding Gutenberg Applications & WebOPS Case Study
Building Gutenberg Applications & WebOPS Case StudyRoy Sivan
 
A Practical Approach to React Native at All Things Open Conference
A Practical Approach to React Native at All Things Open ConferenceA Practical Approach to React Native at All Things Open Conference
A Practical Approach to React Native at All Things Open ConferenceTracy Lee
 
Alexa Skills Kit programing for dummies
Alexa Skills Kit programing for dummiesAlexa Skills Kit programing for dummies
Alexa Skills Kit programing for dummiesNaotaka Jay HOTTA
 
ScholarPress OAH 2010
ScholarPress OAH 2010ScholarPress OAH 2010
ScholarPress OAH 2010Jeremy Boggs
 
[Codecamp] The sorry state of frontend code
[Codecamp] The sorry state of frontend code[Codecamp] The sorry state of frontend code
[Codecamp] The sorry state of frontend codeAlin Pandichi
 
The Power of RxJS in Nativescript + Angular
The Power of RxJS in Nativescript + AngularThe Power of RxJS in Nativescript + Angular
The Power of RxJS in Nativescript + AngularTracy Lee
 
WTF Is the Semantic Web? - Greg Elin
WTF Is the Semantic Web? - Greg ElinWTF Is the Semantic Web? - Greg Elin
WTF Is the Semantic Web? - Greg ElinCrisisCommons
 
WTF Is the Semantic Web? Ignite
WTF Is the Semantic Web? IgniteWTF Is the Semantic Web? Ignite
WTF Is the Semantic Web? IgniteGreg Elin
 
Nitro for your Grails App: How to improve performance!! Greach' 18
Nitro for your Grails App: How to improve performance!!  Greach' 18Nitro for your Grails App: How to improve performance!!  Greach' 18
Nitro for your Grails App: How to improve performance!! Greach' 18Alberto Barón Cuevas
 
Brightspace Ignite Tennessee 2015 - Version Control for Course Content
Brightspace Ignite Tennessee 2015 - Version Control for Course ContentBrightspace Ignite Tennessee 2015 - Version Control for Course Content
Brightspace Ignite Tennessee 2015 - Version Control for Course ContentD2L Barry
 
RxJS: A Beginner & Expert's Perspective - ng-conf 2017
RxJS: A Beginner & Expert's Perspective - ng-conf 2017RxJS: A Beginner & Expert's Perspective - ng-conf 2017
RxJS: A Beginner & Expert's Perspective - ng-conf 2017Tracy Lee
 
Automate, Create Tools, & Test Ideas Quickly with Google Apps Script
Automate, Create Tools, & Test Ideas Quickly with Google Apps ScriptAutomate, Create Tools, & Test Ideas Quickly with Google Apps Script
Automate, Create Tools, & Test Ideas Quickly with Google Apps ScriptCatalyst
 
The Angular road from 1.x to 2.0
The Angular road from 1.x to 2.0The Angular road from 1.x to 2.0
The Angular road from 1.x to 2.0Vassilis Pitsounis
 
We Are Developers - Modern React (Suspense, Context, Hooks) - Roy Derks
We Are Developers - Modern React (Suspense, Context, Hooks) - Roy DerksWe Are Developers - Modern React (Suspense, Context, Hooks) - Roy Derks
We Are Developers - Modern React (Suspense, Context, Hooks) - Roy DerksRoy Derks
 
WordPress SFO Meetup - Gutenberg FAQ
WordPress SFO Meetup - Gutenberg FAQWordPress SFO Meetup - Gutenberg FAQ
WordPress SFO Meetup - Gutenberg FAQRoy Sivan
 
Building Headless Applications with WordPress & Gutenberg
Building Headless Applications with WordPress & GutenbergBuilding Headless Applications with WordPress & Gutenberg
Building Headless Applications with WordPress & GutenbergRoy Sivan
 
Visual Studio 2013 Update 4 Introduction
Visual Studio 2013 Update 4 IntroductionVisual Studio 2013 Update 4 Introduction
Visual Studio 2013 Update 4 IntroductionWarren Thompson
 

Tendances (20)

5 W's of Hookin'
5 W's of Hookin'5 W's of Hookin'
5 W's of Hookin'
 
Contribution & Confidence, All Things Open Keynote
Contribution & Confidence, All Things Open KeynoteContribution & Confidence, All Things Open Keynote
Contribution & Confidence, All Things Open Keynote
 
Building Gutenberg Applications & WebOPS Case Study
Building Gutenberg Applications & WebOPS Case StudyBuilding Gutenberg Applications & WebOPS Case Study
Building Gutenberg Applications & WebOPS Case Study
 
A Practical Approach to React Native at All Things Open Conference
A Practical Approach to React Native at All Things Open ConferenceA Practical Approach to React Native at All Things Open Conference
A Practical Approach to React Native at All Things Open Conference
 
Alexa Skills Kit programing for dummies
Alexa Skills Kit programing for dummiesAlexa Skills Kit programing for dummies
Alexa Skills Kit programing for dummies
 
ScholarPress OAH 2010
ScholarPress OAH 2010ScholarPress OAH 2010
ScholarPress OAH 2010
 
[Codecamp] The sorry state of frontend code
[Codecamp] The sorry state of frontend code[Codecamp] The sorry state of frontend code
[Codecamp] The sorry state of frontend code
 
The Power of RxJS in Nativescript + Angular
The Power of RxJS in Nativescript + AngularThe Power of RxJS in Nativescript + Angular
The Power of RxJS in Nativescript + Angular
 
Let Codenarc check if you write good Groovy code
Let Codenarc check if you write good Groovy codeLet Codenarc check if you write good Groovy code
Let Codenarc check if you write good Groovy code
 
WTF Is the Semantic Web? - Greg Elin
WTF Is the Semantic Web? - Greg ElinWTF Is the Semantic Web? - Greg Elin
WTF Is the Semantic Web? - Greg Elin
 
WTF Is the Semantic Web? Ignite
WTF Is the Semantic Web? IgniteWTF Is the Semantic Web? Ignite
WTF Is the Semantic Web? Ignite
 
Nitro for your Grails App: How to improve performance!! Greach' 18
Nitro for your Grails App: How to improve performance!!  Greach' 18Nitro for your Grails App: How to improve performance!!  Greach' 18
Nitro for your Grails App: How to improve performance!! Greach' 18
 
Brightspace Ignite Tennessee 2015 - Version Control for Course Content
Brightspace Ignite Tennessee 2015 - Version Control for Course ContentBrightspace Ignite Tennessee 2015 - Version Control for Course Content
Brightspace Ignite Tennessee 2015 - Version Control for Course Content
 
RxJS: A Beginner & Expert's Perspective - ng-conf 2017
RxJS: A Beginner & Expert's Perspective - ng-conf 2017RxJS: A Beginner & Expert's Perspective - ng-conf 2017
RxJS: A Beginner & Expert's Perspective - ng-conf 2017
 
Automate, Create Tools, & Test Ideas Quickly with Google Apps Script
Automate, Create Tools, & Test Ideas Quickly with Google Apps ScriptAutomate, Create Tools, & Test Ideas Quickly with Google Apps Script
Automate, Create Tools, & Test Ideas Quickly with Google Apps Script
 
The Angular road from 1.x to 2.0
The Angular road from 1.x to 2.0The Angular road from 1.x to 2.0
The Angular road from 1.x to 2.0
 
We Are Developers - Modern React (Suspense, Context, Hooks) - Roy Derks
We Are Developers - Modern React (Suspense, Context, Hooks) - Roy DerksWe Are Developers - Modern React (Suspense, Context, Hooks) - Roy Derks
We Are Developers - Modern React (Suspense, Context, Hooks) - Roy Derks
 
WordPress SFO Meetup - Gutenberg FAQ
WordPress SFO Meetup - Gutenberg FAQWordPress SFO Meetup - Gutenberg FAQ
WordPress SFO Meetup - Gutenberg FAQ
 
Building Headless Applications with WordPress & Gutenberg
Building Headless Applications with WordPress & GutenbergBuilding Headless Applications with WordPress & Gutenberg
Building Headless Applications with WordPress & Gutenberg
 
Visual Studio 2013 Update 4 Introduction
Visual Studio 2013 Update 4 IntroductionVisual Studio 2013 Update 4 Introduction
Visual Studio 2013 Update 4 Introduction
 

En vedette

Festival 2015 - Negócios de Impacto
Festival 2015 - Negócios de ImpactoFestival 2015 - Negócios de Impacto
Festival 2015 - Negócios de ImpactoABCR
 
Mass Information Security Requirements January 2010
Mass Information Security Requirements January 2010Mass Information Security Requirements January 2010
Mass Information Security Requirements January 2010madamseane
 
US EPA BRAD TMOF
US EPA BRAD TMOFUS EPA BRAD TMOF
US EPA BRAD TMOFentogenex
 
Scavenger Hunt
Scavenger HuntScavenger Hunt
Scavenger Huntsgarrettp7
 
Our Global Village
Our Global VillageOur Global Village
Our Global VillageAndre Pageot
 
МультиТендер - почему наша реклама действительно работает
МультиТендер - почему наша реклама действительно работаетМультиТендер - почему наша реклама действительно работает
МультиТендер - почему наша реклама действительно работаетtelekomkonsalting
 
Episode 1 development
Episode 1   developmentEpisode 1   development
Episode 1 developmentAviator42009
 
2012 Spouse Catalogue Towson University Cps
2012 Spouse Catalogue Towson University Cps2012 Spouse Catalogue Towson University Cps
2012 Spouse Catalogue Towson University CpsNoel Waterman
 
Pokalbis
PokalbisPokalbis
Pokalbiszigius
 
Dasar dasar algoritma
Dasar dasar algoritmaDasar dasar algoritma
Dasar dasar algoritmaaliemprabowo
 
Bc Homes Sales Edge Lower in July 2011
Bc Homes Sales Edge Lower in July 2011Bc Homes Sales Edge Lower in July 2011
Bc Homes Sales Edge Lower in July 2011Matt Collinge
 
My smart goal presentation
My smart goal presentationMy smart goal presentation
My smart goal presentationBrandon Kingsley
 

En vedette (20)

Jeremy Rifkin em Curitiba
Jeremy Rifkin  em CuritibaJeremy Rifkin  em Curitiba
Jeremy Rifkin em Curitiba
 
Festival 2015 - Negócios de Impacto
Festival 2015 - Negócios de ImpactoFestival 2015 - Negócios de Impacto
Festival 2015 - Negócios de Impacto
 
Mass Information Security Requirements January 2010
Mass Information Security Requirements January 2010Mass Information Security Requirements January 2010
Mass Information Security Requirements January 2010
 
writing_research_paper_handout(goerzen2011)
writing_research_paper_handout(goerzen2011)writing_research_paper_handout(goerzen2011)
writing_research_paper_handout(goerzen2011)
 
My photo anaylsis
My photo anaylsisMy photo anaylsis
My photo anaylsis
 
US EPA BRAD TMOF
US EPA BRAD TMOFUS EPA BRAD TMOF
US EPA BRAD TMOF
 
Scavenger Hunt
Scavenger HuntScavenger Hunt
Scavenger Hunt
 
What BP Does
What BP DoesWhat BP Does
What BP Does
 
Our Global Village
Our Global VillageOur Global Village
Our Global Village
 
Conditionals
ConditionalsConditionals
Conditionals
 
МультиТендер - почему наша реклама действительно работает
МультиТендер - почему наша реклама действительно работаетМультиТендер - почему наша реклама действительно работает
МультиТендер - почему наша реклама действительно работает
 
Photo presentation8
Photo presentation8Photo presentation8
Photo presentation8
 
Episode 1 development
Episode 1   developmentEpisode 1   development
Episode 1 development
 
2012 Spouse Catalogue Towson University Cps
2012 Spouse Catalogue Towson University Cps2012 Spouse Catalogue Towson University Cps
2012 Spouse Catalogue Towson University Cps
 
Tugas tik
Tugas tikTugas tik
Tugas tik
 
Pokalbis
PokalbisPokalbis
Pokalbis
 
Dasar dasar algoritma
Dasar dasar algoritmaDasar dasar algoritma
Dasar dasar algoritma
 
Bc Homes Sales Edge Lower in July 2011
Bc Homes Sales Edge Lower in July 2011Bc Homes Sales Edge Lower in July 2011
Bc Homes Sales Edge Lower in July 2011
 
Janitor psa
Janitor psaJanitor psa
Janitor psa
 
My smart goal presentation
My smart goal presentationMy smart goal presentation
My smart goal presentation
 

Similaire à Drupal DOMinate

Drupal Integrated DevOps Workflow
Drupal Integrated DevOps WorkflowDrupal Integrated DevOps Workflow
Drupal Integrated DevOps WorkflowCrifkin
 
Bigdata for small pockets, by Javier Ramirez from teowaki. RubyC Kiev 2014
Bigdata for small pockets, by Javier Ramirez from teowaki. RubyC Kiev 2014Bigdata for small pockets, by Javier Ramirez from teowaki. RubyC Kiev 2014
Bigdata for small pockets, by Javier Ramirez from teowaki. RubyC Kiev 2014javier ramirez
 
Internship final presentation
Internship final presentationInternship final presentation
Internship final presentationNealGopani
 
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love itDrupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love itRyan Weaver
 
Configuration Management with Puppet
Configuration Management with Puppet Configuration Management with Puppet
Configuration Management with Puppet Rachel Andrew
 
The Modern Java Web Developer Bootcamp - Devoxx 2013
The Modern Java Web Developer Bootcamp - Devoxx 2013The Modern Java Web Developer Bootcamp - Devoxx 2013
The Modern Java Web Developer Bootcamp - Devoxx 2013Matt Raible
 
Beating the Class out of Drupal 8: An intro to the Classy core theme
Beating the Class out of Drupal 8: An intro to the Classy core themeBeating the Class out of Drupal 8: An intro to the Classy core theme
Beating the Class out of Drupal 8: An intro to the Classy core themeCoLab Coop
 
Beginning Laravel Workshop - September 2018
Beginning Laravel Workshop - September 2018Beginning Laravel Workshop - September 2018
Beginning Laravel Workshop - September 2018Peter Gallagher
 
Getting to know composer - (PHP)
Getting to know composer - (PHP)Getting to know composer - (PHP)
Getting to know composer - (PHP)Bill Condo
 
For a Social Local and Mobile Drupal
For a Social Local and Mobile DrupalFor a Social Local and Mobile Drupal
For a Social Local and Mobile DrupalAdyax
 
Drupal
DrupalDrupal
Drupalbtopro
 
WebGeek AppNimbus (Nikko Bautista)
WebGeek AppNimbus (Nikko Bautista)WebGeek AppNimbus (Nikko Bautista)
WebGeek AppNimbus (Nikko Bautista)WebGeek Philippines
 
The State of Drupal 8
The State of Drupal 8The State of Drupal 8
The State of Drupal 8nyccamp
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalDrupalDay
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupalsparkfabrik
 
Building Web Apps in Ratpack
Building Web Apps in RatpackBuilding Web Apps in Ratpack
Building Web Apps in RatpackDaniel Woods
 
Automated Testing in WordPress, Really?!
Automated Testing in WordPress, Really?!Automated Testing in WordPress, Really?!
Automated Testing in WordPress, Really?!Ptah Dunbar
 
5 best practices for (web/ software) development (2010)
5 best practices for (web/ software) development (2010)5 best practices for (web/ software) development (2010)
5 best practices for (web/ software) development (2010)Erwin Elling
 
Pushing The Boundaries Of Continuous Integration
Pushing The Boundaries Of Continuous IntegrationPushing The Boundaries Of Continuous Integration
Pushing The Boundaries Of Continuous IntegrationRobbie Clutton
 

Similaire à Drupal DOMinate (20)

Drupal Integrated DevOps Workflow
Drupal Integrated DevOps WorkflowDrupal Integrated DevOps Workflow
Drupal Integrated DevOps Workflow
 
Bigdata for small pockets, by Javier Ramirez from teowaki. RubyC Kiev 2014
Bigdata for small pockets, by Javier Ramirez from teowaki. RubyC Kiev 2014Bigdata for small pockets, by Javier Ramirez from teowaki. RubyC Kiev 2014
Bigdata for small pockets, by Javier Ramirez from teowaki. RubyC Kiev 2014
 
Drupalcampatl d7
Drupalcampatl d7Drupalcampatl d7
Drupalcampatl d7
 
Internship final presentation
Internship final presentationInternship final presentation
Internship final presentation
 
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love itDrupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
Drupal 8: Huge wins, a Bigger Community, and why you (and I) will Love it
 
Configuration Management with Puppet
Configuration Management with Puppet Configuration Management with Puppet
Configuration Management with Puppet
 
The Modern Java Web Developer Bootcamp - Devoxx 2013
The Modern Java Web Developer Bootcamp - Devoxx 2013The Modern Java Web Developer Bootcamp - Devoxx 2013
The Modern Java Web Developer Bootcamp - Devoxx 2013
 
Beating the Class out of Drupal 8: An intro to the Classy core theme
Beating the Class out of Drupal 8: An intro to the Classy core themeBeating the Class out of Drupal 8: An intro to the Classy core theme
Beating the Class out of Drupal 8: An intro to the Classy core theme
 
Beginning Laravel Workshop - September 2018
Beginning Laravel Workshop - September 2018Beginning Laravel Workshop - September 2018
Beginning Laravel Workshop - September 2018
 
Getting to know composer - (PHP)
Getting to know composer - (PHP)Getting to know composer - (PHP)
Getting to know composer - (PHP)
 
For a Social Local and Mobile Drupal
For a Social Local and Mobile DrupalFor a Social Local and Mobile Drupal
For a Social Local and Mobile Drupal
 
Drupal
DrupalDrupal
Drupal
 
WebGeek AppNimbus (Nikko Bautista)
WebGeek AppNimbus (Nikko Bautista)WebGeek AppNimbus (Nikko Bautista)
WebGeek AppNimbus (Nikko Bautista)
 
The State of Drupal 8
The State of Drupal 8The State of Drupal 8
The State of Drupal 8
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
 
Behaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & DrupalBehaviour Driven Development con Behat & Drupal
Behaviour Driven Development con Behat & Drupal
 
Building Web Apps in Ratpack
Building Web Apps in RatpackBuilding Web Apps in Ratpack
Building Web Apps in Ratpack
 
Automated Testing in WordPress, Really?!
Automated Testing in WordPress, Really?!Automated Testing in WordPress, Really?!
Automated Testing in WordPress, Really?!
 
5 best practices for (web/ software) development (2010)
5 best practices for (web/ software) development (2010)5 best practices for (web/ software) development (2010)
5 best practices for (web/ software) development (2010)
 
Pushing The Boundaries Of Continuous Integration
Pushing The Boundaries Of Continuous IntegrationPushing The Boundaries Of Continuous Integration
Pushing The Boundaries Of Continuous Integration
 

Dernier

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
🐬 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
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
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
 
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
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
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
 
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
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
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...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

Drupal DOMinate

  • 1. Drupal DOMinate Stories of masochism on the front end Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
  • 2. Agenda Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather Worst Practices Best Practices Drupal.behaviors{} Drupal.settings{} Questions
  • 3. Don’t hack core If I update jQuery versions it works it doesn’t work! Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather Stories from the front-end lines
  • 4. Better/Best Practices Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather jQuery Update module http://drupal.org/project/jquery_update Using closure http://drupal.org/project/jqmulti
  • 5. Drupal DOM object Whip out your web inspector, firebug, dev tool flavor and take a peek Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather Drupal {} Drupal.settings{} Drupal.theme() Drupal.locale{} Drupal.behaviors{}
  • 6. Drupal.js Let’s have a read Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'locale': {} };
  • 7. Drupal.behaviors Man I wish I knew that before Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
  • 8. Drupal.behaviors Man I wish I knew that before Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather So how should I load my script on the page?
  • 9. Drupal.behaviors Man I wish I knew that before Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
  • 10. Drupal.behaviors Man I wish I knew that before Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather Drupal.attachBehaviors();
  • 11. Drupal.behaviors Man I wish I knew that before Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather $(“#element”).doSomething(); $(“#element:not(.processed)”).addClass(‘processed’).doSomething(); vs
  • 12. Drupal.settings Another way of using drupal_add_js Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
  • 13. Drupal.settings Another way of using drupal_add_js Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather
  • 14. Sources Steve Rifkin & Matt Wrather LA Drupal 5-14-2013 @steverifkin @mwrather http://api.drupal.org/api/drupal/developer!topics! javascript_startup_guide.html/6 http://drupal.org/node/304258 http://drupal.org/project/jqmulti https://drupal.org/node/121997