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

update selection buttons

This commit is contained in:
Luke Pulverenti 2015-07-14 12:39:34 -04:00
parent 59a3cada00
commit 1c27cdeb2c
35 changed files with 226 additions and 115 deletions

View file

@ -10,6 +10,7 @@
$('#chkUpcomingTheaterTrailers', page).checked(config.EnableIntrosFromUpcomingTrailers).checkboxradio('refresh');
$('#chkUpcomingDvdTrailers', page).checked(config.EnableIntrosFromUpcomingDvdMovies).checkboxradio('refresh');
$('#chkUpcomingStreamingTrailers', page).checked(config.EnableIntrosFromUpcomingStreamingMovies).checkboxradio('refresh');
$('#chkOtherTrailers', page).checked(config.EnableIntrosFromSimilarMovies).checkboxradio('refresh');
$('#chkUnwatchedOnly', page).checked(!config.EnableIntrosForWatchedContent).checkboxradio('refresh');
$('#chkEnableParentalControl', page).checked(config.EnableIntrosParentalControl).checkboxradio('refresh');
@ -41,6 +42,7 @@
config.EnableIntrosFromUpcomingTrailers = $('#chkUpcomingTheaterTrailers', page).checked();
config.EnableIntrosFromUpcomingDvdMovies = $('#chkUpcomingDvdTrailers', page).checked();
config.EnableIntrosFromUpcomingStreamingMovies = $('#chkUpcomingStreamingTrailers', page).checked();
config.EnableIntrosFromSimilarMovies = $('#chkOtherTrailers', page).checked();
ApiClient.updateNamedConfiguration("cinemamode", config).done(Dashboard.processServerConfigurationUpdateResult);
});

View file

@ -364,6 +364,14 @@
updateFilterControls(this);
Dashboard.getCurrentUser().done(function(user) {
if (user.Policy.IsAdministrator) {
$('.btnMergeVersions', page).show();
} else {
$('.btnMergeVersions', page).hide();
}
});
});
})(jQuery, document);

View file

