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...
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.
Postades fredag 12 maj av
Mattias Sundberg
|
Uppdaterad fredag 21 januari, 15:47
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)
{
var itemtmp = item1.cloneNode(1);
var parent = item1.parentNode;
item2 = parent.replaceChild(itemtmp,item2);
parent.replaceChild(item2,item1);
parent.replaceChild(item1,itemtmp);
itemtmp = null;
}
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.
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...
It took eight or nine tries but at last
Technorati has indexed this blog. They seriously have some problems with certain blogs.
Some good came out of it though, I finally took the time to look over the markup generated from the blog engine and it's now validated.
Technorati Profile
Just claiming my blog at Technorati, their Javascript-version don't work that well...
Today I finally took the step and let this blog out of it's prison, as of now it will be readable for the whole world, even though very few will actually read it :)
There's still much to do but it would also be nice with some feedback. So far it has only been tested with Firefox (1.5) on Windows and Debian GNU/Linux and Internet Explorer 6. Opera should work although some things will render badly.
The ToDo-list has been updated also, trackbacks are now enabled but are shown as ordinary comments. This will however change very soon.
I will probably get some work done tonight, Sweden isn't playing their next game in the hockey World Championships until tomorrow so :)
And we will win the wholee thing, just wait and see. i do hope the final will be a reprise of the Olympics with Finland against Sweden, it won't get better than that!
Wrote a new module last night.
The module is called mod_xmms and displays the current tracks being played in Xmms. However, it´s a quite custom module since it will not work unless Xmms is run from the same machine as the blog engine. It also shows the cover image from my
Mp3 Archive which is my other ongoing project.
I also now load the jstemplates with Ajax and I am also able to reload the templates with Ajax after editing them. Quite handy if you ask me =)
I´ve pulled my hair for several hours when trying to localize the blog engine. So without further due, here´s the solution on Debian-based systems:
First, symlink /etc/locale.gen to /usr/share/i18n/SUPPORTED:
emma:/home/mattias# ln -s /etc/locale.gen /usr/share/i18n/supported
And then run locale-gen:
emma:/home/mattias# locale-gen
The problem is that Debian doesn´t generate all supported locales as default and gettext won´t translate anything if the systems locales is missing. So, either use the solution I provided or run:
emma:/home/mattias# dpkg-reconfigure locales
When asked which locales you want to generate, select "All locales". This will acutally do exactly the same thing as my solution although somewhat more automatic.