Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions spihelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,11 @@ async function spiHelperPerformActions () {
if (mw.util.isIPAddress(globalLockEntry, true)) {
return
}
// skip if already globally locked
if (await spiHelperIsUserGloballyLocked(globalLockEntry)) {
return
}

templateContent += '|' + (matchCount + 1) + '=' + globalLockEntry
if (locked) {
locked += ', '
Expand Down Expand Up @@ -3004,6 +3009,7 @@ async function spiHelperGenerateBlockTableLine (name, defaultblock, id) {

let block, ab, acb, ntp, nem, duration

const isIP = mw.util.isIPAddress(name, true)
if (currentBlock) {
block = true
acb = currentBlock.acb
Expand All @@ -3017,7 +3023,7 @@ async function spiHelperGenerateBlockTableLine (name, defaultblock, id) {
ab = true
ntp = spiHelperArchiveNoticeParams.notalk
nem = spiHelperArchiveNoticeParams.notalk
duration = mw.util.isIPAddress(name, true) ? '1 week' : 'indefinite'
duration = isIP ? '1 week' : 'indefinite'
}

const $table = $('#spiHelper_blockTable', document)
Expand Down Expand Up @@ -3053,7 +3059,7 @@ async function spiHelperGenerateBlockTableLine (name, defaultblock, id) {
.val(name)).appendTo($row)
// Global lock (disabled for IPs since they can't be locked)
$('<td>').append($('<input>').attr('type', 'checkbox').attr('id', 'spiHelper_block_lock' + id)
.prop('disabled', mw.util.isIPAddress(name, true))).appendTo($row)
.prop('disabled', isIP).prop('checked', !isIP && spiHelperArchiveNoticeParams.xwiki)).appendTo($row)
$table.append($row)

// Generate the select entries
Expand Down
Loading