From 8d7ae321a025a0b13cbf599fe37d0b13cab370b4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 26 Dec 2015 13:35:53 -0500 Subject: [PATCH] merge from dev --- .../emby-apiclient/.bower.json | 8 +- .../emby-apiclient/apiclient.js | 6 +- .../emby-apiclient/connectionmanager.js | 6 +- .../emby-webcomponents/.bower.json | 14 +- .../emby-webcomponents/bower.json | 3 +- .../emby-webcomponents/browser.js | 66 ++++ .../browserdeviceprofile.js | 333 ++++++++++++++++++ .../emby-webcomponents}/requirecss.js | 14 +- .../emby-webcomponents/requirehtml.js | 64 ++-- .../bower_components/hammerjs/.bower.json | 18 +- .../bower_components/hammerjs/.bowerrc | 3 - .../bower_components/hammerjs/.gitignore | 21 -- .../bower_components/hammerjs/.jscsrc | 95 ----- .../bower_components/hammerjs/.jshintrc | 22 -- .../bower_components/hammerjs/.travis.yml | 11 - .../bower_components/hammerjs/CHANGELOG.md | 24 ++ .../hammerjs/Gruntfile.coffee | 124 ------- .../bower_components/hammerjs/bower.json | 10 +- .../bower_components/hammerjs/changelog.js | 71 ++++ .../bower_components/hammerjs/component.json | 8 - .../bower_components/hammerjs/hammer.js | 86 ++++- .../bower_components/hammerjs/hammer.min.js | 4 +- .../bower_components/hammerjs/hammer.min.map | 2 +- .../bower_components/hammerjs/package.json | 45 --- .../iron-flex-layout/.bower.json | 6 +- dashboard-ui/scripts/librarylist.js | 35 +- dashboard-ui/scripts/site.js | 79 +---- 27 files changed, 678 insertions(+), 500 deletions(-) create mode 100644 dashboard-ui/bower_components/emby-webcomponents/browser.js create mode 100644 dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js rename dashboard-ui/{components => bower_components/emby-webcomponents}/requirecss.js (89%) delete mode 100644 dashboard-ui/bower_components/hammerjs/.bowerrc delete mode 100644 dashboard-ui/bower_components/hammerjs/.gitignore delete mode 100644 dashboard-ui/bower_components/hammerjs/.jscsrc delete mode 100644 dashboard-ui/bower_components/hammerjs/.jshintrc delete mode 100644 dashboard-ui/bower_components/hammerjs/.travis.yml delete mode 100644 dashboard-ui/bower_components/hammerjs/Gruntfile.coffee create mode 100644 dashboard-ui/bower_components/hammerjs/changelog.js delete mode 100644 dashboard-ui/bower_components/hammerjs/component.json delete mode 100644 dashboard-ui/bower_components/hammerjs/package.json diff --git a/dashboard-ui/bower_components/emby-apiclient/.bower.json b/dashboard-ui/bower_components/emby-apiclient/.bower.json index 3dad57dd05..6882b33b03 100644 --- a/dashboard-ui/bower_components/emby-apiclient/.bower.json +++ b/dashboard-ui/bower_components/emby-apiclient/.bower.json @@ -16,12 +16,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.0.17", - "_release": "1.0.17", + "version": "1.0.19", + "_release": "1.0.19", "_resolution": { "type": "version", - "tag": "1.0.17", - "commit": "3ce9bb842c3188d3440aef5319b01a24e57603cb" + "tag": "1.0.19", + "commit": "09f50cd4f4b126b0ea9a0a26c1b425b4a1e25f5b" }, "_source": "git://github.com/MediaBrowser/Emby.ApiClient.Javascript.git", "_target": "~1.0.3", diff --git a/dashboard-ui/bower_components/emby-apiclient/apiclient.js b/dashboard-ui/bower_components/emby-apiclient/apiclient.js index 93f9461206..7ff829da1c 100644 --- a/dashboard-ui/bower_components/emby-apiclient/apiclient.js +++ b/dashboard-ui/bower_components/emby-apiclient/apiclient.js @@ -187,7 +187,8 @@ var fetchRequest = { headers: headers, - method: request.type + method: request.type, + credentials: 'same-origin' }; var contentType = request.contentType; @@ -221,6 +222,9 @@ var timeout = setTimeout(reject, timeoutMs); + options = options || {}; + options.credentials = 'same-origin'; + fetch(url, options).then(function (response) { clearTimeout(timeout); resolve(response); diff --git a/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js b/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js index b8e686a6be..358a9f0b9d 100644 --- a/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js +++ b/dashboard-ui/bower_components/emby-apiclient/connectionmanager.js @@ -88,7 +88,8 @@ var fetchRequest = { headers: headers, - method: request.type + method: request.type, + credentials: 'same-origin' }; var contentType = request.contentType; @@ -124,6 +125,9 @@ var timeout = setTimeout(reject, timeoutMs); + options = options || {}; + options.credentials = 'same-origin'; + fetch(url, options).then(function (response) { clearTimeout(timeout); diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index edfd95b985..d62e0f8ed6 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -10,19 +10,19 @@ "license": "https://github.com/MediaBrowser/emby-webcomponents/blob/master/LICENSE", "homepage": "https://github.com/MediaBrowser/emby-webcomponents", "dependencies": { - "requirejs": "requirejs#^2.1.22" + "requirejs": "requirejs#^2.1.22", + "isMobile": "isMobile#^0.3.9" }, "devDependencies": {}, "ignore": [], - "version": "1.0.0", - "_release": "1.0.0", + "version": "1.0.2", + "_release": "1.0.2", "_resolution": { "type": "version", - "tag": "1.0.0", - "commit": "e5ea8f8503ae36e45609e77aae4ecae170cb5dea" + "tag": "1.0.2", + "commit": "a4909b1637879d7e52ce9eaba8247ad98b690de9" }, "_source": "git://github.com/MediaBrowser/emby-webcomponents.git", "_target": "~1.0.0", - "_originalSource": "emby-webcomponents", - "_direct": true + "_originalSource": "emby-webcomponents" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/bower.json b/dashboard-ui/bower_components/emby-webcomponents/bower.json index b31e2944df..0a6c6d4d1d 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/bower.json @@ -10,7 +10,8 @@ "license": "https://github.com/MediaBrowser/emby-webcomponents/blob/master/LICENSE", "homepage": "https://github.com/MediaBrowser/emby-webcomponents", "dependencies": { - "requirejs": "requirejs#^2.1.22" + "requirejs": "requirejs#^2.1.22", + "isMobile": "isMobile#^0.3.9" }, "devDependencies": { diff --git a/dashboard-ui/bower_components/emby-webcomponents/browser.js b/dashboard-ui/bower_components/emby-webcomponents/browser.js new file mode 100644 index 0000000000..cc4cef38d2 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/browser.js @@ -0,0 +1,66 @@ +define(['isMobile'], function (isMobile) { + + var uaMatch = function (ua) { + ua = ua.toLowerCase(); + + var match = /(edge)[ \/]([\w.]+)/.exec(ua) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(opr)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(chrome)[ \/]([\w.]+)/.exec(ua) || + /(safari)[ \/]([\w.]+)/.exec(ua) || + /(msie) ([\w.]+)/.exec(ua) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || + []; + + var platform_match = /(ipad)/.exec(ua) || + /(iphone)/.exec(ua) || + /(android)/.exec(ua) || + []; + + var browser = match[1] || ""; + + if (ua.indexOf("windows phone") != -1 || ua.indexOf("iemobile") != -1) { + + // http://www.neowin.net/news/ie11-fakes-user-agent-to-fool-gmail-in-windows-phone-81-gdr1-update + browser = "msie"; + } + else if (ua.indexOf("like gecko") != -1 && ua.indexOf('webkit') == -1 && ua.indexOf('opera') == -1 && ua.indexOf('chrome') == -1 && ua.indexOf('safari') == -1) { + browser = "msie"; + } + + if (browser == 'opr') { + browser = 'opera'; + } + + return { + browser: browser, + version: match[2] || "0", + platform: platform_match[0] || "" + }; + }; + + var userAgent = window.navigator.userAgent; + var matched = uaMatch(userAgent); + var browser = {}; + + if (matched.browser) { + browser[matched.browser] = true; + browser.version = matched.version; + } + + if (matched.platform) { + browser[matched.platform] = true; + } + + if (!browser.chrome && !browser.msie && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf("webkit") != -1) { + browser.safari = true; + } + + if (isMobile.any) { + browser.mobile = true; + } + + browser.animate = document.documentElement.animate != null; + + return browser; +}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js b/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js new file mode 100644 index 0000000000..17ab704e3d --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js @@ -0,0 +1,333 @@ +define(['browser'], function (browser) { + + var supportedFormats; + function getSupportedFormats() { + + if (supportedFormats) { + return supportedFormats; + } + + var list = []; + var elem = document.createElement('video'); + + if (elem.canPlayType('video/webm').replace(/no/, '')) { + list.push('webm'); + } + if (elem.canPlayType('audio/mp4; codecs="ac-3"').replace(/no/, '')) { + list.push('ac3'); + } + if (browser.chrome) { + list.push('mkv'); + } + + var canPlayH264 = true; + var userAgent = navigator.userAgent.toLowerCase(); + if (userAgent.indexOf('firefox') != -1 && userAgent.indexOf('windows') == -1) { + canPlayH264 = false; + } + + if (canPlayH264) { + list.push('h264'); + } + + if (document.createElement('audio').canPlayType('audio/aac').replace(/no/, '')) { + list.push('aac'); + } + + if (document.createElement('audio').canPlayType('audio/mp3').replace(/no/, '')) { + list.push('mp3'); + } + if (document.createElement('audio').canPlayType('audio/ogg; codecs="opus"').replace(/no/, '')) { + list.push('opus'); + } + + if (document.createElement('audio').canPlayType('audio/webm').replace(/no/, '')) { + list.push('webma'); + } + + if (document.createElement('audio').canPlayType('audio/flac').replace(/no/, '')) { + list.push('flac'); + } + + supportedFormats = list; + return list; + } + + var _supportsTextTracks; + function supportsTextTracks() { + + if (_supportsTextTracks == null) { + _supportsTextTracks = document.createElement('video').textTracks != null; + } + + // For now, until ready + return _supportsTextTracks; + } + + var _canPlayHls; + function canPlayHls(src) { + + if (_canPlayHls == null) { + _canPlayHls = window.MediaSource != null || canPlayNativeHls(); + } + return _canPlayHls; + } + + function canPlayNativeHls() { + var media = document.createElement('video'); + + if (media.canPlayType('application/x-mpegURL').replace(/no/, '') || + media.canPlayType('application/vnd.apple.mpegURL').replace(/no/, '')) { + return true; + } + + return false; + } + + return function () { + + var bitrateSetting = 100000000; + + var supportedFormats = getSupportedFormats(); + + var canPlayWebm = supportedFormats.indexOf('webm') != -1; + var canPlayAc3 = supportedFormats.indexOf('ac3') != -1; + var canPlayMp3 = supportedFormats.indexOf('mp3') != -1; + var canPlayAac = supportedFormats.indexOf('aac') != -1; + var canPlayMkv = supportedFormats.indexOf('mkv') != -1; + + var profile = {}; + + profile.MaxStreamingBitrate = bitrateSetting; + profile.MaxStaticBitrate = 100000000; + profile.MusicStreamingTranscodingBitrate = Math.min(bitrateSetting, 192000); + + profile.DirectPlayProfiles = []; + + if (supportedFormats.indexOf('h264') != -1) { + profile.DirectPlayProfiles.push({ + Container: 'mp4,m4v', + Type: 'Video', + VideoCodec: 'h264', + AudioCodec: 'aac' + (canPlayMp3 ? ',mp3' : '') + (canPlayAc3 ? ',ac3' : '') + }); + } + + if (browser.chrome) { + profile.DirectPlayProfiles.push({ + Container: 'mkv,mov', + Type: 'Video', + VideoCodec: 'h264', + AudioCodec: 'aac' + (canPlayMp3 ? ',mp3' : '') + (canPlayAc3 ? ',ac3' : '') + }); + } + + ['opus', 'mp3', 'aac', 'flac', 'webma'].forEach(function (audioFormat) { + + if (supportedFormats.indexOf(audioFormat) != -1) { + profile.DirectPlayProfiles.push({ + Container: audioFormat == 'webma' ? 'webma,webm' : audioFormat, + Type: 'Audio' + }); + } + }); + + if (canPlayWebm) { + profile.DirectPlayProfiles.push({ + Container: 'webm', + Type: 'Video' + }); + } + + profile.TranscodingProfiles = []; + + ['opus', 'mp3', 'aac'].forEach(function (audioFormat) { + + if (supportedFormats.indexOf(audioFormat) != -1) { + profile.TranscodingProfiles.push({ + Container: audioFormat, + Type: 'Audio', + AudioCodec: audioFormat, + Context: 'Streaming', + Protocol: 'http' + }); + profile.TranscodingProfiles.push({ + Container: audioFormat, + Type: 'Audio', + AudioCodec: audioFormat, + Context: 'Static', + Protocol: 'http' + }); + } + }); + + // Can't use mkv on mobile because we have to use the native player controls and they won't be able to seek it + if (canPlayMkv && !browser.mobile) { + profile.TranscodingProfiles.push({ + Container: 'mkv', + Type: 'Video', + AudioCodec: 'aac' + (canPlayAc3 ? ',ac3' : ''), + VideoCodec: 'h264', + Context: 'Streaming' + }); + } + + if (canPlayHls()) { + profile.TranscodingProfiles.push({ + Container: 'ts', + Type: 'Video', + AudioCodec: 'aac' + (canPlayAc3 ? ',ac3' : ''), + VideoCodec: 'h264', + Context: 'Streaming', + Protocol: 'hls' + }); + } + + if (canPlayWebm) { + + profile.TranscodingProfiles.push({ + Container: 'webm', + Type: 'Video', + AudioCodec: 'vorbis', + VideoCodec: 'vpx', + Context: 'Streaming', + Protocol: 'http' + }); + } + + profile.TranscodingProfiles.push({ + Container: 'mp4', + Type: 'Video', + AudioCodec: 'aac', + VideoCodec: 'h264', + Context: 'Streaming', + Protocol: 'http' + }); + + profile.TranscodingProfiles.push({ + Container: 'mp4', + Type: 'Video', + AudioCodec: 'aac', + VideoCodec: 'h264', + Context: 'Static', + Protocol: 'http' + }); + + profile.ContainerProfiles = []; + + profile.CodecProfiles = []; + profile.CodecProfiles.push({ + Type: 'Audio', + Conditions: [{ + Condition: 'LessThanEqual', + Property: 'AudioChannels', + Value: '2' + }] + }); + + profile.CodecProfiles.push({ + Type: 'VideoAudio', + Codec: 'aac', + Container: 'mkv,mov', + Conditions: [ + { + Condition: 'NotEquals', + Property: 'AudioProfile', + Value: 'HE-AAC' + } + // Disabling this is going to require us to learn why it was disabled in the first place + //, + //{ + // Condition: 'NotEquals', + // Property: 'AudioProfile', + // Value: 'LC' + //} + ] + }); + + profile.CodecProfiles.push({ + Type: 'VideoAudio', + Codec: 'aac,mp3', + Conditions: [ + { + Condition: 'LessThanEqual', + Property: 'AudioChannels', + Value: '6' + } + ] + }); + + profile.CodecProfiles.push({ + Type: 'VideoAudio', + Conditions: [ + { + Condition: 'Equals', + Property: 'IsSecondaryAudio', + Value: 'false', + IsRequired: 'false' + } + ] + }); + + profile.CodecProfiles.push({ + Type: 'Video', + Codec: 'h264', + Conditions: [ + { + Condition: 'NotEquals', + Property: 'IsAnamorphic', + Value: 'true', + IsRequired: false + }, + { + Condition: 'EqualsAny', + Property: 'VideoProfile', + Value: 'high|main|baseline|constrained baseline' + }, + { + Condition: 'LessThanEqual', + Property: 'VideoLevel', + Value: '41' + }] + }); + + profile.CodecProfiles.push({ + Type: 'Video', + Codec: 'vpx', + Conditions: [ + { + Condition: 'NotEquals', + Property: 'IsAnamorphic', + Value: 'true', + IsRequired: false + }] + }); + + // Subtitle profiles + // External vtt or burn in + profile.SubtitleProfiles = []; + if (supportsTextTracks()) { + + profile.SubtitleProfiles.push({ + Format: 'vtt', + Method: 'External' + }); + } + + profile.ResponseProfiles = []; + + profile.ResponseProfiles.push({ + Type: 'Video', + Container: 'm4v', + MimeType: 'video/mp4' + }); + + profile.ResponseProfiles.push({ + Type: 'Video', + Container: 'mov', + MimeType: 'video/webm' + }); + + return profile; + }(); +}); \ No newline at end of file diff --git a/dashboard-ui/components/requirecss.js b/dashboard-ui/bower_components/emby-webcomponents/requirecss.js similarity index 89% rename from dashboard-ui/components/requirecss.js rename to dashboard-ui/bower_components/emby-webcomponents/requirecss.js index 603326d340..96752bd015 100644 --- a/dashboard-ui/components/requirecss.js +++ b/dashboard-ui/bower_components/emby-webcomponents/requirecss.js @@ -26,17 +26,17 @@ define(function () { requireCss.load = function (cssId, req, load, config) { // Somehow if the url starts with /css, require will get all screwed up since this extension is also called css - cssId = cssId.replace('components/requirecss', 'css'); + var srch = '/emby-webcomponents/requirecss'; + var index = cssId.indexOf(srch); + + if (index != -1) { + cssId = 'css' + cssId.substring(index + srch.length); + } + var url = cssId + '.css'; var packageName = ''; - // TODO: handle any value before the # - if (url.indexOf('theme#') != -1) { - url = url.replace('theme#', ''); - packageName = 'theme'; - } - if (url.indexOf('http') != 0 && url.indexOf('file:') != 0) { url = config.baseUrl + url; } diff --git a/dashboard-ui/bower_components/emby-webcomponents/requirehtml.js b/dashboard-ui/bower_components/emby-webcomponents/requirehtml.js index 5c483087da..1764812234 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/requirehtml.js +++ b/dashboard-ui/bower_components/emby-webcomponents/requirehtml.js @@ -1,46 +1,46 @@ define(function () { - var cssAPI = {}; - - cssAPI.normalize = function (name, normalize) { - if (name.substr(name.length - 5, 5) == '.html') - name = name.substr(0, name.length - 5); - - return normalize(name); - } var importedFiles = []; - cssAPI.load = function (cssId, req, load, config) { + return { - // Somehow if the url starts with /css, require will get all screwed up since this extension is also called css - cssId = cssId.replace('js/requirehtml', 'html'); + load: function (cssId, req, load, config) { - var url = cssId + '.html'; + // Somehow if the url starts with /html, require will get all screwed up since this extension is also called html + cssId = cssId.replace('js/requirehtml', 'html'); - if (url.indexOf('http') != 0 && url.indexOf('file:') != 0) { - url = config.baseUrl + url; - } + var url = cssId + '.html'; - if (importedFiles.indexOf(url) == -1) { - importedFiles.push(url); - - var link = document.createElement('link'); - link.rel = 'import'; - - if (url.toLowerCase().indexOf('bower_') == -1) { - url = url + "?" + config.urlArgs; + if (url.indexOf('http') != 0 && url.indexOf('file:') != 0) { + url = config.baseUrl + url; } - link.onload = load; - link.href = url; + if (importedFiles.indexOf(url) == -1) { + importedFiles.push(url); - document.head.appendChild(link); + var link = document.createElement('link'); + link.rel = 'import'; - return; + if (url.toLowerCase().indexOf('bower_') == -1) { + url = url + "?" + config.urlArgs; + } + + link.onload = load; + link.href = url; + + document.head.appendChild(link); + + return; + } + + load(); + }, + + normalize: function (name, normalize) { + if (name.substr(name.length - 5, 5) == '.html') + name = name.substr(0, name.length - 5); + + return normalize(name); } - - load(); - } - - return cssAPI; + }; }); diff --git a/dashboard-ui/bower_components/hammerjs/.bower.json b/dashboard-ui/bower_components/hammerjs/.bower.json index 977f642119..95586d345b 100644 --- a/dashboard-ui/bower_components/hammerjs/.bower.json +++ b/dashboard-ui/bower_components/hammerjs/.bower.json @@ -3,15 +3,23 @@ "main": "hammer.js", "ignore": [ "tests", - "src" + "src", + ".bowerrc", + ".gitignore", + ".jscsrc", + ".jshintrc", + ".travis.yml", + "component.json", + "Gruntfile.coffee", + "package.json" ], "homepage": "https://github.com/hammerjs/hammer.js", - "version": "2.0.5", - "_release": "2.0.5", + "version": "2.0.6", + "_release": "2.0.6", "_resolution": { "type": "version", - "tag": "v2.0.5", - "commit": "4ac915029353faf7cbe3ac9252d84a2621772f85" + "tag": "v2.0.6", + "commit": "05f0872c6130daf537bad27a393310cd5833c9a1" }, "_source": "git://github.com/hammerjs/hammer.js.git", "_target": "~2.0.4", diff --git a/dashboard-ui/bower_components/hammerjs/.bowerrc b/dashboard-ui/bower_components/hammerjs/.bowerrc deleted file mode 100644 index a3731bd2c5..0000000000 --- a/dashboard-ui/bower_components/hammerjs/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "json": "bower.json" -} \ No newline at end of file diff --git a/dashboard-ui/bower_components/hammerjs/.gitignore b/dashboard-ui/bower_components/hammerjs/.gitignore deleted file mode 100644 index 391688ff93..0000000000 --- a/dashboard-ui/bower_components/hammerjs/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -# ide -.idea -.iml - -# node -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results -tests/build.js - -npm-debug.log -node_modules diff --git a/dashboard-ui/bower_components/hammerjs/.jscsrc b/dashboard-ui/bower_components/hammerjs/.jscsrc deleted file mode 100644 index 168677b828..0000000000 --- a/dashboard-ui/bower_components/hammerjs/.jscsrc +++ /dev/null @@ -1,95 +0,0 @@ -{ - "excludeFiles": [ - "*.js", - "tests/**/assets", - "node_modules/**" - ], - "requireCurlyBraces": [ - "if", - "else", - "for", - "while", - "do", - "try", - "catch" - ], - "requireOperatorBeforeLineBreak": true, - "requireCamelCaseOrUpperCaseIdentifiers": true, - "maximumLineLength": { - "value": 120, - "allowComments": true, - "allowRegex": true - }, - "validateIndentation": 4, - "validateQuoteMarks": "'", - "disallowMultipleLineStrings": true, - "disallowMixedSpacesAndTabs": true, - "disallowTrailingWhitespace": true, - "disallowSpaceAfterPrefixUnaryOperators": true, - "requireSpaceAfterKeywords": [ - "if", - "else", - "for", - "while", - "do", - "switch", - "return", - "try", - "catch" - ], - "requireSpaceBeforeBinaryOperators": [ - "=", - "+=", - "-=", - "*=", - "/=", - "%=", - "<<=", - ">>=", - ">>>=", - "&=", - "|=", - "^=", - "+=", - "+", - "-", - "*", - "/", - "%", - "<<", - ">>", - ">>>", - "&", - "|", - "^", - "&&", - "||", - "===", - "==", - ">=", - "<=", - "<", - ">", - "!=", - "!==" - ], - "requireSpaceAfterBinaryOperators": true, - "requireSpacesInConditionalExpression": true, - "requireSpaceBeforeBlockStatements": true, - "requireLineFeedAtFileEnd": true, - "requireSpacesInFunctionExpression": { - "beforeOpeningCurlyBrace": true - }, - "disallowSpacesInAnonymousFunctionExpression": { - "beforeOpeningRoundBrace": true - }, - "disallowSpacesInsideObjectBrackets": "all", - "disallowSpacesInsideArrayBrackets": "all", - "disallowSpacesInsideParentheses": true, - "validateJSDoc": { - "checkParamNames": true, - "requireParamTypes": true - }, - "disallowMultipleLineBreaks": true, - "disallowNewlineBeforeBlockStatements": true -} \ No newline at end of file diff --git a/dashboard-ui/bower_components/hammerjs/.jshintrc b/dashboard-ui/bower_components/hammerjs/.jshintrc deleted file mode 100644 index 925e528b52..0000000000 --- a/dashboard-ui/bower_components/hammerjs/.jshintrc +++ /dev/null @@ -1,22 +0,0 @@ -{ - "browser": true, - "curly": true, - "eqnull": true, - "expr": true, - "maxerr": 100, - "freeze": true, - "newcap": true, - "node": true, - "quotmark": "single", - "strict": true, - "sub": true, - "trailing": true, - "undef": true, - "unused": true, - "camelcase": true, - "indent": 4, - "validthis": true, - "globals": { - "define": false - } -} diff --git a/dashboard-ui/bower_components/hammerjs/.travis.yml b/dashboard-ui/bower_components/hammerjs/.travis.yml deleted file mode 100644 index 308d9a6e86..0000000000 --- a/dashboard-ui/bower_components/hammerjs/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -node_js: - - "0.10" - -sudo: false - -before_script: - - npm install -g grunt-cli - -script: - - grunt test-travis \ No newline at end of file diff --git a/dashboard-ui/bower_components/hammerjs/CHANGELOG.md b/dashboard-ui/bower_components/hammerjs/CHANGELOG.md index 27f8963ca2..d3bc17db6c 100644 --- a/dashboard-ui/bower_components/hammerjs/CHANGELOG.md +++ b/dashboard-ui/bower_components/hammerjs/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +### 2.0.6, 2015-12-23 +- Add Assign method and deprecate merge and extend ([#895](https://github.com/hammerjs/hammer.js/pull/895)[fc01eae](https://github.com/hammerjs/hammer.js/commit/fc01eaea678acc430c664eb374555fbe3d403bdd)) +- Expose Hammer on window or self if either is defined to avoid issues when AMD is present but not used. ( [356f795](https://github.com/hammerjs/hammer.js/commit/356f7955b01f3679c29d6c45931679256b45036e)) +- Add support for PointerEvent instead of MSPointerEvent if supported. ([#754](https://github.com/hammerjs/hammer.js/issues/754), [439c7a6](https://github.com/hammerjs/hammer.js/commit/439c7a6c46978ab387b4b8289399e904d1c49535)) +- Fixed moz-prefix, prefix should be Moz not moz. ([3ea47f3](https://github.com/hammerjs/hammer.js/commit/3ea47f3aebadc9d3bb6bf52bc8402cad135ef8a9)) +- Removed non-existant recognizer ([f1c2d3b](https://github.com/hammerjs/hammer.js/commit/f1c2d3bf05f530ae092ecfc2335fceeff0e9eec9)) +- Fixed config leaking between instances([189098f](https://github.com/hammerjs/hammer.js/commit/189098ff7736f6ed2fce9a3d3e1f5a3afee085ba)) +- Fixed gaps in gesture configs and update tests to match ([70c2902](https://github.com/hammerjs/hammer.js/commit/70c2902d773a750e92ce8c423f8a4165c07eab97)) +- Fixed Manager off method ([#768](https://github.com/hammerjs/hammer.js/issues/768), [da49a27](https://github.com/hammerjs/hammer.js/commit/da49a2730779ecc3b4dd147cc418a0df7c70fad9)) +- Added compatibility with requirejs optimizer namespaces ( [70075f2](https://github.com/hammerjs/hammer.js/commit/70075f2df1b855f7c6d8d3caac49b9276b88c8d6)) +- Made touchaction test zoomable ( [50264a7](https://github.com/hammerjs/hammer.js/commit/50264a70251ca88bbaf7b666401e527eee616de5)) +- Fixed preventing default when for `pan-x pan-y` case ( [95eaafa](https://github.com/hammerjs/hammer.js/commit/95eaafadad27bd1b25d20cf976811a451922f1c4)) +- Fixed incorrect touch action pan direction ( [a81da57](https://github.com/hammerjs/hammer.js/commit/a81da57a82ebf37e695e7c443e4e2715e7f32856)) +- Fixed combined pan-x pan-y to resolve to none ( [fdae07b](https://github.com/hammerjs/hammer.js/commit/fdae07bc2ba3c90aad28da6791b3d5df627bc612)) +- Fixed inverted touch-action for pan recognizer ([#728](https://github.com/hammerjs/hammer.js/issues/728), [605bd3b](https://github.com/hammerjs/hammer.js/commit/605bd3beca780be91dd43f9da8b809d155a43d1a)) +- Fixed dependency on non standard touch list ordering ([#610](https://github.com/hammerjs/hammer.js/issues/610), [#791](https://github.com/hammerjs/hammer.js/issues/791), [287720a](https://github.com/hammerjs/hammer.js/commit/287720a6e5067e7f28be8b8b3b266d22905361c4)) +- Fixed swipe to not trigger after multitouch gesture ([#640](https://github.com/hammerjs/hammer.js/issues/640), [711d8a1](https://github.com/hammerjs/hammer.js/commit/711d8a1df1aa5057ecb536454a36257e3c0d6d91)) +- Fixed swipe recognizer to use overall gesture direction and velocity ( [963fe69](https://github.com/hammerjs/hammer.js/commit/963fe697515273fee508414bc29e2656465cea55)) +- Fixed getDirection returning reversed direction ( [e40dcde](https://github.com/hammerjs/hammer.js/commit/e40dcde43bdac7a74c8ce5c05a4f62121089cd91)) +- Fixed detection of tap when multi touch gestures are present ( [c46cbba](https://github.com/hammerjs/hammer.js/commit/c46cbba1c2cbbf874b59913416858d9dae297e64)) +- Fixed incorrect event order ([#824](https://github.com/hammerjs/hammer.js/issues/824), [92f2d76](https://github.com/hammerjs/hammer.js/commit/92f2d76188480d967e738a19cd508d0b94a31329)) +- Fixed leaking options between recognizer instances ([#813](https://github.com/hammerjs/hammer.js/issues/813), [af32c9b](https://github.com/hammerjs/hammer.js/commit/af32c9bace3f04bb34bee852ff56a33cc8fc27cd)) +- Fixed detection when element has no style attribute ( [5ca6d8c](https://github.com/hammerjs/hammer.js/commit/5ca6d8cbead02c71929a8073e95ddf98e11c0e06)) + ### 2.0.4, 2014-09-28 - Fix IE pointer issue. [#665](https://github.com/hammerjs/hammer.js/pull/665) - Fix multi-touch at different elements. [#668](https://github.com/hammerjs/hammer.js/pull/668) diff --git a/dashboard-ui/bower_components/hammerjs/Gruntfile.coffee b/dashboard-ui/bower_components/hammerjs/Gruntfile.coffee deleted file mode 100644 index d14d6ec585..0000000000 --- a/dashboard-ui/bower_components/hammerjs/Gruntfile.coffee +++ /dev/null @@ -1,124 +0,0 @@ -module.exports = (grunt) -> - grunt.initConfig - pkg: grunt.file.readJSON 'package.json' - - usebanner: - taskName: - options: - position: 'top' - banner: ' -/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n - * <%= pkg.homepage %>\n - *\n - * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;\n - * Licensed under the <%= _.pluck(pkg.licenses, "type").join(", ") %> license */' - linebreak: true - files: - src: ['./hammer.js','./hammer.min.js'] - - concat: - build: - src: [ - 'src/hammer.prefix.js' - 'src/utils.js' - 'src/input.js' - 'src/input/*.js' - 'src/touchaction.js' - 'src/recognizer.js' - 'src/recognizers/*.js' - 'src/hammer.js' - 'src/manager.js' - 'src/expose.js' - 'src/hammer.suffix.js'] - dest: 'hammer.js' - - uglify: - min: - options: - report: 'gzip' - sourceMap: 'hammer.min.map' - files: - 'hammer.min.js': ['hammer.js'] - # special test build that exposes everything so it's testable - test: - options: - wrap: "$H" - comments: 'all' - exportAll: true - mangle: false - beautify: true - compress: - global_defs: - exportName: 'Hammer' - files: - 'tests/build.js': [ - 'src/utils.js' - 'src/input.js' - 'src/input/*.js' - 'src/touchaction.js' - 'src/recognizer.js' - 'src/recognizers/*.js' - 'src/hammer.js' - 'src/manager.js' - 'src/expose.js'] - - 'string-replace': - version: - files: - 'hammer.js': 'hammer.js' - options: - replacements: [ - pattern: '{{PKG_VERSION}}' - replacement: '<%= pkg.version %>' - ] - - jshint: - options: - jshintrc: true - build: - src: ['hammer.js'] - - jscs: - src: [ - 'src/**/*.js', - '!src/hammer.prefix.js', - '!src/hammer.suffix.js' - ] - options: - config: "./.jscsrc" - force: true - - watch: - scripts: - files: ['src/**/*.js'] - tasks: ['concat','string-replace','uglify','jshint','jscs'] - options: - interrupt: true - - connect: - server: - options: - hostname: "0.0.0.0" - port: 8000 - - qunit: - all: ['tests/unit/index.html'] - - - # Load tasks - grunt.loadNpmTasks 'grunt-contrib-concat' - grunt.loadNpmTasks 'grunt-contrib-uglify' - grunt.loadNpmTasks 'grunt-contrib-qunit' - grunt.loadNpmTasks 'grunt-contrib-watch' - grunt.loadNpmTasks 'grunt-contrib-jshint' - grunt.loadNpmTasks 'grunt-contrib-connect' - grunt.loadNpmTasks 'grunt-string-replace' - grunt.loadNpmTasks 'grunt-banner' - grunt.loadNpmTasks 'grunt-jscs' - - # Default task(s) - grunt.registerTask 'default', ['connect', 'watch'] - grunt.registerTask 'default-test', ['connect', 'uglify:test', 'watch'] - grunt.registerTask 'build', ['concat', 'string-replace', 'uglify:min', 'usebanner', 'test'] - grunt.registerTask 'test', ['jshint', 'jscs', 'uglify:test', 'qunit'] - grunt.registerTask 'test-travis', ['build'] diff --git a/dashboard-ui/bower_components/hammerjs/bower.json b/dashboard-ui/bower_components/hammerjs/bower.json index 632c16e5e5..f241608cdf 100644 --- a/dashboard-ui/bower_components/hammerjs/bower.json +++ b/dashboard-ui/bower_components/hammerjs/bower.json @@ -3,6 +3,14 @@ "main": "hammer.js", "ignore": [ "tests", - "src" + "src", + ".bowerrc", + ".gitignore", + ".jscsrc", + ".jshintrc", + ".travis.yml", + "component.json", + "Gruntfile.coffee", + "package.json" ] } diff --git a/dashboard-ui/bower_components/hammerjs/changelog.js b/dashboard-ui/bower_components/hammerjs/changelog.js new file mode 100644 index 0000000000..887a32926c --- /dev/null +++ b/dashboard-ui/bower_components/hammerjs/changelog.js @@ -0,0 +1,71 @@ +var changelog = require( "changelogplease" ); +var gittags = require( "git-tags" ).get( function( error, tags ) { + if ( error ) { + throw error + } + console.log( tags[ 1 ] + ".." + tags[ 0 ] ); + var exclude = [ "Merge", "Whitespace", "Fixup", "Cleanup", "Formatting", "Ignore" ]; + changelog( { + ticketUrl: "https://github.com/hammerjs/hammer.js/issues/{id}", + commitUrl: "https://github.com/hammerjs/hammerjs/commit/{id}", + sort: false, + repo: "./", + committish: tags[ 1 ] + ".." + tags[ 0 ] + }, function( error, log ) { + if ( error ) { + throw error; + } + log = parseLog( log ); + console.log( log ); + } ); + function parseLog( log ) { + var lines = log.split( "\n" ); + var newLog = []; + var log = []; + var currentComponent; + + + lines.shift(); + lines.forEach( function( line ) { + var newLine = parseLine( line ); + if ( newLine ) { + log.push( line ); + } + } ); + var log = log.join( "\n" ); + return log.replace( /\*/g, "-" ).replace( /__TICKETREF__,/g, "" ); + } + function parseLine( line ) { + var parts = getParts( line ); + + if ( exclude.indexOf( parts.component ) > -1 ) { + return false; + } + return parts; + } + function getParts( line ) { + var parts = line.split( ":" ); + var component = ""; + var message; + var commits = line.match( /\{\{([A-Za-z0-9 ]){0,99}\}\}/ ) + + if ( parts.length > 1 && parts[ 0 ].length <= 20 ) { + component = parts[ 0 ]; + parts.shift(); + message = parts.join( ":" ); + } else { + parts = line.split( " " ); + component = parts[ 1 ]; + parts.shift(); + message = parts.join( " " ); + } + + if ( component ) { + component = component.replace( /\* |,/, "" ); + } + return { + component: component, + message: message + }; + } +} ); diff --git a/dashboard-ui/bower_components/hammerjs/component.json b/dashboard-ui/bower_components/hammerjs/component.json deleted file mode 100644 index f4467af9f8..0000000000 --- a/dashboard-ui/bower_components/hammerjs/component.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "hammerjs", - "version": "2.0.3", - "main": "hammer.js", - "scripts": [ - "hammer.js" - ] -} diff --git a/dashboard-ui/bower_components/hammerjs/hammer.js b/dashboard-ui/bower_components/hammerjs/hammer.js index 7acc5eec2b..bbabf7378b 100644 --- a/dashboard-ui/bower_components/hammerjs/hammer.js +++ b/dashboard-ui/bower_components/hammerjs/hammer.js @@ -1,4 +1,4 @@ -/*! Hammer.JS - v2.0.4 - 2015-12-22 +/*! Hammer.JS - v2.0.6 - 2015-12-23 * http://hammerjs.github.io/ * * Copyright (c) 2015 Jorik Tangelder; @@ -71,15 +71,69 @@ function each(obj, iterator, context) { } } +/** + * wrap a method with a deprecation warning and stack trace + * @param {Function} method + * @param {String} name + * @param {String} message + * @returns {Function} A new function wrapping the supplied method. + */ +function deprecate(method, name, message) { + var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n'; + return function() { + var e = new Error('get-stack-trace'); + var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '') + .replace(/^\s+at\s+/gm, '') + .replace(/^Object.\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace'; + + var log = window.console && (window.console.warn || window.console.log); + if (log) { + log.call(window.console, deprecationMessage, stack); + } + return method.apply(this, arguments); + }; +} + +/** + * extend object. + * means that properties in dest will be overwritten by the ones in src. + * @param {Object} target + * @param {...Object} objects_to_assign + * @returns {Object} target + */ +var assign; +if (typeof Object.assign !== 'function') { + assign = function assign(target) { + if (target === undefined || target === null) { + throw new TypeError('Cannot convert undefined or null to object'); + } + + var output = Object(target); + for (var index = 1; index < arguments.length; index++) { + var source = arguments[index]; + if (source !== undefined && source !== null) { + for (var nextKey in source) { + if (source.hasOwnProperty(nextKey)) { + output[nextKey] = source[nextKey]; + } + } + } + } + return output; + }; +} else { + assign = Object.assign; +} + /** * extend object. * means that properties in dest will be overwritten by the ones in src. * @param {Object} dest * @param {Object} src - * @param {Boolean} [merge] + * @param {Boolean=false} [merge] * @returns {Object} dest */ -function extend(dest, src, merge) { +var extend = deprecate(function extend(dest, src, merge) { var keys = Object.keys(src); var i = 0; while (i < keys.length) { @@ -89,7 +143,7 @@ function extend(dest, src, merge) { i++; } return dest; -} +}, 'extend', 'Use `assign`.'); /** * merge the values from src in the dest. @@ -98,9 +152,9 @@ function extend(dest, src, merge) { * @param {Object} src * @returns {Object} dest */ -function merge(dest, src) { +var merge = deprecate(function merge(dest, src) { return extend(dest, src, true); -} +}, 'merge', 'Use `assign`.'); /** * simple class inheritance @@ -117,7 +171,7 @@ function inherit(child, base, properties) { childP._super = baseP; if (properties) { - extend(childP, properties); + assign(childP, properties); } } @@ -1284,13 +1338,11 @@ var STATE_FAILED = 32; * @param {Object} options */ function Recognizer(options) { - // make sure, options are copied over to a new object to prevent leaking it outside - options = extend({}, options || {}); + this.options = assign({}, this.defaults, options || {}); this.id = uniqueId(); this.manager = null; - this.options = merge(options, this.defaults); // default is enable true this.options.enable = ifUndefined(this.options.enable, true); @@ -1314,7 +1366,7 @@ Recognizer.prototype = { * @return {Recognizer} */ set: function(options) { - extend(this.options, options); + assign(this.options, options); // also update the touchAction, in case something changed about the directions/enabled state this.manager && this.manager.touchAction.update(); @@ -1475,7 +1527,7 @@ Recognizer.prototype = { recognize: function(inputData) { // make a new copy of the inputData // so we can change the inputData without messing up the other recognizers - var inputDataClone = extend({}, inputData); + var inputDataClone = assign({}, inputData); // is is enabled and allow recognizing? if (!boolOrFn(this.options.enable, [this, inputDataClone])) { @@ -2040,7 +2092,7 @@ function Hammer(element, options) { /** * @const {string} */ -Hammer.VERSION = '2.0.4'; +Hammer.VERSION = '2.0.6'; /** * default settings @@ -2164,8 +2216,7 @@ var FORCED_STOP = 2; * @constructor */ function Manager(element, options) { - var newOptions = options ? extend({}, options) : {}; - this.options = merge(newOptions, Hammer.defaults); + this.options = assign({}, Hammer.defaults, options || {}); this.options.inputTarget = this.options.inputTarget || element; @@ -2193,7 +2244,7 @@ Manager.prototype = { * @returns {Manager} */ set: function(options) { - extend(this.options, options); + assign(this.options, options); // Options that need a little more setup if (options.touchAction) { @@ -2446,7 +2497,7 @@ function triggerDomEvent(event, data) { data.target.dispatchEvent(gestureEvent); } -extend(Hammer, { +assign(Hammer, { INPUT_START: INPUT_START, INPUT_MOVE: INPUT_MOVE, INPUT_END: INPUT_END, @@ -2493,6 +2544,7 @@ extend(Hammer, { each: each, merge: merge, extend: extend, + assign: assign, inherit: inherit, bindFn: bindFn, prefixed: prefixed diff --git a/dashboard-ui/bower_components/hammerjs/hammer.min.js b/dashboard-ui/bower_components/hammerjs/hammer.min.js index 9b0d605eab..d5def77352 100644 --- a/dashboard-ui/bower_components/hammerjs/hammer.min.js +++ b/dashboard-ui/bower_components/hammerjs/hammer.min.js @@ -1,7 +1,7 @@ -/*! Hammer.JS - v2.0.4 - 2015-12-22 +/*! Hammer.JS - v2.0.6 - 2015-12-23 * http://hammerjs.github.io/ * * Copyright (c) 2015 Jorik Tangelder; * Licensed under the license */ -!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(k(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e-1}function r(a){return a.trim().split(/\s+/g)}function s(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;dc[b]}):d.sort()),d}function v(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g1&&!c.firstMultiple?c.firstMultiple=E(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=F(d);b.timeStamp=nb(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=J(h,i),b.distance=I(h,i),C(c,b),b.offsetDirection=H(b.deltaX,b.deltaY);var j=G(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=mb(j.x)>mb(j.y)?j.x:j.y,b.scale=g?L(g.pointers,d):1,b.rotation=g?K(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,D(c,b);var k=a.element;p(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function C(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===yb||f.eventType===Ab)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function D(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Bb&&(i>xb||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=G(i,j,k);e=l.x,f=l.y,c=mb(l.x)>mb(l.y)?l.x:l.y,g=H(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function E(a){for(var b=[],c=0;ce;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:lb(c/b),y:lb(d/b)}}function G(a,b,c){return{x:b/a||0,y:c/a||0}}function H(a,b){return a===b?Cb:mb(a)>=mb(b)?0>a?Db:Eb:0>b?Fb:Gb}function I(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function J(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function K(a,b){return J(b[1],b[0],Lb)+J(a[1],a[0],Lb)}function L(a,b){return I(b[0],b[1],Lb)/I(a[0],a[1],Lb)}function M(){this.evEl=Nb,this.evWin=Ob,this.allow=!0,this.pressed=!1,y.apply(this,arguments)}function N(){this.evEl=Rb,this.evWin=Sb,y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function O(){this.evTarget=Ub,this.evWin=Vb,this.started=!1,y.apply(this,arguments)}function P(a,b){var c=t(a.touches),d=t(a.changedTouches);return b&(Ab|Bb)&&(c=u(c.concat(d),"identifier",!0)),[c,d]}function Q(){this.evTarget=Xb,this.targetIds={},y.apply(this,arguments)}function R(a,b){var c=t(a.touches),d=this.targetIds;if(b&(yb|zb)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=t(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return p(a.target,i)}),b===yb)for(e=0;eh&&(b.push(a),h=b.length-1):e&(Ab|Bb)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Tb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Ub="touchstart",Vb="touchstart touchmove touchend touchcancel";j(O,y,{handler:function(a){var b=Tb[a.type];if(b===yb&&(this.started=!0),this.started){var c=P.call(this,a,b);b&(Ab|Bb)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}});var Wb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Xb="touchstart touchmove touchend touchcancel";j(Q,y,{handler:function(a){var b=Wb[a.type],c=R.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}),j(S,y,{handler:function(a,b,c){var d=c.pointerType==tb,e=c.pointerType==vb;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Ab|Bb)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Yb=v(jb.style,"touchAction"),Zb=Yb!==d,$b="compute",_b="auto",ac="manipulation",bc="none",cc="pan-x",dc="pan-y";T.prototype={set:function(a){a==$b&&(a=this.compute()),Zb&&this.manager.element.style&&(this.manager.element.style[Yb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){l(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),U(a.join(" "))},preventDefaults:function(a){if(!Zb){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=q(d,bc),f=q(d,dc),g=q(d,cc);if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}if(!g||!f)return e||f&&c&Hb||g&&c&Ib?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var ec=1,fc=2,gc=4,hc=8,ic=hc,jc=16,kc=32;V.prototype={defaults:{},set:function(a){return h(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=Y(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=Y(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=Y(a,this),-1===s(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=Y(a,this);var b=s(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;hc>d&&b(c.options.event+W(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=hc&&b(c.options.event+W(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=kc)},canEmit:function(){for(var a=0;af?Db:Eb,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Cb:0>g?Fb:Gb,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Z.prototype.attrTest.call(this,a)&&(this.state&fc||!(this.state&fc)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=X(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),j(_,Z,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&fc)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),j(ab,V,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[_b]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventType&(Ab|Bb)&&!f)this.reset();else if(a.eventType&yb)this.reset(),this._timer=e(function(){this.state=ic,this.tryEmit()},b.time,this);else if(a.eventType&Ab)return ic;return kc},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===ic&&(a&&a.eventType&Ab?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=nb(),this.manager.emit(this.options.event,this._input)))}}),j(bb,Z,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&fc)}}),j(cb,Z,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Hb|Ib,pointers:1},getTouchAction:function(){return $.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Hb|Ib)?b=a.overallVelocity:c&Hb?b=a.overallVelocityX:c&Ib&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&mb(b)>this.options.velocity&&a.eventType&Ab},emit:function(a){var b=X(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),j(db,V,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ac]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&hb(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==kb?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;dc[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=nb(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=mb(j.x)>mb(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===Ab||f.eventType===Cb)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Db&&(i>zb||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=mb(l.x)>mb(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;ce;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:lb(c/b),y:lb(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Eb:mb(a)>=mb(b)?0>a?Fb:Gb:0>b?Hb:Ib}function H(a,b,c){c||(c=Mb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Mb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Nb)+I(a[1],a[0],Nb)}function K(a,b){return H(b[0],b[1],Nb)/H(a[0],a[1],Nb)}function L(){this.evEl=Pb,this.evWin=Qb,this.allow=!0,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Tb,this.evWin=Ub,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=Wb,this.evWin=Xb,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Cb|Db)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=Zb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ab|Bb)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ab)for(e=0;eh&&(b.push(a),h=b.length-1):e&(Cb|Db)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Vb={touchstart:Ab,touchmove:Bb,touchend:Cb,touchcancel:Db},Wb="touchstart",Xb="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Vb[a.type];if(b===Ab&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Cb|Db)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:vb,srcEvent:a})}}});var Yb={touchstart:Ab,touchmove:Bb,touchend:Cb,touchcancel:Db},Zb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=Yb[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:vb,srcEvent:a})}}),i(R,x,{handler:function(a,b,c){var d=c.pointerType==vb,e=c.pointerType==xb;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Cb|Db)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var $b=u(jb.style,"touchAction"),_b=$b!==d,ac="compute",bc="auto",cc="manipulation",dc="none",ec="pan-x",fc="pan-y";S.prototype={set:function(a){a==ac&&(a=this.compute()),_b&&this.manager.element.style&&(this.manager.element.style[$b]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),T(a.join(" "))},preventDefaults:function(a){if(!_b){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,dc),f=p(d,fc),g=p(d,ec);if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}if(!g||!f)return e||f&&c&Jb||g&&c&Kb?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var gc=1,hc=2,ic=4,jc=8,kc=jc,lc=16,mc=32;U.prototype={defaults:{},set:function(a){return hb(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=X(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=X(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=X(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=X(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;jc>d&&b(c.options.event+V(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=jc&&b(c.options.event+V(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=mc)},canEmit:function(){for(var a=0;af?Fb:Gb,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Eb:0>g?Hb:Ib,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Y.prototype.attrTest.call(this,a)&&(this.state&hc||!(this.state&hc)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=W(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i($,Y,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[dc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&hc)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(_,U,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bc]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distanceb.time;if(this._input=a,!d||!c||a.eventType&(Cb|Db)&&!f)this.reset();else if(a.eventType&Ab)this.reset(),this._timer=e(function(){this.state=kc,this.tryEmit()},b.time,this);else if(a.eventType&Cb)return kc;return mc},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===kc&&(a&&a.eventType&Cb?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=nb(),this.manager.emit(this.options.event,this._input)))}}),i(ab,Y,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[dc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&hc)}}),i(bb,Y,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Jb|Kb,pointers:1},getTouchAction:function(){return Z.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Jb|Kb)?b=a.overallVelocity:c&Jb?b=a.overallVelocityX:c&Kb&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&mb(b)>this.options.velocity&&a.eventType&Cb},emit:function(a){var b=W(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(cb,U,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[cc]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance=0.8.0" - }, - "scripts": { - "test": "grunt test" - } -} diff --git a/dashboard-ui/bower_components/iron-flex-layout/.bower.json b/dashboard-ui/bower_components/iron-flex-layout/.bower.json index 846bf5c150..0985b733c6 100644 --- a/dashboard-ui/bower_components/iron-flex-layout/.bower.json +++ b/dashboard-ui/bower_components/iron-flex-layout/.bower.json @@ -28,14 +28,14 @@ "iron-component-page": "polymerelements/iron-component-page#^1.0.0" }, "ignore": [], - "homepage": "https://github.com/polymerelements/iron-flex-layout", + "homepage": "https://github.com/PolymerElements/iron-flex-layout", "_release": "1.2.2", "_resolution": { "type": "version", "tag": "v1.2.2", "commit": "41c4f35be1368afb770312b907a258175565dbdf" }, - "_source": "git://github.com/polymerelements/iron-flex-layout.git", + "_source": "git://github.com/PolymerElements/iron-flex-layout.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-flex-layout" + "_originalSource": "PolymerElements/iron-flex-layout" } \ No newline at end of file diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index b5711cdba1..231db5dd16 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -892,11 +892,10 @@ showSelections(card); - if (s.stopPropagation) { + if (e.stopPropagation) { e.stopPropagation(); } e.preventDefault(); - e.stopPropagation(); return false; } e.preventDefault(); @@ -949,19 +948,17 @@ if (!itemSelectionPanel) { - require(['paper-checkbox'], function () { - itemSelectionPanel = document.createElement('div'); - itemSelectionPanel.classList.add('itemSelectionPanel'); + itemSelectionPanel = document.createElement('div'); + itemSelectionPanel.classList.add('itemSelectionPanel'); - item.querySelector('.cardContent').appendChild(itemSelectionPanel); + item.querySelector('.cardContent').appendChild(itemSelectionPanel); - var chkItemSelect = document.createElement('paper-checkbox'); - chkItemSelect.classList.add('chkItemSelect'); + var chkItemSelect = document.createElement('paper-checkbox'); + chkItemSelect.classList.add('chkItemSelect'); - $(chkItemSelect).on('change', onSelectionChange); + $(chkItemSelect).on('change', onSelectionChange); - itemSelectionPanel.appendChild(chkItemSelect); - }); + itemSelectionPanel.appendChild(chkItemSelect); } } @@ -1018,14 +1015,16 @@ function showSelections(initialCard) { - var cards = document.querySelectorAll('.card'); - for (var i = 0, length = cards.length; i < length; i++) { - showSelection(cards[i]); - } + require(['paper-checkbox'], function() { + var cards = document.querySelectorAll('.card'); + for (var i = 0, length = cards.length; i < length; i++) { + showSelection(cards[i]); + } - showSelectionCommands(); - initialCard.querySelector('.chkItemSelect').checked = true; - updateItemSelection(initialCard, true); + showSelectionCommands(); + initialCard.querySelector('.chkItemSelect').checked = true; + updateItemSelection(initialCard, true); + }); } function hideSelections() { diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index d549eec598..2ce8557eb7 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1779,6 +1779,7 @@ var AppInfo = {}; } var apiClientBowerPath = bowerPath + "/emby-apiclient"; + var embyWebComponentsBowerPath = bowerPath + '/emby-webcomponents'; var paths = { velocity: bowerPath + "/velocity/velocity.min", @@ -1801,6 +1802,8 @@ var AppInfo = {}; credentialprovider: apiClientBowerPath + '/credentials', apiclient: apiClientBowerPath + '/apiclient', connectionmanagerfactory: apiClientBowerPath + '/connectionmanager', + browserdeviceprofile: embyWebComponentsBowerPath + "/browserdeviceprofile", + browser: embyWebComponentsBowerPath + "/browser", connectservice: apiClientBowerPath + '/connectservice' }; @@ -1835,7 +1838,7 @@ var AppInfo = {}; requirejs.config({ map: { '*': { - 'css': 'components/requirecss', + 'css': bowerPath + '/emby-webcomponents/requirecss', 'html': bowerPath + '/emby-webcomponents/requirehtml' } }, @@ -2370,78 +2373,11 @@ var AppInfo = {}; return getWebHostingAppInfo(); } - function setBrowserInfo(isMobile) { - - var uaMatch = function (ua) { - ua = ua.toLowerCase(); - - var match = /(edge)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(opr)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(safari)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - var platform_match = /(ipad)/.exec(ua) || - /(iphone)/.exec(ua) || - /(android)/.exec(ua) || - []; - - var browser = match[1] || ""; - - if (ua.indexOf("windows phone") != -1 || ua.indexOf("iemobile") != -1) { - - // http://www.neowin.net/news/ie11-fakes-user-agent-to-fool-gmail-in-windows-phone-81-gdr1-update - browser = "msie"; - } - else if (ua.indexOf("like gecko") != -1 && ua.indexOf('webkit') == -1 && ua.indexOf('opera') == -1 && ua.indexOf('chrome') == -1 && ua.indexOf('safari') == -1) { - browser = "msie"; - } - - if (browser == 'opr') { - browser = 'opera'; - } - - return { - browser: browser, - version: match[2] || "0", - platform: platform_match[0] || "" - }; - }; - - var userAgent = window.navigator.userAgent; - var matched = uaMatch(userAgent); - var browser = {}; - - if (matched.browser) { - browser[matched.browser] = true; - browser.version = matched.version; - } - - if (matched.platform) { - browser[matched.platform] = true; - } - - if (!browser.chrome && !browser.msie && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf("webkit") != -1) { - browser.safari = true; - } - - if (isMobile.any) { - browser.mobile = true; - } - - browser.animate = document.documentElement.animate != null; - - window.browserInfo = browser; - } - initRequire(); var initialDependencies = []; - initialDependencies.push('isMobile'); + initialDependencies.push('browser'); initialDependencies.push('apiclient-store'); initialDependencies.push('scripts/extensions'); @@ -2455,7 +2391,9 @@ var AppInfo = {}; initialDependencies.push('native-promise-only'); } - require(initialDependencies, function (isMobile) { + require(initialDependencies, function (browser) { + + window.browserInfo = browser; function onWebComponentsReady() { @@ -2469,7 +2407,6 @@ var AppInfo = {}; }); } - setBrowserInfo(isMobile); setAppInfo(); setDocumentClasses();