@ -592,6 +592,11 @@
});
});
var btnMore = page.querySelectorAll('.btnMoreCommands iron-icon');
for (var i = 0, length = btnMore.length; i < length; i++) {
btnMore[i].icon = AppInfo.moreIcon;
}
}).on('pagebeforeshowready', "#itemByNameDetailPage", function () {
var page = this;

View file

@ -1691,9 +1691,13 @@
}).on("click", ".moreCriticReviews", function () {
renderCriticReviews(page, currentItem);
});
var btnMore = page.querySelectorAll('.btnMoreCommands iron-icon');
for (var i = 0, length = btnMore.length; i < length; i++) {
btnMore[i].icon = AppInfo.moreIcon;
}
}).on('pagebeforeshowready', "#itemDetailPage", function () {
var page = this;

View file

@ -1138,7 +1138,7 @@
html += '</span>';
//html += '<button type="button" data-role="none" class="listviewMenuButton imageButton listViewMoreButton" data-icon="none">';
//html += '</button>';
html += '<paper-icon-button icon="more-vert" class="listviewMenuButton"></paper-icon-button>';
html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="listviewMenuButton"></paper-icon-button>';
html += '<span class="listViewUserDataButtons">';
html += LibraryBrowser.getUserDataIconsHtml(item);
html += '</span>';
@ -1811,7 +1811,7 @@
html += '<paper-icon-button icon="play-arrow" class="cardOverlayPlayButton" onclick="return false;"></paper-icon-button>';
}
if (options.overlayMoreButton) {
html += '<paper-icon-button icon="more-vert" class="cardOverlayMoreButton" onclick="return false;"></paper-icon-button>';
html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="cardOverlayMoreButton" onclick="return false;"></paper-icon-button>';
}
// cardScalable
@ -1838,7 +1838,7 @@
if (options.cardLayout) {
html += '<div class="cardButtonContainer">';
html += '<paper-icon-button icon="more-vert" class="listviewMenuButton btnCardOptions"></paper-icon-button>';
html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="listviewMenuButton btnCardOptions"></paper-icon-button>';
html += "</div>";
}
@ -2400,7 +2400,7 @@
if (options.viewButton) {
//html += '<paper-button raised class="subdued notext"><iron-icon icon="view-comfy"></iron-icon></paper-button>';
html += '<paper-button raised class="subdued notext" onclick="require([\'jqmicons\']);jQuery(\'.viewPanel\', jQuery(this).parents(\'.page\')).panel(\'toggle\');"><iron-icon icon="more-vert"></iron-icon></paper-button>';
html += '<paper-button raised class="subdued notext" onclick="require([\'jqmicons\']);jQuery(\'.viewPanel\', jQuery(this).parents(\'.page\')).panel(\'toggle\');"><iron-icon icon="' + AppInfo.moreIcon + '"></iron-icon></paper-button>';
}
html += '</div>';

View file

@ -124,7 +124,7 @@
buttonCount++;
}
html += '<paper-icon-button icon="more-vert" class="btnMoreCommands"></paper-icon-button>';
html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="btnMoreCommands"></paper-icon-button>';
buttonCount++;
html += '</div>';
@ -508,7 +508,7 @@
while (target != null) {
var tagName = target.tagName || '';
if (tagName == 'A' || tagName.indexOf('BUTTON') != -1) {
if (tagName == 'A' || tagName.indexOf('BUTTON') != -1 || tagName.indexOf('INPUT') != -1) {
return true;
}
@ -780,9 +780,13 @@
function onCardClick(e) {
if (isClickable(targetElem)) {
return;
}
var targetElem = e.target;
if (targetElem.classList.contains('itemSelectionPanel') || this.querySelector('.itemSelectionPanel')) {
return false;
return;
}
var info = LibraryBrowser.getListItemInfo(this);
@ -807,10 +811,6 @@
return;
}
if (isClickable(targetElem)) {
return;
}
var target = $(targetElem);
if (target.parents('a').length || target.parents('button').length) {
return;

View file

@ -29,9 +29,7 @@
html += '<paper-icon-button icon="mic" class="headerButton headerButtonRight headerVoiceButton hide" onclick="VoiceInputManager.startListening();"></paper-icon-button>';
if (!showUserAtTop()) {
html += '<button class="headerButton headerButtonRight headerUserButton" type="button" data-role="none" onclick="Dashboard.showUserFlyout(this);">';
html += '<div class="fa fa-user"></div>';
html += '</button>';
html += '<paper-icon-button icon="person" class="headerButton headerButtonRight headerUserButton" onclick="return Dashboard.showUserFlyout(this);"></paper-icon-button>';
}
if (!$.browser.mobile && !AppInfo.isNativeApp) {
@ -93,9 +91,7 @@
}
}
var userButtonHtml = '';
if (user.name) {
if (user.imageUrl && AppInfo.enableUserImage) {
var userButtonHeight = 26;
@ -106,15 +102,12 @@
url += "&height=" + (userButtonHeight * Math.max(devicePixelRatio || 1, 2));
}
userButtonHtml += '<div class="lazy headerUserImage" data-src="' + url + '" style="width:' + userButtonHeight + 'px;height:' + userButtonHeight + 'px;"></div>';
} else {
userButtonHtml += '<div class="fa fa-user"></div>';
}
var headerUserButton = header.querySelector('.headerUserButton');
if (headerUserButton) {
headerUserButton.innerHTML = userButtonHtml;
ImageLoader.lazyChildren(headerUserButton);
var headerUserButton = header.querySelector('.headerUserButton');
if (headerUserButton) {
headerUserButton.icon = null;
headerUserButton.src = url;
headerUserButton.classList.add('headerUserButtonRound');
}
}
}
}
@ -567,7 +560,7 @@
$('.btnCast').removeClass('btnActiveCast').each(function () {
this.icon = 'cast';
});
$('.nowPlayingSelectedPlayer').html('');
$('.headerSelectedPlayer').html('');
} else {
@ -575,7 +568,7 @@
this.icon = 'cast-connected';
});
$('.nowPlayingSelectedPlayer').html((info.deviceName || info.name));
$('.headerSelectedPlayer').html((info.deviceName || info.name));
}
}

View file

