Topic on Talk:Talk pages project/New topic/Flow

Patrik L. (talkcontribs)

@PPelberg (WMF) @Matma Rex Hello, some users at Czech Wikipedia use custom buttons when adding new topics using common.js. Could it be available to add custom buttons to the New discussion tool? See examples down.


Buttons are usually used for warning vandals (template Experimenty2 warns them).


When is user longtime problematic (vandal/experimenter), some users use this in headings: {{subst:prvnívelké:{{subst:CURRENTMONTHNAME}}}} {{subst:CURRENTYEAR}} (prvnívelké = ucfirst, in Czech months begin with a lowercase, exception is heading).

This originally reported @David V. to me by private chat and I agree with him. It is really important for patrollers. Buttons facilitate the work of patrollers, just one click adds (not)memorable string and it is fast and easy to use. Btw. you can see his common.js.

Thanks a lot for your work!


Example:

mw.loader.using('user.options', function() {

if(mw.user.options.get('usebetatoolbar')) {
   mw.loader.using('ext.wikiEditor', function() {
     $(function() {
     	$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
       section: 'advanced',
       group: 'format',
       tools: {
           buttonId: {
               label: 'Experimenty2',
               type: 'button',
               icon: 'https://upload.wikimedia.org/wikipedia/commons/a/ae/EXPBT2.png',
               action: {
                   type: 'encapsulate',
                   options: {
                       pre: '\x7b\x7bsubst:Experimenty2}}',
                       peri: ,
                       post: '--\x7E\x7E\x7E\x7E'
                   }
               }
           }
       }
     	});
     });
   });
 }


});


Example 2:

mw.loader.using('user.options', function() {

 if(mw.user.options.get('usebetatoolbar')) {
   mw.loader.using('ext.wikiEditor', function() {
     $(function() {
     	$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
       section: 'advanced',
       group: 'insert',
       tools: {
           buttonId: {
               label: 'Nadpis aktuálního měsíce a roku',
               type: 'button',
               icon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/18/Exclamation-orange.svg/5px-Exclamation-orange.svg.png',
               action: {
                   type: 'encapsulate',
                   options: {
                       pre: ,
                       peri: '\x7b\x7bsubst:prvnívelké:\x7b\x7bsubst:CURRENTMONTHNAME}}}} \x7b\x7bsubst:CURRENTYEAR}}',
                       post: 
                   }
               }
           }
       }
     	});
     });
   });
 }

});

Whatamidoing (WMF) (talkcontribs)

I suspect that we will need @Matma Rex to answer this technical parts of this question.

Matma Rex (talkcontribs)

It's not currently possible to do this. Sorry, I don't have a better answer right now.

Reply to "Buttons"