W3C home > Mailing lists > Public > public-pointer-events@w3.org > April to June 2014

[Bug 25220] New: Use elided pseudo-code instead of alert() in examples 1 and 2

From: <bugzilla@jessica.w3.org>
Date: Tue, 01 Apr 2014 01:04:03 +0000
To: public-pointer-events@w3.org
Message-ID: <bug-25220-5978@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=25220

            Bug ID: 25220
           Summary: Use elided pseudo-code instead of alert() in examples
                    1 and 2
           Product: PointerEventsWG
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Pointer Events specification
          Assignee: jrossi@microsoft.com
          Reporter: redux@splintered.co.uk
        QA Contact: public-pointer-events-bugzilla@w3.org
                CC: public-pointer-events@w3.org

Just to make the examples look a bit less amateurish, perhaps better to replace
the various alert(...) statements in examples 1 and 2 with a comment and
elipsis?

In example 1:

if(window.navigator.maxTouchPoints>1)
    alert("Your user agent and hardware support multi-touch!");
}

change to

if(window.navigator.maxTouchPoints>1)
    /* User agent and hardware support multi-touch */
}


In example 2:

switch(event.pointerType) {
    case "mouse":
        /* mouse input detected */
        ...
        break;
    case "pen":
        /* pen/stylus input detected */
        ...
        break;
    case "touch":
        /* touch input detected */
        ...
        break;    
    default:
        /* pointerType is empty (could not be detected)
           or UA-specific custom type */
        ...
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Tuesday, 1 April 2014 01:04:05 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:20:26 UTC