This file contains hidden or 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
ezrichtext: | |
alloy_editor: | |
extra_plugins: [random, smiley] |
This file contains hidden or 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
const ezParagraphConfig = new window.eZ.ezAlloyEditor.ezParagraphConfig({ customStyles: this.customStylesConfigurations }); | |
const ezCustomStyleConfig = new window.eZ.ezAlloyEditor.ezCustomStyleConfig({ customStyles: this.customStylesConfigurations }); | |
const pluginButtons = ['random']; | |
ezCustomStyleConfig.buttons = ezCustomStyleConfig.buttons.concat(pluginButtons); | |
ezParagraphConfig.buttons = ezParagraphConfig.buttons.concat(pluginButtons); |
This file contains hidden or 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
eZConfigManager.replace({ | |
eZConfig, | |
entryName: 'ezplatform-admin-ui-alloyeditor-js', | |
itemToReplace: path.resolve(__dirname, '../../../../vendor/ezsystems/ezplatform-admin-ui/src/bundle/Resources/public/js/scripts/fieldType/base/base-rich-text.js'), | |
newItem: path.resolve(__dirname, '../public/js/base-rich-text.js'), | |
}); |
This file contains hidden or 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
$ cp \ | |
vendor/ezsystems/ezplatform-admin-ui/src/bundle/Resources/public/js/scripts/fieldType/base/base-rich-text.js \ | |
src/ExtendedAdminUIBundle/Resources/public/js/base-rich-text.js |
This file contains hidden or 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
eZConfigManager.add({ | |
eZConfig, | |
entryName: 'ezplatform-admin-ui-alloyeditor-js', | |
newItems: [ | |
path.resolve(__dirname, '../public/js/alloyeditor/buttons/random.js'), | |
path.resolve(__dirname, '../public/js/alloyeditor/plugins/random.js'), | |
] | |
}); |
This file contains hidden or 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
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import AlloyEditor from 'alloyeditor'; | |
import EzButton from '../../../../../../../vendor/ezsystems/ezplatform-admin-ui/src/bundle/Resources/public/js/alloyeditor/src/base/ez-button.js'; | |
export default class BtnRandom extends EzButton { | |
static get key() { | |
return 'random'; | |
} |
This file contains hidden or 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
$ yarn encore dev |
This file contains hidden or 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
const path = require('path'); | |
module.exports = (eZConfig, eZConfigManager) => { | |
eZConfigManager.add({ | |
eZConfig, | |
entryName: 'ezplatform-admin-ui-alloyeditor-js', | |
newItems: [ | |
path.resolve(__dirname, '../public/js/alloyeditor/plugins/random.js'), | |
] | |
}); |
This file contains hidden or 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
ezrichtext: | |
alloy_editor: | |
extra_plugins: [random] |
This file contains hidden or 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
(function(global) { | |
if (CKEDITOR.plugins.get('random')) { | |
return; | |
} | |
const InsertRandomNumber = { | |
exec: function(editor) { | |
const number = Math.floor(Math.random() * 1000) + 100; | |
editor.focus(); | |
editor.insertText(' ' + number); |