This repository has been archived by the owner on May 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EZP-26516: As an editor, I want to be able to add/edit tabular data i…
…n RichText editor (#772) * Add Table button and disable embed and image inside table * Add support for table headings Missign alloy menu item, and as we support table headings now we can add this. * Add Richtext table styling when border is used * [Tests] Adjust image and embed tests * [Tests] Add test for table button * [Trasnlation] Add string for table button * Fix the click test on table button * Cleanup based on review, jshint & cleanup of jsdoc * Refactor to avoid duplicated isDisabled logic
- Loading branch information
Showing
18 changed files
with
505 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) eZ Systems AS. All rights reserved. | ||
* For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
// **NOTICE:** | ||
// THIS IS AN AUTO-GENERATED FILE | ||
// DO YOUR MODIFICATIONS IN THE CORRESPONDING .jsx FILE | ||
// AND REGENERATE IT WITH: grunt jsx | ||
// END OF NOTICE | ||
YUI.add('ez-alloyeditor-button-table', function (Y) { | ||
"use strict"; | ||
|
||
var AlloyEditor = Y.eZ.AlloyEditor, | ||
React = Y.eZ.React, | ||
ButtonTable; | ||
|
||
/** | ||
* The ButtonTable class provides functionality for creating and editing a table in a document. ButtonTable | ||
* renders in two different modes: | ||
* | ||
* - Normal: Just a button that allows to switch to the edition mode | ||
* - Exclusive: The ButtonTableEdit UI with all the table edition controls. | ||
* | ||
* This component is a copy of AlloyEditor.ButtonTable, with slightly different render() logic. | ||
* | ||
* @class ButtonTable | ||
*/ | ||
ButtonTable = React.createClass({displayName: "ButtonTable", | ||
propTypes: { | ||
editor: React.PropTypes.object.isRequired, | ||
label: React.PropTypes.string, | ||
tabIndex: React.PropTypes.number, | ||
}, | ||
|
||
statics: { | ||
key: 'eztable' | ||
}, | ||
|
||
render: function () { | ||
if (this.props.renderExclusive) { | ||
return ( | ||
React.createElement(AlloyEditor.ButtonTableEdit, React.__spread({}, this.props)) | ||
); | ||
} | ||
|
||
var css = "ae-button ez-ae-labeled-button"; | ||
|
||
return ( | ||
React.createElement("button", {className: css, onClick: this.props.requestExclusive, tabIndex: this.props.tabIndex}, | ||
React.createElement("span", {className: "ez-ae-icon ez-ae-icon-table ae-icon-table"}), | ||
React.createElement("p", {className: "ez-ae-label"}, Y.eZ.trans('table', {}, 'onlineeditor')) | ||
) | ||
); | ||
}, | ||
}); | ||
|
||
AlloyEditor.Buttons[ButtonTable.key] = AlloyEditor.ButtonTable = ButtonTable; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (C) eZ Systems AS. All rights reserved. | ||
* For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
YUI.add('ez-alloyeditor-button-table', function (Y) { | ||
"use strict"; | ||
|
||
var AlloyEditor = Y.eZ.AlloyEditor, | ||
React = Y.eZ.React, | ||
ButtonTable; | ||
|
||
/** | ||
* The ButtonTable class provides functionality for creating and editing a table in a document. ButtonTable | ||
* renders in two different modes: | ||
* | ||
* - Normal: Just a button that allows to switch to the edition mode | ||
* - Exclusive: The ButtonTableEdit UI with all the table edition controls. | ||
* | ||
* This component is a copy of AlloyEditor.ButtonTable, with slightly different render() logic. | ||
* | ||
* @class ButtonTable | ||
*/ | ||
ButtonTable = React.createClass({ | ||
propTypes: { | ||
editor: React.PropTypes.object.isRequired, | ||
label: React.PropTypes.string, | ||
tabIndex: React.PropTypes.number, | ||
}, | ||
|
||
statics: { | ||
key: 'eztable' | ||
}, | ||
|
||
render: function () { | ||
if (this.props.renderExclusive) { | ||
return ( | ||
<AlloyEditor.ButtonTableEdit {...this.props} /> | ||
); | ||
} | ||
|
||
var css = "ae-button ez-ae-labeled-button"; | ||
|
||
return ( | ||
<button className={css} onClick={this.props.requestExclusive} tabIndex={this.props.tabIndex}> | ||
<span className="ez-ae-icon ez-ae-icon-table ae-icon-table"></span> | ||
<p className="ez-ae-label">{Y.eZ.trans('table', {}, 'onlineeditor')}</p> | ||
</button> | ||
); | ||
}, | ||
}); | ||
|
||
AlloyEditor.Buttons[ButtonTable.key] = AlloyEditor.ButtonTable = ButtonTable; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.