RSS - Latest posts Archive for November, 2008

Home » Archive for November, 2008
12Nov
2008

WordPress NextGen gallery tweak

Recently I found myself in that very anoying situation where a very good piece of software seemed to lack just this one function… again. I have been doing a gallery website and used the NextGen gallery plugin to display the photos. Unfortunatelly it was a case of a gallery per post with about 1 or 2 photos per gallery.

The biggest issue with this setting was the process of creating galleries. By default in NextGen you create the gallery on one page, upload the images in another, and then create new post yet elsewhere. But there had to be a way to at least merge the gallery creation with photo upload, especially considering a new gallery form consisted of a single “gallery name” field. (more…)

Categories:

7Nov
2008

Nested sortable using jTree – clickable links

jTree is a lightweight solution for nested, sortable lists based on jQuery. I’ve been trying to find a good solution for quite a while, however the only good competitor to jTree is now not compatible with the new jQuery (1.2.6). After getting fed up at work with including totally different sets of javascript files depending on whether the nested sortable was needed on a page or not I have decided it was time for some clean-up.

Minimal is a very good word to describe jTree, which most of the time is good, however sometimes you might just want a little bit more. One of the biggest issues for me was lack of clickable links inside the LIs. Fortunately after some tweaking I came up with a hacky but working solution:

if ($("#jTreeHelper").is(":not(:animated)") && e.button !=2) {
 	//	Allow for clickable links
	if(new String(e.target).match(/(f|ht)tp(s{0,1}):///ig)){
 		return false;
	}
	$("body").css("cursor","move");

Just add the highlighted lines in the jquery.jtree.js file. Basically it just checks if the target of the click is a link and if it is it ignores the dragging.

Categories: