-
-
+
+
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index 2116665a0a..c4eb8cacb9 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -2392,9 +2392,7 @@
html += '';
@@ -2421,7 +2421,7 @@
$(page).prepend(html);
- Search.onSearchRendered($('.viewMenuBar', page));
+ Search.onSearchRendered($('.viewMenuBar', page).trigger('create'));
}
function insertViews(page, user, counts, liveTvServices) {
@@ -2433,36 +2433,27 @@
var view = page.getAttribute('data-view') || getParameterByName('context');
- var viewCount = 0;
-
if (counts.MovieCount || counts.TrailerCount) {
html += '';
- viewCount++;
}
if (counts.EpisodeCount || counts.SeriesCount) {
html += '';
- viewCount++;
}
if (liveTvServices.length) {
html += '';
- viewCount++;
}
if (counts.SongCount || counts.MusicVideoCount) {
html += '';
- viewCount++;
}
if (counts.GameCount) {
html += '';
- viewCount++;
}
- $(page).addClass('pageViewCount' + viewCount);
-
$('.homeMenuLink', page).after(html);
}
diff --git a/dashboard-ui/scripts/notifications.js b/dashboard-ui/scripts/notifications.js
index 7a4336af1b..cf18c4a3e6 100644
--- a/dashboard-ui/scripts/notifications.js
+++ b/dashboard-ui/scripts/notifications.js
@@ -26,7 +26,7 @@
var context = this;
- var html = '
';
+ var html = '
';
html += '
Close';
@@ -40,7 +40,7 @@
html += '';
- html += '
';
+ html += '
';
html += '
';
html += '
';
diff --git a/dashboard-ui/scripts/pluginspage.js b/dashboard-ui/scripts/pluginspage.js
index 13afb86348..7e1bb41e61 100644
--- a/dashboard-ui/scripts/pluginspage.js
+++ b/dashboard-ui/scripts/pluginspage.js
@@ -1,10 +1,10 @@
var PluginsPage = {
onPageShow: function () {
- PluginsPage.reloadList();
+ PluginsPage.reloadList(this);
},
- reloadList: function () {
+ reloadList: function (page) {
Dashboard.showLoadingMsg();
@@ -14,14 +14,12 @@
$.when(promise1, promise2).done(function(response1, response2) {
- PluginsPage.populateList(response1[0], response2[0]);
+ PluginsPage.populateList(page, response1[0], response2[0]);
});
},
- populateList: function (plugins, pluginConfigurationPages) {
-
- var page = $($.mobile.activePage);
+ populateList: function (page, plugins, pluginConfigurationPages) {
plugins = plugins.sort(function (plugin1, plugin2) {
@@ -71,6 +69,7 @@
deletePlugin: function (link) {
+ var page = $(link).parents('.page');
var name = link.getAttribute('data-pluginname');
var uniqueid = link.getAttribute('data-id');
@@ -83,7 +82,7 @@
ApiClient.uninstallPlugin(uniqueid).done(function () {
- PluginsPage.reloadList();
+ PluginsPage.reloadList(page);
});
}
});
diff --git a/dashboard-ui/scripts/search.js b/dashboard-ui/scripts/search.js
index f21a866ea3..38bdcef40a 100644
--- a/dashboard-ui/scripts/search.js
+++ b/dashboard-ui/scripts/search.js
@@ -11,43 +11,12 @@
}
}
- function createSearchHintsElement(page) {
-
- $(document.body).off("mousedown.hidesearchhints").on("mousedown.hidesearchhints", function (e) {
-
- var elem = $(e.target);
-
- if (!elem.is('#searchHints,#txtSearch,#btnSearch') && !elem.parents('#searchHints,#txtSearch,#btnSearch').length) {
- hideFlyout(page);
- }
-
- });
-
- return $('#searchHints', page).show();
- }
-
- function hideFlyout(page) {
- $('#searchHints', page).hide();
-
- $(document.body).off("mousedown.hidesearchhints");
- }
-
- function showFlyout(page) {
-
- var hints = $('#searchHints:visible');
-
- if (!hints.length) {
-
- createSearchHintsElement(page);
- }
- }
-
- function updateFlyout(page, searchTerm) {
+ function updateSearchHints(page, searchTerm) {
if (!searchTerm) {
+ $('#searchHints', page).empty();
clearSearchHintTimeout();
- hideFlyout(page);
return;
}
@@ -69,11 +38,7 @@
if (currentTimeout != searchHintTimeout) {
return;
}
-
- if (!result.TotalRecordCount) {
- hideFlyout(page);
- return;
- }
+
renderSearchHintResult(page, result.SearchHints);
});
}
@@ -106,7 +71,7 @@
var html = '';
var context;
-
+
if (hint.Type == "Episode" || hint.Type == "Season" || hint.Type == "Series") {
context = "tv";
}
@@ -238,39 +203,72 @@
$('#searchHints', page).html(html);
}
+
+ function getSearchPanel(page) {
+
+ var panel = $('#searchPanel', page);
+
+ if (!panel.length) {
+
+ var html = '';
+
+ html += '
';
+
+ html += '
';
+ html += 'Search';
+ html += '
';
+
+ html += '
';
+
+ html += '
';
+
+ html += '
';
+
+ $(page).append(html);
+
+ panel = $('#searchPanel', page).panel({}).trigger('create');
+
+ $('#txtSearch', panel).on("keyup", function (e) {
+
+ // Down
+ if (e.keyCode == 40) {
+
+ var first = $('.searchHint', panel)[0];
+
+ if (first) {
+ first.focus();
+ }
+
+ return false;
+ }
+
+ }).on("keyup", function (e) {
+
+ if (e.keyCode != 40) {
+ var value = this.value;
+
+ updateSearchHints(panel, value);
+ }
+
+ });
+ }
+
+ return panel;
+ }
function search() {
var self = this;
- self.getSearchHtml = function () {
+ self.showSearchPanel = function (page) {
- var html = '';
-
- return html;
+ $(panel).panel('toggle');
};
self.onSearchRendered = function (parentElem) {
- $('#searchForm', parentElem).on("submit", function () {
-
- Dashboard.alert('Coming soon.');
-
- return false;
- });
-
$('#searchHints', parentElem).on("keydown", '.searchHint', function (e) {
// Down
@@ -298,39 +296,6 @@
}
});
- $('#txtSearch', parentElem).on("keyup", function (e) {
-
- // Down
- if (e.keyCode == 40) {
-
- var first = $('.searchHint', parentElem)[0];
-
- if (first) {
- first.focus();
- }
-
- return false;
- }
-
- }).on("keyup", function (e) {
-
- if (e.keyCode != 40) {
- var value = this.value;
-
- showFlyout(parentElem);
- updateFlyout(parentElem, value);
- }
-
- }).on("focus", function () {
-
- var value = this.value;
-
- if (value) {
- showFlyout(parentElem, value);
- }
-
- });
-
};
}
@@ -338,8 +303,6 @@
$(document).on('pagehide', ".libraryPage", function () {
- hideFlyout(this);
-
$('#txtSearch', this).val('');
});
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index 457a0ce983..a58b53a10e 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -265,7 +265,7 @@ var Dashboard = {
showServerRestartWarning: function (systemInfo) {
- var html = '
Please restart Media Browser Server to finish updating.';
+ var html = '
Please restart to finish updating.';
if (systemInfo.CanSelfRestart) {
html += '
';
@@ -717,7 +717,6 @@ var Dashboard = {
var page = $.mobile.activePage;
-
$("#dashboardPanel", page).panel("open");
},
diff --git a/dashboard-ui/scripts/userprofilespage.js b/dashboard-ui/scripts/userprofilespage.js
index 7b17cab8a4..da6f80d9f2 100644
--- a/dashboard-ui/scripts/userprofilespage.js
+++ b/dashboard-ui/scripts/userprofilespage.js
@@ -61,6 +61,7 @@
deleteUser: function (link) {
+ var page = $.mobile.activePage;
var name = link.getAttribute('data-username');
var msg = "Are you sure you wish to delete " + name + "?";
@@ -74,7 +75,7 @@
ApiClient.deleteUser(id).done(function () {
- Dashboard.validateCurrentUser($.mobile.activePage);
+ Dashboard.validateCurrentUser(page);
UserProfilesPage.loadPageData();
});
}
diff --git a/dashboard-ui/scripts/wizarduserpage.js b/dashboard-ui/scripts/wizarduserpage.js
index 9a18b3db93..2ab448bd29 100644
--- a/dashboard-ui/scripts/wizarduserpage.js
+++ b/dashboard-ui/scripts/wizarduserpage.js
@@ -13,7 +13,7 @@
self.onSubmit = function () {
Dashboard.showLoadingMsg();
- var page = $.mobile.activePage;
+ var form = this;
ApiClient.getUsers().done(function (users) {
@@ -23,13 +23,13 @@
user = users[0];
- user.Name = $('#txtUsername', page).val();
+ user.Name = $('#txtUsername', form).val();
ApiClient.updateUser(user).done(onSaveComplete);
} else {
- user = { Name: $('#txtUsername', page).val() };
+ user = { Name: $('#txtUsername', form).val() };
ApiClient.createUser(user).done(onSaveComplete);
}
diff --git a/dashboard-ui/songs.html b/dashboard-ui/songs.html
index e531d6187c..f97d106afd 100644
--- a/dashboard-ui/songs.html
+++ b/dashboard-ui/songs.html
@@ -17,8 +17,8 @@
-
-
+
+
diff --git a/dashboard-ui/tvgenres.html b/dashboard-ui/tvgenres.html
index 925181aa81..acca0de9df 100644
--- a/dashboard-ui/tvgenres.html
+++ b/dashboard-ui/tvgenres.html
@@ -18,8 +18,8 @@
-
-
+
+
diff --git a/dashboard-ui/tvpeople.html b/dashboard-ui/tvpeople.html
index 4a71dab5d0..f47955f9ee 100644
--- a/dashboard-ui/tvpeople.html
+++ b/dashboard-ui/tvpeople.html
@@ -21,8 +21,8 @@
-
-
+
+
diff --git a/dashboard-ui/tvshows.html b/dashboard-ui/tvshows.html
index e1c0dc9b0f..898cc29188 100644
--- a/dashboard-ui/tvshows.html
+++ b/dashboard-ui/tvshows.html
@@ -27,8 +27,8 @@
-
-
+
+
diff --git a/dashboard-ui/tvstudios.html b/dashboard-ui/tvstudios.html
index 910db168a5..6881ce14fa 100644
--- a/dashboard-ui/tvstudios.html
+++ b/dashboard-ui/tvstudios.html
@@ -18,8 +18,8 @@
-
-
+
+