mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
more shim cleanup
This commit is contained in:
parent
672e1bd9ed
commit
e0dd72328c
10 changed files with 61 additions and 71 deletions
47
src/UI/jQuery/jquery.ajax.js
Normal file
47
src/UI/jQuery/jquery.ajax.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
module.exports = function(){
|
||||
|
||||
var $ = this;
|
||||
|
||||
var original = $.ajax;
|
||||
$.ajax = function(xhr){
|
||||
'use strict';
|
||||
if(xhr && xhr.data && xhr.type === 'DELETE') {
|
||||
if(xhr.url.contains('?')) {
|
||||
xhr.url += '&';
|
||||
}
|
||||
else {
|
||||
xhr.url += '?';
|
||||
}
|
||||
xhr.url += $.param(xhr.data);
|
||||
delete xhr.data;
|
||||
}
|
||||
if(xhr) {
|
||||
xhr.headers = xhr.headers || {};
|
||||
xhr.headers['X-Api-Key'] = window.NzbDrone.ApiKey;
|
||||
}
|
||||
return original.apply(this, arguments);
|
||||
/* .done(function (response, status, xhr) {
|
||||
var version = xhr.getResponseHeader('X-ApplicationVersion');
|
||||
if (!window.NzbDrone || !window.NzbDrone.Version) {
|
||||
return;
|
||||
}
|
||||
if (version !== window.NzbDrone.Version) {
|
||||
var vent = require('../vent');
|
||||
var messenger = require('../Shared/Messenger');
|
||||
if (!vent || !messenger) {
|
||||
return;
|
||||
}
|
||||
messenger.show({
|
||||
message : 'Sonarr has been updated', hideAfter : 0, id : 'droneUpdated', actions : {
|
||||
viewChanges : {
|
||||
label : 'View Changes', action : function () {
|
||||
window.location = window.NzbDrone.UrlBase + '/system/updates';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
vent.trigger(vent.Events.ServerUpdated);
|
||||
}
|
||||
});*/
|
||||
};
|
||||
};
|
|
@ -1,7 +1,8 @@
|
|||
var $ = require('jquery');
|
||||
|
||||
module.exports = (function(){
|
||||
module.exports = function(){
|
||||
'use strict';
|
||||
|
||||
var $ = this;
|
||||
|
||||
$.fn.spinForPromise = function(promise){
|
||||
var self = this;
|
||||
if(!promise || promise.state() !== 'pending') {
|
||||
|
@ -43,4 +44,4 @@ module.exports = (function(){
|
|||
}
|
||||
return this;
|
||||
};
|
||||
}).call(this);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue