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

View File

@ -1633,7 +1633,7 @@
} }
// If really close to 16:9 (episode image), just return 16:9 // 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; return 1.777777778;
} }

View File

@ -84,6 +84,7 @@
html += '<div class="libraryMenuDivider"></div>'; html += '<div class="libraryMenuDivider"></div>';
html += '<div class="adminMenuOptions">'; 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 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 += '<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>'; html += '</div>';

View File

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

View File

@ -258,8 +258,6 @@
var page = this; var page = this;
reloadData(page);
// off here // off here
$('.btnSync', page).taskButton({ $('.btnSync', page).taskButton({
mode: 'off' 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; var self = this;
if (options.panel) { if (options.panel) {
@ -73,24 +106,21 @@ $.fn.taskButton = function (options) {
if (options.mode == 'off') { if (options.mode == 'off') {
this.off(".taskbutton");
$(ApiClient).off(".taskbutton");
if (ApiClient.isWebSocketOpen()) { if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop"); ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop");
} }
$(ApiClient).off(".taskbutton");
} else { } else {
this.on('click', function () { this.on('click.taskbutton', function () {
var button = this; var button = this;
var id = button.getAttribute('data-taskid'); var id = button.getAttribute('data-taskid');
ApiClient.startScheduledTask(id).done(function () { onButtonClick(self, id);
pollTasks(self);
});
}); });
pollTasks(self); pollTasks(self);