+
diff --git a/dashboard-ui/scripts/dashboardpage.js b/dashboard-ui/scripts/dashboardpage.js
index 0f54283e2e..359f306244 100644
--- a/dashboard-ui/scripts/dashboardpage.js
+++ b/dashboard-ui/scripts/dashboardpage.js
@@ -32,6 +32,22 @@
DashboardPage.reloadSystemInfo(page);
DashboardPage.reloadNews(page);
DashboardPage.sessionUpdateTimer = setInterval(DashboardPage.refreshSessionsLocally, 60000);
+
+ $('.activityItems', page).activityLogList();
+ },
+
+ onPageHide: function () {
+
+ var page = this;
+
+ $('.activityItems', page).activityLogList('destroy');
+
+ $(ApiClient).off("websocketmessage", DashboardPage.onWebSocketMessage).off("websocketopen", DashboardPage.onWebSocketConnectionChange).off("websocketerror", DashboardPage.onWebSocketConnectionChange).off("websocketclose", DashboardPage.onWebSocketConnectionChange);
+ DashboardPage.stopInterval();
+
+ if (DashboardPage.sessionUpdateTimer) {
+ clearInterval(DashboardPage.sessionUpdateTimer);
+ }
},
renderPaths: function (page, systemInfo) {
@@ -134,16 +150,6 @@
},
- onPageHide: function () {
-
- $(ApiClient).off("websocketmessage", DashboardPage.onWebSocketMessage).off("websocketopen", DashboardPage.onWebSocketConnectionChange).off("websocketerror", DashboardPage.onWebSocketConnectionChange).off("websocketclose", DashboardPage.onWebSocketConnectionChange);
- DashboardPage.stopInterval();
-
- if (DashboardPage.sessionUpdateTimer) {
- clearInterval(DashboardPage.sessionUpdateTimer);
- }
- },
-
startInterval: function () {
if (ApiClient.isWebSocketOpen()) {
@@ -1043,3 +1049,150 @@ $(document).on('pagebeforeshow', "#dashboardPage", DashboardPage.onPageShow)
};
})(jQuery, document, window);
+
+
+(function ($, document, window) {
+
+ function getEntryHtml(entry) {
+
+ var html = '';
+
+ html += '
';
+
+ html += '
';
+
+ var date = parseISO8601Date(entry.Date, { toLocal: true });
+
+ var color = entry.Severity == 'Error' || entry.Severity == 'Fatal' || entry.Severity == 'Warn' ? '#cc0000' : 'green';
+
+ html += '
' + date.toLocaleDateString() + ' ' + date.toLocaleTimeString().toLowerCase() + '
';
+
+ html += '
';
+ html += entry.Name;
+ html += '
';
+
+ entry.ShortOverview = entry.ShortOverview || ' ';
+
+ if (entry.ShortOverview) {
+
+ html += '
';
+
+ if (entry.Overview) {
+ html += '
' + entry.Overview + '
';
+ }
+ }
+
+ //if (notification.Url) {
+ // html += '
' + Globalize.translate('ButtonMoreInformation') + '
';
+ //}
+
+ html += '
';
+
+ html += '
';
+
+ return html;
+ }
+
+ function renderList(elem, result, startIndex, limit) {
+
+ var html = result.Items.map(getEntryHtml).join('');
+
+ if (result.TotalRecordCount > limit) {
+
+ var query = { StartIndex: startIndex, Limit: limit };
+
+ html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, false, limit, false);
+ }
+
+ $(elem).html(html).trigger('create');
+
+ $('.btnNextPage', elem).on('click', function () {
+ reloadData(elem, startIndex + limit, limit);
+ });
+
+ $('.btnPreviousPage', elem).on('click', function () {
+ reloadData(elem, startIndex - limit, limit);
+ });
+
+ $('.btnShowOverview', elem).on('click', function () {
+
+ var item = $(this).parents('.newsItem');
+ var overview = $('.newsItemLongDescription', item).html();
+ var name = $('.notificationName', item).html();
+
+ Dashboard.alert({
+ message: overview,
+ title: name
+ });
+ });
+ }
+
+ function reloadData(elem, startIndex, limit) {
+
+ if (startIndex == null) {
+ startIndex = parseInt(elem.getAttribute('data-activitystartindex') || '0');
+ }
+
+ limit = limit || parseInt(elem.getAttribute('data-activitylimit') || '7');
+
+ ApiClient.getJSON(ApiClient.getUrl('System/ActivityLog/Entries', {
+
+ startIndex: startIndex,
+ limit: limit
+
+ })).done(function (result) {
+
+ elem.setAttribute('data-activitystartindex', startIndex);
+ elem.setAttribute('data-activitylimit', limit);
+
+ renderList(elem, result, startIndex, limit);
+ });
+ }
+
+ function createList(elem) {
+
+ elem.each(function () {
+
+ reloadData(this);
+ });
+
+ $(ApiClient).on('websocketmessage.activityloglistener', function (e, data) {
+
+ var msg = data;
+
+ if (msg.MessageType === "ActivityLogEntryCreated") {
+ elem.each(function () {
+
+ reloadData(this);
+ });
+ }
+ });
+ }
+
+ function destroyList(elem) {
+
+ $(ApiClient).off('websocketmessage.activityloglistener');
+ }
+
+ $.fn.activityLogList = function (action) {
+
+ if (action == 'destroy') {
+ destroyList(this);
+ } else {
+ createList(this);
+ }
+
+ return this;
+ };
+
+})(jQuery, document, window);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index c7e9bfe129..30475c994e 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -408,8 +408,7 @@
}
if (commands.indexOf('edit') != -1) {
- html += '
Edit metadata';
- html += '
Edit images';
+ html += '
Edit';
}
html += '';
@@ -1788,9 +1787,9 @@
if (showControls) {
html += '
';
- html += '';
+ html += '';
- html += '';
+ html += '';
html += '
';
if (showLimit !== false) {
diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js
index 531508c58d..f27475f00f 100644
--- a/dashboard-ui/scripts/librarylist.js
+++ b/dashboard-ui/scripts/librarylist.js
@@ -168,11 +168,11 @@
var id = this.getAttribute('data-itemid');
- PlaylistManager.showPanel([id]);
-
// Used by the tab menu, not the slide up
$('.tapHoldMenu').popup('close');
+ PlaylistManager.showPanel([id]);
+
return false;
}
diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js
index ac59b5b4ca..77fce9ac53 100644
--- a/dashboard-ui/scripts/mediaplayer-video.js
+++ b/dashboard-ui/scripts/mediaplayer-video.js
@@ -981,6 +981,16 @@
return true;
};
+ // Replace audio version
+ self.cleanup = function (playerElement) {
+
+ if (playerElement.tagName.toLowerCase() == 'video') {
+ currentTimeElement.html('--:--');
+
+ unbindEventsForPlayback();
+ }
+ };
+
self.playVideo = function (item, mediaSource, startPosition) {
var mediaStreams = mediaSource.MediaStreams || [];
@@ -1197,6 +1207,10 @@
}).one("playing.mediaplayerevent", function () {
+
+ // For some reason this is firing at the start, so don't bind until playback has begun
+ $(this).on("ended.playbackstopped", self.onPlaybackStopped).one('ended.playnext', self.playNextAfterEnded);
+
self.onPlaybackStart(this, item, mediaSource);
}).on("pause.mediaplayerevent", function (e) {
@@ -1265,15 +1279,7 @@
self.toggleFullscreen();
- }).on("ended.playbackstopped", function () {
-
- currentTimeElement.html('--:--');
-
- self.onPlaybackStopped.call(this);
-
- unbindEventsForPlayback();
-
- }).one('ended.playnext', self.playNextAfterEnded);
+ });
bindEventsForPlayback();
diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js
index 094f5c4d3e..7134d3393f 100644
--- a/dashboard-ui/scripts/mediaplayer.js
+++ b/dashboard-ui/scripts/mediaplayer.js
@@ -606,6 +606,8 @@
if (newItem) {
+ console.log('playing next track');
+
Dashboard.getCurrentUser().done(function (user) {
self.playInternal(newItem, 0, user);
@@ -1092,14 +1094,22 @@
$(self).trigger('volumechange', [state]);
};
+ self.cleanup = function() {
+
+ };
+
self.onPlaybackStopped = function () {
+ console.log('playback stopped');
+
$('body').removeClass('bodyWithPopupOpen');
var playerElement = this;
$(playerElement).off('.mediaplayerevent').off('ended.playbackstopped');
+ self.cleanup(playerElement);
+
clearProgressInterval();
var item = self.currentItem;
@@ -1253,27 +1263,38 @@
}).on("volumechange.mediaplayerevent", function () {
+ console.log('audio element event: volumechange');
+
self.onVolumeChanged(this);
}).one("playing.mediaplayerevent", function () {
+ console.log('audio element event: playing');
+
$('.mediaPlayerAudioContainer').hide();
+ // For some reason this is firing at the start, so don't bind until playback has begun
+ $(this).on("ended.playbackstopped", self.onPlaybackStopped).one('ended.playnext', self.playNextAfterEnded);
+
self.onPlaybackStart(this, item, mediaSource);
}).on("pause.mediaplayerevent", function () {
+ console.log('audio element event: pause');
+
self.onPlaystateChange(this);
}).on("playing.mediaplayerevent", function () {
+ console.log('audio element event: playing');
+
self.onPlaystateChange(this);
}).on("timeupdate.mediaplayerevent", function () {
self.setCurrentTime(self.getCurrentTicks(this));
- }).on("ended.playbackstopped", self.onPlaybackStopped).one('ended.playnext', self.playNextAfterEnded)[0];
+ })[0];
};
function canPlayAudioStreamDirect(audioStream) {
diff --git a/dashboard-ui/scripts/metadatasubtitles.js b/dashboard-ui/scripts/metadatasubtitles.js
index c9e5bf8da7..3462352817 100644
--- a/dashboard-ui/scripts/metadatasubtitles.js
+++ b/dashboard-ui/scripts/metadatasubtitles.js
@@ -2,13 +2,13 @@
function loadPage(page, config, languages) {
- $('#chkSubtitlesMovies', page).checked(config.SubtitleOptions.DownloadMovieSubtitles).checkboxradio("refresh");
- $('#chkSubtitlesEpisodes', page).checked(config.SubtitleOptions.DownloadEpisodeSubtitles).checkboxradio("refresh");
+ $('#chkSubtitlesMovies', page).checked(config.DownloadMovieSubtitles).checkboxradio("refresh");
+ $('#chkSubtitlesEpisodes', page).checked(config.DownloadEpisodeSubtitles).checkboxradio("refresh");
- $('#chkSkipIfGraphicalSubsPresent', page).checked(config.SubtitleOptions.SkipIfGraphicalSubtitlesPresent).checkboxradio("refresh");
- $('#chkSkipIfAudioTrackPresent', page).checked(config.SubtitleOptions.SkipIfAudioTrackMatches).checkboxradio("refresh");
+ $('#chkSkipIfGraphicalSubsPresent', page).checked(config.SkipIfGraphicalSubtitlesPresent).checkboxradio("refresh");
+ $('#chkSkipIfAudioTrackPresent', page).checked(config.SkipIfAudioTrackMatches).checkboxradio("refresh");
- $('#txtOpenSubtitleUsername', page).val(config.SubtitleOptions.OpenSubtitlesUsername);
+ $('#txtOpenSubtitleUsername', page).val(config.OpenSubtitlesUsername);
$('#txtOpenSubtitlePassword', page).val('');
populateLanguages(page, config, languages);
@@ -34,7 +34,7 @@
$('.downloadLanguages', page).html(html).trigger("create");
- var langs = config.SubtitleOptions.DownloadLanguages || [];
+ var langs = config.DownloadLanguages || [];
$('.chkLang', page).each(function () {
@@ -49,7 +49,7 @@
var page = this;
- var promise1 = ApiClient.getServerConfiguration();
+ var promise1 = ApiClient.getNamedConfiguration("subtitles");
var promise2 = ApiClient.getCultures();
$.when(promise1, promise2).done(function (response1, response2) {
@@ -69,29 +69,29 @@
var form = this;
- ApiClient.getServerConfiguration().done(function (config) {
+ ApiClient.getNamedConfiguration("subtitles").done(function (config) {
- config.SubtitleOptions.DownloadMovieSubtitles = $('#chkSubtitlesMovies', form).checked();
- config.SubtitleOptions.DownloadEpisodeSubtitles = $('#chkSubtitlesEpisodes', form).checked();
+ config.DownloadMovieSubtitles = $('#chkSubtitlesMovies', form).checked();
+ config.DownloadEpisodeSubtitles = $('#chkSubtitlesEpisodes', form).checked();
- config.SubtitleOptions.SkipIfGraphicalSubtitlesPresent = $('#chkSkipIfGraphicalSubsPresent', form).checked();
- config.SubtitleOptions.SkipIfAudioTrackMatches = $('#chkSkipIfAudioTrackPresent', form).checked();
+ config.SkipIfGraphicalSubtitlesPresent = $('#chkSkipIfGraphicalSubsPresent', form).checked();
+ config.SkipIfAudioTrackMatches = $('#chkSkipIfAudioTrackPresent', form).checked();
- config.SubtitleOptions.OpenSubtitlesUsername = $('#txtOpenSubtitleUsername', form).val();
+ config.OpenSubtitlesUsername = $('#txtOpenSubtitleUsername', form).val();
var newPassword = $('#txtOpenSubtitlePassword', form).val();
if (newPassword) {
- config.SubtitleOptions.OpenSubtitlesPasswordHash = newPassword;
+ config.OpenSubtitlesPasswordHash = newPassword;
}
- config.SubtitleOptions.DownloadLanguages = $('.chkLang:checked', form).get().map(function (c) {
+ config.DownloadLanguages = $('.chkLang:checked', form).get().map(function (c) {
return c.getAttribute('data-lang');
});
- ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
+ ApiClient.updateNamedConfiguration("subtitles", config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
diff --git a/dashboard-ui/scripts/musicrecommended.js b/dashboard-ui/scripts/musicrecommended.js
index d5cfda6c74..596f244ee8 100644
--- a/dashboard-ui/scripts/musicrecommended.js
+++ b/dashboard-ui/scripts/musicrecommended.js
@@ -11,7 +11,7 @@
var options = {
IncludeItemTypes: "Audio",
- Limit: screenWidth >= 1600 ? 18 : (screenWidth >= 1200 ? 10 : 12),
+ Limit: screenWidth >= 1600 ? 21 : (screenWidth >= 1200 ? 21 : 12),
Fields: "PrimaryImageAspectRatio",
ParentId: parentId
};
@@ -34,7 +34,7 @@
SortBy: "DatePlayed",
SortOrder: "Descending",
IncludeItemTypes: "Audio",
- Limit: screenWidth >= 1600 ? 6 : (screenWidth >= 1200 ? 5 : 6),
+ Limit: screenWidth >= 1600 ? 7 : (screenWidth >= 1200 ? 7 : 6),
Recursive: true,
Fields: "PrimaryImageAspectRatio,AudioInfo",
Filters: "IsPlayed",
@@ -64,7 +64,7 @@
SortBy: "PlayCount",
SortOrder: "Descending",
IncludeItemTypes: "Audio",
- Limit: screenWidth >= 1600 ? 12 : (screenWidth >= 1200 ? 10 : 12),
+ Limit: screenWidth >= 1600 ? 14 : (screenWidth >= 1200 ? 14 : 12),
Recursive: true,
Fields: "PrimaryImageAspectRatio,AudioInfo",
Filters: "IsPlayed",
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index 88a162801e..cc85abba67 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -396,7 +396,7 @@ var Dashboard = {
var html = '
';
html += '
';
- html += '
' + title + '
';
+ html += '' + title + '
';
html += '';
html += '
';
@@ -1262,7 +1262,6 @@ $(function () {
$(document).on('contextmenu', '.ui-popup-screen', function (e) {
- document.title = '1';
$('.ui-popup').popup('close');
e.preventDefault();