diff --git a/dashboard-ui/addplugin.html b/dashboard-ui/addplugin.html
index a348b58a1e..ac27238180 100644
--- a/dashboard-ui/addplugin.html
+++ b/dashboard-ui/addplugin.html
@@ -1,4 +1,4 @@
-
+
@@ -27,7 +27,7 @@
@@ -65,7 +65,6 @@
@@ -78,14 +77,6 @@
-
-
diff --git a/dashboard-ui/autoorganizetv.html b/dashboard-ui/autoorganizetv.html
index c7688684eb..4d6eccfbf7 100644
--- a/dashboard-ui/autoorganizetv.html
+++ b/dashboard-ui/autoorganizetv.html
@@ -6,7 +6,6 @@
${AutoOrganizeHelp}
-
${AutoOrganizeTvHelp}
-
+
-
-
@@ -157,7 +154,7 @@
${LabelDeleteEmptyFoldersHelp}
-
+
diff --git a/dashboard-ui/bower_components/document-register-element/.bower.json b/dashboard-ui/bower_components/document-register-element/.bower.json
new file mode 100644
index 0000000000..4fbb40a04b
--- /dev/null
+++ b/dashboard-ui/bower_components/document-register-element/.bower.json
@@ -0,0 +1,35 @@
+{
+ "name": "document-register-element",
+ "description": "A stand-alone working lightweight version of the W3C Custom Elements specification",
+ "main": "./build/document-register-element.js",
+ "ignore": [
+ "test",
+ ".jshintrc",
+ ".travis.yml",
+ ".TO_LOCALE.md",
+ ".gitignore",
+ ".gitmodules",
+ ".npmignore",
+ "benchmark",
+ "dom4",
+ "ie8",
+ "src",
+ "template",
+ "package.json",
+ "index.html",
+ "testrhino.js",
+ "Makefile"
+ ],
+ "homepage": "https://github.com/WebReflection/document-register-element",
+ "version": "0.5.4",
+ "_release": "0.5.4",
+ "_resolution": {
+ "type": "version",
+ "tag": "0.5.4",
+ "commit": "d1d0e80a1c8a0e3f9369280fca834e2cbac2ce6e"
+ },
+ "_source": "https://github.com/WebReflection/document-register-element.git",
+ "_target": "^0.5.4",
+ "_originalSource": "document-register-element",
+ "_direct": true
+}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/document-register-element/LICENSE.txt b/dashboard-ui/bower_components/document-register-element/LICENSE.txt
new file mode 100644
index 0000000000..6cadd51ee5
--- /dev/null
+++ b/dashboard-ui/bower_components/document-register-element/LICENSE.txt
@@ -0,0 +1,19 @@
+Copyright (C) 2014-2015 by WebReflection
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/dashboard-ui/bower_components/document-register-element/RESOURCES.md b/dashboard-ui/bower_components/document-register-element/RESOURCES.md
new file mode 100644
index 0000000000..8cb3d7abb3
--- /dev/null
+++ b/dashboard-ui/bower_components/document-register-element/RESOURCES.md
@@ -0,0 +1,9 @@
+# A list of resources related to Custom Elements and this polyfill
+
+## Demo
+
+ * [Self contained Custom Elements via restyle()](http://webreflection.blogspot.co.uk/2014/08/self-contained-custom-elements-via.html) post and its cross browser [demo](https://webreflection.github.io/custom-element/)
+ * [transform-3d](https://github.com/kentaromiura/transform-3d/) repo and [its demo](http://kentaromiura.github.io/transform-3d/)
+ * comparison against Polymer and demos in [Why Web Components Are Ready For Production](http://developer.telerik.com/featured/web-components-ready-production/)
+ * [W3C Specifications](http://w3c.github.io/webcomponents/spec/custom/)
+ * [HTML5 Rocks Article](http://www.html5rocks.com/en/tutorials/webcomponents/customelements/) except for the Shadow DOM being completely different specification
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/document-register-element/basic.html b/dashboard-ui/bower_components/document-register-element/basic.html
new file mode 100644
index 0000000000..713a029e4c
--- /dev/null
+++ b/dashboard-ui/bower_components/document-register-element/basic.html
@@ -0,0 +1,12 @@
+
+
+
+
testing my-element
+
+
+
+
+
+ some content
+
+
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/document-register-element/bower.json b/dashboard-ui/bower_components/document-register-element/bower.json
new file mode 100644
index 0000000000..231af542c9
--- /dev/null
+++ b/dashboard-ui/bower_components/document-register-element/bower.json
@@ -0,0 +1,23 @@
+{
+ "name": "document-register-element",
+ "description": "A stand-alone working lightweight version of the W3C Custom Elements specification",
+ "main": "./build/document-register-element.js",
+ "ignore": [
+ "test",
+ ".jshintrc",
+ ".travis.yml",
+ ".TO_LOCALE.md",
+ ".gitignore",
+ ".gitmodules",
+ ".npmignore",
+ "benchmark",
+ "dom4",
+ "ie8",
+ "src",
+ "template",
+ "package.json",
+ "index.html",
+ "testrhino.js",
+ "Makefile"
+ ]
+}
diff --git a/dashboard-ui/bower_components/document-register-element/build/document-register-element.js b/dashboard-ui/bower_components/document-register-element/build/document-register-element.js
new file mode 100644
index 0000000000..02fbeaf06c
--- /dev/null
+++ b/dashboard-ui/bower_components/document-register-element/build/document-register-element.js
@@ -0,0 +1,2 @@
+/*! (C) WebReflection Mit Style License */
+(function(e,t,n,r){"use strict";function rt(e,t){for(var n=0,r=e.length;n
>0),s="attached",o="detached",u="extends",a="ADDITION",f="MODIFICATION",l="REMOVAL",c="DOMAttrModified",h="DOMContentLoaded",p="DOMSubtreeModified",d="<",v="=",m=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,g=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],y=[],b=[],w="",E=t.documentElement,S=y.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},x=n.prototype,T=x.hasOwnProperty,N=x.isPrototypeOf,C=n.defineProperty,k=n.getOwnPropertyDescriptor,L=n.getOwnPropertyNames,A=n.getPrototypeOf,O=n.setPrototypeOf,M=!!n.__proto__,_=n.create||function mt(e){return e?(mt.prototype=e,new mt):this},D=O||(M?function(e,t){return e.__proto__=t,e}:L&&k?function(){function e(e,t){for(var n,r=L(t),i=0,s=r.length;i 0;
});
@@ -924,11 +925,11 @@
console.log('Begin connectToServers, with ' + servers.length + ' servers');
- if (servers.length == 1) {
+ if (servers.length === 1) {
return self.connectToServer(servers[0], options).then(function (result) {
- if (result.State == ConnectionState.Unavailable) {
+ if (result.State === ConnectionState.Unavailable) {
result.State = result.ConnectUser == null ?
ConnectionState.ConnectSignIn :
@@ -945,7 +946,7 @@
if (firstServer) {
return self.connectToServer(firstServer, options).then(function (result) {
- if (result.State == ConnectionState.SignedIn) {
+ if (result.State === ConnectionState.SignedIn) {
return result;
@@ -992,9 +993,9 @@
if (server.LastConnectionMode != null) {
//tests.push(server.LastConnectionMode);
}
- if (tests.indexOf(ConnectionMode.Manual) == -1) { tests.push(ConnectionMode.Manual); }
- if (tests.indexOf(ConnectionMode.Local) == -1) { tests.push(ConnectionMode.Local); }
- if (tests.indexOf(ConnectionMode.Remote) == -1) { tests.push(ConnectionMode.Remote); }
+ if (tests.indexOf(ConnectionMode.Manual) === -1) { tests.push(ConnectionMode.Manual); }
+ if (tests.indexOf(ConnectionMode.Local) === -1) { tests.push(ConnectionMode.Local); }
+ if (tests.indexOf(ConnectionMode.Remote) === -1) { tests.push(ConnectionMode.Remote); }
//beginWakeServer(server);
@@ -1007,7 +1008,7 @@
function stringEqualsIgnoreCase(str1, str2) {
- return (str1 || '').toLowerCase() == (str2 || '').toLowerCase();
+ return (str1 || '').toLowerCase() === (str2 || '').toLowerCase();
}
function compareVersions(a, b) {
@@ -1049,7 +1050,7 @@
var skipTest = false;
var timeout = defaultTimeout;
- if (mode == ConnectionMode.Local) {
+ if (mode === ConnectionMode.Local) {
enableRetry = true;
timeout = 8000;
@@ -1060,7 +1061,7 @@
}
}
- else if (mode == ConnectionMode.Manual) {
+ else if (mode === ConnectionMode.Manual) {
if (stringEqualsIgnoreCase(address, server.LocalAddress)) {
enableRetry = true;
@@ -1078,7 +1079,7 @@
tryConnect(address, timeout).then(function (result) {
- if (compareVersions(self.minServerVersion(), result.Version) == 1) {
+ if (compareVersions(self.minServerVersion(), result.Version) === 1) {
console.log('minServerVersion requirement not met. Server version: ' + result.Version);
resolve({
@@ -1086,6 +1087,11 @@
Servers: [server]
});
+ } if (result.Id !== server.Id) {
+
+ // http request succeeded, but it's a different server than what was expected
+ testNextConnectionMode(tests, index + 1, server, options, resolve);
+
} else {
console.log('calling onSuccessfulConnection with connection mode ' + mode + ' with server ' + server.Name);
onSuccessfulConnection(server, result, mode, options, resolve);
@@ -1178,7 +1184,7 @@
result.Servers.push(server);
result.ApiClient.updateServerInfo(server, connectionMode);
- if (result.State == ConnectionState.SignedIn) {
+ if (result.State === ConnectionState.SignedIn) {
afterConnected(result.ApiClient, options);
}
@@ -1197,7 +1203,7 @@
// attempt to correct bad input
address = address.trim();
- if (address.toLowerCase().indexOf('http') != 0) {
+ if (address.toLowerCase().indexOf('http') !== 0) {
address = "http://" + address;
}
@@ -1314,7 +1320,7 @@
reject({ errorCode: 'passwordmatch' });
return;
}
- if (password != passwordConfirm) {
+ if (password !== passwordConfirm) {
reject({ errorCode: 'passwordmatch' });
return;
}
@@ -1406,7 +1412,7 @@
var serverInfo = a.serverInfo();
// We have to keep this hack in here because of the addApiClient method
- return !serverInfo || serverInfo.Id == item;
+ return !serverInfo || serverInfo.Id === item;
})[0];
};
@@ -1443,7 +1449,7 @@
}
var server = credentialProvider.credentials().Servers.filter(function (s) {
- return s.Id == serverId;
+ return s.Id === serverId;
});
server = server.length ? server[0] : null;
@@ -1453,7 +1459,7 @@
var credentials = credentialProvider.credentials();
credentials.Servers = credentials.Servers.filter(function (s) {
- return s.Id != serverId;
+ return s.Id !== serverId;
});
credentialProvider.credentials(credentials);
@@ -1560,7 +1566,7 @@
console.log('getRegistrationInfo has cached info');
- if (regInfo.deviceId == params.deviceId) {
+ if (regInfo.deviceId === params.deviceId) {
console.log('getRegistrationInfo returning cached info');
return Promise.resolve();
}
@@ -1593,17 +1599,17 @@
var status = response.status;
console.log('getRegistrationInfo response: ' + status);
- if (status == 200) {
+ if (status === 200) {
appStorage.setItem(cacheKey, JSON.stringify({
lastValidDate: new Date().getTime(),
deviceId: params.deviceId
}));
return Promise.resolve();
}
- if (status == 401) {
+ if (status === 401) {
return Promise.reject();
}
- if (status == 403) {
+ if (status === 403) {
return Promise.reject('overlimit');
}
diff --git a/dashboard-ui/bower_components/emby-apiclient/credentials.js b/dashboard-ui/bower_components/emby-apiclient/credentials.js
index 35807d3a01..35c37d999c 100644
--- a/dashboard-ui/bower_components/emby-apiclient/credentials.js
+++ b/dashboard-ui/bower_components/emby-apiclient/credentials.js
@@ -1,4 +1,5 @@
define(['events', 'appStorage'], function (events, appStorage) {
+ 'use strict';
return function (key) {
@@ -57,7 +58,7 @@
}
var existing = list.filter(function (s) {
- return s.Id == server.Id;
+ return s.Id === server.Id;
})[0];
if (existing) {
@@ -109,7 +110,7 @@
server.Users = server.Users || [];
var existing = server.Users.filter(function (s) {
- return s.Id == user.Id;
+ return s.Id === user.Id;
})[0];
if (existing) {
diff --git a/dashboard-ui/bower_components/emby-apiclient/events.js b/dashboard-ui/bower_components/emby-apiclient/events.js
index 39ed006f5f..f356da5789 100644
--- a/dashboard-ui/bower_components/emby-apiclient/events.js
+++ b/dashboard-ui/bower_components/emby-apiclient/events.js
@@ -1,4 +1,5 @@
define([], function () {
+ 'use strict';
function getCallbacks(obj, name) {
@@ -32,7 +33,7 @@
var list = getCallbacks(obj, eventName);
var i = list.indexOf(fn);
- if (i != -1) {
+ if (i !== -1) {
list.splice(i, 1);
}
},
diff --git a/dashboard-ui/bower_components/emby-apiclient/fileupload.js b/dashboard-ui/bower_components/emby-apiclient/fileupload.js
index 4007c646b6..2b8db0ddec 100644
--- a/dashboard-ui/bower_components/emby-apiclient/fileupload.js
+++ b/dashboard-ui/bower_components/emby-apiclient/fileupload.js
@@ -1,4 +1,5 @@
define([], function () {
+ 'use strict';
return function () {
diff --git a/dashboard-ui/bower_components/emby-apiclient/localassetmanager.js b/dashboard-ui/bower_components/emby-apiclient/localassetmanager.js
index a365f2f569..4ced1f00cb 100644
--- a/dashboard-ui/bower_components/emby-apiclient/localassetmanager.js
+++ b/dashboard-ui/bower_components/emby-apiclient/localassetmanager.js
@@ -1,4 +1,5 @@
define([], function () {
+ 'use strict';
function getLocalMediaSource(serverId, itemId) {
return Promise.resolve(null);
diff --git a/dashboard-ui/bower_components/emby-apiclient/serverdiscovery-chrome.js b/dashboard-ui/bower_components/emby-apiclient/serverdiscovery-chrome.js
index 019333abdd..5cc54c97d3 100644
--- a/dashboard-ui/bower_components/emby-apiclient/serverdiscovery-chrome.js
+++ b/dashboard-ui/bower_components/emby-apiclient/serverdiscovery-chrome.js
@@ -1,4 +1,5 @@
define([], function () {
+ 'use strict';
function stringToArrayBuffer(string) {
// UTF-16LE
@@ -79,7 +80,7 @@
console.log(info);
- if (info != null && info.socketId == socketId) {
+ if (info != null && info.socketId === socketId) {
var json = arrayBufferToString(info.data);
console.log('Server discovery json: ' + json);
var server = JSON.parse(json);
@@ -119,7 +120,7 @@
console.log('chrome.sockets.udp.bind');
chrome.sockets.udp.bind(createInfo.socketId, '0.0.0.0', 0, function (bindResult) {
- if (getResultCode(bindResult) != 0) {
+ if (getResultCode(bindResult) !== 0) {
console.log('bind fail: ' + bindResult);
return;
}
@@ -130,7 +131,7 @@
chrome.sockets.udp.send(createInfo.socketId, data, '255.255.255.255', port, function (sendResult) {
- if (getResultCode(sendResult) != 0) {
+ if (getResultCode(sendResult) !== 0) {
console.log('send fail: ' + sendResult);
} else {
diff --git a/dashboard-ui/bower_components/emby-apiclient/serverdiscovery-winjs.js b/dashboard-ui/bower_components/emby-apiclient/serverdiscovery-winjs.js
index 06de593f08..93e8bc26c5 100644
--- a/dashboard-ui/bower_components/emby-apiclient/serverdiscovery-winjs.js
+++ b/dashboard-ui/bower_components/emby-apiclient/serverdiscovery-winjs.js
@@ -1,4 +1,5 @@
define([], function () {
+ 'use strict';
function listenerSession(resolve, timeoutMs) {
@@ -78,7 +79,7 @@
var stringLength = eventArguments.getDataReader().unconsumedBufferLength;
var receivedMessage = eventArguments.getDataReader().readString(stringLength);
- if (receivedMessage == stringToSend) {
+ if (receivedMessage === stringToSend) {
return;
}
@@ -97,7 +98,7 @@
servers.push(server);
} catch (exception) {
- onError("Error receiving message: " + receivedMessage);
+ onError("Error receiving message: " + exception);
}
}
diff --git a/dashboard-ui/bower_components/emby-apiclient/serverdiscovery.js b/dashboard-ui/bower_components/emby-apiclient/serverdiscovery.js
index 10c926a16f..5406b102b0 100644
--- a/dashboard-ui/bower_components/emby-apiclient/serverdiscovery.js
+++ b/dashboard-ui/bower_components/emby-apiclient/serverdiscovery.js
@@ -1,4 +1,5 @@
define([], function () {
+ 'use strict';
return {
diff --git a/dashboard-ui/bower_components/emby-apiclient/sync/contentuploader.js b/dashboard-ui/bower_components/emby-apiclient/sync/contentuploader.js
index 90e62e3100..b3c423e93b 100644
--- a/dashboard-ui/bower_components/emby-apiclient/sync/contentuploader.js
+++ b/dashboard-ui/bower_components/emby-apiclient/sync/contentuploader.js
@@ -1,4 +1,5 @@
define(['localassetmanager'], function (localAssetManager) {
+ 'use strict';
return function (connectionManager) {
@@ -43,9 +44,9 @@
return uploadHistory.FilesUploaded.filter(function (u) {
- return getUploadId(file) == u.Id;
+ return getUploadId(file) === u.Id;
- }).length == 0;
+ }).length === 0;
});
}
diff --git a/dashboard-ui/bower_components/emby-apiclient/sync/mediasync.js b/dashboard-ui/bower_components/emby-apiclient/sync/mediasync.js
index 2965084178..bf00460023 100644
--- a/dashboard-ui/bower_components/emby-apiclient/sync/mediasync.js
+++ b/dashboard-ui/bower_components/emby-apiclient/sync/mediasync.js
@@ -1,4 +1,5 @@
define(['localassetmanager'], function (LocalAssetManager) {
+ 'use strict';
return function () {
@@ -248,55 +249,54 @@
// Just for now while media syncing gets worked out
deferred.resolve();
- return;
- var libraryItem = localItem.Item;
+ //var libraryItem = localItem.Item;
- var serverId = libraryItem.ServerId;
- var itemId = null;
- var imageTag = null;
- var imageType = "Primary";
+ //var serverId = libraryItem.ServerId;
+ //var itemId = null;
+ //var imageTag = null;
+ //var imageType = "Primary";
- switch (index) {
+ //switch (index) {
- case 0:
- itemId = libraryItem.Id;
- imageType = "Primary";
- imageTag = (libraryItem.ImageTags || {})["Primary"];
- break;
- case 1:
- itemId = libraryItem.SeriesId;
- imageType = "Primary";
- imageTag = libraryItem.SeriesPrimaryImageTag;
- break;
- case 2:
- itemId = libraryItem.SeriesId;
- imageType = "Thumb";
- imageTag = libraryItem.SeriesPrimaryImageTag;
- break;
- case 3:
- itemId = libraryItem.AlbumId;
- imageType = "Primary";
- imageTag = libraryItem.AlbumPrimaryImageTag;
- break;
- default:
- break;
- }
+ // case 0:
+ // itemId = libraryItem.Id;
+ // imageType = "Primary";
+ // imageTag = (libraryItem.ImageTags || {})["Primary"];
+ // break;
+ // case 1:
+ // itemId = libraryItem.SeriesId;
+ // imageType = "Primary";
+ // imageTag = libraryItem.SeriesPrimaryImageTag;
+ // break;
+ // case 2:
+ // itemId = libraryItem.SeriesId;
+ // imageType = "Thumb";
+ // imageTag = libraryItem.SeriesPrimaryImageTag;
+ // break;
+ // case 3:
+ // itemId = libraryItem.AlbumId;
+ // imageType = "Primary";
+ // imageTag = libraryItem.AlbumPrimaryImageTag;
+ // break;
+ // default:
+ // break;
+ //}
- if (!itemId || !imageTag) {
- getNextImage(index + 1, apiClient, localItem, deferred);
- return;
- }
+ //if (!itemId || !imageTag) {
+ // getNextImage(index + 1, apiClient, localItem, deferred);
+ // return;
+ //}
- downloadImage(apiClient, serverId, itemId, imageTag, imageType).then(function () {
+ //downloadImage(apiClient, serverId, itemId, imageTag, imageType).then(function () {
- // For the sake of simplicity, limit to one image
- deferred.resolve();
- return;
+ // // For the sake of simplicity, limit to one image
+ // deferred.resolve();
+ // return;
- getNextImage(index + 1, apiClient, localItem, deferred);
+ // getNextImage(index + 1, apiClient, localItem, deferred);
- }, getOnFail(deferred));
+ //}, getOnFail(deferred));
}
function downloadImage(apiClient, serverId, itemId, imageTag, imageType) {
@@ -340,7 +340,7 @@
}
var files = jobItem.AdditionalFiles.filter(function (f) {
- return f.Type == 'Subtitles';
+ return f.Type === 'Subtitles';
});
var mediaSource = jobItem.Item.MediaSources[0];
@@ -375,7 +375,7 @@
var deferred = DeferredBuilder.Deferred();
var subtitleStream = mediaSource.MediaStreams.filter(function (m) {
- return m.Type == 'Subtitle' && m.Index == file.Index;
+ return m.Type === 'Subtitle' && m.Index === file.Index;
})[0];
if (!subtitleStream) {
@@ -445,7 +445,7 @@
var userIdsWithAccess = syncDataResult.ItemUserAccess[itemId];
- if (userIdsWithAccess.join(',') == savedUserIdsWithAccess.join(',')) {
+ if (userIdsWithAccess.join(',') === savedUserIdsWithAccess.join(',')) {
// Hasn't changed, nothing to do
deferred.resolve();
}
diff --git a/dashboard-ui/bower_components/emby-apiclient/sync/multiserversync.js b/dashboard-ui/bower_components/emby-apiclient/sync/multiserversync.js
index 9b9975136f..d23a916aa7 100644
--- a/dashboard-ui/bower_components/emby-apiclient/sync/multiserversync.js
+++ b/dashboard-ui/bower_components/emby-apiclient/sync/multiserversync.js
@@ -1,4 +1,5 @@
define(['serversync'], function (ServerSync) {
+ 'use strict';
function syncNext(connectionManager, servers, index, options, resolve, reject) {
diff --git a/dashboard-ui/bower_components/emby-apiclient/sync/offlineusersync.js b/dashboard-ui/bower_components/emby-apiclient/sync/offlineusersync.js
index aebecc3e43..712782b887 100644
--- a/dashboard-ui/bower_components/emby-apiclient/sync/offlineusersync.js
+++ b/dashboard-ui/bower_components/emby-apiclient/sync/offlineusersync.js
@@ -1,4 +1,5 @@
define(['localassetmanager'], function (localAssetManager) {
+ 'use strict';
function syncNext(users, index, resolve, reject, apiClient, server) {
diff --git a/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js b/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js
index e31d8b0760..ea050ec29f 100644
--- a/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js
+++ b/dashboard-ui/bower_components/emby-apiclient/sync/serversync.js
@@ -1,4 +1,5 @@
define([], function () {
+ 'use strict';
return function (connectionManager) {
@@ -20,7 +21,7 @@
return connectionManager.connectToServer(server, connectionOptions).then(function (result) {
- if (result.State == MediaBrowser.ConnectionState.SignedIn) {
+ if (result.State === MediaBrowser.ConnectionState.SignedIn) {
return performSync(server, options);
} else {
console.log('Unable to connect to server id: ' + server.Id);
@@ -42,7 +43,7 @@
var uploadPhotos = options.uploadPhotos !== false;
- if (options.cameraUploadServers && options.cameraUploadServers.indexOf(server.Id) == -1) {
+ if (options.cameraUploadServers && options.cameraUploadServers.indexOf(server.Id) === -1) {
uploadPhotos = false;
}
diff --git a/dashboard-ui/bower_components/emby-apiclient/wakeonlan.js b/dashboard-ui/bower_components/emby-apiclient/wakeonlan.js
index 7897b199e7..b6f3cbd8ab 100644
--- a/dashboard-ui/bower_components/emby-apiclient/wakeonlan.js
+++ b/dashboard-ui/bower_components/emby-apiclient/wakeonlan.js
@@ -1,4 +1,5 @@
define([], function () {
+ 'use strict';
function send(info) {
diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json
index 3041ce57be..9a98379bd3 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json
+++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json
@@ -14,12 +14,12 @@
},
"devDependencies": {},
"ignore": [],
- "version": "1.4.236",
- "_release": "1.4.236",
+ "version": "1.4.299",
+ "_release": "1.4.299",
"_resolution": {
"type": "version",
- "tag": "1.4.236",
- "commit": "d369818012719cb7fd38b052073428631937ae6f"
+ "tag": "1.4.299",
+ "commit": "7e708cf27aa74f7f0d0aaa30d95d3e1f09b71ce3"
},
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1",
diff --git a/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.css b/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.css
index d2ab1dd2f9..3149ba5da3 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.css
+++ b/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.css
@@ -4,10 +4,21 @@
padding: 0;
border: none;
max-height: 84%;
+ border-radius: 1px !important;
+ color: #fff;
+}
+
+.actionsheet-not-fullscreen {
+ background-color: #2a2a2a;
+}
+
+.actionSheetMenuItem:hover {
+ background-color: #333;
}
.actionsheet-fullscreen {
max-height: none;
+ border-radius: 0 !important;
}
.actionSheetContent-centered {
@@ -35,6 +46,8 @@
font-weight: inherit;
align-items: center;
flex-shrink: 0;
+ background: transparent;
+ box-shadow: none;
}
.actionSheetMenuItem-noflex {
@@ -94,4 +107,4 @@
position: fixed;
top: .75em;
left: .5em;
-}
\ No newline at end of file
+}
diff --git a/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js b/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js
index a49f3e5db7..fd06b26f59 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js
+++ b/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js
@@ -1,4 +1,5 @@
define(['dialogHelper', 'layoutManager', 'globalize', 'browser', 'dom', 'emby-button', 'css!./actionsheet', 'material-icons', 'scrollStyles'], function (dialogHelper, layoutManager, globalize, browser, dom) {
+ 'use strict';
function getOffsets(elems) {
@@ -25,7 +26,9 @@
results[i] = {
top: box.top,
- left: box.left
+ left: box.left,
+ width: box.width,
+ height: box.height
};
}
@@ -44,11 +47,11 @@
var pos = getOffsets([options.positionTo])[0];
- if (options.positionY != 'top') {
- pos.top += options.positionTo.offsetHeight / 2;
+ if (options.positionY !== 'top') {
+ pos.top += (pos.height || 0) / 2;
}
- pos.left += options.positionTo.offsetWidth / 2;
+ pos.left += (pos.width || 0) / 2;
var height = dlg.offsetHeight || 300;
var width = dlg.offsetWidth || 160;
@@ -119,6 +122,8 @@
if (isFullscreen) {
dlg.classList.add('actionsheet-fullscreen');
+ } else {
+ dlg.classList.add('actionsheet-not-fullscreen');
}
var extraSpacing = !layoutManager.tv;
diff --git a/dashboard-ui/bower_components/emby-webcomponents/alert/alert.js b/dashboard-ui/bower_components/emby-webcomponents/alert/alert.js
index 8bbfd86f4b..83090c8d45 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/alert/alert.js
+++ b/dashboard-ui/bower_components/emby-webcomponents/alert/alert.js
@@ -1,4 +1,5 @@
define(['dialog', 'globalize'], function (dialog, globalize) {
+ 'use strict';
return function (text, title) {
@@ -15,7 +16,7 @@ define(['dialog', 'globalize'], function (dialog, globalize) {
var items = [];
items.push({
- name: globalize.translate('sharedcomponents#ButtonOk'),
+ name: globalize.translate('sharedcomponents#ButtonGotIt'),
id: 'ok',
type: 'submit'
});
@@ -23,7 +24,7 @@ define(['dialog', 'globalize'], function (dialog, globalize) {
options.buttons = items;
return dialog(options).then(function (result) {
- if (result == 'ok') {
+ if (result === 'ok') {
return Promise.resolve();
}
diff --git a/dashboard-ui/bower_components/emby-webcomponents/alert/nativealert.js b/dashboard-ui/bower_components/emby-webcomponents/alert/nativealert.js
index 271638f029..f565e802c7 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/alert/nativealert.js
+++ b/dashboard-ui/bower_components/emby-webcomponents/alert/nativealert.js
@@ -1,4 +1,5 @@
define([], function () {
+ 'use strict';
function replaceAll(str, find, replace) {
diff --git a/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js b/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js
index 2404dab5c7..5ba87cb3dd 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js
+++ b/dashboard-ui/bower_components/emby-webcomponents/alphapicker/alphapicker.js
@@ -1,14 +1,16 @@
define(['focusManager', 'css!./style.css', 'paper-icon-button-light', 'material-icons'], function (focusManager) {
+ 'use strict';
var selectedButtonClass = 'alphaPickerButton-selected';
function focus() {
- var selected = this.querySelector('.' + selectedButtonClass);
+ var scope = this;
+ var selected = scope.querySelector('.' + selectedButtonClass);
if (selected) {
focusManager.focus(selected);
} else {
- focusManager.autoFocus(this, true);
+ focusManager.autoFocus(scope, true);
}
}
@@ -25,11 +27,9 @@ define(['focusManager', 'css!./style.css', 'paper-icon-button-light', 'material-
var letters;
html += '';
- if (options.mode == 'keyboard') {
+ if (options.mode === 'keyboard') {
// space_bar icon
- html += '';
+ html += '';
} else {
letters = ['#'];
html += letters.map(getLetterButton).join('');
@@ -38,11 +38,9 @@ define(['focusManager', 'css!./style.css', 'paper-icon-button-light', 'material-
letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
html += letters.map(getLetterButton).join('');
- if (options.mode == 'keyboard') {
+ if (options.mode === 'keyboard') {
// backspace icon
- html += '';
+ html += '';
html += '
';
letters = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
@@ -60,7 +58,7 @@ define(['focusManager', 'css!./style.css', 'paper-icon-button-light', 'material-
element.focus = focus;
}
- function alphaPicker(options) {
+ function AlphaPicker(options) {
var self = this;
@@ -83,7 +81,7 @@ define(['focusManager', 'css!./style.css', 'paper-icon-button-light', 'material-
alphaFocusTimeout = null;
- if (document.activeElement == alphaFocusedElement) {
+ if (document.activeElement === alphaFocusedElement) {
var value = alphaFocusedElement.getAttribute('data-value');
self.value(value, true);
}
@@ -125,7 +123,7 @@ define(['focusManager', 'css!./style.css', 'paper-icon-button-light', 'material-
if (alphaPickerButton) {
var value = alphaPickerButton.getAttribute('data-value');
- if (currentValue == value.toUpperCase()) {
+ if (currentValue === value.toUpperCase()) {
self.value(null, true);
} else {
self.value(value, true);
@@ -173,7 +171,7 @@ define(['focusManager', 'css!./style.css', 'paper-icon-button-light', 'material-
itemsContainer.addEventListener('focus', onItemsFocusIn, true);
}
- if (options.mode == 'keyboard') {
+ if (options.mode === 'keyboard') {
element.addEventListener('click', onAlphaPickerInKeyboardModeClick);
}
@@ -225,14 +223,14 @@ define(['focusManager', 'css!./style.css', 'paper-icon-button-light', 'material-
value = value.toUpperCase();
currentValue = value;
- if (options.mode != 'keyboard') {
+ if (options.mode !== 'keyboard') {
selected = element.querySelector('.' + selectedButtonClass);
btn = element.querySelector('.alphaPickerButton[data-value=\'' + value + '\']');
- if (btn && btn != selected) {
+ if (btn && btn !== selected) {
btn.classList.add(selectedButtonClass);
}
- if (selected && selected != btn) {
+ if (selected && selected !== btn) {
selected.classList.remove(selectedButtonClass);
}
}
@@ -281,5 +279,5 @@ define(['focusManager', 'css!./style.css', 'paper-icon-button-light', 'material-
self.visible(true);
}
- return alphaPicker;
+ return AlphaPicker;
});
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/emby-webcomponents/appsettings.js b/dashboard-ui/bower_components/emby-webcomponents/appsettings.js
index 8d331b9e4d..06b4a79ccd 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/appsettings.js
+++ b/dashboard-ui/bower_components/emby-webcomponents/appsettings.js
@@ -1,4 +1,5 @@
define(['appStorage', 'events'], function (appStorage, events) {
+ 'use strict';
function getKey(name, userId) {
@@ -9,7 +10,7 @@ define(['appStorage', 'events'], function (appStorage, events) {
return name;
}
- return new function () {
+ function AppSettings() {
var self = this;
@@ -19,7 +20,7 @@ define(['appStorage', 'events'], function (appStorage, events) {
self.set('enableAutoLogin', val.toString());
}
- return self.get('enableAutoLogin') != 'false';
+ return self.get('enableAutoLogin') !== 'false';
};
self.enableAutomaticBitrateDetection = function (val) {
@@ -28,7 +29,7 @@ define(['appStorage', 'events'], function (appStorage, events) {
self.set('enableAutomaticBitrateDetection', val.toString());
}
- return self.get('enableAutomaticBitrateDetection') != 'false';
+ return self.get('enableAutomaticBitrateDetection') !== 'false';
};
self.maxStreamingBitrate = function (val) {
@@ -66,7 +67,7 @@ define(['appStorage', 'events'], function (appStorage, events) {
self.set('syncOnlyOnWifi', val.toString());
}
- return self.get('syncOnlyOnWifi') != 'false';
+ return self.get('syncOnlyOnWifi') !== 'false';
};
self.syncPath = function (val) {
@@ -99,7 +100,7 @@ define(['appStorage', 'events'], function (appStorage, events) {
appStorage.setItem(getKey(name, userId), value);
- if (currentValue != value) {
+ if (currentValue !== value) {
events.trigger(self, 'change', [name]);
}
};
@@ -108,5 +109,7 @@ define(['appStorage', 'events'], function (appStorage, events) {
return appStorage.getItem(getKey(name, userId));
};
- }();
+ }
+
+ return new AppSettings();
});
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/emby-webcomponents/backdrop/backdrop.js b/dashboard-ui/bower_components/emby-webcomponents/backdrop/backdrop.js
index 864c1144ca..9c7725b26a 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/backdrop/backdrop.js
+++ b/dashboard-ui/bower_components/emby-webcomponents/backdrop/backdrop.js
@@ -1,4 +1,5 @@
define(['browser', 'connectionManager', 'playbackManager', 'dom', 'css!./style'], function (browser, connectionManager, playbackManager, dom) {
+ 'use strict';
function enableAnimation(elem) {
@@ -18,7 +19,7 @@
return true;
}
- function backdrop() {
+ function Backdrop() {
var self = this;
var isDestroyed;
@@ -52,7 +53,7 @@
currentAnimation = animation;
animation.onfinish = function () {
- if (animation == currentAnimation) {
+ if (animation === currentAnimation) {
currentAnimation = null;
}
if (existingBackdropImage && existingBackdropImage.parentNode) {
@@ -166,14 +167,14 @@
var elem = getBackdropContainer();
var existingBackdropImage = elem.querySelector('.displayingBackdropImage');
- if (existingBackdropImage && existingBackdropImage.getAttribute('data-url') == url) {
- if (existingBackdropImage.getAttribute('data-url') == url) {
+ if (existingBackdropImage && existingBackdropImage.getAttribute('data-url') === url) {
+ if (existingBackdropImage.getAttribute('data-url') === url) {
return;
}
existingBackdropImage.classList.remove('displayingBackdropImage');
}
- var instance = new backdrop();
+ var instance = new Backdrop();
instance.load(url, elem, existingBackdropImage);
currentLoadingBackdrop = instance;
}
@@ -215,28 +216,38 @@
var list = [];
+ var onImg = function (img) {
+ list.push(img);
+ };
+
for (var i = 0, length = items.length; i < length; i++) {
var itemImages = getItemImageUrls(items[i]);
- itemImages.forEach(function (img) {
- list.push(img);
- });
+ itemImages.forEach(onImg);
}
return list;
}
function arraysEqual(a, b) {
- if (a === b) return true;
- if (a == null || b == null) return false;
- if (a.length != b.length) return false;
+ if (a === b) {
+ return true;
+ }
+ if (a == null || b == null) {
+ return false;
+ }
+ if (a.length !== b.length) {
+ return false;
+ }
// If you don't care about the order of the elements inside
// the array, you should sort both arrays here.
for (var i = 0; i < a.length; ++i) {
- if (a[i] !== b[i]) return false;
+ if (a[i] !== b[i]) {
+ return false;
+ }
}
return true;
}
diff --git a/dashboard-ui/bower_components/emby-webcomponents/browser.js b/dashboard-ui/bower_components/emby-webcomponents/browser.js
index b4e05c5a43..8f4fb0d54d 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/browser.js
+++ b/dashboard-ui/bower_components/emby-webcomponents/browser.js
@@ -1,27 +1,28 @@
define([], function () {
+ 'use strict';
function isTv() {
// This is going to be really difficult to get right
var userAgent = navigator.userAgent.toLowerCase();
- if (userAgent.indexOf('tv') != -1) {
+ if (userAgent.indexOf('tv') !== -1) {
return true;
}
- if (userAgent.indexOf('samsungbrowser') != -1) {
+ if (userAgent.indexOf('samsungbrowser') !== -1) {
return true;
}
- if (userAgent.indexOf('nintendo') != -1) {
+ if (userAgent.indexOf('nintendo') !== -1) {
return true;
}
- if (userAgent.indexOf('viera') != -1) {
+ if (userAgent.indexOf('viera') !== -1) {
return true;
}
- if (userAgent.indexOf('webos') != -1) {
+ if (userAgent.indexOf('webos') !== -1) {
return true;
}
@@ -45,7 +46,7 @@
var lower = userAgent.toLowerCase();
for (var i = 0, length = terms.length; i < length; i++) {
- if (lower.indexOf(terms[i]) != -1) {
+ if (lower.indexOf(terms[i]) !== -1) {
return true;
}
}
@@ -87,6 +88,34 @@
}
}
+ function hasKeyboard(browser) {
+
+ if (browser.touch) {
+ return true;
+ }
+
+ if (browser.xboxOne) {
+ return true;
+ }
+
+ if (browser.ps4) {
+ return true;
+ }
+
+ if (browser.edgeUwp) {
+ // This is OK for now, but this won't always be true
+ // Should we use this?
+ // https://gist.github.com/wagonli/40d8a31bd0d6f0dd7a5d
+ return true;
+ }
+
+ if (browser.tv) {
+ return true;
+ }
+
+ return false;
+ }
+
var uaMatch = function (ua) {
ua = ua.toLowerCase();
@@ -100,6 +129,8 @@
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
+ var versionMatch = /(version)[ \/]([\w.]+)/.exec(ua);
+
var platform_match = /(ipad)/.exec(ua) ||
/(iphone)/.exec(ua) ||
/(android)/.exec(ua) ||
@@ -107,27 +138,41 @@
var browser = match[1] || "";
- if (browser == "edge") {
+ if (browser === "edge") {
platform_match = [""];
} else {
- if (ua.indexOf("windows phone") != -1 || ua.indexOf("iemobile") != -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) {
+ 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') {
+ if (browser === 'opr') {
browser = 'opera';
}
+ var version;
+ if (versionMatch && versionMatch.length > 2) {
+ version = versionMatch[2];
+ }
+
+ version = version || match[2] || "0";
+
+ var versionMajor = parseInt(version.split('.')[0]);
+
+ if (isNaN(versionMajor)) {
+ versionMajor = 0;
+ }
+
return {
browser: browser,
- version: match[2] || "0",
- platform: platform_match[0] || ""
+ version: version,
+ platform: platform_match[0] || "",
+ versionMajor: versionMajor
};
};
@@ -138,17 +183,18 @@
if (matched.browser) {
browser[matched.browser] = true;
browser.version = matched.version;
+ browser.versionMajor = matched.versionMajor;
}
if (matched.platform) {
browser[matched.platform] = true;
}
- if (!browser.chrome && !browser.msie && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf("webkit") != -1) {
+ if (!browser.chrome && !browser.msie && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf("webkit") !== -1) {
browser.safari = true;
}
- if (userAgent.toLowerCase().indexOf("playstation 4") != -1) {
+ if (userAgent.toLowerCase().indexOf("playstation 4") !== -1) {
browser.ps4 = true;
browser.tv = true;
}
@@ -157,14 +203,14 @@
browser.mobile = true;
}
- browser.xboxOne = userAgent.toLowerCase().indexOf('xbox') != -1;
+ browser.xboxOne = userAgent.toLowerCase().indexOf('xbox') !== -1;
browser.animate = document.documentElement.animate != null;
- browser.tizen = userAgent.toLowerCase().indexOf('tizen') != -1 || userAgent.toLowerCase().indexOf('smarthub') != -1;
- browser.web0s = userAgent.toLowerCase().indexOf('Web0S'.toLowerCase()) != -1;
- browser.edgeUwp = browser.edge && userAgent.toLowerCase().indexOf('msapphost') != -1;
+ browser.tizen = userAgent.toLowerCase().indexOf('tizen') !== -1 || userAgent.toLowerCase().indexOf('smarthub') !== -1;
+ browser.web0s = userAgent.toLowerCase().indexOf('Web0S'.toLowerCase()) !== -1;
+ browser.edgeUwp = browser.edge && userAgent.toLowerCase().indexOf('msapphost') !== -1;
browser.tv = isTv();
- browser.operaTv = browser.tv && userAgent.toLowerCase().indexOf('opr/') != -1;
+ browser.operaTv = browser.tv && userAgent.toLowerCase().indexOf('opr/') !== -1;
if (!isStyleSupported('display', 'flex')) {
browser.noFlex = true;
@@ -178,5 +224,7 @@
browser.touch = true;
}
+ browser.keyboard = hasKeyboard(browser);
+
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
index 1c9e04b45e..06a6b5a03b 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js
+++ b/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js
@@ -1,4 +1,5 @@
define(['browser'], function (browser) {
+ 'use strict';
function canPlayH264() {
var v = document.createElement('video');
@@ -46,7 +47,7 @@ define(['browser'], function (browser) {
}
function canPlayHlsWithMSE() {
- if (window.MediaSource != null && !browser.firefox) {
+ if (window.MediaSource != null) {
// text tracks don’t work with this in firefox
return true;
}
@@ -58,7 +59,7 @@ define(['browser'], function (browser) {
var typeString;
- if (format == 'flac') {
+ if (format === 'flac') {
if (browser.tizen) {
return true;
}
@@ -67,7 +68,7 @@ define(['browser'], function (browser) {
}
}
- else if (format == 'wma') {
+ else if (format === 'wma') {
if (browser.tizen) {
return true;
}
@@ -76,7 +77,7 @@ define(['browser'], function (browser) {
}
}
- else if (format == 'opus') {
+ else if (format === 'opus') {
typeString = 'audio/ogg; codecs="opus"';
if (document.createElement('audio').canPlayType(typeString).replace(/no/, '')) {
@@ -86,7 +87,7 @@ define(['browser'], function (browser) {
return false;
}
- if (format == 'webma') {
+ if (format === 'webma') {
typeString = 'audio/webm';
} else {
typeString = 'audio/' + format;
@@ -117,7 +118,7 @@ define(['browser'], function (browser) {
}
// Filter out browsers based on chromium that don't support mkv
- if (userAgent.indexOf('vivaldi') != -1 || userAgent.indexOf('opera') != -1) {
+ if (userAgent.indexOf('vivaldi') !== -1 || userAgent.indexOf('opera') !== -1) {
return false;
}
@@ -138,13 +139,14 @@ define(['browser'], function (browser) {
function testCanPlayTs() {
- return browser.tizen || browser.web0s;
+ return browser.tizen || browser.web0s || browser.edgeUwp;
}
function getDirectPlayProfileForVideoContainer(container, videoAudioCodecs) {
var supported = false;
var profileContainer = container;
+ var videoCodecs = [];
switch (container) {
@@ -153,7 +155,7 @@ define(['browser'], function (browser) {
videoAudioCodecs = [];
break;
case 'avi':
- supported = browser.edgeUwp;
+ supported = browser.tizen || browser.edgeUwp;
break;
case 'mpg':
case 'mpeg':
@@ -169,16 +171,19 @@ define(['browser'], function (browser) {
break;
case 'mov':
supported = browser.chrome || browser.edgeUwp;
+ videoCodecs.push('h264');
break;
case 'm2ts':
supported = browser.tizen || browser.web0s || browser.edgeUwp;
+ videoCodecs.push('h264');
break;
case 'wmv':
supported = browser.tizen || browser.web0s || browser.edgeUwp;
videoAudioCodecs = [];
break;
case 'ts':
- supported = browser.tizen || browser.web0s || browser.edgeUwp;
+ supported = testCanPlayTs();
+ videoCodecs.push('h264');
profileContainer = 'ts,mpegts';
break;
default:
@@ -192,6 +197,7 @@ define(['browser'], function (browser) {
return {
Container: profileContainer,
Type: 'Video',
+ VideoCodec: videoCodecs.join(','),
AudioCodec: videoAudioCodecs.join(',')
};
}
@@ -199,7 +205,7 @@ define(['browser'], function (browser) {
function getMaxBitrate() {
if (browser.edgeUwp) {
- return 15000000;
+ return 30000000;
}
// 10mbps
@@ -216,7 +222,7 @@ define(['browser'], function (browser) {
if (browser.tizen) {
// 2015 models
- if (userAgent.indexOf('tizen 2.3') != -1) {
+ if (userAgent.indexOf('tizen 2.3') !== -1) {
return 20000000;
}
@@ -239,7 +245,6 @@ define(['browser'], function (browser) {
var canPlayWebm = videoTestElement.canPlayType('video/webm').replace(/no/, '');
var canPlayMkv = testCanPlayMkv(videoTestElement);
- var canPlayTs = testCanPlayTs();
var profile = {};
@@ -269,19 +274,20 @@ define(['browser'], function (browser) {
}
var mp3Added = false;
- if (canPlayMkv || canPlayTs) {
+ if (canPlayMkv) {
if (supportsMp3VideoAudio) {
mp3Added = true;
videoAudioCodecs.push('mp3');
- hlsVideoAudioCodecs.push('mp3');
}
}
if (videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.40.2"').replace(/no/, '')) {
videoAudioCodecs.push('aac');
hlsVideoAudioCodecs.push('aac');
}
- if (!mp3Added && supportsMp3VideoAudio) {
- videoAudioCodecs.push('mp3');
+ if (supportsMp3VideoAudio) {
+ if (!mp3Added) {
+ videoAudioCodecs.push('mp3');
+ }
hlsVideoAudioCodecs.push('mp3');
}
@@ -342,12 +348,12 @@ define(['browser'], function (browser) {
['opus', 'mp3', 'aac', 'flac', 'webma', 'wma', 'wav'].filter(canPlayAudioFormat).forEach(function (audioFormat) {
profile.DirectPlayProfiles.push({
- Container: audioFormat == 'webma' ? 'webma,webm' : audioFormat,
+ Container: audioFormat === 'webma' ? 'webma,webm' : audioFormat,
Type: 'Audio'
});
// aac also appears in the m4a container
- if (audioFormat == 'aac') {
+ if (audioFormat === 'aac') {
profile.DirectPlayProfiles.push({
Container: 'm4a',
AudioCodec: audioFormat,
@@ -389,7 +395,7 @@ define(['browser'], function (browser) {
}
// 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 && options.supportsCustomSeeking && !browser.tizen) {
+ if (canPlayMkv && options.supportsCustomSeeking && !browser.tizen && options.enableMkvProgressive !== false) {
profile.TranscodingProfiles.push({
Container: 'mkv',
Type: 'Video',
@@ -400,28 +406,15 @@ define(['browser'], function (browser) {
});
}
- if (canPlayTs && options.supportsCustomSeeking && !browser.tizen && !browser.web0s) {
- profile.TranscodingProfiles.push({
- Container: 'ts',
- Type: 'Video',
- AudioCodec: videoAudioCodecs.join(','),
- VideoCodec: 'h264',
- Context: 'Streaming',
- CopyTimestamps: copyTimestamps,
- // If audio transcoding is needed, limit channels to number of physical audio channels
- // Trying to transcode to 5 channels when there are only 2 speakers generally does not sound good
- MaxAudioChannels: physicalAudioChannels.toString()
- });
- }
-
- if (canPlayHls()) {
+ if (canPlayHls() && options.enableHls !== false) {
profile.TranscodingProfiles.push({
Container: 'ts',
Type: 'Video',
AudioCodec: hlsVideoAudioCodecs.join(','),
VideoCodec: 'h264',
Context: 'Streaming',
- Protocol: 'hls'
+ Protocol: 'hls',
+ MaxAudioChannels: physicalAudioChannels.toString()
});
}
@@ -565,6 +558,15 @@ define(['browser'], function (browser) {
}]
});
+ if (!browser.edgeUwp && !browser.tizen && !browser.web0s) {
+ profile.CodecProfiles[profile.CodecProfiles.length - 1].Conditions.push({
+ Condition: 'NotEquals',
+ Property: 'IsAVC',
+ Value: 'false',
+ IsRequired: false
+ });
+ }
+
profile.CodecProfiles.push({
Type: 'Video',
Codec: 'vpx',
diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css
index 9523c94d0b..e2356586b4 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css
+++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css
@@ -1,3 +1,12 @@
+button::-moz-focus-inner {
+ padding: 0;
+ border: 0;
+}
+
+button {
+ -webkit-border-fit: border !important;
+}
+
.card {
border: 0;
font-size: inherit !important;
@@ -82,10 +91,14 @@
transform: scale(1.16, 1.16);
}
+.cardBox-mobile {
+ margin: 1px;
+}
+
@media all and (min-width: 600px) {
.cardBox-mobile {
- margin: 3px;
+ margin: 2px;
}
}
@@ -147,7 +160,7 @@
.cardImageContainer {
/* Should be 0 with visualCardBox, but not really noticeable */
- border-radius: 2px;
+ border-radius: 1px;
}
}
@@ -179,6 +192,8 @@
bottom: 0;
/* Needed in case this is a button */
display: block;
+ /* Needed in safari */
+ height: 100%;
}
.cardImage {
@@ -192,6 +207,23 @@
background-position: center bottom;
}
+.cardImage-img {
+ max-height: 100%;
+ max-width: 100%;
+ /* This is simply for lazy image purposes, to ensure the image is visible sooner when scrolling */
+ min-height: 70%;
+ min-width: 70%;
+ align-self: flex-end;
+ position: static;
+}
+
+.coveredImage-img {
+ max-height: none;
+ max-width: none;
+ height: 100%;
+ width: 100%;
+}
+
.coveredImage {
background-size: 100% 100%;
background-position: center center;
@@ -211,12 +243,8 @@
}
.visualCardBox-cardFooter {
- border-bottom-left-radius: 2px;
- border-bottom-right-radius: 2px;
- -moz-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
- -ms-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
- -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+ border-bottom-left-radius: 1px;
+ border-bottom-right-radius: 1px;
}
.innerCardFooter {
@@ -245,6 +273,11 @@
overflow: hidden;
text-overflow: ellipsis;
color: inherit;
+ text-align: left;
+}
+
+.singleCardText {
+ padding: .5em;
}
.cardTextCentered {
@@ -259,8 +292,9 @@
margin-right: 2em;
}
-.cardCenteredText {
+.cardDefaultText {
white-space: normal;
+ text-align: center;
}
.textActionButton {
@@ -315,15 +349,21 @@
.cardOverlayButton {
color: #fff !important;
- background-color: rgba(0,0,0,.7) !important;
+ background-color: rgba(0,0,0,.8) !important;
border-radius: 500px;
position: absolute;
bottom: 0;
right: 0;
margin: 0 .35em .5em 0;
z-index: 1;
+ /*opacity: 0;
+ transition: opacity 0.5s ease-in; /* vendorless fallback */ */;
}
+ /*.card:hover .cardOverlayButton {
+ opacity: 1;
+}*/
+
.cardOverlayButton:hover {
background-color: rgba(0,0,0,.9) !important;
transition: background-color .5s ease-out;
@@ -375,7 +415,7 @@
}
.overflowBackdropCard-scalable {
- width: 84%;
+ width: 80%;
max-width: 400px;
}
@@ -514,7 +554,6 @@
}
}
-
@media all and (min-width: 1600px) {
.portraitCard-scalable {
@@ -524,12 +563,27 @@
.smallBackdropCard-scalable {
width: 12.5%;
}
+
+ .backdropCard-scalable {
+ width: 20%;
+ }
+
+ .squareCard-scalable {
+ width: 12.5%;
+ }
}
@media all and (min-width: 1800px) {
+ .smallBackdropCard-scalable {
+ width: 10%;
+ }
+}
+
+@media all and (min-width: 1920px) {
+
.squareCard-scalable {
- width: 12.5%;
+ width: 11.111111111111111111111111111111%;
}
.smallBackdropCard-scalable {
@@ -539,10 +593,6 @@
@media all and (min-width: 2100px) {
- .squareCard-scalable {
- width: 11.111111111111111111111111111111%;
- }
-
.backdropCard-scalable {
width: 20%;
}
@@ -582,6 +632,10 @@
width: 16.66666666666666667%;
}
-.layout-tv .personCard-scalable {
- width: 14.285714285714285714285714285714%;
+
+@media all and (min-width: 1600px) {
+
+ .layout-tv .backdropCard-scalable {
+ width: 25%;
+ }
}
diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js
index 86e6ffa371..5f1293615d 100644
--- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js
+++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js
@@ -1,5 +1,6 @@
define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo', 'focusManager', 'indicators', 'globalize', 'layoutManager', 'apphost', 'dom', 'emby-button', 'css!./card', 'paper-icon-button-light', 'clearButtonStyle'],
function (datetime, imageLoader, connectionManager, itemHelper, mediaInfo, focusManager, indicators, globalize, layoutManager, appHost, dom) {
+ 'use strict';
// Regular Expressions for parsing tags and attributes
var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
@@ -32,7 +33,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var apiClient = connectionManager.currentApiClient();
- if (arguments.length == 1) {
+ if (arguments.length === 1) {
options = arguments[0];
items = options.items;
@@ -48,54 +49,122 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
switch (shape) {
case 'portrait':
- if (screenWidth >= 2200) return 10;
- if (screenWidth >= 2100) return 9;
- if (screenWidth >= 1600) return 8;
- if (screenWidth >= 1400) return 7;
- if (screenWidth >= 1200) return 6;
- if (screenWidth >= 800) return 5;
- if (screenWidth >= 640) return 4;
+ if (screenWidth >= 2200) {
+ return 10;
+ }
+ if (screenWidth >= 2100) {
+ return 9;
+ }
+ if (screenWidth >= 1600) {
+ return 8;
+ }
+ if (screenWidth >= 1400) {
+ return 7;
+ }
+ if (screenWidth >= 1200) {
+ return 6;
+ }
+ if (screenWidth >= 800) {
+ return 5;
+ }
+ if (screenWidth >= 640) {
+ return 4;
+ }
return 3;
case 'square':
- if (screenWidth >= 2100) return 9;
- if (screenWidth >= 1800) return 8;
- if (screenWidth >= 1400) return 7;
- if (screenWidth >= 1200) return 6;
- if (screenWidth >= 900) return 5;
- if (screenWidth >= 700) return 4;
- if (screenWidth >= 500) return 3;
+ if (screenWidth >= 2100) {
+ return 9;
+ }
+ if (screenWidth >= 1800) {
+ return 8;
+ }
+ if (screenWidth >= 1400) {
+ return 7;
+ }
+ if (screenWidth >= 1200) {
+ return 6;
+ }
+ if (screenWidth >= 900) {
+ return 5;
+ }
+ if (screenWidth >= 700) {
+ return 4;
+ }
+ if (screenWidth >= 500) {
+ return 3;
+ }
return 2;
case 'banner':
- if (screenWidth >= 2200) return 4;
- if (screenWidth >= 1200) return 3;
- if (screenWidth >= 800) return 2;
+ if (screenWidth >= 2200) {
+ return 4;
+ }
+ if (screenWidth >= 1200) {
+ return 3;
+ }
+ if (screenWidth >= 800) {
+ return 2;
+ }
return 1;
case 'backdrop':
- if (screenWidth >= 2500) return 6;
- if (screenWidth >= 2100) return 5;
- if (screenWidth >= 1200) return 4;
- if (screenWidth >= 770) return 3;
- if (screenWidth >= 420) return 2;
+ if (screenWidth >= 2500) {
+ return 6;
+ }
+ if (screenWidth >= 1600) {
+ return 5;
+ }
+ if (screenWidth >= 1200) {
+ return 4;
+ }
+ if (screenWidth >= 770) {
+ return 3;
+ }
+ if (screenWidth >= 420) {
+ return 2;
+ }
return 1;
case 'smallBackdrop':
- if (screenWidth >= 1440) return 8;
- if (screenWidth >= 1100) return 6;
- if (screenWidth >= 800) return 5;
- if (screenWidth >= 600) return 4;
- if (screenWidth >= 540) return 3;
- if (screenWidth >= 420) return 2;
+ if (screenWidth >= 1440) {
+ return 8;
+ }
+ if (screenWidth >= 1100) {
+ return 6;
+ }
+ if (screenWidth >= 800) {
+ return 5;
+ }
+ if (screenWidth >= 600) {
+ return 4;
+ }
+ if (screenWidth >= 540) {
+ return 3;
+ }
+ if (screenWidth >= 420) {
+ return 2;
+ }
return 1;
case 'overflowPortrait':
- if (screenWidth >= 1000) return 100 / 23;
- if (screenWidth >= 640) return 100 / 36;
+ if (screenWidth >= 1000) {
+ return 100 / 23;
+ }
+ if (screenWidth >= 640) {
+ return 100 / 36;
+ }
return 2.5;
case 'overflowSquare':
- if (screenWidth >= 1000) return 100 / 22;
- if (screenWidth >= 640) return 100 / 30;
+ if (screenWidth >= 1000) {
+ return 100 / 22;
+ }
+ if (screenWidth >= 640) {
+ return 100 / 30;
+ }
return 100 / 42;
case 'overflowBackdrop':
- if (screenWidth >= 1000) return 100 / 40;
- if (screenWidth >= 640) return 100 / 60;
+ if (screenWidth >= 1000) {
+ return 100 / 40;
+ }
+ if (screenWidth >= 640) {
+ return 100 / 60;
+ }
return 100 / 84;
default:
return 4;
@@ -122,7 +191,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
if (isResizable(screenWidth)) {
var roundScreenTo = 100;
- screenWidth = Math.ceil(screenWidth / roundScreenTo) * roundScreenTo;
+ screenWidth = Math.floor(screenWidth / roundScreenTo) * roundScreenTo;
}
if (window.screen) {
@@ -142,27 +211,31 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var primaryImageAspectRatio = imageLoader.getPrimaryImageAspectRatio(items);
- var isThumbAspectRatio = primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1.777777778) < .3;
- var isSquareAspectRatio = primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1) < .33 ||
- primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1.3333334) < .01;
+ var isThumbAspectRatio = primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1.777777778) < 0.3;
+ var isSquareAspectRatio = primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1) < 0.33 ||
+ primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1.3333334) < 0.01;
- if (options.shape == 'auto' || options.shape == 'autohome' || options.shape == 'autooverflow' || options.shape == 'autoVertical') {
+ if (options.shape === 'auto' || options.shape === 'autohome' || options.shape === 'autooverflow' || options.shape === 'autoVertical') {
- if (options.preferThumb || isThumbAspectRatio) {
- options.shape = options.shape == 'autooverflow' ? 'overflowBackdrop' : 'backdrop';
+ if (options.preferThumb === true || isThumbAspectRatio) {
+ options.shape = options.shape === 'autooverflow' ? 'overflowBackdrop' : 'backdrop';
} else if (isSquareAspectRatio) {
options.coverImage = true;
- options.shape = options.shape == 'autooverflow' ? 'overflowSquare' : 'square';
+ options.shape = options.shape === 'autooverflow' ? 'overflowSquare' : 'square';
} else if (primaryImageAspectRatio && primaryImageAspectRatio > 1.9) {
options.shape = 'banner';
options.coverImage = true;
- } else if (primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 0.6666667) < .2) {
- options.shape = options.shape == 'autooverflow' ? 'overflowPortrait' : 'portrait';
+ } else if (primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 0.6666667) < 0.2) {
+ options.shape = options.shape === 'autooverflow' ? 'overflowPortrait' : 'portrait';
} else {
- options.shape = options.defaultShape || (options.shape == 'autooverflow' ? 'overflowSquare' : 'square');
+ options.shape = options.defaultShape || (options.shape === 'autooverflow' ? 'overflowSquare' : 'square');
}
}
+ if (options.preferThumb === 'auto') {
+ options.preferThumb = options.shape === 'backdrop' || options.shape === 'overflowBackdrop';
+ }
+
options.uiAspect = getDesiredAspect(options.shape);
options.primaryImageAspectRatio = primaryImageAspectRatio;
@@ -175,13 +248,13 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
}
if (layoutManager.tv) {
- if (options.shape == 'backdrop') {
+ if (options.shape === 'backdrop') {
options.width = options.width || 500;
}
- else if (options.shape == 'portrait') {
+ else if (options.shape === 'portrait') {
options.width = options.width || 243;
}
- else if (options.shape == 'square') {
+ else if (options.shape === 'square') {
options.width = options.width || 243;
}
}
@@ -193,13 +266,17 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var isVertical;
- if (options.shape == 'autoVertical') {
+ if (options.shape === 'autoVertical') {
isVertical = true;
}
+ if (options.vibrant && !appHost.supports('imageanalysis')) {
+ options.vibrant = false;
+ }
+
setCardData(items, options);
- if (options.indexBy == 'Genres') {
+ if (options.indexBy === 'Genres') {
return buildCardsByGenreHtmlInternal(items, apiClient, options);
}
@@ -209,6 +286,10 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
className += ' ' + options.shape + 'Card';
}
+ if (options.cardCssClass) {
+ className += ' ' + options.cardCssClass;
+ }
+
var html = '';
var itemsInRow = 0;
@@ -225,30 +306,30 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
if (options.indexBy) {
var newIndexValue = '';
- if (options.indexBy == 'PremiereDate') {
+ if (options.indexBy === 'PremiereDate') {
if (item.PremiereDate) {
try {
- newIndexValue = getDisplayDateText(datetime.parseISO8601Date(item.PremiereDate));
+ newIndexValue = datetime.toLocaleDateString(datetime.parseISO8601Date(item.PremiereDate), { weekday: 'long', month: 'long', day: 'numeric' });
} catch (err) {
}
}
}
- else if (options.indexBy == 'Genres') {
+ else if (options.indexBy === 'Genres') {
newIndexValue = item.Name;
}
- else if (options.indexBy == 'ProductionYear') {
+ else if (options.indexBy === 'ProductionYear') {
newIndexValue = item.ProductionYear;
}
- else if (options.indexBy == 'CommunityRating') {
- newIndexValue = item.CommunityRating ? (Math.floor(item.CommunityRating) + (item.CommunityRating % 1 >= .5 ? .5 : 0)) + '+' : null;
+ else if (options.indexBy === 'CommunityRating') {
+ newIndexValue = item.CommunityRating ? (Math.floor(item.CommunityRating) + (item.CommunityRating % 1 >= 0.5 ? 0.5 : 0)) + '+' : null;
}
- if (newIndexValue != currentIndexValue) {
+ if (newIndexValue !== currentIndexValue) {
if (hasOpenRow) {
html += ' ';
@@ -280,7 +361,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
}
}
- if (options.rows && itemsInRow == 0) {
+ if (options.rows && itemsInRow === 0) {
if (hasOpenRow) {
html += '
';
@@ -318,6 +399,19 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
return html;
}
+ function filterItemsByGenre(items, genre) {
+
+ var genreLower = genre.toLowerCase();
+ return items.filter(function (currentItem) {
+
+ return currentItem.Genres.filter(function (g) {
+
+ return g.toLowerCase() === genreLower;
+
+ }).length > 0;
+ });
+ }
+
function buildCardsByGenreHtmlInternal(items, apiClient, options) {
var className = 'card';
@@ -330,19 +424,43 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var loopItems = options.genres;
+ var itemsInRow;
+ var hasOpenRow;
+
+ var onGenre = function (renderItem) {
+
+ var currentItemHtml = '';
+
+ if (options.rows && itemsInRow === 0) {
+
+ if (hasOpenRow) {
+ currentItemHtml += '
';
+ hasOpenRow = false;
+ }
+
+ currentItemHtml += '
';
+ hasOpenRow = true;
+ }
+
+ var cardClass = className;
+ currentItemHtml += buildCard(i, renderItem, apiClient, options, cardClass);
+
+ itemsInRow++;
+
+ if (options.rows && itemsInRow >= options.rows) {
+ currentItemHtml += '
';
+ hasOpenRow = false;
+ itemsInRow = 0;
+ }
+
+ return currentItemHtml;
+ };
+
for (var i = 0, length = loopItems.length; i < length; i++) {
var item = loopItems[i];
- var genreLower = item.Name.toLowerCase();
- var renderItems = items.filter(function (currentItem) {
-
- return currentItem.Genres.filter(function (g) {
-
- return g.toLowerCase() == genreLower;
-
- }).length > 0;
- });
+ var renderItems = filterItemsByGenre(items, item.Name);
if (!renderItems.length) {
continue;
@@ -357,39 +475,10 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
showMoreButton = true;
}
- var itemsInRow = 0;
- var hasOpenRow = false;
-
- html += renderItems.map(function (renderItem) {
-
- var currentItemHtml = '';
-
- if (options.rows && itemsInRow == 0) {
-
- if (hasOpenRow) {
- currentItemHtml += '
';
- hasOpenRow = false;
- }
-
- currentItemHtml += '
';
- hasOpenRow = true;
- }
-
- var cardClass = className;
- currentItemHtml += buildCard(i, renderItem, apiClient, options, cardClass);
-
- itemsInRow++;
-
- if (options.rows && itemsInRow >= options.rows) {
- currentItemHtml += '
';
- hasOpenRow = false;
- itemsInRow = 0;
- }
-
- return currentItemHtml;
-
- }).join('');
+ itemsInRow = 0;
+ hasOpenRow = false;
+ html += renderItems.map(onGenre).join('');
if (showMoreButton) {
html += '
';
@@ -404,38 +493,17 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
return html;
}
- function getDisplayDateText(date) {
-
- var weekday = [];
- weekday[0] = globalize.translate('sharedcomponents#Sunday');
- weekday[1] = globalize.translate('sharedcomponents#Monday');
- weekday[2] = globalize.translate('sharedcomponents#Tuesday');
- weekday[3] = globalize.translate('sharedcomponents#Wednesday');
- weekday[4] = globalize.translate('sharedcomponents#Thursday');
- weekday[5] = globalize.translate('sharedcomponents#Friday');
- weekday[6] = globalize.translate('sharedcomponents#Saturday');
-
- var day = weekday[date.getDay()];
- date = date.toLocaleDateString();
-
- if (date.toLowerCase().indexOf(day.toLowerCase()) == -1) {
- return day + " " + date;
- }
-
- return date;
- }
-
function getDesiredAspect(shape) {
if (shape) {
shape = shape.toLowerCase();
- if (shape.indexOf('portrait') != -1) {
+ if (shape.indexOf('portrait') !== -1) {
return (2 / 3);
}
- if (shape.indexOf('backdrop') != -1) {
+ if (shape.indexOf('backdrop') !== -1) {
return (16 / 9);
}
- if (shape.indexOf('square') != -1) {
+ if (shape.indexOf('square') !== -1) {
return 1;
}
}
@@ -453,35 +521,9 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var forceName = false;
var imgUrl = null;
var coverImage = false;
+ var uiAspect = null;
- if (options.autoThumb && item.ImageTags && item.ImageTags.Primary && item.PrimaryImageAspectRatio && item.PrimaryImageAspectRatio >= 1.34) {
-
- height = primaryImageAspectRatio ? Math.round(width / primaryImageAspectRatio) : null;
-
- imgUrl = ApiClient.getScaledImageUrl(item.Id, {
- type: "Primary",
- maxHeight: height,
- maxWidth: width,
- tag: item.ImageTags.Primary
- });
-
- if (primaryImageAspectRatio) {
- if (uiAspect) {
- if (Math.abs(primaryImageAspectRatio - uiAspect) <= .2) {
- coverImage = true;
- }
- }
- }
-
- } else if (options.autoThumb && item.ImageTags && item.ImageTags.Thumb) {
-
- imgUrl = ApiClient.getScaledImageUrl(item.Id, {
- type: "Thumb",
- maxWidth: width,
- tag: item.ImageTags.Thumb
- });
-
- } else if (options.preferThumb && item.ImageTags && item.ImageTags.Thumb) {
+ if (options.preferThumb && item.ImageTags && item.ImageTags.Thumb) {
imgUrl = apiClient.getScaledImageUrl(item.Id, {
type: "Thumb",
@@ -505,7 +547,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
tag: item.SeriesThumbImageTag
});
- } else if (options.preferThumb && item.ParentThumbItemId && options.inheritThumb !== false) {
+ } else if (options.preferThumb && item.ParentThumbItemId && options.inheritThumb !== false && item.MediaType !== 'Photo') {
imgUrl = apiClient.getScaledImageUrl(item.ParentThumbItemId, {
type: "Thumb",
@@ -539,9 +581,9 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
}
if (primaryImageAspectRatio) {
- var uiAspect = getDesiredAspect(options.shape);
+ uiAspect = getDesiredAspect(options.shape);
if (uiAspect) {
- coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= .2;
+ coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= 0.2;
}
}
@@ -561,9 +603,9 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
}
if (primaryImageAspectRatio) {
- var uiAspect = getDesiredAspect(options.shape);
+ uiAspect = getDesiredAspect(options.shape);
if (uiAspect) {
- coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= .2;
+ coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= 0.2;
}
}
}
@@ -587,13 +629,13 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
});
if (primaryImageAspectRatio) {
- var uiAspect = getDesiredAspect(options.shape);
+ uiAspect = getDesiredAspect(options.shape);
if (uiAspect) {
- coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= .2;
+ coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= 0.2;
}
}
}
- else if (item.Type == 'Season' && item.ImageTags && item.ImageTags.Thumb) {
+ else if (item.Type === 'Season' && item.ImageTags && item.ImageTags.Thumb) {
imgUrl = apiClient.getScaledImageUrl(item.Id, {
type: "Thumb",
@@ -669,7 +711,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
return 'defaultCardColor' + getDefaultColorIndex(str);
}
- function getCardTextLines(lines, cssClass, forceLines, isOuterFooter, cardLayout) {
+ function getCardTextLines(lines, cssClass, forceLines, isOuterFooter, cardLayout, addRightMargin) {
var html = '';
@@ -678,18 +720,19 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
for (i = 0, length = lines.length; i < length; i++) {
+ var currentCssClass = cssClass;
var text = lines[i];
- if (i == 1 && isOuterFooter) {
- cssClass += ' cardText-secondary';
+ if (valid > 0 && isOuterFooter) {
+ currentCssClass += ' cardText-secondary';
}
- if (isOuterFooter && cardLayout) {
- cssClass += ' cardText-rightmargin';
+ if (addRightMargin) {
+ currentCssClass += ' cardText-rightmargin';
}
if (text) {
- html += "
";
+ html += "
";
html += text;
html += "
";
valid++;
@@ -706,7 +749,8 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
return html;
}
- function getCardFooterText(item, apiClient, options, showTitle, forceName, overlayText, imgUrl, footerClass, progressHtml, isOuterFooter) {
+ var uniqueFooterIndex = 0;
+ function getCardFooterText(item, apiClient, options, showTitle, forceName, overlayText, imgUrl, footerClass, progressHtml, isOuterFooter, cardFooterId, vibrantSwatch) {
var html = '';
@@ -714,24 +758,22 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
if (isOuterFooter && options.cardLayout && !layoutManager.tv) {
- if (options.cardFooterAside == 'logo') {
-
- }
- else if (options.cardFooterAside != 'none') {
- var moreIcon = appHost.moreIcon == 'dots-horiz' ? '' : '';
+ if (options.cardFooterAside !== 'none') {
+ var moreIcon = appHost.moreIcon === 'dots-horiz' ? '' : '';
html += '
';
}
}
- var cssClass = options.centerText && !options.cardLayout ? "cardText cardTextCentered" : "cardText";
+ var cssClass = options.centerText ? "cardText cardTextCentered" : "cardText";
var lines = [];
+ var parentTitleUnderneath = item.Type === 'MusicAlbum' || item.Type === 'Audio' || item.Type === 'MusicVideo';
+ var titleAdded;
if (showOtherText) {
- var parentTitleUnderneath = item.Type == 'MusicAlbum' || item.Type == 'Audio' || item.Type == 'MusicVideo';
if ((options.showParentTitle || options.showParentTitleOrTitle) && !parentTitleUnderneath) {
- if (isOuterFooter && item.Type == 'Episode' && item.SeriesName && item.SeriesId) {
+ if (isOuterFooter && item.Type === 'Episode' && item.SeriesName && item.SeriesId) {
lines.push(getTextActionButton({
Id: item.SeriesId,
@@ -742,20 +784,35 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
}
else {
- var parentTitle = item.EpisodeTitle ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || "");
+ if (item.Type === 'Program') {
- if (parentTitle || options.showParentTitle) {
- lines.push(parentTitle);
+ lines.push(item.Name);
+
+ if (!item.IsSeries) {
+ titleAdded = true;
+ }
+
+ } else {
+ var parentTitle = item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || "";
+
+ if (parentTitle || showTitle) {
+ lines.push(parentTitle);
+ }
}
}
}
}
- if (showTitle || forceName || (options.showParentTitleOrTitle && !lines.length)) {
+ var showMediaTitle = (showTitle && !titleAdded) || (options.showParentTitleOrTitle && !lines.length);
+ if (!showMediaTitle && !titleAdded && (showTitle || forceName)) {
+ showMediaTitle = true;
+ }
- var name = options.showTitle == 'auto' && !item.IsFolder && item.MediaType == 'Photo' ? '' : itemHelper.getDisplayName(item);
+ if (showMediaTitle) {
- lines.push(htmlEncode(name));
+ var name = options.showTitle === 'auto' && !item.IsFolder && item.MediaType === 'Photo' ? '' : itemHelper.getDisplayName(item);
+
+ lines.push(name);
}
if (showOtherText) {
@@ -766,7 +823,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
item.AlbumArtists[0].IsFolder = true;
lines.push(getTextActionButton(item.AlbumArtists[0]));
} else {
- lines.push(item.EpisodeTitle ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || ""));
+ lines.push(item.Type === 'Program' ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || ""));
}
}
@@ -789,7 +846,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var songLine = '';
if (item.SongCount) {
- songLine = item.SongCount == 1 ?
+ songLine = item.SongCount === 1 ?
globalize.translate('sharedcomponents#ValueOneSong') :
globalize.translate('sharedcomponents#ValueSongCount', item.SongCount);
}
@@ -818,24 +875,31 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
lines.push(item.ProductionYear || '');
}
- if (options.showChannelName) {
+ if (options.showRuntime) {
- lines.push(item.ChannelName || '');
+ if (item.RunTimeTicks) {
+
+ lines.push(datetime.getDisplayRunningTime(item.RunTimeTicks));
+ } else {
+ lines.push('');
+ }
}
if (options.showAirTime) {
- var airTimeText;
+ var airTimeText = '';
if (item.StartDate) {
try {
var date = datetime.parseISO8601Date(item.StartDate);
- airTimeText = date.toLocaleDateString();
+ if (options.showAirDateTime) {
+ airTimeText += datetime.toLocaleDateString(date, { weekday: 'short', month: 'short', day: 'numeric' }) + ' ';
+ }
- airTimeText += ', ' + datetime.getDisplayTime(date);
+ airTimeText += datetime.getDisplayTime(date);
- if (item.EndDate) {
+ if (item.EndDate && options.showAirEndTime) {
date = datetime.parseISO8601Date(item.EndDate);
airTimeText += ' - ' + datetime.getDisplayTime(date);
}
@@ -848,34 +912,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
lines.push(airTimeText || '');
}
- if (options.showCurrentProgram && item.Type == 'TvChannel') {
-
- if (item.CurrentProgram) {
- lines.push(item.CurrentProgram.Name);
- } else {
- lines.push('');
- }
- }
-
- if (options.showSeriesYear) {
-
- if (item.Status == "Continuing") {
-
- lines.push(globalize.translate('sharedcomponents#SeriesYearToPresent', item.ProductionYear || ''));
-
- } else {
- lines.push(item.ProductionYear || '');
- }
-
- }
-
- if (options.showProgramAirInfo) {
-
- var text = item.StartDate ?
- datetime.toLocaleString(datetime.parseISO8601Date(item.StartDate, true)) :
- '';
-
- lines.push(text || ' ');
+ if (options.showChannelName) {
if (item.ChannelId) {
@@ -905,20 +942,86 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
lines.push(item.ChannelName || ' ');
}
}
+
+ if (options.showCurrentProgram && item.Type === 'TvChannel') {
+
+ if (item.CurrentProgram) {
+ lines.push(item.CurrentProgram.Name);
+ } else {
+ lines.push('');
+ }
+ }
+
+ if (options.showSeriesYear) {
+
+ if (item.Status === "Continuing") {
+
+ lines.push(globalize.translate('sharedcomponents#SeriesYearToPresent', item.ProductionYear || ''));
+
+ } else {
+
+ if (item.EndDate && item.ProductionYear) {
+ lines.push(item.ProductionYear + ' - ' + datetime.parseISO8601Date(item.EndDate).getFullYear());
+ } else {
+ lines.push(item.ProductionYear || '');
+ }
+ }
+
+ }
+
+ if (options.showSeriesTimerTime) {
+ if (item.RecordAnyTime) {
+
+ lines.push(globalize.translate('sharedcomponents#Anytime'));
+ } else {
+ lines.push(datetime.getDisplayTime(item.StartDate));
+ }
+ }
+
+ if (options.showSeriesTimerChannel) {
+ if (item.RecordAnyChannel) {
+ lines.push(globalize.translate('sharedcomponents#AllChannels'));
+ }
+ else if (item.ChannelId) {
+ lines.push(item.ChannelName || '');
+ }
+ }
+
+ if (options.showPersonRoleOrType) {
+ if (item.Role) {
+ lines.push('as ' + item.Role);
+ }
+ else if (item.Type) {
+ lines.push(globalize.translate('core#' + item.Type));
+ } else {
+ lines.push('');
+ }
+ }
}
- if ((showTitle || !imgUrl) && forceName && overlayText && lines.length == 1) {
+ if ((showTitle || !imgUrl) && forceName && overlayText && lines.length === 1) {
lines = [];
}
- html += getCardTextLines(lines, cssClass, !options.overlayText, isOuterFooter, options.cardLayout);
+ html += getCardTextLines(lines, cssClass, !options.overlayText, isOuterFooter, options.cardLayout, isOuterFooter && options.cardLayout && !options.centerText);
if (progressHtml) {
html += progressHtml;
}
if (html) {
- html = '