Manual:CopyTextLayout/fr

CopyTextLayout est un widget MediaWiki qui affiche un bouton pour copier le texte fourni. C'est un widget basé sur OOUI. C'est une combinaison de TextInputWidget et ButtonWidget de OOUI.



Exemples JavaScript


Dans les extensions de MediaWiki
Using the widget in MediaWiki Extension will be done through the 3 steps. First create the resource javascript file, Second register the js file in extension.json file. So that the module can load by ResourceLoader. And finally, load it by Output Context.
 * Create the resource.js file in extension directory with following code.
 * Register the js file as module in extension.json
 * Finally load it by Output Context in your SpecialPage/ParserHook.



Dans les scripts utilisateurs
To use the widget in UserScript is very easy, you just need to load the dependencie by mw.loader.using. and put the code into the block. Try the below code in your Special:MyPage/common.js



Dans les gadgets
To use in gadgets, you have to add a mediawiki.widgets entry in the  field of gadget description. See Gadgets' documentation for instructions and examples.
 * So Add dependencies in MediaWiki:Gadgets-definition


 * Create MediaWiki:Gadget-mygadget.js page with code. You does not need to use mw.loader.using as we did in UserScript.

