squarespace-yui-block-initializers
A collection of initializers for Squarespace YUI blocks.
About
After having spent way too much time figuring out how to initialize different blocks in Squarespace projects, this has happened. The primary use-case for these methods is due to asynchronous web app routing and ajax content loading. Obviously, the issue with Squarespace is that when you do this the new content doesn't get any of its blocks initialized. Based on project needs thus far, these are the ones I have figured out. On top of that, I pulled some from this resource by this guy to add as well. I'm excluding the lightbox initializers until I can determine whether or not there is a lighter way to hit those or not. Submissions for others to be added are more than welcome :)
Installation
npm install squarespace-yui-block-initializers --save-dev
Usage
# CommonJS
var sqs = require( "squarespace-yui-block-initializers" );
# ES6 Module
import "node_modules/squarespace-yui-block-initializers/sqs";
Methods
- initVideo()
- initAudio()
- initCommerce()
- initImages()
- initGallery()
- initMap()
- trackPage( id )
Pull Requests
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request