Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Class Prototype ${USER} ${DATE}
- */
- /* global Utils */
- 'use strict';
- (function ($, context) {
- var ${className} = context.${className} = function () {
- this.init.apply(this, arguments);
- };
- ${className}.prototype = {
- constructor: ${className}.prototype.constructor,
- options: {
- },
- /**
- * Constructor
- */
- init: function (element, options) {
- this.options = $.extend(true, {}, this.options, options, Utils.getOptionsFromDom('${className.toLowerCase()}', element));
- this.${DS}element = $(element);
- this.create();
- this.events();
- },
- /**
- * Create dom and init dom references to this
- */
- create: function () {
- },
- /**
- * Init all events
- */
- events: function () {
- }
- };
- //jquery plugin implementation
- $.fn.${className.substring(0,1).toLowerCase()}${className.substring(1)} = function(options) {
- return this.each(function() {
- if(!$(this).data('${className}-plugin')) {
- $(this).data('${className}-plugin', new ${className}(this, options));
- }
- });
- };
- })(jQuery, window);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement