]> _ Git - fluidbook-html5.git/commitdiff
wip #740 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 29 Sep 2016 17:04:32 +0000 (17:04 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 29 Sep 2016 17:04:32 +0000 (17:04 +0000)
_index.html
js/libs/fastclick/fastclick.js
js/libs/fluidbook/fluidbook.resize.js
js/libs/fluidbook/fluidbook.support.js
js/libs/fluidbook/fluidbook.viewport.js
style/fluidbook.css
style/fluidbook.less

index 04f6051a18db09d787ef7de53a092493f2515ad4..4ab306f700fa1e5aa0a91e3f46edd703a1205c59 100644 (file)
@@ -1,11 +1,14 @@
 <!DOCTYPE html>
-<html<!-- $cache --> prefix="og: http://ogp.me/ns#">
+<!--[if IE 9]>
+<html class="ie9"> <![endif]-->
+<!--[if gt IE 9]><!-->
+<html<!-- $cache --> prefix="og: http://ogp.me/ns#"><!--<![endif]-->
 <head>
        <title><!-- $titre --></title>
        <meta charset="utf-8">
-       <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=IE8">
+       <meta http-equiv="X-UA-Compatible" content="IE=9">
        <meta http-equiv="Content-Security-Policy"
-             content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
+             content="default-src * gap://ready file:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
        <!--<meta name="apple-mobile-web-app-capable" content="yes">-->
        <meta name="viewport" content="initial-scale=1,minimum-scale=1">
        <meta name="google" content="notranslate">
index d3409af59dc480a40faff5eb137e70c214a6ead6..f40e0298685903cc9aff817b9fa5195b664f743b 100644 (file)
@@ -1,5 +1,4 @@
-;
-(function () {
+;(function () {
     'use strict';
 
     /**
 
         // Some old versions of Android don't have Function.prototype.bind
         function bind(method, context) {
-            return function () {
-                return method.apply(context, arguments);
-            };
+            return function() { return method.apply(context, arguments); };
         }
 
 
         // which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
         // layer when they are cancelled.
         if (!Event.prototype.stopImmediatePropagation) {
-            layer.removeEventListener = function (type, callback, capture) {
+            layer.removeEventListener = function(type, callback, capture) {
                 var rmv = Node.prototype.removeEventListener;
                 if (type === 'click') {
                     rmv.call(layer, type, callback.hijacked || callback, capture);
                 }
             };
 
-            layer.addEventListener = function (type, callback, capture) {
+            layer.addEventListener = function(type, callback, capture) {
                 var adv = Node.prototype.addEventListener;
                 if (type === 'click') {
-                    adv.call(layer, type, callback.hijacked || (callback.hijacked = function (event) {
+                    adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
                             if (!event.propagationStopped) {
                                 callback(event);
                             }
             // Android browser on at least 3.2 requires a new reference to the function in layer.onclick
             // - the old one won't work if passed to addEventListener directly.
             oldOnClick = layer.onclick;
-            layer.addEventListener('click', function (event) {
+            layer.addEventListener('click', function(event) {
                 oldOnClick(event);
             }, false);
             layer.onclick = null;
      * @param {EventTarget|Element} target Target DOM element
      * @returns {boolean} Returns true if the element needs a native click
      */
-    FastClick.prototype.needsClick = function (target) {
+    FastClick.prototype.needsClick = function(target) {
         switch (target.nodeName.toLowerCase()) {
 
             // Don't send a synthetic click to disabled inputs (issue #62)
      * @param {EventTarget|Element} target Target DOM element
      * @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
      */
-    FastClick.prototype.needsFocus = function (target) {
+    FastClick.prototype.needsFocus = function(target) {
         switch (target.nodeName.toLowerCase()) {
             case 'textarea':
                 return true;
      * @param {EventTarget|Element} targetElement
      * @param {Event} event
      */
-    FastClick.prototype.sendClick = function (targetElement, event) {
+    FastClick.prototype.sendClick = function(targetElement, event) {
         var clickEvent, touch;
 
         // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
         targetElement.dispatchEvent(clickEvent);
     };
 
-    FastClick.prototype.determineEventType = function (targetElement) {
+    FastClick.prototype.determineEventType = function(targetElement) {
 
         //Issue #159: Android Chrome Select Box does not open with a synthetic click event
         if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
     /**
      * @param {EventTarget|Element} targetElement
      */
-    FastClick.prototype.focus = function (targetElement) {
+    FastClick.prototype.focus = function(targetElement) {
         var length;
 
         // Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
      *
      * @param {EventTarget|Element} targetElement
      */
-    FastClick.prototype.updateScrollParent = function (targetElement) {
+    FastClick.prototype.updateScrollParent = function(targetElement) {
         var scrollParent, parentElement;
 
         scrollParent = targetElement.fastClickScrollParent;
      * @param {EventTarget} targetElement
      * @returns {Element|EventTarget}
      */
-    FastClick.prototype.getTargetElementFromEventTarget = function (eventTarget) {
+    FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
 
         // On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
         if (eventTarget.nodeType === Node.TEXT_NODE) {
      * @param {Event} event
      * @returns {boolean}
      */
-    FastClick.prototype.onTouchStart = function (event) {
+    FastClick.prototype.onTouchStart = function(event) {
         var targetElement, touch, selection;
 
         // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
      * @param {Event} event
      * @returns {boolean}
      */
-    FastClick.prototype.touchHasMoved = function (event) {
+    FastClick.prototype.touchHasMoved = function(event) {
         var touch = event.changedTouches[0], boundary = this.touchBoundary;
 
         if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
      * @param {Event} event
      * @returns {boolean}
      */
-    FastClick.prototype.onTouchMove = function (event) {
+    FastClick.prototype.onTouchMove = function(event) {
         if (!this.trackingClick) {
             return true;
         }
      * @param {EventTarget|HTMLLabelElement} labelElement
      * @returns {Element|null}
      */
-    FastClick.prototype.findControl = function (labelElement) {
+    FastClick.prototype.findControl = function(labelElement) {
 
         // Fast path for newer browsers supporting the HTML5 control attribute
         if (labelElement.control !== undefined) {
      * @param {Event} event
      * @returns {boolean}
      */
-    FastClick.prototype.onTouchEnd = function (event) {
+    FastClick.prototype.onTouchEnd = function(event) {
         var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
 
         if (!this.trackingClick) {
      *
      * @returns {void}
      */
-    FastClick.prototype.onTouchCancel = function () {
+    FastClick.prototype.onTouchCancel = function() {
         this.trackingClick = false;
         this.targetElement = null;
     };
      * @param {Event} event
      * @returns {boolean}
      */
-    FastClick.prototype.onMouse = function (event) {
+    FastClick.prototype.onMouse = function(event) {
 
         // If a target element was never set (because a touch event was never fired) allow the event
         if (!this.targetElement) {
      * @param {Event} event
      * @returns {boolean}
      */
-    FastClick.prototype.onClick = function (event) {
+    FastClick.prototype.onClick = function(event) {
         var permitted;
 
         // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
      *
      * @returns {void}
      */
-    FastClick.prototype.destroy = function () {
+    FastClick.prototype.destroy = function() {
         var layer = this.layer;
 
         if (deviceIsAndroid) {
      *
      * @param {Element} layer The layer to listen on
      */
-    FastClick.notNeeded = function (layer) {
+    FastClick.notNeeded = function(layer) {
         var metaViewport;
         var chromeVersion;
         var blackberryVersion;
         }
 
         // Chrome version - zero for other browsers
-        chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1];
+        chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
 
         if (chromeVersion) {
 
         }
 
         // Firefox version - zero for other browsers
-        firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1];
+        firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
 
         if (firefoxVersion >= 27) {
             // Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896
      * @param {Element} layer The layer to listen on
      * @param {Object} [options={}] The options to override the defaults
      */
-    FastClick.attach = function (layer, options) {
+    FastClick.attach = function(layer, options) {
         return new FastClick(layer, options);
     };
 
     if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
 
         // AMD. Register as an anonymous module.
-        define(function () {
+        define(function() {
             return FastClick;
         });
     } else if (typeof module !== 'undefined' && module.exports) {
index 65fbe0e61d6edd0fd0665311f16441e52d56ffb7..df199e85a165f30aa9692110f55fab17e0d99670 100644 (file)
@@ -184,6 +184,9 @@ FluidbookResize.prototype = {
 
         this.resizePopupVideos();
         this.resizeSplash();
+        if (this.fluidbook.support.ie9) {
+            this.resizeIE9Multimedia();
+        }
 
         if (this.fluidbook.form) {
             this.fluidbook.form.resize();
@@ -208,6 +211,21 @@ FluidbookResize.prototype = {
         return $(window).height() - 44;
     },
 
+    resizeIE9Multimedia: function () {
+       return;
+        var links = $("#links .link.multimedia");
+        $(links).each(function () {
+            $(this).css('zoom', (this.bookScale));
+            var i = $(this).find("iframe")
+            var scale=this.bookScale*$(this).transform('scale');
+            if ($(i).length) {
+                var iframe = $(i).contents();
+               // $(iframe).find('#swiffycontainer>div').css('zoom', (1 / this.bookScale));
+            }
+        });
+
+    },
+
     resizePopupVideos: function () {
         var $this = this;
         var maxh = this.getPopupVideoHeight();
index 54f4e933230454a068d3fb8a49ff9f2e469ed7fa..828435c5802da12d147b84ec22023518994075f9 100644 (file)
@@ -8,6 +8,8 @@ function FluidbookSupport(fluidbook) {
     this.transitions2d = Modernizr.csstransforms && Modernizr.csstransitions;
     this.transitions3d = Modernizr.csstransforms3d && Modernizr.preserve3d && this.transitions2d;
 
+    this.ie9=$("html").hasClass('ie9');
+
     this.androidbrowser = this.android && this.userAgent.search(/applewebkit/i) > -1;
 
     this.transitionendevent = null;
index 1e0666cbdf5ed090b15ab9e42942d1005fc0985c..e01e21e922934e6183779deac758d6d121c1fd06 100644 (file)
@@ -2,8 +2,8 @@ function FluidbookViewport(fluidbook) {
     this.width = 'device-width';
     this.height = null;
     this.minScale = 1;
-    this.maxScale = 5;
-    this.initialScale = 0;
+    this.maxScale = 10;
+    this.initialScale = 1;
     this.userScalable = true;
     this.meta = $('meta[name="viewport"]');
     this.fluidbook = fluidbook;
@@ -26,7 +26,7 @@ FluidbookViewport.prototype = {
         if (this.initialScale > 0) {
             var is = 'initial-scale=' + this.initialScale + ', ';
         }
-        var us = this.userScalable == true ? '1' : '0';
+        var us = this.userScalable == true ? 'yes' : 'no';
         var value = w + h + is + 'minimum-scale=' + Math.max(0.25, this.minScale) + ', maximum-scale=' + Math.min(10, this.maxScale) + ', user-scalable=' + us + ", shrink-to-fit=no";
         this.meta.attr('content', value);
 
index 831e2ebf853bddf4dcbc728d9f890a21f906de97..8ec68ee9e1f4a6ee053ea947108962d6c3caa6b0 100644 (file)
@@ -229,11 +229,6 @@ body {
   left: 0px;
   overflow: hidden;
 }
-#pages {
-  position: absolute;
-  top: 0px;
-  left: 0px;
-}
 /* Shadow */
 #shadow {
   position: absolute;
index 261cf5b2d117afc39d1bb010c33f076961e9ce02..001085c5cf9501ac22cf42f618a9617d3fabf565 100644 (file)
@@ -260,12 +260,6 @@ body {
        overflow: hidden;
 }
 
-#pages {
-       position: absolute;
-       top: 0px;
-       left: 0px;
-}
-
 /* Shadow */
 #shadow {
        position: absolute;