Improves in emacs: - use htmx to send content to the controller - show txt and formatted_txt content in the second panel - show two tabs if "tabs" winix parameter is used - add an option to show either one or two panels - correctly resize the editor window (F11) when two panels are shown Improves in ckeditor: - use htmx to send content to the controller - do not check automatically for ckeditor update Improves in tinymce/nicedit/meta/env: - use htmx to send content to the controller while here: - change PascalCase to snake_case in meta/env controllers - update CodeMirror editor to 5.65.16 - udpate Showdown (markdown to html converter) to 2.1.0
108 lines
3.5 KiB
HTML
108 lines
3.5 KiB
HTML
<div class="winix">
|
|
|
|
[frame "ckeditor"]
|
|
<h1 id="winix_header_id" [if winix_frame_is "ckeditor"]hx-swap-oob="true"[end]>
|
|
[if request.is_item]
|
|
{edit}
|
|
[else]
|
|
{add}
|
|
[end]
|
|
</h1>
|
|
[end]
|
|
|
|
|
|
[# ckeditor needs javascript to work properly so we assume that the save method]
|
|
[# will be made only through ajax (htmx)]
|
|
<form class="uk-form-stacked">
|
|
|
|
[if one [mount_type_is "cms"] [any [mount_type_is "thread"] [thread_mount_arg_is "subject"]]]
|
|
<div class="uk-margin">
|
|
<label class="uk-form-label" for="winix_title_id">{title}</label>
|
|
<div class="uk-form-controls">
|
|
<input class="uk-input" id="winix_title_id" type="text" name="subject" value="[item.subject]" [if not request.is_item]autofocus [end]>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="uk-margin">
|
|
<label class="uk-form-label" for="winix_url_id">{suggested_url}</label>
|
|
<div class="uk-form-controls">
|
|
[frame "ckeditor"]
|
|
<input class="uk-input" id="winix_url_id" type="text" name="url" value="[item.url]" [if winix_frame_is "ckeditor"]hx-swap-oob="true"[end]>
|
|
[end]
|
|
</div>
|
|
</div>
|
|
[end]
|
|
|
|
|
|
<div class="uk-margin">
|
|
[if mount_type_is "cms"]<label class="uk-form-label" for="winix_content_id">{form_emacs_content_cms}</label>[end]
|
|
[if mount_type_is "thread"]<label class="uk-form-label" for="winix_content_id">{form_emacs_content_thread}</label>[end]
|
|
[if mount_type_is "ticket"]<label class="uk-form-label" for="winix_content_id">{form_emacs_content_ticket}</label>[end]
|
|
|
|
[# template fun_ls.html uses the name: itemcontent to refer to this textarea item]
|
|
|
|
<div class="uk-form-controls">
|
|
<div style="border-top: 1px solid #dadada; border-bottom: 1px solid #dadada; padding: 0.2em 0 0.2em 0; margin: 1em 0 1em 0;" id="winix-editor-content">[item.content.print_content]</div>
|
|
<input type="hidden" id="winix_content_id" name="itemcontent" value="[item.content.content_raw]">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="uk-form-controls">
|
|
<input id="contenttype" type="hidden" name="contenttype" value="2">
|
|
</div>
|
|
|
|
<div class="uk-margin winix-ckeditor-status">
|
|
[frame "ckeditor"]
|
|
|
|
[if not user_logged]
|
|
<div class="uk-margin">
|
|
<label class="uk-form-label" for="winix_nick_id">{nick}</label>
|
|
<div class="uk-form-controls">
|
|
<input class="uk-input" id="winix_nick_id" type="text" name="guestname" value="[item.content.guest_name]">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="uk-margin">
|
|
<label class="uk-form-label" for="winix_rebus_id">{rebus_how_is_it} [rebus_question]?</label>
|
|
<div class="uk-form-controls">
|
|
<input class="uk-input" id="winix_rebus_id" type="text" name="rebus">
|
|
</div>
|
|
</div>
|
|
|
|
[include "antispam.html"]
|
|
[end]
|
|
|
|
[if winix_function_param_is "postredirect"]
|
|
<input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]">
|
|
[end]
|
|
|
|
[# IMPROVEME put some kind of a status msg here]
|
|
|
|
<div class="uk-margin-medium-top">
|
|
<button
|
|
class="uk-button uk-button-primary uk-width-1-1 uk-width-1-2@s uk-width-1-3@m wx-button-spinner"
|
|
type="button"
|
|
hx-on:click="winix_update_from_ckeditor(this, '[doc_base_url][dir][if request.is_item][item.url]/[end]ckeditor/frame:ckeditor', '.winix-ckeditor-status')"
|
|
>
|
|
<span class="wx-button-spinner-text">
|
|
[if request.is_item]{change}[else]{add}[end]
|
|
</span>
|
|
<div class="wx-button-spinner-spinner">
|
|
<div uk-spinner="ratio: 0.5"></div>
|
|
</div>
|
|
</button>
|
|
</div>
|
|
|
|
[end]
|
|
</div>
|
|
|
|
|
|
[include "ckeditor.html"]
|
|
[ckeditor_old_browsers_support]
|
|
[ckeditor "winix-editor-content"]
|
|
|
|
</form>
|
|
|
|
</div>
|