User:DodoMan/blockanddiscuss.js: Difference between revisions

Jump to navigation Jump to search
m
(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*: «[^»]*»\\.)?...")
 
 
(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 = '\\{\\{(Averto-3\\|[^\\|]*\\|[^\\}]*|Vandale banni)\\}\\}';
       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">{{Averto-3||}}~~' + '~~</textarea>'))
           .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 = '{{Averto-3|' + duration.replace(' ', '|') + '}}';
           template = '{{Blocked user|' + duration.replace(' ', '|') + '}}';
         }
         }
         $('#' + textId).val(
         $('#' + textId).val(
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu