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
103 lines
3.4 KiB
HTML
103 lines
3.4 KiB
HTML
<div class="winix">
|
|
|
|
[frame "nicedit"]
|
|
<h1 id="winix_header_id" [if winix_frame_is "nicedit"]hx-swap-oob="true"[end]>
|
|
[if request.is_item]
|
|
{edit}
|
|
[else]
|
|
{add}
|
|
[end]
|
|
</h1>
|
|
[end]
|
|
|
|
|
|
[# nicedit 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 "nicedit"]
|
|
<input class="uk-input" id="winix_url_id" type="text" name="url" value="[item.url]" [if winix_frame_is "nicedit"]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]
|
|
|
|
<div class="uk-form-controls">
|
|
<textarea class="uk-textarea" rows="[if mount_type_is "cms"]30[else]10[end]" cols="60" name="itemcontent" id="winix_content_id">[item.content.content_raw]</textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="uk-form-controls">
|
|
<input type="hidden" name="contenttype" value="2">
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
new nicEditor(\{fullPanel:true, iconsPath:'[doc_base_url_common]/nicedit/0.9_r25/nicEditorIcons.gif', uploadURI:'[doc_base_url][dir]upload/' \}).panelInstance('winix_content_id');
|
|
</script>
|
|
|
|
<div class="uk-margin winix-nicedit-status">
|
|
[frame "nicedit"]
|
|
|
|
[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_nicedit(this, '[doc_base_url][dir][if request.is_item][item.url]/[end]nicedit/frame:nicedit', '.winix-nicedit-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>
|
|
|
|
</form>
|
|
|
|
|
|
</div>
|