Creating jQuery Plugin for RTE Intellisense

Was doing some proof of concept with RTE plugin like CKEditor or TinyMCE, and ended up with an interest to incorporate a text hints or intellisense for the editor.

At first I was trying to use the jQuery Autocomplete, but it tie to a input box, and RTE does not use input box, they use contenteditable DOM element like <body> inside an iframe. And I came across the amazing code editor CodeMirror that came with the amazing autocomplete feature that I was looking for, it pops up nicely where it meant to be, and performance was terrific, but I don’t want dependencies from any of CodeMirror’s code base, and reverse engineering isn’t my strength.

… 

 

jQuery hover executed twice

Recently been using jQuery a lots for effect and for the awesome DOM manipulation. I found there is a small problem with this code:
[cc lang=”javascript” escaped=”true”]
$(“#myButton”).hover(function() {
// my hover function
}[/cc]
The function get executed when mouse over the button, but when mouse is leaving the button, it get executed again, quick fix:
[cc lang=”javascript” escaped=”true”]$(“#myButton”).hover(function() {
// my hover function
,function() {} );[/cc]
Just adding in the an empty function after that seems to fix the problem.

 

Fun with jquery Animated Timer

Recently been assigned a task to create a simple game for web site, without using Flash, Java, HTML5 Canvas or Unity plugin, and I have to use server side script as I need to do some backend process. I’ve combined with jquery for the front end UI update for much more smoother game play experience. I’ve got a nice polished web design from designer, so I decided to make the timer to more animated, I not yet familiar with the jquery and yet want to try build this on my own. So I got myself a very dirty codes, but it served my purposed, and still got improvement, such as extending the jquery (I guess there already got such thing out there), automatically create the 6 tag, cleaning unnecessary codes.


NOTE:  Somehow Javascript is not working on WordPress.com, to be fix once moved to my hosting.

Demo:

00:00:00



…