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:
@@ -37,13 +37,10 @@
|
||||
#include "core/misc.h"
|
||||
|
||||
|
||||
namespace Winix
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
{
|
||||
|
||||
Env::Env()
|
||||
{
|
||||
fun.url = L"env";
|
||||
@@ -68,15 +65,15 @@ return true;
|
||||
|
||||
|
||||
|
||||
bool Env::Parse(const std::wstring & env_str)
|
||||
bool Env::parse(const std::wstring & env_str)
|
||||
{
|
||||
return (conf_parser.parse_space(env_str, space) == pt::SpaceParser::ok);
|
||||
}
|
||||
|
||||
|
||||
bool Env::EditAdminEnv(const std::wstring & env_str)
|
||||
bool Env::edit_admin_env(const std::wstring & env_str)
|
||||
{
|
||||
if( Parse(env_str) )
|
||||
if( parse(env_str) )
|
||||
{
|
||||
user_wrapper.user->admin_env = space;
|
||||
|
||||
@@ -102,9 +99,9 @@ return false;
|
||||
}
|
||||
|
||||
|
||||
bool Env::EditEnv(const std::wstring & env_str)
|
||||
bool Env::edit_env(const std::wstring & env_str)
|
||||
{
|
||||
if( Parse(env_str) )
|
||||
if( parse(env_str) )
|
||||
{
|
||||
user_wrapper.user->env = space;
|
||||
|
||||
@@ -131,7 +128,7 @@ return false;
|
||||
|
||||
|
||||
|
||||
void Env::SaveEnv()
|
||||
void Env::save_env()
|
||||
{
|
||||
const std::wstring & env_str = cur->request->PostVar(L"envvar");
|
||||
bool status = false;
|
||||
@@ -140,27 +137,29 @@ void Env::SaveEnv()
|
||||
{
|
||||
if( cur->session->puser->is_super_user )
|
||||
{
|
||||
status = EditAdminEnv(env_str);
|
||||
status = edit_admin_env(env_str);
|
||||
|
||||
if( status )
|
||||
{
|
||||
//slog << loginfo << T(L"env_admin_changed_successfully") << logend;
|
||||
redirect_if_needed();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = EditEnv(env_str);
|
||||
status = edit_env(env_str);
|
||||
|
||||
if( status )
|
||||
{
|
||||
//slog << loginfo << T(L"env_changed_successfully") << logend;
|
||||
redirect_if_needed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Env::RegisterModels()
|
||||
void Env::register_models()
|
||||
{
|
||||
cur->request->models.Add(L"users", system->users);
|
||||
cur->request->models.Add(L"env_user", user_wrapper);
|
||||
@@ -192,7 +191,7 @@ void Env::make_post()
|
||||
{
|
||||
if( user_wrapper.user )
|
||||
{
|
||||
SaveEnv();
|
||||
save_env();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -201,7 +200,7 @@ void Env::make_post()
|
||||
}
|
||||
}
|
||||
|
||||
RegisterModels();
|
||||
register_models();
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +209,7 @@ void Env::make_get()
|
||||
user_wrapper.user = cur->session->puser;
|
||||
user_wrapper.set_connector(model_connector);
|
||||
|
||||
RegisterModels();
|
||||
register_models();
|
||||
}
|
||||
|
||||
|
||||
@@ -223,6 +222,3 @@ void Env::clear()
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
|
Reference in New Issue
Block a user