update task buttons

This commit is contained in:
Luke Pulverenti 2015-01-22 11:41:34 -05:00
parent 3dcd5b04d5
commit 4b51e69e53
6 changed files with 52 additions and 14 deletions

View File

@ -163,9 +163,10 @@
.viewMenuSearch {
position: absolute;
top: 0;
left: 35%;
right: 35%;
left: 40%;
right: 40%;
display: none;
padding-right: 55px;
}
@media all and (min-width: 800px) {
@ -179,6 +180,14 @@
}
}
@media all and (min-width: 1200px) {
.viewMenuSearch {
left: 42%;
right: 42%;
}
}
.searchResultsOverlay {
position: fixed;
background: #222 !important;

View File

@ -1633,7 +1633,7 @@
}
// If really close to 16:9 (episode image), just return 16:9
if (Math.abs(1.777777778 - result) <= .15) {
if (Math.abs(1.777777778 - result) <= .2) {
return 1.777777778;
}

View File

@ -84,6 +84,7 @@
html += '<div class="libraryMenuDivider"></div>';
html += '<div class="adminMenuOptions">';
html += '<a class="viewMenuLink viewMenuTextLink lnkMediaFolder iconViewMenu" data-itemid="dashboard" href="dashboard.html"><span class="fa fa-dashboard"></span>' + Globalize.translate('ButtonDashboard') + '</a>';
html += '<a class="viewMenuLink viewMenuTextLink lnkMediaFolder editorViewMenu iconViewMenu" data-itemid="editor" href="edititemmetadata.html"><span class="fa fa-edit"></span>' + Globalize.translate('ButtonMetadataManager') + '</a>';
html += '<a class="viewMenuLink viewMenuTextLink lnkMediaFolder iconViewMenu" data-itemid="reports" href="reports.html"><span class="fa fa-bar-chart"></span>' + Globalize.translate('ButtonReports') + '</a>';
html += '</div>';

View File

@ -380,7 +380,7 @@
// Down key
if (e.keyCode == 40) {
//var first = $('.searchHint', panel)[0];
//var first = $('.card', panel)[0];
//if (first) {
// first.focus();

View File

@ -258,8 +258,6 @@
var page = this;
reloadData(page);
// off here
$('.btnSync', page).taskButton({
mode: 'off'

View File

@ -65,6 +65,39 @@ $.fn.taskButton = function (options) {
}
}
function onScheduledTaskMessageConfirmed(instance, id) {
ApiClient.startScheduledTask(id).done(function () {
pollTasks(instance);
});
}
function onButtonClick(instance, id) {
var key = 'scheduledTaskButton' + options.taskKey;
var expectedValue = '4';
if (store.getItem(key) == expectedValue) {
onScheduledTaskMessageConfirmed(instance, id);
} else {
var msg = Globalize.translate('ConfirmMessageScheduledTaskButton');
msg += '<br/>';
msg += '<br/>';
msg += '<a href="scheduledtasks.html">' + Globalize.translate('ButtonScheduledTasks') + '</a>';
Dashboard.confirm(msg, Globalize.translate('HeaderConfirmation'), function (result) {
if (result) {
store.setItem(key, expectedValue);
onScheduledTaskMessageConfirmed(instance, id);
}
});
}
}
var self = this;
if (options.panel) {
@ -73,24 +106,21 @@ $.fn.taskButton = function (options) {
if (options.mode == 'off') {
this.off(".taskbutton");
$(ApiClient).off(".taskbutton");
if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop");
}
$(ApiClient).off(".taskbutton");
} else {
this.on('click', function () {
this.on('click.taskbutton', function () {
var button = this;
var id = button.getAttribute('data-taskid');
ApiClient.startScheduledTask(id).done(function () {
pollTasks(self);
});
onButtonClick(self, id);
});
pollTasks(self);