cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hermw...@apache.org
Subject [5/5] merge pull request with cordova-js changes
Date Tue, 30 Oct 2012 22:09:24 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cordova-webos/blob/985d2cea/lib/thumbs.0.5.2.js
----------------------------------------------------------------------
diff --git a/lib/thumbs.0.5.2.js b/lib/thumbs.0.5.2.js
deleted file mode 100644
index c5770c6..0000000
--- a/lib/thumbs.0.5.2.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-The MIT License
-
-Copyright (c) 2010 Michael Brooks
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-(function(window) {
-
-    /**
-     * Do not use thumbs.js on touch-enabled devices
-     * 
-     * Thanks to Jesse MacFadyen (purplecabbage):
-     * https://gist.github.com/850593#gistcomment-22484
-     */
-    try {
-        document.createEvent('TouchEvent');
-        return;
-    }
-    catch(e) {
-    }
-
-    /**
-     * Map touch events to mouse events
-     */
-    var eventMap = {
-        'mousedown': 'touchstart',
-        'mouseup':   'touchend',
-        'mousemove': 'touchmove'
-    };
-
-    /**
-     * Fire touch events
-     *
-     * Monitor mouse events and fire a touch event on the
-     * object broadcasting the mouse event. This approach
-     * likely has poorer performance than hijacking addEventListener
-     * but it is a little more browser friendly.
-     */
-    window.addEventListener('load', function() {
-        for (var key in eventMap) {
-            document.body.addEventListener(key, function(e) {
-                // Supports:
-                //   - addEventListener
-                //   - setAttribute
-                var event = createTouchEvent(eventMap[e.type], e);
-                e.target.dispatchEvent(event);
-
-                // Supports:
-                //   - element.ontouchstart
-                var fn = e.target['on' + eventMap[e.type]];
-                if (typeof fn === 'function') fn(e);
-            }, false);
-        }
-    }, false);
-
-    /**
-     * Utility function to create a touch event.
-     *
-     * @param  name  {String} of the event
-     * @return event {Object}
-     */
-    var createTouchEvent = function(name, e) {
-        var event = document.createEvent('MouseEvents');
-
-        event.initMouseEvent(
-            name,
-            e.bubbles,
-            e.cancelable,
-            e.view,
-            e.detail,
-            e.screenX,
-            e.screenY,
-            e.clientX,
-            e.clientY,
-            e.ctrlKey,
-            e.altKey,
-            e.shiftKey,
-            e.metaKey,
-            e.button,
-            e.relatedTarget
-        );
-
-        return event;
-    };
-
-})(window);


Mime
View raw message