3.0.5416.0

This commit is contained in:
Luke Pulverenti 2014-10-31 00:57:24 -04:00
parent 7884354722
commit 866379a702
15 changed files with 190 additions and 65 deletions

View File

@ -80,7 +80,7 @@
.sectionHeaderButton { .sectionHeaderButton {
vertical-align: middle; vertical-align: middle;
margin: 0 0 0 1.5em; margin: 0 0 .25em 1.5em;
position: relative; position: relative;
top: 8px; top: 8px;
} }

View File

@ -18,6 +18,10 @@
<form class="deviceForm"> <form class="deviceForm">
<p class="reportedName">
</p>
<br/>
<ul data-role="listview" class="ulForm"> <ul data-role="listview" class="ulForm">
<li> <li>
<label for="txtCustomName">${LabelCustomDeviceDisplayName}</label> <label for="txtCustomName">${LabelCustomDeviceDisplayName}</label>

View File

@ -34,15 +34,17 @@
<input id="chkDisplayFolderView" type="checkbox" /> <input id="chkDisplayFolderView" type="checkbox" />
</div> </div>
<br /><br /> <br />
<div style="margin: 0 1em;"> <br />
<p>${LabelGroupChannelsIntoViews}</p> <div data-role="collapsible" style="margin: 0 1em;">
<div class="channelGroupList"></div> <h2>${HeaderChannels}</h2>
<div class="fieldDescription">${LabelGroupChannelsIntoViewsHelp}</div> <div>
<p>${LabelGroupChannelsIntoViews}</p>
<div class="channelGroupList"></div>
<div class="fieldDescription">${LabelGroupChannelsIntoViewsHelp}</div>
</div>
</div> </div>
<br /><br />
<br />
<br />
<div class="detailSectionHeader" style="margin: 0 .5em;"> <div class="detailSectionHeader" style="margin: 0 .5em;">
${HeaderViewOrder} ${HeaderViewOrder}
@ -57,6 +59,19 @@
<br /> <br />
<br /> <br />
<div class="detailSectionHeader" style="margin: 0 .5em;">
${HeaderLatestItems}
</div>
<div style="margin: 0 1em;">
<p>${LabelSelectLastestItemsFolders}</p>
<div class="latestItemsList">
</div>
</div>
<br />
<br />
<div class="detailSectionHeader" style="margin: 0 .5em;"> <div class="detailSectionHeader" style="margin: 0 .5em;">
${HeaderOtherDisplaySettings} ${HeaderOtherDisplaySettings}
</div> </div>

View File

@ -3,12 +3,13 @@
function load(page, device, capabilities) { function load(page, device, capabilities) {
if (capabilities.SupportsContentUploading) { if (capabilities.SupportsContentUploading) {
$('.fldCameraUploadPath', page).show(); $('#fldCameraUploadPath', page).show();
} else { } else {
$('.fldCameraUploadPath', page).hide(); $('#fldCameraUploadPath', page).hide();
} }
$('#txtCustomName', page).val(device.CustomName || ''); $('#txtCustomName', page).val(device.CustomName || '');
$('.reportedName', page).html(device.ReportedName || '');
} }
function loadData(page) { function loadData(page) {
@ -75,7 +76,6 @@
var page = this; var page = this;
loadData(page); loadData(page);
}); });
window.DevicePage = { window.DevicePage = {

View File

@ -123,11 +123,9 @@
function loadRecentlyAdded(elem, userId, context) { function loadRecentlyAdded(elem, userId, context) {
var screenWidth = $(window).width();
var options = { var options = {
Limit: screenWidth >= 2400 ? 24 : (screenWidth >= 1600 ? 20 : (screenWidth >= 1440 ? 12 : (screenWidth >= 800 ? 9 : 8))), Limit: 24,
Fields: "PrimaryImageAspectRatio", Fields: "PrimaryImageAspectRatio",
IsPlayed: false IsPlayed: false
}; };
@ -137,7 +135,10 @@
var html = ''; var html = '';
if (items.length) { if (items.length) {
html += '<h1 class="listHeader">' + Globalize.translate('HeaderLatestMedia') + '</h1>'; html += '<div>';
html += '<h1 style="display:inline-block; vertical-align:middle;" class="listHeader">' + Globalize.translate('HeaderLatestMedia') + '</h1>';
html += '<a href="mypreferencesdisplay.html" data-role="button" data-icon="edit" data-mini="true" data-inline="true" data-iconpos="notext" class="sectionHeaderButton">d</a>';
html += '</div>';
html += '<div>'; html += '<div>';
html += LibraryBrowser.getPosterViewHtml({ html += LibraryBrowser.getPosterViewHtml({
items: items, items: items,

View File

@ -908,12 +908,9 @@
$(apiClient).off('websocketmessage.librarylist', onWebSocketMessage).on('websocketmessage.librarylist', onWebSocketMessage); $(apiClient).off('websocketmessage.librarylist', onWebSocketMessage).on('websocketmessage.librarylist', onWebSocketMessage);
} }
$(function () { $(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) { initializeApiClient(apiClient);
initializeApiClient(apiClient);
});
}); });
})(jQuery, document, window); })(jQuery, document, window);

View File

@ -431,19 +431,21 @@
}); });
function initializeApiClient(apiClient) { function initializeApiClient(apiClient) {
$(apiClient).off('websocketmessage.librarymenu', onWebSocketMessage).on('websocketmessage.librarymenu', onWebSocketMessage); $(apiClient).off('websocketmessage.librarymenu', onWebSocketMessage).on('websocketmessage.librarymenu', onWebSocketMessage);
} }
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
initializeApiClient(apiClient);
});
$(function () { $(function () {
$(MediaController).on('playerchange', function () { $(MediaController).on('playerchange', function () {
updateCastIcon(); updateCastIcon();
}); });
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
initializeApiClient(apiClient);
});
}); });
})(window, document, jQuery); })(window, document, jQuery);

View File

@ -443,12 +443,9 @@
$(apiClient).on("websocketmessage", onWebSocketMessageReceived); $(apiClient).on("websocketmessage", onWebSocketMessageReceived);
} }
$(function () { $(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) { initializeApiClient(apiClient);
initializeApiClient(apiClient);
});
}); });
function getTargetsHtml(targets) { function getTargetsHtml(targets) {

View File

@ -27,6 +27,33 @@
$('.folderGroupList', page).html(folderHtml).trigger('create'); $('.folderGroupList', page).html(folderHtml).trigger('create');
} }
function renderLatestItems(page, user, result) {
var folderHtml = '';
folderHtml += '<div data-role="controlgroup">';
folderHtml += result.Items.map(function (i) {
var currentHtml = '';
var id = 'chkIncludeInLatest' + i.Id;
currentHtml += '<label for="' + id + '">' + i.Name + '</label>';
var isChecked = user.Configuration.LatestItemsExcludes.indexOf(i.Id) == -1;
var checkedHtml = isChecked ? ' checked="checked"' : '';
currentHtml += '<input class="chkIncludeInLatest" data-folderid="' + i.Id + '" type="checkbox" id="' + id + '"' + checkedHtml + ' />';
return currentHtml;
}).join('');
folderHtml += '</div>';
$('.latestItemsList', page).html(folderHtml).trigger('create');
}
function renderChannels(page, user, result) { function renderChannels(page, user, result) {
var folderHtml = ''; var folderHtml = '';
@ -117,6 +144,7 @@
$.when(promise1, promise2, promise3).done(function (r1, r2, r3) { $.when(promise1, promise2, promise3).done(function (r1, r2, r3) {
renderViews(page, user, r1[0]); renderViews(page, user, r1[0]);
renderLatestItems(page, user, r1[0]);
renderChannels(page, user, r2[0]); renderChannels(page, user, r2[0]);
renderViewOrder(page, user, r3[0]); renderViewOrder(page, user, r3[0]);
@ -137,6 +165,11 @@
user.Configuration.IncludeTrailersInSuggestions = $('#chkDisplayTrailersWithinMovieSuggestions', page).checked(); user.Configuration.IncludeTrailersInSuggestions = $('#chkDisplayTrailersWithinMovieSuggestions', page).checked();
user.Configuration.LatestItemsExcludes = $(".chkIncludeInLatest:not(:checked)", page).get().map(function (i) {
return i.getAttribute('data-folderid');
});
user.Configuration.ExcludeFoldersFromGrouping = $(".chkGroupFolder:not(:checked)", page).get().map(function (i) { user.Configuration.ExcludeFoldersFromGrouping = $(".chkGroupFolder:not(:checked)", page).get().map(function (i) {
return i.getAttribute('data-folderid'); return i.getAttribute('data-folderid');

View File

@ -1,6 +1,6 @@
(function ($, document, Notifications) { (function ($, document, Notifications) {
$(document).on("pageinit", ".page", function () { $(document).on("pageinit", "#notificationsPage", function () {
// If there is no user logged in there can be no notifications // If there is no user logged in there can be no notifications
if (!Dashboard.getCurrentUserId()) return; if (!Dashboard.getCurrentUserId()) return;

View File

@ -238,12 +238,9 @@
}); });
} }
$(function () { $(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) { initializeApiClient(apiClient);
initializeApiClient(apiClient);
});
}); });
})(jQuery, document, Dashboard, LibraryBrowser); })(jQuery, document, Dashboard, LibraryBrowser);

View File

@ -349,12 +349,9 @@
$(apiClient).on("websocketmessage", onWebSocketMessageReceived).on("websocketopen", onWebSocketConnectionChange); $(apiClient).on("websocketmessage", onWebSocketMessageReceived).on("websocketopen", onWebSocketConnectionChange);
} }
$(function () { $(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) { initializeApiClient(apiClient);
initializeApiClient(apiClient);
});
}); });
})(window, document, jQuery); })(window, document, jQuery);

