1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #2250 from MediaBrowser/beta

Beta
This commit is contained in:
Luke 2016-10-20 15:27:40 -04:00 committed by GitHub
commit d6c43efc9c
127 changed files with 1222 additions and 922 deletions

View file

@ -16,12 +16,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.1.90",
"_release": "1.1.90",
"version": "1.1.91",
"_release": "1.1.91",
"_resolution": {
"type": "version",
"tag": "1.1.90",
"commit": "eb52e55b0f856ac89abcea9a71f475595d718627"
"tag": "1.1.91",
"commit": "f94b80f14bce6922acf1dbd749a60ad54e4abfd8"
},
"_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
"_target": "^1.1.51",

View file

@ -1252,11 +1252,9 @@
if (!username) {
return Promise.reject();
return;
}
if (!password) {
return Promise.reject();
return;
}
return ajax({

View file

@ -14,12 +14,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.4.313",
"_release": "1.4.313",
"version": "1.4.321",
"_release": "1.4.321",
"_resolution": {
"type": "version",
"tag": "1.4.313",
"commit": "79c18a7f2b379d8162bdca36b7cf0713bbe43ad8"
"tag": "1.4.321",
"commit": "fb270e69c8391f62e762ee03d77a7b8a495c5a6f"
},
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1",

View file

@ -51,15 +51,21 @@
return;
}
setTimeout(function () {
var onAnimationComplete = function () {
dom.removeEventListener(backdropImage, 'animationend', onAnimationComplete, {
once: true
});
if (backdropImage === currentAnimatingElement) {
currentAnimatingElement = null;
}
if (existingBackdropImage && existingBackdropImage.parentNode) {
existingBackdropImage.parentNode.removeChild(existingBackdropImage);
}
}, 800);
};
dom.addEventListener(backdropImage, 'animationend', onAnimationComplete, {
once: true
});
internalBackdrop(true);
};

View file

