[jQuery] Extending jQuery
I want to learn the ins and outs of jQuery by writing a WYSIWYG
editor using jQuery.
I'm not sure where to start, though. I can't find a consistent way to
extend jQuery. Different libraries do it in different ways. I asked
about this once before a long time ago in 2006 on a grid control I
created.
http://www.mail-archive.com/discuss@jquery.com/msg09124.html
Here is my thoughts on an API. I'd like to get your feedback. (The
working name of my project is swimlane.)
You can create a swimlane object and operate on that.
var swimlane = $(".editor").swimlane();
swimlane.activate();
swimlane.toggleOrderedList();
swimlane.store("http://blogometer.com/swimlane/store",
function() { alert('done'); });
You could mimic the array oritented selectors.
$("#editor").swimlane()
.activate()
.toggleOrderedList()
.store(
"http://blogometer.com/swimlane/store",
function() { alert('done'); }
)
.end().css("wdith", "480px");
I've seen some interfaces where it seems like they are using a very
simple string messaging, along the lines of...
$('#editor').swimlane('activiate');
$('#editor').swimlane('toggleOrderedList');
Your thoughts are much appreciated.
--
Alan Gutierrez | alan@blogometer.com | http://blogometer.com/ | 504
717 1428
Think New Orleans | http://thinknola.com/