Mattias Sundberg - Om saker som passerar genom mina synapser

Leaner and lighter

       // May 30, 2006 - 23:39

Stripped away about 200 lines of Javascript code today. Mostly obsolete stuff that wasn't in use but also some effects like the sortable "modules" in the right column. No need for it really.

The size of the file shrunk to 12Kb. But there's still about 96Kb of Javascript being loaded, Trimpath and Prototype being the largest. I can probably shrink that a lot by using the light version of Prototype but that mean I have to change a lot of the Ajax stuff so we'll se about that one...

Kommentera (0 kommentarer)

More useless Javascript

       // May 19, 2006 - 22:52

Seems like I'm spending more time adding quite useless features to the client-end of this blog engine instead of completing the administration GUI. But toys and Ajax-gizmos are so much more fun to do! =)

Did however set up another instance of the blog engine for a friend of mine, it was kind of an experiment to find out how portable it is. It worked out quite well, found a couple of bugs and made some new, temporary bugs, while setting it up. But head over to Jeppe to see what he is doing with it.

Kommentera (0 kommentarer)

swapNode in Firefox

       // May 12, 2006 - 23:43

This is for you lazy guys out there. The Microsoft DOM extension swapNode() is a quite handy feature when dealing with Ajax and stuff, however Firefox lacks this method and I figured I'd share the solution I'm using.

This solution doesn't require you to update your behaviours if you are using them. The functions references to the two nodes you want to swap.
function swapNodes(item1,item2) {
// We need a clone of the node we want to swap
var itemtmp = item1.cloneNode(1);

// We also need the parentNode of the items we are going to swap.
var parent = item1.parentNode;

// First replace the second node with the copy of the first node
// which returns a the new node

item2 = parent.replaceChild(itemtmp,item2);

//Then we need to replace the first node with the new second node
parent.replaceChild(item2,item1);

// And finally replace the first item with it's copy so that we
// still use the old nodes but in the new order. This is the reason
// we don't need to update our Behaviours since we still have
// the same nodes.

parent.replaceChild(item1,itemtmp);

// Free up some memory, we don't want unused nodes in our document.
itemtmp = null;
}

Kommentera (15 kommentarer)

Problems today

     // May 11, 2006 - 22:34

Have had some problems viewing post details all day and couldn't figure it out. Didn't really had the time to debug anything either but when I came home I knew what the problem was.

Seemed like I was to fast, as always, totally missed that a SQL-query threw an exception and the code was written to catch the exception and close the connection silently. Another thing to put on the ToDo-list kids, never catch exceptions if you don't intend to do anything with it =)

However, it should be OK now.

Kommentera (0 kommentarer)

Tags

   // May 10, 2006 - 09:17

I´m thinking of rewriting the tag-handling. Sure, the tag cloud stays and the links to del.icio.us and Technorati also stays. But I want to do something more to them. Maybe being able to subscribe to certain tags or combination of tags.

I don´t know...

Kommentera (0 kommentarer)

Mattias Sundberg

Detta är min alldeles högst personliga blogg där jag skriver om än det ena än det andra.
Ibland skriver jag ofta(re) ibland väldigt sällan. Jag skriver delvis säsongsbetonat då jag är ett stort Formel 1-fan och delvis om mitt jobb/hobby som programmerare.

Mer om mig hittar du här

Sundberg.IT

Bevaka via e-post

Genom att fylla i din e-postadress nedan får du meddelanden så fort jag uppdaterar bloggen.

Senast kommenterat

Follow Sundberg.IT Bloggportalen.se Add to Technorati Favorites Mashit.se MediaCreeper Creeper Vardagsbetraktelser bloggar

BloggRegistret.se

AlertFox