src/cm/media/js/lib/yui/yui_3.10.3/docs/event/gestures.html
changeset 525 89ef5ed3c48b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cm/media/js/lib/yui/yui_3.10.3/docs/event/gestures.html	Tue Jul 16 14:29:46 2013 +0200
@@ -0,0 +1,303 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>Event</title>
+    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic">
+    <link rel="stylesheet" href="../../build/cssgrids/cssgrids-min.css">
+    <link rel="stylesheet" href="../assets/css/main.css">
+    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
+    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
+    <script src="../../build/yui/yui-min.js"></script>
+    
+</head>
+<body>
+<!--
+<a href="https://github.com/yui/yui3"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
+-->
+<div id="doc">
+    <div id="hd">
+        <h1><img src="http://yuilibrary.com/img/yui-logo.png"></h1>
+    </div>
+    
+        <a href="#toc" class="jump">Jump to Table of Contents</a>
+    
+
+            <h1>Event</h1>
+    <div class="yui3-g">
+        <div class="yui3-u-3-4">
+            <div id="main">
+                <div class="content"><div class="intro">
+    <p>The <code>event-gestures</code> rollup module provides gesture events such as "flick" and "gesturemove", which normalize user interactions across touch and mouse or pointer based input devices. <code>event-gestures</code> is comprised of two modules - <code>event-flick</code> and <code>event-move</code>.</p>
+</div>
+
+<h2 id="using-event-flick">Using <code>event-flick</code></h2>
+
+<p>The <code>event-flick</code> module provides a "flick" event which notifies users interested in a "flick" gesture, providing distance, time and velocity information. Listening to a "flick" event is easy:</p>
+
+<pre class="code prettyprint">node.on(&quot;flick&quot;, function (event) {
+    Y.log(&quot;I was flicked!&quot;);
+});</pre>
+
+
+<h3 id="configuring-the-flick-event">Configuring the Flick Event</h3>
+
+<p>To configure the firing of the "flick" event, you can pass in an optional configuration object. Check the <a href="http://yuilibrary.com/yui/docs/api/classes/YUI.html#event_flick" alt="API Docs for Flick">API Docs</a> for a full list of keys that can be supplied into the config object.</p>
+
+<h2 id="using-event-move">Using <code>event-move</code></h2>
+
+<p>The <code>event-move</code> module provides "gesturemovestart", "gesturemove" and "gesturemoveend" events, which can be used to normalize drag type interactions across touch and mouse devices. These are very easy to use, but can be quite powerful.</p>
+
+<pre class="code prettyprint">node.on(&quot;gesturemovestart&quot;, function (event) {
+    Y.log(&quot;gesturemovestart was called&quot;);
+});
+
+node.on(&quot;gesturemove&quot;, function (event) {
+    Y.log(&quot;gesturemove was called&quot;);
+});
+
+node.on(&quot;gesturemoveend&quot;, function (event) {
+    Y.log(&quot;gesturemoveend was called&quot;);
+});</pre>
+
+
+<h3 id="gesture-events-in-different-environments">Gesture events in different environments</h3>
+
+<p>The <code>event-move</code> module normalizes gestures across mouse and touch environments.</p>
+
+<table>
+<thead>
+    <tr>
+        <th>Environment</th>
+        <th><code>gesturemovestart</code></th>
+        <th><code>gesturemove</code></th>
+        <th><code>gesturemoveend</code></th>
+    </th>
+</thead>
+<tbody>
+    <tr>
+        <td>Mouse</td>
+        <td><code>mousedown</code></td>
+        <td><code>mousemove</code></td>
+        <td><code>mouseup</code></td>
+    </tr>
+    <tr>
+        <td>Touch</td>
+        <td><code>touchstart</code></td>
+        <td><code>touchmove</code></td>
+        <td><code>touchend</code></td>
+    </tr>
+    <tr>
+        <td>MSPointer</td>
+        <td><code>MSPointerDown</code></td>
+        <td><code>MSPointerMove</code></td>
+        <td><code>MSPointerUp</code></td>
+    </tr>
+</tbody>
+</table>
+
+<h3 id="configuring-gesture-events">Configuring gesture events</h3>
+
+<p>By default, the "gesturemove" and "gesturemoveend" events only fire when the same node has subscribed to the "gesturemovestart" event as well. This can be over-ridden by setting <code>{standAlone: true}</code> in the configuration properties when subscribing to these events.</p>
+
+<p>Generally, a "gesturemovestart" and "gesturemoveend" event fires once, while the "gesturemove" event fires repeatedly as the mouse/finger moves across the screen. Each of these events also accept a config object to control their firing. Refer to the <a href="http://yuilibrary.com/yui/docs/api/classes/YUI.html#event_gesturemovestart" alt="Gesture API Docs">API Docs</a> for more information.</p>
+
+<h3 id="ie10-gestures-and--ms-touch-action">IE10, Gestures, and <code>-ms-touch-action</code></h3>
+
+<p>IE10 introduces the <a href="http://blogs.msdn.com/b/ie/archive/2011/09/20/touch-input-for-ie10-and-metro-style-apps.aspx" alt="MSPointer Events">MSPointer</a> events, which normalize mouse/touch/pen inputs in IE10. <code>event-move</code> takes advantage of these new events, and automatically use them on supported environments.</p>
+
+<p>Another new aspect of IE10 is the <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh767313.aspx" alt="MSTouchAction Property"><code>ms-touch-action</code></a> CSS property. This CSS property tells IE10 whether to permit default touch behavior or not. Examples of default touch behavior include panning the page, pinching, and double-tapping to zoom.</p>
+
+<p>To prevent default behavior, Microsoft suggests setting <code>-ms-touch-action: none</code> for elements on which you do not want the default touch behavior to occur. We have <a href="https://connect.microsoft.com/IE/feedback/details/767646/ms-touch-action-does-not-allow-a-way-to-programmatically-prevent-default-touch-behavior" alt="msTouchAction Bug">filed a bug</a>against IE10 regarding the prevention of default touch behavior.</p>
+
+<p>If you want an element to have an <code>-ms-touch-action</code> value other than <code>none</code>, the current workaround is to set that via JavaScript inside the "gesturemovestart" event:</p>
+
+<pre class="code prettyprint">&#x2F;&#x2F;On IE10, attaching gesturemovestart will set horizontalScrollingNode&#x27;s msTouchAction property to none.
+horizontalScrollingNode.on(&quot;gesturemovestart&quot;, function (e) {
+
+    &#x2F;*
+     * If we want to be able to swipe horizontally through the element,
+     * but still scroll the page when we swipe horizontally or pinch-zoom,
+     * we can set that via JavaScript in the styles property
+    *&#x2F;
+    horizontalScrollingNode.getDOMNode().style.msTouchAction = &#x27;pan-y | pinch-zoom&#x27;;
+});</pre>
+
+
+<p>If you wish to change the default <code>-ms-touch-action</code> value to be something other than <code>none</code>, you can change the default by modifying the <code>Y.Event._DEFAULT_TOUCH_ACTION</code>. Please note that this property may be changed in the future, depending on the resolution of and is subject to change based on the resolution of <a href="https://connect.microsoft.com/IE/feedback/details/767646/ms-touch-action-does-not-allow-a-way-to-programmatically-prevent-default-touch-behavior" alt="msTouchAction bug">this ticket</a> or a change in the <code>-ms-touch-action</code> implementation.</p>
+
+<h3 id="known-issues-in-ie10-touch-mode">Known Issues in IE10 Touch Mode</h3>
+
+<p>If you are using the <code>event-tap</code> or <code>event-flick</code> modules in IE10 on a touch-enabled device (ie: not mouse-based), you will need to set the <code>-ms-touch-action</code> property manually using CSS. Check out this <a href="http://blogs.msdn.com/b/ie/archive/2011/10/19/handling-multi-touch-and-mouse-input-in-all-browsers.aspx" alt="Handling Multi-touch in all browsers">example from Microsoft</a>.
+
+<p>You do not need to do this if you are using the <code>event-move</code> module, since that has support for -ms-touch-action built-in as of YUI3.7.3. You can follow the respective tickets for <a href="http://yuilibrary.com/projects/yui3/ticket/2532869" alt="event-tap mstouchaction ticket"><code>event-tap</code></a> and <a href="http://yuilibrary.com/projects/yui3/ticket/2532868" alt="eventflick mstouchaction ticket"><code>event-flick</code></a>.</p>
+
+</div>
+            </div>
+        </div>
+
+        <div class="yui3-u-1-4">
+            <div class="sidebar">
+                
+                    <div id="toc" class="sidebox">
+                        <div class="hd">
+                            <h2 class="no-toc">Table of Contents</h2>
+                        </div>
+
+                        <div class="bd">
+                            <ul class="toc">
+<li>
+<a href="#using-event-flick">Using <code>event-flick</code></a>
+<ul class="toc">
+<li>
+<a href="#configuring-the-flick-event">Configuring the Flick Event</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#using-event-move">Using <code>event-move</code></a>
+<ul class="toc">
+<li>
+<a href="#gesture-events-in-different-environments">Gesture events in different environments</a>
+</li>
+<li>
+<a href="#configuring-gesture-events">Configuring gesture events</a>
+</li>
+<li>
+<a href="#ie10-gestures-and--ms-touch-action">IE10, Gestures, and <code>-ms-touch-action</code></a>
+</li>
+<li>
+<a href="#known-issues-in-ie10-touch-mode">Known Issues in IE10 Touch Mode</a>
+</li>
+</ul>
+</li>
+</ul>
+                        </div>
+                    </div>
+                
+
+                
+                    <div class="sidebox">
+                        <div class="hd">
+                            <h2 class="no-toc">Examples</h2>
+                        </div>
+
+                        <div class="bd">
+                            <ul class="examples">
+                                
+                                    
+                                        <li data-description="Use the Event Utility to attach simple DOM event handlers.">
+                                            <a href="basic-example.html">Simple DOM Events</a>
+                                        </li>
+                                    
+                                
+                                    
+                                        <li data-description="Using the synthetic event API to create a DOM event that fires in response to arrow keys being pressed.">
+                                            <a href="synth-example.html">Creating an Arrow Event for DOM Subscription</a>
+                                        </li>
+                                    
+                                
+                                    
+                                        <li data-description="Supporting cross-device swipe gestures, using the event-move gesture events">
+                                            <a href="swipe-example.html">Supporting A Swipe Left Gesture</a>
+                                        </li>
+                                    
+                                
+                                    
+                                
+                                    
+                                
+                                    
+                                
+                                    
+                                
+                                    
+                                
+                            </ul>
+                        </div>
+                    </div>
+                
+
+                
+                    <div class="sidebox">
+                        <div class="hd">
+                            <h2 class="no-toc">Examples That Use This Component</h2>
+                        </div>
+
+                        <div class="bd">
+                            <ul class="examples">
+                                
+                                    
+                                
+                                    
+                                
+                                    
+                                
+                                    
+                                        <li data-description="Creating an accessible menu button using the Focus Manager Node Plugin, Event&#x27;s delegation support and mouseenter event, along with the Overlay widget and Node&#x27;s support for the WAI-ARIA Roles and States.">
+                                            <a href="../node-focusmanager/node-focusmanager-button.html">Accessible Menu Button</a>
+                                        </li>
+                                    
+                                
+                                    
+                                        <li data-description="Shows how to extend the base widget class, to create your own Widgets.">
+                                            <a href="../widget/widget-extend.html">Extending the Base Widget Class</a>
+                                        </li>
+                                    
+                                
+                                    
+                                        <li data-description="Example Photo Browser application.">
+                                            <a href="../dd/photo-browser.html">Photo Browser</a>
+                                        </li>
+                                    
+                                
+                                    
+                                        <li data-description="Portal style example using Drag &amp; Drop Event Bubbling and Animation.">
+                                            <a href="../dd/portal-drag.html">Portal Style Example</a>
+                                        </li>
+                                    
+                                
+                                    
+                                        <li data-description="Use IO to request data over HTTP.">
+                                            <a href="../io/get.html">HTTP GET to request data</a>
+                                        </li>
+                                    
+                                
+                            </ul>
+                        </div>
+                    </div>
+                
+            </div>
+        </div>
+    </div>
+</div>
+
+<script src="../assets/vendor/prettify/prettify-min.js"></script>
+<script>prettyPrint();</script>
+
+<script>
+YUI.Env.Tests = {
+    examples: [],
+    project: '../assets',
+    assets: '../assets/event',
+    name: 'event',
+    title: 'Event',
+    newWindow: '',
+    auto:  false 
+};
+YUI.Env.Tests.examples.push('basic-example');
+YUI.Env.Tests.examples.push('synth-example');
+YUI.Env.Tests.examples.push('swipe-example');
+YUI.Env.Tests.examples.push('node-focusmanager-button');
+YUI.Env.Tests.examples.push('widget-extend');
+YUI.Env.Tests.examples.push('photo-browser');
+YUI.Env.Tests.examples.push('portal-drag');
+YUI.Env.Tests.examples.push('get');
+
+</script>
+<script src="../assets/yui/test-runner.js"></script>
+
+
+
+</body>
+</html>