Created
December 12, 2013 14:59
-
-
Save antoviaque/7929345 to your computer and use it in GitHub Desktop.
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($) { | |
| $.scribble = { | |
| window: window, | |
| location: location, | |
| bootstrap: function(root) { | |
| var $this = this; | |
| if(root.hasClass('scribble_root')) { | |
| console.log('Error: Scribble is already instanciated on this/these DOM element(s)'); | |
| } else { | |
| $this.render(root); | |
| } | |
| }, | |
| render: function(root) { | |
| root.empty(); | |
| root.addClass('scribble_root'); | |
| root.append('<a href="#">Scribble!</a>'); | |
| } | |
| }; | |
| $.fn.scribble = function() { | |
| console.log(this); | |
| return this.each(function() { | |
| $.scribble.bootstrap($(this)); | |
| }); | |
| }; | |
| })(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment