Risen Against Gravity

GenSephyr

I've moved my blog and portfolio to http://fusedthought.com/en/blog. However, this site will still be kept as an archive...

Individual entires can still be accessed using their trackback links.

Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Sunday, May 27, 2007

Blogskin / style switcher Version 2

In the last post (http://gyeojz.blogspot.com/2007/05/blogskin-style-switcher.html), I've announced the availability of the blogksin switcher.

After some work, I've updated it to remember the user's preferences via the use of cookies. It was some work, but finally it is ready.

For those who want to have a style switcher but are unable to use brothercake's IOTBS in Blogger or some other sites due to the same-origin policy, my style switcher may be the answer. However, it may not be suited for all, but at least it works.



Some good points over the usual "alternate stylesheet method";
1. It loads the styles on demand.
2. Its cross-browser compatible. (at least its tested to work in Firefox, IE6, IE 7 and Opera).
3. Its customizable to load other style required elements like javascript on demand too.
4. The file size is relatively small.

Known Issues
1. In Opera, default is alright. but some layout problems when a alternative style is used. Seems that it doesn't really support link disabled.



The switcher works by getting the ?css= Parameter in the URL.
index.html?css=0 resets to the default style. While other numbers corresponds to the other style types.

I'll be packaging the scripts into a zip file and releasing it under a license once I solve the Opera bug/problem.

So watch this space =)

UPDATE: Opera Problem fixed.

Tuesday, May 22, 2007

Blogskin / style switcher

Remember a few post ago at the release of my current blogskin, "Desire Secundus: Choosing the path to take", I was musing about the lack of support for the IOTBS switcher because of cross-domain restriction?

well, I've thought about it and came up with a solution.
Using a script from netlobo which gets url parameters, I've came up with something which emulates PHP (but less efficient) and is expandable for future blogskins/style.
It even downloads the blog styles on-demand...

However, there is one limitation. The user preferences aren't remembered and the only way is for the user to visit the site using the appropriate URL parameters to view the skin.

Probably the user preference will come at a later date.
For now, enjoy the switcher (located in the sidebar or somewhere in the page depending on the blogskin/style).

The GET URL parameter script is copyright to the respective programmer.
For now, the switcher is copyrighted to me. I may decide to release it under another license at a later date. For now, it is still undergoing some tests.

So enjoy!

(p.s. For those who haven't read the news on the closure of Yahoo photos, you can read an article about it at my tech blog.)

Content and Layout by GenSephyr. Copyright © 2007 GenSephyr All Rights Reserved

Site designed with Open Source Technologies.