「利用者:Dragoniez/scripts/AN Reporter.js」の版間の差分

削除された内容 追加された内容
v2.2: 報告試行後のボタンの表示方法を変更
v2.3: 報告対象者がレンジIPでもインプットに自動入力される機能を追加
2行目:
* AN Reporter (ANR)
* Author: Dragoniez
* Version: 2.23
*************************************/
//<nowiki>
197行目:
` <div id="anr-user1-input-div">` +
` <label id="anr-user1-label" for="anr-user1-input" style="${labelCSS}">利用者</label>` +
` <input id="anr-user1-input" style="width: 31ch34ch;">` +
` <select disabled id="anr-user1-select">` +
` <option class="anr-opt-UNL">UNL</option>` +
270行目:
$('.anr-modal-dialog').dialog({
'minHeight': 50,
'minWidth': 300'58ch',
'width': 'auto',
'modal': true,
277行目:
 
// Get the name of the user to report if it can be retrieved from the page
var username = mw.config.get('wgRelevantUserName'); // Note: This does not pick up IP ranges
 
// Workaround to pick up IP ranges
if (username === null && mw.config.get('wgCanonicalSpecialPageName') === 'Contributions') {
let relUsername = $('#firstHeading').text().replace('の投稿記録', '');
if (mw.util.isIPAddress(relUsername, true)) {
username = relUsername;
}
}
// If wgRelevantUserName returns null or the name of the current user, set the variable as a null string
if (!username || username === mw.config.get('wgUserName')) {
username = '';
}
 
// Show the user name on the dialog
$('#anr-user1-input').val(username);
typeDropdown('#anr-user1-input', '#anr-user1-select');
689 ⟶ 701行目:
$('.anr-section-div').empty();
$('.anr-section-div').append(sectionsI);
$('#anr-section-options-si').select2css({'width': widthS$(this).width()}); // Adjust the width of Select2
$('.anr-section-div').css('display', 'block');
$('.anr-target-a-div').css('display', 'block');
696 ⟶ 709行目:
$('.anr-section-div').empty();
$('.anr-section-div').append(sectionsS);
var widthS = $('#anr-targetsection-options-s').select2({'width': $(this).width()});
$('#anr-section-options-s').select2({'width': widthS}); // Adjust the width of Select2
$('.anr-section-div').css('display', 'block');
$('.anr-target-a-div').css('display', 'block');