Created
December 27, 2011 16:31
-
-
Save pererinha/65290df2a8e14e30b78f to your computer and use it in GitHub Desktop.
jQuery Plugin Bootstrap
This file contains 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 info = { | |
name : 'markdownEditor', | |
version : '1.0', | |
soundtrack : 'Requiem for a dream', | |
author : '@pererinha', | |
date : '27/12/2011' | |
} | |
var defaults = { | |
height : 400, | |
width : 600, | |
}; | |
var MarkDownEditor = function( input ){ | |
var settings, el; | |
function resize(){ | |
el.width( settings.width ); | |
el.height( settings.height ); | |
} | |
// Public methods | |
return { | |
init : function ( options ) { | |
el = $( input ); | |
settings = options; | |
resize(); | |
} | |
}; | |
} | |
$.fn.markdownEditor = function( options ) { | |
if( !options ){ options = {}; } | |
var options = $.extend(defaults, options); | |
var instance = $.data( this, 'markdownEditor', new MarkDownEditor( this )); | |
return instance.init.call(this, options); | |
}; | |
})( jQuery ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment