mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update chromecast
This commit is contained in:
parent
f6995379a2
commit
3f09347bf7
8 changed files with 185 additions and 68 deletions
|
@ -438,7 +438,7 @@
|
||||||
|
|
||||||
if (!mute) {
|
if (!mute) {
|
||||||
|
|
||||||
this.session.setReceiverVolumeLevel(vol || 1,
|
this.session.setReceiverVolumeLevel((vol || 1),
|
||||||
this.mediaCommandSuccessCallback.bind(this),
|
this.mediaCommandSuccessCallback.bind(this),
|
||||||
this.errorHandler);
|
this.errorHandler);
|
||||||
}
|
}
|
||||||
|
@ -449,18 +449,6 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Toggle mute CC
|
|
||||||
*/
|
|
||||||
CastPlayer.prototype.toggleMute = function () {
|
|
||||||
if (this.audio == true) {
|
|
||||||
this.mute();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.unMute();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mute CC
|
* Mute CC
|
||||||
*/
|
*/
|
||||||
|
@ -469,15 +457,6 @@
|
||||||
this.setReceiverVolume(true);
|
this.setReceiverVolume(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Unmute CC
|
|
||||||
*/
|
|
||||||
CastPlayer.prototype.unMute = function () {
|
|
||||||
this.audio = true;
|
|
||||||
this.setReceiverVolume(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* media seek function in either Cast or local mode
|
* media seek function in either Cast or local mode
|
||||||
* @param {Event} e An event object from seek
|
* @param {Event} e An event object from seek
|
||||||
|
@ -684,11 +663,19 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
self.unMute = function () {
|
self.unMute = function () {
|
||||||
castPlayer.unMute();
|
self.setVolume(getCurrentVolume() + 2);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.toggleMute = function () {
|
self.toggleMute = function () {
|
||||||
castPlayer.toggleMute();
|
|
||||||
|
var state = self.lastPlayerData || {};
|
||||||
|
state = state.PlayState || {};
|
||||||
|
|
||||||
|
if (state.IsMuted) {
|
||||||
|
self.unMute();
|
||||||
|
} else {
|
||||||
|
self.mute();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.getTargets = function () {
|
self.getTargets = function () {
|
||||||
|
@ -724,7 +711,10 @@
|
||||||
"Mute",
|
"Mute",
|
||||||
"Unmute",
|
"Unmute",
|
||||||
"ToggleMute",
|
"ToggleMute",
|
||||||
"SetVolume"]
|
"SetVolume",
|
||||||
|
"SetAudioStreamIndex",
|
||||||
|
"SetSubtitleStreamIndex",
|
||||||
|
"DisplayContent"]
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -732,6 +722,24 @@
|
||||||
castPlayer.seekMedia(position);
|
castPlayer.seekMedia(position);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.setAudioStreamIndex = function (index) {
|
||||||
|
castPlayer.sendMessage({
|
||||||
|
options: {
|
||||||
|
index: index
|
||||||
|
},
|
||||||
|
command: 'SetAudioStreamIndex'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
self.setSubtitleStreamIndex = function (index) {
|
||||||
|
castPlayer.sendMessage({
|
||||||
|
options: {
|
||||||
|
index: index
|
||||||
|
},
|
||||||
|
command: 'SetSubtitleStreamIndex'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
self.nextTrack = function () {
|
self.nextTrack = function () {
|
||||||
castPlayer.sendMessage({
|
castPlayer.sendMessage({
|
||||||
options: {},
|
options: {},
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
var currentItem;
|
var currentItem;
|
||||||
var shape;
|
var shape;
|
||||||
|
var currentItemsQuery;
|
||||||
|
|
||||||
function getPromise() {
|
function getPromise() {
|
||||||
|
|
||||||
|
@ -404,6 +405,8 @@
|
||||||
|
|
||||||
addCurrentItemToQuery(query);
|
addCurrentItemToQuery(query);
|
||||||
|
|
||||||
|
currentItemsQuery = query;
|
||||||
|
|
||||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
@ -422,7 +425,8 @@
|
||||||
|
|
||||||
html = LibraryBrowser.getListViewHtml({
|
html = LibraryBrowser.getListViewHtml({
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
smallIcon: true
|
smallIcon: true,
|
||||||
|
playFromHere: true
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -462,7 +466,8 @@
|
||||||
|
|
||||||
html = LibraryBrowser.getListViewHtml({
|
html = LibraryBrowser.getListViewHtml({
|
||||||
items: result.Items,
|
items: result.Items,
|
||||||
smallIcon: true
|
smallIcon: true,
|
||||||
|
playFromHere: true
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -509,6 +514,16 @@
|
||||||
LibraryBrowser.showPlayMenu(this, currentItem.Id, currentItem.Type, false, "Audio", userdata.PlaybackPositionTicks);
|
LibraryBrowser.showPlayMenu(this, currentItem.Id, currentItem.Type, false, "Audio", userdata.PlaybackPositionTicks);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.itemsContainer', page).on('playallfromhere', function (e, index) {
|
||||||
|
|
||||||
|
LibraryBrowser.playAllFromHere(currentItemsQuery, index);
|
||||||
|
|
||||||
|
}).on('queueallfromhere', function (e, index) {
|
||||||
|
|
||||||
|
LibraryBrowser.queueAllFromHere(currentItemsQuery, index);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}).on('pageshow', "#itemByNameDetailPage", function () {
|
}).on('pageshow', "#itemByNameDetailPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
|
@ -92,6 +92,35 @@
|
||||||
return "" + d.getFullYear() + formatDigit(d.getMonth() + 1) + formatDigit(d.getDate()) + formatDigit(d.getHours()) + formatDigit(d.getMinutes()) + formatDigit(d.getSeconds());
|
return "" + d.getFullYear() + formatDigit(d.getMonth() + 1) + formatDigit(d.getDate()) + formatDigit(d.getHours()) + formatDigit(d.getMinutes()) + formatDigit(d.getSeconds());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
playAllFromHere: function (query, index) {
|
||||||
|
|
||||||
|
query = $.extend({}, query);
|
||||||
|
query.StartIndex = index;
|
||||||
|
query.Limit = 100;
|
||||||
|
query.Fields = "MediaSources,Chapters";
|
||||||
|
|
||||||
|
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||||
|
|
||||||
|
MediaController.play({
|
||||||
|
items: result.Items
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
queueAllFromHere: function (query, index) {
|
||||||
|
query = $.extend({}, query);
|
||||||
|
query.StartIndex = index;
|
||||||
|
query.Limit = 100;
|
||||||
|
query.Fields = "MediaSources,Chapters";
|
||||||
|
|
||||||
|
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||||
|
|
||||||
|
MediaController.queue({
|
||||||
|
items: result.Items
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
getItemCountsHtml: function (options, item) {
|
getItemCountsHtml: function (options, item) {
|
||||||
|
|
||||||
var counts = [];
|
var counts = [];
|
||||||
|
@ -573,7 +602,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var href = LibraryBrowser.getHref(item, options.context);
|
var href = LibraryBrowser.getHref(item, options.context);
|
||||||
html += '<li class="' + cssClass + '"' + dataAttributes + ' data-itemid="' + item.Id + '" data-playlistitemid="' + (item.PlaylistItemId || '') + '" data-href="' + href + '"><a href="' + href + '">';
|
html += '<li class="' + cssClass + '"' + dataAttributes + ' data-index="' + index + '" data-itemid="' + item.Id + '" data-playlistitemid="' + (item.PlaylistItemId || '') + '" data-href="' + href + '"><a href="' + href + '">';
|
||||||
|
|
||||||
var imgUrl;
|
var imgUrl;
|
||||||
|
|
||||||
|
@ -701,13 +730,13 @@
|
||||||
|
|
||||||
html += '</li>';
|
html += '</li>';
|
||||||
|
|
||||||
|
index++;
|
||||||
return html;
|
return html;
|
||||||
|
|
||||||
}).join('');
|
}).join('');
|
||||||
|
|
||||||
outerHtml += '</ul>';
|
outerHtml += '</ul>';
|
||||||
|
|
||||||
index++;
|
|
||||||
return outerHtml;
|
return outerHtml;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -773,6 +802,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.playFromHere) {
|
||||||
|
itemCommands.push('playfromhere');
|
||||||
|
itemCommands.push('queuefromhere');
|
||||||
|
}
|
||||||
|
|
||||||
return itemCommands;
|
return itemCommands;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -133,6 +133,12 @@
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function closeContextMenu() {
|
||||||
|
|
||||||
|
// Used by the tab menu, not the slide up
|
||||||
|
$('.tapHoldMenu').popup('close');
|
||||||
|
}
|
||||||
|
|
||||||
function onTrailerButtonClick() {
|
function onTrailerButtonClick() {
|
||||||
|
|
||||||
var id = this.getAttribute('data-itemid');
|
var id = this.getAttribute('data-itemid');
|
||||||
|
@ -141,8 +147,7 @@
|
||||||
MediaController.play({ items: trailers });
|
MediaController.play({ items: trailers });
|
||||||
});
|
});
|
||||||
|
|
||||||
// Used by the tab menu, not the slide up
|
closeContextMenu();
|
||||||
$('.tapHoldMenu').popup('close');
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -151,8 +156,7 @@
|
||||||
|
|
||||||
var card = $(this).parents('.card')[0];
|
var card = $(this).parents('.card')[0];
|
||||||
|
|
||||||
// Used by the tab menu
|
closeContextMenu();
|
||||||
$('.tapHoldMenu').popup('close');
|
|
||||||
|
|
||||||
showContextMenu(card, {
|
showContextMenu(card, {
|
||||||
showPlayOptions: false
|
showPlayOptions: false
|
||||||
|
@ -165,36 +169,20 @@
|
||||||
|
|
||||||
var id = this.getAttribute('data-itemid');
|
var id = this.getAttribute('data-itemid');
|
||||||
|
|
||||||
// Used by the tab menu, not the slide up
|
closeContextMenu();
|
||||||
$('.tapHoldMenu').popup('close');
|
|
||||||
|
|
||||||
PlaylistManager.showPanel([id]);
|
PlaylistManager.showPanel([id]);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onRemoveFromPlaylistButtonClick() {
|
|
||||||
|
|
||||||
var playlistItemId = this.getAttribute('data-playlistitemid');
|
|
||||||
|
|
||||||
var page = $(this).parents('.page');
|
|
||||||
|
|
||||||
$('.itemsContainer', page).trigger('removefromplaylist', [playlistItemId]);
|
|
||||||
|
|
||||||
// Used by the tab menu, not the slide up
|
|
||||||
$('.tapHoldMenu').popup('close');
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function onShuffleButtonClick() {
|
function onShuffleButtonClick() {
|
||||||
|
|
||||||
var id = this.getAttribute('data-itemid');
|
var id = this.getAttribute('data-itemid');
|
||||||
|
|
||||||
MediaController.shuffle(id);
|
MediaController.shuffle(id);
|
||||||
|
|
||||||
// Used by the tab menu, not the slide up
|
closeContextMenu();
|
||||||
$('.tapHoldMenu').popup('close');
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -205,8 +193,7 @@
|
||||||
|
|
||||||
MediaController.instantMix(id);
|
MediaController.instantMix(id);
|
||||||
|
|
||||||
// Used by the tab menu, not the slide up
|
closeContextMenu();
|
||||||
$('.tapHoldMenu').popup('close');
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -217,8 +204,7 @@
|
||||||
|
|
||||||
MediaController.queue(id);
|
MediaController.queue(id);
|
||||||
|
|
||||||
// Used by the tab menu, not the slide up
|
closeContextMenu();
|
||||||
$('.tapHoldMenu').popup('close');
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -229,8 +215,52 @@
|
||||||
|
|
||||||
MediaController.play(id);
|
MediaController.play(id);
|
||||||
|
|
||||||
// Used by the tab menu, not the slide up
|
closeContextMenu();
|
||||||
$('.tapHoldMenu').popup('close');
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onPlayAllFromHereButtonClick() {
|
||||||
|
|
||||||
|
var index = this.getAttribute('data-index');
|
||||||
|
|
||||||
|
var page = $(this).parents('.page');
|
||||||
|
|
||||||
|
var itemsContainer = $('.hasContextMenu', page).parents('.itemsContainer');
|
||||||
|
|
||||||
|
closeContextMenu();
|
||||||
|
|
||||||
|
itemsContainer.trigger('playallfromhere', [index]);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onQueueAllFromHereButtonClick() {
|
||||||
|
|
||||||
|
var index = this.getAttribute('data-index');
|
||||||
|
|
||||||
|
var page = $(this).parents('.page');
|
||||||
|
|
||||||
|
var itemsContainer = $('.hasContextMenu', page).parents('.itemsContainer');
|
||||||
|
|
||||||
|
closeContextMenu();
|
||||||
|
|
||||||
|
itemsContainer.trigger('queueallfromhere', [index]);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onRemoveFromPlaylistButtonClick() {
|
||||||
|
|
||||||
|
var playlistItemId = this.getAttribute('data-playlistitemid');
|
||||||
|
|
||||||
|
var page = $(this).parents('.page');
|
||||||
|
|
||||||
|
var itemsContainer = $('.hasContextMenu', page).parents('.itemsContainer');
|
||||||
|
|
||||||
|
itemsContainer.trigger('removefromplaylist', [playlistItemId]);
|
||||||
|
|
||||||
|
closeContextMenu();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -244,8 +274,7 @@
|
||||||
startPositionTicks: parseInt(this.getAttribute('data-ticks'))
|
startPositionTicks: parseInt(this.getAttribute('data-ticks'))
|
||||||
});
|
});
|
||||||
|
|
||||||
// Used by the tab menu, not the slide up
|
closeContextMenu();
|
||||||
$('.tapHoldMenu').popup('close');
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -260,7 +289,7 @@
|
||||||
|
|
||||||
function showContextMenu(card, options) {
|
function showContextMenu(card, options) {
|
||||||
|
|
||||||
$('.tapHoldMenu').popup("close").remove();
|
closeContextMenu();
|
||||||
|
|
||||||
var displayContextItem = card;
|
var displayContextItem = card;
|
||||||
|
|
||||||
|
@ -277,6 +306,7 @@
|
||||||
var playAccess = card.getAttribute('data-playaccess');
|
var playAccess = card.getAttribute('data-playaccess');
|
||||||
var locationType = card.getAttribute('data-locationtype');
|
var locationType = card.getAttribute('data-locationtype');
|
||||||
var isPlaceHolder = card.getAttribute('data-placeholder') == 'true';
|
var isPlaceHolder = card.getAttribute('data-placeholder') == 'true';
|
||||||
|
var index = card.getAttribute('data-index');
|
||||||
|
|
||||||
$(card).addClass('hasContextMenu');
|
$(card).addClass('hasContextMenu');
|
||||||
|
|
||||||
|
@ -297,8 +327,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.showPlayOptions !== false) {
|
if (options.showPlayOptions !== false) {
|
||||||
|
|
||||||
if (MediaController.canPlayByAttributes(itemType, mediaType, playAccess, locationType, isPlaceHolder)) {
|
if (MediaController.canPlayByAttributes(itemType, mediaType, playAccess, locationType, isPlaceHolder)) {
|
||||||
html += '<li data-icon="play"><a href="#" class="btnPlay" data-itemid="' + itemId + '">' + Globalize.translate('ButtonPlay') + '</a></li>';
|
html += '<li data-icon="play"><a href="#" class="btnPlay" data-itemid="' + itemId + '">' + Globalize.translate('ButtonPlay') + '</a></li>';
|
||||||
|
|
||||||
|
if (commands.indexOf('playfromhere') != -1) {
|
||||||
|
html += '<li data-icon="play"><a href="#" class="btnPlayAllFromHere" data-index="' + index + '">' + Globalize.translate('ButtonPlayAllFromHere') + '</a></li>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playbackPositionTicks && mediaType != "Audio") {
|
if (playbackPositionTicks && mediaType != "Audio") {
|
||||||
|
@ -312,6 +347,10 @@
|
||||||
|
|
||||||
if (MediaController.canQueueMediaType(mediaType, itemType)) {
|
if (MediaController.canQueueMediaType(mediaType, itemType)) {
|
||||||
html += '<li data-icon="plus"><a href="#" class="btnQueue" data-itemid="' + itemId + '">' + Globalize.translate('ButtonQueue') + '</a></li>';
|
html += '<li data-icon="plus"><a href="#" class="btnQueue" data-itemid="' + itemId + '">' + Globalize.translate('ButtonQueue') + '</a></li>';
|
||||||
|
|
||||||
|
if (commands.indexOf('queuefromhere') != -1) {
|
||||||
|
html += '<li data-icon="plus"><a href="#" class="btnQueueAllFromHere" data-index="' + index + '">' + Globalize.translate('ButtonQueueAllFromHere') + '</a></li>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commands.indexOf('instantmix') != -1) {
|
if (commands.indexOf('instantmix') != -1) {
|
||||||
|
@ -350,6 +389,8 @@
|
||||||
$('.btnPlayTrailer', elem).on('click', onTrailerButtonClick);
|
$('.btnPlayTrailer', elem).on('click', onTrailerButtonClick);
|
||||||
$('.btnAddToPlaylist', elem).on('click', onAddToPlaylistButtonClick);
|
$('.btnAddToPlaylist', elem).on('click', onAddToPlaylistButtonClick);
|
||||||
$('.btnRemoveFromPlaylist', elem).on('click', onRemoveFromPlaylistButtonClick);
|
$('.btnRemoveFromPlaylist', elem).on('click', onRemoveFromPlaylistButtonClick);
|
||||||
|
$('.btnPlayAllFromHere', elem).on('click', onPlayAllFromHereButtonClick);
|
||||||
|
$('.btnQueueAllFromHere', elem).on('click', onQueueAllFromHereButtonClick);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
|
|
||||||
MediaController.getCurrentPlayer().displayContent({
|
MediaController.getCurrentPlayer().displayContent({
|
||||||
|
|
||||||
itemName: item.Name,
|
ItemName: item.Name,
|
||||||
itemId: item.Id,
|
ItemId: item.Id,
|
||||||
itemType: item.Type,
|
ItemType: item.Type,
|
||||||
context: info.context
|
Context: info.context
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -435,6 +435,7 @@
|
||||||
|
|
||||||
self.playlist = items;
|
self.playlist = items;
|
||||||
currentPlaylistIndex = 0;
|
currentPlaylistIndex = 0;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/' + firstItem.Id + '/Intros')).done(function (intros) {
|
ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/' + firstItem.Id + '/Intros')).done(function (intros) {
|
||||||
|
|
|
@ -75,7 +75,8 @@
|
||||||
showIndex: false,
|
showIndex: false,
|
||||||
title: item.Name,
|
title: item.Name,
|
||||||
showRemoveFromPlaylist: true,
|
showRemoveFromPlaylist: true,
|
||||||
smallIcon: true
|
smallIcon: true,
|
||||||
|
playFromHere: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,6 +182,24 @@
|
||||||
|
|
||||||
removeFromPlaylist(page, [playlistItemId]);
|
removeFromPlaylist(page, [playlistItemId]);
|
||||||
|
|
||||||
|
}).on('playallfromhere', function (e, index) {
|
||||||
|
|
||||||
|
LibraryBrowser.playAllFromHere({
|
||||||
|
|
||||||
|
Recursive: true,
|
||||||
|
ParentId: query.ParentId
|
||||||
|
|
||||||
|
}, index);
|
||||||
|
|
||||||
|
}).on('queueallfromhere', function (e, index) {
|
||||||
|
|
||||||
|
LibraryBrowser.queueAllFromHere({
|
||||||
|
|
||||||
|
Recursive: true,
|
||||||
|
ParentId: query.ParentId
|
||||||
|
|
||||||
|
}, index);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pagebeforeshow', "#playlistEditorPage", function () {
|
}).on('pagebeforeshow', "#playlistEditorPage", function () {
|
||||||
|
|
|
@ -1274,14 +1274,13 @@ $(document).on('pagebeforeshow', ".page", function () {
|
||||||
|
|
||||||
var page = $(this);
|
var page = $(this);
|
||||||
|
|
||||||
var userId = Dashboard.getCurrentUserId();
|
if (Dashboard.getAccessToken() && Dashboard.getCurrentUserId()) {
|
||||||
|
|
||||||
if (userId) {
|
|
||||||
|
|
||||||
Dashboard.getCurrentUser().done(function (user) {
|
Dashboard.getCurrentUser().done(function (user) {
|
||||||
|
|
||||||
if (!user.Configuration.IsAdministrator && page.hasClass('type-interior') && !page.hasClass('publicUserPage')) {
|
if (!user.Configuration.IsAdministrator && page.hasClass('type-interior') && !page.hasClass('publicUserPage')) {
|
||||||
window.location.replace("index.html");
|
window.location.replace("index.html");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Dashboard.ensureToolsMenu(page, user);
|
Dashboard.ensureToolsMenu(page, user);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue