diff options
author | dklawren <dklawren@users.noreply.github.com> | 2018-09-07 12:04:50 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-09-07 12:04:50 +0200 |
commit | 2e6e3e13587ee526ba94faabd5551e67508518f5 (patch) | |
tree | d54e6a7bf25c0545ef23e4854f70d5a55589b2a7 /extensions/MozReview/web | |
parent | a68b0d94e176d37e1381f38f235f760ca0a1001d (diff) | |
download | bugzilla-2e6e3e13587ee526ba94faabd5551e67508518f5.tar.gz bugzilla-2e6e3e13587ee526ba94faabd5551e67508518f5.tar.xz |
Bug 1488292 - Remove MozReview extension from BMO code tree as MozReview is being decommissioned
Diffstat (limited to 'extensions/MozReview/web')
-rw-r--r-- | extensions/MozReview/web/js/mozreview.js | 134 | ||||
-rw-r--r-- | extensions/MozReview/web/style/attachment.css | 13 | ||||
-rw-r--r-- | extensions/MozReview/web/style/mozreview.css | 79 |
3 files changed, 0 insertions, 226 deletions
diff --git a/extensions/MozReview/web/js/mozreview.js b/extensions/MozReview/web/js/mozreview.js deleted file mode 100644 index 6fe51f53b..000000000 --- a/extensions/MozReview/web/js/mozreview.js +++ /dev/null @@ -1,134 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This Source Code Form is "Incompatible With Secondary Licenses", as - * defined by the Mozilla Public License, v. 2.0. - */ - -var MozReview = {}; - -MozReview.getReviewRequest = function() { - var hostUrl = $('.mozreview-requests').data('mozreviewUrl'); - var tr = $('<tr/>'); - var td = $('<td/>'); - var link = $('<a/>'); - - var rrSummaryApiUrl = hostUrl + - 'api/extensions/mozreview.extension.MozReviewExtension/summary/?bug=' + - BUGZILLA.bug_id; - var rrUiBaseUrl = hostUrl + 'r/'; - - function rrUrl(rrId) { - return rrUiBaseUrl + rrId + '/'; - } - - function rrDiffUrl(rrId) { - return rrUrl(rrId) + 'diff/#index_header'; - } - - function humanizedInt(i) { - if (i > 1000) { - return (i / 1000).toFixed(1) + 'k'; - } else { - return '' + i; - } - } - - function rrCommitRow(rr, firstCommit) { - var trCommit = tr.clone(); - var tdSubmitter = td.clone(); - var tdSummary = td.clone(); - var diffLink = link.clone(); - var diffStat = ''; - - if (firstCommit) { - tdSubmitter.text(rr.submitter); - } - - tdSummary.addClass('mozreview-summary'); - diffLink.attr('href', rrDiffUrl(rr.id)); - diffLink.text(rr.summary); - tdSummary.append(diffLink); - - if (rr.diff.insert > 0) { - diffStat = '+' + humanizedInt(rr.diff.insert); - } - - if (rr.diff.delete > 0) { - if (diffStat.length > 0) { - diffStat += ' / '; - } - diffStat += '-' + humanizedInt(rr.diff.delete); - } - - trCommit.append( - tdSubmitter, - tdSummary, - td.clone().text(diffStat) - .addClass('mozreview-diffstat'), - td.clone().text(rr.issue_open_count) - .addClass('mozreview-open-issues'), - td.clone().text(timeAgo(new Date(rr.last_updated))) - ); - - if (rr.status == "discarded") { - $('.mozreview-hide-discarded-row').removeClass('bz_default_hidden'); - trCommit.addClass('bz_default_hidden mozreview-discarded-request'); - } - - return trCommit; - } - - $('.mozreview-hide-discarded-link').click(function(event) { - event.preventDefault(); - if ($('.bz_default_hidden.mozreview-discarded-request').length) { - $('.mozreview-discarded-request').removeClass('bz_default_hidden'); - $('.mozreview-discarded-action').text('Hide'); - } else { - $('.mozreview-discarded-request').addClass('bz_default_hidden'); - $('.mozreview-discarded-action').text('Show'); - } - }); - - var tbody = $('tbody.mozreview-request'); - - function displayLoadError(errStr) { - var errRow = tbody.find('.mozreview-loading-error-row'); - errRow.find('.mozreview-load-error-string').text(errStr); - errRow.removeClass('bz_default_hidden'); - } - - $.getJSON(rrSummaryApiUrl, function(data) { - var family, parent, i, j; - - if (data.review_request_summaries.length === 0) { - displayLoadError('none returned from server'); - } else { - for (i = 0; i < data.review_request_summaries.length; i++) { - family = data.review_request_summaries[i]; - for (j = 0; j < family.children.length; j++) { - tbody.append(rrCommitRow(family.children[j], j == 0)); - } - } - } - - tbody.find('.mozreview-loading-row').addClass('bz_default_hidden'); - }).fail(function(jqXHR, textStatus, errorThrown) { - var errStr; - if (jqXHR.responseJSON && jqXHR.responseJSON.err && - jqXHR.responseJSON.err.msg) { - errStr = jqXHR.responseJSON.err.msg; - } else if (errorThrown) { - errStr = errorThrown; - } else { - errStr = 'unknown'; - } - displayLoadError(errStr); - tbody.find('.mozreview-loading-row').addClass('bz_default_hidden'); - }); -}; - -$().ready(function() { - MozReview.getReviewRequest(); -}); diff --git a/extensions/MozReview/web/style/attachment.css b/extensions/MozReview/web/style/attachment.css deleted file mode 100644 index 474bf466e..000000000 --- a/extensions/MozReview/web/style/attachment.css +++ /dev/null @@ -1,13 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This Source Code Form is "Incompatible With Secondary Licenses", as - * defined by the Mozilla Public License, v. 2.0. */ - -.mozreview-ad { - background-color: #fff9db; - color: #666458; - padding: 5px; - margin-bottom: 10px; -} diff --git a/extensions/MozReview/web/style/mozreview.css b/extensions/MozReview/web/style/mozreview.css deleted file mode 100644 index a2263fc11..000000000 --- a/extensions/MozReview/web/style/mozreview.css +++ /dev/null @@ -1,79 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This Source Code Form is "Incompatible With Secondary Licenses", as - * defined by the Mozilla Public License, v. 2.0. */ - -.mozreview-table { - background: #fff; - border: none; - border-collapse: collapse; - border-bottom: 1px solid rgba(0, 0, 0, 0.2); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); -} - -.mozreview-table th { - text-align: left; - padding: 4px; -} - -.mozreview-table td { - vertical-align: middle !important; - padding: 4px !important; -} - -.mozreview-table thead, .mozreview-table tfoot { - background-color: #eee; - color: #404040; -} - -.mozreview-requests { - background: #fff; - border: none; - border-collapse: collapse; -} - -.mozreview-requests th { - padding: 2px; -} - -.mozreview-requests td { - padding: 2px; -} - -.mozreview-requests .mozreview-summary { - text-align: left; -} - -.mozreview-requests .mozreview-open-issues { - text-align: center; -} - -.mozreview-requests .mozreview-diffstat { - text-align: center; - white-space: nowrap; -} - -/* bug-modal specific */ - -#module-mozreview-requests .module-content { - padding: 0; -} - -.bug_modal .mozreview-table { - width: 100%; -} - -.bug_modal .mozreview-request td { - padding-left: 8px; -} - -.bug_modal .mozreview-requests th { - text-align: left; - padding-left: 8px; -} - -.bug_modal .mozreview-hide-discarded-row { - padding: 4px; -} |