JAVASCRIPT, TESTING, AND DRUPAL

Similar documents
Subject Tool Remarks What is JQuery. Slide Javascript Library

Yusof Al-Wadei Page 1 of 9. Interactive Web Design through Survey and Adoption of Modern Web-Technologies Yusof Hussein Al-Wadei

with Microsoft Office Sharepoint Server (MOSS) Webparts

Framework as a master tool in modern web development

IGW+ Certificate. I d e a l G r o u p i n W e b. International professional web design,

FormAPI, AJAX and Node.js

Gantry Basics. Presented By: Jesse Hammil (Peanut Gallery: David Beuving)

dustin caruso JavaScript / WordPress / UI developer 1230 Parkside Drive South, Reading, PA, USA dustin@dustincaruso.com

Everything you ever wanted to know about Drupal 8*

About Me. Cross-platform Mobile Development Challenges, Best Practices and more.

Interactive Web Development ITP 301 (4 Units)

Auditing Drupal sites for performance, content and optimal configuration

IBM Digital Experience. Using Modern Web Development Tools and Technology with IBM Digital Experience

Google Web Toolkit. Introduction to GWT Development. Ilkka Rinne & Sampo Savolainen / Spatineo Oy

Continuous Integration and Delivery. manage development build deploy / release

What s New in IBM Web Experience Factory IBM Corporation

Drupal Training Modules 2015

MASTER DRUPAL 7 MODULE DEVELOPMENT

Creating Value through Innovation MAGENTO 1.X TO MAGENTO 2.0 MIGRATION

AJAX Toolkit Framework

A little about me: I m a Computer Science Engineer I m Spanish but living in Finland. I ve been working and contributing to Drupal for more than 3

HTML5, The Future of App Development

CAKEPHP & EXTJS - RESPONSIVE WEB TECHNOLOGIES

Embracing Eclipse Orion

IBM Script Portlet for WebSphere Portal Release 1.1

Progressive Enhancement With GQuery and GWT. Ray Cromwell

1 (11) Paperiton DMS Document Management System System Requirements Release: 2012/

An introduction to creating Web 2.0 applications in Rational Application Developer Version 8.0

Building Mobile Applications Creating ios applications with jquery Mobile, PhoneGap, and Drupal 7

Abdullah Radwan. Target Job. Work Experience (9 Years)

Facebook Twitter YouTube Google Plus Website . o Zooming and Panning. Panel. 3D commands. o Working with Canvas

Trainer name is P. Ranjan Raja. He is honour of and he has 8 years of experience in real time programming.

ECOMMERCE SITE LIKE- GRAINGER.COM

Lecture 9 Chrome Extensions

WebIOPi. Installation Walk-through Macros

Agile Web Application Testing

Advanced Online Media Dr. Cindy Royal Texas State University - San Marcos School of Journalism and Mass Communication

Advantage of Jquery: T his file is downloaded from

A set-up guide and general information to help you get the most out of your new theme.

CHOOSING THE RIGHT HTML5 FRAMEWORK To Build Your Mobile Web Application

Mike Laurel. Web Developer UI / UX Engineer.

OIT 307/ OIT 218: Web Programming

Porting Existing PhoneGap Apps to Tizen OS - Development Story

Cross-Platform Tools

CiviCRM for Drupal Developers

Simple Tips to Improve Drupal Performance: No Coding Required. By Erik Webb, Senior Technical Consultant, Acquia

Programming Fundamentals of Web Applications Course 10958A; 5 Days

Developing Exceptional Mobile and Multi-Channel Applications using IBM Web Experience Factory

E-Commerce: Designing And Creating An Online Store

Sitecore Dashboard User Guide

HTML5 Data Visualization and Manipulation Tool Colorado School of Mines Field Session Summer 2013

HtmlUnit: An Efficient Approach to Testing Web Applications

EZ PLATFORM DESIGN AND DEVELOP CONTENT-DRIVEN WEBSITES AND APPLICATIONS

Coding for Desktop and Mobile with HTML5 and Java EE 7

100% NO CODING NO DEVELOPING IMMEDIATE BUSINESS -25% -70% UNLIMITED SCALABILITY DEVELOPMENT TIME SOFTWARE STABILITY

Installing and Sending with DocuSign for NetSuite v2.2

Getting Started Developing JavaScript Web Apps. this = that. VT Geospatial Forum 2015

AUDIT REPORT EXAMPLE

Art of Code Front-end Web Development Training Program

Typography and Drupal. What does Drupal provide? Ashok Modi DDCLA 2011

by Geoff Blake TenTonOnline.com

Software Development & Education Center PHP 5

Drupal 8 Theming Deep Dive

Modern Web Development From Angle Brackets to Web Sockets

Using jquery and CSS to Gain Easy Wins in CiviCRM

How Web Browsers Work

Libraries Workshop Catalog

Creating a Drupal 8 theme from scratch

Creating Modern CICS Web Applications by Exploiting Open Source Javascript Libraries

WEB DEVELOPMENT COURSE (PHP/ MYSQL)

Testing for the web and some other stuff

Office 365 SharePoint Online White Paper

TIAGO FAIA MARQUES Online CV / Portfolio

Responsive Web Design: Is It Worth It?

Microsoft Dynamics CRM2015 Fast Track for developers

