Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #2792 Added a new text editor form type based on Trix (javier…
…eguiluz) This PR was squashed before being merged into the 2.0.x-dev branch (closes #2792). Discussion ---------- Added a new text editor form type based on Trix This is similar to #2766 but creates a regular text editor instead of a source code editor. The type is not configurable on purpose to keep it simple. If you need advanced features, you can keep using the FOSCKEditor bundle. This is how it looks: ![image](https://user-images.githubusercontent.com/73419/60042629-75740080-96be-11e9-9163-4f53105f61e7.png) Commits ------- f9940c2 Added a new text editor form type based on Trix
- Loading branch information
Showing
17 changed files
with
165 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@import '~trix/dist/trix.css'; | ||
|
||
.easyadmin-text-editor-wrapper { | ||
background: var(--white); | ||
border: 0; | ||
border-radius: var(--border-radius); | ||
box-shadow: 0 0 0 1px rgba(43, 45, 80, .16), 0 0 0 1px rgba(6, 122, 184, 0), 0 0 0 2px rgba(6, 122, 184, 0), 0 1px 1px rgba(0, 0, 0, .08); | ||
padding: 7px; | ||
} | ||
trix-toolbar { | ||
margin-bottom: 10px; | ||
} | ||
trix-toolbar .trix-button-group { | ||
border-color: var(--gray-500); | ||
margin-bottom: 0; | ||
border-width: 1px 1px 2px; | ||
} | ||
trix-toolbar .trix-button { | ||
border: 0; | ||
color: var(--gray-500); | ||
} | ||
trix-toolbar .trix-button.trix-active { | ||
color: var(--gray-700); | ||
} | ||
trix-editor { | ||
border: 0; | ||
padding: 3px; | ||
} |
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,3 @@ | ||
require('../css/form-type-text-editor.css'); | ||
|
||
import 'trix/dist/trix'; |
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,28 @@ | ||
<?php | ||
|
||
namespace EasyCorp\Bundle\EasyAdminBundle\Form\Type; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\TextareaType; | ||
|
||
/** | ||
* @author Javier Eguiluz <javier.eguiluz@gmail.com> | ||
*/ | ||
class TextEditorType extends AbstractType | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getParent(): string | ||
{ | ||
return TextareaType::class; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getBlockPrefix(): string | ||
{ | ||
return 'easyadmin_text_editor'; | ||
} | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.