A bunch of jQuery plugin snippets for Sublime Text 2 via shichuan/javascript-patterns/jquery-plugin-patterns
Clone this repo into the Packages directory of Sublime Text.
- Basic - the most basic pattern
- Extend - enables you to define multiple functions at once and which sometimes make more sense semantically
- Lightweight - perfect as a generic template for beginners and above
- Namespaced pattern - to avoid collisions and improve code organization when working with components under another namespace
- Prototypal inheritance - prototypal inheritance with the DOM-to-Object bridge pattern
- Best options - globally/Per-call overridable options for greater option customization
- Custom events (Pseudo Pub/Sub) - for better application decoupling
- 'Highly configurable' mutable - define plugin’s logic using a constructor and an object literal defined on its prototype
- UI Widget factory - for building complex, stateful plugins based on object-oriented principles
- UI Widget factory "bridge" - the bridge serves as a middle layer between a JavaScript object that is created using $.widget and jQuery’s API
- UI Widget factory for jQuery mobile - demonstrating best practices for building mobile widgets
- UI Widget + RequireJS module - for wrapping jQueryUI widgets inside RequireJS compatible modules
- Universal Module Definition pattern - create AMD and CommonJS compatible plugin modules which are compatible with a number of different script loaders
shichuan references
The Essentials of Writing High Quality JavaScript
jQuery Anti-Patterns for Performance & Compression
How DRY Affects JavaScript Performance
Pro JavaScript Design Patterns
Essential JavaScript Design Patterns For Beginners, Volume 1.
According to the site: "100% Free & taken from somewhere else"