SlideShare a Scribd company logo
1 of 14
Download to read offline
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

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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
 

Similar to 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
 

Similar to 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
 

Recently uploaded

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
 
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
 
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
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
[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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
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
 

Recently uploaded (20)

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?
 
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
 
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
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
[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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
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
 

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