@ -411,12 +411,29 @@
// External vtt or burn in
profile.SubtitleProfiles = [];
if (self.supportsTextTracks()) {
profile.SubtitleProfiles.push({
Format: 'vtt',
Method: 'External'
});
if (isVlc) {
profile.SubtitleProfiles.push({
Format: 'srt',
Method: 'External'
});
profile.SubtitleProfiles.push({
Format: 'srt',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'ass',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'ssa',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'pgs',
Method: 'Embed'
});
} else {
profile.SubtitleProfiles.push({
Format: 'vtt',
Method: 'External'
@ -823,7 +840,12 @@
contentType = 'video/' + mediaSource.Container;
if (mediaSource.enableDirectPlay) {
mediaUrl = FileSystemBridge.translateFilePath(mediaSource.Path);
mediaUrl = mediaSource.Path;
if (mediaSource.Protocol == 'File') {
mediaUrl = FileSystemBridge.translateFilePath(mediaUrl);
}
playMethod = 'DirectPlay';
} else {
@ -860,7 +882,11 @@
if (mediaSource.enableDirectPlay) {
mediaUrl = FileSystemBridge.translateFilePath(mediaSource.Path);
mediaUrl = mediaSource.Path;
if (mediaSource.Protocol == 'File') {
mediaUrl = FileSystemBridge.translateFilePath(mediaUrl);
}
playMethod = 'DirectPlay';
} else {

View file

@ -461,6 +461,14 @@
updateFilterControls(page);
filtersLoaded = false;
Dashboard.getCurrentUser().done(function (user) {
if (user.Policy.IsAdministrator) {
$('.btnMergeVersions', page).show();
} else {
$('.btnMergeVersions', page).hide();
}
});
});
})(jQuery, document);

View file

@ -685,7 +685,7 @@
$('.nowPlayingCastIcon').each(function () {
this.icon = 'cast';
});
$('.headerSelectedPlayer').html('');
$('.nowPlayingSelectedPlayer').html('');
} else {
@ -693,7 +693,7 @@
this.icon = 'cast-connected';
});
$('.headerSelectedPlayer').html((info.deviceName || info.name));
$('.nowPlayingSelectedPlayer').html((info.deviceName || info.name));
}
}

View file

@ -85,7 +85,7 @@
html += '<div class="cardFooter">';
html += '<div class="cardText" style="text-align:right; float:right;padding-top:5px;">';
html += '<paper-icon-button icon="more-vert" class="btnCardMenu"></paper-icon-button>';
html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="btnCardMenu"></paper-icon-button>';
html += "</div>";
html += "<div class='cardText'>";

View file

