Posted by: Paul on: September 11, 2008
As a follow up to the previous release, I’ve put together another plugin for the Expression Engine content management system.
This one adds the full YUI rich text editor to the ‘body’ area of the Expression Engine publish / edit interface.
The YUI simpleEditor is nice and everything, but sometimes it’s a bit too … simple.
Get the [...]
Posted by: Paul on: August 27, 2008
Being frustrated with the tinymce plugin for Expression Engine, I decided to create a rich text editor plugin for Expression Engine using the YUI library simple editor.
Due to a magic combination of:
the awesomeness of the YUI library
the thoroughness of the YUI documentation
the simplicity of creating extensions for Expression Engine
it was surprisingly straightforward.
If you’re using Expression [...]
Posted by: Paul on: April 29, 2008
Along with dom traversal (ala CSS2), you can also use CSS2 and CSS3 selectors in jQuery. For example:
lb = $(‘a[rel="lightbox"]‘);
will get you all the anchor elements in the dom which have the rel=”lightbox” attribute. This, however:
lb = $(‘a[rel*="light"]‘);
will get you all the anchor elements in the dom which have the substring “light” in their rel [...]
Posted by: Paul on: March 7, 2008
I’ve been using components of the YUI framework for a while now and have been really impressed with the depth and breadth of what it enables you to do. I was pretty convinced I’d stick with YUI for a good while….until today.
Now, I’d heard about jQuery a lot but had never taklen a decent look [...]
Posted by: Paul on: May 10, 2007
wrong: write 100 lines of code, test, spend an hour undoing your typo’s and logic bugs
right: write 5-10 lines of code, test, make easy fixes, repeat as often as needed until component is complete.
Posted by: Paul on: March 20, 2007
It’s typeof to the rescue (again)!
To check if a function exists before you try and call it (and get a nasty javasscript error), use typeof to check.
Heres something I prepared earlier:
if(typeof window.myFunction == ‘function’) {
// function exists, so we can now call it
myFunction(‘foo’, ‘bar’);
}
——————
Want to improve your JavaScript skills? I recommend the following:
Ajax in [...]
Posted by: Paul on: February 8, 2007
In my previous post, I detailed how typeof could be used to test if something is present or not. Given that this sounds loosely defined at best, consider the following:
window.onload = function() {
var myObject = new Object();
var myImg = new Image();
var myArray = new Array();
var myString = new String();
theDiv = document.getElementById(‘n’);
theDiv.innerHTML = typeof(myObject) + ‘<br [...]
Posted by: Paul on: February 1, 2007
PHP has a simple function to test whether a variable or array key is set:
if(isset($somevar)) {
// do PHP stuff
}
I needed the same kind of thing in JavaScript as tests like this were failing:
if(case1 && case1[0].innerHTML && case1[0].innerHTML.length > 0) {
// you won’t be doing anything in here, as your browser will cry and complain
}
Seeing as [...]
recent comments