diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 1804e4f09d..b73c583e04 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -312,17 +312,6 @@ vertical-align: middle; } -.criticRatingSummary { - color: #506A16 !important; - background-color: #F2F0C4; - background-image: -webkit-gradient(linear,left top,left bottom,from(#FFE37C),to(#F2F0C4)); - background-image: -webkit-linear-gradient(top,#FFE37C,#F2F0C4); - background-image: -moz-linear-gradient(top,#FFE37C,#F2F0C4); - background-image: -ms-linear-gradient(top,#FFE37C,#F2F0C4); - background-image: -o-linear-gradient(top,#FFE37C,#F2F0C4); - background-image: linear-gradient(top,#FFE37C,#F2F0C4); -} - .criticRatingScore { font-weight: bold; font-size: 18px; @@ -1216,19 +1205,42 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { bottom: 0; left: 0; right: 0; - height: 55px; - background-color: rgba(0, 0, 0, .85); + top: 0; + background-color: rgba(0, 0, 0, .3); z-index: 999; - text-align: center; - padding: 1em; + border: 2px solid #52B54B; } - .itemSelectionPanel .ui-checkbox { - max-width: 130px; - margin-left: auto; - margin-right: auto; + .itemSelectionPanel #checkbox { + border-radius: 0 !important; } +.selectionCommandsPanel { + position: fixed; + top: 0; + left: 0; + right: 0; + height: 50px; + background: #52B54B; + z-index: 1000; +} + + .selectionCommandsPanel paper-icon-button { + color: #fff; + vertical-align: middle; + } + +.itemSelectionCount { + font-size: 28px; + vertical-align: middle; + color: #fff; +} + +.selectionCommandsPanel iron-icon { + height: 32px; + width: 32px; +} + @media all and (min-height: 480px) { .alphabetPicker { diff --git a/dashboard-ui/scripts/episodes.js b/dashboard-ui/scripts/episodes.js index 1c1588540c..50756169fe 100644 --- a/dashboard-ui/scripts/episodes.js +++ b/dashboard-ui/scripts/episodes.js @@ -379,14 +379,6 @@ reloadItems(tabContent, viewPanel); updateFilterControls(tabContent, viewPanel); } - - Dashboard.getCurrentUser().done(function (user) { - if (user.Policy.IsAdministrator) { - $('.btnMergeVersions', page).show(); - } else { - $('.btnMergeVersions', page).hide(); - } - }); }; })(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index fbbe49a078..423a0b2619 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -519,25 +519,8 @@ }); } - function onListViewMenuButtonClick(e) { + function onListViewPlayButtonClick(e, playButton) { - var btn = parentWithClass(e.target, 'listviewMenuButton') || parentWithClass(e.target, 'cardOverlayMoreButton'); - - if (btn) { - showContextMenu(btn, {}); - - e.preventDefault(); - return false; - } - } - - function onListViewPlayButtonClick(e) { - - var playButton = parentWithClass(e.target, 'cardOverlayPlayButton'); - - if (!playButton) { - return; - } var card = e.target; if (!card.classList.contains('card') && !card.classList.contains('listItem')) { @@ -579,13 +562,40 @@ return false; } - function onGroupedCardClick(e) { + function onCardClick(e) { - var card = parentWithClass(e.target, 'groupedCard'); + var playButton = parentWithClass(e.target, 'cardOverlayPlayButton'); - if (!card) { - return; + if (playButton) { + return onListViewPlayButtonClick(e, playButton); } + + var listviewMenuButton = parentWithClass(e.target, 'listviewMenuButton') || parentWithClass(e.target, 'cardOverlayMoreButton'); + + if (listviewMenuButton) { + showContextMenu(listviewMenuButton, {}); + + e.preventDefault(); + return false; + } + + var card = parentWithClass(e.target, 'card'); + + if (card) { + + var itemSelectionPanel = card.querySelector('.itemSelectionPanel'); + if (itemSelectionPanel) { + return onItemSelectionPanelClick(e, itemSelectionPanel); + } + + if (card.classList.contains('groupedCard')) { + return onGroupedCardClick(e); + } + } + } + + function onGroupedCardClick(e, card) { + var itemId = card.getAttribute('data-itemid'); var context = card.getAttribute('data-context'); @@ -872,7 +882,7 @@ elem = elem.querySelector('a'); - if ($('.itemSelectionPanel:visible', elem).length) { + if (elem.querySelector('.itemSelectionPanel')) { return; } @@ -945,20 +955,14 @@ preventHover = true; } - this.off('click', onGroupedCardClick); - this.on('click', onGroupedCardClick); - - this.off('click', onListViewMenuButtonClick); - this.on('click', onListViewMenuButtonClick); - - this.off('click', onListViewPlayButtonClick); - this.on('click', onListViewPlayButtonClick); + this.off('click', onCardClick); + this.on('click', onCardClick); if (AppInfo.isTouchPreferred) { - //this.off('contextmenu', disableEvent); - //this.on('contextmenu', disableEvent); - this.off('contextmenu', onContextMenu); - this.on('contextmenu', onContextMenu); + this.off('contextmenu', disableEvent); + this.on('contextmenu', disableEvent); + //this.off('contextmenu', onContextMenu); + //this.on('contextmenu', onContextMenu); } else { this.off('contextmenu', onContextMenu); @@ -975,7 +979,7 @@ } for (var i = 0, length = this.length; i < length; i++) { - //initTapHold(this[i]); + initTapHold(this[i]); } return this; @@ -987,7 +991,31 @@ } function onTapHold(e) { - onContextMenu(e); + + var card = parentWithClass(e.target, 'card'); + + if (card) { + + showSelections(card); + + e.preventDefault(); + return false; + } + } + + function onTapHoldUp(e) { + + var itemSelectionPanel = parentWithClass(e.target, 'itemSelectionPanel'); + + if (itemSelectionPanel) { + if (!parentWithClass(e.target, 'chkItemSelect')) { + var chkItemSelect = itemSelectionPanel.querySelector('.chkItemSelect'); + + if (chkItemSelect) { + chkItemSelect.checked = !chkItemSelect.checked; + } + } + } } function initTapHold(element) { @@ -1001,78 +1029,187 @@ var hammertime = new Hammer(element); hammertime.on('press', onTapHold); + hammertime.on('pressup', onTapHoldUp); }); } - function toggleSelections(page) { + function onItemSelectionPanelClick(e, itemSelectionPanel) { - Dashboard.showLoadingMsg(); + // toggle the checkbox, if it wasn't clicked on + if (!parentWithClass(e.target, 'chkItemSelect')) { + var chkItemSelect = itemSelectionPanel.querySelector('.chkItemSelect'); - var selectionCommands = $('.selectionCommands', page); + if (chkItemSelect) { + var newValue = !chkItemSelect.checked; + chkItemSelect.checked = newValue; + updateItemSelection(chkItemSelect, newValue); + } + } - if (selectionCommands.is(':visible')) { + e.preventDefault(); + return false; + } - selectionCommands.hide(); - $('.itemSelectionPanel', page).hide(); + function showSelection(item) { - } else { + var itemSelectionPanel = item.querySelector('.itemSelectionPanel'); - selectionCommands.show(); + if (!itemSelectionPanel) { - var panels = $('.itemSelectionPanel', page).show(); + itemSelectionPanel = document.createElement('div'); + itemSelectionPanel.classList.add('itemSelectionPanel'); - if (!panels.length) { + item.querySelector('.cardContent').appendChild(itemSelectionPanel); - var index = 0; - $('.cardContent', page).each(function () { - var chkItemSelectId = 'chkItemSelect' + index; + var html = ''; - $(this).append('