@ -264,7 +264,7 @@ define(['browser'], function (browser) {
// Otherwise with HLS and mp3 audio we're seeing some browsers
// safari is lying
if ((videoTestElement.canPlayType('audio/mp4; codecs="ac-3"').replace(/no/, '') && !browser.safari) || browser.edgeUwp || browser.tizen) {
if ((options.disableVideoAudioCodecs || []).indexOf('ac3') == -1) {
if ((options.disableVideoAudioCodecs || []).indexOf('ac3') === -1) {
videoAudioCodecs.push('ac3');
// This works in edge desktop, but not mobile

View file

@ -71,7 +71,7 @@ button {
.cardBox {
padding: 0 !important;
margin: 0;
margin: 2px;
transition: none;
border: 3px solid transparent;
/* Needed in case cardBox is a button */
@ -91,10 +91,6 @@ button {
transform: scale(1.16, 1.16);
}
.cardBox-mobile {
margin: 2px;
}
.card:focus {
position: relative !important;
z-index: 10 !important;
@ -202,6 +198,11 @@ button {
}
.coveredImage-img {
width: 100%;
height: 100%;
}
.coveredImage-noscale-img {
max-height: none;
max-width: none;
}

View file

@ -2,32 +2,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
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,
// Match everything outside of normal chars and " (quote character)
NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g;
/**
* Escapes all potentially dangerous characters, so that the
* resulting string can be safely inserted into attribute or
* element text.
* @param value
* @returns {string} escaped text
*/
function htmlEncode(value) {
return value.
replace(/&/g, '&').
replace(SURROGATE_PAIR_REGEXP, function (value) {
var hi = value.charCodeAt(0);
var low = value.charCodeAt(1);
return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
}).
replace(NON_ALPHANUMERIC_REGEXP, function (value) {
return '&#' + value.charCodeAt(0) + ';';
}).
replace(/</g, '&lt;').
replace(/>/g, '&gt;');
}
var devicePixelRatio = window.devicePixelRatio || 1;
function getCardsHtml(items, options) {
@ -1202,9 +1177,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var separateCardBox = scalable;
var cardBoxClass = options.cardLayout ? 'cardBox visualCardBox' : 'cardBox';
if (!layoutManager.tv) {
cardBoxClass += ' cardBox-mobile';
} else {
if (layoutManager.tv) {
cardBoxClass += ' cardBox-focustransform';
}
@ -1300,7 +1273,11 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var imgClass = 'cardImage cardImage-img lazy';
if (coveredImage) {
imgClass += ' coveredImage-img';
if (devicePixelRatio === 1) {
imgClass += ' coveredImage-noscale-img';
} else {
imgClass += ' coveredImage-img';
}
}
cardImageContainerOpen += '<img crossOrigin="Anonymous" class="' + imgClass + '" data-vibrant="' + cardFooterId + '" data-swatch="db" data-src="' + imgUrl + '" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" />';

View file

@ -1,4 +1,5 @@
define(['shell', 'dialogHelper', 'loading', 'layoutManager', 'connectionManager', 'embyRouter', 'globalize', 'emby-checkbox', 'emby-input', 'paper-icon-button-light', 'emby-select', 'material-icons', 'css!./../formdialog', 'emby-button'], function (shell, dialogHelper, loading, layoutManager, connectionManager, embyRouter, globalize) {
'use strict';
var currentServerId;

View file

@ -148,12 +148,47 @@
}
}
return toLocaleTimeString(date, {
if (toLocaleTimeStringSupportsLocales) {
return toLocaleTimeString(date, {
hour: 'numeric',
minute: '2-digit'
hour: 'numeric',
minute: '2-digit'
});
});
}
var time = toLocaleTimeString(date);
var timeLower = time.toLowerCase();
if (timeLower.indexOf('am') !== -1 || timeLower.indexOf('pm') !== -1) {
time = timeLower;
var hour = date.getHours() % 12;
var suffix = date.getHours() > 11 ? 'pm' : 'am';
if (!hour) {
hour = 12;
}
var minutes = date.getMinutes();
if (minutes < 10) {
minutes = '0' + minutes;
}
minutes = ':' + minutes;
time = hour + minutes + suffix;
} else {
var timeParts = time.split(':');
// Trim off seconds
if (timeParts.length > 2) {
timeParts.length -= 1;
time = timeParts.join(':');
}
}
return time;
}
function isRelativeDay(date, offsetInDays) {

View file

@ -3,6 +3,24 @@
var globalOnOpenCallback;
function enableAnimation() {
if (browser.animate) {
return true;
}
if (browser.edge) {
return true;
}
// An indication of an older browser
if (browser.noFlex) {
return false;
}
return true;
}
function removeCenterFocus(dlg) {
if (layoutManager.tv) {
@ -136,10 +154,9 @@
backdropParent.parentNode.insertBefore(backdrop, backdropParent);
dlg.backdrop = backdrop;
// Doing this immediately causes the opacity to jump immediately without animating
setTimeout(function () {
backdrop.classList.add('dialogBackdropOpened');
}, 0);
// trigger reflow or the backdrop will not animate
void backdrop.offsetWidth;
backdrop.classList.add('dialogBackdropOpened');
dom.addEventListener((dlg.dialogContainer || backdrop), 'click', function (e) {
if (e.target === dlg.dialogContainer) {
@ -226,27 +243,59 @@
}
};
setTimeout(onAnimationFinish, dlg.animationConfig.entry.timing.duration);
if (enableAnimation()) {
var onFinish = function () {
dom.removeEventListener(dlg, 'animationend', onFinish, {
once: true
});
onAnimationFinish();
};
dom.addEventListener(dlg, 'animationend', onFinish, {
once: true
});
return;
}
onAnimationFinish();
}
function animateDialogClose(dlg, onAnimationFinish) {
switch (dlg.animationConfig.exit.name) {
if (enableAnimation()) {
case 'fadeout':
dlg.style.animation = 'fadeout ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both';
break;
case 'scaledown':
dlg.style.animation = 'scaledown ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both';
break;
case 'slidedown':
dlg.style.animation = 'slidedown ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both';
break;
default:
break;
var animated = true;
switch (dlg.animationConfig.exit.name) {
case 'fadeout':
dlg.style.animation = 'fadeout ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both';
break;
case 'scaledown':
dlg.style.animation = 'scaledown ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both';
break;
case 'slidedown':
dlg.style.animation = 'slidedown ' + dlg.animationConfig.exit.timing.duration + 'ms ease-out normal both';
break;
default:
animated = false;
break;
}
var onFinish = function () {
dom.removeEventListener(dlg, 'animationend', onFinish, {
once: true
});
onAnimationFinish();
};
dom.addEventListener(dlg, 'animationend', onFinish, {
once: true
});
if (animated) {
return;
}
}
setTimeout(onAnimationFinish, dlg.animationConfig.exit.timing.duration);
onAnimationFinish();
}
function shouldLockDocumentScroll(options) {
@ -270,15 +319,26 @@
var backdrop = dlg.backdrop;
if (backdrop) {
dlg.backdrop = null;
if (!backdrop) {
return;
}
dlg.backdrop = null;
var onAnimationFinish = function () {
backdrop.parentNode.removeChild(backdrop);
};
if (enableAnimation()) {
backdrop.classList.remove('dialogBackdropOpened');
setTimeout(function () {
backdrop.parentNode.removeChild(backdrop);
}, 300);
// this is not firing animatonend
setTimeout(onAnimationFinish, 300);
return;
}
onAnimationFinish();
}
function centerFocus(elem, horiz, on) {
@ -375,19 +435,21 @@
dlg.classList.add('dialog-' + options.size);
}
switch (dlg.animationConfig.entry.name) {
if (enableAnimation()) {
switch (dlg.animationConfig.entry.name) {
case 'fadein':
dlg.style.animation = 'fadein ' + entryAnimationDuration + 'ms ease-out normal';
break;
case 'scaleup':
dlg.style.animation = 'scaleup ' + entryAnimationDuration + 'ms ease-out normal both';
break;
case 'slideup':
dlg.style.animation = 'slideup ' + entryAnimationDuration + 'ms ease-out normal';
break;
default:
break;
case 'fadein':
dlg.style.animation = 'fadein ' + entryAnimationDuration + 'ms ease-out normal';
break;
case 'scaleup':
dlg.style.animation = 'scaleup ' + entryAnimationDuration + 'ms ease-out normal both';
break;
case 'slideup':
dlg.style.animation = 'slideup ' + entryAnimationDuration + 'ms ease-out normal';
break;
default:
break;
}
}
return dlg;

View file

@ -1,4 +1,5 @@
define(['itemShortcuts', 'connectionManager', 'layoutManager', 'browser', 'dom', 'loading', 'serverNotifications', 'events', 'registerElement'], function (itemShortcuts, connectionManager, layoutManager, browser, dom, loading, serverNotifications, events) {
'use strict';
var ItemsContainerProtoType = Object.create(HTMLDivElement.prototype);

View file

@ -1,4 +1,5 @@
define(['multi-download'], function (multiDownload) {
'use strict';
return {
download: function (items) {

View file

@ -1,4 +1,5 @@
define(['dom', 'fullscreenManager'], function (dom, fullscreenManager) {
'use strict';
dom.addEventListener(window, 'dblclick', function () {

View file

@ -1,4 +1,5 @@
define([], function () {
'use strict';
function fullscreenManager() {

View file

@ -317,8 +317,9 @@
padding: 0 .5em 0;
overflow: hidden;
text-overflow: ellipsis;
display: flex;
align-items: center;
/* Need block here or the ellipsis overflow is lost */
display: block;
}
.programIcon {
@ -335,6 +336,20 @@
margin-left: .25em;
}
.programTextIcon {
font-weight: bold;
color: rgb(30,30,30);
font-size: .9em;
background: #555;
padding: .18em .32em;
border-radius: .25em;
margin-right: .35em;
}
.programTextIcon-tv {
font-size: .7em;
}
.guideChannelNumber {
padding-left: 1em;
max-width: 30%;

View file

@ -378,7 +378,7 @@
return '<i class="md-icon programIcon timerIcon">&#xE061;</i>';
}
function getChannelProgramsHtml(context, date, channel, programs, options) {
function getChannelProgramsHtml(context, date, channel, programs, options, index) {
var html = '';
@ -482,7 +482,7 @@
timerAttributes += ' data-seriestimerid="' + program.SeriesTimerId + '"';
}
html += '<button data-action="' + clickAction + '"' + timerAttributes + ' data-isfolder="' + program.IsFolder + '" data-id="' + program.Id + '" data-serverid="' + program.ServerId + '" data-type="' + program.Type + '" class="' + cssClass + '" style="left:' + startPercent + '%;width:' + endPercent + '%;">';
html += '<button data-action="' + clickAction + '"' + timerAttributes + ' data-id="' + program.Id + '" data-serverid="' + program.ServerId + '" data-type="' + program.Type + '" class="' + cssClass + '" style="left:' + startPercent + '%;width:' + endPercent + '%;">';
if (displayInnerContent) {
var guideProgramNameClass = "guideProgramName";
@ -506,7 +506,12 @@
html += '</div>';
if (program.IsHD && options.showHdIcon) {
html += '<i class="guideHdIcon md-icon programIcon">hd</i>';
//html += '<i class="guideHdIcon md-icon programIcon">hd</i>';
if (layoutManager.tv) {
html += '<div class="programIcon programTextIcon programTextIcon-tv">HD</div>';
} else {
html += '<div class="programIcon programTextIcon">HD</div>';
}
}
html += getTimerIndicator(program);
@ -543,7 +548,7 @@
for (var i = 0, length = channels.length; i < length; i++) {
html.push(getChannelProgramsHtml(context, date, channels[i], programs, options));
html.push(getChannelProgramsHtml(context, date, channels[i], programs, options, i));
}
var programGrid = context.querySelector('.programGrid');

View file

@ -176,7 +176,8 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
url = url.split('?')[0];
var cacheKey = 'vibrant21';
var cacheKey = 'vibrant25';
//cacheKey = 'vibrant' + new Date().getTime();
return cacheKey + url;
}

View file

@ -1,4 +1,5 @@
define(['connectionManager', 'playbackManager', 'events', 'inputManager', 'focusManager', 'embyRouter'], function (connectionManager, playbackManager, events, inputManager, focusManager, embyRouter) {
'use strict';
function notifyApp() {
@ -149,10 +150,10 @@ define(['connectionManager', 'playbackManager', 'events', 'inputManager', 'focus
notifyApp();
var serverId = apiClient.serverInfo().Id;
if (msg.Data.PlayCommand == "PlayNext") {
if (msg.Data.PlayCommand === "PlayNext") {
playbackManager.queueNext({ ids: msg.Data.ItemIds, serverId: serverId });
}
else if (msg.Data.PlayCommand == "PlayLast") {
else if (msg.Data.PlayCommand === "PlayLast") {
playbackManager.queue({ ids: msg.Data.ItemIds, serverId: serverId });
}
else {

View file

@ -1,4 +1,5 @@
define(['playbackManager', 'focusManager', 'embyRouter', 'dom'], function (playbackManager, focusManager, embyRouter, dom) {
'use strict';
var lastInputTime = new Date().getTime();

View file

@ -1,4 +1,5 @@
define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', 'playbackManager', 'loading', 'appSettings'], function (appHost, globalize, connectionManager, itemHelper, embyRouter, playbackManager, loading, appSettings) {
'use strict';
var isMobileApp = window.Dashboard != null;
@ -29,21 +30,21 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
});
}
if ((item.Type == 'Timer') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) {
if ((item.Type === 'Timer') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) {
commands.push({
name: globalize.translate('sharedcomponents#CancelRecording'),
id: 'canceltimer'
});
}
if ((item.Type == 'Recording' && item.Status == 'InProgress') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) {
if ((item.Type === 'Recording' && item.Status === 'InProgress') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) {
commands.push({
name: globalize.translate('sharedcomponents#CancelRecording'),
id: 'canceltimer'
});
}
if ((item.Type == 'SeriesTimer') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) {
if ((item.Type === 'SeriesTimer') && user.Policy.EnableLiveTvManagement && options.cancelTimer !== false) {
commands.push({
name: globalize.translate('sharedcomponents#CancelSeries'),
id: 'cancelseriestimer'
@ -52,7 +53,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
if (item.CanDelete) {
if (item.Type == 'Playlist' || item.Type == 'BoxSet') {
if (item.Type === 'Playlist' || item.Type === 'BoxSet') {
commands.push({
name: globalize.translate('sharedcomponents#Delete'),
id: 'delete'
@ -67,9 +68,9 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
if (itemHelper.canEdit(user, item)) {
if (options.edit !== false && item.Type != 'SeriesTimer') {
if (options.edit !== false && item.Type !== 'SeriesTimer') {
var text = (item.Type == 'Timer' || item.Type == 'SeriesTimer') ? globalize.translate('sharedcomponents#Edit') : globalize.translate('sharedcomponents#EditInfo');
var text = (item.Type === 'Timer' || item.Type === 'SeriesTimer') ? globalize.translate('sharedcomponents#Edit') : globalize.translate('sharedcomponents#EditInfo');
commands.push({
name: text,
@ -90,7 +91,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
if (itemHelper.canEdit(user, item)) {
if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual' && !(item.Type == 'Recording' && item.Status != 'Completed')) {
if (item.MediaType === 'Video' && item.Type !== 'TvChannel' && item.Type !== 'Program' && item.LocationType !== 'Virtual' && !(item.Type === 'Recording' && item.Status !== 'Completed')) {
if (options.editSubtitles !== false) {
commands.push({
name: globalize.translate('sharedcomponents#EditSubtitles'),
@ -116,7 +117,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
}
}
if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "MusicGenre" || item.CollectionType == "music") {
if (item.MediaType === "Audio" || item.Type === "MusicAlbum" || item.Type === "MusicArtist" || item.Type === "MusicGenre" || item.CollectionType === "music") {
if (options.instantMix !== false) {
commands.push({
name: globalize.translate('sharedcomponents#InstantMix'),
@ -149,7 +150,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
}
}
if (options.playAllFromHere && item.Type != 'Program' && item.Type != 'TvChannel') {
if (options.playAllFromHere && item.Type !== 'Program' && item.Type !== 'TvChannel') {
commands.push({
name: globalize.translate('sharedcomponents#PlayAllFromHere'),
id: 'playallfromhere'
@ -173,7 +174,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
}
}
if (item.Type == 'Program') {
if (item.Type === 'Program') {
commands.push({
name: Globalize.translate('sharedcomponents#Record'),
@ -183,7 +184,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
if (user.Policy.IsAdministrator) {
if (item.Type != 'Timer' && item.Type != 'SeriesTimer' && item.Type != 'Program' && !(item.Type == 'Recording' && item.Status != 'Completed')) {
if (item.Type !== 'Timer' && item.Type !== 'SeriesTimer' && item.Type !== 'Program' && !(item.Type === 'Recording' && item.Status !== 'Completed')) {
commands.push({
name: globalize.translate('sharedcomponents#Refresh'),
id: 'refresh'
@ -214,7 +215,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
}
}
if (item.IsFolder || item.Type == "MusicArtist" || item.Type == "MusicGenre") {
if (item.IsFolder || item.Type === "MusicArtist" || item.Type === "MusicGenre") {
if (options.shuffle !== false) {
commands.push({
name: globalize.translate('sharedcomponents#Shuffle'),
@ -534,7 +535,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
startPosition = item.UserData.PlaybackPositionTicks;
}
if (item.Type == 'Program') {
if (item.Type === 'Program') {
playbackManager[method]({
ids: [item.ChannelId],
startPositionTicks: startPosition
@ -553,12 +554,12 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
var serverId = apiClient.serverInfo().Id;
if (item.Type == 'Timer') {
if (item.Type === 'Timer') {
require(['recordingEditor'], function (recordingEditor) {
recordingEditor.show(item.Id, serverId).then(resolve, reject);
});
} else if (item.Type == 'SeriesTimer') {
} else if (item.Type === 'SeriesTimer') {
require(['seriesRecordingEditor'], function (recordingEditor) {
recordingEditor.show(item.Id, serverId).then(resolve, reject);

View file

@ -1,4 +1,5 @@
define(['apphost'], function (appHost) {
'use strict';
function getDisplayName(item, options) {
@ -8,24 +9,24 @@ define(['apphost'], function (appHost) {
options = options || {};
if (item.Type == 'Timer') {
if (item.Type === 'Timer') {
item = item.ProgramInfo || item;
}
var name = (item.Type == 'Program' && item.IsSeries ? item.EpisodeTitle : item.Name) || '';
var name = (item.Type === 'Program' && item.IsSeries ? item.EpisodeTitle : item.Name) || '';
if (item.Type == "TvChannel") {
if (item.Type === "TvChannel") {
if (item.Number) {
return item.Number + ' ' + name;
}
return name;
}
if (/*options.isInlineSpecial &&*/ item.Type == "Episode" && item.ParentIndexNumber == 0) {
if (/*options.isInlineSpecial &&*/ item.Type === "Episode" && item.ParentIndexNumber === 0) {
name = Globalize.translate('sharedcomponents#ValueSpecialEpisodeName', name);
} else if ((item.Type == "Episode" || item.Type == 'Program') && item.IndexNumber != null && item.ParentIndexNumber != null) {
} else if ((item.Type === "Episode" || item.Type === 'Program') && item.IndexNumber != null && item.ParentIndexNumber != null) {
var displayIndexNumber = item.IndexNumber;
@ -50,56 +51,56 @@ define(['apphost'], function (appHost) {
function supportsAddingToCollection(item) {
if (item.Type == 'Timer' || item.Type == 'SeriesTimer') {
if (item.Type === 'Timer' || item.Type === 'SeriesTimer') {
return false;
}
var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'TvChannel', 'Program', 'MusicAlbum', 'Timer'];
if (item.Type == 'Recording') {
if (item.Status != 'Completed') {
if (item.Type === 'Recording') {
if (item.Status !== 'Completed') {
return false;
}
}
return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
return !item.CollectionType && invalidTypes.indexOf(item.Type) === -1 && item.MediaType !== 'Photo';
}
function supportsAddingToPlaylist(item) {
if (item.Type == 'Program') {
if (item.Type === 'Program') {
return false;
}
if (item.Type == 'Timer') {
if (item.Type === 'Timer') {
return false;
}
if (item.Type == 'SeriesTimer') {
if (item.Type === 'SeriesTimer') {
return false;
}
if (item.Type == 'Recording') {
if (item.Status != 'Completed') {
if (item.Type === 'Recording') {
if (item.Status !== 'Completed') {
return false;
}
}
return item.MediaType || item.IsFolder || item.Type == "Genre" || item.Type == "MusicGenre" || item.Type == "MusicArtist";
return item.MediaType || item.IsFolder || item.Type === "Genre" || item.Type === "MusicGenre" || item.Type === "MusicArtist";
}
function canEdit(user, item) {
var itemType = item.Type;
if (itemType == "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType == "UserView") {
if (itemType === "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType === "UserView") {
return false;
}
if (itemType == 'Program') {
if (itemType === 'Program') {
return false;
}
if (item.Type == 'Recording') {
if (item.Status != 'Completed') {
if (item.Type === 'Recording') {
if (item.Status !== 'Completed') {
return false;
}
}
@ -114,15 +115,15 @@ define(['apphost'], function (appHost) {
canIdentify: function (user, itemType) {
if (itemType == "Movie" ||
itemType == "Trailer" ||
itemType == "Series" ||
itemType == "Game" ||
itemType == "BoxSet" ||
itemType == "Person" ||
itemType == "Book" ||
itemType == "MusicAlbum" ||
itemType == "MusicArtist") {
if (itemType === "Movie" ||
itemType === "Trailer" ||
itemType === "Series" ||
itemType === "Game" ||
itemType === "BoxSet" ||
itemType === "Person" ||
itemType === "Book" ||
itemType === "MusicAlbum" ||
itemType === "MusicArtist") {
if (user.Policy.IsAdministrator) {
@ -139,7 +140,7 @@ define(['apphost'], function (appHost) {
var itemType = item.Type;
if (itemType == 'UserView') {
if (itemType === 'UserView') {
if (user.Policy.IsAdministrator) {
return true;
@ -148,13 +149,13 @@ define(['apphost'], function (appHost) {
return false;
}
if (item.Type == 'Recording') {
if (item.Status != 'Completed') {
if (item.Type === 'Recording') {
if (item.Status !== 'Completed') {
return false;
}
}
return itemType != 'Timer' && itemType != 'SeriesTimer' && canEdit(user, item);
return itemType !== 'Timer' && itemType !== 'SeriesTimer' && canEdit(user, item);
},
canSync: function (user, item) {
@ -168,14 +169,14 @@ define(['apphost'], function (appHost) {
canShare: function (user, item) {
if (item.Type == 'Timer') {
if (item.Type === 'Timer') {
return false;
}
if (item.Type == 'SeriesTimer') {
if (item.Type === 'SeriesTimer') {
return false;
}
if (item.Type == 'Recording') {
if (item.Status != 'Completed') {
if (item.Type === 'Recording') {
if (item.Status !== 'Completed') {
return false;
}
}

View file

@ -1,4 +1,5 @@
define(['connectionManager', 'itemHelper', 'mediaInfo', 'userdataButtons', 'playbackManager', 'globalize', 'dom', 'apphost', 'css!./itemhovermenu', 'emby-button'], function (connectionManager, itemHelper, mediaInfo, userdataButtons, playbackManager, globalize, dom, appHost) {
'use strict';
var preventHover = false;
var showOverlayTimeout;
@ -72,9 +73,9 @@
var className = card.className.toLowerCase();
var isMiniItem = className.indexOf('mini') != -1;
var isSmallItem = isMiniItem || className.indexOf('small') != -1;
var isPortrait = className.indexOf('portrait') != -1;
var isMiniItem = className.indexOf('mini') !== -1;
var isSmallItem = isMiniItem || className.indexOf('small') !== -1;
var isPortrait = className.indexOf('portrait') !== -1;
var parentName = isSmallItem || isMiniItem || isPortrait ? null : item.SeriesName;
var name = item.EpisodeTitle ? item.Name : itemHelper.getDisplayName(item);
@ -136,7 +137,7 @@
buttonCount++;
}
var moreIcon = appHost.moreIcon == 'dots-horiz' ? '&#xE5D3;' : '&#xE5D4;';
var moreIcon = appHost.moreIcon === 'dots-horiz' ? '&#xE5D3;' : '&#xE5D4;';
html += '<button is="emby-button" class="itemAction autoSize fab cardOverlayFab mini" data-action="menu" data-playoptions="false"><i class="md-icon cardOverlayFab-md-icon">' + moreIcon + '</i></button>';
buttonCount++;
@ -191,7 +192,7 @@
var id = dataElement.getAttribute('data-id');
var type = dataElement.getAttribute('data-type');
if (type == 'Timer' || type == 'SeriesTimer') {
if (type === 'Timer' || type === 'SeriesTimer') {
return;
}
@ -265,7 +266,6 @@
}
ItemHoverMenu.prototype = {
constructor: ItemHoverMenu,
destroy: function () {
@ -276,7 +276,7 @@
passive: true
});
}
}
};
return ItemHoverMenu;
});

View file

@ -1,4 +1,5 @@
define(['dialogHelper', 'loading', 'cardBuilder', 'connectionManager', 'require', 'globalize', 'scrollHelper', 'layoutManager', 'focusManager', 'emby-input', 'emby-checkbox', 'paper-icon-button-light', 'css!./../formdialog', 'material-icons', 'cardStyle'], function (dialogHelper, loading, cardBuilder, connectionManager, require, globalize, scrollHelper, layoutManager, focusManager) {
'use strict';
var currentItem;
var currentItemType;
@ -20,13 +21,14 @@
var i, length;
var identifyField = page.querySelectorAll('.identifyField');
var value;
for (i = 0, length = identifyField.length; i < length; i++) {
var value = identifyField[i].value;
value = identifyField[i].value;
if (value) {
if (identifyField[i].type == 'number') {
if (identifyField[i].type === 'number') {
value = parseInt(value);
}
@ -39,7 +41,7 @@
var txtLookupId = page.querySelectorAll('.txtLookupId');
for (i = 0, length = txtLookupId.length; i < length; i++) {
var value = txtLookupId[i].value;
value = txtLookupId[i].value;
if (value) {
hasId = true;
@ -177,11 +179,11 @@
var cardBoxCssClass = 'cardBox visualCardBox';
var padderClass;
if (currentItemType == "Episode") {
if (currentItemType === "Episode") {
cssClass += " backdropCard backdropCard-scalable";
padderClass = 'cardPadder-backdrop';
}
else if (currentItemType == "MusicAlbum" || currentItemType == "MusicArtist") {
else if (currentItemType === "MusicAlbum" || currentItemType === "MusicArtist") {
cssClass += " squareCard squareCard-scalable";
padderClass = 'cardPadder-square';
}
@ -297,7 +299,7 @@
page.querySelector('#txtLookupName').value = '';
if (item.Type == "Person" || item.Type == "BoxSet") {
if (item.Type === "Person" || item.Type === "BoxSet") {
page.querySelector('.fldLookupYear').classList.add('hide');
page.querySelector('#txtLookupYear').value = '';
@ -455,7 +457,7 @@
dlg.querySelector('#txtLookupName').value = itemName;
if (itemType == "Person" || itemType == "BoxSet") {
if (itemType === "Person" || itemType === "BoxSet") {
dlg.querySelector('.fldLookupYear').classList.add('hide');
dlg.querySelector('#txtLookupYear').value = '';

View file

@ -3,7 +3,7 @@ define(['browser', 'appSettings', 'events'], function (browser, appSettings, eve
function setLayout(self, layout, selectedLayout) {
if (layout == selectedLayout) {
if (layout === selectedLayout) {
self[layout] = true;
document.documentElement.classList.add('layout-' + layout);
} else {
@ -12,7 +12,7 @@ define(['browser', 'appSettings', 'events'], function (browser, appSettings, eve
}
}
function layoutManager() {
function LayoutManager() {
var self = this;
@ -62,7 +62,7 @@ define(['browser', 'appSettings', 'events'], function (browser, appSettings, eve
self.autoLayout();
}
};
};
}
return new layoutManager();
return new LayoutManager();
});

View file

@ -1,8 +1,9 @@
define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutManager', 'globalize', 'datetime', 'userdataButtons', 'apphost', 'css!./listview'], function (itemHelper, mediaInfo, indicators, connectionManager, layoutManager, globalize, datetime, userdataButtons, appHost) {
'use strict';
function getIndex(item, options) {
if (options.index == 'disc') {
if (options.index === 'disc') {
return item.ParentIndexNumber == null ? '' : globalize.translate('sharedcomponents#ValueDiscNumber', item.ParentIndexNumber);
}
@ -10,9 +11,11 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
var sortBy = (options.sortBy || '').toLowerCase();
var code, name;
if (sortBy.indexOf('sortname') == 0) {
if (sortBy.indexOf('sortname') === 0) {
if (item.Type == 'Episode') return '';
if (item.Type === 'Episode') {
return '';
}
// SortName
name = (item.SortName || item.Name || '?')[0].toUpperCase();
@ -24,11 +27,11 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
return name.toUpperCase();
}
if (sortBy.indexOf('officialrating') == 0) {
if (sortBy.indexOf('officialrating') === 0) {
return item.OfficialRating || globalize.translate('sharedcomponents#Unrated');
}
if (sortBy.indexOf('communityrating') == 0) {
if (sortBy.indexOf('communityrating') === 0) {
if (item.CommunityRating == null) {
return globalize.translate('sharedcomponents#Unrated');
@ -36,7 +39,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
return Math.floor(item.CommunityRating);
}
if (sortBy.indexOf('criticrating') == 0) {
if (sortBy.indexOf('criticrating') === 0) {
if (item.CriticRating == null) {
return globalize.translate('sharedcomponents#Unrated');
@ -44,7 +47,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
return Math.floor(item.CriticRating);
}
if (sortBy.indexOf('metascore') == 0) {
if (sortBy.indexOf('metascore') === 0) {
if (item.Metascore == null) {
return globalize.translate('sharedcomponents#Unrated');
@ -52,10 +55,12 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
return Math.floor(item.Metascore);
}
if (sortBy.indexOf('albumartist') == 0) {
if (sortBy.indexOf('albumartist') === 0) {
// SortName
if (!item.AlbumArtist) return '';
if (!item.AlbumArtist) {
return '';
}
name = item.AlbumArtist[0].toUpperCase();
@ -78,9 +83,9 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
type: "Primary"
};
if (item.ImageTags && item.ImageTags['Primary']) {
if (item.ImageTags && item.ImageTags.Primary) {
options.tag = item.ImageTags['Primary'];
options.tag = item.ImageTags.Primary;
return apiClient.getScaledImageUrl(item.Id, options);
}
@ -144,7 +149,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
var groupTitle = '';
var action = options.action || 'link';
var isLargeStyle = options.imageSize == 'large';
var isLargeStyle = options.imageSize === 'large';
var enableOverview = options.enableOverview;
var clickEntireItem = layoutManager.tv ? true : false;
@ -163,13 +168,13 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
var itemGroupTitle = getIndex(item, options);
if (itemGroupTitle != groupTitle) {
if (itemGroupTitle !== groupTitle) {
if (html) {
html += '</div>';
}
if (i == 0) {
if (i === 0) {
html += '<h1 class="listGroupHeader listGroupHeader-first">';
}
else {
@ -187,7 +192,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
var cssClass = "listItem";
if (options.highlight !== false) {
if (i % 2 == 1) {
if (i % 2 === 1) {
cssClass += ' listItem-odd';
}
}
@ -270,7 +275,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
var parentTitle = null;
if (options.showParentTitle) {
if (item.Type == 'Episode') {
if (item.Type === 'Episode') {
parentTitle = item.SeriesName;
}
@ -306,23 +311,23 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
}
if (options.artist !== false) {
if (item.ArtistItems && item.Type != 'MusicAlbum') {
if (item.ArtistItems && item.Type !== 'MusicAlbum') {
textlines.push(item.ArtistItems.map(function (a) {
return a.Name;
}).join(', '));
}
if (item.AlbumArtist && item.Type == 'MusicAlbum') {
if (item.AlbumArtist && item.Type === 'MusicAlbum') {
textlines.push(item.AlbumArtist);
}
}
if (item.Type == 'Game') {
if (item.Type === 'Game') {
textlines.push(item.GameSystem);
}
if (item.Type == 'TvChannel') {
if (item.Type === 'TvChannel') {
if (item.CurrentProgram) {
textlines.push(itemHelper.getDisplayName(item.CurrentProgram));
@ -340,7 +345,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
html += '<div class="' + cssClass + '">';
var moreIcon = appHost.moreIcon == 'dots-horiz' ? '&#xE5D3;' : '&#xE5D4;';
var moreIcon = appHost.moreIcon === 'dots-horiz' ? '&#xE5D3;' : '&#xE5D4;';
html += getTextLinesHtml(textlines, isLargeStyle);
@ -376,7 +381,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
}
}
if (!options.recordButton && (item.Type == 'Timer' || item.Type == 'Program')) {
if (!options.recordButton && (item.Type === 'Timer' || item.Type === 'Program')) {
html += indicators.getTimerIndicator(item).replace('indicatorIcon', 'indicatorIcon listItemAside');
}

View file

@ -1,4 +1,5 @@
define(['css!./loading-legacy'], function () {
'use strict';
var loadingElem;

View file

@ -1,4 +1,5 @@
define(['css!./loading-lite'], function () {
'use strict';
var loadingElem;

View file

@ -1,17 +1,18 @@
define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', 'css!./mediainfo.css', 'programStyles'], function (datetime, globalize, embyRouter, itemHelper) {
'use strict';
function getTimerIndicator(item) {
var status;
if (item.Type == 'SeriesTimer') {
if (item.Type === 'SeriesTimer') {
return '<i class="md-icon mediaInfoItem mediaInfoIconItem mediaInfoTimerIcon">&#xE062;</i>';
}
else if (item.TimerId || item.SeriesTimerId) {
status = item.Status || 'Cancelled';
}
else if (item.Type == 'Timer') {
else if (item.Type === 'Timer') {
status = item.Status;
}
@ -21,7 +22,7 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
if (item.SeriesTimerId) {
if (status != 'Cancelled') {
if (status !== 'Cancelled') {
return '<i class="md-icon mediaInfoItem mediaInfoIconItem mediaInfoTimerIcon">&#xE062;</i>';
}
@ -93,12 +94,13 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
var miscInfo = [];
options = options || {};
var text, date, minutes;
var count;
var showFolderRuntime = item.Type == "MusicAlbum" || item.MediaType == 'MusicArtist' || item.MediaType == 'Playlist' || item.MediaType == 'MusicGenre';
var showFolderRuntime = item.Type === "MusicAlbum" || item.MediaType === 'MusicArtist' || item.MediaType === 'Playlist' || item.MediaType === 'MusicGenre';
if (showFolderRuntime) {
var count = item.SongCount || item.ChildCount;
count = item.SongCount || item.ChildCount;
if (count) {
@ -110,9 +112,9 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
}
}
else if (item.Type == "PhotoAlbum" || item.Type == "BoxSet") {
else if (item.Type === "PhotoAlbum" || item.Type === "BoxSet") {
var count = item.ChildCount;
count = item.ChildCount;
if (count) {
@ -120,7 +122,7 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
}
}
if (item.Type == "Episode" || item.MediaType == 'Photo') {
if (item.Type === "Episode" || item.MediaType === 'Photo') {
if (item.PremiereDate) {
@ -136,7 +138,7 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
}
}
if (item.StartDate && item.Type != 'Program') {
if (item.StartDate && item.Type !== 'Program') {
try {
date = datetime.parseISO8601Date(item.StartDate);
@ -144,7 +146,7 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
text = datetime.toLocaleDateString(date);
miscInfo.push(text);
if (item.Type != "Recording") {
if (item.Type !== "Recording") {
text = datetime.getDisplayTime(date);
miscInfo.push(text);
}
@ -154,9 +156,9 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
}
}
if (options.year !== false && item.ProductionYear && item.Type == "Series") {
if (options.year !== false && item.ProductionYear && item.Type === "Series") {
if (item.Status == "Continuing") {
if (item.Status === "Continuing") {
miscInfo.push(globalize.translate('sharedcomponents#SeriesYearToPresent', item.ProductionYear));
}
@ -170,7 +172,7 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
var endYear = datetime.parseISO8601Date(item.EndDate).getFullYear();
if (endYear != item.ProductionYear) {
if (endYear !== item.ProductionYear) {
text += "-" + datetime.parseISO8601Date(item.EndDate).getFullYear();
}
@ -184,7 +186,7 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
}
}
if (item.Type == 'Program') {
if (item.Type === 'Program') {
if (item.IsLive) {
miscInfo.push({
@ -228,7 +230,7 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
}
if (options.year !== false) {
if (item.Type != "Series" && item.Type != "Episode" && item.Type != "Person" && item.MediaType != 'Photo' && item.Type != 'Program') {
if (item.Type !== "Series" && item.Type !== "Episode" && item.Type !== "Person" && item.MediaType !== 'Photo' && item.Type !== 'Program') {
if (item.ProductionYear) {
@ -247,9 +249,9 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
}
}
if (item.RunTimeTicks && item.Type != "Series" && item.Type != 'Program' && !showFolderRuntime && options.runtime !== false) {
if (item.RunTimeTicks && item.Type !== "Series" && item.Type !== 'Program' && !showFolderRuntime && options.runtime !== false) {
if (item.Type == "Audio") {
if (item.Type === "Audio") {
miscInfo.push(datetime.getDisplayRunningTime(item.RunTimeTicks));
@ -273,11 +275,11 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
miscInfo.push("3D");
}
if (item.MediaType == 'Photo' && item.Width && item.Height) {
if (item.MediaType === 'Photo' && item.Width && item.Height) {
miscInfo.push(item.Width + "x" + item.Height);
}
if (options.container !== false && item.Type == 'Audio' && item.Container) {
if (options.container !== false && item.Type === 'Audio' && item.Container) {
miscInfo.push(item.Container);
}
@ -313,7 +315,7 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
function getEndsAt(item) {
if (item.MediaType == 'Video' && item.RunTimeTicks) {
if (item.MediaType === 'Video' && item.RunTimeTicks) {
if (!item.StartDate) {
var endDate = new Date().getTime() + (item.RunTimeTicks / 10000);
@ -444,7 +446,7 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
if (options.interactive == null) {
options.interactive = false;
}
if (item.Type == 'Program') {
if (item.Type === 'Program') {
return getProgramInfoHtml(item, options);
}

View file

@ -1,4 +1,5 @@
define(['itemHelper', 'dom', 'layoutManager', 'dialogHelper', 'datetime', 'loading', 'focusManager', 'connectionManager', 'globalize', 'require', 'shell', 'dom', 'emby-checkbox', 'emby-input', 'emby-select', 'listViewStyle', 'emby-textarea', 'emby-button', 'paper-icon-button-light', 'css!./../formdialog'], function (itemHelper, dom, layoutManager, dialogHelper, datetime, loading, focusManager, connectionManager, globalize, require, shell, dom) {
define(['itemHelper', 'dom', 'layoutManager', 'dialogHelper', 'datetime', 'loading', 'focusManager', 'connectionManager', 'globalize', 'require', 'shell', 'emby-checkbox', 'emby-input', 'emby-select', 'listViewStyle', 'emby-textarea', 'emby-button', 'paper-icon-button-light', 'css!./../formdialog'], function (itemHelper, dom, layoutManager, dialogHelper, datetime, loading, focusManager, connectionManager, globalize, require, shell) {
'use strict';
var currentContext;
var metadataEditorInfo;
@ -33,7 +34,7 @@
var newContentType = form.querySelector('#selectContentType').value || '';
if ((metadataEditorInfo.ContentType || '') != newContentType) {
if ((metadataEditorInfo.ContentType || '') !== newContentType) {
apiClient.ajax({
@ -104,7 +105,7 @@
var parts = date.toISOString().split('T');
// If the date is the same, preserve the time
if (parts[0].indexOf(val) == 0) {
if (parts[0].indexOf(val) === 0) {
var iso = parts[1];
@ -189,14 +190,14 @@
item.PreferredMetadataLanguage = form.querySelector('#selectLanguage').value;
item.PreferredMetadataCountryCode = form.querySelector('#selectCountry').value;
if (currentItem.Type == "Person") {
if (currentItem.Type === "Person") {
var placeOfBirth = form.querySelector('#txtPlaceOfBirth').value;
item.ProductionLocations = placeOfBirth ? [placeOfBirth] : [];
}
if (currentItem.Type == "Series") {
if (currentItem.Type === "Series") {
// 600000000
var seriesRuntime = form.querySelector('#txtSeriesRuntime').value;
@ -248,7 +249,7 @@
personEditor.show(person).then(function (updatedPerson) {
var isNew = index == -1;
var isNew = index === -1;
if (isNew) {
currentItem.People.push(updatedPerson);
@ -308,7 +309,7 @@
if (msg.MessageType === "LibraryChanged") {
if (msg.Data.ItemsUpdated.indexOf(currentItem.Id) != -1) {
if (msg.Data.ItemsUpdated.indexOf(currentItem.Id) !== -1) {
console.log('Item updated - reloading metadata');
reload(currentContext, currentItem.Id, currentItem.ServerId);
@ -400,16 +401,17 @@
context.querySelector('#peopleList').addEventListener('click', function (e) {
var index;
var btnDeletePerson = dom.parentWithClass(e.target, 'btnDeletePerson');
if (btnDeletePerson) {
var index = parseInt(btnDeletePerson.getAttribute('data-index'));
index = parseInt(btnDeletePerson.getAttribute('data-index'));
currentItem.People.splice(index, 1);
populatePeople(context, currentItem.People);
}
var btnEditPerson = dom.parentWithClass(e.target, 'btnEditPerson');
if (btnEditPerson) {
var index = parseInt(btnEditPerson.getAttribute('data-index'));
index = parseInt(btnEditPerson.getAttribute('data-index'));
editPerson(context, currentItem.People[index], index);
}
});
@ -535,7 +537,7 @@
// Context is optional and restricts the querySelector to the context
function hideElement(selector, context, multiple) {
context = context || document;
if (typeof selector == 'string') {
if (typeof selector === 'string') {
var elements = multiple ? context.querySelectorAll(selector) : [context.querySelector(selector)];
@ -554,7 +556,7 @@
// Context is optional and restricts the querySelector to the context
function showElement(selector, context, multiple) {
context = context || document;
if (typeof selector == 'string') {
if (typeof selector === 'string') {
var elements = multiple ? context.querySelectorAll(selector) : [context.querySelector(selector)];
@ -569,31 +571,31 @@
}
function setFieldVisibilities(context, item) {
if (item.Path && item.LocationType != 'Remote') {
if (item.Path && item.LocationType !== 'Remote') {
showElement('#fldPath', context);
} else {
hideElement('#fldPath', context);
}
if (item.Type == "Series" || item.Type == "Movie" || item.Type == "Trailer") {
if (item.Type === "Series" || item.Type === "Movie" || item.Type === "Trailer") {
showElement('#fldOriginalName', context);
} else {
hideElement('#fldOriginalName', context);
}
if (item.Type == "Series") {
if (item.Type === "Series") {
showElement('#fldSeriesRuntime', context);
} else {
hideElement('#fldSeriesRuntime', context);
}
if (item.Type == "Series" || item.Type == "Person") {
if (item.Type === "Series" || item.Type === "Person") {
showElement('#fldEndDate', context);
} else {
hideElement('#fldEndDate', context);
}
if (item.Type == "Movie" || item.MediaType == "Game" || item.MediaType == "Trailer" || item.Type == "MusicVideo") {
if (item.Type === "Movie" || item.MediaType === "Game" || item.MediaType === "Trailer" || item.Type === "MusicVideo") {
showElement('#fldBudget', context);
showElement('#fldRevenue', context);
} else {
@ -601,19 +603,19 @@
hideElement('#fldRevenue', context);
}
if (item.Type == "MusicAlbum") {
if (item.Type === "MusicAlbum") {
showElement('#albumAssociationMessage', context);
} else {
hideElement('#albumAssociationMessage', context)
hideElement('#albumAssociationMessage', context);
}
if (item.MediaType == "Game") {
if (item.MediaType === "Game") {
showElement('#fldPlayers', context);
} else {
hideElement('#fldPlayers', context);
}
if (item.Type == "Movie" || item.Type == "Trailer") {
if (item.Type === "Movie" || item.Type === "Trailer") {
showElement('#fldCriticRating', context);
showElement('#fldCriticRatingSummary', context);
} else {
@ -621,19 +623,19 @@
hideElement('#fldCriticRatingSummary', context);
}
if (item.Type == "Movie") {
if (item.Type === "Movie") {
showElement('#fldAwardSummary', context);
} else {
hideElement('#fldAwardSummary', context);
}
if (item.Type == "Movie" || item.Type == "Trailer") {
if (item.Type === "Movie" || item.Type === "Trailer") {
showElement('#fldMetascore', context);
} else {
hideElement('#fldMetascore', context);
}
if (item.Type == "Series") {
if (item.Type === "Series") {
showElement('#fldStatus', context);
showElement('#fldAirDays', context);
showElement('#fldAirTime', context);
@ -643,19 +645,19 @@
hideElement('#fldAirTime', context);
}
if (item.MediaType == "Video" && item.Type != "TvChannel") {
if (item.MediaType === "Video" && item.Type !== "TvChannel") {
showElement('#fld3dFormat', context);
} else {
hideElement('#fld3dFormat', context);
}
if (item.Type == "Audio") {
if (item.Type === "Audio") {
showElement('#fldAlbumArtist', context);
} else {
hideElement('#fldAlbumArtist', context);
}
if (item.Type == "Audio" || item.Type == "MusicVideo") {
if (item.Type === "Audio" || item.Type === "MusicVideo") {
showElement('#fldArtist', context);
showElement('#fldAlbum', context);
} else {
@ -663,26 +665,26 @@
hideElement('#fldAlbum', context);
}
if (item.Type == "Episode") {
if (item.Type === "Episode") {
showElement('#collapsibleDvdEpisodeInfo', context);
} else {
hideElement('#collapsibleDvdEpisodeInfo', context);
}
if (item.Type == "Episode" && item.ParentIndexNumber == 0) {
if (item.Type === "Episode" && item.ParentIndexNumber === 0) {
showElement('#collapsibleSpecialEpisodeInfo', context);
} else {
hideElement('#collapsibleSpecialEpisodeInfo', context);
}
if (item.Type == "Person" || item.Type == "Genre" || item.Type == "Studio" || item.Type == "GameGenre" || item.Type == "MusicGenre" || item.Type == "TvChannel") {
if (item.Type === "Person" || item.Type === "Genre" || item.Type === "Studio" || item.Type === "GameGenre" || item.Type === "MusicGenre" || item.Type === "TvChannel") {
hideElement('#fldCommunityRating', context);
hideElement('#fldCommunityVoteCount', context);
hideElement('#genresCollapsible', context);
hideElement('#peopleCollapsible', context);
hideElement('#studiosCollapsible', context);
if (item.Type == "TvChannel") {
if (item.Type === "TvChannel") {
showElement('#fldOfficialRating', context);
} else {
hideElement('#fldOfficialRating', context);
@ -698,7 +700,7 @@
showElement('#fldCustomRating', context);
}
if (item.Type == "TvChannel") {
if (item.Type === "TvChannel") {
hideElement('#tagsCollapsible', context);
hideElement('#metadataSettingsCollapsible', context);
hideElement('#fldPremiereDate', context);
@ -712,19 +714,19 @@
showElement('#fldYear', context);
}
if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "BoxSet") {
if (item.Type === "Movie" || item.Type === "Trailer" || item.Type === "BoxSet") {
showElement('#keywordsCollapsible', context);
} else {
hideElement('#keywordsCollapsible', context);
}
if (item.MediaType == "Video" && item.Type != "TvChannel") {
if (item.MediaType === "Video" && item.Type !== "TvChannel") {
showElement('#fldSourceType', context);
} else {
hideElement('#fldSourceType', context);
}
if (item.Type == "Person") {
if (item.Type === "Person") {
//todo
context.querySelector('#txtProductionYear').label(globalize.translate('sharedcomponents#LabelBirthYear'));
context.querySelector("#txtPremiereDate").label(globalize.translate('sharedcomponents#LabelBirthDate'));
@ -737,20 +739,20 @@
hideElement('#fldPlaceOfBirth');
}
if (item.MediaType == "Video" && item.Type != "TvChannel") {
if (item.MediaType === "Video" && item.Type !== "TvChannel") {
showElement('#fldOriginalAspectRatio');
} else {
hideElement('#fldOriginalAspectRatio');
}
if (item.Type == "Audio" || item.Type == "Episode" || item.Type == "Season") {
if (item.Type === "Audio" || item.Type === "Episode" || item.Type === "Season") {
showElement('#fldIndexNumber');
if (item.Type == "Episode") {
if (item.Type === "Episode") {
context.querySelector('#txtIndexNumber').label(globalize.translate('sharedcomponents#LabelEpisodeNumber'));
} else if (item.Type == "Season") {
} else if (item.Type === "Season") {
context.querySelector('#txtIndexNumber').label(globalize.translate('sharedcomponents#LabelSeasonNumber'));
} else if (item.Type == "Audio") {
} else if (item.Type === "Audio") {
context.querySelector('#txtIndexNumber').label(globalize.translate('sharedcomponents#LabelTrackNumber'));
} else {
context.querySelector('#txtIndexNumber').label(globalize.translate('sharedcomponents#LabelNumber'));
@ -759,12 +761,12 @@
hideElement('#fldIndexNumber');
}
if (item.Type == "Audio" || item.Type == "Episode") {
if (item.Type === "Audio" || item.Type === "Episode") {
showElement('#fldParentIndexNumber');
if (item.Type == "Episode") {
if (item.Type === "Episode") {
context.querySelector('#txtParentIndexNumber').label(globalize.translate('LabelSeasonNumber'));
} else if (item.Type == "Audio") {
} else if (item.Type === "Audio") {
context.querySelector('#txtParentIndexNumber').label(globalize.translate('LabelDiscNumber'));
} else {
context.querySelector('#txtParentIndexNumber').label(globalize.translate('LabelParentNumber'));
@ -773,7 +775,7 @@
hideElement('#fldParentIndexNumber', context);
}
if (item.Type == "BoxSet") {
if (item.Type === "BoxSet") {
showElement('#fldDisplayOrder', context);
context.querySelector('#selectDisplayOrder').innerHTML = '<option value="SortName">' + globalize.translate('sharedcomponents#SortName') + '</option><option value="PremiereDate">' + globalize.translate('sharedcomponents#ReleaseDate') + '</option>';
@ -784,7 +786,7 @@
var displaySettingFields = context.querySelectorAll('.fldDisplaySetting');
var hiddenDisplaySettingFields = Array.prototype.filter.call(displaySettingFields, function (field) {
return field.style.display != 'none';
return field.style.display !== 'none';
});
if (hiddenDisplaySettingFields.length) {
@ -815,7 +817,7 @@
context.querySelector('#select3dFormat', context).value = item.Video3DFormat || "";
Array.prototype.forEach.call(context.querySelectorAll('.chkAirDay', context), function (el) {
el.checked = (item.AirDays || []).indexOf(el.getAttribute('data-day')) != -1;
el.checked = (item.AirDays || []).indexOf(el.getAttribute('data-day')) !== -1;
});
populateListView(context.querySelector('#listGenres'), item.Genres);
@ -830,9 +832,9 @@
var chkLockData = context.querySelector("#chkLockData");
chkLockData.checked = lockData;
if (chkLockData.checked) {
hideElement('.providerSettingsContainer', context)
hideElement('.providerSettingsContainer', context);
} else {
showElement('.providerSettingsContainer', context)
showElement('.providerSettingsContainer', context);
}
populateInternetProviderSettings(context, item, item.LockedFields);
@ -957,7 +959,7 @@
ratings.push({ Name: rating.Name, Value: rating.Name });
if (rating.Name == currentValue) {
if (rating.Name === currentValue) {
currentValueFound = true;
}
}
@ -1037,7 +1039,7 @@
html += (person.Name || '');
html += '</div>';
if (person.Role && person.Role != lastType) {
if (person.Role && person.Role !== lastType) {
html += '<div class="secondary">' + (person.Role) + '</div>';
}
@ -1060,7 +1062,7 @@
var field = fields[i];
var name = field.name;
var value = field.value || field.name;
var checkedHtml = currentFields.indexOf(value) == -1 ? ' checked' : '';
var checkedHtml = currentFields.indexOf(value) === -1 ? ' checked' : '';
html += '<label>';
html += '<input type="checkbox" is="emby-checkbox" class="selectLockedField" data-value="' + value + '"' + checkedHtml + '/>';
html += '<span>' + name + '</span>';
@ -1071,7 +1073,7 @@
function populateInternetProviderSettings(context, item, lockedFields) {
var container = context.querySelector('.providerSettingsContainer');
lockedFields = lockedFields || new Array();
lockedFields = lockedFields || [];
var metadatafields = [
{ name: globalize.translate('sharedcomponents#Name'), value: "Name" },
@ -1081,13 +1083,13 @@
{ name: globalize.translate('sharedcomponents#People'), value: "Cast" }
];
if (item.Type == "Person") {
if (item.Type === "Person") {
metadatafields.push({ name: globalize.translate('sharedcomponents#BirthLocation'), value: "ProductionLocations" });
} else {
metadatafields.push({ name: globalize.translate('sharedcomponents#ProductionLocations'), value: "ProductionLocations" });
}
if (item.Type == "Series") {
if (item.Type === "Series") {
metadatafields.push({ name: globalize.translate('Runtime'), value: "Runtime" });
}
@ -1097,7 +1099,7 @@
metadatafields.push({ name: globalize.translate('sharedcomponents#Images'), value: "Images" });
metadatafields.push({ name: globalize.translate('sharedcomponents#Backdrops'), value: "Backdrops" });
if (item.Type == "Game") {
if (item.Type === "Game") {
metadatafields.push({ name: globalize.translate('sharedcomponents#Screenshots'), value: "Screenshots" });
}
@ -1133,13 +1135,13 @@
setFieldVisibilities(context, item);
fillItemInfo(context, item, metadataEditorInfo.ParentalRatingOptions);
if (item.MediaType == "Video" && item.Type != "Episode") {
if (item.MediaType === "Video" && item.Type !== "Episode") {
showElement('#fldShortOverview', context);
} else {
hideElement('#fldShortOverview', context);
}
if (item.MediaType == "Video" && item.Type != "Episode") {
if (item.MediaType === "Video" && item.Type !== "Episode") {
showElement('#fldTagline', context);
} else {
hideElement('#fldTagline', context);

View file

@ -1,4 +1,5 @@
define(['dialogHelper', 'layoutManager', 'globalize', 'require', 'paper-icon-button-light', 'emby-input', 'emby-select', 'css!./../formdialog'], function (dialogHelper, layoutManager, globalize, require) {
'use strict';
function centerFocus(elem, horiz, on) {
require(['scrollHelper'], function (scrollHelper) {
@ -59,7 +60,7 @@
dlg.querySelector('.selectPersonType').addEventListener('change', function (e) {
if (this.value == 'Actor') {
if (this.value === 'Actor') {
dlg.querySelector('.fldRole').classList.remove('hide');
} else {
dlg.querySelector('.fldRole').classList.add('hide');

View file

@ -1,73 +1,71 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.multiDownload = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
define([], function () {
'use strict';
function fallback(urls) {
var i = 0;
function fallback(urls) {
var i = 0;
(function createIframe() {
var frame = document.createElement('iframe');
frame.style.display = 'none';
frame.src = urls[i++];
document.documentElement.appendChild(frame);
(function createIframe() {
var frame = document.createElement('iframe');
frame.style.display = 'none';
frame.src = urls[i++];
document.documentElement.appendChild(frame);
// the download init has to be sequential otherwise IE only use the first
var interval = setInterval(function () {
if (frame.contentWindow.document.readyState === 'complete') {
clearInterval(interval);
// the download init has to be sequential otherwise IE only use the first
var interval = setInterval(function () {
if (frame.contentWindow.document.readyState === 'complete') {
clearInterval(interval);
// Safari needs a timeout
setTimeout(function () {
frame.parentNode.removeChild(frame);
}, 1000);
// Safari needs a timeout
setTimeout(function () {
frame.parentNode.removeChild(frame);
}, 1000);
if (i < urls.length) {
createIframe();
}
}
}, 100);
})();
}
if (i < urls.length) {
createIframe();
}
}
}, 100);
})();
}
function isFirefox() {
// sad panda :(
return /Firefox\//i.test(navigator.userAgent);
}
function isFirefox() {
// sad panda :(
return /Firefox\//i.test(navigator.userAgent);
}
function sameDomain(url) {
var a = document.createElement('a');
a.href = url;
function sameDomain(url) {
var a = document.createElement('a');
a.href = url;
return location.hostname === a.hostname && location.protocol === a.protocol;
}
return location.hostname === a.hostname && location.protocol === a.protocol;
}
function download(url) {
var a = document.createElement('a');
a.download = '';
a.href = url;
// firefox doesn't support `a.click()`...
a.dispatchEvent(new MouseEvent('click'));
}
function download(url) {
var a = document.createElement('a');
a.download = '';
a.href = url;
// firefox doesn't support `a.click()`...
a.dispatchEvent(new MouseEvent('click'));
}
module.exports = function (urls) {
if (!urls) {
throw new Error('`urls` required');
}
return function (urls) {
if (!urls) {
throw new Error('`urls` required');
}
if (typeof document.createElement('a').download === 'undefined') {
return fallback(urls);
}
if (typeof document.createElement('a').download === 'undefined') {
return fallback(urls);
}
var delay = 0;
var delay = 0;
urls.forEach(function (url) {
// the download init has to be sequential for firefox if the urls are not on the same domain
if (isFirefox() && !sameDomain(url)) {
return setTimeout(download.bind(null, url), 100 * ++delay);
}
urls.forEach(function (url) {
// the download init has to be sequential for firefox if the urls are not on the same domain
if (isFirefox() && !sameDomain(url)) {
return setTimeout(download.bind(null, url), 100 * ++delay);
}
download(url);
});
}
},{}]},{},[1])(1)
download(url);
});
};
});

View file

@ -1,4 +1,5 @@
define(['browser', 'appStorage', 'apphost', 'loading', 'connectionManager', 'globalize', 'embyRouter', 'dom', 'css!./multiselect'], function (browser, appStorage, appHost, loading, connectionManager, globalize, embyRouter, dom) {
'use strict';
var selectedItems = [];
var selectedElements = [];
@ -54,7 +55,7 @@
if (selected) {
var current = selectedItems.filter(function (i) {
return i == id;
return i === id;
});
if (!current.length) {
@ -64,10 +65,10 @@
} else {
selectedItems = selectedItems.filter(function (i) {
return i != id;
return i !== id;
});
selectedElements = selectedElements.filter(function (i) {
return i != chkItemSelect;
return i !== chkItemSelect;
});
}
@ -130,7 +131,7 @@
html += '<span class="itemSelectionCount"></span>';
html += '</div>';
var moreIcon = appHost.moreIcon == 'dots-horiz' ? '&#xE5D3;' : '&#xE5D4;';
var moreIcon = appHost.moreIcon === 'dots-horiz' ? '&#xE5D3;' : '&#xE5D4;';
html += '<button is="paper-icon-button-light" class="btnSelectionPanelOptions autoSize" style="margin-left:auto;"><i class="md-icon">' + moreIcon + '</i></button>';
selectionCommandsPanel.innerHTML = html;
@ -354,7 +355,7 @@
var container = dom.parentWithAttribute(i, 'is', 'emby-itemscontainer');
if (container && elems.indexOf(container) == -1) {
if (container && elems.indexOf(container) === -1) {
elems.push(container);
}
});
@ -400,7 +401,7 @@
require(['emby-checkbox'], function () {
var cards = document.querySelectorAll('.card');
for (var i = 0, length = cards.length; i < length; i++) {
showSelection(cards[i], initialCard == cards[i]);
showSelection(cards[i], initialCard === cards[i]);
}
showSelectionCommands();

View file

@ -1,4 +1,5 @@
define(['serverNotifications', 'playbackManager', 'events', 'globalize', 'require'], function (serverNotifications, playbackManager, events, globalize, require) {
'use strict';
function onOneDocumentClick() {
@ -171,18 +172,18 @@ define(['serverNotifications', 'playbackManager', 'events', 'globalize', 'requir
data: {}
};
if (status == 'completed') {
if (status === 'completed') {
notification.title = globalize.translate('sharedcomponents#PackageInstallCompleted').replace('{0}', installation.Name + ' ' + installation.Version);
notification.vibrate = true;
}
else if (status == 'cancelled') {
else if (status === 'cancelled') {
notification.title = globalize.translate('sharedcomponents#PackageInstallCancelled').replace('{0}', installation.Name + ' ' + installation.Version);
}
else if (status == 'failed') {
else if (status === 'failed') {
notification.title = globalize.translate('sharedcomponents#PackageInstallFailed').replace('{0}', installation.Name + ' ' + installation.Version);
notification.vibrate = true;
}
else if (status == 'progress') {
else if (status === 'progress') {
notification.title = globalize.translate('sharedcomponents#InstallingPackage').replace('{0}', installation.Name + ' ' + installation.Version);
notification.actions =
@ -197,14 +198,14 @@ define(['serverNotifications', 'playbackManager', 'events', 'globalize', 'requir
notification.data.id = installation.id;
}
if (status == 'progress') {
if (status === 'progress') {
var percentComplete = Math.round(installation.PercentComplete || 0);
notification.body = percentComplete + '% complete.';
}
var timeout = status == 'cancelled' ? 5000 : 0;
var timeout = status === 'cancelled' ? 5000 : 0;
showNotification(notification, timeout, apiClient);
});

View file

@ -1,5 +1,7 @@
define([], function () {
'use strict';
/**
* Detect click event
*/
@ -123,7 +125,9 @@ define([], function () {
*/
page.base = function (path) {
if (0 === arguments.length) return base;
if (0 === arguments.length) {
return base;
}
base = path;
};
@ -142,17 +146,31 @@ define([], function () {
page.start = function (options) {
options = options || {};
if (running) return;
if (running) {
return;
}
running = true;
if (false === options.dispatch) dispatch = false;
if (false === options.decodeURLComponents) decodeURLComponents = false;
if (false !== options.popstate) window.addEventListener('popstate', onpopstate, false);
if (false === options.dispatch) {
dispatch = false;
}
if (false === options.decodeURLComponents) {
decodeURLComponents = false;
}
if (false !== options.popstate) {
window.addEventListener('popstate', onpopstate, false);
}
if (false !== options.click) {
document.addEventListener(clickEvent, onclick, false);
}
if (options.enableHistory != null) enableHistory = options.enableHistory;
if (true === options.hashbang) hashbang = true;
if (!dispatch) return;
if (options.enableHistory != null) {
enableHistory = options.enableHistory;
}
if (true === options.hashbang) {
hashbang = true;
}
if (!dispatch) {
return;
}
var url = (hashbang && ~location.hash.indexOf('#!')) ? location.hash.substr(2) + location.search : location.pathname + location.search + location.hash;
page.replace(url, null, true, dispatch);
};
@ -164,7 +182,9 @@ define([], function () {
*/
page.stop = function () {
if (!running) return;
if (!running) {
return;
}
page.current = '';
page.len = 0;
running = false;
@ -186,8 +206,12 @@ define([], function () {
var ctx = new Context(path, state);
ctx.isBack = isBack;
page.current = ctx.path;
if (false !== dispatch) page.dispatch(ctx);
if (false !== ctx.handled && false !== push) ctx.pushState();
if (false !== dispatch) {
page.dispatch(ctx);
}
if (false !== ctx.handled && false !== push) {
ctx.pushState();
}
return ctx;
};
@ -286,7 +310,9 @@ define([], function () {
page.current = ctx.path;
ctx.init = init;
ctx.save(); // save before dispatching, which may redirect
if (false !== dispatch) page.dispatch(ctx);
if (false !== dispatch) {
page.dispatch(ctx);
}
return ctx;
};
@ -306,7 +332,9 @@ define([], function () {
function nextExit() {
var fn = page.exits[j++];
if (!fn) return nextEnter();
if (!fn) {
return nextEnter();
}
fn(prev, nextExit);
}
@ -317,7 +345,9 @@ define([], function () {
ctx.handled = false;
return;
}
if (!fn) return unhandled(ctx);
if (!fn) {
return unhandled(ctx);
}
fn(ctx, nextEnter);
}
@ -338,7 +368,9 @@ define([], function () {
*/
function unhandled(ctx) {
if (ctx.handled) return;
if (ctx.handled) {
return;
}
var current;
if (hashbang) {
@ -347,7 +379,9 @@ define([], function () {
current = location.pathname + location.search;
}
if (current === ctx.canonicalPath) return;
if (current === ctx.canonicalPath) {
return;
}
page.stop();
ctx.handled = false;
location.href = ctx.canonicalPath;
@ -392,12 +426,16 @@ define([], function () {
*/
function Context(path, state) {
if ('/' === path[0] && 0 !== path.indexOf(base)) path = base + (hashbang ? '#!' : '') + path;
if ('/' === path[0] && 0 !== path.indexOf(base)) {
path = base + (hashbang ? '#!' : '') + path;
}
var i = path.indexOf('?');
this.canonicalPath = path;
this.path = path.replace(base, '') || '/';
if (hashbang) this.path = this.path.replace('#!', '') || '/';
if (hashbang) {
this.path = this.path.replace('#!', '') || '/';
}
this.title = document.title;
this.state = state || {};
@ -409,7 +447,9 @@ define([], function () {
// fragment
this.hash = '';
if (!hashbang) {
if (!~this.path.indexOf('#')) return;
if (!~this.path.indexOf('#')) {
return;
}
var parts = this.path.split('#');
this.path = parts[0];
this.hash = decodeURLEncodedURIComponent(parts[1]) || '';
@ -507,7 +547,9 @@ define([], function () {
Route.prototype.middleware = function (fn) {
var self = this;
return function (ctx, next) {
if (self.match(ctx.path, ctx.params)) return fn(ctx, next);
if (self.match(ctx.path, ctx.params)) {
return fn(ctx, next);
}
next();
};
};
@ -528,7 +570,9 @@ define([], function () {
pathname = ~qsIndex ? path.slice(0, qsIndex) : path,
m = this.regexp.exec(decodeURIComponent(pathname));
if (!m) return false;
if (!m) {
return false;
}
for (var i = 1, len = m.length; i < len; ++i) {
var key = keys[i - 1];
@ -587,8 +631,12 @@ define([], function () {
});
}
return function onpopstate(e) {
if (!loaded) return;
if (ignorePopState(e)) return;
if (!loaded) {
return;
}
if (ignorePopState(e)) {
return;
}
if (e.state) {
var path = e.state.path;
page.replace(path, e.state, null, null, true);
@ -603,43 +651,63 @@ define([], function () {
function onclick(e) {
if (1 !== which(e)) return;
if (1 !== which(e)) {
return;
}
if (e.metaKey || e.ctrlKey || e.shiftKey) return;
if (e.defaultPrevented) return;
if (e.metaKey || e.ctrlKey || e.shiftKey) {
return;
}
if (e.defaultPrevented) {
return;
}
// ensure link
var el = e.target;
while (el && 'A' !== el.nodeName) el = el.parentNode;
if (!el || 'A' !== el.nodeName) return;
while (el && 'A' !== el.nodeName) {
el = el.parentNode;
}
if (!el || 'A' !== el.nodeName) {
return;
}
// Ignore if tag has
// 1. "download" attribute
// 2. rel="external" attribute
if (el.hasAttribute('download') || el.getAttribute('rel') === 'external') return;
if (el.hasAttribute('download') || el.getAttribute('rel') === 'external') {
return;
}
// ensure non-hash for the same path
var link = el.getAttribute('href');
if (link == '#') {
if (link === '#') {
e.preventDefault();
return;
}
if (!hashbang && el.pathname === location.pathname && (el.hash || '#' === link)) return;
if (!hashbang && el.pathname === location.pathname && (el.hash || '#' === link)) {
return;
}
// Check for mailto: in the href
if (link && link.indexOf('mailto:') > -1) return;
if (link && link.indexOf('mailto:') > -1) {
return;
}
// check target
if (el.target) return;
if (el.target) {
return;
}
// x-origin
if (!sameOrigin(el.href)) return;
if (!sameOrigin(el.href)) {
return;
}
@ -653,9 +721,13 @@ define([], function () {
path = path.substr(base.length);
}
if (hashbang) path = path.replace('#!', '');
if (hashbang) {
path = path.replace('#!', '');
}
if (base && orig === path) return;
if (base && orig === path) {
return;
}
e.preventDefault();
page.show(orig);
@ -676,7 +748,9 @@ define([], function () {
function sameOrigin(href) {
var origin = location.protocol + '//' + location.hostname;
if (location.port) origin += ':' + location.port;
if (location.port) {
origin += ':' + location.port;
}
return (href && (0 === href.indexOf(origin)));
}
@ -688,17 +762,17 @@ define([], function () {
* @type {RegExp}
*/
var PATH_REGEXP = new RegExp([
// Match escaped characters that would otherwise appear in future matches.
// This allows the user to escape special characters that won't transform.
'(\\\\.)',
// Match Express-style parameters and un-named parameters with a prefix
// and optional suffixes. Matches appear as:
//
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))'
].join('|'), 'g')
// Match escaped characters that would otherwise appear in future matches.
// This allows the user to escape special characters that won't transform.
'(\\\\.)',
// Match Express-style parameters and un-named parameters with a prefix
// and optional suffixes. Matches appear as:
//
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))'
].join('|'), 'g');
/**
* Parse a string for the raw tokens.
@ -707,42 +781,42 @@ define([], function () {
* @return {Array}
*/
function parse(str) {
var tokens = []
var key = 0
var index = 0
var path = ''
var res
var tokens = [];
var key = 0;
var index = 0;
var path = '';
var res;
while ((res = PATH_REGEXP.exec(str)) != null) {
var m = res[0]
var escaped = res[1]
var offset = res.index
path += str.slice(index, offset)
index = offset + m.length
var m = res[0];
var escaped = res[1];
var offset = res.index;
path += str.slice(index, offset);
index = offset + m.length;
// Ignore already escaped sequences.
if (escaped) {
path += escaped[1]
continue
path += escaped[1];
continue;
}
// Push the current path onto the tokens.
if (path) {
tokens.push(path)
path = ''
tokens.push(path);
path = '';
}
var prefix = res[2]
var name = res[3]
var capture = res[4]
var group = res[5]
var suffix = res[6]
var asterisk = res[7]
var prefix = res[2];
var name = res[3];
var capture = res[4];
var group = res[5];
var suffix = res[6];
var asterisk = res[7];
var repeat = suffix === '+' || suffix === '*'
var optional = suffix === '?' || suffix === '*'
var delimiter = prefix || '/'
var pattern = capture || group || (asterisk ? '.*' : '[^' + delimiter + ']+?')
var repeat = suffix === '+' || suffix === '*';
var optional = suffix === '?' || suffix === '*';
var delimiter = prefix || '/';
var pattern = capture || group || (asterisk ? '.*' : '[^' + delimiter + ']+?');
tokens.push({
name: name || key++,
@ -751,24 +825,24 @@ define([], function () {
optional: optional,
repeat: repeat,
pattern: escapeGroup(pattern)
})
});
}
// Match any characters still remaining.
if (index < str.length) {
path += str.substr(index)
path += str.substr(index);
}
// If the path exists, push it onto the end.
if (path) {
tokens.push(path)
tokens.push(path);
}
return tokens
return tokens;
}
var isarray = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) == '[object Array]';
return Object.prototype.toString.call(arr) === '[object Array]';
};
/**
@ -778,7 +852,7 @@ define([], function () {
* @return {String}
*/
function escapeString(str) {
return str.replace(/([.+*?=^!:${}()[\]|\/])/g, '\\$1')
return str.replace(/([.+*?=^!:${}()[\]|\/])/g, '\\$1');
}
/**
@ -788,7 +862,7 @@ define([], function () {
* @return {String}
*/
function escapeGroup(group) {
return group.replace(/([=!:$\/()])/g, '\\$1')
return group.replace(/([=!:$\/()])/g, '\\$1');
}
/**
@ -799,8 +873,8 @@ define([], function () {
* @return {RegExp}
*/
function attachKeys(re, keys) {
re.keys = keys
return re
re.keys = keys;
return re;
}
/**
@ -810,7 +884,7 @@ define([], function () {
* @return {String}
*/
function flags(options) {
return options.sensitive ? '' : 'i'
return options.sensitive ? '' : 'i';
}
/**
@ -822,7 +896,7 @@ define([], function () {
*/
function regexpToRegexp(path, keys) {
// Use a negative lookahead to match only capturing groups.
var groups = path.source.match(/\((?!\?)/g)
var groups = path.source.match(/\((?!\?)/g);
if (groups) {
for (var i = 0; i < groups.length; i++) {
@ -833,11 +907,11 @@ define([], function () {
optional: false,
repeat: false,
pattern: null
})
});
}
}
return attachKeys(path, keys)
return attachKeys(path, keys);
}
/**
@ -849,15 +923,15 @@ define([], function () {
* @return {RegExp}
*/
function arrayToRegexp(path, keys, options) {
var parts = []
var parts = [];
for (var i = 0; i < path.length; i++) {
parts.push(pathToRegexp(path[i], keys, options).source)
parts.push(pathToRegexp(path[i], keys, options).source);
}
var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
return attachKeys(regexp, keys)
return attachKeys(regexp, keys);
}
/**
@ -869,17 +943,17 @@ define([], function () {
* @return {RegExp}
*/
function stringToRegexp(path, keys, options) {
var tokens = parse(path)
var re = tokensToRegExp(tokens, options)
var tokens = parse(path);
var re = tokensToRegExp(tokens, options);
// Attach keys back to the regexp.
for (var i = 0; i < tokens.length; i++) {
if (typeof tokens[i] !== 'string') {
keys.push(tokens[i])
keys.push(tokens[i]);
}
}
return attachKeys(re, keys)
return attachKeys(re, keys);
}
/**
@ -891,39 +965,39 @@ define([], function () {
* @return {RegExp}
*/
function tokensToRegExp(tokens, options) {
options = options || {}
options = options || {};
var strict = options.strict
var end = options.end !== false
var route = ''
var lastToken = tokens[tokens.length - 1]
var endsWithSlash = typeof lastToken === 'string' && /\/$/.test(lastToken)
var strict = options.strict;
var end = options.end !== false;
var route = '';
var lastToken = tokens[tokens.length - 1];
var endsWithSlash = typeof lastToken === 'string' && /\/$/.test(lastToken);
// Iterate over the tokens and create our regexp string.
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i]
var token = tokens[i];
if (typeof token === 'string') {
route += escapeString(token)
route += escapeString(token);
} else {
var prefix = escapeString(token.prefix)
var capture = token.pattern
var prefix = escapeString(token.prefix);
var capture = token.pattern;
if (token.repeat) {
capture += '(?:' + prefix + capture + ')*'
capture += '(?:' + prefix + capture + ')*';
}
if (token.optional) {
if (prefix) {
capture = '(?:' + prefix + '(' + capture + '))?'
capture = '(?:' + prefix + '(' + capture + '))?';
} else {
capture = '(' + capture + ')?'
capture = '(' + capture + ')?';
}
} else {
capture = prefix + '(' + capture + ')'
capture = prefix + '(' + capture + ')';
}
route += capture
route += capture;
}
}
@ -932,18 +1006,18 @@ define([], function () {
// is valid at the end of a path match, not in the middle. This is important
// in non-ending mode, where "/test/" shouldn't match "/test//route".
if (!strict) {
route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?'
route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?';
}
if (end) {
route += '$'
route += '$';
} else {
// In non-ending mode, we need the capturing groups to match as much as
// possible by using a positive lookahead to the end or next path segment.
route += strict && endsWithSlash ? '' : '(?=\\/|$)'
route += strict && endsWithSlash ? '' : '(?=\\/|$)';
}
return new RegExp('^' + route, flags(options))
return new RegExp('^' + route, flags(options));
}
/**
@ -959,24 +1033,24 @@ define([], function () {
* @return {RegExp}
*/
function pathToRegexp(path, keys, options) {
keys = keys || []
keys = keys || [];
if (!isarray(keys)) {
options = keys
keys = []
options = keys;
keys = [];
} else if (!options) {
options = {}
options = {};
}
if (path instanceof RegExp) {
return regexpToRegexp(path, keys, options)
return regexpToRegexp(path, keys, options);
}
if (isarray(path)) {
return arrayToRegexp(path, keys, options)
return arrayToRegexp(path, keys, options);
}
return stringToRegexp(path, keys, options)
return stringToRegexp(path, keys, options);
}
return page;

View file

@ -1,4 +1,5 @@
define(['shell', 'dialogHelper', 'loading', 'layoutManager', 'connectionManager', 'userSettings', 'embyRouter', 'globalize', 'emby-input', 'paper-icon-button-light', 'emby-select', 'material-icons', 'css!./../formdialog', 'emby-button'], function (shell, dialogHelper, loading, layoutManager, connectionManager, userSettings, embyRouter, globalize) {
'use strict';
var currentServerId;

View file

@ -1,4 +1,5 @@
define(['actionsheet', 'datetime', 'playbackManager', 'globalize', 'appSettings'], function (actionsheet, datetime, playbackManager, globalize, appSettings) {
'use strict';
var isMobileApp = window.Dashboard != null;
@ -14,10 +15,10 @@ define(['actionsheet', 'datetime', 'playbackManager', 'globalize', 'appSettings'
var serverId = item.ServerId;
var resumePositionTicks = item.UserData ? item.UserData.PlaybackPositionTicks : null;
var showExternalPlayer = isMobileApp && mediaType == 'Video' && !isFolder && appSettings.enableExternalPlayers();
var playableItemId = itemType == 'Program' ? channelId : itemId;
var showExternalPlayer = isMobileApp && mediaType === 'Video' && !isFolder && appSettings.enableExternalPlayers();
var playableItemId = itemType === 'Program' ? channelId : itemId;
if (!resumePositionTicks && mediaType != "Audio" && !isFolder && !showExternalPlayer) {
if (!resumePositionTicks && mediaType !== "Audio" && !isFolder && !showExternalPlayer) {
playbackManager.play({
ids: [playableItemId],
serverId: serverId
@ -58,14 +59,14 @@ define(['actionsheet', 'datetime', 'playbackManager', 'globalize', 'appSettings'
});
}
if (itemType == "Audio" || itemType == "MusicAlbum" || itemType == "MusicArtist" || itemType == "MusicGenre") {
if (itemType === "Audio" || itemType === "MusicAlbum" || itemType === "MusicArtist" || itemType === "MusicGenre") {
menuItems.push({
name: globalize.translate('sharedcomponents#InstantMix'),
id: 'instantmix'
});
}
if (isFolder || itemType == "MusicArtist" || itemType == "MusicGenre") {
if (isFolder || itemType === "MusicArtist" || itemType === "MusicGenre") {
menuItems.push({
name: globalize.translate('sharedcomponents#Shuffle'),
id: 'shuffle'

View file

@ -1,4 +1,5 @@
define([], function () {
'use strict';
function replaceAll(str, find, replace) {

View file

@ -1,4 +1,5 @@
define(['dialogHelper', 'layoutManager', 'scrollHelper', 'globalize', 'dom', 'require', 'material-icons', 'emby-button', 'paper-icon-button-light', 'emby-input', 'formDialogStyle'], function (dialogHelper, layoutManager, scrollHelper, globalize, dom, require) {
'use strict';
function setInputProperties(dlg, options) {
var txtInput = dlg.querySelector('#txtInput');

View file

@ -1,4 +1,5 @@
define([], function () {
'use strict';
function getVideoQualityOptions(maxStreamingBitrate, videoWidth) {
@ -60,12 +61,12 @@
var option = options[i];
if (selectedIndex == -1 && option.bitrate <= maxStreamingBitrate) {
if (selectedIndex === -1 && option.bitrate <= maxStreamingBitrate) {
selectedIndex = i;
}
}
if (selectedIndex == -1) {
if (selectedIndex === -1) {
selectedIndex = options.length - 1;
}
@ -74,7 +75,7 @@
}
return options;
};
}
return {
getVideoQualityOptions: getVideoQualityOptions

View file

@ -1,4 +1,5 @@
define(['dialogHelper', 'globalize', 'layoutManager', 'mediaInfo', 'apphost', 'connectionManager', 'require', 'loading', 'scrollHelper', 'datetime', 'imageLoader', 'recordingFields', 'events', 'emby-checkbox', 'emby-button', 'emby-collapse', 'emby-input', 'paper-icon-button-light', 'css!./../formdialog', 'css!./recordingcreator', 'material-icons'], function (dialogHelper, globalize, layoutManager, mediaInfo, appHost, connectionManager, require, loading, scrollHelper, datetime, imageLoader, recordingFields, events) {
'use strict';
var currentDialog;
var closeAction;
@ -110,7 +111,7 @@
function executeCloseAction(action, programId, serverId) {
if (action == 'play') {
if (action === 'play') {
require(['playbackManager'], function (playbackManager) {

View file

@ -1,4 +1,5 @@
define(['dialogHelper', 'globalize', 'layoutManager', 'mediaInfo', 'apphost', 'connectionManager', 'require', 'loading', 'scrollHelper', 'imageLoader', 'scrollStyles', 'emby-button', 'emby-collapse', 'emby-input', 'paper-icon-button-light', 'css!./../formdialog', 'css!./recordingcreator', 'material-icons'], function (dialogHelper, globalize, layoutManager, mediaInfo, appHost, connectionManager, require, loading, scrollHelper, imageLoader) {
'use strict';
var currentDialog;
var recordingDeleted = false;

View file

@ -1,4 +1,5 @@
define(['globalize', 'connectionManager', 'require', 'loading', 'apphost', 'dom', 'recordingHelper', 'events', 'registrationServices', 'paper-icon-button-light', 'emby-button'], function (globalize, connectionManager, require, loading, appHost, dom, recordingHelper, events, registrationServices) {
'use strict';
function getRegistration(apiClient, programId, feature) {
@ -114,7 +115,7 @@
parent.querySelector('.seriesRecordingButton .buttonText').innerHTML = globalize.translate('sharedcomponents#RecordSeries');
}
if (program.TimerId && program.Status != 'Cancelled') {
if (program.TimerId && program.Status !== 'Cancelled') {
parent.querySelector('.btnManageRecording').classList.remove('visibilityHide');
parent.querySelector('.singleRecordingButton .recordingIcon').classList.add('recordingIcon-active');
parent.querySelector('.singleRecordingButton .buttonText').innerHTML = globalize.translate('sharedcomponents#DoNotRecord');
@ -142,7 +143,7 @@
});
}
function recordingEditor(options) {
function RecordingEditor(options) {
this.options = options;
this.embed();
}
@ -155,7 +156,7 @@
var options = this.options;
if (!this.TimerId || this.Status == 'Cancelled') {
if (!this.TimerId || this.Status === 'Cancelled') {
return;
}
@ -206,7 +207,7 @@
var button = dom.parentWithTag(e.target, 'BUTTON');
var isChecked = !button.querySelector('i').classList.contains('recordingIcon-active');
var hasEnabledTimer = this.TimerId && this.Status != 'Cancelled';
var hasEnabledTimer = this.TimerId && this.Status !== 'Cancelled';
if (isChecked) {
if (!hasEnabledTimer) {
@ -272,7 +273,7 @@
}
}
recordingEditor.prototype.embed = function () {
RecordingEditor.prototype.embed = function () {
var self = this;
@ -299,19 +300,19 @@
});
};
recordingEditor.prototype.hasChanged = function () {
RecordingEditor.prototype.hasChanged = function () {
return this.changed;
};
recordingEditor.prototype.refresh = function () {
RecordingEditor.prototype.refresh = function () {
fetchData(this);
};
recordingEditor.prototype.destroy = function () {
RecordingEditor.prototype.destroy = function () {
};
return recordingEditor;
return RecordingEditor;
});

View file

@ -1,4 +1,5 @@
define(['globalize', 'loading'], function (globalize, loading) {
'use strict';
function changeRecordingToSeries(apiClient, timerId, programId) {
@ -129,7 +130,7 @@
var apiClient = connectionManager.getApiClient(serverId);
var hasTimer = timerId && timerStatus != 'Cancelled';
var hasTimer = timerId && timerStatus !== 'Cancelled';
if (seriesTimerId && hasTimer) {

View file

@ -1,4 +1,5 @@
define(['dialogHelper', 'globalize', 'layoutManager', 'mediaInfo', 'apphost', 'connectionManager', 'require', 'loading', 'scrollHelper', 'imageLoader', 'datetime', 'scrollStyles', 'emby-button', 'emby-checkbox', 'emby-input', 'emby-select', 'paper-icon-button-light', 'css!./../formdialog', 'css!./recordingcreator', 'material-icons'], function (dialogHelper, globalize, layoutManager, mediaInfo, appHost, connectionManager, require, loading, scrollHelper, imageLoader, datetime) {
'use strict';
var currentDialog;
var recordingUpdated = false;
@ -60,9 +61,9 @@
item.PrePaddingSeconds = form.querySelector('#txtPrePaddingMinutes').value * 60;
item.PostPaddingSeconds = form.querySelector('#txtPostPaddingMinutes').value * 60;
item.RecordAnyChannel = form.querySelector('.selectChannels').value == 'all';
item.RecordAnyTime = form.querySelector('.selectAirTime').value == 'any';
item.RecordNewOnly = form.querySelector('.selectShowType').value == 'new';
item.RecordAnyChannel = form.querySelector('.selectChannels').value === 'all';
item.RecordAnyTime = form.querySelector('.selectAirTime').value === 'any';
item.RecordNewOnly = form.querySelector('.selectShowType').value === 'new';
item.SkipEpisodesInLibrary = form.querySelector('.chkSkipEpisodesInLibrary').checked;
item.KeepUpTo = form.querySelector('.selectKeepUpTo').value;
@ -116,9 +117,9 @@
var text;
if (i == 0) {
if (i === 0) {
text = globalize.translate('sharedcomponents#AsManyAsPossible');
} else if (i == 1) {
} else if (i === 1) {
text = globalize.translate('sharedcomponents#ValueOneEpisode');
} else {
text = globalize.translate('sharedcomponents#ValueEpisodeCount', i);

View file

@ -1,4 +1,5 @@
define(['shell', 'dialogHelper', 'loading', 'layoutManager', 'connectionManager', 'embyRouter', 'globalize', 'emby-input', 'emby-checkbox', 'paper-icon-button-light', 'emby-select', 'material-icons', 'css!./../formdialog', 'emby-button'], function (shell, dialogHelper, loading, layoutManager, connectionManager, embyRouter, globalize) {
'use strict';
function parentWithClass(elem, className) {
@ -71,7 +72,7 @@
var apiClient = connectionManager.getApiClient(options.serverId);
var replaceAllImages = dlg.querySelector('.chkReplaceImages').checked;
var replaceAllMetadata = dlg.querySelector('#selectMetadataRefreshMode').value == 'all';
var replaceAllMetadata = dlg.querySelector('#selectMetadataRefreshMode').value === 'all';
options.itemIds.forEach(function (itemId) {
apiClient.refreshItem(itemId, {

View file

@ -1,4 +1,5 @@
define(['appSettings', 'loading', 'apphost', 'iapManager', 'events', 'shell', 'globalize', 'dialogHelper', 'connectionManager', 'layoutManager', 'emby-button'], function (appSettings, loading, appHost, iapManager, events, shell, globalize, dialogHelper, connectionManager, layoutManager) {
'use strict';
var currentDisplayingProductInfos = [];
var currentDisplayingResolve = null;
@ -150,14 +151,14 @@
console.log('validateFeature: ' + feature);
return iapManager.isUnlockedByDefault(feature).then(function () {
return iapManager.isUnlockedByDefault(feature, options).then(function () {
return showPeriodicMessageIfNeeded(feature);
}, function () {
var unlockableFeatureCacheKey = 'featurepurchased-' + feature;
if (appSettings.get(unlockableFeatureCacheKey) == '1') {
if (appSettings.get(unlockableFeatureCacheKey) === '1') {
return Promise.resolve();
}
@ -173,7 +174,7 @@
return Promise.resolve();
}
if (appSettings.get(unlockableCacheKey) == '1') {
if (appSettings.get(unlockableCacheKey) === '1') {
return Promise.resolve();
}
}
@ -318,7 +319,7 @@
html += '</div>';
}
if (dialogOptions.feature == 'playback') {
if (dialogOptions.feature === 'playback') {
html += '<p>';
html += '<button is="emby-button" type="button" class="raised button-cancel block btnCloseDialog"><span>' + globalize.translate('sharedcomponents#ButtonPlayOneMinute') + '</span></button>';
html += '</p>';
@ -356,7 +357,7 @@
dialogHelper.close(dlg);
};
if (dialogOptions.feature == 'playback') {
if (dialogOptions.feature === 'playback') {
alertText({
text: globalize.translate('sharedcomponents#ThankYouForTryingEnjoyOneMinute'),
title: globalize.translate('sharedcomponents#HeaderTryPlayback')
@ -475,7 +476,7 @@
var featureId = this.getAttribute('data-featureid');
if (this.getAttribute('data-email') == 'true') {
if (this.getAttribute('data-email') === 'true') {
getUserEmail().then(function (email) {
iapManager.beginPurchase(featureId, email);
});
@ -595,7 +596,7 @@
if (resolve && currentDisplayingProductInfos.filter(function (p) {
return product.id == p.id;
return product.id === p.id;
}).length) {

View file

@ -1,17 +1,20 @@
define(function () {
'use strict';
var requireCss = {};
requireCss.normalize = function (name, normalize) {
if (name.substr(name.length - 4, 4) == '.css')
if (name.substr(name.length - 4, 4) === '.css') {
name = name.substr(0, name.length - 4);
}
return normalize(name);
}
};
var importedCss = [];
function isLoaded(url) {
return importedCss.indexOf(url) != -1;
return importedCss.indexOf(url) !== -1;
}
function removeFromLoadHistory(url) {
@ -19,7 +22,7 @@ define(function () {
url = url.toLowerCase();
importedCss = importedCss.filter(function (c) {
return url.indexOf(c.toLowerCase()) == -1;
return url.indexOf(c.toLowerCase()) === -1;
});
}
@ -29,13 +32,13 @@ define(function () {
var srch = '/emby-webcomponents/require/requirecss';
var index = cssId.indexOf(srch);
if (index != -1) {
if (index !== -1) {
cssId = 'css' + cssId.substring(index + srch.length);
}
var url = cssId + '.css';
if (url.indexOf('://') == -1) {
if (url.indexOf('://') === -1) {
url = config.baseUrl + url;
}
@ -58,7 +61,7 @@ define(function () {
} else {
load();
}
}
};
window.requireCss = {
removeStylesheet: function (stylesheet) {

View file

@ -1,4 +1,5 @@
define(function () {
'use strict';
var importedFiles = [];
@ -11,18 +12,18 @@ define(function () {
var url = cssId + '.html';
if (url.indexOf('://') == -1) {
if (url.indexOf('://') === -1) {
url = config.baseUrl + url;
}
if (importedFiles.indexOf(url) == -1) {
if (importedFiles.indexOf(url) === -1) {
importedFiles.push(url);
var link = document.createElement('link');
link.rel = 'import';
if (config.urlArgs) {
if (url.toLowerCase().indexOf('bower_') == -1 || url.toLowerCase().indexOf('emby-webcomponents') != -1) {
if (url.toLowerCase().indexOf('bower_') === -1 || url.toLowerCase().indexOf('emby-webcomponents') !== -1) {
url = url + config.urlArgs(cssId, url);
}
}
@ -39,8 +40,9 @@ define(function () {
},
normalize: function (name, normalize) {
if (name.substr(name.length - 5, 5) == '.html')
if (name.substr(name.length - 5, 5) === '.html') {
name = name.substr(0, name.length - 5);
}
return normalize(name);
}

View file

@ -1,10 +1,11 @@
define(function () {
'use strict';
return {
load: function (url, req, load, config) {
if (url.indexOf('://') == -1) {
if (url.indexOf('://') === -1) {
url = config.baseUrl + url;
}

View file

@ -1,4 +1,5 @@
define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'browser', 'pageJs', 'appSettings', 'apphost'], function (loading, dom, viewManager, skinManager, pluginManager, backdrop, browser, page, appSettings, appHost) {
'use strict';
var embyRouter = {
showLocalLogin: function (apiClient, serverId, manualLogin) {
@ -108,10 +109,10 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
var url = route.contentPath || route.path;
if (url.indexOf('://') == -1) {
if (url.indexOf('://') === -1) {
// Put a slash at the beginning but make sure to avoid a double slash
if (url.indexOf('/') != 0) {
if (url.indexOf('/') !== 0) {
url = '/' + url;
}
@ -162,7 +163,7 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
var currentViewLoadRequest;
function sendRouteToViewManager(ctx, next, route, controllerFactory) {
if (isDummyBackToHome && route.type == 'home') {
if (isDummyBackToHome && route.type === 'home') {
isDummyBackToHome = false;
return;
}
@ -198,7 +199,7 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
if (!isBackNav) {
// Don't force a new view for home due to the back menu
//if (route.type != 'home') {
//if (route.type !== 'home') {
onNewViewNeeded();
return;
//}
@ -269,7 +270,7 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
firstConnectionResult = null;
if (firstResult.State != MediaBrowser.ConnectionState.SignedIn && !route.anonymous) {
if (firstResult.State !== MediaBrowser.ConnectionState.SignedIn && !route.anonymous) {
handleConnectionResult(firstResult, loading);
return;
@ -334,7 +335,7 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
function validateRole(apiClient, role) {
if (role == 'admin') {
if (role === 'admin') {
return apiClient.getCurrentUser().then(function (user) {
if (user.Policy.IsAdministrator) {
@ -395,13 +396,13 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
var path = window.location.pathname || '';
var index = path.lastIndexOf('/');
if (index != -1) {
if (index !== -1) {
path = path.substring(index);
} else {
path = '/' + path;
}
if (!path || path == '/') {
if (!path || path === '/') {
path = '/index.html';
}
@ -411,7 +412,7 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
var baseRoute = window.location.href.split('?')[0].replace(getRequestFile(), '');
// support hashbang
baseRoute = baseRoute.split('#')[0];
if (baseRoute.lastIndexOf('/') == baseRoute.length - 1) {
if (baseRoute.lastIndexOf('/') === baseRoute.length - 1) {
baseRoute = baseRoute.substring(0, baseRoute.length - 1);
}
function baseUrl() {
@ -431,7 +432,7 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
var index = currentPath.indexOf('?');
var search = '';
if (index != -1) {
if (index !== -1) {
search = currentPath.substring(index);
}
@ -444,10 +445,11 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
var regex = new RegExp(regexS, "i");
var results = regex.exec(url || getWindowLocationSearch());
if (results == null)
if (results == null) {
return "";
else
} else {
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
}
function back() {
@ -462,7 +464,7 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
return false;
}
if (curr.type == 'home') {
if (curr.type === 'home') {
return false;
}
return page.canGoBack();
@ -472,10 +474,10 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
var baseRoute = baseUrl();
path = path.replace(baseRoute, '');
if (currentRouteInfo && currentRouteInfo.path == path) {
if (currentRouteInfo && currentRouteInfo.path === path) {
// can't use this with home right now due to the back menu
if (currentRouteInfo.route.type != 'home') {
if (currentRouteInfo.route.type !== 'home') {
loading.hide();
return Promise.resolve();
}
@ -511,7 +513,7 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
var skin = skinManager.getCurrentSkin();
var homeRoute = skin.getRoutes().filter(function (r) {
return r.type == 'home';
return r.type === 'home';
})[0];
return show(pluginManager.mapRoute(skin, homeRoute));
@ -528,7 +530,7 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
});
} else {
if (arguments.length == 2) {
if (arguments.length === 2) {
options = arguments[1];
}
skinManager.getCurrentSkin().showItem(item, options);
@ -543,7 +545,7 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
var skin = skinManager.getCurrentSkin();
var homeRoute = skin.getRoutes().filter(function (r) {
return r.type == 'video-osd';
return r.type === 'video-osd';
})[0];
return show(pluginManager.mapRoute(skin, homeRoute));
@ -572,13 +574,13 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
backgroundContainer = document.querySelector('.backgroundContainer');
}
if (level == 'full' || level == 2) {
if (level === 'full' || level === 2) {
backdrop.clear(true);
document.documentElement.classList.add('transparentDocument');
backgroundContainer.classList.add('backgroundContainer-transparent');
backdropContainer.classList.add('hide');
}
else if (level == 'backdrop' || level == 1) {
else if (level === 'backdrop' || level === 1) {
backdrop.externalBackdrop(true);
document.documentElement.classList.add('transparentDocument');
backgroundContainer.classList.add('backgroundContainer-transparent');
@ -600,7 +602,7 @@ define(['loading', 'dom', 'viewManager', 'skinManager', 'pluginManager', 'backdr
function setBaseRoute() {
var baseRoute = window.location.pathname.replace(getRequestFile(), '');
if (baseRoute.lastIndexOf('/') == baseRoute.length - 1) {
if (baseRoute.lastIndexOf('/') === baseRoute.length - 1) {
baseRoute = baseRoute.substring(0, baseRoute.length - 1);
}

View file

@ -1,4 +1,5 @@
define(['browser', 'layoutManager', 'dom', 'focusManager', 'scrollStyles'], function (browser, layoutManager, dom, focusManager) {
'use strict';
/**
* Return type of the value.
@ -65,7 +66,7 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'scrollStyles'], func
var scrollerFactory = function (frame, options) {
// Extend options
var o = extend({}, {
var o = Object.assign({}, {
slidee: null, // Selector, DOM element, or jQuery object with DOM element representing SLIDEE.
horizontal: false, // Switch to horizontal mode.
@ -483,7 +484,6 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'scrollStyles'], func
if (type(item) === 'boolean') {
immediate = item;
item = undefined;
v
}
if (item === undefined) {
@ -539,14 +539,6 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'scrollStyles'], func
to('center', item, immediate);
};
function extend() {
for (var i = 1; i < arguments.length; i++)
for (var key in arguments[i])
if (arguments[i].hasOwnProperty(key))
arguments[0][key] = arguments[i][key];
return arguments[0];
}
/**
* Initialize continuous movement.
*
@ -642,7 +634,9 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'scrollStyles'], func
dragging.path = sqrt(pow(dragging.pathX, 2) + pow(dragging.pathY, 2));
dragging.delta = o.horizontal ? dragging.pathX : dragging.pathY;
if (!dragging.released && dragging.path < 1) return;
if (!dragging.released && dragging.path < 1) {
return;
}
// We haven't decided whether this is a drag or not...
if (!dragging.init) {
@ -721,7 +715,7 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'scrollStyles'], func
while (element) {
if (interactiveElements.indexOf(element.tagName) != -1) {
if (interactiveElements.indexOf(element.tagName) !== -1) {
return true;
}
@ -832,9 +826,9 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'scrollStyles'], func
}
function onFrameClick(e) {
if (e.which == 1) {
if (e.which === 1) {
var focusableParent = focusManager.focusableParent(e.target);
if (focusableParent && focusableParent != document.activeElement) {
if (focusableParent && focusableParent !== document.activeElement) {
focusableParent.focus();
}
}
@ -851,7 +845,9 @@ define(['browser', 'layoutManager', 'dom', 'focusManager', 'scrollStyles'], func
}
// Disallow multiple instances on the same element
if (frame.sly) throw new Error('There is already a Sly instance on this element');
if (frame.sly) {
throw new Error('There is already a Sly instance on this element');
}
frame.sly = true;

View file

@ -1,4 +1,5 @@
define(['focusManager', 'dom', 'scrollStyles'], function (focusManager, dom) {
'use strict';
function getBoundingClientRect(elem) {

View file

@ -1,4 +1,5 @@
define(['connectionManager', 'events'], function (connectionManager, events) {
'use strict';
var serverNotifications = {};
@ -8,7 +9,7 @@ define(['connectionManager', 'events'], function (connectionManager, events) {
if (msg.MessageType === "UserDataChanged") {
if (msg.Data.UserId == apiClient.getCurrentUserId()) {
if (msg.Data.UserId === apiClient.getCurrentUserId()) {
for (var i = 0, length = msg.Data.UserDataList.length; i < length; i++) {
events.trigger(serverNotifications, 'UserDataChanged', [apiClient, msg.Data.UserDataList[i]]);

View file

@ -1,48 +1,52 @@
var connectionManager;
(function () {
'use strict';
function getApiClient(serverId) {
var connectionManager;
if (connectionManager) {
return Promise.resolve(connectionManager.getApiClient(serverId));
}
function getApiClient(serverId) {
//importScripts('serviceworker-cache-polyfill.js');
return Promise.reject();
}
function executeAction(action, data, serverId) {
return getApiClient(serverId).then(function (apiClient) {
switch (action) {
case 'cancel-install':
var id = data.id;
return apiClient.cancelPackageInstallation(id);
case 'restart':
return apiClient.restartServer();
default:
clients.openWindow("/");
return Promise.resolve();
if (connectionManager) {
return Promise.resolve(connectionManager.getApiClient(serverId));
}
});
}
self.addEventListener('notificationclick', function (event) {
//importScripts('serviceworker-cache-polyfill.js');
var notification = event.notification;
notification.close();
var data = notification.data;
var serverId = data.serverId;
var action = event.action;
if (!action) {
clients.openWindow("/");
event.waitUntil(Promise.resolve());
return;
return Promise.reject();
}
event.waitUntil(executeAction(action, data, serverId));
function executeAction(action, data, serverId) {
}, false);
return getApiClient(serverId).then(function (apiClient) {
switch (action) {
case 'cancel-install':
var id = data.id;
return apiClient.cancelPackageInstallation(id);
case 'restart':
return apiClient.restartServer();
default:
clients.openWindow("/");
return Promise.resolve();
}
});
}
self.addEventListener('notificationclick', function (event) {
var notification = event.notification;
notification.close();
var data = notification.data;
var serverId = data.serverId;
var action = event.action;
if (!action) {
clients.openWindow("/");
event.waitUntil(Promise.resolve());
return;
}
event.waitUntil(executeAction(action, data, serverId));
}, false);
})();

View file

@ -1,4 +1,6 @@
self.addEventListener('sync', function (event) {
if (event.tag == 'emby-sync') {
'use strict';
if (event.tag === 'emby-sync') {
}
});

View file

@ -1,4 +1,5 @@
define(['connectionManager', 'sharingMenu', 'loading'], function (connectionManager, sharingMenu, loading) {
'use strict';
function onSharingCancel(options, apiClient) {

View file

@ -1,4 +1,5 @@
define(['dialogHelper', 'layoutManager', 'globalize', './social-share-kit-1.0.10/dist/js/social-share-kit.min', 'css!./social-share-kit-1.0.10/dist/css/social-share-kit.css', 'emby-button'], function (dialogHelper, layoutManager, globalize) {
'use strict';
function showMenu(options) {
@ -24,7 +25,7 @@
html += '<a href="#" class="ssk ssk-tumblr" style="color:#fff;"></a>';
html += '</div>';
dlg.style['padding'] = '.5em 1.5em 1.5em';
dlg.style.padding = '.5em 1.5em 1.5em';
dlg.innerHTML = html;

View file

@ -1,4 +1,5 @@
define([], function () {
'use strict';
return {
openUrl: function (url) {

View file

@ -1,4 +1,5 @@
define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'globalize', 'loading', 'dom', 'recordingHelper'], function (playbackManager, inputManager, connectionManager, embyRouter, globalize, loading, dom, recordingHelper) {
'use strict';
function playAllFromHere(card, serverId, queue) {
@ -10,7 +11,7 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
var foundCard = false;
for (var i = 0, length = cards.length; i < length; i++) {
if (cards[i] == card) {
if (cards[i] === card) {
foundCard = true;
}
if (foundCard) {
@ -58,7 +59,7 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
}).indexOf(startItemId);
if (index == -1) {
if (index === -1) {
index = 0;
}
@ -82,7 +83,7 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
function showItem(item, options) {
if (item.Type == 'Photo') {
if (item.Type === 'Photo') {
showSlideshow(item.Id, item.ServerId);
return;
@ -108,10 +109,10 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
var apiClient = connectionManager.getApiClient(serverId);
if (type == 'Timer') {
if (type === 'Timer') {
return apiClient.getLiveTvTimer(id);
}
if (type == 'SeriesTimer') {
if (type === 'SeriesTimer') {
return apiClient.getLiveTvSeriesTimer(id);
}
return apiClient.getItem(apiClient.getCurrentUserId(), id);
@ -142,12 +143,14 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
}, options || {})).then(function (result) {
if (result.command == 'playallfromhere' || result.command == 'queueallfromhere') {
var itemsContainer;
if (result.command === 'playallfromhere' || result.command === 'queueallfromhere') {
executeAction(card, options.positionTo, result.command);
}
else if (result.command == 'removefromplaylist' || result.command == 'removefromcollection') {
else if (result.command === 'removefromplaylist' || result.command === 'removefromcollection') {
var itemsContainer = options.itemsContainer || dom.parentWithAttribute(card, 'is', 'emby-itemscontainer');
itemsContainer = options.itemsContainer || dom.parentWithAttribute(card, 'is', 'emby-itemscontainer');
if (itemsContainer) {
itemsContainer.dispatchEvent(new CustomEvent('needsrefresh', {
@ -157,9 +160,9 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
}));
}
}
else if (result.command == 'canceltimer') {
else if (result.command === 'canceltimer') {
var itemsContainer = options.itemsContainer || dom.parentWithAttribute(card, 'is', 'emby-itemscontainer');
itemsContainer = options.itemsContainer || dom.parentWithAttribute(card, 'is', 'emby-itemscontainer');
if (itemsContainer) {
itemsContainer.dispatchEvent(new CustomEvent('timercancelled', {
@ -185,7 +188,7 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
SeriesId: card.getAttribute('data-seriesid'),
ServerId: card.getAttribute('data-serverid'),
MediaType: card.getAttribute('data-mediatype'),
IsFolder: card.getAttribute('data-isfolder') == 'true',
IsFolder: card.getAttribute('data-isfolder') === 'true',
UserData: {
PlaybackPositionTicks: parseInt(card.getAttribute('data-positionticks') || '0')
}
@ -222,23 +225,23 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
var serverId = item.ServerId;
var type = item.Type;
if (action == 'link') {
if (action === 'link') {
showItem(item, {
context: card.getAttribute('data-context')
});
}
else if (action == 'programdialog') {
else if (action === 'programdialog') {
showProgramDialog(item);
}
else if (action == 'instantmix') {
else if (action === 'instantmix') {
playbackManager.instantMix(id, serverId);
}
else if (action == 'play') {
else if (action === 'play') {
var startPositionTicks = parseInt(card.getAttribute('data-positionticks') || '0');
@ -249,25 +252,25 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
});
}
else if (action == 'playallfromhere') {
else if (action === 'playallfromhere') {
playAllFromHere(card, serverId);
}
else if (action == 'queueallfromhere') {
else if (action === 'queueallfromhere') {
playAllFromHere(card, serverId, true);
}
else if (action == 'setplaylistindex') {
else if (action === 'setplaylistindex') {
playbackManager.currentPlaylistIndex(parseInt(card.getAttribute('data-index')));
}
else if (action == 'record') {
else if (action === 'record') {
onRecordCommand(serverId, id, type, card.getAttribute('data-timerid'), card.getAttribute('data-seriestimerid'));
}
else if (action == 'menu') {
else if (action === 'menu') {
var options = target.getAttribute('data-playoptions') == 'false' ?
var options = target.getAttribute('data-playoptions') === 'false' ?
{
shuffle: false,
instantMix: false,
@ -283,17 +286,17 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
showContextMenu(card, options);
}
else if (action == 'playmenu') {
else if (action === 'playmenu') {
showPlayMenu(card, target);
}
else if (action == 'edit') {
else if (action === 'edit') {
getItem(target).then(function (item) {
editItem(item, serverId);
});
}
else if (action == 'playtrailer') {
else if (action === 'playtrailer') {
getItem(target).then(playTrailer);
}
}
@ -315,7 +318,7 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
var serverId = apiClient.serverInfo().Id;
if (item.Type == 'Timer') {
if (item.Type === 'Timer') {
if (item.ProgramId) {
require(['recordingCreator'], function (recordingCreator) {
@ -338,9 +341,9 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
function onRecordCommand(serverId, id, type, timerId, seriesTimerId) {
if (type == 'Program' || timerId || seriesTimerId) {
if (type === 'Program' || timerId || seriesTimerId) {
var programId = type == 'Program' ? id : null;
var programId = type === 'Program' ? id : null;
recordingHelper.toggle(serverId, programId, timerId, seriesTimerId);
}
}
@ -373,7 +376,7 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
var cmd = e.detail.command;
if (cmd == 'play' || cmd == 'record' || cmd == 'menu' || cmd == 'info') {
if (cmd === 'play' || cmd === 'record' || cmd === 'menu' || cmd === 'info') {
var card = dom.parentWithClass(e.target, 'itemAction');
if (card) {

View file

@ -1,4 +1,5 @@
define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'focusManager', 'apphost', 'loading', 'css!./style', 'material-icons', 'paper-icon-button-light'], function (dialogHelper, inputmanager, connectionManager, layoutManager, focusManager, appHost, loading) {
'use strict';
function getImageUrl(item, options, apiClient) {
@ -15,7 +16,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
return apiClient.getScaledImageUrl(item.Id, options);
}
if (options.type == 'Primary') {
if (options.type === 'Primary') {
if (item.AlbumId && item.AlbumPrimaryImageTag) {
options.tag = item.AlbumPrimaryImageTag;
@ -57,7 +58,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
return getBackdropImageUrl(item, imageOptions, apiClient);
} else {
if (item.MediaType == 'Photo' && original) {
if (item.MediaType === 'Photo' && original) {
return apiClient.getUrl("Items/" + item.Id + "/Download", {
api_key: apiClient.accessToken()
});
@ -351,7 +352,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
function playPause() {
var paused = dlg.querySelector('.btnSlideshowPause i').innerHTML != "pause";
var paused = dlg.querySelector('.btnSlideshowPause i').innerHTML !== "pause";
if (paused) {
play();
} else {
@ -387,6 +388,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
}
var _osdOpen = false;
function isOsdOpen() {
return _osdOpen;
}
@ -413,10 +415,12 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
}
var hideTimeout;
function startHideTimer() {
stopHideTimer();
hideTimeout = setTimeout(hideOsd, 4000);
}
function stopHideTimer() {
if (hideTimeout) {
clearTimeout(hideTimeout);
@ -436,8 +440,9 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
requestAnimationFrame(function () {
var keyframes = [
{ transform: 'translate3d(0,' + elem.offsetHeight + 'px,0)', opacity: '.3', offset: 0 },
{ transform: 'translate3d(0,0,0)', opacity: '1', offset: 1 }];
{ transform: 'translate3d(0,' + elem.offsetHeight + 'px,0)', opacity: '.3', offset: 0 },
{ transform: 'translate3d(0,0,0)', opacity: '1', offset: 1 }
];
var timing = { duration: 300, iterations: 1, easing: 'ease-out' };
elem.animate(keyframes, timing).onfinish = function () {
focusManager.focus(elem.querySelector('.btnSlideshowPause'));
@ -454,8 +459,9 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
requestAnimationFrame(function () {
var keyframes = [
{ transform: 'translate3d(0,0,0)', opacity: '1', offset: 0 },
{ transform: 'translate3d(0,' + elem.offsetHeight + 'px,0)', opacity: '.3', offset: 1 }];
{ transform: 'translate3d(0,0,0)', opacity: '1', offset: 0 },
{ transform: 'translate3d(0,' + elem.offsetHeight + 'px,0)', opacity: '.3', offset: 1 }
];
var timing = { duration: 300, iterations: 1, easing: 'ease-out' };
elem.animate(keyframes, timing).onfinish = function () {
elem.classList.add('hide');
@ -465,6 +471,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
}
var lastMouseMoveData;
function onMouseMove(e) {
var eventX = e.screenX || 0;
@ -572,8 +579,9 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
if (newCardImageContainer.animate) {
var keyframes = [
{ opacity: '0', offset: 0 },
{ opacity: '1', offset: 1 }];
{ opacity: '0', offset: 0 },
{ opacity: '1', offset: 1 }
];
var timing = { duration: 1200, iterations: 1 };
newCardImageContainer.animate(keyframes, timing).onfinish = onAnimationFinished;
} else {
@ -615,5 +623,5 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
dialogHelper.close(dialog);
}
};
}
};
});

View file

@ -1,4 +1,5 @@
define(['dialogHelper', 'require', 'layoutManager', 'globalize', 'userSettings', 'connectionManager', 'loading', 'focusManager', 'dom', 'apphost', 'emby-select', 'listViewStyle', 'paper-icon-button-light', 'css!./../formdialog', 'material-icons', 'css!./subtitleeditor', 'emby-button'], function (dialogHelper, require, layoutManager, globalize, userSettings, connectionManager, loading, focusManager, dom, appHost) {
'use strict';
var currentItem;
var hasChanges;
@ -104,7 +105,7 @@
var subs = streams.filter(function (s) {
return s.Type == 'Subtitle';
return s.Type === 'Subtitle';
});
var html = '';
@ -223,7 +224,7 @@
context.querySelector('.noSearchResults').classList.add('hide');
var moreIcon = appHost.moreIcon == 'dots-horiz' ? '&#xE5D3;' : '&#xE5D4;';
var moreIcon = appHost.moreIcon === 'dots-horiz' ? '&#xE5D3;' : '&#xE5D4;';
for (var i = 0, length = results.length; i < length; i++) {
@ -231,7 +232,7 @@
var provider = result.ProviderName;
if (provider != lastProvider) {
if (provider !== lastProvider) {
if (i > 0) {
html += '</div>';
@ -336,7 +337,7 @@
loading.hide();
}
if (typeof itemId == 'string') {
if (typeof itemId === 'string') {
apiClient.getItem(apiClient.getCurrentUserId(), itemId).then(onGetItem);
}
else {

View file

@ -1,4 +1,5 @@
define(['apphost', 'globalize', 'connectionManager', 'layoutManager', 'shell', 'focusManager', 'scrollHelper', 'appSettings', 'paper-icon-button-light', 'formDialogStyle'], function (appHost, globalize, connectionManager, layoutManager, shell, focusManager, scrollHelper, appSettings) {
'use strict';
var currentDialogOptions;
@ -57,7 +58,7 @@
dialogHelper.close(dlg);
require(['toast'], function (toast) {
var msg = target == apiClient.deviceId() ? globalize.translate('sharedcomponents#DownloadScheduled') : globalize.translate('sharedcomponents#SyncJobCreated');
var msg = target === apiClient.deviceId() ? globalize.translate('sharedcomponents#DownloadScheduled') : globalize.translate('sharedcomponents#SyncJobCreated');
toast(msg);
});
@ -109,7 +110,7 @@
require(['toast'], function (toast) {
var msg = targetId == apiClient.deviceId() ? globalize.translate('sharedcomponents#DownloadScheduled') : globalize.translate('sharedcomponents#SyncJobCreated');
var msg = targetId === apiClient.deviceId() ? globalize.translate('sharedcomponents#DownloadScheduled') : globalize.translate('sharedcomponents#SyncJobCreated');
toast(msg);
});
@ -189,7 +190,7 @@
var targetContainerClass = options.isLocalSync ? ' hide' : '';
if (options.showName || dialogOptions.Options.indexOf('Name') != -1) {
if (options.showName || dialogOptions.Options.indexOf('Name') !== -1) {
html += '<div class="inputContainer' + targetContainerClass + '">';
html += '<input is="emby-input" type="text" id="txtSyncJobName" class="txtSyncJobName" required="required" label="' + globalize.translate('sharedcomponents#LabelSyncJobName') + '"/>';
@ -206,7 +207,7 @@
html += targets.map(function (t) {
var isSelected = t.Id == appInfo.deviceId;
var isSelected = t.Id === appInfo.deviceId;
var selectedHtml = isSelected ? ' selected="selected"' : '';
return '<option' + selectedHtml + ' value="' + t.Id + '">' + t.Name + '</option>';
@ -235,7 +236,7 @@
html += '<input is="emby-input" type="number" step=".1" min=".1" id="txtBitrate" label="' + globalize.translate('sharedcomponents#LabelBitrateMbps') + '"/>';
html += '</div>';
if (dialogOptions.Options.indexOf('UnwatchedOnly') != -1) {
if (dialogOptions.Options.indexOf('UnwatchedOnly') !== -1) {
html += '<div class="checkboxContainer checkboxContainer-withDescription">';
html += '<label>';
html += '<input is="emby-checkbox" type="checkbox" id="chkUnwatchedOnly"/>';
@ -245,7 +246,7 @@
html += '</div>';
}
if (dialogOptions.Options.indexOf('SyncNewContent') != -1) {
if (dialogOptions.Options.indexOf('SyncNewContent') !== -1) {
html += '<div class="checkboxContainer checkboxContainer-withDescription">';
html += '<label>';
html += '<input is="emby-checkbox" type="checkbox" id="chkSyncNewContent"/>';
@ -255,7 +256,7 @@
html += '</div>';
}
if (dialogOptions.Options.indexOf('ItemLimit') != -1) {
if (dialogOptions.Options.indexOf('ItemLimit') !== -1) {
html += '<div class="inputContainer">';
html += '<input is="emby-input" type="number" step="1" min="1" id="txtItemLimit" label="' + globalize.translate('sharedcomponents#LabelItemLimit') + '"/>';
html += '<div class="fieldDescription">' + globalize.translate('sharedcomponents#LabelItemLimitHelp') + '</div>';
@ -330,16 +331,16 @@
var firstItem = (options.items || [])[0] || {};
if (firstItem.Type == 'Audio') {
if (firstItem.Type === 'Audio') {
return true;
}
if (firstItem.Type == 'MusicAlbum') {
if (firstItem.Type === 'MusicAlbum') {
return true;
}
if (firstItem.Type == 'MusicArtist') {
if (firstItem.Type === 'MusicArtist') {
return true;
}
if (firstItem.Type == 'MusicGenre') {
if (firstItem.Type === 'MusicGenre') {
return true;
}
@ -492,17 +493,17 @@
var options = currentDialogOptions || {};
var option = (options.ProfileOptions || []).filter(function (o) {
return o.Id == profileId;
return o.Id === profileId;
})[0];
var qualityOptions = options.QualityOptions || [];
if (option) {
form.querySelector('.profileDescription').innerHTML = option.Description || '';
setQualityFieldVisible(form, qualityOptions.length > 0 && option.EnableQualityOptions && options.Options.indexOf('Quality') != -1);
setQualityFieldVisible(form, qualityOptions.length > 0 && option.EnableQualityOptions && options.Options.indexOf('Quality') !== -1);
} else {
form.querySelector('.profileDescription').innerHTML = '';
setQualityFieldVisible(form, qualityOptions.length > 0 && options.Options.indexOf('Quality') != -1);
setQualityFieldVisible(form, qualityOptions.length > 0 && options.Options.indexOf('Quality') !== -1);
}
}
@ -510,7 +511,7 @@
var options = currentDialogOptions || {};
var option = (options.QualityOptions || []).filter(function (o) {
return o.Id == qualityId;
return o.Id === qualityId;
})[0];
var qualityDescription = form.querySelector('.qualityDescription');
@ -524,7 +525,7 @@
var fldBitrate = form.querySelector('.fldBitrate');
var txtBitrate = form.querySelector('#txtBitrate');
if (qualityId == 'custom') {
if (qualityId === 'custom') {
if (fldBitrate) {
fldBitrate.classList.remove('hide');
@ -549,7 +550,7 @@
var fldProfile = form.querySelector('.fldProfile');
var selectProfile = form.querySelector('#selectProfile');
if (options.ProfileOptions.length && options.Options.indexOf('Profile') != -1) {
if (options.ProfileOptions.length && options.Options.indexOf('Profile') !== -1) {
if (fldProfile) {
fldProfile.classList.remove('hide');
}

View file

@ -1,4 +1,5 @@
define(['playbackManager', 'userSettings'], function (playbackManager, userSettings) {
'use strict';
var currentOwnerId;
var currentThemeIds = [];
@ -39,7 +40,7 @@ define(['playbackManager', 'userSettings'], function (playbackManager, userSetti
function enabled(mediaType) {
if (mediaType == 'Video') {
if (mediaType === 'Video') {
return userSettings.enableThemeVideos();
}
@ -55,7 +56,7 @@ define(['playbackManager', 'userSettings'], function (playbackManager, userSetti
var ownerId = themeMediaResult.ThemeVideosResult.Items.length ? themeMediaResult.ThemeVideosResult.OwnerId : themeMediaResult.ThemeSongsResult.OwnerId;
if (ownerId != currentOwnerId) {
if (ownerId !== currentOwnerId) {
var items = themeMediaResult.ThemeVideosResult.Items.length ? themeMediaResult.ThemeVideosResult.Items : themeMediaResult.ThemeSongsResult.Items;

View file

@ -1,4 +1,5 @@
define(['css!./toast'], function () {
'use strict';
function remove(elem) {

View file

@ -1,4 +1,4 @@
define(['browser', 'css!./viewcontainer-lite'], function (browser) {
define(['browser', 'dom', 'css!./viewcontainer-lite'], function (browser, dom) {
'use strict';
var mainAnimatedPages = document.querySelector('.mainAnimatedPages');
@ -140,7 +140,16 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
currentAnimations = animations;
setTimeout(resolve, duration);
var onAnimationComplete = function () {
dom.removeEventListener(newAnimatedPage, 'animationend', onAnimationComplete, {
once: true
});
resolve();
};
dom.addEventListener(newAnimatedPage, 'animationend', onAnimationComplete, {
once: true
});
});
}
@ -161,7 +170,16 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
currentAnimations = animations;
setTimeout(resolve, duration);
var onAnimationComplete = function () {
dom.removeEventListener(newAnimatedPage, 'animationend', onAnimationComplete, {
once: true
});
resolve();
};
dom.addEventListener(newAnimatedPage, 'animationend', onAnimationComplete, {
once: true
});
});
}

View file

@ -1,4 +1,5 @@
define(['dom'], function (dom) {
'use strict';
/**
* Copyright 2012, Digital Fusion

View file

@ -1,4 +1,5 @@
define(['playbackManager'], function (playbackManager) {
'use strict';
function setActiveDevice(name) {
return function () {
@ -12,5 +13,5 @@
return setActiveDevice(result.properties.devicename);
}
return;
}
};
});

View file

@ -1,4 +1,5 @@
define(['inputManager'], function (inputManager) {
'use strict';
function disableDisplayMirror() {
return function () {
@ -11,10 +12,9 @@
switch (result.item.deviceid) {
case 'displaymirroring':
return disableDisplayMirror();
break;
default:
return;
}
}
};
});

View file

@ -1,4 +1,5 @@
define(['inputManager'], function (inputManager) {
'use strict';
function enableDisplayMirror() {
return function () {
@ -11,10 +12,9 @@
switch (result.item.deviceid) {
case 'displaymirroring':
return enableDisplayMirror();
break;
default:
return;
}
}
};
});

View file

@ -1,4 +1,5 @@
define(['connectionManager', 'playbackManager', 'globalize'], function (connectionManager, playbackManager, globalize) {
'use strict';
/// <summary> Play items. </summary>
/// <param name="items"> The items. </param>
@ -54,7 +55,6 @@
return function () {
var query = {
Limit: result.item.limit || 100,
UserId: result.userId,
ExcludeLocationTypes: "Virtual"
@ -98,5 +98,5 @@
playItems(queryResult.Items, result.item.shuffle);
});
};
}
};
});

View file

@ -1,10 +1,11 @@
define(['inputManager'], function (inputManager) {
'use strict';
return function (result) {
return function (result) {
switch (result.item.deviceid) {
default:
return;
}
}
};
});

View file

@ -1,4 +1,5 @@
define(['inputManager', 'connectionManager', 'embyRouter'], function (inputManager, connectionManager, embyRouter) {
'use strict';
function getMusicCommand(result) {
return function () {
@ -46,17 +47,17 @@
return function () {
var act = result.item.menuid;
if (act) {
if (act.indexOf('livetv') != -1) {
if (act.indexOf('livetv') !== -1) {
inputManager.trigger('livetv');
} else if (act.indexOf('guide') != -1) {
} else if (act.indexOf('guide') !== -1) {
inputManager.trigger('guide');
} else if (act.indexOf('channels') != -1) {
} else if (act.indexOf('channels') !== -1) {
inputManager.trigger('livetv');
} else if (act.indexOf('recordings') != -1) {
} else if (act.indexOf('recordings') !== -1) {
inputManager.trigger('recordedtv');
} else if (act.indexOf('scheduled') != -1) {
} else if (act.indexOf('scheduled') !== -1) {
inputManager.trigger('recordedtv');
} else if (act.indexOf('series') != -1) {
} else if (act.indexOf('series') !== -1) {
inputManager.trigger('recordedtv');
} else {
inputManager.trigger('livetv');
@ -83,18 +84,18 @@
return function () {
var act = result.item.menuid;
if (act) {
if (act.indexOf('home') != -1) {
if (act.indexOf('home') !== -1) {
inputManager.trigger('home');
}
else if (act.indexOf('nextup') != -1) {
else if (act.indexOf('nextup') !== -1) {
inputManager.trigger('nextup');
}
else if (act.indexOf('favorites') != -1) {
else if (act.indexOf('favorites') !== -1) {
inputManager.trigger('favorites');
} else if (act.indexOf('upcoming') != -1) {
} else if (act.indexOf('upcoming') !== -1) {
inputManager.trigger('upcomingtv');
}
else if (act.indexOf('nowplaying') != -1) {
else if (act.indexOf('nowplaying') !== -1) {
inputManager.trigger('nowplaying');
}
else {
@ -129,5 +130,5 @@
return;
}
}
};
});

View file

@ -1,4 +1,5 @@
define(['inputManager'], function (inputManager) {
'use strict';
function toggleDisplayMirror() {
return function () {
@ -11,10 +12,9 @@
switch (result.item.deviceid) {
case 'displaymirroring':
return toggleDisplayMirror();
break;
default:
return;
}
}
};
});

View file

@ -1,6 +1,7 @@
// <date>09.10.2015</date>
// <summary>grammarprocessor class</summary>
define([], function () {
'use strict';
/// <summary> The named register exponent. </summary>
var NamedRegExp = function (pattern, string) {
@ -24,14 +25,15 @@ define([], function () {
for (var i = 0, len = regexp.length; i < len; i++) {
if (finalMatch[(i + 1)] !== false) {
var mth = finalMatch[(i + 1)];
if (mth)
if (mth) {
mth = mth.trim().toLowerCase();
}
regexp[i].value = mth;
}
}
}
else
} else {
regexp = null;
}
return regexp;
};
@ -91,8 +93,9 @@ define([], function () {
var isvalid = false;
commandgroups.map(function (group) {
if (isvalid)
if (isvalid) {
return;
}
if (group.defaultValues && group.defaultValues.length > 0) {
group.defaultValues.map(function (item) {
@ -105,14 +108,19 @@ define([], function () {
group.items.map(function (item) {
var regex = NamedRegExp(item.command, text);
if (!regex && item.altcommand)
regex = NamedRegExp(item.altcommand, text)
if (!regex && item.altcommand) {
regex = NamedRegExp(item.altcommand, text);
}
if (regex && regex.length > 0) {
//Group data
if (group.groupid) result.groupid = group.groupid;
if (group.name) result.name = group.name;
if (group.groupid) {
result.groupid = group.groupid;
}
if (group.name) {
result.name = group.name;
}
if (group.defaultValues) {
result.defaultValues.sourceid = group.defaultValues.sourceid || result.defaultValues.sourceid;
result.defaultValues.deviceid = group.defaultValues.deviceid || result.defaultValues.deviceid;
@ -128,7 +136,9 @@ define([], function () {
if (group.name) result.name = group.name;
if (group.name) {
result.name = group.name;
}
//Item data
var usegroupDefault = checkItemProperty(item.usedefaultvalues, result.item.usedefaultvalues);
@ -181,15 +191,17 @@ define([], function () {
break;
}
if (result.text)
if (result.text) {
result.text = result.text.replace(regresult.value, '').trim();
}
});
isvalid = true;
}
if (isvalid)
if (isvalid) {
return;
}
});
}
});
@ -205,10 +217,12 @@ define([], function () {
var idx = -1;
idx = actions.map(function (e) { return e.name; }).indexOf(name);
if (idx > -1)
if (idx > -1) {
return actions[idx];
else
}
else {
return null;
}
}
/// <summary> Check item property. </summary>
@ -218,23 +232,27 @@ define([], function () {
/// <param name="groupDefaultValue"> The group default value. </param>
/// <returns> . </returns>
function checkItemProperty(property, itemDefaultValue, useGroupDefaultValue, groupDefaultValue) {
if (property)
if (property) {
return property;
}
if (useGroupDefaultValue && groupDefaultValue)
if (useGroupDefaultValue && groupDefaultValue) {
return groupDefaultValue;
}
return itemDefaultValue;
}
return function (commandgroups, text) {
var result;
if (commandgroups) {
var result = processcommands(text, commandgroups);
result = processcommands(text, commandgroups);
console.log(text);
console.log(commandgroups);
}
return result;
}
};
});

View file

@ -1,6 +1,7 @@
// <date>09.10.2015</date>
// <summary>voicecommands class</summary>
define(['require'], function (require) {
'use strict';
/// <summary> Process the command. </summary>
/// <param name="commandPath"> Full pathname of the command file. </param>
@ -31,30 +32,22 @@ define(['require'], function (require) {
case 'show':
return processCommand('./commands/showcommands.js', result);
break;
case 'play':
return processCommand('./commands/playcommands.js', result);
break;
case 'shuffle':
return processCommand('./commands/playcommands.js', result);
break;
case 'search':
return processCommand('./commands/searchcommands.js', result);
break;
case 'control':
return processCommand('./commands/controlcommands.js', result);
break;
case 'enable':
return processCommand('./commands/enablecommands.js', result);
break;
case 'disable':
return processCommand('./commands/disablecommands.js', result);
break;
case 'toggle':
return processCommand('./commands/togglecommands.js', result);
break;
default:
return Promise.reject();
}
}
};
});

View file

@ -1,4 +1,5 @@
define(['dialogHelper', 'voiceReceiver', 'voiceProcessor', 'globalize', 'emby-button', 'css!./voice.css', 'material-icons', 'css!./../formdialog'], function (dialogHelper, voicereceiver, voiceprocessor, globalize) {
'use strict';
var lang = 'en-US';
@ -33,7 +34,7 @@ define(['dialogHelper', 'voiceReceiver', 'voiceProcessor', 'globalize', 'emby-bu
var commands = [];
commandGroups.map(function (group) {
if ((group.items && group.items.length > 0) && (groupid == group.groupid || groupid == '')) {
if ((group.items && group.items.length > 0) && (groupid !== group.groupid || groupid === '')) {
group.items.map(function (item) {
@ -63,12 +64,15 @@ define(['dialogHelper', 'voiceReceiver', 'voiceProcessor', 'globalize', 'emby-bu
idx = commandgroups.map(function (e) { return e.groupid; }).indexOf(groupid);
if (idx > -1)
if (idx > -1) {
return commandgroups[idx];
else
}
else {
return null;
} else
}
} else {
return null;
}
});
}
@ -99,6 +103,10 @@ define(['dialogHelper', 'voiceReceiver', 'voiceProcessor', 'globalize', 'emby-bu
var isNewDialog = false;
var dlg;
function onCancelClick() {
dialogHelper.close(dlg);
}
if (!currentDialog) {
isNewDialog = true;
@ -166,10 +174,6 @@ define(['dialogHelper', 'voiceReceiver', 'voiceProcessor', 'globalize', 'emby-bu
currentDialog = null;
});
function onCancelClick() {
dialogHelper.close(dlg);
}
var closeButtons = dlg.querySelectorAll('.btnCancelVoiceInput');
for (var i = 0, length = closeButtons.length; i < length; i++) {
closeButtons[i].addEventListener('click', onCancelClick);
@ -214,8 +218,9 @@ define(['dialogHelper', 'voiceReceiver', 'voiceProcessor', 'globalize', 'emby-bu
/// <returns> . </returns>
function showUnrecognizedCommandHelp(command) {
//speak("I don't understend this command");
if (command)
if (command) {
currentDialog.querySelector('.voiceInputText').innerText = command;
}
currentDialog.querySelector('.unrecognizedCommand').classList.remove('hide');
currentDialog.querySelector('.defaultVoiceHelp').classList.add('hide');
}
@ -225,10 +230,12 @@ define(['dialogHelper', 'voiceReceiver', 'voiceProcessor', 'globalize', 'emby-bu
/// <returns> . </returns>
function showCommands(result) {
//speak('Hello, what can I do for you?');
if (result)
if (result) {
showVoiceHelp(result.groupid, result.name);
else
}
else {
showVoiceHelp();
}
}
function resetDialog() {
@ -257,7 +264,7 @@ define(['dialogHelper', 'voiceReceiver', 'voiceProcessor', 'globalize', 'emby-bu
}, 1);
}, function (result) {
if (result.error == 'group') {
if (result.error === 'group') {
showVoiceHelp(result.item.groupid, result.groupName);
return;
}

View file

@ -1,4 +1,5 @@
define(['./voicecommands.js', './grammarprocessor.js', 'require'], function (voicecommands, grammarprocessor, require) {
'use strict';
var commandgroups;

View file

@ -1,4 +1,5 @@
define(['events'], function (events) {
'use strict';
var receiver = {
@ -13,7 +14,7 @@
var srch = 'jarvis';
var index = text.toLowerCase().indexOf(srch);
if (index != -1) {
if (index !== -1) {
text = text.substring(index + srch.length);
} else {
return null;
@ -30,11 +31,13 @@
return new Promise(function (resolve, reject) {
cancelListener();
var recognition = new (window.SpeechRecognition ||
var recognitionObj = window.SpeechRecognition ||
window.webkitSpeechRecognition ||
window.mozSpeechRecognition ||
window.oSpeechRecognition ||
window.msSpeechRecognition)();
window.msSpeechRecognition;
var recognition = new recognitionObj();
recognition.lang = options.lang;
recognition.continuous = options.continuous || false;

View file

@ -155,7 +155,6 @@ define(['appStorage', 'browser'], function (appStorage, browser) {
return features;
}();
var appInfo;
var version = window.dashboardVersion || '3.0';

View file

@ -98,6 +98,11 @@
var commands = [];
commands.push({
name: globalize.translate('ButtonRemoteControl'),
id: 'remotecontrol'
});
// manage server, metadata manager, reports, sync to other devices
if (currentUser.Policy.IsAdministrator) {
commands.push({
@ -118,11 +123,6 @@
});
}
commands.push({
name: globalize.translate('ButtonRemoteControl'),
id: 'remotecontrol'
});
if (Dashboard.isConnectMode()) {
commands.push({
name: globalize.translate('HeaderSelectServer'),

View file

@ -1,9 +1,7 @@
define([], function () {
function goNext() {
require(['scripts/wizardcontroller'], function (wizardcontroller) {
wizardcontroller.navigateToService();
});
Dashboard.navigate('wizardagreement.html');
}
function loadDownloadInfo(view) {

View file

@ -107,6 +107,12 @@
<div id="castContent" is="emby-itemscontainer" class="itemsContainer"></div>
<button is="emby-button" type="button" class="raised more morePeople hide">${ButtonMore}</button>
</div>
<div id="seriesScheduleSection" class="detailSection hide">
<h1>
${HeaderUpcomingOnTV}
</h1>
<div id="seriesScheduleList" is="emby-itemscontainer" class="itemsContainer vertical-list"></div>
</div>
<div class="detailSection photoInfo hide">
<h1>

View file

@ -446,6 +446,11 @@
page.querySelector('#childrenCollapsible').classList.add('hide');
}
if (item.Type == 'Series') {
renderSeriesSchedule(page, item, user);
}
if (item.Type == 'Series') {
renderNextUp(page, item, user);
@ -934,20 +939,21 @@
}
var supportsImageAnalysis = appHost.supports('imageanalysis');
var cardLayout = supportsImageAnalysis && (item.Type == "MusicAlbum" || item.Type == "Game" || item.Type == "MusicArtist");
html += cardBuilder.getCardsHtml({
items: result.Items,
shape: shape,
showParentTitle: item.Type == "MusicAlbum",
centerText: !supportsImageAnalysis,
centerText: !cardLayout,
showTitle: item.Type == "MusicAlbum" || item.Type == "Game" || item.Type == "MusicArtist",
context: context,
lazy: true,
showDetailsMenu: true,
coverImage: item.Type == "MusicAlbum" || item.Type == "MusicArtist",
overlayPlayButton: true,
cardLayout: supportsImageAnalysis && (item.Type == "MusicAlbum" || item.Type == "Game" || item.Type == "MusicArtist"),
vibrant: supportsImageAnalysis
cardLayout: cardLayout,
vibrant: cardLayout && supportsImageAnalysis
});
html += '</div>';
@ -1242,10 +1248,49 @@
function renderChannelGuide(page, item, user) {
require('scripts/livetvcomponents,scripts/livetvchannel,livetvcss'.split(','), function () {
require('scripts/livetvchannel,scripts/livetvcomponents,livetvcss'.split(','), function (liveTvChannelPage) {
liveTvChannelPage.renderPrograms(page, item.Id);
});
}
LiveTvChannelPage.renderPrograms(page, item.Id);
function renderSeriesSchedule(page, item, user) {
return;
ApiClient.getLiveTvPrograms({
UserId: Dashboard.getCurrentUserId(),
HasAired: false,
SortBy: "StartDate",
EnableTotalRecordCount: false,
EnableImages: false,
ImageTypeLimit: 0,
Limit: 50,
EnableUserData: false,
LibrarySeriesId: item.Id
}).then(function (result) {
if (result.Items.length) {
page.querySelector('#seriesScheduleSection').classList.remove('hide');
} else {
page.querySelector('#seriesScheduleSection').classList.add('hide');
}
page.querySelector('#seriesScheduleList').innerHTML = listView.getListViewHtml({
items: result.Items,
enableUserDataButtons: false,
showParentTitle: false,
image: false,
showProgramDateTime: true,
mediaInfo: false,
showTitle: true,
moreButton: false,
action: 'programdialog'
});
Dashboard.hideLoadingMsg();
});
}

View file

@ -55,7 +55,8 @@
SortBy: "StartDate",
EnableTotalRecordCount: false,
EnableImages: false,
ImageTypeLimit: 0
ImageTypeLimit: 0,
EnableUserData: false
}).then(function (result) {
@ -64,7 +65,7 @@
});
}
window.LiveTvChannelPage = {
return {
renderPrograms: loadPrograms
};

View file

@ -87,7 +87,7 @@
html += cardBuilder.getCardsHtml({
items: group.items,
shape: getBackdropShape(),
showTitle: true,
showParentTitleOrTitle: true,
showAirTime: true,
showAirEndTime: true,
showChannelName: true,

View file

@ -130,7 +130,9 @@
promise.then(function (result) {
renderRecordings(context.querySelector('#latestRecordings'), result.Items);
renderRecordings(context.querySelector('#latestRecordings'), result.Items, {
shape: (enableScrollX() ? 'overflowBackdrop' : 'backdrop')
});
Dashboard.hideLoadingMsg();
});

View file

@ -113,7 +113,6 @@
var html = cardBuilder.getCardsHtml({
items: hints,
shape: "auto",
lazy: true,
overlayText: false,
showTitle: true,
centerImage: true,

View file

@ -15,10 +15,7 @@
function showServerConnectionFailure() {
Dashboard.alert({
message: Globalize.translate("MessageUnableToConnectToServer"),
title: Globalize.translate("HeaderConnectionFailure")
});
alertText(Globalize.translate('MessageUnableToConnectToServer'), Globalize.translate("HeaderConnectionFailure"));
}
function getServerHtml(server) {
@ -69,12 +66,23 @@
page.querySelector('.serverList').innerHTML = html;
}
function alertText(text, title) {
alertTextWithOptions({
title: title,
text: text
});
}
function alertTextWithOptions(options) {
require(['alert'], function (alert) {
alert(options);
});
}
function showGeneralError() {
Dashboard.hideLoadingMsg();
Dashboard.alert({
message: Globalize.translate('DefaultErrorMessage')
});
alertText(Globalize.translate('DefaultErrorMessage'));
}
function parentWithClass(elem, className) {
@ -124,12 +132,10 @@
break;
case MediaBrowser.ConnectionState.ServerUpdateNeeded:
{
Dashboard.alert(alert({
alertTextWithOptions({
text: Globalize.translate('core#ServerUpdateNeeded', 'https://emby.media'),
html: Globalize.translate('core#ServerUpdateNeeded', '<a href="https://emby.media">https://emby.media</a>')
}));
});
}
break;
default:
@ -284,7 +290,7 @@
html += '</div>';
html += '<button is="paper-icon-button-light" class="btnInviteMenu autoSize"><i class="md-icon">' + AppInfo.moreIcon.replace('-','_') + '</i></button>';
html += '<button is="paper-icon-button-light" class="btnInviteMenu autoSize"><i class="md-icon">' + AppInfo.moreIcon.replace('-', '_') + '</i></button>';
html += '</div>';

View file

@ -1119,7 +1119,7 @@ var AppInfo = {};
var headroom = new Headroom([], {
// or scroll tolerance per direction
tolerance: {
down: 20,
down: 0,
up: 0
},
classes: {
@ -2588,13 +2588,6 @@ var AppInfo = {};
anonymous: true
});
defineRoute({
path: '/wizardservice.html',
dependencies: ['dashboardcss'],
autoFocus: false,
anonymous: true
});
defineRoute({
path: '/wizardsettings.html',
dependencies: ['dashboardcss'],

View file

@ -6,7 +6,7 @@
apiClient.getJSON(apiClient.getUrl('Startup/Info')).then(function (info) {
if (info.HasMediaEncoder) {
navigateToService();
Dashboard.navigate('wizardagreement.html');
} else {
Dashboard.navigate('wizardcomponents.html');
@ -14,22 +14,7 @@
});
}
function navigateToService() {
var apiClient = ApiClient;
apiClient.getJSON(apiClient.getUrl('Startup/Info')).then(function (info) {
if (info.SupportsRunningAsService) {
Dashboard.navigate('wizardservice.html');
} else {
Dashboard.navigate('wizardagreement.html');
}
});
}
return {
navigateToComponents: navigateToComponents,
navigateToService: navigateToService
navigateToComponents: navigateToComponents
};
});

View file

@ -1,13 +0,0 @@
define(['jQuery'], function ($) {
$(document).on('pageinit', "#wizardServicePage", function () {
var page = this;
$('#btnNextPage', page).on('click', function () {
Dashboard.navigate('wizardagreement.html');
});
});
});

View file

@ -1932,8 +1932,8 @@
"SyncJobItemStatusCancelled": "Cancelled",
"LabelProfile": "Profile:",
"LabelBitrateMbps": "Bitrate (Mbps):",
"EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install Emby Server visit the Emby website.",
"EmbyIntroDownloadMessage": "To download and install the free Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install the free Emby Server visit the Emby website.",
"ButtonNewServer": "New Server",
"MyDevice": "My Device",
"ButtonRemote": "Remote",
@ -2094,7 +2094,7 @@
"MapChannels": "Map Channels",
"LabelffmpegPath": "FFmpeg path:",
"LabelffmpegVersion": "FFmpeg version:",
"LabelffmpegPathHelp": "The path to your downloaded ffmpeg application file, or folder containing ffmpeg.",
"LabelffmpegPathHelp": "The path to the ffmpeg application file, or folder containing ffmpeg.",
"SetupFFmpeg": "Setup FFmpeg",
"SetupFFmpegHelp": "Emby may require a library or application to convert certain media types. There are many different applications available, however, Emby has been tested to work with ffmpeg. Emby is in no way affiliated with ffmpeg, its ownership, code or distribution.",
"EnterFFmpegLocation": "Enter FFmpeg path",

View file

@ -1932,8 +1932,8 @@
"SyncJobItemStatusCancelled": "Cancelled",
"LabelProfile": "Profile:",
"LabelBitrateMbps": "Bitrate (Mbps):",
"EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install Emby Server visit the Emby website.",
"EmbyIntroDownloadMessage": "To download and install the free Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install the free Emby Server visit the Emby website.",
"ButtonNewServer": "New Server",
"MyDevice": "My Device",
"ButtonRemote": "Remote",
@ -2094,7 +2094,7 @@
"MapChannels": "Map Channels",
"LabelffmpegPath": "FFmpeg path:",
"LabelffmpegVersion": "FFmpeg version:",
"LabelffmpegPathHelp": "The path to your downloaded ffmpeg application file, or folder containing ffmpeg.",
"LabelffmpegPathHelp": "The path to the ffmpeg application file, or folder containing ffmpeg.",
"SetupFFmpeg": "Setup FFmpeg",
"SetupFFmpegHelp": "Emby may require a library or application to convert certain media types. There are many different applications available, however, Emby has been tested to work with ffmpeg. Emby is in no way affiliated with ffmpeg, its ownership, code or distribution.",
"EnterFFmpegLocation": "Enter FFmpeg path",

View file

@ -1932,8 +1932,8 @@
"SyncJobItemStatusCancelled": "Cancelled",
"LabelProfile": "Profile:",
"LabelBitrateMbps": "Bitrate (Mbps):",
"EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install Emby Server visit the Emby website.",
"EmbyIntroDownloadMessage": "To download and install the free Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install the free Emby Server visit the Emby website.",
"ButtonNewServer": "New Server",
"MyDevice": "My Device",
"ButtonRemote": "Remote",
@ -2094,7 +2094,7 @@
"MapChannels": "Map Channels",
"LabelffmpegPath": "FFmpeg path:",
"LabelffmpegVersion": "FFmpeg version:",
"LabelffmpegPathHelp": "The path to your downloaded ffmpeg application file, or folder containing ffmpeg.",
"LabelffmpegPathHelp": "The path to the ffmpeg application file, or folder containing ffmpeg.",
"SetupFFmpeg": "Setup FFmpeg",
"SetupFFmpegHelp": "Emby may require a library or application to convert certain media types. There are many different applications available, however, Emby has been tested to work with ffmpeg. Emby is in no way affiliated with ffmpeg, its ownership, code or distribution.",
"EnterFFmpegLocation": "Enter FFmpeg path",

View file

@ -1932,8 +1932,8 @@
"SyncJobItemStatusCancelled": "Cancel\u00b7lat",
"LabelProfile": "Perfil:",
"LabelBitrateMbps": "Bitrate (Mbps):",
"EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install Emby Server visit the Emby website.",
"EmbyIntroDownloadMessage": "To download and install the free Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install the free Emby Server visit the Emby website.",
"ButtonNewServer": "Nou servidor",
"MyDevice": "El meu dispositiu",
"ButtonRemote": "Remot",
@ -2094,7 +2094,7 @@
"MapChannels": "Map Channels",
"LabelffmpegPath": "FFmpeg path:",
"LabelffmpegVersion": "FFmpeg version:",
"LabelffmpegPathHelp": "The path to your downloaded ffmpeg application file, or folder containing ffmpeg.",
"LabelffmpegPathHelp": "The path to the ffmpeg application file, or folder containing ffmpeg.",
"SetupFFmpeg": "Setup FFmpeg",
"SetupFFmpegHelp": "Emby may require a library or application to convert certain media types. There are many different applications available, however, Emby has been tested to work with ffmpeg. Emby is in no way affiliated with ffmpeg, its ownership, code or distribution.",
"EnterFFmpegLocation": "Enter FFmpeg path",

View file

@ -2094,7 +2094,7 @@
"MapChannels": "Map Channels",
"LabelffmpegPath": "FFmpeg path:",
"LabelffmpegVersion": "FFmpeg version:",
"LabelffmpegPathHelp": "The path to your downloaded ffmpeg application file, or folder containing ffmpeg.",
"LabelffmpegPathHelp": "The path to the ffmpeg application file, or folder containing ffmpeg.",
"SetupFFmpeg": "Setup FFmpeg",
"SetupFFmpegHelp": "Emby may require a library or application to convert certain media types. There are many different applications available, however, Emby has been tested to work with ffmpeg. Emby is in no way affiliated with ffmpeg, its ownership, code or distribution.",
"EnterFFmpegLocation": "Enter FFmpeg path",

View file

@ -1933,7 +1933,7 @@
"LabelProfile": "Profil:",
"LabelBitrateMbps": "Bitrate (Mbps):",
"EmbyIntroDownloadMessage": "For at downloade og installere Emby bes\u00f8g {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install Emby Server visit the Emby website.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install the free Emby Server visit the Emby website.",
"ButtonNewServer": "Ny server",
"MyDevice": "Min enhed",
"ButtonRemote": "Fjernbetjening",
@ -2094,7 +2094,7 @@
"MapChannels": "Map Channels",
"LabelffmpegPath": "FFmpeg path:",
"LabelffmpegVersion": "FFmpeg version:",
"LabelffmpegPathHelp": "The path to your downloaded ffmpeg application file, or folder containing ffmpeg.",
"LabelffmpegPathHelp": "The path to the ffmpeg application file, or folder containing ffmpeg.",
"SetupFFmpeg": "Setup FFmpeg",
"SetupFFmpegHelp": "Emby may require a library or application to convert certain media types. There are many different applications available, however, Emby has been tested to work with ffmpeg. Emby is in no way affiliated with ffmpeg, its ownership, code or distribution.",
"EnterFFmpegLocation": "Enter FFmpeg path",

View file

@ -1932,8 +1932,8 @@
"SyncJobItemStatusCancelled": "Cancelled",
"LabelProfile": "Profile:",
"LabelBitrateMbps": "Bitrate (Mbps):",
"EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install Emby Server visit the Emby website.",
"EmbyIntroDownloadMessage": "To download and install the free Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install the free Emby Server visit the Emby website.",
"ButtonNewServer": "New Server",
"MyDevice": "My Device",
"ButtonRemote": "Remote",
@ -2094,7 +2094,7 @@
"MapChannels": "Map Channels",
"LabelffmpegPath": "FFmpeg path:",
"LabelffmpegVersion": "FFmpeg version:",
"LabelffmpegPathHelp": "The path to your downloaded ffmpeg application file, or folder containing ffmpeg.",
"LabelffmpegPathHelp": "The path to the ffmpeg application file, or folder containing ffmpeg.",
"SetupFFmpeg": "Setup FFmpeg",
"SetupFFmpegHelp": "Emby may require a library or application to convert certain media types. There are many different applications available, however, Emby has been tested to work with ffmpeg. Emby is in no way affiliated with ffmpeg, its ownership, code or distribution.",
"EnterFFmpegLocation": "Enter FFmpeg path",

View file

@ -1932,8 +1932,8 @@
"SyncJobItemStatusCancelled": "Cancelled",
"LabelProfile": "Profile:",
"LabelBitrateMbps": "Bitrate (Mbps):",
"EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install Emby Server visit the Emby website.",
"EmbyIntroDownloadMessage": "To download and install the free Emby Server visit {0}.",
"EmbyIntroDownloadMessageWithoutLink": "To download and install the free Emby Server visit the Emby website.",
"ButtonNewServer": "New Server",
"MyDevice": "My Device",
"ButtonRemote": "Remote",
@ -2094,7 +2094,7 @@
"MapChannels": "Map Channels",
"LabelffmpegPath": "FFmpeg path:",
"LabelffmpegVersion": "FFmpeg version:",
"LabelffmpegPathHelp": "The path to your downloaded ffmpeg application file, or folder containing ffmpeg.",
"LabelffmpegPathHelp": "The path to the ffmpeg application file, or folder containing ffmpeg.",
"SetupFFmpeg": "Setup FFmpeg",
"SetupFFmpegHelp": "Emby may require a library or application to convert certain media types. There are many different applications available, however, Emby has been tested to work with ffmpeg. Emby is in no way affiliated with ffmpeg, its ownership, code or distribution.",
"EnterFFmpegLocation": "Enter FFmpeg path",

View file

@ -2094,7 +2094,7 @@
"MapChannels": "Map Channels",
"LabelffmpegPath": "FFmpeg path:",
"LabelffmpegVersion": "FFmpeg version:",
"LabelffmpegPathHelp": "The path to your downloaded ffmpeg application file, or folder containing ffmpeg.",
"LabelffmpegPathHelp": "The path to the ffmpeg application file, or folder containing ffmpeg.",
"SetupFFmpeg": "Setup FFmpeg",
"SetupFFmpegHelp": "Emby may require a library or application to convert certain media types. There are many different applications available, however, Emby has been tested to work with ffmpeg. Emby is in no way affiliated with ffmpeg, its ownership, code or distribution.",
"EnterFFmpegLocation": "Enter FFmpeg path",

Some files were not shown because too many files have changed in this diff Show more