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:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2014, Tomasz Sowa
|
||||
* Copyright (c) 2008-2024, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -36,14 +36,10 @@
|
||||
#include "functions.h"
|
||||
|
||||
|
||||
|
||||
namespace Winix
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
{
|
||||
|
||||
Ckeditor::Ckeditor()
|
||||
{
|
||||
fun.url = L"ckeditor";
|
||||
@@ -57,7 +53,16 @@ void Ckeditor::init()
|
||||
|
||||
bool Ckeditor::has_access()
|
||||
{
|
||||
return functions->fun_emacs.has_access();
|
||||
FunctionBase * emacs = functions->Find(L"emacs");
|
||||
|
||||
if( emacs )
|
||||
{
|
||||
return emacs->has_access();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,13 +78,20 @@ void Ckeditor::make_get()
|
||||
|
||||
void Ckeditor::make_post()
|
||||
{
|
||||
functions->fun_emacs.make_post();
|
||||
}
|
||||
FunctionBase * emacs = functions->Find(L"emacs");
|
||||
|
||||
if( emacs )
|
||||
{
|
||||
emacs->make_post();
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log2 << "Ckeditor: I cannot save your content, there is no emacs function available" << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||
* Copyright (c) 2011-2024, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -37,11 +37,8 @@
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
namespace Winix
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
@@ -50,16 +47,15 @@ class Ckeditor : public FunctionBase
|
||||
public:
|
||||
|
||||
Ckeditor();
|
||||
void init();
|
||||
bool has_access();
|
||||
void make_get();
|
||||
void make_post();
|
||||
|
||||
void init() override;
|
||||
bool has_access() override;
|
||||
void make_get() override;
|
||||
void make_post() override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
#endif
|
||||
|
@@ -37,14 +37,10 @@
|
||||
#include "functions.h"
|
||||
|
||||
|
||||
|
||||
namespace Winix
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
{
|
||||
|
||||
Emacs::Emacs()
|
||||
{
|
||||
fun.url = L"emacs";
|
||||
@@ -128,13 +124,30 @@ return WINIX_NOTIFY_CODE_ADD;
|
||||
}
|
||||
|
||||
|
||||
// IMPROVEME
|
||||
// make some kind of utils and put this method there
|
||||
// because this method is used from ckeditor and other editors too
|
||||
void Emacs::push_url_to_current_function(const wchar_t * local_url)
|
||||
{
|
||||
if( cur->request->is_htmx_request )
|
||||
{
|
||||
pt::WTextStream url;
|
||||
|
||||
if( cur->request->IsParam(L"tabs") )
|
||||
prepare_current_function(L"/tabs", url);
|
||||
else
|
||||
prepare_current_function(nullptr, url);
|
||||
|
||||
cur->request->out_headers.add(Header::hx_push_url, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* this make_post() is used from Ckeditor, Tinymce and Nicedit as well
|
||||
*/
|
||||
void Emacs::make_post()
|
||||
{
|
||||
bool status = false;
|
||||
bool adding = !cur->request->is_item;
|
||||
std::wstring old_url;
|
||||
|
||||
if( !adding )
|
||||
old_url = cur->request->item.url;
|
||||
@@ -163,38 +176,29 @@ void Emacs::make_post()
|
||||
}
|
||||
|
||||
cur->request->status = status ? WINIX_ERR_OK : WINIX_ERR_PERMISSION_DENIED;
|
||||
answer.add(L"status", status);
|
||||
|
||||
if( status )
|
||||
{
|
||||
if( adding )
|
||||
{
|
||||
system->RedirectToLastFunction(nullptr, false);
|
||||
answer.add(L"redirect_to", cur->request->redirect_to);
|
||||
|
||||
if( cur->request->container_type != Request::ContainerType::container_raw )
|
||||
{
|
||||
cur->request->redirect_to.clear();
|
||||
}
|
||||
}
|
||||
|
||||
functions->CheckSpecialFile(cur->request->item);
|
||||
bool was_url_changed = (adding || cur->request->item.url != old_url);
|
||||
redirect_if_needed(was_url_changed);
|
||||
}
|
||||
|
||||
cur->request->models.Add(L"answer", answer);
|
||||
if( adding )
|
||||
{
|
||||
// App::AddDefaultModels() is called before make_post() and didn't see the item yet
|
||||
cur->request->models.Add(L"item", cur->request->item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Emacs::clear()
|
||||
{
|
||||
answer.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
|
||||
|
@@ -37,11 +37,8 @@
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
namespace Winix
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
@@ -50,25 +47,21 @@ class Emacs : public FunctionBase
|
||||
public:
|
||||
|
||||
Emacs();
|
||||
bool has_access();
|
||||
void make_post();
|
||||
bool has_access() override;
|
||||
void make_post() override;
|
||||
|
||||
private:
|
||||
|
||||
bool has_emacs_access(const Item & item);
|
||||
void clear();
|
||||
void clear() override;
|
||||
|
||||
int notify_code_edit();
|
||||
int notify_code_add();
|
||||
|
||||
std::wstring old_url;
|
||||
pt::Space answer;
|
||||
void push_url_to_current_function(const wchar_t * local_url = nullptr) override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
#endif
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -40,11 +40,7 @@
|
||||
#include "space/spaceparser.h"
|
||||
|
||||
|
||||
namespace Winix
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
@@ -54,10 +50,10 @@ public:
|
||||
|
||||
Env();
|
||||
|
||||
bool has_access();
|
||||
void make_post();
|
||||
void make_get();
|
||||
void clear();
|
||||
bool has_access() override;
|
||||
void make_post() override;
|
||||
void make_get() override;
|
||||
void clear() override;
|
||||
|
||||
|
||||
private:
|
||||
@@ -66,13 +62,13 @@ private:
|
||||
pt::Space space;
|
||||
UserWrapper user_wrapper;
|
||||
|
||||
bool EditAdminEnv(const std::wstring & env_str);
|
||||
bool EditEnv(const std::wstring & env_str);
|
||||
bool edit_admin_env(const std::wstring & env_str);
|
||||
bool edit_env(const std::wstring & env_str);
|
||||
|
||||
bool Parse(const std::wstring & env_str);
|
||||
void SaveEnv();
|
||||
bool parse(const std::wstring & env_str);
|
||||
void save_env();
|
||||
|
||||
void RegisterModels();
|
||||
void register_models();
|
||||
|
||||
|
||||
};
|
||||
@@ -80,6 +76,4 @@ private:
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
#endif
|
||||
|
@@ -659,6 +659,115 @@ std::wstring FunctionBase::prepare_doc_url(const std::wstring & local_url)
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::prepare_current_dir(const wchar_t * local_url, pt::WTextStream & url)
|
||||
{
|
||||
prepare_doc_url(nullptr, url);
|
||||
|
||||
for(Item * dir : cur->request->dir_tab)
|
||||
{
|
||||
if( !dir->url.empty() )
|
||||
url << L"/" << dir->url;
|
||||
}
|
||||
|
||||
if( local_url )
|
||||
{
|
||||
url << local_url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::prepare_current_dir(const wchar_t * local_url, std::wstring & url)
|
||||
{
|
||||
pt::WTextStream stream;
|
||||
prepare_current_dir(local_url, stream);
|
||||
stream.to_str(url);
|
||||
}
|
||||
|
||||
|
||||
std::wstring FunctionBase::prepare_current_dir(const wchar_t * local_url)
|
||||
{
|
||||
std::wstring url;
|
||||
prepare_current_dir(local_url, url);
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
std::wstring FunctionBase::prepare_current_dir(const std::wstring & local_url)
|
||||
{
|
||||
return prepare_current_dir(local_url.c_str());
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::prepare_current_item(const wchar_t * local_url, pt::WTextStream & url)
|
||||
{
|
||||
prepare_current_dir(nullptr, url);
|
||||
|
||||
if( cur->request->is_item )
|
||||
url << L"/" << cur->request->item.url;
|
||||
|
||||
if( local_url )
|
||||
{
|
||||
url << local_url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::prepare_current_item(const wchar_t * local_url, std::wstring & url)
|
||||
{
|
||||
pt::WTextStream stream;
|
||||
prepare_current_item(local_url, stream);
|
||||
stream.to_str(url);
|
||||
}
|
||||
|
||||
|
||||
std::wstring FunctionBase::prepare_current_item(const wchar_t * local_url)
|
||||
{
|
||||
std::wstring url;
|
||||
prepare_current_item(local_url, url);
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
std::wstring FunctionBase::prepare_current_item(const std::wstring & local_url)
|
||||
{
|
||||
return prepare_current_item(local_url.c_str());
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::prepare_current_function(const wchar_t * local_url, pt::WTextStream & url)
|
||||
{
|
||||
prepare_current_item(nullptr, url);
|
||||
url << L"/" << fun.url;
|
||||
|
||||
if( local_url )
|
||||
{
|
||||
url << local_url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::prepare_current_function(const wchar_t * local_url, std::wstring & url)
|
||||
{
|
||||
pt::WTextStream stream;
|
||||
prepare_current_function(local_url, stream);
|
||||
stream.to_str(url);
|
||||
}
|
||||
|
||||
|
||||
std::wstring FunctionBase::prepare_current_function(const wchar_t * local_url)
|
||||
{
|
||||
std::wstring url;
|
||||
prepare_current_function(local_url, url);
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
std::wstring FunctionBase::prepare_current_function(const std::wstring & local_url)
|
||||
{
|
||||
return prepare_current_function(local_url.c_str());
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::redirect_to(const wchar_t * url, bool append_domain)
|
||||
{
|
||||
if( cur->request->is_htmx_request )
|
||||
@@ -674,16 +783,19 @@ void FunctionBase::redirect_to(const wchar_t * url, bool append_domain)
|
||||
}
|
||||
else
|
||||
{
|
||||
if( append_domain )
|
||||
if( cur->request->container_type == Request::ContainerType::container_raw )
|
||||
{
|
||||
prepare_doc_url(url, cur->request->redirect_to);
|
||||
}
|
||||
else
|
||||
{
|
||||
cur->request->redirect_to = url;
|
||||
}
|
||||
if( append_domain )
|
||||
{
|
||||
prepare_doc_url(url, cur->request->redirect_to);
|
||||
}
|
||||
else
|
||||
{
|
||||
cur->request->redirect_to = url;
|
||||
}
|
||||
|
||||
cur->request->redirect_type = Header::status_303_see_other;
|
||||
cur->request->redirect_type = Header::status_303_see_other;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -899,8 +1011,93 @@ void FunctionBase::update_content(const wchar_t * frame, const wchar_t * dom_tar
|
||||
|
||||
void FunctionBase::close_modal_dialogs()
|
||||
{
|
||||
pt::Space & trigger = cur->request->out_headers.get_add_space(Header::hx_trigger);
|
||||
trigger.add(L"winix:closedialogs", true);
|
||||
if( cur->request->is_htmx_request )
|
||||
{
|
||||
pt::Space & trigger = cur->request->out_headers.get_add_space(Header::hx_trigger);
|
||||
trigger.add(L"winix:closedialogs", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::push_url_to_current_dir(const wchar_t * local_url)
|
||||
{
|
||||
if( cur->request->is_htmx_request )
|
||||
{
|
||||
pt::WTextStream url;
|
||||
prepare_current_dir(local_url, url);
|
||||
cur->request->out_headers.add(Header::hx_push_url, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::push_url_to_current_item(const wchar_t * local_url)
|
||||
{
|
||||
if( cur->request->is_htmx_request )
|
||||
{
|
||||
pt::WTextStream url;
|
||||
prepare_current_item(local_url, url);
|
||||
cur->request->out_headers.add(Header::hx_push_url, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::push_url_to_current_function(const wchar_t * local_url)
|
||||
{
|
||||
if( cur->request->is_htmx_request )
|
||||
{
|
||||
pt::WTextStream url;
|
||||
prepare_current_function(local_url, url);
|
||||
cur->request->out_headers.add(Header::hx_push_url, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::redirect_to_current_dir()
|
||||
{
|
||||
pt::WTextStream url;
|
||||
prepare_current_dir(nullptr, url);
|
||||
redirect_to(url, false);
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::redirect_to_current_item()
|
||||
{
|
||||
pt::WTextStream url;
|
||||
prepare_current_item(nullptr, url);
|
||||
redirect_to(url, false);
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::redirect_to_current_function()
|
||||
{
|
||||
pt::WTextStream url;
|
||||
prepare_current_function(nullptr, url);
|
||||
redirect_to(url, false);
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::redirect_if_needed(bool was_url_changed)
|
||||
{
|
||||
if( cur->request->container_type == Request::ContainerType::container_raw )
|
||||
{
|
||||
/* save_and_close is not used at the moment anywhere in templates */
|
||||
if( cur->request->post_in.has_key(L"save_and_close") )
|
||||
{
|
||||
redirect_to_current_item();
|
||||
}
|
||||
else
|
||||
if( was_url_changed )
|
||||
{
|
||||
if( cur->request->is_htmx_request )
|
||||
{
|
||||
push_url_to_current_function();
|
||||
}
|
||||
else
|
||||
{
|
||||
system->RedirectToLastFunction(nullptr, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -185,6 +185,21 @@ public:
|
||||
virtual std::wstring prepare_doc_url(const wchar_t * local_url = nullptr);
|
||||
virtual std::wstring prepare_doc_url(const std::wstring & local_url);
|
||||
|
||||
virtual void prepare_current_dir(const wchar_t * local_url, pt::WTextStream & url);
|
||||
virtual void prepare_current_dir(const wchar_t * local_url, std::wstring & url);
|
||||
virtual std::wstring prepare_current_dir(const wchar_t * local_url = nullptr);
|
||||
virtual std::wstring prepare_current_dir(const std::wstring & local_url);
|
||||
|
||||
virtual void prepare_current_item(const wchar_t * local_url, pt::WTextStream & url);
|
||||
virtual void prepare_current_item(const wchar_t * local_url, std::wstring & url);
|
||||
virtual std::wstring prepare_current_item(const wchar_t * local_url);
|
||||
virtual std::wstring prepare_current_item(const std::wstring & local_url);
|
||||
|
||||
virtual void prepare_current_function(const wchar_t * local_url, pt::WTextStream & url);
|
||||
virtual void prepare_current_function(const wchar_t * local_url, std::wstring & url);
|
||||
virtual std::wstring prepare_current_function(const wchar_t * local_url);
|
||||
virtual std::wstring prepare_current_function(const std::wstring & local_url);
|
||||
|
||||
virtual void redirect_to(const wchar_t * url, bool append_domain = true);
|
||||
virtual void redirect_to(const std::wstring & url, bool append_domain = true);
|
||||
virtual void redirect_to(const pt::WTextStream & url, bool append_domain = true);
|
||||
@@ -211,6 +226,16 @@ public:
|
||||
|
||||
virtual void close_modal_dialogs();
|
||||
|
||||
virtual void push_url_to_current_dir(const wchar_t * local_url = nullptr);
|
||||
virtual void push_url_to_current_item(const wchar_t * local_url = nullptr);
|
||||
virtual void push_url_to_current_function(const wchar_t * local_url = nullptr);
|
||||
|
||||
virtual void redirect_to_current_dir();
|
||||
virtual void redirect_to_current_item();
|
||||
virtual void redirect_to_current_function();
|
||||
|
||||
virtual void redirect_if_needed(bool was_url_changed = false);
|
||||
|
||||
|
||||
/*
|
||||
* DEPRECATED
|
||||
|
@@ -36,13 +36,10 @@
|
||||
#include "core/log.h"
|
||||
|
||||
|
||||
namespace Winix
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
{
|
||||
|
||||
Meta::Meta()
|
||||
{
|
||||
fun.url = L"meta";
|
||||
@@ -60,7 +57,7 @@ bool Meta::has_access()
|
||||
|
||||
|
||||
|
||||
bool Meta::Parse(const std::wstring & meta_str)
|
||||
bool Meta::parse(const std::wstring & meta_str)
|
||||
{
|
||||
return (conf_parser.parse_space(meta_str, space) == pt::SpaceParser::ok);
|
||||
}
|
||||
@@ -68,9 +65,9 @@ bool Meta::Parse(const std::wstring & meta_str)
|
||||
|
||||
|
||||
|
||||
bool Meta::EditAdminMeta(Item & item, const std::wstring & meta_str)
|
||||
bool Meta::edit_admin_meta(Item & item, const std::wstring & meta_str)
|
||||
{
|
||||
if( Parse(meta_str) )
|
||||
if( parse(meta_str) )
|
||||
{
|
||||
item.propagate_connector();
|
||||
item.item_content.admin_meta = space;
|
||||
@@ -99,9 +96,9 @@ return false;
|
||||
|
||||
|
||||
|
||||
bool Meta::EditMeta(Item & item, const std::wstring & meta_str)
|
||||
bool Meta::edit_meta(Item & item, const std::wstring & meta_str)
|
||||
{
|
||||
if( Parse(meta_str) )
|
||||
if( parse(meta_str) )
|
||||
{
|
||||
item.propagate_connector();
|
||||
item.item_content.meta = space;
|
||||
@@ -130,7 +127,7 @@ return false;
|
||||
|
||||
|
||||
|
||||
void Meta::ChangeAdminMeta()
|
||||
void Meta::change_admin_meta()
|
||||
{
|
||||
// IMPROVE ME we need to show an error msg if the user is not an admin
|
||||
|
||||
@@ -138,23 +135,23 @@ void Meta::ChangeAdminMeta()
|
||||
{
|
||||
const std::wstring & meta_str = cur->request->PostVar(L"itemmeta");
|
||||
|
||||
if( EditAdminMeta(*cur->request->last_item, meta_str) )
|
||||
if( edit_admin_meta(*cur->request->last_item, meta_str) )
|
||||
{
|
||||
system->RedirectToLastItem();
|
||||
redirect_if_needed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Meta::ChangeMeta()
|
||||
void Meta::change_meta()
|
||||
{
|
||||
if( system->HasWriteAccess(*cur->request->last_item) )
|
||||
{
|
||||
const std::wstring & meta_str = cur->request->PostVar(L"itemmeta");
|
||||
|
||||
if( EditMeta(*cur->request->last_item, meta_str) )
|
||||
if( edit_meta(*cur->request->last_item, meta_str) )
|
||||
{
|
||||
system->RedirectToLastItem();
|
||||
redirect_if_needed();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -164,9 +161,9 @@ void Meta::ChangeMeta()
|
||||
void Meta::make_post()
|
||||
{
|
||||
if( cur->request->IsParam(L"a") )
|
||||
ChangeAdminMeta();
|
||||
change_admin_meta();
|
||||
else
|
||||
ChangeMeta();
|
||||
change_meta();
|
||||
}
|
||||
|
||||
|
||||
@@ -174,5 +171,3 @@ void Meta::make_post()
|
||||
} // namespace
|
||||
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
|
@@ -38,11 +38,8 @@
|
||||
#include "functionbase.h"
|
||||
#include "space/spaceparser.h"
|
||||
|
||||
namespace Winix
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
@@ -52,26 +49,25 @@ public:
|
||||
|
||||
Meta();
|
||||
|
||||
bool has_access();
|
||||
void make_post();
|
||||
bool has_access() override;
|
||||
void make_post() override;
|
||||
|
||||
bool EditAdminMeta(Item & item, const std::wstring & meta_str);
|
||||
bool EditMeta(Item & item, const std::wstring & meta_str);
|
||||
|
||||
private:
|
||||
|
||||
pt::SpaceParser conf_parser;
|
||||
pt::Space space;
|
||||
|
||||
bool Parse(const std::wstring & meta_str);
|
||||
void ChangeAdminMeta();
|
||||
void ChangeMeta();
|
||||
bool edit_admin_meta(Item & item, const std::wstring & meta_str);
|
||||
bool edit_meta(Item & item, const std::wstring & meta_str);
|
||||
|
||||
bool parse(const std::wstring & meta_str);
|
||||
void change_admin_meta();
|
||||
void change_meta();
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
#endif
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||
* Copyright (c) 2011-2024, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -36,14 +36,10 @@
|
||||
#include "functions.h"
|
||||
|
||||
|
||||
|
||||
namespace Winix
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
{
|
||||
|
||||
Nicedit::Nicedit()
|
||||
{
|
||||
fun.url = L"nicedit";
|
||||
@@ -52,19 +48,36 @@ Nicedit::Nicedit()
|
||||
|
||||
bool Nicedit::has_access()
|
||||
{
|
||||
return functions->fun_emacs.has_access();
|
||||
FunctionBase * emacs = functions->Find(L"emacs");
|
||||
|
||||
if( emacs )
|
||||
{
|
||||
return emacs->has_access();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Nicedit::make_post()
|
||||
{
|
||||
functions->fun_emacs.make_post();
|
||||
}
|
||||
FunctionBase * emacs = functions->Find(L"emacs");
|
||||
|
||||
if( emacs )
|
||||
{
|
||||
emacs->make_post();
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log2 << "Nicedit: I cannot save your content, there is no emacs function available" << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011-2014, Tomasz Sowa
|
||||
* Copyright (c) 2011-2024, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -37,11 +37,8 @@
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
namespace Winix
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
@@ -50,14 +47,13 @@ class Nicedit : public FunctionBase
|
||||
public:
|
||||
|
||||
Nicedit();
|
||||
bool has_access();
|
||||
void make_post();
|
||||
|
||||
bool has_access() override;
|
||||
void make_post() override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
#endif
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2021, Tomasz Sowa
|
||||
* Copyright (c) 2008-2024, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -36,13 +36,10 @@
|
||||
#include "functions.h"
|
||||
|
||||
|
||||
namespace Winix
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
{
|
||||
|
||||
Tinymce::Tinymce()
|
||||
{
|
||||
fun.url = L"tinymce";
|
||||
@@ -57,7 +54,16 @@ void Tinymce::init()
|
||||
|
||||
bool Tinymce::has_access()
|
||||
{
|
||||
return functions->fun_emacs.has_access();
|
||||
FunctionBase * emacs = functions->Find(L"emacs");
|
||||
|
||||
if( emacs )
|
||||
{
|
||||
return emacs->has_access();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,10 +77,18 @@ void Tinymce::make_get()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Tinymce::make_post()
|
||||
{
|
||||
functions->fun_emacs.make_post();
|
||||
FunctionBase * emacs = functions->Find(L"emacs");
|
||||
|
||||
if( emacs )
|
||||
{
|
||||
emacs->make_post();
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log2 << "Tinymce: I cannot save your content, there is no emacs function available" << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,5 +96,3 @@ void Tinymce::make_post()
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||
* Copyright (c) 2010-2024, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -37,11 +37,8 @@
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
namespace Winix
|
||||
{
|
||||
|
||||
|
||||
namespace Fun
|
||||
namespace Winix::Fun
|
||||
{
|
||||
|
||||
|
||||
@@ -50,16 +47,14 @@ class Tinymce : public FunctionBase
|
||||
public:
|
||||
|
||||
Tinymce();
|
||||
void init();
|
||||
bool has_access();
|
||||
void make_get();
|
||||
void make_post();
|
||||
void init() override;
|
||||
bool has_access() override;
|
||||
void make_get() override;
|
||||
void make_post() override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
} // namespace Winix
|
||||
|
||||
#endif
|
||||
|
@@ -88,7 +88,8 @@ coreStyles_underline :
|
||||
|
||||
//config.allowedContent : true, // allowes all
|
||||
disallowedContent : 'p(western)', // from copying from Office
|
||||
extraAllowedContent : 'aside caption figure figcaption article footer header section div (*); ul(*); ol(*); h1(*); h2(*); h3(*); h4(*); h5(*); h6(*); p(*); table(*); tr(*); td(*);'
|
||||
extraAllowedContent : 'aside caption figure figcaption article footer header section div (*); ul(*); ol(*); h1(*); h2(*); h3(*); h4(*); h5(*); h6(*); p(*); table(*); tr(*); td(*);',
|
||||
versionCheck: false
|
||||
|
||||
});
|
||||
|
||||
@@ -167,7 +168,8 @@ coreStyles_underline :
|
||||
|
||||
//config.allowedContent : true, // allowes all
|
||||
disallowedContent : 'p(western)', // from copying from Office
|
||||
extraAllowedContent : 'aside caption figure figcaption article footer header section (*); ul(*); h1(*); h2(*); p(*)'
|
||||
extraAllowedContent : 'aside caption figure figcaption article footer header section (*); ul(*); h1(*); h2(*); p(*)',
|
||||
versionCheck: false
|
||||
|
||||
});
|
||||
|
||||
|
@@ -1,7 +1,18 @@
|
||||
<div class="winix">
|
||||
|
||||
[if request.is_item]<h1>{edit}</h1>[else]<h1>{add}</h1>[end]
|
||||
[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"]]]
|
||||
@@ -15,22 +26,25 @@
|
||||
<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 "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]
|
||||
[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" data-winix-post-name="itemcontent">[item.content.print_content]</div>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
@@ -38,56 +52,51 @@
|
||||
<input id="contenttype" type="hidden" name="contenttype" value="2">
|
||||
</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 winix-ckeditor-status">
|
||||
[frame "ckeditor"]
|
||||
|
||||
<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 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">
|
||||
<div class="uk-form-controls uk-inline">
|
||||
|
||||
<button class="uk-button uk-button-primary winix_update_button"
|
||||
data-winix-function-path="[doc_base_url][dir][if request.is_item][item.url]/[end]ckeditor"
|
||||
data-winix-content-ckeditor-instances="winix-editor-content"
|
||||
data-winix-content-inputs="winix_url_id,winix_title_id,contenttype"
|
||||
data-winix-progressbar-id="winix-editor-progressbar"
|
||||
data-winix-messages-status-success-id="winix-editor-messages-status-success"
|
||||
data-winix-messages-status-error-id="winix-editor-messages-status-error"
|
||||
<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')"
|
||||
>
|
||||
{ckeditor_update_button}
|
||||
</button>
|
||||
|
||||
<div id="winix-editor-progressbar" class="uk-invisible uk-position-center-right-out uk-margin-small-left">
|
||||
<img src="[doc_base_url_common]/progressbars/progressbar_fading_lines_16x16.gif" alt="{ckeditor_update_progressbar_img_alt}">
|
||||
<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>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="winix-editor-messages-status-success" class="winix-editor-messages-status-success">
|
||||
</div>
|
||||
|
||||
<div id="winix-editor-messages-status-error" class="winix-editor-messages-status-error">
|
||||
</div>
|
||||
|
||||
[end]
|
||||
</div>
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
<input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]">
|
||||
[end]
|
||||
|
||||
[include "ckeditor.html"]
|
||||
[ckeditor_old_browsers_support]
|
||||
|
@@ -1,10 +1,22 @@
|
||||
<div class="winix">
|
||||
|
||||
[if request.is_item]<h1>{edit}</h1>[else]<h1>{add}</h1>[end]
|
||||
|
||||
[frame "emacs"]
|
||||
<h1 id="winix_header_id" [if winix_frame_is "emacs"]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]emacs">
|
||||
<form
|
||||
action="[doc_base_url][dir][if request.is_item][item.url]/[end]emacs/[if winix_function_param_is "tabs"]/tabs[end]"
|
||||
method="post"
|
||||
class="uk-form-stacked"
|
||||
>
|
||||
|
||||
<div class="uk-margin">
|
||||
<label class="uk-form-label" for="winix_title_id">{title}</label>
|
||||
@@ -16,41 +28,59 @@
|
||||
<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 "emacs"]
|
||||
<input class="uk-input" id="winix_url_id" type="text" name="url" value="[item.url]" [if winix_frame_is "emacs"]hx-swap-oob="true"[end]>
|
||||
[end]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
[include "fun_emacs_post.html"]
|
||||
|
||||
[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.guest_name]">
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-margin winix-emacs-status">
|
||||
[frame "emacs"]
|
||||
|
||||
<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">
|
||||
[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="submit"
|
||||
hx-on:click="event.preventDefault(); winix_update_from_codemirror(this, '[doc_base_url][dir][if request.is_item][item.url]/[end]emacs/frame:emacs', '.winix-emacs-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>
|
||||
</div>
|
||||
|
||||
[include "antispam.html"]
|
||||
[end]
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
<div class="uk-form-controls">
|
||||
<input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]">
|
||||
[end]
|
||||
</div>
|
||||
[end]
|
||||
|
||||
<div class="uk-margin uk-form-controls">
|
||||
<input class="uk-button uk-button-primary" type="submit" value="[if request.is_item]{change}[else]{add}[end]">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
@@ -15,31 +15,10 @@
|
||||
[# CodeMirror doesn't work correctly inside fieldset tag -- horizontal scroll is broken]
|
||||
|
||||
|
||||
<div class="uk-flex uk-child-width-1-2">
|
||||
[if not [winix_function_param_is "tabs"]]
|
||||
|
||||
<textarea
|
||||
style="height: 1000px"
|
||||
class="uk-textareaa"
|
||||
[if request.is_item]autofocus [end]
|
||||
id="winix_content_id"
|
||||
rows="[if winix_function_is "upload"]7[else][if mount_type_is "cms"]300[else]300[end][end]"
|
||||
cols="60" name="itemcontent">[item.content.content_raw]</textarea>
|
||||
<div class="uk-flex uk-child-width-1-1" uk-height-match> [# uk-child-width-1-1 or uk-child-width-1-2 class will be added by js]
|
||||
|
||||
<div class="uk-margin-left" id="winix_output_preview">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
[if false]
|
||||
<ul uk-tab>
|
||||
<li><a href="#">{upload_content_edit}</a></li>
|
||||
<li><a href="#">{upload_content_preview}</a></li>
|
||||
</ul>
|
||||
|
||||
<ul class="uk-switcher">
|
||||
|
||||
<li>
|
||||
<textarea
|
||||
style="height: 1000px"
|
||||
class="uk-textarea"
|
||||
@@ -47,15 +26,38 @@
|
||||
id="winix_content_id"
|
||||
rows="[if winix_function_is "upload"]7[else][if mount_type_is "cms"]300[else]300[end][end]"
|
||||
cols="60" name="itemcontent">[item.content.content_raw]</textarea>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<div class="uk-margin-left" id="winix_output_preview">
|
||||
<div class="uk-margin-left" id="winix_output_preview" style="display: none;">
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
[end]
|
||||
|
||||
</div>
|
||||
|
||||
[else]
|
||||
|
||||
<ul uk-tab>
|
||||
<li><a href="#">{form_emacs_content_edit}</a></li>
|
||||
<li><a href="#">{form_emacs_content_preview}</a></li>
|
||||
</ul>
|
||||
|
||||
<ul class="uk-switcher">
|
||||
|
||||
<li>
|
||||
<textarea
|
||||
style="height: 1000px"
|
||||
class="uk-textarea"
|
||||
[if request.is_item]autofocus [end]
|
||||
id="winix_content_id"
|
||||
rows="[if winix_function_is "upload"]7[else][if mount_type_is "cms"]300[else]300[end][end]"
|
||||
cols="60" name="itemcontent">[item.content.content_raw]</textarea>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<div id="winix_output_preview">
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
[end]
|
||||
|
||||
<input type="hidden" id="winix_content_parsed_id" value="" name="itemcontent_parsed">
|
||||
|
||||
@@ -64,22 +66,30 @@
|
||||
|
||||
|
||||
<div class="uk-margin">
|
||||
<label class="uk-form-label" for="winix_contenttype_id">{form_emacs_content_type}</label>
|
||||
<select class="uk-select" name="contenttype" id="winix_contenttype_id">
|
||||
<option[if item.content.type_is "text"] selected[end] value="0">{form_emacs_content_type_text}</option>
|
||||
<option[if item.content.type_is "formatted text"] selected[end] value="1">{form_emacs_content_type_formatted_text}</option>
|
||||
[if user_can_use_html]<option[if item.content.type_is "html"] selected[end] value="2">{form_emacs_content_type_html}</option>[end]
|
||||
[if user_can_use_html]<option[if item.content.type_is "markdown"] selected[end] value="5">{form_emacs_content_type_markdown}</option>[end]
|
||||
[if user_can_use_other]<option[if item.content.type_is "other"] selected[end] value="4">{form_emacs_content_type_other}</option>[end]
|
||||
</select>
|
||||
|
||||
|
||||
[if false]
|
||||
[if user_can_use_bbcode]<option[if item.content.type_is "bbcode"] selected[end] value="3">{form_emacs_content_type_bbcode}</option>[end]
|
||||
[end]
|
||||
|
||||
<label class="uk-form-label" for="winix_contenttype_id">{form_emacs_content_type}</label>
|
||||
<select class="uk-select" name="contenttype" id="winix_contenttype_id">
|
||||
<option[if item.content.type_is "text"] selected[end] value="0">{form_emacs_content_type_text}</option>
|
||||
<option[if item.content.type_is "formatted text"] selected[end] value="1">{form_emacs_content_type_formatted_text}</option>
|
||||
[if user_can_use_html]<option[if item.content.type_is "html"] selected[end] value="2">{form_emacs_content_type_html}</option>[end]
|
||||
[if user_can_use_html]<option[if item.content.type_is "markdown"] selected[end] value="5">{form_emacs_content_type_markdown}</option>[end]
|
||||
[if user_can_use_other]<option[if item.content.type_is "other"] selected[end] value="4">{form_emacs_content_type_other}</option>[end]
|
||||
</select>
|
||||
|
||||
[if false]
|
||||
[if user_can_use_bbcode]<option[if item.content.type_is "bbcode"] selected[end] value="3">{form_emacs_content_type_bbcode}</option>[end]
|
||||
[end]
|
||||
</div>
|
||||
|
||||
|
||||
[if not [winix_function_param_is "tabs"]]
|
||||
<div class="uk-margin">
|
||||
<label class="uk-form-label" for="winix_viewtype_id">{form_emacs_view_type}</label>
|
||||
<select class="uk-select" id="winix_viewtype_id">
|
||||
<option value="1" selected>{form_emacs_view_type_one_panel}</option>
|
||||
<option value="2">{form_emacs_view_type_two_panels}</option>
|
||||
</select>
|
||||
</div>
|
||||
[end]
|
||||
|
||||
|
||||
|
||||
|
@@ -62,13 +62,30 @@
|
||||
|
||||
<input type="hidden" name="userid" value="[env_user.user.id]">
|
||||
|
||||
<div class="uk-margin">
|
||||
<input class="uk-button uk-button-primary" type="submit" value="{change}">
|
||||
</div>
|
||||
<div class="uk-margin winix-env-status">
|
||||
[frame "env"]
|
||||
|
||||
[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-medium">
|
||||
<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="submit"
|
||||
hx-on:click="event.preventDefault(); winix_update_from_codemirror(this, '[doc_base_url][dir][if request.is_item][item.url]/[end]env[if winix_function_param_is "a"]/a[end]/frame:env', '.winix-env-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>
|
||||
|
||||
|
@@ -9,7 +9,11 @@
|
||||
</h1>
|
||||
|
||||
|
||||
<form class="uk-form-stacked" method="post" action="[doc_base_url][dir][if request.is_item][item.url]/[end]meta[if winix_function_param_is "a"]/a[end]">
|
||||
<form
|
||||
action="[doc_base_url][dir][if request.is_item][item.url]/[end]meta[if winix_function_param_is "a"]/a[end]"
|
||||
method="post"
|
||||
class="uk-form-stacked"
|
||||
>
|
||||
|
||||
<div class="uk-margin">
|
||||
<label class="uk-form-label" for="winix_content_id">
|
||||
@@ -47,13 +51,32 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="uk-margin">
|
||||
<input class="uk-button uk-button-primary" type="submit" value="{change}">
|
||||
</div>
|
||||
<div class="uk-margin winix-meta-status">
|
||||
[frame "meta"]
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
<input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]">
|
||||
[end]
|
||||
|
||||
<div class="uk-margin-medium">
|
||||
<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="submit"
|
||||
hx-on:click="event.preventDefault(); winix_update_from_codemirror(this, '[doc_base_url][dir][if request.is_item][item.url]/[end]meta[if winix_function_param_is "a"]/a[end]/frame:meta', '.winix-meta-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>
|
||||
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
<input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]">
|
||||
[end]
|
||||
|
||||
</form>
|
||||
|
||||
|
@@ -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>
|
||||
|
@@ -1,7 +1,18 @@
|
||||
<div class="winix">
|
||||
|
||||
[if request.is_item]<h1>{edit}</h1>[else]<h1>{add}</h1>[end]
|
||||
[frame "tinymce"]
|
||||
<h1 id="winix_header_id" [if winix_frame_is "tinymce"]hx-swap-oob="true"[end]>
|
||||
[if request.is_item]
|
||||
{edit}
|
||||
[else]
|
||||
{add}
|
||||
[end]
|
||||
</h1>
|
||||
[end]
|
||||
|
||||
|
||||
[# tinymce 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"]]]
|
||||
@@ -15,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 "tinymce"]
|
||||
<input class="uk-input" id="winix_url_id" type="text" name="url" value="[item.url]" [if winix_frame_is "tinymce"]hx-swap-oob="true"[end]>
|
||||
[end]
|
||||
</div>
|
||||
</div>
|
||||
[end]
|
||||
@@ -26,7 +39,8 @@
|
||||
[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">
|
||||
<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" data-winix-post-name="itemcontent">[item.content.print_content]</div>
|
||||
<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>
|
||||
|
||||
@@ -34,54 +48,50 @@
|
||||
<input id="contenttype" type="hidden" name="contenttype" value="2">
|
||||
</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 winix-tinymce-status">
|
||||
[frame "tinymce"]
|
||||
|
||||
<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>
|
||||
[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]
|
||||
|
||||
[include "antispam.html"]
|
||||
[end]
|
||||
|
||||
[if winix_function_param_is "postredirect"]
|
||||
<input type="hidden" name="postredirect" value="[winix_function_param_value "postredirect"]">
|
||||
[end]
|
||||
|
||||
<div class="uk-margin">
|
||||
<div class="uk-form-controls uk-inline">
|
||||
[# IMPROVEME put some kind of a status msg here]
|
||||
|
||||
<button class="uk-button uk-button-primary winix_update_button"
|
||||
data-winix-function-path="[doc_base_url][dir][if request.is_item][item.url]/[end]tinymce"
|
||||
data-winix-content-tinymce-instances="winix-editor-content"
|
||||
data-winix-content-inputs="winix_url_id,winix_title_id,contenttype"
|
||||
data-winix-progressbar-id="winix-editor-progressbar"
|
||||
data-winix-messages-status-success-id="winix-editor-messages-status-success"
|
||||
data-winix-messages-status-error-id="winix-editor-messages-status-error"
|
||||
<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_tinymce(this, '[doc_base_url][dir][if request.is_item][item.url]/[end]tinymce/frame:tinymce', '.winix-tinymce-status')"
|
||||
>
|
||||
{tinymce_update_button}
|
||||
</button>
|
||||
|
||||
<div id="winix-editor-progressbar" class="uk-invisible uk-position-center-right-out uk-margin-small-left">
|
||||
<img src="[doc_base_url_common]/progressbars/progressbar_fading_lines_16x16.gif" alt="{tinymce_update_progressbar_img_alt}">
|
||||
<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>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="winix-editor-messages-status-success" class="winix-editor-messages-status-success">
|
||||
</div>
|
||||
|
||||
<div id="winix-editor-messages-status-error" class="winix-editor-messages-status-error">
|
||||
</div>
|
||||
|
||||
[end]
|
||||
</div>
|
||||
|
||||
|
||||
|
@@ -55,72 +55,95 @@
|
||||
[end]
|
||||
|
||||
|
||||
[if or [winix_function_is "emacs"] [winix_function_is "ckeditor"] [winix_function_is "tinymce"] [winix_function_is "nicedit"] [winix_function_is "env"] [winix_function_is "meta"]]
|
||||
<style>
|
||||
.wx-button-spinner .wx-button-spinner-text \{
|
||||
display: block;
|
||||
\}
|
||||
.wx-button-spinner .wx-button-spinner-spinner \{
|
||||
display: none;
|
||||
\}
|
||||
.htmx-request.wx-button-spinner .wx-button-spinner-text \{
|
||||
display: none;
|
||||
\}
|
||||
.htmx-request.wx-button-spinner .wx-button-spinner-spinner \{
|
||||
display: block;
|
||||
\}
|
||||
</style>
|
||||
|
||||
[if or [winix_function_is "emacs"] [winix_function_is "env"] [winix_function_is "meta"]]
|
||||
<script type="text/javascript" src="[doc_base_url_common]/codemirror/5.64.0/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="[doc_base_url_common]/codemirror/5.64.0/lib/codemirror.css" type="text/css">
|
||||
|
||||
<script src="[doc_base_url_common]/codemirror/5.64.0/mode/css/css.js"></script>
|
||||
<script src="[doc_base_url_common]/codemirror/5.64.0/mode/javascript/javascript.js"></script>
|
||||
<script src="[doc_base_url_common]/codemirror/5.64.0/mode/xml/xml.js"></script>
|
||||
<script src="[doc_base_url_common]/codemirror/5.64.0/mode/htmlmixed/htmlmixed.js"></script>
|
||||
<script src="[doc_base_url_common]/codemirror/5.64.0/mode/markdown/markdown.js"></script>
|
||||
|
||||
[if false]
|
||||
<link rel="stylesheet" href="[doc_base_url_common]/codemirror/5.64.0/theme/base16-light.css" type="text/css">
|
||||
[end]
|
||||
|
||||
<script src="[doc_base_url_common]/codemirror/5.64.0/addon/display/fullscreen.js"></script>
|
||||
<link rel="stylesheet" href="[doc_base_url_common]/codemirror/5.64.0/addon/display/fullscreen.css" type="text/css">
|
||||
|
||||
[if false]
|
||||
<script src="[doc_base_url_common]/codemirror/5.64.0/addon/search/search.js"></script>
|
||||
<link rel="stylesheet" href="[doc_base_url_common]/codemirror/5.64.0/addon/search/matchesonscrollbar.css" type="text/css">
|
||||
<script>
|
||||
function winix_update_from_editors(el, post_url, target)
|
||||
\{
|
||||
htmx.ajax('POST', post_url, \{source: el, target: target\} );
|
||||
\}
|
||||
</script>
|
||||
[end]
|
||||
|
||||
<script src="[doc_base_url_common]/codemirror/5.64.0/addon/fold/xml-fold.js"></script>
|
||||
<script src="[doc_base_url_common]/codemirror/5.64.0/addon/edit/matchtags.js"></script>
|
||||
|
||||
<script src="[doc_base_url_common]/codemirror/5.64.0/addon/selection/active-line.js"></script>
|
||||
[if or [winix_function_is "emacs"] [winix_function_is "env"] [winix_function_is "meta"]]
|
||||
<script type="text/javascript" src="[doc_base_url_common]/codemirror/5.65.16/lib/codemirror.js"></script>
|
||||
<link rel="stylesheet" href="[doc_base_url_common]/codemirror/5.65.16/lib/codemirror.css" type="text/css">
|
||||
|
||||
<script src="[doc_base_url_common]/codemirror/5.65.16/mode/css/css.js"></script>
|
||||
<script src="[doc_base_url_common]/codemirror/5.65.16/mode/javascript/javascript.js"></script>
|
||||
<script src="[doc_base_url_common]/codemirror/5.65.16/mode/xml/xml.js"></script>
|
||||
<script src="[doc_base_url_common]/codemirror/5.65.16/mode/htmlmixed/htmlmixed.js"></script>
|
||||
<script src="[doc_base_url_common]/codemirror/5.65.16/mode/markdown/markdown.js"></script>
|
||||
|
||||
[if false]
|
||||
<link rel="stylesheet" href="[doc_base_url_common]/codemirror/5.65.16/theme/base16-light.css" type="text/css">
|
||||
[end]
|
||||
|
||||
<script src="[doc_base_url_common]/codemirror/5.65.16/addon/display/fullscreen.js"></script>
|
||||
<link rel="stylesheet" href="[doc_base_url_common]/codemirror/5.65.16/addon/display/fullscreen.css" type="text/css">
|
||||
|
||||
[if false]
|
||||
<script src="[doc_base_url_common]/codemirror/5.65.16/addon/search/search.js"></script>
|
||||
<link rel="stylesheet" href="[doc_base_url_common]/codemirror/5.65.16/addon/search/matchesonscrollbar.css" type="text/css">
|
||||
[end]
|
||||
|
||||
<script src="[doc_base_url_common]/codemirror/5.65.16/addon/fold/xml-fold.js"></script>
|
||||
<script src="[doc_base_url_common]/codemirror/5.65.16/addon/edit/matchtags.js"></script>
|
||||
|
||||
<script src="[doc_base_url_common]/codemirror/5.65.16/addon/selection/active-line.js"></script>
|
||||
|
||||
|
||||
[# markdown to html converter ]
|
||||
[# https://github.com/showdownjs/showdown ]
|
||||
<script src="[doc_base_url_common]/showdown/1.9.1/dist/showdown.min.js"></script>
|
||||
<script src="[doc_base_url_common]/showdown/2.1.0/dist/showdown.min.js"></script>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<style>
|
||||
.CodeMirror-matchingtag \{
|
||||
font-weight: bold;
|
||||
background: none;
|
||||
\}
|
||||
|
||||
.CodeMirror-matchingtag \{
|
||||
font-weight: bold;
|
||||
background: none;
|
||||
\}
|
||||
.CodeMirror-activeline-background \{
|
||||
background: #f3f3f3;
|
||||
\}
|
||||
|
||||
.CodeMirror-activeline-background \{
|
||||
background: #f3f3f3;
|
||||
\}
|
||||
|
||||
.CodeMirror \{
|
||||
border: 1px solid #dedede;
|
||||
\}
|
||||
|
||||
|
||||
</style>
|
||||
.CodeMirror \{
|
||||
border: 1px solid #dedede;
|
||||
\}
|
||||
</style>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var winix_code_mirror_editor = null;
|
||||
var winix_showdown_converter = null;
|
||||
var winix_converter_output = null;
|
||||
var winix_content_parsed = null;
|
||||
var winix_emacs_mode = 0;
|
||||
let winix_code_mirror_editor = null;
|
||||
let winix_showdown_converter = null;
|
||||
let winix_converter_output = null;
|
||||
let winix_content_parsed = null;
|
||||
let winix_emacs_mode = 0;
|
||||
let winix_view_mode = 1; /* one panel */
|
||||
|
||||
function winix_initialize_editor()
|
||||
\{
|
||||
var text_area = document.getElementById("winix_content_id");
|
||||
var winix_contenttype = document.getElementById("winix_contenttype_id");
|
||||
var onchange_delay = null;
|
||||
let text_area = document.getElementById("winix_content_id");
|
||||
let winix_contenttype = document.getElementById("winix_contenttype_id");
|
||||
let winix_viewtype = document.getElementById("winix_viewtype_id");
|
||||
let onchange_delay = null;
|
||||
|
||||
winix_content_parsed = document.getElementById("winix_content_parsed_id");
|
||||
|
||||
@@ -137,8 +160,8 @@
|
||||
tabSize: 4,
|
||||
indentWithTabs: true,
|
||||
extraKeys: \{
|
||||
"F11": function(cm) \{ cm.setOption("fullScreen", !cm.getOption("fullScreen")); \},
|
||||
"Esc": function(cm) \{ if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); \}
|
||||
"F11": winix_change_cm_to_fullscreen,
|
||||
"Esc": winix_change_cm_to_normal_screen
|
||||
\},
|
||||
lineNumbers: true,
|
||||
lineWiseCopyCut: false,
|
||||
@@ -168,24 +191,172 @@
|
||||
\});
|
||||
\}
|
||||
|
||||
if( winix_viewtype )
|
||||
\{
|
||||
[if not [winix_function_param_is "tabs"]]
|
||||
winix_viewtype.addEventListener("change", function(e) \{
|
||||
winix_view_mode = parseInt(this.value);
|
||||
winix_refresh_panels_view(false);
|
||||
\});
|
||||
[end]
|
||||
\}
|
||||
\}
|
||||
|
||||
function winix_change_cm_to_fullscreen(cm)
|
||||
\{
|
||||
let is_fullscreen = cm.getOption("fullScreen");
|
||||
cm.setOption("fullScreen", !is_fullscreen);
|
||||
winix_refresh_panels_view(!is_fullscreen);
|
||||
\}
|
||||
|
||||
function winix_change_cm_to_normal_screen(cm)
|
||||
\{
|
||||
let is_fullscreen = cm.getOption("fullScreen");
|
||||
|
||||
if( is_fullscreen)
|
||||
\{
|
||||
cm.setOption("fullScreen", false);
|
||||
winix_refresh_panels_view(false);
|
||||
\}
|
||||
\}
|
||||
|
||||
function winix_refresh_panels_view(force_one_panel)
|
||||
\{
|
||||
[if not [winix_function_param_is "tabs"]]
|
||||
if( winix_converter_output )
|
||||
\{
|
||||
if( !force_one_panel && winix_view_mode == 2 )
|
||||
\{
|
||||
console.log('Changing to two panels mode');
|
||||
winix_converter_output.parentElement.classList.remove('uk-child-width-1-1');
|
||||
winix_converter_output.parentElement.classList.add('uk-child-width-1-2');
|
||||
winix_converter_output.style.display = 'block';
|
||||
\}
|
||||
else
|
||||
\{
|
||||
console.log('Changing to one panel mode');
|
||||
winix_converter_output.style.display = 'none';
|
||||
winix_converter_output.parentElement.classList.remove('uk-child-width-1-2');
|
||||
winix_converter_output.parentElement.classList.add('uk-child-width-1-1');
|
||||
\}
|
||||
\}
|
||||
[end]
|
||||
\}
|
||||
|
||||
function winix_esc_to_html(c)
|
||||
\{
|
||||
let html='';
|
||||
|
||||
switch(c)
|
||||
\{
|
||||
case '\0':
|
||||
html += '�';
|
||||
break;
|
||||
|
||||
case '<':
|
||||
html += '<';
|
||||
break;
|
||||
|
||||
case '>':
|
||||
html += '>';
|
||||
break;
|
||||
|
||||
case '&':
|
||||
html += '&';
|
||||
break;
|
||||
|
||||
case '"':
|
||||
html += '"';
|
||||
break;
|
||||
|
||||
case '\'':
|
||||
html += ''';
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
html += ' ';
|
||||
break;
|
||||
|
||||
case '\r':
|
||||
html += ' ';
|
||||
break;
|
||||
|
||||
default:
|
||||
html += c;
|
||||
break;
|
||||
\}
|
||||
|
||||
return html;
|
||||
\}
|
||||
|
||||
function winix_convert_from_txt_to_html(str)
|
||||
\{
|
||||
let i=0;
|
||||
let html='';
|
||||
|
||||
for(; i < str.length ; ++i)
|
||||
\{
|
||||
html += winix_esc_to_html(str\[i\]);
|
||||
\}
|
||||
|
||||
return html;
|
||||
\}
|
||||
|
||||
function winix_convert_from_formatted_txt_to_html(str)
|
||||
\{
|
||||
let i=0;
|
||||
let html='<p>';
|
||||
let was_nl=0;
|
||||
|
||||
// skipping first new line characters
|
||||
for(; i < str.length && (str\[i\]=='\r' || str\[i\]=='\n') ; ++i)
|
||||
\{
|
||||
\}
|
||||
|
||||
for(; i < str.length ; ++i)
|
||||
\{
|
||||
if( str\[i\] == '\r' )
|
||||
continue;
|
||||
|
||||
if( str\[i\] == '\n' )
|
||||
\{
|
||||
++was_nl;
|
||||
\}
|
||||
else
|
||||
\{
|
||||
if( was_nl == 1 )
|
||||
html += '<br>\n';
|
||||
else
|
||||
if( was_nl > 1 )
|
||||
html += '</p>\n<p>';
|
||||
|
||||
was_nl = 0;
|
||||
\}
|
||||
|
||||
html += winix_esc_to_html(str\[i\]);
|
||||
\}
|
||||
|
||||
html += '</p>';
|
||||
return html;
|
||||
\}
|
||||
|
||||
function winix_codemirror_preview()
|
||||
\{
|
||||
if( winix_code_mirror_editor !== null )
|
||||
\{
|
||||
if( winix_emacs_mode == 2 )
|
||||
let sourceMarkup = winix_code_mirror_editor.getValue();
|
||||
|
||||
if( winix_emacs_mode == 2 ) // html
|
||||
\{
|
||||
let sourceMarkup = winix_code_mirror_editor.getValue();
|
||||
winix_converter_output.innerHTML = sourceMarkup;
|
||||
if( winix_converter_output !== null )
|
||||
winix_converter_output.innerHTML = sourceMarkup;
|
||||
|
||||
if( winix_content_parsed !== null )
|
||||
winix_content_parsed.value = "";
|
||||
\}
|
||||
else
|
||||
if( winix_emacs_mode == 5 )
|
||||
if( winix_emacs_mode == 5 ) // markdown
|
||||
\{
|
||||
let sourceMarkup = winix_code_mirror_editor.getValue();
|
||||
let htmlMarkup = winix_showdown_converter.makeHtml(sourceMarkup);
|
||||
|
||||
if( winix_converter_output !== null )
|
||||
@@ -195,10 +366,29 @@
|
||||
winix_content_parsed.value = htmlMarkup;
|
||||
\}
|
||||
else
|
||||
if( winix_emacs_mode == 1 ) // formatted text
|
||||
\{
|
||||
[# IMPROVEME add support for text and formated text ]
|
||||
|
||||
winix_converter_output.innerHTML = "";
|
||||
if( winix_converter_output !== null )
|
||||
winix_converter_output.innerHTML = winix_convert_from_formatted_txt_to_html(sourceMarkup);
|
||||
|
||||
if( winix_content_parsed !== null )
|
||||
winix_content_parsed.value = "";
|
||||
|
||||
\}
|
||||
else
|
||||
if( winix_emacs_mode == 0 ) // text
|
||||
\{
|
||||
if( winix_converter_output !== null )
|
||||
winix_converter_output.innerHTML = winix_convert_from_txt_to_html(sourceMarkup);
|
||||
|
||||
if( winix_content_parsed !== null )
|
||||
winix_content_parsed.value = "";
|
||||
|
||||
\}
|
||||
else
|
||||
\{
|
||||
if( winix_converter_output !== null )
|
||||
winix_converter_output.innerHTML = "";
|
||||
|
||||
if( winix_content_parsed !== null )
|
||||
winix_content_parsed.value = "";
|
||||
@@ -206,7 +396,6 @@
|
||||
\}
|
||||
\}
|
||||
|
||||
|
||||
function winix_get_codemirror_mode(mode)
|
||||
\{
|
||||
switch(mode)
|
||||
@@ -231,25 +420,25 @@
|
||||
if( winix_code_mirror_editor !== null )
|
||||
\{
|
||||
let codeMirrorMode = winix_get_codemirror_mode(winix_emacs_mode);
|
||||
console.log("changing mode to: " + codeMirrorMode);
|
||||
console.log("Changing mode to: " + codeMirrorMode);
|
||||
winix_code_mirror_editor.setOption("mode", codeMirrorMode);
|
||||
winix_codemirror_preview();
|
||||
\}
|
||||
\}
|
||||
|
||||
|
||||
|
||||
[if false]
|
||||
this will probably be used to change the mode in the fly
|
||||
winix_code_mirror_editor.setOption("mode", "");
|
||||
function winix_update_from_codemirror(el, post_url, target)
|
||||
\{
|
||||
if( winix_code_mirror_editor )
|
||||
\{
|
||||
winix_codemirror_preview();
|
||||
let editor_data = winix_code_mirror_editor.getValue();
|
||||
winix_code_mirror_editor.save(); // save content to the textarea
|
||||
winix_update_from_editors(el, post_url, target);
|
||||
\}
|
||||
\}
|
||||
|
||||
before saving (update button by ajax) this method should be used:
|
||||
cm.save()
|
||||
Copy the content of the editor into the textarea.
|
||||
[end]
|
||||
|
||||
window.addEventListener("load", winix_initialize_editor, false);
|
||||
|
||||
</script>
|
||||
|
||||
[end]
|
||||
@@ -262,8 +451,25 @@ cm.save()
|
||||
[def winix_has_jquery true]
|
||||
<script type="text/javascript" src="[doc_base_url_common]/jquery/3.7.1/jquery-3.7.1.min.js"></script>
|
||||
[end]
|
||||
|
||||
<script type="text/javascript" src="[doc_base_url_common]/winix/update_button.js"></script>
|
||||
|
||||
<script>
|
||||
function winix_update_from_ckeditor(el, post_url, target)
|
||||
\{
|
||||
if( typeof CKEDITOR !== 'undefined' )
|
||||
\{
|
||||
let div_id = 'winix-editor-content';
|
||||
let editor_data = CKEDITOR.instances\[div_id\].getData();
|
||||
let itemcontent = document.getElementById('winix_content_id');
|
||||
|
||||
if( itemcontent )
|
||||
\{
|
||||
itemcontent.value = editor_data;
|
||||
winix_update_from_editors(el, post_url, target);
|
||||
\}
|
||||
\}
|
||||
\}
|
||||
</script>
|
||||
|
||||
[end]
|
||||
|
||||
|
||||
@@ -277,13 +483,46 @@ cm.save()
|
||||
[def winix_has_jquery true]
|
||||
<script type="text/javascript" src="[doc_base_url_common]/jquery/3.7.1/jquery-3.7.1.min.js"></script>
|
||||
[end]
|
||||
|
||||
<script type="text/javascript" src="[doc_base_url_common]/winix/update_button.js"></script>
|
||||
|
||||
<script>
|
||||
function winix_update_from_tinymce(el, post_url, target)
|
||||
\{
|
||||
if( typeof tinymce !== 'undefined' )
|
||||
\{
|
||||
let div_id = 'winix-editor-content';
|
||||
let editor_data = tinymce.get(div_id).getContent();
|
||||
let itemcontent = document.getElementById('winix_content_id');
|
||||
|
||||
if( itemcontent )
|
||||
\{
|
||||
itemcontent.value = editor_data;
|
||||
winix_update_from_editors(el, post_url, target);
|
||||
\}
|
||||
\}
|
||||
\}
|
||||
</script>
|
||||
[end]
|
||||
|
||||
|
||||
[if winix_function_is "nicedit"]
|
||||
[# the path is set in the fun_nicedit.html too for downloading a gif file]
|
||||
<script type="text/javascript" src="[doc_base_url_common]/nicedit/0.9_r25/nicEdit.js"></script>
|
||||
|
||||
<script>
|
||||
function winix_update_from_nicedit(el, post_url, target)
|
||||
\{
|
||||
let nicedit = nicEditors.findEditor('winix_content_id');
|
||||
let itemcontent = document.getElementById('winix_content_id');
|
||||
|
||||
if( nicedit && itemcontent )
|
||||
\{
|
||||
let editor_data = nicedit.getContent();
|
||||
itemcontent.value = editor_data;
|
||||
winix_update_from_editors(el, post_url, target);
|
||||
\}
|
||||
\}
|
||||
</script>
|
||||
|
||||
[end]
|
||||
|
||||
|
||||
|
@@ -108,8 +108,10 @@ short_url = Short url
|
||||
title = Title
|
||||
nick = Nick
|
||||
change = Change
|
||||
change_and_close = Change and close
|
||||
edit = Edit
|
||||
add = Add
|
||||
add_and_close = Add and close
|
||||
move = Move
|
||||
copy = Copy
|
||||
user = User
|
||||
@@ -127,15 +129,6 @@ rebus_need_to_solve = Solve the rebus please!
|
||||
edit_ticket_header = Edit ticket
|
||||
create_ticket_header = Create a new ticket
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ckeditor_update_button = Update
|
||||
ckeditor_update_progressbar_img_alt = Progressbar
|
||||
|
||||
|
||||
|
||||
form_ticket_type = Ticket type
|
||||
form_ticket_status = Status
|
||||
form_ticket_priority = Priority
|
||||
@@ -173,6 +166,9 @@ form_emacs_content_cms = Content
|
||||
form_emacs_content_thread = Post
|
||||
form_emacs_content_ticket = Info
|
||||
|
||||
form_emacs_content_edit = Content
|
||||
form_emacs_content_preview = Preview
|
||||
|
||||
form_emacs_content_type = Message type
|
||||
|
||||
form_emacs_content_type_text = text
|
||||
@@ -182,6 +178,10 @@ form_emacs_content_type_bbcode = bbcode
|
||||
form_emacs_content_type_other = other \(no formatting\)
|
||||
form_emacs_content_type_markdown = markdown
|
||||
|
||||
form_emacs_view_type = View
|
||||
form_emacs_view_type_one_panel = One panel
|
||||
form_emacs_view_type_two_panels = Two panels
|
||||
|
||||
|
||||
last_header = Last logged users
|
||||
last_tab_login = Login
|
||||
@@ -355,8 +355,6 @@ upload_button_download = Download
|
||||
upload_button_edit = Edit
|
||||
upload_error = Error:
|
||||
upload_processing = Processing...
|
||||
upload_content_edit = Content
|
||||
upload_content_preview = Preview
|
||||
|
||||
|
||||
who_header = Sessions
|
||||
@@ -508,10 +506,6 @@ stat_template_from_mount_point = from the mount point
|
||||
|
||||
subject_header = Edit subject
|
||||
|
||||
|
||||
tinymce_update_button = Update
|
||||
tinymce_update_progressbar_img_alt = Progressbar
|
||||
|
||||
uname_header = System
|
||||
uname_components = Components
|
||||
uname_available_plugins = Plugins
|
||||
|
@@ -112,8 +112,10 @@ short_url = Krótki url
|
||||
title = Tytuł
|
||||
nick = Nick
|
||||
change = Zmień
|
||||
change_and_close = Zmień i zamknij
|
||||
edit = Edytuj
|
||||
add = Dodaj
|
||||
add_and_close = Dodaj i zamknij
|
||||
move = Przenieś
|
||||
copy = Kopiuj
|
||||
user = Użytkownik
|
||||
@@ -133,15 +135,6 @@ rebus_need_to_solve = Proszę rozwiązać rebus!
|
||||
edit_ticket_header = Edytuj zgłoszenie
|
||||
create_ticket_header = Nowe zgłoszenie
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ckeditor_update_button = Aktualizuj
|
||||
ckeditor_update_progressbar_img_alt = Progressbar
|
||||
|
||||
|
||||
|
||||
form_ticket_type = Rodzaj zgłoszenia
|
||||
form_ticket_status = Status
|
||||
form_ticket_priority = Priorytet
|
||||
@@ -178,6 +171,9 @@ form_emacs_content_cms = Zawartość
|
||||
form_emacs_content_thread = Post
|
||||
form_emacs_content_ticket = Opis
|
||||
|
||||
form_emacs_content_edit = Zawartość
|
||||
form_emacs_content_preview = Podgląd
|
||||
|
||||
form_emacs_content_type = Rodzaj wiadomości
|
||||
|
||||
form_emacs_content_type_text = text
|
||||
@@ -187,6 +183,9 @@ form_emacs_content_type_bbcode = bbcode
|
||||
form_emacs_content_type_other = inny \(brak formatowania\)
|
||||
form_emacs_content_type_markdown = markdown
|
||||
|
||||
form_emacs_view_type = Widok
|
||||
form_emacs_view_type_one_panel = Jeden panel
|
||||
form_emacs_view_type_two_panels = Dwa panele
|
||||
|
||||
last_header = Ostatnio logowani użytkownicy
|
||||
last_tab_login = Login
|
||||
@@ -375,8 +374,6 @@ upload_button_download = Ściągnij
|
||||
upload_button_edit = Edytuj
|
||||
upload_error = Błąd:
|
||||
upload_processing = Przygotowywanie...
|
||||
upload_content_edit = Zawartość
|
||||
upload_content_preview = Podgląd
|
||||
|
||||
|
||||
who_header = Lista sesji
|
||||
@@ -526,10 +523,6 @@ stat_template_from_mount_point = z punktu montowania
|
||||
|
||||
subject_header = Zmień tytuł
|
||||
|
||||
|
||||
tinymce_update_button = Aktualizuj
|
||||
tinymce_update_progressbar_img_alt = Progressbar
|
||||
|
||||
uname_header = System
|
||||
uname_components = Komponenty
|
||||
uname_available_plugins = Pluginy
|
||||
|
@@ -233,13 +233,11 @@ public:
|
||||
|
||||
/*
|
||||
* parsed object content
|
||||
* IMPROVEME not used in winix yet
|
||||
*/
|
||||
std::wstring content_parsed;
|
||||
|
||||
/*
|
||||
* parsed content type
|
||||
* IMPROVEME not used in winix yet
|
||||
*/
|
||||
ContentType content_parsed_type;
|
||||
|
||||
|
@@ -51,34 +51,34 @@ extern Ezc::Vars ezc_vars;
|
||||
void HtmlEscapeFormTxt(HtmlTextStream & out, const std::wstring & in)
|
||||
{
|
||||
std::wstring::const_iterator i;
|
||||
int was_enter = 0; // how many enteres there were before
|
||||
int was_nl = 0; // how many new line characters there were before
|
||||
|
||||
if( in.empty() )
|
||||
return;
|
||||
|
||||
out << R("<p>"); // !! pozbyc sie wstawianie tego html tutaj (wrzucic w jakis sposob do szablonow)
|
||||
out << R("<p>");
|
||||
|
||||
// skipping first new line characters
|
||||
for(i = in.begin() ; i != in.end() && (*i==13 || *i==10) ; ++i);
|
||||
|
||||
for( ; i != in.end() ; ++i )
|
||||
{
|
||||
if( *i == 13 ) // skipping stupid characters (\r\n\ in dos mode)
|
||||
if( *i == 13 )
|
||||
continue;
|
||||
|
||||
if( *i == 10 )
|
||||
{
|
||||
++was_enter;
|
||||
++was_nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( was_enter == 1 )
|
||||
if( was_nl == 1 )
|
||||
out << R("<br>\n");
|
||||
else
|
||||
if( was_enter > 1 )
|
||||
if( was_nl > 1 )
|
||||
out << R("</p>\n<p>");
|
||||
|
||||
was_enter = 0;
|
||||
was_nl = 0;
|
||||
}
|
||||
|
||||
out << *i;
|
||||
|
Reference in New Issue
Block a user