User:ערן/veReplace

This script adds option for replace and replace all in VisualEditor.

Usage
The script adds replace option in VE toolbar, which opens dialog for replacing term:

User setup
Copy the following code to your Special:MyPage/common.js:

Project setup
To turn it as a gadget that user can select in their preferences (requires sysop rights): (notice the first line is just a loader for the real script which is declared in the second line - this way it is possible to load the replace option only once VE is activated)
 * create MediaWiki:Gadget-veReplaceLoader.js with the following code:
 * create MediaWiki:Gadget-veReplaceLoader with short description (example: "Adds replace button to VisualEditor")
 * create MediaWiki:Gadget-veReplace.js and copy the code from User:ערן/veReplace.js.
 * add the following to MediaWiki:Gadgets-definition:
 * veReplaceLoader[ResourceLoader|dependencies=ext.visualEditor.viewPageTarget.init]|veReplaceLoader.js
 * veReplace[ResourceLoader|rights=hidden|hidden|dependencies=ext.visualEditor.core]|veReplace.js