Last active
February 11, 2024 22:23
Revisions
-
adamwdraper revised this gist
Feb 5, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else { // Browser globals factory(jQuery); -
adamwdraper created this gist
Jun 18, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,63 @@ // Uses AMD or browser globals to create a jQuery plugin. /** * Name - jQuery Plugin * * Version: 0.0.1 (5/25/2012) * Requires: jQuery v1.7+ * * Copyright (c) 2011 User - http://github.com/username * Under MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jQuery'], factory); } else { // Browser globals factory(jQuery); } }(function ($) { var $this; var methods = { init : function( options ) { return this.each(function(){ var $this = $(this), data = $this.data('initialized'); if ( ! data ) { $this = $(this); $this.data('initialized', true); } }); }, value: function() { }, set: function(value) { }, reset: function() { } }; $.fn.inputGrid = function( method ) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.plugin' ); } }; }));