User:DodoMan/blockanddiscuss.js: Difference between revisions
From Test Wiki
Content deleted Content added
Created page with "if (mw.config.get('wgCanonicalNamespace') == 'Special' && mw.config.get('wgCanonicalSpecialPageName') == 'Block') { $(function() { var api = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/api.php'; var checkId = 'mw-input-wpBlockMessage'; var textId = 'mw-input-wpBlockMessageText'; var blockTemplate = '\\{\\{(Averto-3\\|[^\\|]*\\|[^\\}]*|Vandale banni)\\}\\}'; var reason = '(\\s*Avec le motif suivant\\s*: «[^»]*»\\.)?..." |
m FuzzyBot moved page User:DodoMan~usurped/blockanddiscuss.js to User:DodoMan/blockanddiscuss.js: Part of translatable page "User:DodoMan~usurped" |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 5: | Line 5: | ||
var checkId = 'mw-input-wpBlockMessage'; |
var checkId = 'mw-input-wpBlockMessage'; |
||
var textId = 'mw-input-wpBlockMessageText'; |
var textId = 'mw-input-wpBlockMessageText'; |
||
var blockTemplate = '\\{\\{( |
var blockTemplate = '\\{\\{(Blocked user\\|[^\\|]*\\|[^\\}]*)\\}\\}'; |
||
var reason = '(\\s*Avec le motif suivant\\s*: «[^»]*»\\.)?~~' + '~~'; |
var reason = '(\\s*Avec le motif suivant\\s*: «[^»]*»\\.)?~~' + '~~'; |
||
var $watchBlock = $('#mw-input-wpWatch').closest('.oo-ui-fieldLayout'); |
var $watchBlock = $('#mw-input-wpWatch').closest('.oo-ui-fieldLayout'); |
||
| Line 27: | Line 27: | ||
.end() |
.end() |
||
.find('.oo-ui-fieldLayout-field') |
.find('.oo-ui-fieldLayout-field') |
||
.replaceWith($('<textarea id="' + textId + '" rows="10">{{ |
.replaceWith($('<textarea id="' + textId + '" rows="10">{{Blocked user}}~~' + '~~</textarea>')) |
||
.end() |
.end() |
||
.appendTo($watchBlock.parent()) |
.appendTo($watchBlock.parent()) |
||
| Line 62: | Line 62: | ||
var template = '{{Vandale banni}}'; |
var template = '{{Vandale banni}}'; |
||
if (duration != 'indéfiniment') { |
if (duration != 'indéfiniment') { |
||
template = '{{ |
template = '{{Blocked user|' + duration.replace(' ', '|') + '}}'; |
||
} |
} |
||
$('#' + textId).val( |
$('#' + textId).val( |
||