updated to the new pikotools api: [ezc out] and [out] changed to [ezc frame] or just [frame]
- when returning json streams changed "out" field to "frames" - renamed config parameter: allow_ezc_out_in_executable_items -> allow_ezc_frames_in_executable_items - added basic support for ajax requests in thread plugin
This commit is contained in:
parent
ba331dea4a
commit
e6fae4598c
|
@ -750,7 +750,7 @@ void App::CreateJSONAnswer()
|
||||||
|
|
||||||
if( !req.return_info_only )
|
if( !req.return_info_only )
|
||||||
{
|
{
|
||||||
json_out_stream << L"{\n\"out\": {\n";
|
json_out_stream << L"{\n\"frames\": {\n";
|
||||||
|
|
||||||
auto i = req.out_streams.streams_map.begin();
|
auto i = req.out_streams.streams_map.begin();
|
||||||
bool is_first = true;
|
bool is_first = true;
|
||||||
|
|
|
@ -309,7 +309,7 @@ void Config::AssignValues(bool stdout_is_closed)
|
||||||
incorrect_login_cannot_login_delay = Size(L"incorrect_login_cannot_login_delay", 1800);
|
incorrect_login_cannot_login_delay = Size(L"incorrect_login_cannot_login_delay", 1800);
|
||||||
|
|
||||||
pid_file = Text(L"pid_file", L"");
|
pid_file = Text(L"pid_file", L"");
|
||||||
allow_ezc_out_in_executable_items = Bool(L"allow_ezc_out_in_executable_items", false);
|
allow_ezc_frames_in_executable_items = Bool(L"allow_ezc_frames_in_executable_items", false);
|
||||||
|
|
||||||
check_proxy_ip_header = Bool(L"check_proxy_ip_header", false);
|
check_proxy_ip_header = Bool(L"check_proxy_ip_header", false);
|
||||||
proxy_ip_header = Text(L"proxy_ip_header", L"X_Real_IP");
|
proxy_ip_header = Text(L"proxy_ip_header", L"X_Real_IP");
|
||||||
|
|
|
@ -638,7 +638,7 @@ public:
|
||||||
|
|
||||||
// how many output streams do we have in Request class
|
// how many output streams do we have in Request class
|
||||||
// those streams used in ajax responses
|
// those streams used in ajax responses
|
||||||
// you can use no more [ezc out] statements than this limit
|
// you can use no more [ezc frames] statements than this limit
|
||||||
// default: 128
|
// default: 128
|
||||||
size_t ezc_out_streams_size;
|
size_t ezc_out_streams_size;
|
||||||
|
|
||||||
|
@ -758,10 +758,10 @@ public:
|
||||||
// pid file is saved after winix has dropped privileges
|
// pid file is saved after winix has dropped privileges
|
||||||
std::wstring pid_file;
|
std::wstring pid_file;
|
||||||
|
|
||||||
// allow to use [ezc out] statement in executable items (used in 'run' winix function)
|
// allow to use [ezc frame] statements in executable items (used in 'run' winix function)
|
||||||
// default false
|
// default false
|
||||||
// warning: if you enable this options a user can override a different output stream when using ajax
|
// warning: if you enable this options a user can override a different output stream when using ajax
|
||||||
bool allow_ezc_out_in_executable_items;
|
bool allow_ezc_frames_in_executable_items;
|
||||||
|
|
||||||
|
|
||||||
// check whether there is a 'log_proxy_ip_header' header
|
// check whether there is a 'log_proxy_ip_header' header
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<h1>{create_thread_header}</h1>
|
<h1>{create_thread_header}</h1>
|
||||||
|
|
||||||
|
|
||||||
<form class="uk-form-stacked" method="post" action="[doc_base_url][dir]createthread">
|
<form class="uk-form-stacked" method="post" action="[doc_base_url][dir]createthread" [if winix_has_htmx]hx-post="[doc_base_url][dir]createthread" hx-push-url="true"[end]>
|
||||||
|
|
||||||
<div class="uk-margin">
|
<div class="uk-margin">
|
||||||
<label class="uk-form-label" for="winix_title_id">{title}</label>
|
<label class="uk-form-label" for="winix_title_id">{title}</label>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<h1>{thread_header_reply}</h1>
|
<h1>{thread_header_reply}</h1>
|
||||||
|
|
||||||
|
|
||||||
<form class="uk-form-stacked" method="post" action="[doc_base_url][dir][item_url]/reply">
|
<form class="uk-form-stacked" method="post" action="[doc_base_url][dir][item_url]/reply" [if winix_has_htmx]hx-post="[doc_base_url][dir][item_url]/reply"[end]>
|
||||||
|
|
||||||
[if thread_mount_arg_is "subject"]
|
[if thread_mount_arg_is "subject"]
|
||||||
<div class="uk-margin">
|
<div class="uk-margin">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="winix">
|
<div class="winix winix-threads-list">
|
||||||
|
|
||||||
[if mount_page_arg_is "subject"]<h1[if mount_page_arg_is "info"] class="withinfo"[end]>[dir_last_subject]</h1>[end]
|
[if mount_page_arg_is "subject"]<h1[if mount_page_arg_is "info"] class="withinfo"[end]>[dir_last_subject]</h1>[end]
|
||||||
[if mount_page_arg_is "info"][include "dir_last_info.html"][end]
|
[if mount_page_arg_is "info"][include "dir_last_info.html"][end]
|
||||||
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
[if thread_can_create]
|
[if thread_can_create]
|
||||||
<div class="uk-margin">
|
<div class="uk-margin">
|
||||||
<a class="uk-button uk-button-primary" href="[doc_base_url][dir]createthread" rel="nofollow">{thread_create_new}</a>
|
<a class="uk-button uk-button-primary" href="[doc_base_url][dir]createthread" rel="nofollow" [if winix_has_htmx]hx-get="[doc_base_url][dir]createthread" hx-swap="outerHTML" hx-target="this"[end]>{thread_create_new}</a>
|
||||||
</div>
|
</div>
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
<tr><th>{thread_tab_title}</th><th>{thread_tab_author}</th><th>{thread_tab_replies}</th><th>{thread_tab_last_post}</th></tr>
|
<tr><th>{thread_tab_title}</th><th>{thread_tab_author}</th><th>{thread_tab_replies}</th><th>{thread_tab_last_post}</th></tr>
|
||||||
[for thread_sort_tab]
|
[for thread_sort_tab]
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="[doc_base_url][dir][thread_sort_tab_url]">[thread_sort_tab_subject]</a></td> [# dodac sprawdzanie subject empty]
|
<td><a class="winix-thread-link" href="[doc_base_url][dir][thread_sort_tab_url]" [if winix_has_htmx]hx-get="[doc_base_url][dir][thread_sort_tab_url]" hx-push-url="true"[end]>[thread_sort_tab_subject]</a></td> [# dodac sprawdzanie subject empty]
|
||||||
<td>[thread_sort_tab_user]</td><td class="smallfont">[thread_sort_tab_replies]</td>
|
<td>[thread_sort_tab_user]</td><td class="smallfont">[thread_sort_tab_replies]</td>
|
||||||
<td>[thread_sort_tab_last_item_date_modification_nice] ([thread_sort_tab_last_item_user])</td>
|
<td>[thread_sort_tab_last_item_date_modification_nice] ([thread_sort_tab_last_item_user])</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -27,4 +27,11 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
[if false]
|
||||||
|
[if any winix_has_htmx winix_is_htmx_request winix_has_uikit]
|
||||||
|
<script>
|
||||||
|
[# fixme: not working in this way]
|
||||||
|
UIkit.scroll(".winix-thread-link").scrollTo(".winix-threads-list");
|
||||||
|
</script>
|
||||||
|
[end]
|
||||||
|
[end]
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
[if thread_mount_arg_is "sort_desc"]
|
[if thread_mount_arg_is "sort_desc"]
|
||||||
[if thread_can_reply]
|
[if thread_can_reply]
|
||||||
<div class="uk-margin">
|
<div class="uk-margin">
|
||||||
<a class="uk-button uk-button-primary" href="[doc_base_url][dir][item_url]/reply" rel="nofollow">{thread_reply_in_this_thread}</a>
|
<a class="uk-button uk-button-primary" href="[doc_base_url][dir][item_url]/reply" rel="nofollow" [if winix_has_htmx]hx-get="[doc_base_url][dir][item_url]/reply" hx-swap="outerHTML" hx-target="this"[end]>{thread_reply_in_this_thread}</a>
|
||||||
</div>
|
</div>
|
||||||
[end]
|
[end]
|
||||||
[end]
|
[end]
|
||||||
|
@ -47,10 +47,12 @@
|
||||||
[if not [thread_mount_arg_is "sort_desc"]]
|
[if not [thread_mount_arg_is "sort_desc"]]
|
||||||
[if thread_can_reply]
|
[if thread_can_reply]
|
||||||
<div class="uk-margin">
|
<div class="uk-margin">
|
||||||
<a class="uk-button uk-button-primary" href="[doc_base_url][dir][item_url]/reply" rel="nofollow">{thread_reply_in_this_thread}</a>
|
<a class="uk-button uk-button-primary" href="[doc_base_url][dir][item_url]/reply" rel="nofollow" [if winix_has_htmx]hx-get="[doc_base_url][dir][item_url]/reply" hx-swap="outerHTML" hx-target="this"[end]>{thread_reply_in_this_thread}</a>
|
||||||
</div>
|
</div>
|
||||||
[end]
|
[end]
|
||||||
[end]
|
[end]
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -335,7 +335,7 @@ void item_run(Info & i)
|
||||||
InitGenerator(ezc_generator);
|
InitGenerator(ezc_generator);
|
||||||
ezc_generator.SetPattern(*p);
|
ezc_generator.SetPattern(*p);
|
||||||
|
|
||||||
if( config->allow_ezc_out_in_executable_items )
|
if( config->allow_ezc_frames_in_executable_items )
|
||||||
ezc_generator.Generate(item_run_content, cur->request->out_streams);
|
ezc_generator.Generate(item_run_content, cur->request->out_streams);
|
||||||
else
|
else
|
||||||
ezc_generator.Generate(item_run_content);
|
ezc_generator.Generate(item_run_content);
|
||||||
|
@ -742,7 +742,7 @@ void item_tab_run(Info & i)
|
||||||
InitGenerator(ezc_generator);
|
InitGenerator(ezc_generator);
|
||||||
ezc_generator.SetPattern(*p);
|
ezc_generator.SetPattern(*p);
|
||||||
|
|
||||||
if( config->allow_ezc_out_in_executable_items )
|
if( config->allow_ezc_frames_in_executable_items )
|
||||||
ezc_generator.Generate(item_run_content, cur->request->out_streams);
|
ezc_generator.Generate(item_run_content, cur->request->out_streams);
|
||||||
else
|
else
|
||||||
ezc_generator.Generate(item_run_content);
|
ezc_generator.Generate(item_run_content);
|
||||||
|
|
Loading…
Reference in New Issue