From 69a57de9280c48df0970fcc3f676d3b7f920a150 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 29 May 2015 19:51:33 -0400 Subject: [PATCH] consolidate slideout panels --- dashboard-ui/css/card.css | 8 +- dashboard-ui/css/librarybrowser.css | 2 +- dashboard-ui/css/librarymenu.css | 8 +- dashboard-ui/css/site.css | 26 ++- dashboard-ui/scripts/extensions.js | 11 +- dashboard-ui/scripts/itemlistpage.js | 2 +- dashboard-ui/scripts/librarymenu.js | 139 +++++------ dashboard-ui/scripts/mediacontroller.js | 5 + dashboard-ui/scripts/moviesrecommended.js | 7 +- dashboard-ui/scripts/photos.js | 7 +- dashboard-ui/scripts/site.js | 78 +------ .../thirdparty/cordova/android/filesystem.js | 11 + .../thirdparty/cordova/android/imagestore.js | 220 ++++++++++++++++++ dashboard-ui/thirdparty/cordova/chromecast.js | 26 +-- dashboard-ui/thirdparty/cordova/filesystem.js | 11 + dashboard-ui/thirdparty/cordova/imagestore.js | 14 +- dashboard-ui/thirdparty/filesystem.js | 11 + 17 files changed, 388 insertions(+), 198 deletions(-) create mode 100644 dashboard-ui/thirdparty/cordova/android/filesystem.js create mode 100644 dashboard-ui/thirdparty/cordova/android/imagestore.js create mode 100644 dashboard-ui/thirdparty/cordova/filesystem.js create mode 100644 dashboard-ui/thirdparty/filesystem.js diff --git a/dashboard-ui/css/card.css b/dashboard-ui/css/card.css index 9305d1ebbe..e166310677 100644 --- a/dashboard-ui/css/card.css +++ b/dashboard-ui/css/card.css @@ -44,7 +44,7 @@ } .cardBox { - margin: 1px; + margin: 3px; } .largeCardMargin .cardBox { @@ -55,12 +55,12 @@ margin: 4px; } -/*@media all and (max-width: 600px) { +@media all and (max-width: 600px) { .cardBox { - margin: 0; + margin: 1px; } -}*/ +} .grayscale { -webkit-filter: grayscale(100%); diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index baa9882179..68dcb63aa3 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -704,7 +704,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { } .lblDetailTab { - border-color: #1f1f1f !important; + border-color: #212121 !important; } .editMetadataForm { diff --git a/dashboard-ui/css/librarymenu.css b/dashboard-ui/css/librarymenu.css index bfa482ffda..d18c1f1a30 100644 --- a/dashboard-ui/css/librarymenu.css +++ b/dashboard-ui/css/librarymenu.css @@ -8,7 +8,7 @@ .libraryMenuDivider { height: 1px; - background: #282828; + background: #333; margin: .5em 0; } @@ -196,7 +196,7 @@ } .librarySidebarLinks a:hover { - background-color: #38c !important; + background-color: #383838 !important; color: #fff !important; } @@ -208,7 +208,7 @@ } .selectedMediaFolder { - background-color: #52B54B !important; + background-color: #3388cc !important; color: #fff !important; } @@ -217,7 +217,7 @@ } .ui-panel.ui-body-b { - background-color: #161616; + background-color: #212121; } .libraryViewNav .ui-btn-active { diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index 80d5303960..66f3f6eabf 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -243,6 +243,22 @@ body:not(.enableBackButton) .headerBackButton { left: 270px !important; } +@media all and (min-width: 340px) { + + .largePanel { + width: 300px; + } + + /* Make panels larger */ + .largePanelModalOpen.ui-panel-dismiss-position-right { + right: 300px !important; + } + + .largePanelModalOpen.ui-panel-dismiss-position-left { + left: 300px !important; + } +} + pre, textarea.pre { display: block; @@ -453,12 +469,17 @@ h1 .imageLink { } .sidebarLinkIcon { - font-size: 17px; + font-size: 16px; width: 66px; text-align: center; vertical-align: middle; + color: #ddd; } + .sidebarLinkIcon + span { + vertical-align: middle; + } + .ui-page-theme-a .sidebarLinkIcon { color: #666; } @@ -473,8 +494,9 @@ h1 .imageLink { .sidebarHeader { padding-left: 20px; - margin: 1em 0; + margin: 15px 0 10px; font-size: 90%; + color: #ccc; } .ui-page-theme-a .sidebarHeader { diff --git a/dashboard-ui/scripts/extensions.js b/dashboard-ui/scripts/extensions.js index 0dc58dd4e4..28717e674b 100644 --- a/dashboard-ui/scripts/extensions.js +++ b/dashboard-ui/scripts/extensions.js @@ -126,8 +126,17 @@ var WebNotifications = { if (window.cordova && window.cordova.plugins && window.cordova.plugins.notification) { + if (!WebNotifications.lastId) { + // Cordova plugin will crash on android with long. need an int + WebNotifications.lastId = new Date().getDate() + new Date().getMilliseconds(); + } + + WebNotifications.lastId++; + window.cordova.plugins.notification.local.schedule({ - id: new Date().getTime(), + + id: WebNotifications.lastId, + title: data.title, text: data.body, //firstAt: monday_9_am, diff --git a/dashboard-ui/scripts/itemlistpage.js b/dashboard-ui/scripts/itemlistpage.js index a8a63d99b8..48e88b7e72 100644 --- a/dashboard-ui/scripts/itemlistpage.js +++ b/dashboard-ui/scripts/itemlistpage.js @@ -1,6 +1,6 @@ (function ($, document) { - var view = LibraryBrowser.getDefaultItemsView('Poster', 'PosterCard'); + var view = LibraryBrowser.getDefaultItemsView('Poster', 'Poster'); // The base query options var query = { diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index afb1c332ce..0e6d0bebd6 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -20,15 +20,9 @@ html += '
'; - if (!AppInfo.enableHeaderImages) { - html += ''; - } else { - html += ''; - } + html += ''; - html += ''; + html += ''; html += '
'; html += '
'; html += ''; @@ -37,12 +31,6 @@ html += '
'; html += '
'; - html += ''; - html += ''; html += '
'; @@ -73,26 +61,6 @@ } else { $('.dashboardEntryHeaderButton', header).hide(); } - - var userButtonHtml = ''; - if (user.name) { - - if (user.imageUrl && AppInfo.enableUserImage) { - - var userButtonHeight = 26; - - var url = user.imageUrl; - - if (user.supportsImageParams) { - url += "&height=" + (userButtonHeight * Math.max(devicePixelRatio || 1, 2)); - } - - userButtonHtml += '
'; - } else { - userButtonHtml += '
'; - } - $('.headerUserButton', header).html(userButtonHtml).lazyChildren(); - } } function bindMenuEvents() { @@ -143,11 +111,25 @@ html += '
'; html += '
'; - html += '' + Globalize.translate('ButtonDashboard') + ''; + html += '
'; + html += Globalize.translate('HeaderAdmin'); + html += '
'; + html += '' + Globalize.translate('ButtonMetadataManager') + ''; html += '' + Globalize.translate('ButtonReports') + ''; + html += '' + Globalize.translate('ButtonServer') + ''; html += '
'; - html += '' + Globalize.translate('ButtonSync') + ''; + + html += '
'; + html += '
'; + + if (Dashboard.isConnectMode()) { + html += '' + Globalize.translate('ButtonSelectServer') + ''; + } + + html += '' + Globalize.translate('ButtonSignOut') + ''; + html += '
'; + return html; } @@ -162,11 +144,15 @@ panel = getLibraryMenu(user); updateLibraryNavLinks(page); - $(panel).panel('toggle').off('mouseleave.librarymenu').on('mouseleave.librarymenu', function () { + panel = $(panel).panel('toggle').off('mouseleave.librarymenu'); - $(this).panel("close"); + if (!AppInfo.isTouchPreferred) { + panel.on('mouseleave.librarymenu', function () { - }); + $(this).panel("close"); + + }); + } }); } @@ -175,11 +161,15 @@ var page = $.mobile.activePage; var panel = getDashboardMenu(page); - $(panel).panel('toggle').off('mouseleave.librarymenu').on('mouseleave.librarymenu', function () { + panel = $(panel).panel('toggle').off('mouseleave.librarymenu'); - $(this).panel("close"); + if (!AppInfo.isTouchPreferred) { + panel.on('mouseleave.librarymenu', function () { - }); + $(this).panel("close"); + + }); + } } function updateLibraryMenu(panel) { @@ -190,6 +180,7 @@ $('.adminMenuOptions').hide(); $('.syncViewMenu').hide(); + $('.userMenuOptions').hide(); return; } @@ -199,7 +190,12 @@ var items = result.Items; - var html = items.map(function (i) { + var html = ''; + html += '
'; + html += Globalize.translate('HeaderLibrary'); + html += '
'; + + html += items.map(function (i) { var iconCssClass = 'fa'; @@ -290,53 +286,40 @@ html += '