From 72db499cf6a01b6dae80fa370a86bfc403ad9c26 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 13 Feb 2014 00:11:54 -0500 Subject: [PATCH] take photos into the core --- dashboard-ui/css/librarybrowser.css | 12 +- dashboard-ui/css/posteritem.css | 6 +- dashboard-ui/css/site.css | 12 +- dashboard-ui/edititemimages.html | 2 +- dashboard-ui/edititemmetadata.html | 32 ++++++ dashboard-ui/library.html | 2 +- dashboard-ui/scripts/addpluginpage.js | 2 +- dashboard-ui/scripts/edititemmetadata.js | 136 +++++++++++++---------- dashboard-ui/scripts/medialibrarypage.js | 4 +- dashboard-ui/wizardlibrary.html | 2 +- 10 files changed, 133 insertions(+), 77 deletions(-) diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 014b42b390..ae5c921c38 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -191,9 +191,9 @@ } .galleryImageContainer:hover { - -moz-box-shadow: 0 0 20px 3px #2572EB; - -webkit-box-shadow: 0 0 20px 3px #2572EB; - box-shadow: 0 0 20px 3px #2572EB; + -moz-box-shadow: 0 0 20px 3px #38c; + -webkit-box-shadow: 0 0 20px 3px #38c; + box-shadow: 0 0 20px 3px #38c; } .galleryImage { @@ -456,9 +456,9 @@ a.itemTag:hover { } .itemDetailGalleryLink img:hover { - -moz-box-shadow: 0 0 20px 3px #2572EB; - -webkit-box-shadow: 0 0 20px 3px #2572EB; - box-shadow: 0 0 20px 3px #2572EB; + -moz-box-shadow: 0 0 20px 3px #38c; + -webkit-box-shadow: 0 0 20px 3px #38c; + box-shadow: 0 0 20px 3px #38c; } .parentName { diff --git a/dashboard-ui/css/posteritem.css b/dashboard-ui/css/posteritem.css index 998af27856..27cc75e86f 100644 --- a/dashboard-ui/css/posteritem.css +++ b/dashboard-ui/css/posteritem.css @@ -48,9 +48,9 @@ } .posterItem:hover .posterItemImage { - -moz-box-shadow: 0 0 12px 7px #2572EB; - -webkit-box-shadow: 0 0 12px 7px #2572EB; - box-shadow: 0 0 12px 7px #2572EB; + -moz-box-shadow: 0 0 12px 7px #38c; + -webkit-box-shadow: 0 0 12px 7px #38c; + box-shadow: 0 0 12px 7px #38c; } .coveredPosterItemImage { diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index ef53de3935..3eb3895026 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -253,7 +253,7 @@ h1 .imageLink { color: #fff!important; text-shadow: none!important; font-weight: 400!important; - font-size: 16px; + font-size: 15px; } .sidebarLinks a:hover { @@ -262,7 +262,7 @@ h1 .imageLink { } .sidebarLinks a.selectedSidebarLink { - background: #2572EB!important; + background: #38c!important; color: #fff!important; } @@ -310,7 +310,7 @@ h1 .imageLink { } .selectedDashboardPanelLink { - background: #2572EB; + background: #38c; color: #fff!important; } @@ -570,9 +570,9 @@ h1 .imageLink { } .posterViewItem:hover, .userItem:hover, .tileItem:hover { - -moz-box-shadow: 0 0 20px 3px #2572EB; - -webkit-box-shadow: 0 0 20px 3px #2572EB; - box-shadow: 0 0 20px 3px #2572EB; + -moz-box-shadow: 0 0 20px 3px #38c; + -webkit-box-shadow: 0 0 20px 3px #38c; + box-shadow: 0 0 20px 3px #38c; } @media all and (min-width: 750px) { diff --git a/dashboard-ui/edititemimages.html b/dashboard-ui/edititemimages.html index 3db10b4cc3..3eecd402c3 100644 --- a/dashboard-ui/edititemimages.html +++ b/dashboard-ui/edititemimages.html @@ -131,7 +131,7 @@
-
+
diff --git a/dashboard-ui/edititemmetadata.html b/dashboard-ui/edititemmetadata.html index f4aa625a76..d69cf2e317 100644 --- a/dashboard-ui/edititemmetadata.html +++ b/dashboard-ui/edititemmetadata.html @@ -461,8 +461,40 @@
+ + diff --git a/dashboard-ui/library.html b/dashboard-ui/library.html index f4b84f813f..7307a2850c 100644 --- a/dashboard-ui/library.html +++ b/dashboard-ui/library.html @@ -51,7 +51,7 @@

- * Requires the use of a plugin, e.g. GameBrowser or MB Photos. + * Requires the use of a plugin, e.g. GameBrowser or MB Bookshelf.

diff --git a/dashboard-ui/scripts/addpluginpage.js b/dashboard-ui/scripts/addpluginpage.js index 5546fe4399..dfab16e115 100644 --- a/dashboard-ui/scripts/addpluginpage.js +++ b/dashboard-ui/scripts/addpluginpage.js @@ -270,7 +270,7 @@ if (pkg.previewImage || pkg.thumbImage) { - var color = pkg.tileColor || "#2572EB"; + var color = pkg.tileColor || "#38c"; var img = pkg.previewImage ? pkg.previewImage : pkg.thumbImage; $('#pPreviewImage', page).show().html(""); } else { diff --git a/dashboard-ui/scripts/edititemmetadata.js b/dashboard-ui/scripts/edititemmetadata.js index b7866c3f5a..24a42cf238 100644 --- a/dashboard-ui/scripts/edititemmetadata.js +++ b/dashboard-ui/scripts/edititemmetadata.js @@ -86,7 +86,7 @@ for (var i = 0, length = liveTvInfo.Services.length; i < length; i++) { var service = liveTvInfo.Services[i]; - + var name = service.Name; var cssClass = "editorNode"; @@ -770,14 +770,11 @@ if (item.Type == "Episode") { $('#lblIndexNumber', page).html('Episode number'); - } - else if (item.Type == "Season") { + } else if (item.Type == "Season") { $('#lblIndexNumber', page).html('Season number'); - } - else if (item.Type == "Audio") { + } else if (item.Type == "Audio") { $('#lblIndexNumber', page).html('Track number'); - } - else { + } else { $('#lblIndexNumber', page).html('Number'); } } else { @@ -789,11 +786,9 @@ if (item.Type == "Episode") { $('#lblParentIndexNumber', page).html('Season number'); - } - else if (item.Type == "Audio") { + } else if (item.Type == "Audio") { $('#lblParentIndexNumber', page).html('Disc number'); - } - else { + } else { $('#lblParentIndexNumber', page).html('Parent number'); } } else { @@ -850,12 +845,12 @@ $('#select3dFormat', page).val(item.Video3DFormat || "").selectmenu('refresh'); - $('.chkAirDay', page).each(function() { + $('.chkAirDay', page).each(function () { this.checked = (item.AirDays || []).indexOf(this.getAttribute('data-day')) != -1; }).checkboxradio('refresh'); - + populateListView($('#listGenres', page), item.Genres); populateListView($('#listStudios', page), (item.Studios || []).map(function (element) { return element.Name || ''; })); @@ -918,8 +913,7 @@ date = parseISO8601Date(item.DateCreated, { toLocal: true }); $('#txtDateAdded', page).val(date.toISOString().slice(0, 10)); - } - catch (e) { + } catch (e) { $('#txtDateAdded', page).val(''); } } else { @@ -931,8 +925,7 @@ date = parseISO8601Date(item.PremiereDate, { toLocal: true }); $('#txtPremiereDate', page).val(date.toISOString().slice(0, 10)); - } - catch (e) { + } catch (e) { $('#txtPremiereDate', page).val(''); } } else { @@ -944,8 +937,7 @@ date = parseISO8601Date(item.EndDate, { toLocal: true }); $('#txtEndDate', page).val(date.toISOString().slice(0, 10)); - } - catch (e) { + } catch (e) { $('#txtEndDate', page).val(''); } } else { @@ -1105,12 +1097,12 @@ } return html; } + function populateInternetProviderSettings(page, item, lockedFields) { var container = $('#providerSettingsContainer', page); lockedFields = lockedFields || new Array(); var metadatafields = [ - { name: "Name" }, { name: "Overview" }, { name: "Genres" }, @@ -1149,13 +1141,32 @@ $('#lock' + field).val(field).slider('refresh'); } } - + function getSelectedAirDays(form) { - return $('.chkAirDay:checked', form).map(function() { + return $('.chkAirDay:checked', form).map(function () { return this.getAttribute('data-day'); }).get(); } + function performDelete(page) { + + $('#btnDelete', page).buttonEnabled(false); + $('#btnRefresh', page).buttonEnabled(false); + $('.btnSave', page).buttonEnabled(false); + + $('#refreshLoading', page).show(); + + var parentId = currentItem.ParentId; + + ApiClient.deleteItem(currentItem.Id).done(function () { + + var elem = $('#' + parentId)[0]; + + $('.libraryTree').jstree("select_node", elem, true) + .jstree("delete_node", '#' + currentItem.Id); + }); + } + function editItemMetadataPage() { var self = this; @@ -1211,7 +1222,7 @@ OfficialRating: $('#selectOfficialRating', form).val(), CustomRating: $('#selectCustomRating', form).val(), People: currentItem.People, - EnableInternetProviders: $("#enableInternetProviders", form).prop('checked'), + EnableInternetProviders: !$("#enableInternetProviders", form).prop('checked'), LockedFields: $('.selectLockedField', form).map(function () { var value = $(this).val(); if (value != '') return value; @@ -1219,7 +1230,7 @@ }; item.ProviderIds = $.extend(currentItem.ProviderIds, { - + Gamesdb: $('#txtGamesDb', form).val(), Imdb: $('#txtImdb', form).val(), Tmdb: $('#txtTmdb', form).val(), @@ -1236,7 +1247,7 @@ Zap2It: $('#txtZap2It', form).val(), NesBox: $('#txtNesBoxName', form).val(), NesBoxRom: $('#txtNesBoxRom', form).val() - + }); item.PreferredMetadataLanguage = $('#selectLanguage', form).val(); @@ -1313,6 +1324,19 @@ $(source).parent().remove(); list.listview('refresh'); }; + + self.onDeleteFormSubmitted = function () { + + var page = $(this).parents('.page'); + + if ($('#fldChallengeValue', page).val() != $('#txtDeleteTest', page).val()) { + alert('The value entered is not correct. Please try again.'); + } else { + performDelete(page); + } + + return false; + }; } window.EditItemMetadataPage = new editItemMetadataPage(); @@ -1534,7 +1558,7 @@ var refreshPromise; - var force = $('#selectRefreshMode', page).val()=='all'; + var force = $('#selectRefreshMode', page).val() == 'all'; if (currentItem.Type == "MusicArtist") { refreshPromise = ApiClient.refreshArtist(currentItem.Name, force); @@ -1565,39 +1589,39 @@ }); }); + function getRandomInt(min, max) { + return Math.floor(Math.random() * (max - min + 1) + min); + } + $('#btnDelete', this).on('click', function () { - var msg = "

Are you sure you wish to delete this item from your library?

"; - if (currentItem.LocationType != "Remote" && currentItem.LocationType != "Virtual") { - msg = "

The following media location will be deleted:

"; - msg += "

" + currentItem.Path + "

"; - msg += "

Are you sure you wish to continue?

"; + $('.deletePath', page).html((currentItem.Path || '')); + + var val1 = getRandomInt(6, 12); + var val2 = getRandomInt(8, 16); + + $('#challengeValueText', page).html(val1 + ' * ' + val2 + ':'); + + var val = val1 * val2; + + $('#fldChallengeValue', page).val(val); + + $('#popupConfirmDelete', page).popup('open'); + + } else { + + var msg = "

Are you sure you wish to delete this item from your library?

"; + + Dashboard.confirm(msg, "Confirm Deletion", function (result) { + + if (result) { + + performDelete(page); + } + + }); } - - Dashboard.confirm(msg, "Confirm Deletion", function (result) { - - if (result) { - - $('#btnDelete', page).buttonEnabled(false); - $('#btnRefresh', page).buttonEnabled(false); - $('.btnSave', page).buttonEnabled(false); - - $('#refreshLoading', page).show(); - - var parentId = currentItem.ParentId; - - ApiClient.deleteItem(currentItem.Id).done(function () { - - var elem = $('#' + parentId)[0]; - - $('.libraryTree').jstree("select_node", elem, true) - .jstree("delete_node", '#' + currentItem.Id); - }); - } - - }); - }); $('.libraryTree', page).on('itemclicked', function (event, data) { @@ -1605,7 +1629,7 @@ if (data.itemType == "livetvservice") { return; } - + if (data.id != currentItem.Id) { MetadataEditor.currentItemId = data.id; diff --git a/dashboard-ui/scripts/medialibrarypage.js b/dashboard-ui/scripts/medialibrarypage.js index 7b69361c36..6280b2c7e6 100644 --- a/dashboard-ui/scripts/medialibrarypage.js +++ b/dashboard-ui/scripts/medialibrarypage.js @@ -159,7 +159,7 @@ html += ''; if (addPathMappingInfo) { - html += '

Use path substitution to map server paths to network shares that clients are able to access.

'; + html += '

Use path substitution to map server paths to network shares that clients are able to access.

'; } html += '

'; @@ -315,7 +315,7 @@ { name: "Games*", value: "games" }, { name: "Home videos", value: "homevideos" }, { name: "Music videos", value: "musicvideos" }, - { name: "Photos*", value: "photos" }, + { name: "Photos", value: "photos" }, { name: "Trailers", value: "trailers" }, { name: "Adult videos", value: "adultvideos" }, { name: "Mixed content", value: "mixed" } diff --git a/dashboard-ui/wizardlibrary.html b/dashboard-ui/wizardlibrary.html index 1051e6ff1d..d4fb5de029 100644 --- a/dashboard-ui/wizardlibrary.html +++ b/dashboard-ui/wizardlibrary.html @@ -43,7 +43,7 @@

- * Requires the use of a plugin, e.g. GameBrowser or MB Photos. + * Requires the use of a plugin, e.g. GameBrowser or MB Bookshelf.