yeeg

Sep. 30th, 2006 10:34 am
egypturnash: (Default)
[personal profile] egypturnash
Last night, instead of working on work stuff (which I've been spazzing on and getting behind, ugh) , I experimented with using the Script.aculo.us dynamic html library in the backend of Singapore for reordering, moving and deleting images. Wheeeee. It took longer than I want to admit just to figure out how to wire up a button to move all the dragged divs back into their original container... DHTML accomplished via Javascript-coerced-to-look-like-Ruby is really head-hurty when you don't actually know any Ruby.*

If I go anywhere with it I suspect I may try finding a smaller effects library and rolling a few of the functions myself; 144k (after including just the parts of the library I require) is a hell of a lot of extra crap to load just for WHEE DRAGGY DRAG!!! - even when I only call for it on the pages you can do it on.

I feel dirty. Next thing I know I'll be using 8-pixel type and putting round corners and shiny plastic gradients on everything, because I'll have caught the web 2.0 disease...

* sortable list reset code 'cause NONE of the examples do anything like this:
<input type="button" class="button" value="Undo changes" onClick="javascript:resetform();"/>
...and this javascript embedded somewhere in the page, below the 'Thumbnails' etc. divs filled with divs we want to drag:
	// initialize all these sortables 
	things = new Array ('Thumbnails', Trash', 'First', 'Prev', 'Next', 'Last');
	for (i=0; i<things.length; i++) {
		Sortable.create (things[i], {tag:'div',  containment:things, dropOnEmpty:true, constraint:false});
	}
	
	function resetform() {
		for (i=1; i<things.length; i++) {
			$children=$A(Element.findChildren($(things[i]),false,false,'div'));
			$children.each(function (which) {
				$('Thumbnails').appendChild(which);
			})
		}
		Sortable.setSequence ('Thumbnails',Sortable.sequence('Thumbnails').sort());
	}


I would've stuck some fragments of this on their documentation/examples wiki, but I can't figure out where on earth to register a username!

"$children.each". That is so clearly someone jamming alien constructs into Javascript. It was easier to talk to scriptaculous objects on their own terms than to do it in more traditional ways, though! But trying to switch between php syntax, javascript syntax, and javascript-pretending-to-be-ruby syntax is brain-grinding.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

Profile

egypturnash: (Default)
Margaret Trauth

October 2020

S M T W T F S
    123
45678 910
11121314151617
18192021222324
25262728293031

Most Popular Tags

Expand Cut Tags

No cut tags
Page generated Jun. 30th, 2025 11:14 am