User:BZPN/Przeglądarka.js: Difference between revisions
From Test Wiki
Content deleted Content added
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
// Autor: BZPN |
|||
// UŻYWASZ SKRYPTU NA WŁASNĄ ODPOWIEDZIALNOŚĆ! Autor nie ponosi odpowiedzialności za ew. szkody spowodowane użyciem skryptu. |
|||
$(document).ready(function () { |
$(document).ready(function () { |
||
var pageName = mw.config.get('wgCanonicalSpecialPageName'); |
var pageName = mw.config.get('wgCanonicalSpecialPageName'); |
||
| Line 30: | Line 32: | ||
$('#mw-content-text').prepend($reviewBox); |
$('#mw-content-text').prepend($reviewBox); |
||
// Podgląd edycji |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
fromrev: revid - 1, // Pobieramy poprzednią wersję |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
var diff = data.compare['*']; |
|||
| ⚫ | |||
var $modal = $(` |
|||
| ⚫ | |||
<div style="max-height: 400px; overflow-y: scroll;">${diff}</div> |
|||
<button id="close-modal" class="oo-ui-buttonElement-button" style="margin-top: 10px;">Zamknij</button> |
|||
</div> |
|||
| ⚫ | |||
| ⚫ | |||
// Zamknij modal po kliknięciu przycisku |
|||
| ⚫ | |||
$modal.remove(); |
|||
}); |
|||
}); |
|||
}); |
|||
| ⚫ | |||
}); |
|||
$('#review-selected-button').click(function () { |
$('#review-selected-button').click(function () { |
||
| Line 105: | Line 149: | ||
$('#cancel-review').click(function () { |
$('#cancel-review').click(function () { |
||
$('#mass-review-box').hide(); |
$('#mass-review-box').hide(); |
||
| ⚫ | |||
// Dodanie checkboxów |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
// Dodaj przycisk podglądu edycji |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
var diffUrl = mw.util.getUrl(title, { diff: revid }); |
|||
| ⚫ | |||
var diffHtml = $(data).find('#mw-diff-otitle2').html(); // Pobranie HTML różnic |
|||
// Wyświetlanie podglądu w modalnym oknie |
|||
| ⚫ | |||
var $closeButton = $('<button style="position: absolute; top: 10px; right: 10px;">Zamknij</button>'); |
|||
| ⚫ | |||
$modal.append('<div class="diff-content">' + diffHtml + '</div>'); |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
$('.diff-addedline', $modal).css('background-color', '#e6f7ff'); // Dodane linie na niebiesko |
|||
$('.diff-deletedline', $modal).css('background-color', '#ffe6e6'); // Usunięte linie na pomarańczowo |
|||
| ⚫ | |||
| ⚫ | |||
}); |
}); |
||
} |
} |
||