Autonomía digital y tecnológica

Código e ideas para una internet distribuida

Linkoteca. jQuery


I’ve just had a nice experience improving and modernizing a large JavaScript codebase in a WordPress plugin. The original code was written in an old-fashioned way with jQuery in a single large file. Using modern EcmaScript and tools like Webpack, I was able to split it into modules and improve the code structure. The new code is much more readable and maintainable, and of course, fewer bugs. In this tutorial, I’ll show you how I did that.

Not too long ago I decided to write a jQuery plugin for making the use of iScroll a little less painful. Since I made the plugin at work I’m not really at liberty to share it. But what I can share is a step by step tutorial for creating a jQuery plugin of your own. Let’s get started.

Flapper is a jQuery plugin that replicates the split-flap (or «Solari») displays that used to be common in train stations and airports, and your dad’s alarm clock in the 70s.

To use, just attach Flapper to any input on your page. Whenever the input’s change event is fired, Flapper will update the display.