From 535a1fd09e4b150e31165e2e79af42c2e5f2bda5 Mon Sep 17 00:00:00 2001 From: Kohei Yoshino Date: Wed, 18 Jul 2018 22:44:16 -0400 Subject: Bug 1472954 - Implement one-click component watching on bug modal and component description pages --- extensions/BugModal/web/bug_modal.js | 40 ------------------------------------ 1 file changed, 40 deletions(-) (limited to 'extensions/BugModal/web/bug_modal.js') diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js index c4bff9412..a4ae83d72 100644 --- a/extensions/BugModal/web/bug_modal.js +++ b/extensions/BugModal/web/bug_modal.js @@ -1434,46 +1434,6 @@ if (history && history.replaceState) { } } -// ajax wrapper, to simplify error handling and auth -function bugzilla_ajax(request, done_fn, error_fn) { - $('#xhr-error').hide(''); - $('#xhr-error').html(''); - request.url += (request.url.match('\\?') ? '&' : '?') + - 'Bugzilla_api_token=' + encodeURIComponent(BUGZILLA.api_token); - if (request.type != 'GET') { - request.contentType = 'application/json'; - request.processData = false; - if (request.data && request.data.constructor === Object) { - request.data = JSON.stringify(request.data); - } - } - return $.ajax(request) - .done(function(data) { - if (data.error) { - if (!request.hideError) { - $('#xhr-error').html(data.message); - $('#xhr-error').show('fast'); - } - if (error_fn) - error_fn(data.message); - } - else if (done_fn) { - done_fn(data); - } - }) - .fail(function(data) { - if (data.statusText === 'abort') - return; - var message = data.responseJSON ? data.responseJSON.message : 'Unexpected Error'; // all errors are unexpected :) - if (!request.hideError) { - $('#xhr-error').html(message); - $('#xhr-error').show('fast'); - } - if (error_fn) - error_fn(message); - }); -} - // lightbox function lb_show(el) { -- cgit v1.2.3-24-g4f1b