]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 2 Aug 2013 09:55:34 +0000 (09:55 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 2 Aug 2013 09:55:34 +0000 (09:55 +0000)
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.support.js
js/libs/gal/gal.filesystem.js
js/libs/gal/gal.js
js/libs/modernizr/modernizr.js
style/fluidbook.css

index 3b2be5e31cbfaa4a46d5cc239640414a67649769..9105a741522732d341b3934cefd2e79609d92ba1 100644 (file)
@@ -181,7 +181,7 @@ FluidbookLoader.prototype = {
                        prefix = 't';
                }
 
-               return 'data/background/150/' + prefix + page + '.jpg';
+               return 'data/background/' + this.fluidbook.support.resolution + '/' + prefix + page + '.jpg';
        },
        getTextsURL: function(page) {
                return 'data/contents/p' + page + '.svg';
@@ -190,7 +190,7 @@ FluidbookLoader.prototype = {
                var $this = this;
                var back = $("#page_" + page + ' .background');
                this._loadBackground(page, function() {
-                       $(back).addClass('r150');
+                       $(back).addClass('r' + $this.fluidbook.support.resolution);
                        $(back).append($this.backgrounds[page]);
                });
        },
index b7e2bc27cab85dc3e27f745978311f65935f5f94..de7ed49fbd9ba6dd8d759a55410ae8cb2c655483 100644 (file)
@@ -8,7 +8,11 @@ function FluidbookSupport(fluidbook) {
        this.transitions3d = Modernizr.csstransforms3d && Modernizr.csstransitions && Modernizr.csstransformspreserve3d;
        this.transitions2d = Modernizr.csstransforms && Modernizr.csstransitions;
        this.transitionendevent = null;
-       this.initialResolution = 150;
+       if (Modernizr.mq('(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)')) {
+               this.resolution = this.fluidbook.datas.retinaResolution;
+       } else {
+               this.resolution = 150;
+       }
 
        this.isMobile = isMobile();
        this.SVG = Modernizr.svg && this.fluidbook.datas.mobileIconVector;
@@ -107,16 +111,16 @@ FluidbookSupport.prototype = {
                }
        },
        getOrientation: function() {
-               try{
-                       if(this.fluidbook.pad && this.fluidbook.pad.enabled){
+               try {
+                       if (this.fluidbook.pad && this.fluidbook.pad.enabled) {
                                return 0;
                        }
-               }catch(err){
-                       
+               } catch (err) {
+
                }
 
                try {
-                       var mql = window.matchMedia("(orientation: portrait)");
+                       var mql = Modernizr.mq("(orientation: portrait)");
                        if (mql.matches) {
                                return 0;
                        } else {
index b5d3a2908379f76202fc99d78b56fd8e15a663ec..70f061db2b777717b872aa2662808ebbf4049495 100644 (file)
                        case FileError.PATH_EXISTS_ERR:
                                message = 'path exists';
                                break;
-
                }
-
-
                console.error('Filesystem error:', error.code + ' :: ' + message);
        }
        ;
@@ -95,7 +92,6 @@
 
                var f = folders.shift();
 
-
                root.getDirectory(f, {create: true}, function(dirEntry) {
                        if (folders.length > 0) {
                                createDir_(dirEntry, folders, callback);
                }, onError);
 
                var that = this;
+               this.lookupTable = {};
                // And then recreate it
                this.fs.root.getDirectory(ROOT_DIR, {create: true}, function(dirEntry) {
                        that.root = dirEntry;
index 8835c7739729da325aeb03c2c4ea570ce8a7a219..634d18109455a77643451aacb0c5b5db55c930b9 100644 (file)
                        }
                        var key = bundle[index];
                        adapter.checkAsset(key, function() {
+
                                // Iterate to the next file.
                                loop(index + 1);
                        }, function() {
 
        GAL.prototype.getRootURL = function() {
                return this.adapter.root.toURL();
-       }
+       };
+
+       GAL.prototype.downloadAll = function() {
+               console.log('downloadAll');
+               downloadAll_.call(this);
+       };
 
 
        /**
        }
 
        /**
-        * @private
+        * 
         * Starts downloading all of the assets in the manifest, in order.
         */
        function downloadAll_() {
+               console.log('downloadAll_');
                var that = this;
                // Start by downloading the first bundle, then download subsequent ones.
                (function loop(bundleIndex) {
                                // We're done downloading stuff!
                                return;
                        }
+
                        var bundleName = that.bundleOrder[bundleIndex];
                        that.onLoaded(bundleName, function() {
                                // Once bundle is loaded, load the next bundle.
index c41c11b36e4f2a340d5acc9938aadc63b5c2bd23..61c8a90f77d6f8c9116bf2581748347489b1be55 100644 (file)
@@ -1,5 +1,5 @@
 /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
- * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
+ * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
  */
 ;
 
@@ -87,7 +87,25 @@ window.Modernizr = (function( window, document, undefined ) {
 
     },
 
+    testMediaQuery = function( mq ) {
 
+      var matchMedia = window.matchMedia || window.msMatchMedia;
+      if ( matchMedia ) {
+        return matchMedia(mq).matches;
+      }
+
+      var bool;
+
+      injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) {
+        bool = (window.getComputedStyle ?
+                  getComputedStyle(node, null) :
+                  node.currentStyle)['position'] == 'absolute';
+      });
+
+      return bool;
+
+     },
 
     isEventSupported = (function() {
 
@@ -239,7 +257,15 @@ window.Modernizr = (function( window, document, undefined ) {
         }
     }    tests['flexbox'] = function() {
       return testPropsAll('flexWrap');
-    };    tests['canvas'] = function() {
+    };
+
+
+    tests['flexboxlegacy'] = function() {
+        return testPropsAll('boxDirection');
+    };
+
+
+    tests['canvas'] = function() {
         var elem = document.createElement('canvas');
         return !!(elem.getContext && elem.getContext('2d'));
     };
@@ -782,6 +808,7 @@ window.Modernizr = (function( window, document, undefined ) {
     Modernizr._domPrefixes  = domPrefixes;
     Modernizr._cssomPrefixes  = cssomPrefixes;
 
+    Modernizr.mq            = testMediaQuery;
 
     Modernizr.hasEvent      = isEventSupported;
 
index 42348ab10d34a801ec05637e94fadb79c7466c4b..231c41fe083b2b616f9b8340f8f721ee3cc288ee 100644 (file)
@@ -53,7 +53,6 @@ b,strong,h1,h2,h3,h4,h5,h6{
        -ms-touch-action:auto;\r
 }\r
 \r
-\r
 html{\r
        user-select:text;\r
        -moz-user-select:text;\r