Skip to content

Commit 3249de2

Browse files
committed
initial commit 🎆
0 parents  commit 3249de2

File tree

19 files changed

+12560
-0
lines changed

19 files changed

+12560
-0
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
charset = utf-8
7+
trim_trailing_whitespace = false
8+
insert_final_newline = false
9+
10+
[*.{php,yaml}]
11+
insert_final_newline = true
12+
13+
[*.yaml]
14+
indent_size = 2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
namespace Breadlesscode\SimpleEditorExtend\Controller;
3+
4+
use Neos\Flow\Annotations as Flow;
5+
use Neos\Flow\Mvc\Controller\ActionController;
6+
7+
/**
8+
* @Flow\Scope("singleton")
9+
*/
10+
class CkeditorConfigurationController extends ActionController
11+
{
12+
/**
13+
* @Flow\InjectConfiguration(path="buttons")
14+
* @var array
15+
*/
16+
protected $ckeditorConfig;
17+
18+
public function configAction()
19+
{
20+
return \json_encode($this->ckeditorConfig);
21+
}
22+
}

Configuration/Policy.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
privilegeTargets:
2+
'Neos\Flow\Security\Authorization\Privilege\Method\MethodPrivilege':
3+
'Breadlesscode.SimpleEditorExtend:EditorConfig.AjaxEndpoint':
4+
matcher: 'method(Breadlesscode\SimpleEditorExtend\Controller\CkeditorConfigurationController->configAction())'
5+
roles:
6+
'Neos.Flow:Everybody': ## Neos.Neos:AbstractEditor
7+
privileges:
8+
-
9+
privilegeTarget: 'Breadlesscode.SimpleEditorExtend:EditorConfig.AjaxEndpoint'
10+
permission: GRANT

Configuration/Routes.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-
2+
name: 'Ajax endpoint for simple editor config'
3+
uriPattern: 'breadlesscode/editor-config'
4+
defaults:
5+
'@package': 'Breadlesscode.SimpleEditorExtend'
6+
'@controller': 'CkeditorConfiguration'
7+
'@action': 'config'

Configuration/Settings.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Neos:
2+
Neos:
3+
Ui:
4+
resources:
5+
javascript:
6+
'Breadlesscode.SimpleEditorExtend:UiPlugin':
7+
resource: resource://Breadlesscode.SimpleEditorExtend/Public/UiPlugin/Plugin.js
8+
Flow:
9+
mvc:
10+
routes:
11+
'Breadlesscode.SimpleEditorExtend': TRUE

Documentation/preview.gif

139 KB
Loading

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
MIT License
3+
4+
Copyright (c) 2018 Marvin Kuhn
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Neos simple editor extend
2+
3+
This is a small plugin to simply add some buttons to the Neos CMS CKEditor, without writing any JavaScript code. You only need to compose a YAML-File.
4+
5+
## Installation
6+
Most of the time you have to make small adjustments to a package (e.g., the configuration in Settings.yaml). Because of that, it is important to add the corresponding package to the composer from your theme package. Mostly this is the site package located under Packages/Sites/. To install it correctly go to your theme package (e.g.Packages/Sites/Foo.Bar) and run following command:
7+
8+
```bash
9+
composer require breadlesscode/simple-editor-extend --no-update
10+
```
11+
12+
The --no-update command prevent the automatic update of the dependencies. After the package was added to your theme composer.json, go back to the root of the Neos installation and run composer update. Your desired package is now installed correctly.
13+
14+
## Demo
15+
16+
![result demo image](Documentation/preview.gif "Example for the configuration below")
17+
18+
## Example configuration
19+
20+
```yaml
21+
Breadlesscode:
22+
SimpleEditorExtend:
23+
buttons:
24+
'Test.Test:MyCustomSpan':
25+
extensionName: 'exampleExtension'
26+
icon: 'plus-square'
27+
tooltip: 'Mark the text in color green'
28+
position: 'before strong'
29+
formatting:
30+
tag: 'span'
31+
classes: 'test-class'
32+
styles:
33+
background-color: 'green'
34+
'Test.Test:MyCustomSpan2':
35+
extensionName: 'exampleExtension2'
36+
icon: 'rocket'
37+
tooltip: 'Mark the text in color lime'
38+
position: 'before exampleExtension'
39+
formatting:
40+
tag: 'span'
41+
classes: 'test-class-2'
42+
styles:
43+
background-color: 'lime'
44+
```
45+
46+
Now you can use your new formattings like this:
47+
48+
```yaml
49+
'Neos.NodeTypes.BaseMixins:TextMixin':
50+
properties:
51+
text:
52+
ui:
53+
inline:
54+
editorOptions:
55+
formatting:
56+
'Test.Test:MyCustomSpan': true
57+
'Test.Test:MyCustomSpan2': true
58+
```
59+
60+
## License
61+
The MIT License (MIT). Please see [License File](LICENSE) for more information.

Resources/Private/UiPlugin/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10.15.3

0 commit comments

Comments
 (0)