Search and replace on start
Description
Searches for and replaces text in the document when it is reopened.
Plugin type: non-visual, system.
Supported editors: documents.
Installation
Download this plugin from GitHub and install it following the desktop, on-premises, or cloud installation instructions.
Usage
- Enter any text into the document (in this example, it is ONLYOFFICE).
- In the plugin code, enter the replacement text in replaceString parameter.
- Reopen the document.
Plugin structure
Repository on GitHub: https://github.com/ONLYOFFICE/sdkjs-plugins/tree/master/searchAndReplaceOnStart.
- config.json, index.html, and code.js
Config
{
"name": "searchAndReplaceOnStart",
"guid": "asc.{C820F3CC-1248-4CA2-8D0F-D7EFD44DE09C}",
"baseUrl": "",
"variations": [
{
"description": "searchAndReplaceOnStart",
"url": "index.html",
"isViewer": true,
"EditorsSupport": ["word"],
"isSystem": true,
"isVisual": false,
"initDataType": "none",
"initData": "",
"buttons": [],
"events": ["onDocumentContentReady"]
}
]
}
Methods and events
- button
- init
- onDocumentContentReady
- executeMethod ("SearchAndReplace")
Support
If you want to request a feature or report a bug regarding this plugin, use the issues section on GitHub.