![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
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:
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 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.