From a5ab0b50c6526b009ab6f7717f0525b0ad5b4b89 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 11 May 2014 18:38:10 -0400 Subject: [PATCH] update subtitle interface --- dashboard-ui/css/librarybrowser.css | 2 +- dashboard-ui/scripts/backdrops.js | 4 +- dashboard-ui/scripts/contextmenu.js | 116 ---------------------------- dashboard-ui/scripts/librarylist.js | 17 ---- dashboard-ui/scripts/librarymenu.js | 2 - 5 files changed, 3 insertions(+), 138 deletions(-) delete mode 100644 dashboard-ui/scripts/contextmenu.js diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 5533e11ee6..9c2582cdcc 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -17,7 +17,7 @@ } .backdropPage { - background-color: rgba(0, 0, 0, .86); + background-color: rgba(0, 0, 0, .85); } .backdropContainer { diff --git a/dashboard-ui/scripts/backdrops.js b/dashboard-ui/scripts/backdrops.js index b41cfaa532..bf2e1b9f40 100644 --- a/dashboard-ui/scripts/backdrops.js +++ b/dashboard-ui/scripts/backdrops.js @@ -22,7 +22,7 @@ var deferred = $.Deferred(); - var data = localStorage.getItem(key); + var data = sessionStorage.getItem(key); if (data) { @@ -51,7 +51,7 @@ }; }); - localStorage.setItem(key, JSON.stringify(images)); + sessionStorage.setItem(key, JSON.stringify(images)); deferred.resolveWith(null, [images]); }); } diff --git a/dashboard-ui/scripts/contextmenu.js b/dashboard-ui/scripts/contextmenu.js deleted file mode 100644 index 0abaaddbb8..0000000000 --- a/dashboard-ui/scripts/contextmenu.js +++ /dev/null @@ -1,116 +0,0 @@ -(function () { - - function onDocumentMouseDown(e) { - - var $e = $(e.target); - - var isContextMenuOption = $e.is('.contextMenuOption'); - - if (!isContextMenuOption || $e.is('.contextMenuCommandOption')) { - if ($e.is('.itemContextMenu') || $e.parents('.itemContextMenu').length) { - return; - } - } - - if (isContextMenuOption) { - - setTimeout(closeContextMenus, 150); - - } else { - closeContextMenus(); - } - } - - function closeContextMenus() { - $('.itemContextMenu').hide().remove(); - $('.hasContextMenu').removeClass('hasContextMenu'); - } - - function getMenuOptionHtml(item) { - - var html = ''; - - if (item.type == 'divider') { - - html += '

'; - } - - if (item.type == 'header') { - - html += '

' + item.text + '

'; - } - - if (item.type == 'link') { - - html += '' + item.text + ''; - } - - if (item.type == 'command') { - - html += '' + item.text + ''; - } - - return html; - } - - function getMenu(items) { - - var html = ''; - - html += '
'; - html += '
' + items.map(getMenuOptionHtml).join('') + '
'; - html += '
'; - - return $(html).appendTo(document.body); - } - - $.fn.createContextMenu = function (options) { - - return this.on('contextmenu', options.selector, function (e) { - - var elem = this; - var items = options.getOptions(elem); - - if (!items.length) { - return; - } - - var menu = getMenu(items); - - var autoH = menu.height() + 12; - - if ((e.pageY + autoH) > $('html').height()) { - - menu.addClass('dropdown-context-up').css({ - top: e.pageY - 20 - autoH, - left: e.pageX - 13 - - }).fadeIn(); - - } else { - - menu.css({ - top: e.pageY + 10, - left: e.pageX - 13 - - }).fadeIn(); - } - - $(this).addClass('hasContextMenu'); - $(document).off('mousedown.closecontextmenu').on('mousedown.closecontextmenu', onDocumentMouseDown); - - menu.on('click', '.contextMenuCommandOption', function() { - - closeContextMenus(); - - options.command(this.getAttribute('data-command'), elem); - - return false; - }); - - return false; - }); - }; - -})(); - diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index 93ecc9c6ca..c8142094b1 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -262,23 +262,6 @@ return this; } - var sequence = this; - - if (options.contextMenu !== false) { - Dashboard.getCurrentUser().done(function (user) { - - if (user.Configuration.IsAdministrator) { - - sequence.createContextMenu({ - getOptions: getContextMenuOptions, - command: onMenuCommand, - selector: '.posterItem' - }); - } - - }); - } - return this.off('.posterItemHoverMenu').on('mouseenter.posterItemHoverMenu', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverIn) .on('mouseleave.posterItemHoverMenu', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverOut); }; diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index 2fe00c72d8..65861bf3a7 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -61,8 +61,6 @@ $page.prepend(html); - $('.viewMenuBar', page).trigger('create'); - $page.trigger('headercreated'); }