Enable Text Color plugin of Tinymce in Toolbar of Visual Editor - c1-cms

How can i Enable the Text Color plugin of Tinymce in Toolbar of Visual Editor ?
I was able to enable the print, search and replace plugins inside the Visual Editor by editing this file
Composite/content/misc/editors/visualeditor/includes/toolbarsimple.inc
and
modifying a line in below file to include the searchreplace, print plugins
Composite/content/misc/editors/visualeditor/visualeditor.js
plugins: "compositelink,compositetable,compositeimage,compositerendering,compositecharmap,compositefield,compositetext,paste,lists,searchreplace,print",
Similarly is there any way to enable the inbuild feature of Tinymce namely Text Color, Font Size, Font Family, Table, Row, Column in the toolbar of the Visual Editor without making the changes through styles which is done by editing this file
Frontend/Config/VisualEditor/common.xml
Thanks
Ajith

Managed to get the Text Color, Background Color, Font Family, Font Size up and running inside the Composite C1 editor.
Listing down the steps below for the benefit of others.
Copy all the files and folder from Website\Composite\content\misc\editors\visualeditor\tiny_mce\themes\advanced except editor_template.js and editor_template_src.js into your Website\Composite\content\misc\editors\visualeditor\tiny_mce\themes\composite folder.
Edit the file Website\Composite\content\misc\editors\visualeditor\visualeditor.js and include the below lines in the config section.
skin: 'default',
theme_advanced_buttons1: "forecolor,backcolor,fontselect,fontsizeselect",
theme_advanced_buttons2: "",
For a complete list of options visit the TinyMCE link and go to View Source.
You might also want to inclue inlinepopups in the plugins: line for proper rendering of the popups. Any additional plugins like insertdatetime, media, print,searchreplace, etc can also be included in the same line.
To include the plugins like insertdatetime, media, print, searchreplace in existing toolbar row, edit the Website\Composite\content\misc\editors\visualeditor\includes\toolbarsimple.inc file and include the respective tags containing the commands. For eg.
<ui:toolbargroup>
<ui:toolbarbutton cmd="mceSearch" tooltip="Search" image="${skin}/wysiwygeditor/search.png" isdisabled="false" />
<ui:toolbarbutton cmd="mceReplace" tooltip="Replace" image="${skin}/wysiwygeditor/replace.png" isdisabled="false" />
</ui:toolbargroup>
Copy and merge the code from the Website\Composite\content\misc\editors\visualeditor\tiny_mce\themes\advanced\editor_template_src.js file into the Website\Composite\content\misc\editors\visualeditor\tiny_mce\themes\composite\editor_template.js file. Most of the functions can be copied over as it is. Only the common ones like renderUI need special attention. I directly gave a call to the simpleLayout function instead of using a switch in the renderUI
ic = t._simpleLayout(s, tb, o, p);
There could be some issue with not being able to see the entire content in the editor for large content, to fix this issue edit the Website\Composite\content\misc\editors\visualeditor\tiny_mce\themes\composite\skins\default\ui.css file and modify the .defaultSkin iframe css to specify proper height or overflow scroll.
To include more features to your toolbar, just edit theme_advanced_buttons1.
Good Luck..
Ajith

With Composite C1 you need to do styling (like font face, font size, colors and table related styles) using CSS classes and make these classes available to end-users.
The front-end developer define classes needed in CSS and then register them in the toolbar configuration file from where the end-user can select the styles. Composite C1 does not promote having font tags or style attributes in the content html, so if that is what you really want you need to make changes to the core javascript.
You can read about customizing the Visual Editor toolbar here http://docs.composite.net/Console/CustomizingVisualEditor.

Related

Making a background-colorful text in React text editor

I am working on comparing files. So if something was added - I make it green, if deleted - red. And I do that on the server-side by adding a span tag and style attribute. Then I want to show it on the front side with some of React text editors by initializing an initial state with this file. The problem is that text editors cut style attributes, so my text is not with color. And I need to show a job of files comparator.
Thanks for any help :)

