Created
September 19, 2012 13:16
-
-
Save quoidautre/3749617 to your computer and use it in GitHub Desktop.
JQUERY: plugin template
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 characters
| (function($){ | |
| var methods = { | |
| init : function( options ) { | |
| // Create some defaults, extending them with any options that were provided | |
| var settings = $.extend( { | |
| table : '', | |
| field :'', | |
| authentification:false | |
| }, options); | |
| return this.each(function(){ | |
| $(this).on('dblclick',function() { | |
| }); | |
| }); | |
| }, | |
| show : function( ) {}, | |
| hide : function( ) {}, | |
| update : function( content ) {} | |
| }; | |
| $.fn.editcontent = 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 !' ); | |
| } | |
| }; | |
| })(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment