News for hackers. Stuff that matters.
Re:Game about squares by Sephr on Sunday July 27, 2014 @02:15PM (#8093459)
The author is intentionally limiting this app to touch-only for touch-capable users. This breaks the game for anyone wanting to use a touchpad or mouse on their touchscreen laptop.

The offending code (from http://gameaboutsquares.com/game.c.js, beautified):

    (function($) {
        try {
            document.createEvent("TouchEvent");
            return;
        } catch (f) {}
        var eventMap = {
            mousedown : "touchstart",
            mouseup : "touchend",
            mousemove : "touchmove"
        };
        // mouse handling code follows
Never do this! Remove the entire try-catch block. There is absolutely no reason for you to be limiting touch-capable users to touch-only.
Re:Game about squares by gk1 on Sunday July 27, 2014 @03:53PM (#8093783)
I use a touch-enabled laptop and come across this far too often. Even nytimes.com is guilty of this, as is Stripe Checkout.
Re:Game about squares by agmetcalf on Monday July 28, 2014 @01:17PM (#8098073)
We actually changed this recently in Stripe Checkout. Touch detection worked great for 99% of cases, but serving a touch-only experience to devices like yours was pretty clearly unacceptable.

We're now treating the touch-only versions as optimized for specific platforms. For example, we have a mobile version that is optimized for, and only displays on, Android and iOS. Going forward, we may explore a pointer event polyfill to improve support for less common touch devices.

Re:Game about squares by gk1 on Monday July 28, 2014 @01:32PM (#8098172)
I stand corrected. Thank you for finally making this change... It's been driving me mad.
Re:Game about squares by Kiro on Sunday July 27, 2014 @04:41PM (#8093903)
Why are people doing this? There must be a reason.
Re:Game about squares by skeletonjelly on Sunday July 27, 2014 @07:16PM (#8094324)
Re:Game about squares by Kiro on Monday July 28, 2014 @03:48AM (#8095616)
It doesn't answer why they want to do this in the first place.
Re:Game about squares by tootie on Monday July 28, 2014 @09:49AM (#8096652)
A lot of site have a design for mouse (hover states, pulldowns) and a design for touch (the hamburger) and they want to use only one or the other.
Re:Game about squares by Touche on Monday July 28, 2014 @02:35PM (#8098542)
Touch and mouse are separate input devices and have separate set of expectations associated with them.
Re:Game about squares by gegenschall on Sunday July 27, 2014 @02:39PM (#8093556)
Further more it is completely unusable on some touch devices, I tried iPad 4 and iPhone 5. They both scroll the page (better: bump to the top, as if you wanted to scroll past the end of a page) instead of moving the blocks. :-/
Re:Game about squares by izietto on Monday July 28, 2014 @05:25AM (#8095833)
No problem on Android Browser 4.4
Re:Game about squares by JoshTriplett on Sunday July 27, 2014 @05:24PM (#8094028)
I have a touchscreen laptop, and both touch and mouse work perfectly for me. Firefox 31 here.
Re:Game about squares by Aardwolf on Monday July 28, 2014 @10:33AM (#8096921)
Is it multitouch? Could it be that there is no TouchEvent and the touch screen acts as mouse?