parent
a816a83f3a
commit
c8a48d5df3
@ -0,0 +1,11 @@
|
|||||||
|
"use strict";
|
||||||
|
define(['app'], function () {
|
||||||
|
|
||||||
|
NzbDrone.Commands.Execute = function (name) {
|
||||||
|
return $.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url : NzbDrone.Constants.ApiRoot + '/command',
|
||||||
|
data: JSON.stringify({command: name})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
@ -0,0 +1,27 @@
|
|||||||
|
"use strict";
|
||||||
|
define(['app'], function () {
|
||||||
|
NzbDrone.Shared.Messenger = {
|
||||||
|
show: function (options) {
|
||||||
|
|
||||||
|
if (!options.type) {
|
||||||
|
options.type = 'info';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!options.hideAfter) {
|
||||||
|
switch (options.type) {
|
||||||
|
case 'info':
|
||||||
|
options.hideAfter = 5;
|
||||||
|
break;
|
||||||
|
case 'error':
|
||||||
|
options.hideAfter = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return window.Messenger().post({
|
||||||
|
message : options.message,
|
||||||
|
type : options.type,
|
||||||
|
showCloseButton: true,
|
||||||
|
hideAfter : options.hideAfter
|
||||||
|
});
|
||||||
|
}};
|
||||||
|
});
|
Loading…
Reference in new issue