-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
3 changed files
with
29 additions
and
56 deletions.
There are no files selected for viewing
23 changes: 17 additions & 6 deletions
23
code_samples/forms/custom_form_attribute/public/js/formbuilder-richtext-checkbox.js
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 |
---|---|---|
@@ -1,9 +1,20 @@ | ||
(function(global, doc, ibexa) { | ||
const richtext = new ibexa.BaseRichText(); | ||
(function (global, doc, ibexa) { | ||
global.addEventListener('load', (event) => { | ||
const richtext = new ibexa.BaseRichText(); | ||
|
||
// Enable editor in all ibexa-data-source divs | ||
doc.querySelectorAll('.ibexa-data-source').forEach((ibexaDataSource) => { | ||
const richtextContainer = ibexaDataSource.querySelector(".ibexa-data-source__richtext"); | ||
const alloyEditor = richtext.init(richtextContainer); | ||
// Enable editor in all ibexa-data-source divs | ||
doc.querySelectorAll('.ibexa-data-source').forEach( | ||
(ibexaDataSource) => { | ||
const richtextContainer = ibexaDataSource.querySelector( | ||
'.ibexa-data-source__richtext' | ||
); | ||
|
||
if (richtextContainer.classList.contains('ck')) { | ||
return; | ||
} | ||
|
||
const CKEditor = richtext.init(richtextContainer); | ||
} | ||
); | ||
}); | ||
})(window, window.document, window.ibexa); |
27 changes: 0 additions & 27 deletions
27
...tribute/templates/bundles/EzPlatformFormBuilderBundle/fields/config/form_fields.html.twig
This file was deleted.
Oops, something went wrong.
35 changes: 12 additions & 23 deletions
35
...rm_attribute/templates/bundles/IbexaFormBuilderBundle/fields/config/form_fields.html.twig
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 |
---|---|---|
@@ -1,27 +1,16 @@ | ||
{% extends "@!IbexaFormBuilder/fields/config/form_fields.html.twig" %} | ||
{% block _field_configuration_attributes_richtext_description_row %} | ||
<fieldset class="fb-config-field fb-config-field--action form-group" data-field-value="{{form.vars.value.value}}"> | ||
<section class="ibexa-fieldgroup container"> | ||
<div class="ibexa-content-field"> | ||
<div class="ibexa-content-field-value"> | ||
<div class="col-12"> | ||
<div class="ibexa-data-source"> | ||
{% set udw_context = { | ||
'languageCode': 'en', | ||
} %} | ||
{{ form_errors(form) }} | ||
{{ form_widget(form, {'attr': {'class': 'vidar-textarea d-none'}}) }} | ||
<div class="hidden" data-udw-config-name="richtext_embed" data-udw-config="{{ ibexa_udw_config('richtext_embed', udw_context) }}"></div> | ||
<div class="hidden" data-udw-config-name="richtext_embed_image" data-udw-config="{{ ibexa_udw_config('richtext_embed_image', udw_context) }}"></div> | ||
<div class="ibexa-data-source__richtext border px-3 py-3" id="rich_text_content_vl1__editable"></div> | ||
{{ form_rest(form) }} | ||
</div> | ||
{{ encore_entry_link_tags('ibexa-richtext-onlineeditor-css', null, 'richtext') }} | ||
{{ encore_entry_script_tags('ibexa-richtext-onlineeditor-js', null, 'richtext') }} | ||
{{ encore_entry_script_tags('formbuilder-richtext-checkbox-js') }} | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
<fieldset class="fb-config-field form-group" data-field-value="{{form.vars.value.value}}"> | ||
{% set udw_context = { | ||
'languageCode': 'en', | ||
} %} | ||
{{ form_errors(form) }} | ||
|
||
<div class="hidden" data-udw-config-name="richtext_embed" data-udw-config="{{ ibexa_udw_config('richtext_embed', udw_context) }}"></div> | ||
<div class="hidden" data-udw-config-name="richtext_embed_image" data-udw-config="{{ ibexa_udw_config('richtext_embed_image', udw_context) }}"></div> | ||
|
||
{{ form_row(form) }} | ||
|
||
{{ encore_entry_script_tags('formbuilder-richtext-checkbox-js') }} | ||
</fieldset> | ||
{% endblock %} |