From 3d2fda7dd39e2363682f1fa353c951ab0d44ddfa Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Tue, 9 Feb 2016 18:40:49 +0100 Subject: Implemented URL query parsing for initial token /opa/?token=abcde --- .../viewport-units-buggyfill/.bower.json | 30 ++ .../viewport-units-buggyfill/Gruntfile.js | 19 ++ .../viewport-units-buggyfill/bower.json | 20 ++ .../viewport-units-buggyfill/package.json | 43 +++ .../viewport-units-buggyfill.hacks.js | 138 ++++++++ .../viewport-units-buggyfill.js | 347 +++++++++++++++++++++ 6 files changed, 597 insertions(+) create mode 100644 afb-client/bower_components/viewport-units-buggyfill/.bower.json create mode 100755 afb-client/bower_components/viewport-units-buggyfill/Gruntfile.js create mode 100755 afb-client/bower_components/viewport-units-buggyfill/bower.json create mode 100755 afb-client/bower_components/viewport-units-buggyfill/package.json create mode 100644 afb-client/bower_components/viewport-units-buggyfill/viewport-units-buggyfill.hacks.js create mode 100755 afb-client/bower_components/viewport-units-buggyfill/viewport-units-buggyfill.js (limited to 'afb-client/bower_components/viewport-units-buggyfill') diff --git a/afb-client/bower_components/viewport-units-buggyfill/.bower.json b/afb-client/bower_components/viewport-units-buggyfill/.bower.json new file mode 100644 index 0000000..ca2be55 --- /dev/null +++ b/afb-client/bower_components/viewport-units-buggyfill/.bower.json @@ -0,0 +1,30 @@ +{ + "name": "viewport-units-buggyfill", + "version": "0.4.1", + "main": [ + "./viewport-units-buggyfill.js", + "./viewport-units-buggyfill.hacks.js" + ], + "ignore": [ + "**/.*", + "examples", + "*.html", + "*.css", + "*.md" + ], + "keywords": [ + "ios", + "safari", + "viewport" + ], + "homepage": "https://github.com/rodneyrehm/viewport-units-buggyfill", + "_release": "0.4.1", + "_resolution": { + "type": "version", + "tag": "v0.4.1", + "commit": "78773d57c98637e1461da53c4917ca44dc1b3d33" + }, + "_source": "git://github.com/rodneyrehm/viewport-units-buggyfill.git", + "_target": "~0.4.1", + "_originalSource": "viewport-units-buggyfill" +} \ No newline at end of file diff --git a/afb-client/bower_components/viewport-units-buggyfill/Gruntfile.js b/afb-client/bower_components/viewport-units-buggyfill/Gruntfile.js new file mode 100755 index 0000000..a8e10ee --- /dev/null +++ b/afb-client/bower_components/viewport-units-buggyfill/Gruntfile.js @@ -0,0 +1,19 @@ +module.exports = function(grunt) { + 'use strict'; + + var jshintOptions = grunt.file.readJSON('.jshintrc'); + jshintOptions.reporter = require('jshint-stylish'); + + grunt.initConfig({ + jshint: { + options: jshintOptions, + target: [ + 'Gruntfile.js', + 'viewport-units-buggyfill.js' + ] + } + }); + + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.registerTask('lint', 'jshint'); +}; diff --git a/afb-client/bower_components/viewport-units-buggyfill/bower.json b/afb-client/bower_components/viewport-units-buggyfill/bower.json new file mode 100755 index 0000000..3b3c4da --- /dev/null +++ b/afb-client/bower_components/viewport-units-buggyfill/bower.json @@ -0,0 +1,20 @@ +{ + "name": "viewport-units-buggyfill", + "version": "0.4.1", + "main": [ + "./viewport-units-buggyfill.js", + "./viewport-units-buggyfill.hacks.js" + ], + "ignore": [ + "**/.*", + "examples", + "*.html", + "*.css", + "*.md" + ], + "keywords": [ + "ios", + "safari", + "viewport" + ] +} \ No newline at end of file diff --git a/afb-client/bower_components/viewport-units-buggyfill/package.json b/afb-client/bower_components/viewport-units-buggyfill/package.json new file mode 100755 index 0000000..d7803fc --- /dev/null +++ b/afb-client/bower_components/viewport-units-buggyfill/package.json @@ -0,0 +1,43 @@ +{ + "name": "viewport-units-buggyfill", + "version": "0.4.1", + "title": "Viewport Units Buggyfill for Mobile Safari", + "description": "Making viewport units (vh|vw|vmin|vmax) work properly in Mobile Safari", + "homepage": "http://github.com/rodneyrehm/viewport-units-buggyfill/", + "author": { + "name": "Rodney Rehm", + "url": "http://rodneyrehm.de" + }, + "contributors": [{ + "name": "Zoltan Hawryluk", + "url": "http://www.useragentman.com" + }], + "repository": { + "type": "git", + "url": "https://github.com/rodneyrehm/viewport-units-buggyfill.git" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/mit-license" + } + ], + "keywords": [ + "ios", + "safari", + "viewport" + ], + "main": "./viewport-units-buggyfill.js", + "files": [ + "viewport-units-buggyfill.js", + "viewport-units-buggyfill.hacks.js" + ], + "scripts": { + "lint": "grunt lint" + }, + "devDependencies": { + "jshint-stylish": "~0.1.5", + "grunt": "~0.4.2", + "grunt-contrib-jshint": "~0.8.0" + } +} diff --git a/afb-client/bower_components/viewport-units-buggyfill/viewport-units-buggyfill.hacks.js b/afb-client/bower_components/viewport-units-buggyfill/viewport-units-buggyfill.hacks.js new file mode 100644 index 0000000..b931629 --- /dev/null +++ b/afb-client/bower_components/viewport-units-buggyfill/viewport-units-buggyfill.hacks.js @@ -0,0 +1,138 @@ +/*! + * viewport-units-buggyfill.hacks v0.4.1 + * @web: https://github.com/rodneyrehm/viewport-units-buggyfill/ + * @author: Zoltan Hawryluk - http://www.useragentman.com/ + */ + +(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.viewportUnitsBuggyfillHacks = factory(); + } +}(this, function () { + 'use strict'; + + var options; + var calcExpression = /calc\(/g; + var quoteExpression = /[\"\']/g; + var urlExpression = /url\([^\)]*\)/g; + var isOldInternetExplorer = false; + var supportsVminmax = true; + var supportsVminmaxCalc = true; + + // WARNING! + // Do not remove the following conditional comment. + // It is required to identify the current version of IE + + /*@cc_on + + @if (@_jscript_version <= 10) + isOldInternetExplorer = true; + supportsVminmaxCalc = false; + supportsVminmax = false; + @end + + @*/ + + // iOS SAFARI, IE9: abuse "content" if "use_css_content_hack" specified + // IE9: abuse "behavior" if "use_css_behavior_hack" specified + function checkHacks(declarations, rule, name, value) { + if (!options.contentHack && !options.behaviorHack) { + return; + } + + if (name !== 'content' && name !== 'behavior') { + return; + } + + var needsCalcFix = (options.contentHack && !supportsVminmaxCalc && name === 'content' && value.indexOf('use_css_content_hack') > -1); + var needsVminVmaxFix = (options.behaviorHack && !supportsVminmax && name === 'behavior' && value.indexOf('use_css_behavior_hack') > -1); + if (!needsCalcFix && !needsVminVmaxFix) { + return; + } + + var fakeRules = value.replace(quoteExpression, ''); + if (needsVminVmaxFix) { + fakeRules = fakeRules.replace(urlExpression, ''); + } + + fakeRules.split(';').forEach(function(fakeRuleElement) { + var fakeRule = fakeRuleElement.split(':'); + if (fakeRule.length !== 2) { + return; + } + + var name = fakeRule[0].trim(); + var value = fakeRule[1].trim(); + if (name === 'use_css_content_hack' || name === 'use_css_behavior_hack') { + return; + } + + declarations.push([rule, name, value]); + if (calcExpression.test(value)) { + var webkitValue = value.replace(calcExpression, '-webkit-calc('); + declarations.push([rule, name, webkitValue]); + } + }); + } + + return { + required: function(options) { + return options.isMobileSafari || isOldInternetExplorer; + }, + + initialize: function(initOptions) { + options = initOptions; + + // Test viewport units support in calc() expressions + var div = document.createElement('div'); + div.style.width = '1vmax'; + supportsVminmax = div.style.width !== ''; + + // there is no accurate way to detect this programmatically. + if (options.isMobileSafari) { + supportsVminmaxCalc = false; + } + }, + + initializeEvents: function(options, refresh, _refresh) { + if (options.force) { + return; + } + + if (isOldInternetExplorer && !options._listeningToResize) { + window.addEventListener('resize', _refresh, true); + options._listeningToResize = true; + } + }, + + findDeclarations: function(declarations, rule, name, value) { + if (name === null) { + // KeyframesRule does not have a CSS-PropertyName + return; + } + + checkHacks(declarations, rule, name, value); + }, + + overwriteDeclaration: function(rule, name, _value) { + if (isOldInternetExplorer && name === 'filter') { + // remove unit "px" from complex value, e.g.: + // filter: progid:DXImageTransform.Microsoft.DropShadow(OffX=5.4px, OffY=3.9px, Color=#000000); + _value = _value.replace(/px/g, ''); + } + + return _value; + } + }; + +})); 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