improve frontend of emacs, ckeditor, tinymce, nicedit, meta and env functions
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
This commit is contained in:
@@ -1,9 +1,19 @@
|
||||
<div class="winix">
|
||||
|
||||
[if request.is_item]<h1>{edit}</h1>[else]<h1>{add}</h1>[end]
|
||||
[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]
|
||||
|
||||
|
||||
<form class="uk-form-stacked" method="post" action="[doc_base_url][dir][if request.is_item][item.url]/[end]nicedit">
|
||||
[# 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">
|
||||
@@ -16,7 +26,9 @@
|
||||
<div class="uk-margin">
|
||||
<label class="uk-form-label" for="winix_url_id">{suggested_url}</label>
|
||||
<div class="uk-form-controls">
|
||||
<input class="uk-input" id="winix_url_id" type="text" name="url" value="[item.url]">
|
||||
[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]
|
||||
@@ -27,7 +39,7 @@
|
||||
[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_nicedit">[item.content.content_raw]</textarea>
|
||||
<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>
|
||||
|
||||
@@ -36,34 +48,52 @@
|
||||
</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_nicedit');
|
||||
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>
|
||||
[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]
|
||||
<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]
|
||||
[if winix_function_param_is "postredirect"]
|
||||
<input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]">
|
||||
[end]
|
||||
|
||||
<div class="uk-margin">
|
||||
<input class="uk-button uk-button-primary" type="submit" value="[if request.is_item]{change}[else]{add}[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>
|
||||
|
||||
Reference in New Issue
Block a user