Displaying Quill editor content with correct style

I am using the Quill editor (via ngx-quill) to give my user the ability to edit documents. When the documents are displayed I show them like this:
<div [innerHTML]="doc.text"></div>
This works reliably, but the styling of the content of the div tag is quite different from what you see in the Quill editor window. What I want to do is apply the Quill content stylesheet to my div tag, but I haven't been able to find any document to do that. Does anyone here know how to do that?
I know one alternative is to invoke a Quill editor in read-only mode and without a tool-bar. That's my fall-back but I would prefer not to do that.
I was facing the same issue. Some inline styles are displayed, but the styles applied from the Quill.js class are not applied. post-content is class of div containing the content:
let content=document.querySelector('.post-content')
content.innerHTML=content.innerText

Antd multiselect selected Item color or custom style

I am using this multi select of antd Antd multiselect
It is working perfectly fine bt i want to make it like that Multiselect Design
Each selected item have specific color.Is this possible with antd multiselect?Antd provides some props like labelInValue but i am confused how to use they have not provided enough detail.
You can modify the color of the selected items by using css or less variables link to antd instructions for less variables.
To use css, open the node_modules folder, find antd, open the es folder, open the antd component you're using, open the style folder, and then open the index.js file. There you can find the css elements you can modify. Create a css file, change the color attributes on the css elements, and then connect the css file to your javascript/html multiselect.

Drupal 7 - Overriding Omega Theme's Temorary CSS Files

I have a problem with the Omega Theme's styling. I'm actually trying to do something very basic: To make the paragraph margin smaller. Normally I'd put stuff like that into sites/all/themes/my_omega_subtheme/css/global.css and it would work, but in this case it didn't.
So I debugged the webpage and it seems Omega puts some temporary CSS files into sites/default/files/css that are overriding global.css. So I guessed I would be able to change this in the appearance settings, but there aren't any settings for the paragraph margin. Of course I can't change the margin in there, either, because the files seem to be generated every now and then (at least the names are different today, and I made sure to not click save in the appearance settings).
Additionally I tried setting it with CSS ID and / or class because I thought this would surely override the temporary CSS file's value of p { margin-bottom: 20px; }, but it seems I'm just not informed properly.
So what is the correct way to set the paragraph margin in an Omega theme?
Normally the CSS files stored in sites/default/files/css are the compressed CSS files which drupal generates automatically. To be able to make any changes appear as normal, you need to disable CSS compression.
Go to ?q=admin/config/development/performance and un-check the option Aggregate and compress CSS files.
Now when you view the page source, you should be able to see a list off your theme's CSS files.

How do I specify the default font sizer in CK Editor v3

How do I specify the default font size for CKEditor. I tried changing contents.css (body -> font-size) and I tried changing config.js (config.fontSize_defaultLabel) without any success. Does anyone know where i should be looking?
You seem to be on the right track with the contents.css file.
Is your problem that the font size while working in the editor is not correct or is it that the font size isn't being carried over to the page where you actually display the content?
As you know, ckeditor/contents.css is the default style sheet that is loaded while working in the editor, but if you use "config.contentsCss" to call another style sheet, contents.css won't be loaded.
You can call multiple style sheets like this:
config.contentsCss = ['/contents.css', '/css/anotherstylesheet.css'];
If the font size isn't being carried over to the actual page display, you'll need to set the font size in the style sheet used for the actual pages, the default font size used in the editor isn't inserted into the content output by the editor.
"config.fontSize_defaultLabel" is a label only, it doesn't have any effect on the content. Normally, when you load the editor, the font size selector will display "Size". If you set "fontSize_defaultLabel", the font size selector will display whatever value you entered.
If you can provide more details about the problem, I'll try to post a more accurate answer.
Be Well,
Joe

Resources