@ -190,6 +190,19 @@
return deferred.promise();
};
var pollInterval;
function onPollIntervalFired() {
if (!ApiClient.isWebSocketOpen()) {
var apiClient = window.ApiClient;
if (apiClient) {
apiClient.getSessions().done(processUpdatedSessions);
}
}
}
self.subscribeToPlayerUpdates = function () {
self.isUpdating = true;
@ -198,16 +211,25 @@
ApiClient.sendWebSocketMessage("SessionsStart", "100,800");
}
if (pollInterval) {
clearInterval(pollInterval);
pollInterval = null;
}
pollInterval = setInterval(onPollIntervalFired, 1500);
};
function unsubscribeFromPlayerUpdates() {
self.false = true;
self.isUpdating = true;
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("SessionsStop");
}
if (pollInterval) {
clearInterval(pollInterval);
pollInterval = null;
}
}
var playerListenerCount = 0;
@ -307,23 +329,28 @@
}
}
function processUpdatedSessions(sessions) {
var currentTargetId = MediaController.getPlayerInfo().id;
// Update existing data
//updateSessionInfo(popup, msg.Data);
var session = sessions.filter(function (s) {
return s.Id == currentTargetId;
})[0];
if (session) {
firePlaybackEvent('playstatechange', session);
}
}
function onWebSocketMessageReceived(e, msg) {
var apiClient = this;
if (msg.MessageType === "Sessions") {
var currentTargetId = MediaController.getPlayerInfo().id;
// Update existing data
//updateSessionInfo(popup, msg.Data);
var session = msg.Data.filter(function (s) {
return s.Id == currentTargetId;
})[0];
if (session) {
firePlaybackEvent('playstatechange', session);
}
processUpdatedSessions(msg.Data);
}
else if (msg.MessageType === "SessionEnded") {

View file

@ -167,16 +167,31 @@
reloadList($.mobile.activePage);
}
var pollInterval;
function onPollIntervalFired() {
if (!ApiClient.isWebSocketOpen()) {
reloadList($.mobile.activePage);
}
}
function startInterval() {
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000");
}
if (pollInterval) {
clearInterval(pollInterval);
}
pollInterval = setInterval(onPollIntervalFired, 1500);
}
function stopInterval() {
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop");
}
if (pollInterval) {
clearInterval(pollInterval);
}
}
$(document).on('pageinitdepends', "#scheduledTasksPage", function () {

View file

@ -84,7 +84,7 @@
if (server.showOptions !== false) {
html += '<div class="cardText" style="text-align:right; float:right;padding:0;">';
html += '<paper-icon-button icon="more-vert" class="btnServerMenu"></paper-icon-button>';
html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="btnServerMenu"></paper-icon-button>';
html += "</div>";
}
@ -318,7 +318,7 @@
html += '<div class="cardFooter outerCardFooter">';
html += '<div class="cardText" style="text-align:right; float:right;padding:0;">';
html += '<paper-icon-button icon="more-vert" class="btnInviteMenu"></paper-icon-button>';
html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="btnInviteMenu"></paper-icon-button>';
html += "</div>";
html += '<div class="cardText">';

View file

@ -1715,6 +1715,12 @@ var AppInfo = {};
AppInfo.directPlayAudioContainers = [];
AppInfo.directPlayVideoContainers = [];
}
if (isCordova && isIOS) {
AppInfo.moreIcon = 'more-horiz';
} else {
AppInfo.moreIcon = 'more-vert';
}
}
function initializeApiClient(apiClient) {
@ -1780,7 +1786,9 @@ var AppInfo = {};
require(["bower_components/fastclick/lib/fastclick"], function (FastClick) {
FastClick.attach(document.body);
FastClick.attach(document.body, {
tapDelay: 0
});
// Have to work around this issue of fast click breaking the panel dismiss
$(document.body).on('touchstart', '.ui-panel-dismiss', function () {
@ -1845,7 +1853,7 @@ var AppInfo = {};
}
}
if ($.browser.msie && ($.browser.version || 11) <= 10) {
if ($.browser.msie && $.browser.tv && ($.browser.version || 11) <= 10) {
Dashboard.importCss('thirdparty/paper-ie10.css');
}

View file

@ -118,7 +118,7 @@
}
html += '<div class="cardText" style="text-align:right; float:right;padding:0;">';
html += '<paper-icon-button icon="more-vert" class="btnJobMenu"></paper-icon-button>';
html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="btnJobMenu"></paper-icon-button>';
html += "</div>";
for (var i = 0, length = textLines.length; i < length; i++) {

View file

@ -34,7 +34,7 @@ $.fn.taskButton = function (options) {
return;
}
button.buttonEnabled(task.State == 'Idle').attr('data-taskid', task.Id);
$(button).buttonEnabled(task.State == 'Idle').attr('data-taskid', task.Id);
var progress = (task.CurrentProgressPercentage || 0).toFixed(1);
@ -102,9 +102,7 @@ $.fn.taskButton = function (options) {
}
function onSocketOpen() {
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000");
}
startInterval();
}
function onSocketMessage(e, msg) {
@ -117,6 +115,33 @@ $.fn.taskButton = function (options) {
}
var self = this;
var pollInterval;
function onPollIntervalFired() {
if (!ApiClient.isWebSocketOpen()) {
pollTasks(self);
}
}
function startInterval() {
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000");
}
if (pollInterval) {
clearInterval(pollInterval);
}
pollInterval = setInterval(onPollIntervalFired, 1500);
}
function stopInterval() {
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop");
}
if (pollInterval) {
clearInterval(pollInterval);
}
}
if (options.panel) {
$(options.panel).hide();
@ -126,10 +151,7 @@ $.fn.taskButton = function (options) {
this.off('click', onButtonClick);
$(ApiClient).off("websocketmessage", onSocketMessage).off('websocketopen', onSocketOpen);
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop");
}
stopInterval();
} else if (this.length) {
@ -137,9 +159,7 @@ $.fn.taskButton = function (options) {
pollTasks(self);
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "1000,1000");
}
startInterval();
$(ApiClient).on("websocketmessage", onSocketMessage).on('websocketopen', onSocketOpen);
}

View file

@ -143,7 +143,7 @@
html += '<div class="cardFooter">';
html += '<div class="cardText" style="text-align:right; float:right;padding:0;">';
html += '<paper-icon-button icon="more-vert" class="btnUserMenu"></paper-icon-button>';
html += '<paper-icon-button icon="' + AppInfo.moreIcon + '" class="btnUserMenu"></paper-icon-button>';
html += "</div>";
html += '<div class="cardText" style="padding-top:10px;padding-bottom:10px;">';