Issue #17 (querySelector, Utilities, Visual Tools, Guides)
(Skip to the tools section below)
If you've heard of querySelector and querySelectorAll, but maybe haven't made the jump to using them regularly (due to lack of support in oldIE), here is a quick summary:
First, querySelector. This method returns the first element that matches the selector query that it contains:
var el = document.querySelector('.example');
This is similar to what you do with the jQuery $() wrapper when passing in a selector. In the example above, since we're using querySelector, and not querySelectorAll, only the first element with a class of "example" will be selected. If no element matches, it will return null.
Next we have querySelectorAll:
var els = document.querySelectorAll('.example, .other');
In this case, because we're using querySelectorAll, the query will return a NodeList object that contains all the elements in the document that have a class of either "example" or "other".
In both cases, the selector value must be a valid CSS selector that the browser recognizes. Also, you can apply both methods directly to another base element rather than to the whole document:
var baseEl = document.getElementById('base');
var el = baseEl.querySelector('.example');
var els = baseEl.querySelectorAll('.example, .other');
In this case, line two will return the first element with a class of "example" that is inside an element with an ID of "base". The last line will return all elements with a class of "example" or "other" that are inside the same base element. And of course, if I wanted to, I could have used querySelector to grab the base element, too.
The great thing about querySelector and querySelectorAll is the fact that it's supported in all modern browsers and even goes back to IE8. The only catch with regards to IE8 is the fact that IE8 does not recognize most CSS selectors after CSS2.1, so you can use these methods safely in IE8 as long as you don't use any new selectors that IE8 doesn't support.
Now on to this week's tools!
"A library to automatically alert your users when they've lost internet connectivity, like Gmail." Has multiple theme options and requires no configuration.
"NodeJS module to compare two dom trees."
"The goal of CuttySSark is to allow the front-end developer to write compliant CSS that interacts seamlessly with the JS event model."
Cool library to transition/animate numbers like on a real odometer. Has some theme options, too.
"An open source library that provides drag'n'drop file uploads with image previews."
"Lightweight URL argument and parameter parser. Arg.js gives you quick and easy access to parameters in the URL."
mdn.io uses Google's 'I'm feeling lucky' functionality to redirect you to the first search result on MDN. Comes in handy as a quick URL search tool or when writing comments in code, for an easy short URL.
A music composer. More specifically, an "interface for the Web Audio API that supports rhythms, multiple instruments, repeating sections, and complex time signatures."
Text Editors and Visual Tools
Hammer for Mac
A multi-faceted native Mac app that offers numerous time-saving features including "built-in support for SASS (with Bourbon), CoffeeScript, HAML & Markdown, as well as special Hammer tags."
Find a page that has data in a table, and this bookmarklet gives you a button that copies the table into a new overlay and lets you sort, filter, edit, and download the data.
A simple CodePen-like editor for C, Go, Python, and Ruby.
Test Drive Google Fonts
Part of the Typecast app, lets you test fonts from the free Google Fonts directory using a GUI interface.
"Rich content editing entirely re-imagined for the web: an intuitive editor for web content which does not presuppose anything about how it will be rendered."
An open-source Sublime Text clone. Lots of open issues, but certainly an ambitious project that could offer a viable free alternative.
A nice clean and simple markdown editor that updates in real-time with option to switch the theme between GitHub and BitBucket.
Vim as a presentation tool. "Write your slides in a markdown file ... Run vimdeck <file_name.md> and it will generate a file for each slide and open them in VIM."
Docs and Guides
This is a guide describing a CSS metodology based on BEM/OOCSS, invented by the developers working on odnoklassniki.ru, a top Russian social networking website.
A simple step by step guide to help you install and get up and running with the Rails framework on any platform.
An IOS7+ app for iPhone and iPad that displays compatibility tables for HTML5, CSS3, etc. It looks like the name ("CIUM") and data is taken from the well-known "Can I use..." website, but I don't think there is any affiliation.
Can I use... (Beta)
And speaking of Can I use..., they've now launched a Beta version with some new functionality and features that you can start using and provide feedback on.
Easing Functions Cheat Sheet
"This page helps you choose the right easing function." For each example it includes syntax for jQuery (using an easing plugin), CSS, and Sass.
Suggest Your Tool via Twitter
Made something? Send links via Twitter @WebToolsWeekly (details here). No tutorials or articles, please.
3 CSS E-Books for $7!
To help Web Tools Weekly stay ad free, you can offer support:
Suggestions, corrections, improvements? Feel free to reply to this email.
Before I Go...
I don't have much to say about all the privacy and security issues that have been in tech news of late, but if you're concerned about that sort of thing, you might want to check out Ghostery, the web's "most popular privacy tool."
Thanks to all for subscribing and reading!