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

update timer listings

This commit is contained in:
Luke Pulverenti 2016-10-04 01:15:39 -04:00
parent c2290dd41d
commit cf3aa152cf
39 changed files with 368 additions and 287 deletions

View file

@ -16,12 +16,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.1.86",
"_release": "1.1.86",
"version": "1.1.87",
"_release": "1.1.87",
"_resolution": {
"type": "version",
"tag": "1.1.86",
"commit": "a6eb0622d2498b239814205e3313531bdbe15ad7"
"tag": "1.1.87",
"commit": "21057764cdf82e9ef08514cca4e48c76d47e535f"
},
"_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
"_target": "^1.1.51",

View file

@ -1087,7 +1087,7 @@
Servers: [server]
});
} if (result.Id != server.Id) {
} if (result.Id !== server.Id) {
// http request succeeded, but it's a different server than what was expected
testNextConnectionMode(tests, index + 1, server, options, resolve);

View file

@ -14,12 +14,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.4.283",
"_release": "1.4.283",
"version": "1.4.285",
"_release": "1.4.285",
"_resolution": {
"type": "version",
"tag": "1.4.283",
"commit": "52a82ab789f4650d3b0ab7ee41cba96d417cfa76"
"tag": "1.4.285",
"commit": "832eef9023fe34ea838262763ca6f4b70e7b39ae"
},
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1",

View file

@ -558,7 +558,7 @@ define(['browser'], function (browser) {
}]
});
if (browser.chrome) {
if (!browser.edgeUwp && !browser.tizen && !browser.web0s) {
profile.CodecProfiles[profile.CodecProfiles.length - 1].Conditions.push({
Condition: 'NotEquals',
Property: 'IsAVC',

View file

@ -82,6 +82,10 @@
transform: scale(1.16, 1.16);
}
.cardBox-mobile {
margin: 1px;
}
@media all and (min-width: 600px) {
.cardBox-mobile {

View file

@ -1,4 +1,5 @@
define(['dialog', 'globalize'], function (dialog, globalize) {
'use strict';
return function (text, title) {
@ -17,19 +18,19 @@ define(['dialog', 'globalize'], function (dialog, globalize) {
items.push({
name: options.cancelText || globalize.translate('sharedcomponents#ButtonCancel'),
id: 'cancel',
type: options.primary == 'cancel' ? 'submit' : 'cancel'
type: options.primary === 'cancel' ? 'submit' : 'cancel'
});
items.push({
name: options.confirmText || globalize.translate('sharedcomponents#ButtonOk'),
id: 'ok',
type: options.primary == 'cancel' ? 'cancel' : 'submit'
type: options.primary === 'cancel' ? 'cancel' : 'submit'
});
options.buttons = items;
return dialog(options).then(function (result) {
if (result == 'ok') {
if (result === 'ok') {
return Promise.resolve();
}

View file

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

View file

@ -1,4 +1,5 @@
define(['globalize'], function (globalize) {
'use strict';
function parseISO8601Date(s, toLocal) {
@ -40,12 +41,12 @@
}
// if there's a timezone, calculate it
if (d[8] != "Z" && d[10]) {
if (d[8] !== "Z" && d[10]) {
var offset = d[10] * 60 * 60 * 1000;
if (d[11]) {
offset += d[11] * 60 * 1000;
}
if (d[9] == "-") {
if (d[9] === "-") {
ms -= offset;
} else {
ms += offset;
@ -161,7 +162,7 @@
yesterday.setDate(day); // automatically adjusts month/year appropriately
return date.getFullYear() == yesterday.getFullYear() && date.getMonth() == yesterday.getMonth() && date.getDate() == day;
return date.getFullYear() === yesterday.getFullYear() && date.getMonth() === yesterday.getMonth() && date.getDate() === day;
}
return {

View file

@ -1,4 +1,5 @@
define(['dialogHelper', 'dom', 'layoutManager', 'scrollHelper', 'globalize', 'require', 'material-icons', 'emby-button', 'paper-icon-button-light', 'emby-input', 'formDialogStyle'], function (dialogHelper, dom, layoutManager, scrollHelper, globalize, require) {
'use strict';
function showDialog(options, template) {
@ -50,7 +51,7 @@ define(['dialogHelper', 'dom', 'layoutManager', 'scrollHelper', 'globalize', 're
for (i = 0, length = options.buttons.length; i < length; i++) {
var item = options.buttons[i];
var autoFocus = i == 0 ? ' autofocus' : '';
var autoFocus = i === 0 ? ' autofocus' : '';
var buttonClass = 'btnOption raised formDialogFooterItem formDialogFooterItem-autosize';

View file

@ -1,4 +1,5 @@
define(['historyManager', 'focusManager', 'browser', 'layoutManager', 'inputManager', 'dom', 'css!./dialoghelper.css', 'scrollStyles'], function (historyManager, focusManager, browser, layoutManager, inputManager, dom) {
'use strict';
var globalOnOpenCallback;
@ -27,7 +28,7 @@
}
}
function dialogHashHandler(dlg, hash, resolve) {
function DialogHashHandler(dlg, hash, resolve) {
var self = this;
self.originalUrl = window.location.href;
@ -36,7 +37,7 @@
function onHashChange(e) {
var isBack = self.originalUrl == window.location.href;
var isBack = self.originalUrl === window.location.href;
if (isBack || !isOpened(dlg)) {
window.removeEventListener('popstate', onHashChange);
@ -50,7 +51,7 @@
function onBackCommand(e) {
if (e.detail.command == 'back') {
if (e.detail.command === 'back') {
self.closedByBack = true;
e.preventDefault();
e.stopPropagation();
@ -75,7 +76,7 @@
if (!self.closedByBack && isHistoryEnabled(dlg)) {
var state = history.state || {};
if (state.dialogId == hash) {
if (state.dialogId === hash) {
history.back();
}
}
@ -84,7 +85,7 @@
activeElement.focus();
}
if (dlg.getAttribute('data-removeonclose') != 'false') {
if (dlg.getAttribute('data-removeonclose') !== 'false') {
removeCenterFocus(dlg);
var dialogContainer = dlg.dialogContainer;
@ -123,7 +124,7 @@
cancelable: false
}));
if (dlg.getAttribute('data-lockscroll') == 'true' && !document.body.classList.contains('noScroll')) {
if (dlg.getAttribute('data-lockscroll') === 'true' && !document.body.classList.contains('noScroll')) {
document.body.classList.add('noScroll');
removeScrollLockOnClose = true;
}
@ -154,7 +155,7 @@
}, 0);
dom.addEventListener((dlg.dialogContainer || backdrop), 'click', function (e) {
if (e.target == dlg.dialogContainer) {
if (e.target === dlg.dialogContainer) {
close(dlg);
}
}, {
@ -163,7 +164,7 @@
}
function isHistoryEnabled(dlg) {
return dlg.getAttribute('data-history') == 'true';
return dlg.getAttribute('data-history') === 'true';
}
function open(dlg) {
@ -185,7 +186,7 @@
return new Promise(function (resolve, reject) {
new dialogHashHandler(dlg, 'dlg' + new Date().getTime(), resolve);
new DialogHashHandler(dlg, 'dlg' + new Date().getTime(), resolve);
});
}
@ -212,7 +213,7 @@
{ transform: 'scale(0)', offset: 0 },
{ transform: 'none', offset: 1 }];
var timing = elem.animationConfig.entry.timing;
return elem.animate(keyframes, timing).onfinish = onFinish;
elem.animate(keyframes, timing).onfinish = onFinish;
}
function slideUp(elem, onFinish) {
@ -221,7 +222,7 @@
{ transform: 'translate3d(0,30%,0)', opacity: 0, offset: 0 },
{ transform: 'none', opacity: 1, offset: 1 }];
var timing = elem.animationConfig.entry.timing;
return elem.animate(keyframes, timing).onfinish = onFinish;
elem.animate(keyframes, timing).onfinish = onFinish;
}
function fadeIn(elem, onFinish) {
@ -230,7 +231,7 @@
{ opacity: '0', offset: 0 },
{ opacity: '1', offset: 1 }];
var timing = elem.animationConfig.entry.timing;
return elem.animate(keyframes, timing).onfinish = onFinish;
elem.animate(keyframes, timing).onfinish = onFinish;
}
function scaleDown(elem) {
@ -289,11 +290,11 @@
var animation;
if (dlg.animationConfig.exit.name == 'fadeout') {
if (dlg.animationConfig.exit.name === 'fadeout') {
animation = fadeOut(dlg);
} else if (dlg.animationConfig.exit.name == 'scaledown') {
} else if (dlg.animationConfig.exit.name === 'scaledown') {
animation = scaleDown(dlg);
} else if (dlg.animationConfig.exit.name == 'slidedown') {
} else if (dlg.animationConfig.exit.name === 'slidedown') {
animation = slideDown(dlg);
} else {
onAnimationFinish();
@ -308,7 +309,7 @@
var onAnimationFinish = function () {
focusManager.pushScope(dlg);
if (dlg.getAttribute('data-autofocus') == 'true') {
if (dlg.getAttribute('data-autofocus') === 'true') {
focusManager.autoFocus(dlg);
}
};
@ -317,11 +318,11 @@
onAnimationFinish();
return;
}
if (dlg.animationConfig.entry.name == 'fadein') {
if (dlg.animationConfig.entry.name === 'fadein') {
fadeIn(dlg, onAnimationFinish);
} else if (dlg.animationConfig.entry.name == 'scaleup') {
} else if (dlg.animationConfig.entry.name === 'scaleup') {
scaleUp(dlg, onAnimationFinish);
} else if (dlg.animationConfig.entry.name == 'slideup') {
} else if (dlg.animationConfig.entry.name === 'slideup') {
slideUp(dlg, onAnimationFinish);
}
}
@ -332,7 +333,7 @@
return options.lockScroll;
}
if (options.size == 'fullscreen') {
if (options.size === 'fullscreen') {
return true;
}

View file

@ -1,8 +1,9 @@
define([], function () {
'use strict';
function parentWithAttribute(elem, name, value) {
while ((value ? elem.getAttribute(name) != value : !elem.getAttribute(name))) {
while ((value ? elem.getAttribute(name) !== value : !elem.getAttribute(name))) {
elem = elem.parentNode;
if (!elem || !elem.getAttribute) {
@ -20,7 +21,7 @@ define([], function () {
tagNames = [tagNames];
}
while (tagNames.indexOf(elem.tagName || '') == -1) {
while (tagNames.indexOf(elem.tagName || '') === -1) {
elem = elem.parentNode;
if (!elem) {

View file

@ -1,4 +1,5 @@
define(['browser', 'dom', 'css!./emby-button', 'registerElement'], function (browser, dom) {
'use strict';
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
@ -40,14 +41,14 @@
function onKeyDown(e) {
if (e.keyCode == 13) {
if (e.keyCode === 13) {
animateButton.call(this, e);
}
}
function onMouseDown(e) {
if (e.button == 0) {
if (e.button === 0) {
animateButton.call(this, e);
}
}

View file

@ -1,4 +1,5 @@
define(['browser', 'dom', 'css!./emby-button', 'registerElement'], function (browser, dom) {
'use strict';
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
@ -43,7 +44,7 @@
function onKeyDown(e) {
if (e.keyCode == 13) {
if (e.keyCode === 13) {
animateButton.call(this, e);
}
}

View file

@ -1,11 +1,12 @@
define(['css!./emby-checkbox', 'registerElement'], function () {
'use strict';
var EmbyCheckboxPrototype = Object.create(HTMLInputElement.prototype);
function onKeyDown(e) {
// Don't submit form on enter
if (e.keyCode == 13) {
if (e.keyCode === 13) {
e.preventDefault();
this.checked = !this.checked;
@ -20,7 +21,7 @@
EmbyCheckboxPrototype.attachedCallback = function () {
if (this.getAttribute('data-embycheckbox') == 'true') {
if (this.getAttribute('data-embycheckbox') === 'true') {
return;
}

View file

@ -241,7 +241,9 @@
if (browser.touch) {
this.addEventListener('contextmenu', disableEvent);
} else {
this.addEventListener('contextmenu', onContextMenu);
if (this.getAttribute('data-contextmenu') !== 'false') {
this.addEventListener('contextmenu', onContextMenu);
}
}
if (layoutManager.desktop) {

View file

@ -346,6 +346,41 @@
return null;
}
function getTimerIndicator(item) {
var status;
if (item.Type == 'SeriesTimer') {
return '<i class="md-icon programIcon seriesTimerIcon">&#xE062;</i>';
}
else if (item.TimerId) {
status = item.TimerStatus;
}
else if (item.Type == 'Timer') {
status = item.Status;
}
else {
return '';
}
if (item.SeriesTimerId) {
if (status != 'Cancelled' && status != 'Aborted') {
return '<i class="md-icon programIcon seriesTimerIcon">&#xE062;</i>';
}
return '<i class="md-icon programIcon seriesTimerIcon seriesTimerIcon-inactive">&#xE062;</i>';
}
if (!isActive) {
return '';
}
return '<i class="md-icon programIcon">&#xE061;</i>';
}
function getChannelProgramsHtml(context, date, channel, programs, options) {
var html = '';
@ -477,16 +512,7 @@
html += '<i class="guideHdIcon md-icon programIcon">hd</i>';
}
if (program.SeriesTimerId) {
if (program.TimerId) {
html += '<i class="seriesTimerIcon md-icon programIcon">&#xE062;</i>';
} else {
html += '<i class="seriesTimerIcon seriesTimerIcon-inactive md-icon programIcon">&#xE062;</i>';
}
}
else if (program.TimerId) {
html += '<i class="timerIcon md-icon programIcon">&#xE061;</i>';
}
html += getTimerIndicator(program);
if (accentCssClass) {
html += '<div class="programAccent ' + accentCssClass + '"></div>';

View file

@ -98,18 +98,37 @@ define(['css!./indicators.css', 'material-icons'], function () {
function getTimerIndicator(item) {
if (item.SeriesTimerId || item.Type == 'SeriesTimer') {
if (item.TimerId || item.Type == 'Timer' || item.Type == 'SeriesTimer') {
return '<i class="md-icon timerIndicator indicatorIcon">&#xE062;</i>';
} else {
return '<i class="md-icon timerIndicator timerIndicator-inactive indicatorIcon">&#xE062;</i>';
}
var status;
if (item.Type == 'SeriesTimer') {
return '<i class="md-icon timerIndicator indicatorIcon">&#xE062;</i>';
}
else if (item.TimerId || item.Type == 'Timer') {
return '<i class="md-icon timerIndicator indicatorIcon">&#xE061;</i>';
else if (item.TimerId) {
status = item.TimerStatus;
}
else if (item.Type == 'Timer') {
status = item.Status;
}
else {
return '';
}
return '';
if (item.SeriesTimerId) {
if (status != 'Cancelled' && status != 'Aborted') {
return '<i class="md-icon timerIndicator indicatorIcon">&#xE062;</i>';
}
return '<i class="md-icon timerIndicator timerIndicator-inactive indicatorIcon">&#xE062;</i>';
}
if (!isActive) {
return '';
}
return '<i class="md-icon timerIndicator indicatorIcon">&#xE061;</i>';
}
function getSyncIndicator(item) {

View file

@ -8,6 +8,10 @@ define(['apphost'], function (appHost) {
options = options || {};
if (item.Type == 'Timer') {
item = item.ProgramInfo || item;
}
var name = (item.Type == 'Program' && item.IsSeries ? item.EpisodeTitle : item.Name) || '';
if (item.Type == "TvChannel") {

View file

@ -19,11 +19,6 @@
width: 100%;
}
.listItem-nosidepadding {
padding-left: 0;
padding-right: 0;
}
.listItem-largeImage {
padding: .5em !important;
}
@ -59,8 +54,12 @@
justify-content: center;
}
.listItemBody-noleftpadding {
padding-left: 0;
}
.listItem-odd {
background: #171717;
background: #1c1c1c;
}
.three-line {
@ -148,6 +147,7 @@
/* Don't display if flex not supported */
display: none;
align-items: center;
margin-right: 1em;
}
.listGroupHeader {

View file

@ -111,6 +111,12 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
for (var i = 0, length = textlines.length; i < length; i++) {
var text = textlines[i];
if (!text) {
continue;
}
if (i === 0) {
if (isLargeStyle) {
html += '<h2 class="listItemBodyText">';
@ -143,7 +149,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
var clickEntireItem = layoutManager.tv ? true : false;
var outerTagName = clickEntireItem ? 'button' : 'div';
var enableSideMediaInfo = options.enableSideMediaInfo != null ? options.enableSideMediaInfo : clickEntireItem;
var enableSideMediaInfo = options.enableSideMediaInfo != null ? options.enableSideMediaInfo : true;
var outerHtml = '';
@ -178,7 +184,7 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
}
}
var cssClass = "listItem listItem-nosidepadding";
var cssClass = "listItem";
if (options.highlight !== false) {
if (i % 2 == 1) {
@ -285,29 +291,31 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
parentTitle += ' - ' + displayName;
}
textlines.push(parentTitle || '&nbsp;');
textlines.push(parentTitle || '');
}
else if (options.showParentTitle) {
textlines.push(parentTitle || '&nbsp;');
textlines.push(parentTitle || '');
}
if (displayName && !options.parentTitleWithTitle) {
textlines.push(displayName);
}
if (item.ArtistItems && item.Type != 'MusicAlbum') {
textlines.push(item.ArtistItems.map(function (a) {
return a.Name;
if (options.artist !== false) {
if (item.ArtistItems && item.Type != 'MusicAlbum') {
textlines.push(item.ArtistItems.map(function (a) {
return a.Name;
}).join(', ') || '&nbsp;');
}
}).join(', '));
}
if (item.AlbumArtist && item.Type == 'MusicAlbum') {
textlines.push(item.AlbumArtist || '&nbsp;');
if (item.AlbumArtist && item.Type == 'MusicAlbum') {
textlines.push(item.AlbumArtist);
}
}
if (item.Type == 'Game') {
textlines.push(item.GameSystem || '&nbsp;');
textlines.push(item.GameSystem);
}
if (item.Type == 'TvChannel') {
@ -317,11 +325,15 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
}
}
cssClass = 'listItemBody two-line';
cssClass = 'listItemBody';
if (!clickEntireItem) {
cssClass += ' itemAction';
}
if (options.image === false) {
cssClass += ' itemAction listItemBody-noleftpadding';
}
html += '<div class="' + cssClass + '">';
var moreIcon = appHost.moreIcon == 'dots-horiz' ? '&#xE5D3;' : '&#xE5D4;';
@ -360,12 +372,21 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
}
}
if (!options.recordButton && (item.Type == 'Timer' || item.Type == 'Program')) {
html += indicators.getTimerIndicator(item).replace('indicatorIcon', 'indicatorIcon listItemAside');
}
if (!clickEntireItem) {
if (options.moreButton !== false) {
html += '<button is="paper-icon-button-light" class="listItemButton itemAction autoSize" data-action="menu"><i class="md-icon">' + moreIcon + '</i></button>';
}
if (options.recordButton) {
html += '<button is="paper-icon-button-light" class="listItemButton itemAction autoSize" data-action="programdialog">' + indicators.getTimerIndicator(item) + '</button>';
}
if (options.enableUserDataButtons !== false) {
html += '<span class="listViewUserDataButtons">';
html += userdataButtons.getIconsHtml({

View file

@ -1,5 +1,40 @@
define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', 'css!./mediainfo.css', 'programStyles'], function (datetime, globalize, embyRouter, itemHelper) {
function getTimerIndicator(item) {
var status;
if (item.Type == 'SeriesTimer') {
return '<i class="md-icon mediaInfoItem mediaInfoIconItem mediaInfoTimerIcon">&#xE062;</i>';
}
else if (item.TimerId) {
status = item.TimerStatus;
}
else if (item.Type == 'Timer') {
status = item.Status;
}
else {
return '';
}
if (item.SeriesTimerId) {
if (status != 'Cancelled' && status != 'Aborted') {
return '<i class="md-icon mediaInfoItem mediaInfoIconItem mediaInfoTimerIcon">&#xE062;</i>';
}
return '<i class="md-icon mediaInfoItem mediaInfoIconItem">&#xE062;</i>';
}
if (!isActive) {
return '';
}
return '<i class="md-icon mediaInfoItem mediaInfoIconItem mediaInfoTimerIcon">&#xE061;</i>';
}
function getProgramInfoHtml(item, options) {
var html = '';
@ -41,20 +76,10 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
}
if (options.timerIndicator !== false) {
if (item.SeriesTimerId || item.Type == 'SeriesTimer') {
if (item.TimerId || item.Type == 'Timer' || item.Type == 'SeriesTimer') {
miscInfo.push({
html: '<i class="md-icon mediaInfoItem mediaInfoTimerIcon mediaInfoIconItem">&#xE062;</i>'
});
} else {
miscInfo.push({
html: '<i class="md-icon mediaInfoItem mediaInfoIconItem">&#xE062;</i>'
});
}
}
else if (item.TimerId) {
var timerHtml = getTimerIndicator(item);
if (timerHtml) {
miscInfo.push({
html: '<i class="md-icon mediaInfoItem mediaInfoTimerIcon mediaInfoIconItem">&#xE061;</i>'
html: timerHtml
});
}
}
@ -206,20 +231,22 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
}
}
if (item.Type != "Series" && item.Type != "Episode" && item.Type != "Person" && item.MediaType != 'Photo' && item.Type != 'Program') {
if (options.year !== false) {
if (item.Type != "Series" && item.Type != "Episode" && item.Type != "Person" && item.MediaType != 'Photo' && item.Type != 'Program') {
if (item.ProductionYear) {
if (item.ProductionYear) {
miscInfo.push(item.ProductionYear);
}
else if (item.PremiereDate) {
try {
text = datetime.parseISO8601Date(item.PremiereDate).getFullYear();
miscInfo.push(text);
miscInfo.push(item.ProductionYear);
}
catch (e) {
console.log("Error parsing date: " + item.PremiereDate);
else if (item.PremiereDate) {
try {
text = datetime.parseISO8601Date(item.PremiereDate).getFullYear();
miscInfo.push(text);
}
catch (e) {
console.log("Error parsing date: " + item.PremiereDate);
}
}
}
}

View file

@ -117,7 +117,7 @@
parent.querySelector('.seriesRecordingButton .buttonText').innerHTML = globalize.translate('sharedcomponents#RecordSeries');
}
if (program.TimerId) {
if (program.TimerId && program.TimerStatus != 'Cancelled') {
parent.querySelector('.btnManageRecording').classList.remove('visibilityHide');
parent.querySelector('.singleRecordingButton .recordingIcon').classList.add('recordingIcon-active');
parent.querySelector('.singleRecordingButton .buttonText').innerHTML = globalize.translate('sharedcomponents#DoNotRecord');
@ -138,6 +138,7 @@
return apiClient.getLiveTvProgram(options.programId, apiClient.getCurrentUserId()).then(function (program) {
instance.TimerId = program.TimerId;
instance.TimerStatus = program.TimerStatus;
instance.SeriesTimerId = program.SeriesTimerId;
loadData(options.parent, program, apiClient);
@ -161,7 +162,7 @@
var options = this.options;
if (!this.TimerId) {
if (!this.TimerId || this.TimerStatus == 'Cancelled') {
return;
}
@ -212,8 +213,10 @@
var button = dom.parentWithTag(e.target, 'BUTTON');
var isChecked = !button.querySelector('i').classList.contains('recordingIcon-active');
var hasEnabledTimer = this.TimerId && this.TimerStatus != 'Cancelled';
if (isChecked) {
if (!this.TimerId) {
if (!hasEnabledTimer) {
loading.show();
recordingHelper.createRecording(apiClient, options.programId, false).then(function () {
events.trigger(self, 'recordingchanged');
@ -222,7 +225,7 @@
});
}
} else {
if (this.TimerId) {
if (hasEnabledTimer) {
loading.show();
recordingHelper.cancelTimer(apiClient, this.TimerId, true).then(function () {
events.trigger(self, 'recordingchanged');

View file

@ -59,16 +59,18 @@
});
}
function toggleRecording(serverId, programId, timerId, seriesTimerId) {
function toggleRecording(serverId, programId, timerId, timerStatus, seriesTimerId) {
var apiClient = connectionManager.getApiClient(serverId);
if (seriesTimerId && timerId) {
var hasTimer = timerId && timerStatus != 'Cancelled';
if (seriesTimerId && hasTimer) {
// cancel
return cancelTimer(apiClient, timerId, true);
} else if (timerId && programId) {
} else if (hasTimer && programId) {
// change to series recording, if possible
// otherwise cancel individual recording

View file

@ -1,4 +1,5 @@
define(['connectionManager', 'globalize', 'dom', 'paper-icon-button-light', 'material-icons', 'emby-button', 'css!./userdatabuttons'], function (connectionManager, globalize, dom) {
'use strict';
var userDataMethods = {
markPlayed: markPlayed,
@ -9,13 +10,13 @@ define(['connectionManager', 'globalize', 'dom', 'paper-icon-button-light', 'mat
function getUserDataButtonHtml(method, itemId, buttonCssClass, iconCssClass, icon, tooltip, style) {
if (style == 'fab-mini') {
if (style === 'fab-mini') {
style = 'fab';
buttonCssClass = buttonCssClass ? (buttonCssClass + ' mini') : 'mini';
}
var is = style == 'fab' ? 'emby-button' : 'paper-icon-button-light';
var className = style == 'fab' ? 'autoSize fab' : 'autoSize';
var is = style === 'fab' ? 'emby-button' : 'paper-icon-button-light';
var className = style === 'fab' ? 'autoSize fab' : 'autoSize';
if (buttonCssClass) {
className += ' ' + buttonCssClass;
@ -29,9 +30,7 @@ define(['connectionManager', 'globalize', 'dom', 'paper-icon-button-light', 'mat
iconCssClass += 'md-icon';
return '<button title="' + tooltip + '" data-itemid="' + itemId + '" is="' + is + '" data-method="' + method + '" class="' + className + '">\
<i class="'+ iconCssClass + '">' + icon + '</i>\
</button>';
return '<button title="' + tooltip + '" data-itemid="' + itemId + '" is="' + is + '" data-method="' + method + '" class="' + className + '"><i class="'+ iconCssClass + '">' + icon + '</i></button>';
}
function onContainerClick(e) {
@ -50,7 +49,7 @@ define(['connectionManager', 'globalize', 'dom', 'paper-icon-button-light', 'mat
var html = getIconsHtml(options);
if (options.fillMode == 'insertAdjacent') {
if (options.fillMode === 'insertAdjacent') {
options.element.insertAdjacentHTML(options.insertLocation || 'beforeend', html);
} else {
options.element.innerHTML = html;
@ -98,8 +97,8 @@ define(['connectionManager', 'globalize', 'dom', 'paper-icon-button-light', 'mat
if (includePlayed !== false) {
var tooltipPlayed = globalize.translate('sharedcomponents#MarkPlayed');
if (item.MediaType == 'Video' || item.Type == 'Series' || item.Type == 'Season' || item.Type == 'BoxSet' || item.Type == 'Playlist') {
if (item.Type != 'TvChannel') {
if (item.MediaType === 'Video' || item.Type === 'Series' || item.Type === 'Season' || item.Type === 'BoxSet' || item.Type === 'Playlist') {
if (item.Type !== 'TvChannel') {
if (userData.Played) {
html += getUserDataButtonHtml('markPlayed', itemId, btnCssClass + ' btnUserDataOn', iconCssClass, 'check', tooltipPlayed, style);
} else {

View file

@ -1,4 +1,5 @@
define(['userSettingsBuilder'], function (userSettingsBuilder) {
'use strict';
return new userSettingsBuilder();
});

View file

@ -1,4 +1,5 @@
define(['appSettings', 'events', 'browser'], function (appsettings, events, browser) {
'use strict';
return function () {
@ -50,7 +51,7 @@ define(['appSettings', 'events', 'browser'], function (appsettings, events, brow
saveServerPreferences();
}
if (currentValue != value) {
if (currentValue !== value) {
events.trigger(self, 'change', [name]);
}
};
@ -79,7 +80,7 @@ define(['appSettings', 'events', 'browser'], function (appsettings, events, brow
val = self.get('enableCinemaMode', false);
if (val) {
return val != 'false';
return val !== 'false';
}
return true;
@ -94,7 +95,7 @@ define(['appSettings', 'events', 'browser'], function (appsettings, events, brow
val = self.get('enableThemeSongs', false);
if (val) {
return val != 'false';
return val !== 'false';
}
return true;
@ -109,7 +110,7 @@ define(['appSettings', 'events', 'browser'], function (appsettings, events, brow
val = self.get('enableThemeVideos', false);
if (val) {
return val != 'false';
return val !== 'false';
}
return !browser.slow;

View file

@ -1,4 +1,5 @@
define(['browser', 'css!./viewcontainer-lite'], function (browser) {
'use strict';
var mainAnimatedPages = document.querySelector('.mainAnimatedPages');
var allPages = [];
@ -32,7 +33,7 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
cancelActiveAnimations();
var selected = selectedPageIndex;
var previousAnimatable = selected == -1 ? null : allPages[selected];
var previousAnimatable = selected === -1 ? null : allPages[selected];
var pageIndex = selected + 1;
if (pageIndex >= pageContainerCount) {
@ -81,7 +82,7 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
function beforeAnimate(allPages, newPageIndex, oldPageIndex) {
for (var i = 0, length = allPages.length; i < length; i++) {
if (newPageIndex == i || oldPageIndex == i) {
if (newPageIndex === i || oldPageIndex === i) {
//allPages[i].classList.remove('hide');
} else {
allPages[i].classList.add('hide');
@ -91,7 +92,7 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
function afterAnimate(allPages, newPageIndex) {
for (var i = 0, length = allPages.length; i < length; i++) {
if (newPageIndex == i) {
if (newPageIndex === i) {
//allPages[i].classList.remove('hide');
} else {
allPages[i].classList.add('hide');
@ -102,9 +103,9 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
function animate(newAnimatedPage, oldAnimatedPage, transition, isBack) {
if (enableAnimation() && oldAnimatedPage && newAnimatedPage.animate) {
if (transition == 'slide') {
if (transition === 'slide') {
return slide(newAnimatedPage, oldAnimatedPage, transition, isBack);
} else if (transition == 'fade') {
} else if (transition === 'fade') {
return fade(newAnimatedPage, oldAnimatedPage, transition, isBack);
}
}
@ -120,7 +121,7 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
iterations: 1,
easing: 'ease-out',
fill: 'both'
}
};
var animations = [];
@ -158,7 +159,7 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
iterations: 1,
easing: 'ease-out',
fill: 'both'
}
};
var animations = [];
@ -212,7 +213,7 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
var url = options.url;
var index = currentUrls.indexOf(url);
if (index != -1) {
if (index !== -1) {
var animatable = allPages[index];
var view = animatable;
@ -226,7 +227,7 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
cancelActiveAnimations();
var selected = selectedPageIndex;
var previousAnimatable = selected == -1 ? null : allPages[selected];
var previousAnimatable = selected === -1 ? null : allPages[selected];
if (onBeforeChange) {
onBeforeChange(view, true, options);

View file

@ -1,4 +1,5 @@
define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], function (viewcontainer, focusManager, queryString, layoutManager) {
'use strict';
var currentView;
var dispatchPageEvents;
@ -94,7 +95,7 @@ define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], functi
var url = options.url;
var state = options.state;
var index = url.indexOf('?');
var params = index == -1 ? {} : queryString.parse(url.substring(index + 1));
var params = index === -1 ? {} : queryString.parse(url.substring(index + 1));
return {
detail: {