merge from dev

This commit is contained in:
Luke Pulverenti 2015-12-26 13:35:53 -05:00
parent 5e64aeba54
commit 8d7ae321a0
27 changed files with 678 additions and 500 deletions

View File

@ -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",

View File

@ -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);

View File

@ -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);

View File

@ -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"
}

View File

@ -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": {

View File

@ -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;
});

View File

@ -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;
}();
});

View File

@ -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;
}

View File

@ -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;
};
});

View File

@ -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",

View File

@ -1,3 +0,0 @@
{
"json": "bower.json"
}

View File

@ -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

View File

@ -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
}

View File

@ -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
}
}

View File

@ -1,11 +0,0 @@
language: node_js
node_js:
- "0.10"
sudo: false
before_script:
- npm install -g grunt-cli
script:
- grunt test-travis

View File

@ -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)

View File

@ -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']

View File

@ -3,6 +3,14 @@
"main": "hammer.js",
"ignore": [
"tests",
"src"
"src",
".bowerrc",
".gitignore",
".jscsrc",
".jshintrc",
".travis.yml",
"component.json",
"Gruntfile.coffee",
"package.json"
]
}

View File

@ -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
};
}
} );

View File

@ -1,8 +0,0 @@
{
"name": "hammerjs",
"version": "2.0.3",
"main": "hammer.js",
"scripts": [
"hammer.js"
]
}

View File

@ -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.<anonymous>\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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,45 +0,0 @@
{
"name": "hammerjs",
"title": "Hammer.JS",
"description": "A javascript library for multi-touch gestures",
"version": "2.0.5",
"homepage": "http://hammerjs.github.io/",
"license": "MIT",
"keywords": [
"touch",
"gestures"
],
"author": {
"name": "Jorik Tangelder",
"email": "j.tangelder@gmail.com"
},
"repository": {
"type": "git",
"url": "git://github.com/hammerjs/hammer.js.git"
},
"bugs": {
"url": "https://github.com/hammerjs/hammer.js/issues"
},
"dependencies": {},
"devDependencies": {
"grunt": "0.4.x",
"grunt-banner": "^0.2.3",
"grunt-contrib-concat": "0.4.x",
"grunt-contrib-connect": "0.7.x",
"grunt-contrib-jshint": "0.10.x",
"grunt-contrib-qunit": "^0.5.1",
"grunt-contrib-uglify": "0.4.x",
"grunt-contrib-watch": "0.6.x",
"grunt-jscs": "^0.8.0",
"grunt-string-replace": "^0.2.7",
"jquery-hammerjs": "2.0.x",
"hammer-simulator": "git://github.com/hammerjs/simulator#master"
},
"main": "hammer.js",
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"test": "grunt test"
}
}

View File

@ -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"
}

View File

@ -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() {

View File

@ -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();