Today I've just modified the default wysiwyg-editor in my QA website, and I share you my solution to add a CSS class to your text (in your question) by (adding and) using an extra "Styles" button in your wysiwyg-editor
This is what I've created:
And how I do:
Step 1: Change the file: \qa-plugin\wysiwyg-editor\qa-wysiwyg-editor.php
in the lines:
$qa_content['script_lines'][]=array(
"qa_wysiwyg_editor_config={toolbar:[".
"['Bold','Italic','Underline','Strike'],".
"['Font','FontSize'],".
to add more buttons.
In this case, I added the "Styles" button by adding:
"['Styles','Link','Unlink'],".
Step 2: change the file qa-plugin\wysiwyg-editor\plugins\styles\styles\default.js
Clear what you don't want to have, and add something like that:
CKEDITOR.stylesSet.add('default',[{
name:'Big Green Button',
element:'div',
attributes:{
class: 'big-green-button'
}
},
and when you select your text and then select the Styles > Big Green Button, the wysiwyg-editor will wrap the text with <div class="big-green-button">
Step 3 (final): edit qa-styles.css in your theme to update your change (in this example, we need to add .big-green-button style)