Sample NPM package.json for Drupal

I've recently started to dump build tools. The abstractions just aren't needed, and add complexity in some cases. To that end, I'm nearly doing all my asset management in package.json with NPM scripts. For existing sites I'm maintaining, I can use this as a simple drop in to help get started. It may require a little modification site to site, depending on if you need to ignore certain themes, or modules. But, I think the base package here is clear enough you'll be able to replicate the pieces required.

Passing Extra Data To JQuery Ajax Callback Functions

While working with a form that needed ajax handling I ran into an issue. The system I was developing was extremely likely to cause multiple of the same form on the page, one per element. Trying to find and adjust the form post ajax was starting to involve the addition of ids, moving down the dom to move back up, etc. Just nasty, and totally inefficient. So I did a bit of digging to find a way to pass the initial jQuery $form element from the ajax kickoff into the resulting callbacks.


Automatically Saving Form Values In localStorage Cache

As part of the rewrite of a major application process for a client, they have requested the ability to navigate away from the form and come back to finish later. We suggested using database storage at the server, but it was declined as they did not want to use logins, and IP based retrieval could be less secure than desired. They did however, jump at the ability to save data permanently in the user's browser allowing them to come back at need, potentially even year over year. Thus began a small foray into auto persisting forms using localStorage. There's way more to the application than is represented here, but I've pulled the auto-saving piece out as I find it extremely useful in a generic sense.

A generic, lazy loading, self dependency resolving geolocation javascript service object

I've been working on upgrading a client's form autofill options. Right now, they have server side ip sniffing, and forms I'm unable to cache because of the defaulted information. So, blank forms with client side geolocation through the the javascript navigator object is required. I've done this kind of thing before, but it's always been on the page, assuming everything would work. This time around, I'm doing things a little differently, anticipating using this over and over for their many forms. So this time, I'm playing by a few new rules...


Subscribe to RSS - javascript