ProNotion
04/28/2024, 8:30 AMJustify-Left
or Justify-Right
are selected from the formatting toolbar.
tinymce.init({
setup: function(editor) {
editor.on('ExecCommand', function(e) {
var selectedNode = editor.selection.getNode(); // Get the currently selected node
if (e.command === 'JustifyLeft' || e.command === 'JustifyRight') {
// Remove any previously added alignment classes
editor.dom.removeClass(selectedNode, 'custom-justify-left custom-justify-right');
// Check command and add the appropriate class
if (e.command === 'JustifyLeft') {
editor.dom.addClass(selectedNode, 'custom-justify-left');
} else if (e.command === 'JustifyRight') {
editor.dom.addClass(selectedNode, 'custom-justify-right');
}
}
});
}
});
Is this achievable somehow?Mike Chambers
04/28/2024, 10:29 PMjson
"RichTextEditor": {
"Plugins": [ "visualblocks" ],
"Commands": [
{
"Alias": "visualblocks",
"Name": "Visual Blocks",
"Mode": "Insert"
}
],
"CustomConfig": {
"statusbar": "true",
"branding": "false",
"resize": "true",
"formats": "{\"underline\": {\"selector\": \"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li\",\"classes\": \"text-decoration-underline\"},\"alignleft\": {\"selector\": \"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,audio,video\",\"classes\": \"text-start\"},\"alignright\": {\"selector\": \"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,audio,video\",\"classes\": \"text-end\"},\"aligncenter\": {\"selector\": \"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,audio,video\",\"classes\": \"text-center\"},\"alignjustify\": {\"selector\": \"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img,audio,video\",\"classes\": \"text-justify\"}}" //https://www.tiny.cloud/docs/tinymce/6/filter-content/#built-in-formats
}
}
ProNotion
04/29/2024, 7:45 AMProNotion
04/30/2024, 5:19 AMMike Chambers
04/30/2024, 9:52 AMcsharp
var builder = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
builder.Build();
ProNotion
04/30/2024, 9:56 AM