Website Optimization Tips for Speed

Start up Jobs Germany FEB 2014

Web Components What s the Catch? TJ

Develop a Native App (ios and Android) for a Drupal Website without Learning Objective-C or Java. Drupaldelphia 2014 By Joe Roberts

Preparing for Drupal 8

D7 Panels From Zero to Hero Tutorial

Symfony2 and Drupal. Why to talk about Symfony2 framework?

Week 7 Audio and Video

Paul Boisvert. Director Product Management, Magento

Software Development Interactief Centrum voor gerichte Training en Studie Edisonweg 14c, 1821 BN Alkmaar T:

Content Management System (Comparison between Top- Three CMS Platforms)

Front-end Automated Testing #drupal-fat

A Baseline for Web Performance

Notes on how to migrate wikis from SharePoint 2007 to SharePoint 2010

Who? Wolfgang Ziegler (fago) Klaus Purer (klausi) Sebastian Gilits (sepgil) epiqo Austrian based Drupal company Drupal Austria user group

DIPLOMA IN WEBDEVELOPMENT

Conference Paper. Distributed Performance Systems using HTML5 and Rails. Dr. Jesse Allison 1.

Content Management System

Responsive Web Design for Drupal

The Importance of Portal & Web Testing in Your Enterprise. The Growing Challenge of Testing Browser-Based Technologies in SAP

ADAA s Resources for Professionals Portal User Guide

Design ï Development ï Digital Marketing ï Content

Show me the tests! Writing Automated Tests for Drupal

USING SYNERGY WITH CRUISE CONTROL

Transcription:

JAVASCRIPT, TESTING, AND DRUPAL Rob Ballou @rob_ballou 1

JS, TESTING, AND DRUPAL What is the current state of JS in Drupal 7? JavaScript testing Drupal 8 2

ABOUT ME I work for Aten Design Group in Denver, Colorado I am a developer. I like code. 3

DRUPAL 7 4

DRUPAL 7 Drupal is a platform Unlike other systems, you get many tools out-of-the-box What does this include? 5

jquery Drupal jquery drupal.js Plugins: Once, Cookie, Form form.js jquery UI ajax.js 6

JQUERY Drupal comes with: jquery 1.4.4 (2 years old) Newest version: jquery 1.8.2 (1 month old) Core stability, interaction with other modules other JS May miss out on new functionality (e.g,.on()) 7

THERE S A MODULE FOR THAT 8

jquery Update module will provide you with updates jquery 1.8.2 is in the dev version http://drupal.org/project/jquery_update 9

USING JS 10

HOW TO ADD JS Theme Layer Module Libraries 11

THEME JS General UX code Code that helps with the site s appearance Anything that ties heavily to your site s HTML 12

<script> 13

THEME JS Drop the JS file into your theme folder Add the JS to your theme info file scripts[] = js/main.js You can also add via your html.tpl.php file (but you shouldn t) 14

MODULES AND LIBRARIES Relates to your module s functionality Use the Libraries module for 3rd party JS 15

MODULES AND LIBRARIES Use drupal_add_js() http://is.gd/drupal_add_js 16

DRUPAL_ADD_JS Don t do this. It will include your JS everywhere... even if your module isn t being used 17

DRUPAL_ADD_JS Don t do this. It will include your JS everywhere... even if your module isn t being used 17

DRUPAL_ADD_JS! This will only include the JS when your hook is going to run. This is a good thing. 18

DRUPAL_ADD_JS! This will only include the JS when your hook is going to run. This is a good thing. 18

DON T BUILD JS Don t build your JS within your module 19

DON T BUILD JS Don t build your JS within your module 19

MODULES AND LIBRARIES Put JS in a separate file! Use Drupal.settings to get at values from your module into JS 20

USING drupal.settings 21

DRUPAL BEHAVIORS drupal.behaviors allows you to run code when DOM is loaded It also ties into AJAX completion This is simple to implement. Kinda. 22

drupal.behaviors EXAMPLE Use the jquery.once() plugin if you only want the code to execute on DOM load 23

USING JQUERY You can also use jquery directly still May be easier if you re used to it You can use $.ajaxcomplete() 24

TESTING 25

TESTING We ve added our JS What about making sure this code works, though? 26

27

TESTING Testing is good JS testing is important because: Front end code can change any stage in your project Browsers 28

29

QUNIT MODULE 30

TEST SWARM Automated testing with QUnit 31

TESTING Test Swarm is an active project It s involved in the getting tests available in D8 And... it allows you to create your own tests 32

TESTING Implement hook_testswarm_tests() Create a list of tests for your module/js Tests are written in QUnit 33

SO GO TEST YOUR CODE! 34

DRUPAL 8 35

DRUPAL 8 Testing: http://drupal.org/node/237566 Don t use drupal_add_js: http://drupal.org/node/1737148 New libraries: http://drupal.org/node/1149866 Lots of other changes: http://groups.drupal.org/node/226738 AMD, jquery dependencies 36

DRUPAL 8 The future is coming along fast Many of the changes look to create some good practices Smaller JS profiles 37

DRUPAL 8 Get involved, find a way to contribute Voice an opinion Feature freeze is coming up! 38

JAVASCRIPT, TESTING, AND DRUPAL Rob Ballou @rob_ballou 39