From 32386e817b4fc8d8c6f6d60ddb5fc93637554a43 Mon Sep 17 00:00:00 2001
From: Luke Pulverenti
'; + html += '
'; html += ''; html += LibraryBrowser.getRatingHtml(item); html += ''; html += '
'; - //html += ''; - //html += ''; - //html += LibraryBrowser.getUserDataIconsHtml(item); - //html += ''; - //html += '
'; + html += ''; + html += ''; + html += LibraryBrowser.getUserDataIconsHtml(item); + html += ''; + html += '
'; html += '';
html += (item.OverviewHtml || item.Overview || '');
@@ -2494,14 +2494,26 @@
var popup = $('.itemFlyout').on('mouseenter', onOverlayMouseOver).on('mouseleave', onOverlayMouseOut).popup({ positionTo: elem }).trigger('create').popup("open").on("popupafterclose", function () {
- $(elem).off('mouseleave.overlay', onHoverOut);
$(this).off("popupafterclose").off("mouseenter").off("mouseleave").remove();
});
popup.parents().prev('.ui-popup-screen').remove();
currentPosterItem = elem;
+ }
- $(elem).on('mouseleave.overlay', onHoverOut).on('click.overlay', hideOverlay);
+ function onPosterItemClicked() {
+
+ if (showOverlayTimeout) {
+ clearTimeout(showOverlayTimeout);
+ showOverlayTimeout = null;
+ }
+
+ if (hideOverlayTimeout) {
+ clearTimeout(hideOverlayTimeout);
+ hideOverlayTimeout = null;
+ }
+
+ hideOverlay();
}
function hideOverlay() {
@@ -2510,7 +2522,7 @@
if (currentPosterItem) {
- $(currentPosterItem).off('mouseleave.overlay').off('click.overlay');
+ $(currentPosterItem).off('click.overlay');
currentPosterItem = null;
}
}
@@ -2535,7 +2547,7 @@
startHideOverlayTimer();
}
- $.fn.createPosterItemHoverMenu = function (items) {
+ $.fn.createPosterItemHoverMenu = function () {
function onShowTimerExpired(elem) {
@@ -2573,14 +2585,19 @@
}, 600);
}
- return this.hoverIntent({
- over: onHoverIn,
- out: function () {
+ // https://hacks.mozilla.org/2013/04/detecting-touch-its-the-why-not-the-how/
+
+ if (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)) {
+ /* browser with either Touch Events of Pointer Events
+ running on touch-capable device */
+ return this;
+ }
- },
- selector: '.posterItem'
+ return this;
- });
+ return this.on('mouseenter', '.posterItem', onHoverIn)
+ .on('mouseleave', '.posterItem', onHoverOut)
+ .on('click', '.posterItem', onPosterItemClicked);
};
})(jQuery, document, window);
diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js
index e4a87fde78..30560fd50a 100644
--- a/dashboard-ui/scripts/librarymenu.js
+++ b/dashboard-ui/scripts/librarymenu.js
@@ -1,11 +1,11 @@
(function (window, document, $) {
var itemCountsPromise;
- var liveTvServicesPromise;
+ var liveTvInfoPromise;
function ensurePromises() {
itemCountsPromise = itemCountsPromise || ApiClient.getItemCounts(Dashboard.getCurrentUserId());
- liveTvServicesPromise = liveTvServicesPromise || ApiClient.getLiveTvServices();
+ liveTvInfoPromise = liveTvInfoPromise || ApiClient.getLiveTvInfo();
}
function renderHeader(page, user) {
@@ -56,7 +56,7 @@
$('.viewMenuBar', page).trigger('create');
}
- function insertViews(page, user, counts, liveTvServices) {
+ function insertViews(page, user, counts, liveTvInfo) {
var html = '';
@@ -74,7 +74,7 @@
html += '' + (view == 'tv' ? selectedHtml : '') + 'TV';
}
- if (liveTvServices.length) {
+ if (liveTvInfo.ActiveServiceName) {
html += '' + (view == 'livetv' ? selectedHtml : '') + 'Live TV';
}
@@ -93,18 +93,18 @@
ensurePromises();
- $.when(itemCountsPromise, liveTvServicesPromise).done(function (response1, response2) {
+ $.when(itemCountsPromise, liveTvInfoPromise).done(function (response1, response2) {
var counts = response1[0];
- var liveTvServices = response2[0];
+ var liveTvInfo = response2[0];
- var panel = getLibraryMenu(page, counts, liveTvServices);
+ var panel = getLibraryMenu(page, counts, liveTvInfo);
$(panel).panel('toggle');
});
}
- function getLibraryMenu(page, counts, liveTvServices) {
+ function getLibraryMenu(page, counts, liveTvInfo) {
var panel = $('#libraryPanel', page);
@@ -146,7 +146,7 @@
]);
}
- if (liveTvServices.length) {
+ if (liveTvInfo.ActiveServiceName) {
html += getCollapsibleHtml('Live TV', [
{ text: 'Suggested', href: 'livetvsuggested.html' },
@@ -249,12 +249,12 @@
ensurePromises();
- $.when(itemCountsPromise, liveTvServicesPromise).done(function (response1, response2) {
+ $.when(itemCountsPromise, liveTvInfoPromise).done(function (response1, response2) {
var counts = response1[0];
- var liveTvServices = response2[0];
+ var liveTvInfo = response2[0];
- insertViews(page, user, counts, liveTvServices);
+ insertViews(page, user, counts, liveTvInfo);
});
diff --git a/dashboard-ui/scripts/livetvsettings.js b/dashboard-ui/scripts/livetvsettings.js
index 48069939ba..1583f16204 100644
--- a/dashboard-ui/scripts/livetvsettings.js
+++ b/dashboard-ui/scripts/livetvsettings.js
@@ -1,8 +1,8 @@
(function ($, document, window) {
- function loadPage(page, config, tvServices) {
+ function loadPage(page, config, liveTvInfo) {
- if (tvServices.length) {
+ if (liveTvInfo.Services.length) {
$('.liveTvSettingsForm', page).show();
$('.noLiveTvServices', page).hide();
@@ -25,7 +25,7 @@
var promise1 = ApiClient.getServerConfiguration();
- var promise2 = ApiClient.getLiveTvServices();
+ var promise2 = ApiClient.getLiveTvInfo();
$.when(promise1, promise2).done(function (response1, response2) {
diff --git a/dashboard-ui/scripts/livetvtimer.js b/dashboard-ui/scripts/livetvtimer.js
index 1d739129b5..89d01a35e9 100644
--- a/dashboard-ui/scripts/livetvtimer.js
+++ b/dashboard-ui/scripts/livetvtimer.js
@@ -14,7 +14,7 @@
Dashboard.alert('Recording cancelled.');
- reload(page);
+ Dashboard.navigate('livetvtimers.html');
});
}
diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js
index 7254b3be27..9e75a78218 100644
--- a/dashboard-ui/scripts/mediaplayer.js
+++ b/dashboard-ui/scripts/mediaplayer.js
@@ -363,7 +363,7 @@
if (!$(this).hasClass('selectedMediaFlyoutOption')) {
var channelId = this.getAttribute('data-channelid');
- self.playById(channelId, 'Channel');
+ self.playById(channelId);
}
hideFlyout($('#channelsFlyout'));
@@ -1229,29 +1229,7 @@
return ApiClient.getItems(userId, query);
};
- self.playById = function (id, itemType, startPositionTicks) {
-
- if (itemType == "Recording") {
-
- ApiClient.getLiveTvRecording(id, Dashboard.getCurrentUserId()).done(function (item) {
-
- self.play([item], startPositionTicks);
-
- });
-
- return;
- }
-
- if (itemType == "Channel") {
-
- ApiClient.getLiveTvChannel(id, Dashboard.getCurrentUserId()).done(function (item) {
-
- self.play([item], startPositionTicks);
-
- });
-
- return;
- }
+ self.playById = function (id, startPositionTicks) {
ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) {
diff --git a/dashboard-ui/thirdparty/jquery.hoverIntent.minified.js b/dashboard-ui/thirdparty/jquery.hoverIntent.minified.js
deleted file mode 100644
index 3f6bf7372b..0000000000
--- a/dashboard-ui/thirdparty/jquery.hoverIntent.minified.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*!
- * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+
- * http://cherne.net/brian/resources/jquery.hoverIntent.html
- *
- * You may use hoverIntent under the terms of the MIT license.
- * Copyright 2007, 2013 Brian Cherne
- */
-(function(e){e.fn.hoverIntent=function(t,n,r){var i={interval:100,sensitivity:7,timeout:0};if(typeof t==="object"){i=e.extend(i,t)}else if(e.isFunction(n)){i=e.extend(i,{over:t,out:n,selector:r})}else{i=e.extend(i,{over:t,out:t,selector:n})}var s,o,u,a;var f=function(e){s=e.pageX;o=e.pageY};var l=function(t,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if(Math.abs(u-s)+Math.abs(a-o)