View File

@ -1,5 +1,33 @@
(function (document, window, $) { (function (document, window, $) {
function renderLibrarySharingList(page, result) {
var folderHtml = '';
folderHtml += '<div data-role="controlgroup">';
folderHtml += result.Items.map(function (i) {
var currentHtml = '';
var id = 'chkShareFolder' + i.Id;
currentHtml += '<label for="' + id + '">' + i.Name + '</label>';
var isChecked = true;
var checkedHtml = isChecked ? ' checked="checked"' : '';
currentHtml += '<input data-mini="true" class="chkShareFolder" data-folderid="' + i.Id + '" type="checkbox" id="' + id + '"' + checkedHtml + ' />';
return currentHtml;
}).join('');
folderHtml += '</div>';
$('.librarySharingList', page).html(folderHtml).trigger('create');
}
function deleteUser(page, id) { function deleteUser(page, id) {
$('.userMenu', page).on("popupafterclose.deleteuser", function () { $('.userMenu', page).on("popupafterclose.deleteuser", function () {
@ -301,34 +329,49 @@
renderPendingGuests(page, pending); renderPendingGuests(page, pending);
}); });
ApiClient.getJSON(ApiClient.getUrl("Library/MediaFolders", { IsHidden: false })).done(function (result) {
renderLibrarySharingList(page, result);
});
} }
function inviteUser(page) { function inviteUser(page) {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
// Add/Update connect info ApiClient.getJSON(ApiClient.getUrl("Channels", {})).done(function (channelsResult) {
ApiClient.ajax({
type: "POST", var shareExcludes = $(".chkShareFolder:not(:checked)", page).get().map(function (i) {
url: ApiClient.getUrl('Connect/Invite', {
ConnectUsername: $('#txtConnectUsername', page).val(), return i.getAttribute('data-folderid');
SendingUserId: Dashboard.getCurrentUserId() });
}), // Add/Update connect info
dataType: 'json' ApiClient.ajax({
}).done(function (result) { type: "POST",
url: ApiClient.getUrl('Connect/Invite'),
dataType: 'json',
data: {
$('#popupInvite').popup('close'); ConnectUsername: $('#txtConnectUsername', page).val(),
ExcludedLibraries: shareExcludes.join(','),
ExcludedChannels: channelsResult.Items.map(function (c) { return c.Id; }).join(','),
SendingUserId: Dashboard.getCurrentUserId(),
EnableLiveTv: false
}
Dashboard.hideLoadingMsg(); }).done(function (result) {
showNewUserInviteMessage(page, result); $('#popupInvite').popup('close');
Dashboard.hideLoadingMsg();
showNewUserInviteMessage(page, result);
});
}); });
} }
function showNewUserInviteMessage(page, result) { function showNewUserInviteMessage(page, result) {

View File

@ -105,7 +105,7 @@
updateServerInfo(server, systemInfo); updateServerInfo(server, systemInfo);
apiClient.serverInfo(server); apiClient.serverInfo(server);
$(this).trigger('apiclientcreated', [apiClient]); $(self).trigger('apiclientcreated', [apiClient]);
if (enableAutomaticNetworking) { if (enableAutomaticNetworking) {
self.connectToServer(server); self.connectToServer(server);
@ -138,7 +138,7 @@
onLocalAuthenticated(this, result, true); onLocalAuthenticated(this, result, true);
}); });
$(this).trigger('apiclientcreated', [apiClient]); $(self).trigger('apiclientcreated', [apiClient]);
} }
@ -199,7 +199,14 @@
var deferred = $.Deferred(); var deferred = $.Deferred();
if (self.isLoggedIntoConnect() && !connectUser) { if (connectUser != null && connectUser.Id == credentials.ConnectUserId) {
deferred.resolveWith(null, [[]]);
}
else if (self.connectToken() && self.connectUserId()) {
connectUser = null;
getConnectUser(credentials.ConnectUserId, credentials.ConnectAccessToken).done(function (user) { getConnectUser(credentials.ConnectUserId, credentials.ConnectAccessToken).done(function (user) {
onConnectAuthenticated(user); onConnectAuthenticated(user);
@ -352,7 +359,6 @@
deferred.resolveWith(null, [ deferred.resolveWith(null, [
{ {
connectUser: connectUser,
localUser: localUser, localUser: localUser,
name: connectUser ? connectUser.Name : localUser.Name, name: connectUser ? connectUser.Name : localUser.Name,
canManageServer: localUser && localUser.Configuration.IsAdministrator, canManageServer: localUser && localUser.Configuration.IsAdministrator,
@ -375,14 +381,13 @@
var credentials = credentialProvider.credentials(); var credentials = credentialProvider.credentials();
if (credentials.ConnectUserId && credentials.ConnectAccessToken) { if (credentials.ConnectUserId && credentials.ConnectAccessToken && !(self.currentApiClient() && self.currentApiClient().getCurrentUserId())) {
ensureConnectUser(credentials).always(onEnsureConnectUserDone); ensureConnectUser(credentials).always(onEnsureConnectUserDone);
} else { } else {
onEnsureConnectUserDone(); onEnsureConnectUserDone();
} }
return deferred.promise(); return deferred.promise();
}; };
self.isLoggedIntoConnect = function () { self.isLoggedIntoConnect = function () {
@ -608,7 +613,7 @@
deferred.resolveWith(null, [result]); deferred.resolveWith(null, [result]);
$(this).trigger('connected', [result]); $(self).trigger('connected', [result]);
} }
function onExchangeTokenDone() { function onExchangeTokenDone() {
@ -720,7 +725,7 @@
self.loginToConnect = function (username, password) { self.loginToConnect = function (username, password) {
var md5 = CryptoJS.MD5(password).toString(); var md5 = self.getConnectPasswordHash(password);
return $.ajax({ return $.ajax({
type: "POST", type: "POST",
@ -746,6 +751,23 @@
}); });
}; };
self.getConnectPasswordHash = function (password) {
password = password || '';
password = password
.replace("&", "&amp;")
.replace("/", "&#092;")
.replace("!", "&#33;")
.replace("$", "&#036;")
.replace("\"", "&quot;")
.replace("<", "&lt;")
.replace(">", "&gt;")
.replace("'", "&#39;");
return CryptoJS.MD5(password).toString();
};
self.getApiClient = function (item) { self.getApiClient = function (item) {
// Accept string + object // Accept string + object
@ -755,7 +777,10 @@
return apiClients.filter(function (a) { return apiClients.filter(function (a) {
return a.serverInfo().Id = item; var serverInfo = a.serverInfo();
// We have to keep this hack in here because of the addApiClient method
return !serverInfo || serverInfo.Id == item;
})[0]; })[0];
}; };

View File

@ -41,6 +41,8 @@
<div data-role="popup" id="popupInvite" data-theme="a"> <div data-role="popup" id="popupInvite" data-theme="a">
<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-b ui-icon-delete ui-btn-icon-notext ui-btn-right">${ButtonClose}</a>
<div class="ui-bar-a" style="text-align: center; padding: 5px 20px;"> <div class="ui-bar-a" style="text-align: center; padding: 5px 20px;">
<h3 style="margin: .5em;">${HeaderInviteUser}</h3> <h3 style="margin: .5em;">${HeaderInviteUser}</h3>
</div> </div>
@ -58,8 +60,20 @@
</div> </div>
<br /> <br />
<button type="submit" data-icon="mail" data-theme="b">${ButtonSendInvitation}</button>
<a href="#" data-rel="back" data-icon="delete" data-role="button">${ButtonCancel}</a> <div data-role="collapsible" data-mini="true">
<h2>${HeaderShareMediaFolders}</h2>
<div>
<div class="librarySharingList" style="margin-top:1em;">
</div>
</div>
</div>
<div style="margin:1.25em 0;" class="fieldDescription">${MessageGuestSharingPermissionsHelp}</div>
<div>
<button type="submit" data-icon="mail" data-theme="b" data-mini="true">${ButtonSendInvitation}</button>
<a href="#" data-rel="back" data-icon="delete" data-role="button" data-mini="true">${ButtonCancel}</a>
</div>
</div> </div>
</form> </form>