Browse Source

DOC-756: revert #1870 (#1943)

This reverts commit 151ce2dd40.
pull/1948/head
Tyler Kelly 4 years ago
committed by GitHub
parent
commit
778639ad05
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      _data/nav.yml
  2. 35
      _includes/commands/advtable-cmds.md
  3. 83
      _includes/configuration/advtable-value-series.md
  4. 7
      plugins/premium/advtable.md
  5. 13
      release-notes/release-notes58.md

1
_data/nav.yml

@ -236,7 +236,6 @@
- url: "advcode"
- url: "advtable"
pages:
- url: "#advtable_value_series"
- url: "#Commands"
- url: "#Events"
- url: "casechange"

35
_includes/commands/advtable-cmds.md

@ -2,12 +2,18 @@
| Command | Description |
| ------------------------ | ----------------------------------------------------------------------------------------------- |
| mceAdvancedTableSort | Opens the Advanced Table Sort Dialog for the current selection or cursor location. |
| mceSortTableAdvanced | Performs an Advanced Table Sort. For details, see [mceSortTableAdvanced](#mcesorttableadvanced). |
| mceSortTableAdvanced | Performs an Advanced Table Sort. See below for details. |
| mceSortTableByColumnAsc | Sorts the current table ascending by column based on the current cursor position or selection. |
| mceSortTableByColumnDesc | Sorts the current table descending by column based on the current cursor position or selection. |
| mceSortTableByRowAsc | Sorts the current table ascending by row based on the current cursor position or selection. |
| mceSortTableByRowDesc | Sorts the current table descending by row based on the current cursor position or selection. |
| mceTableToggleSeries | Toggles a series column on the selected table. For details, see [mceTableToggleSeries](#mcetabletoggleseries). {{ site.requires_5_7v }} |
| mceSortTableByRowAsc | Sorts the current table ascending by row based on the current cursor position or selection. |
| mceSortTableByRowDesc | Sorts the current table descending by row based on the current cursor position or selection. |
`mceSortTableAdvanced` accepts an object with the following value pairs:
- `sortby` - `'row'` or `'column'`
- `roworcol` - a zero-indexed integer in a string representing the row from the top of the table or column from the left of the table.
- `sort` - `'row'`, `'column'`, `'selection'`, or `'table'`
- `order` - `'ascending'` or `'descending'`
**Examples**
@ -18,23 +24,4 @@ tinymce.activeEditor.execCommand('mceSortTableByColumnAsc')
tinymce.activeEditor.execCommand('mceSortTableByColumnDesc')
tinymce.activeEditor.execCommand('mceSortTableByRowAsc')
tinymce.activeEditor.execCommand('mceSortTableByRowDesc')
tinymce.activeEditor.execCommand('mceTableToggleSeries', false, { name: 'numbers', location: 'left' })
```
### `mceSortTableAdvanced`
`mceSortTableAdvanced` accepts an object with the following key-value pairs:
- `sortby` - `'row'` or `'column'`
- `roworcol` - a zero-indexed integer in a string representing the row from the top of the table or column from the left of the table.
- `sort` - `'row'`, `'column'`, `'selection'`, or `'table'`
- `order` - `'ascending'` or `'descending'`
### `mceTableToggleSeries`
`mceTableToggleSeries` accepts an object with the following key-value pairs:
| Name | Value | Requirement | Description |
| ---- | ----- | ----------- | ----------- |
| name | `string` | Required | Specifies the series to toggle. Series and their associated names are configured using the [advtable_value_series option]({{site.baseurl}}/plugins/premium/advtable/#advtable_value_series). If the series name provided is not present on the table, a series column will be inserted or an existing series will be replaced by the new series. |
| location | `'left'` | Required | Specifies the location of where the series is toggled in the table. For example, a location of `left` will toggle a series column on the left side of the table. |
```

83
_includes/configuration/advtable-value-series.md

@ -1,83 +0,0 @@
## `advtable_value_series`
{{ site.requires_5_7 }}
{% if pluginname != "Advanced Tables" %}
> **Note**: The `advtable_value_series` option requires the Advanced Tables plugin.
{% endif %}
The `advtable_value_series` option is used in conjunction with the [mceTableToggleSeries command]({{site.baseurl}}/plugins/premium/advtable/#commands).
The `advtable_value_series` option configures value series for populating cells in a table. This option can be used to create row identifiers.
**Type:** `Object`
**Default Value:**
```js
{
// Natural number series
numbers: {
update: true,
resizable: false,
generator: `GeneratorFunction` // For details, see: 'Creating a value series generator'
},
// English alphabetic series
alpha: {
update: true,
resizable: false,
generator: `GeneratorFunction` // For details, see: 'Creating a value series generator'
},
}
```
Both default series are configured to update on table changes and not resize when using the resize bars.
### Series configuration
| Name | Value | Requirement | Description |
| ---- | ----- | ----------- | ----------- |
| update | `boolean` | Optional | default: `false` - When `true`, the series values will be updated when changes are made to the table. |
| resizable | `boolean` | Optional | default: `true` - When `true`, table cells containing the series values can be resized using a mouse or touch device. |
| generator | `(info: GeneratorInfo, rowIndex: number, columnIndex: number) => GeneratorResult` | Required | For details on creating a value series generator, see: [Creating a value series generator](#creatingavalueseriesgenerator). |
#### Creating a value series generator
The `generator` is a callback function for specifying how to update a table cell of a value series. The callback is passed information relating to the generator and table cell, the row index, and column index of the table cell. For details, see: [GeneratorInfo](#generatorinfo). The callback should return an object containing the value and optionally, any classes and attributes to be applied to the table cell. For details, see: [GeneratorResult](#generatorresult).
##### GeneratorInfo
| Name | Value | Description |
| ---- | ----- | ----------- |
| rowType | `'thead'`, `'tbody'` or `'tfoot'` | The section of the table cell. |
| cellType | `'td'` or `'th'` | The type of the table cell. |
| direction | `'row'` or `'column'` | The direction of the generator. |
| prevSeriesValue | `string` or `undefined` | The previous value calculated by the generator. |
##### GeneratorResult
| Name | Value | Requirement | Description |
| ---- | ----- | ----------- | ----------- |
| classes | `string[]` | Optional | The classes to be applied to the table cell. |
| attributes | `Object` | Optional | The attributes to be applied to the table cell. The `attributes` should be provided as an object where each key is an attribute and each value is of type `string`, `boolean`, `number` or `null`. A value of `null` for an attribute will remove the attribute from the table cell. |
| value | `string`, `number` or `undefined` | Optional | The value of the table cell. If the value is `undefined`, the editor will use the previous value of the table cell. |
### Example: Using `advtable_value_series`
```js
tinymce.init({
selector: 'textarea', // change this value according to your html
plugins: 'table advtable',
menubar: 'table',
advtable_value_series: {
numbers: {
update: true,
resizable: false,
generator: function (info, rowIndex, columnIndex) {
return {
value: rowIndex + 1
};
}
},
}
});
```

7
plugins/premium/advtable.md

@ -8,7 +8,6 @@ keywords: sort tables advanced advtable premium
{% assign pluginname = "Advanced Tables" %}
{% assign plugincode = "advtable" %}
{% assign plugincategory = "premium" %}
{{site.requires_5_1v}}<br/>
{{site.premiumplugin}}
@ -43,12 +42,6 @@ tinymce.init({
});
```
## Configuration options
The following configuration options affect the behavior of the {{pluginname}} plugin.
{% include configuration/advtable-value-series.md %}
{% include misc/plugin-menu-item-id-boilerplate.md %}
## Commands

13
release-notes/release-notes58.md

@ -57,18 +57,7 @@ The {{site.productname}} 5.8 release includes an accompanying release of the **<
- <Description>
For information on the <<Premium Plugin Name>> plugin, see: [<<Premium Plugin Name>> plugin]({{site.baseurl}}/plugins/premium/advtable/).
### Advanced Tables 1.1.0
The {{site.productname}} 5.8 release includes an accompanying release of the **Advanced Tables** premium plugin.
**Advanced Tables** 1.1.0 provides the following new features:
- Added a new `advtable_value_series` option that allows value series to be configured. For details, see: [Advanced Tables plugin - advtable_value_series]({{site.baseurl}}/plugins/premium/advtable/#advtable_value_series).
- Added a new `mceTableToggleSeries` command that toggles a series column on the selected table. For details, see: [Advanced Tables plugin - Commands]({{site.baseurl}}/plugins/premium/advtable/#commands).
For information on the Advanced Tables plugin, see: [Advanced Tables plugin]({{site.baseurl}}/plugins/premium/advtable/).
For information on the <<Premium Plugin Name>> plugin, see: [<<Premium Plugin Name>> plugin]({{site.baseurl}}/plugins/<<Premium Plugin Name>>/).
### Comments 2.4.0

Loading…
Cancel
Save