Numeric Input for CKEditor

Installation

This plugin is intended to be used from other plugins, and since version 0.2 it can modify also existing dialogs.

You can download it from the CKEditor repository.

First you have to make sure that in your plugin it is specified that you want to use this functionality:

requires: 'dialog,numericinput'

Then, in the definition of the dialog you can use the new type "number", similar for example to the fields of type "text". But, with the "number" type, you can also use the "min", "max" and "step" attributes.

Example:

{   
    id: 'autoplaySpeed',
    type: 'number',
    min: 50,
    step: 50
}

You can find a full example in our demo page

If you want to modify an existing dialog, then you have to provide a JSON object with the configuration of the dialogs and fields that you want to "numerize" to the numericinput_modifyfields entry

config.numericinput_modifyfields = {
    'table': {
        'info' : {
            'txtRows': {
                'min': 1
            },
            'txtCols': {
                'min': 1
            },
            'txtBorder': {
                'min': 0,
                'controlStyle': 'width: 4em',
            },
            'txtCellSpace': {
                'min': 0,
                'controlStyle': 'width: 4em',
            },
            'txtCellPad': {
                'min': 0,
                'controlStyle': 'width: 4em',
            }
        }
    }
}

Download Numeric Input plugin here