added basic support for htmx (ajax)

- if there is HX-Request header present we sent only a part of the whole html
- we return only specific stream defined by [out ...] ezc statement
- the name of the stream is passed in the 'frame' parameter
  (if not present then 'content' is assumed)
- added ezc function: winix_is_htmx_request
This commit is contained in:
2021-05-27 19:36:04 +02:00
parent 1292a56d1b
commit ba331dea4a
8 changed files with 257 additions and 7 deletions

View File

@@ -3,13 +3,17 @@
[# blocks are not connected with languages yet, so don't use \{ but {]
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
{
CKEDITOR.tools.enableHtml5Elements( document );
function winix_ckeditor_old_browser_support() {
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
{
CKEDITOR.tools.enableHtml5Elements( document );
}
}
[if not winix_is_htmx_request]
winix_ckeditor_old_browser_support();
[end]
</script>
[end]
@@ -22,6 +26,7 @@ if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
[block ckeditor]
<script>
function winix_ckeditor_initialize() {
var editorElement = CKEDITOR.document.getById( '[0]' );
editorElement.setAttribute( 'contenteditable', 'true' );
@@ -83,6 +88,13 @@ extraAllowedContent : 'aside caption figure figcaption article footer header sec
});
}
[if not winix_is_htmx_request]
winix_ckeditor_initialize();
[end]
</script>