JavaScript: transform slug to camel case

I refactor my atom packages at the moment and one thing I changed was loading classes from other files. Before, everything was hard-coded and it should be more generic, especially facing future changes. Because I used kind of slug strings internally, I created a function which converts slugs into camel case. Perhaps you need such code?

Continue reading JavaScript: transform slug to camel case

jQuery: missing method toggleAttr for toggling attributes

Today I needed some JS-Code for toggling an DOM elements attribute. Because there is no such feature in the jQuery core, I implemented it. Perhaps it’s useful for you, so here it is :)

Continue reading jQuery: missing method toggleAttr for toggling attributes

jQuery: copy events from one element to another

At the moment, I improve my ApToggleSwitch plugin and stumbled over a problem which leads to a nice jQuery function I want to share. Perhaps this code can be useful for you!

The problem was that I have to copy a special event from one html element to another – in my case I only wanted the change event to be copied. I found some posts how to copy events, but the solutions did not work perfectly, so I had to merge the solutions presented in this thread.

Continue reading jQuery: copy events from one element to another

Firefox only saves 3 windows per default – extend it!

Oh my lovely firefox… Today I had to restart my computer because of important Windows updates. So I closed every application, including four Firefox windows, in mind, that Firefox restores every single window. The problem is, that this browser only saves 3 windows per default, not more! So be careful with how many windows you work, respectively how many windows you want Firefox to restore!

Continue reading Firefox only saves 3 windows per default – extend it!

New jQuery plugin: ApToggleSwitch

Last month I searched for a nice component to improve checkboxes. Checkboxes are okay but I think that a toggle switch is a nicer representation of the TRUE/FALSE status. Furthermore on touch devices checkboxes are sometimes too small, so users really have to aim to click the control.

In total I found a lot of different solutions out there, really inspiring CSS and JavaScript code, but no one was clean, simple and also had a nice look. That’s the reason why I implemented another toggle switch control, inspired by HTC Sense interface!

Have a look!

WordPress Plugin the MVC way

I have to improve a WordPress plugin so it supports more (specific) features. My problem was that I have never worked with WordPress code or even created or modified a WordPress plugin, so I had no experience with WordPress coding. Furthermore I love working with Delphi, C# and PHP, so I do the OOP way – above all because of its many advantages over procedural way (Yeah, I know, there are also disadvantages!). So I searched for a good introduction/code base for implementing the MVC pattern and use it in my plugin. But I did not find anything that satisfied my needs…

That’s why I want to share my code with you which is hopefully a help for everyone who will programm the OOP way ;) You can always find the code at GitHub or downloade it directly as as ZIP file.

Here you can find the readme file.

How to test web applications without having all mobile devices?

Last week I worked on my jQuery plugin apOverlay which will be a part for my apWindow plugin hat gets published in the next two or three weeks. In all modern browsers there are no problems at all – ha, that’s wrong! This is only the half the truth because this statement counts only in normal browser, not completely on mobile devices and its default browsers. But how to test if the implementation is correct? No one wants to buy each phone, PDA, tablet… Well, there is the way to look for simulators but that’s not so easy sometimes :)

Continue reading How to test web applications without having all mobile devices?

PNG-Unterstützung im Internet Explorer 6 (Update)

Abgesehen davon, dass der Internet Explorer 6 schon längst überfällig ist und eigentlich beerdigt gehört – vor allem da es wesentlich bessere und vor allem schnellere Browser gibt – muss man sich als Webdesigner immer wieder damit herumschlagen. Ich bin an dieser Stelle auch ein Vertreter der Meinung, dass wenn ich einem Kunde eine Website liefere, dann muss diese auf allen benutzen Browser gleichermaßen gut funktionieren. Ein Kunde sieht aber meist sehr schnell ein, dass in so einem alten (oder sollte ich sagen veraltet?) Browser JavaScript-Code eher langsam ausgeführt wird, wodurch es dann zu ruckeligen Darstellungen kommen kann. Aber spätestens wenn die Website optisch nicht aussieht, wie in jedem anderen Browser wird er etwas skeptisch.

Continue reading PNG-Unterstützung im Internet Explorer 6 (Update)

Besucherzähler UserCounter auf Basis des pCounter für Yii

Ich hab schon auf einigen Seiten einen Besucherzähler verwendet, der sehr einfach gehalten ist. Viele andere sind (mir) zu komplex und bieten mehr als man will, oder werde gar auf anderen Seiten gehostet, wie z.B. Google Analytics. Mir ist durchaus klar, dass das gerade erwähnte Beispiel eine eierlegende Wollmilchsau ist und man fast unendlich Möglichkeiten hat, aber es muss beim Seitenaufbau dennoch Code von einer anderen Seiten geladen werden. Bei externen Anbietern stellt sich zudem allgemein immer auch die Frage: wie lange wird dieser Service noch angeboten? Was passiert bei Updates? Was passiert, wenn dieser eines Tages mal abgeschaltet werden sollte?

Continue reading Besucherzähler UserCounter auf Basis des pCounter für Yii