X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-demo.git;a=blobdiff_plain;f=afb-client%2Fbower_components%2Fviewport-units-buggyfill%2Fviewport-units-buggyfill.js;fp=afb-client%2Fbower_components%2Fviewport-units-buggyfill%2Fviewport-units-buggyfill.js;h=242af2a494d11a4502eb0920259e9b30f3dc99d6;hp=0000000000000000000000000000000000000000;hb=5b1e6cc132f44262a873fa8296a2a3e1017b0278;hpb=f7d2f9ac4168ee5064580c666d508667a73cefc0 diff --git a/afb-client/bower_components/viewport-units-buggyfill/viewport-units-buggyfill.js b/afb-client/bower_components/viewport-units-buggyfill/viewport-units-buggyfill.js new file mode 100755 index 0000000..242af2a --- /dev/null +++ b/afb-client/bower_components/viewport-units-buggyfill/viewport-units-buggyfill.js @@ -0,0 +1,347 @@ +/*! + * viewport-units-buggyfill v0.4.1 + * @web: https://github.com/rodneyrehm/viewport-units-buggyfill/ + * @author: Rodney Rehm - http://rodneyrehm.de/en/ + */ + +(function (root, factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], factory); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like enviroments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals (root is window) + root.viewportUnitsBuggyfill = factory(); + } +}(this, function () { + 'use strict'; + /*global document, window, location, XMLHttpRequest, XDomainRequest*/ + + var initialized = false; + var options; + var isMobileSafari = /(iPhone|iPod|iPad).+AppleWebKit/i.test(window.navigator.userAgent); + var viewportUnitExpression = /([+-]?[0-9.]+)(vh|vw|vmin|vmax)/g; + var forEach = [].forEach; + var dimensions; + var declarations; + var styleNode; + var isOldInternetExplorer = false; + + // Do not remove the following comment! + // It is a conditional comment used to + // identify old Internet Explorer versions + + /*@cc_on + + @if (@_jscript_version <= 10) + isOldInternetExplorer = true; + @end + + @*/ + + function debounce(func, wait) { + var timeout; + return function() { + var context = this; + var args = arguments; + var callback = function() { + func.apply(context, args); + }; + + clearTimeout(timeout); + timeout = setTimeout(callback, wait); + }; + } + + // from http://stackoverflow.com/questions/326069/how-to-identify-if-a-webpage-is-being-loaded-inside-an-iframe-or-directly-into-t + function inIframe() { + try { + return window.self !== window.top; + } catch (e) { + return true; + } + } + + function initialize(initOptions) { + if (initialized) { + return; + } + + if (initOptions === true) { + initOptions = { + force: true + }; + } + + options = initOptions || {}; + options.isMobileSafari = isMobileSafari; + + if (!options.force && !isMobileSafari && !isOldInternetExplorer && (!options.hacks || !options.hacks.required(options))) { + // this buggyfill only applies to mobile safari + return; + } + + options.hacks && options.hacks.initialize(options); + + initialized = true; + styleNode = document.createElement('style'); + styleNode.id = 'patched-viewport'; + document.head.appendChild(styleNode); + + // Issue #6: Cross Origin Stylesheets are not accessible through CSSOM, + // therefore download and inject them as