Get Started
Plugins
Macros
More information

Work with content controls navigation

Description

Inserts content controls (automatically or manually), navigates and selects them as well as pastes text into them.

Plugin type: visual, non-system.

Supported editors: documents.

WorkWithContentControlsNavigation
Installation

Download this plugin from GitHub and install it following the desktop, on-premises, or cloud installation instructions.

Usage
  1. Add some content controls into the document.
  2. Open the Plugins tab and press Example work with content controls navigation.
  3. In the first field, you can see all the content controls with their IDs (they are updated automatically).
  4. To move to the specific content control, click it in the list.
  5. Press the Test paste for document button to paste text into the document (where the text cursor is located).
  6. In the second field, you can see the selected content.
  7. Press the Get All Content Controls button in the third field to see all the content controls with their IDs.
  8. To select text in a content control, select it and press the Select Current Content Control button.
Plugin structure

Repository on GitHub: https://github.com/ONLYOFFICE/sdkjs-plugins/tree/master/example_work_with_content_controls_navigation.

  1. config.json, index.html and code.js
  2. Icons
  3. Third-party service:
    • jQuery - a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development (http://jquery.com/). License: MIT License.
Config
{
    "name" : "Example work with content controls navigation",
    "guid" : "asc.{C36DDFB5-08F0-4A68-B829-5FB1F7D49728}",

    "variations" : [
        {
            "description" : "Example work with content controls navigation",
            "url"         : "index.html",

            "icons"           : ["resources/img/icon.png", "resources/img/icon@2x.png", "resources/img/icon2.png", "resources/img/icon2@2x.png"],
            "isViewer"        : false,
            "EditorsSupport"  : ["word"],

            "isVisual"        : true,
            "isModal"         : false,
            "isInsideMode"    : true,

            "initDataType"    : "text",
            "initData"        : "",

            "isUpdateOleOnResize" : false,

            "buttons"         : [],

            "initOnSelectionChanged" : true,

            "events" : ["onTargetPositionChanged"]
        }
    ]
}
Methods and events

The main plugin code is located here.

Support

If you want to request a feature or report a bug regarding this plugin, use the issues section on GitHub.