This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25220 - Use elided pseudo-code instead of alert() in examples 1 and 2
Summary: Use elided pseudo-code instead of alert() in examples 1 and 2
Status: RESOLVED FIXED
Alias: None
Product: PointerEventsWG
Classification: Unclassified
Component: Pointer Events specification (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Jacob Rossi [MSFT]
QA Contact: Pointer Events Bugzilla list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-01 01:04 UTC by Patrick H. Lauke
Modified: 2014-05-31 22:15 UTC (History)
1 user (show)

See Also:


Attachments

Description Patrick H. Lauke 2014-04-01 01:04:03 UTC
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 */
        ...
}
Comment 1 Jacob Rossi [MSFT] 2014-05-31 22:15:45 UTC
Fixed as suggested:
https://dvcs.w3.org/hg/pointerevents/rev/72268b279eb8