Martin Suchan – BloQ Just another WordPress site

23Feb/112

Jak jsem si koupil originalni hru…

...aneb s poctivostí nejdřív pojdeš.

V lednu jsem si na Czech Computeru koupil originální hru Settlers 7, ale nakonec jsem si jí ani jednou nemohl zahrát a musel jsem jí vrátit. Jak to? Jednoduše, aktivační klíč v balení hry byl neplatný a ani výrobce hry, ani distributor to nedokázal nijak vyřešit. Jako uživatel jsem na podpoře a dopisováním strávil několik dnů a výsledek byl jen ten, že mi byly vráceny peníze. Kdybych si tu samou hru stáhnul třeba z Pirátské zátoky, mohl bych hrát tak do dvou hodin.

Jak to všechno probíhalo?

18Feb/116

How to make text unselectable on HTML page

How to make text on a web page unselectable? There are several possible approaches - using overlay transparent image in front of the text, using image with text instead of text, or using the following best practice:

There are currently two independent ways for preventing text selection: using CSS style user-select: none; and using attribute on target element unselectable="on". Unfortunately only subset of browsers supports the first one and another subset the second one. To be more precise the CSS style user-select: none; is currently not supported anywhere, but you can use these browser specific styles:
-webkit-user-select: none; - working in Chrome and Safari
-moz-user-select: none; - working in FireFox

On the other hand unselectable="on" is working in Internet Explorer 6+ and in Opera. There is actually one simple hiccup with this property - you need to use it on each sub element in you text to prevent the selection across elements, but I'm sure you'll figure this out :)

Summing that up: using the style and the attribute at the same time on your text you can easily prevent selecting anything.

Example: you can't select this sentence :-P

Tagged as: , 6 Comments
15Feb/111

Disabling key down event propagation in JavaScript

Imagine this non-trivial problem: you have div element with overflow: auto; and long text inside. The scrollbar appears automatically. Normally when the div is focused pressing keys Up or Down causes moving the content up or down. But what if you don't want to scroll the content on keydown event?

11Feb/110

Badges for World Community Grid team statistics

Well, the idea of Team badges really caught me, so I wrote little Opera Extension which injects team badges to Team Statistics page - and it looks really great :)
Current ratio is 1 day in user badges = 1 year in team badges.
http://test.suchan.cz/WCG/WCGTeamBadges.oex

It is currently in "beta" phase - it have tested it only on few pages, but it should be OK - give it a try :)