Why Javascript matters

55 %
45 %
Information about Why Javascript matters
Technology

Published on January 28, 2014

Author: markoheijnen

Source: slideshare.net

Description

At WordCamp Norway I presented about why Javascript matters when developing for WordPress. The amount of Javascript grows and it's time that developers look more into Javascript.

The focus is around the example I build for WordSesh to show what you can do with Javascript and Node.js

Why Javascript matters WordCamp Norway - 2014

Who I am? • Marko Heijnen - @markoheijnen • Working at 1&1 Internet as their WordPress specialist • WordPress core contributor • GlotPress core developer - @GlotPress • Co-author of WP_Image_Editor

Agenda • Why, we as PHP developers, should focus more on the Javascript side • Showing features of Javascript you didn’t know • Ending with an awesome example

WordPress has grown • PHP - 69.1 % • Javascript - 18.4 % • CSS 12.5 %

Current libraries we use • • • • jQuery Backbone.js MediaElement.js TinyMCE ! ! • • • • jQuery UI Underscore.js Plupload zxcvbn

History • WordPress 2.2 starts using jQuery • 3.5 using Backbone/Underscore for the media dialog • 3.6 • MediaElements for audio/video control • Heartbeat API • Revisions started to use Backbone

Future • 3.9 will add playlists for audio & video • TinyMCE 4 • Image editor UI

The things you want to do often, now requires understanding of Javascript

Opening a new media dialog // Create the media frame. image_frame = wp.media.frames.formatImage = wp.media({ // Set the title of the modal. title: $el.data('choose'), // Tell the modal to show only images. library: { type: 'image' }, // Customize the submit button. button: { // Set the text of the button. text: $el.data('update') } }); image_frame.open();

Cool stuff you
 have in Javascript

getUserMedia / WebRTC for live streaming

http:/ /www.webrtc.org/demo https:/ /apprtc.appspot.com

Using Javascript to build almost native apps

Node.js

Node.js • Javascript platform • Uses an event-driven, non-blocking I/O model • Lightweight and efficient • Ideal for real time application • http://nodejs.org/

Running a webserver with Node.js

var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(1337, '127.0.0.1');

The awesome example WordSesh needs NodeJS

WordSesh - Problems • Needs to be refreshed every hour • Has 15 minutes of silence • Results in accidentally playing the previous session

WordSesh - Idea • NodeJS lets you push new sessions • When the session is over, it will be removed • Be able to use YouTube files as wait music • Create a hangout through WordPress

Control panel - two channels

Play a YouTube movie

wordsesh.wpcentral.io

Questions? @markoheijnen markoheijnen.com wpcentral.io wordsesh.wpcentral.io

Add a comment

Related presentations

Related pages

Why JavaScript Matters: A Talk by Doug Crockford

Montana State University EPS Room 103, Bozeman, MT 59718. Why JavaScript Matters
Read more

Why JavaScript Matters | Computer Science Department at ...

August 16th, 2016 Prof. Zhandry awarded Best Young Researcher at CRYPTO 2016; August 11th, 2016 Strong showing of Princeton researchers at CCS; August 5th ...
Read more

Why Javascript Matters : Scott Dowdle : Free Download ...

Douglas Crockford gave a presentation entitled Why Javascript Matters at Montana State University Bozeman on Wednesday, April 20th, 2011.
Read more

Why Javascript on the Server Matters - AppNeta

Standardizing on Javascript helps more teams focus on the same thing: creating stellar applications that deliver phenomenal user experiences.
Read more

Why Framer.js Matters — Medium

And why designers should start using it. ... This past week I’ve been playing around with a Javascript-based prototyping tool called Framer.
Read more

Why JavaScript Matters - cs.rutgers.edu

Why JavaScript Matters Douglas Crockford, Senior JavaScript Architect, Yahoo! ... Crockford is the author of JavaScript: The Good Parts ISBN 978-0596517748.
Read more

Why JavaScript Matters | Computer Science Department at ...

Why JavaScript Matters. Printer Friendly Date and Time Tuesday, April 26, 2011 - 4:30pm to 5:30pm. Location Computer Science Small Auditorium (Room 105) ...
Read more

Why availability matters - Kryogenix

Why availability matters. ... don't get the JavaScript or the CSS or something. ... That's why you need to make your site's availability as high as possible.
Read more

Why Functional Programming Matters - Bret Victor

Why Functional Programming Matters John Hughes The University, Glasgow Abstract ... Yet why should this be? The only faintly plausible reason
Read more