This topic is locked
[SOLVED]

 How to change styling on Basic Rich Text Editor

6/23/2017 7:07:26 AM
PHPRunner General questions
B
bluepoint author

I would like to change the styling on the Basic Rich Text Editor. Primarily remove the first tool bar.
Tried to change the rte.css ... no go.

Tried using straight JQ using the selector and adding css ... no go.
Thought maybe the iFrame was bothering it, so I tried this.



<script>

var head = jQuery("#value_Comments_1").contents().find("head");

var css = '<style type="text/css">' + 'table#toolbar1_value_Comments_1 {display:none !important;} ' + '</style>';

jQuery(head).append(css);

</script>


I tried the above code in the Chrome debugger and it works. But, somehow all these users agents are not letting me change it real time.
Any ideas? Thanks.

admin 6/23/2017

It will work if you move your Javascript code to Javascript OnLoad event.

B
bluepoint author 6/23/2017



It will work if you move your Javascript code to Javascript OnLoad event.


Indeed you are correct. Thanks. Here is some code IMHO make the styling a little better (bootstrap1), perhaps someone can improve.



var head = jQuery("#value_Comments_1").contents().find("head");

var css = '<style type="text/css">' + 'table#toolbar1_value_Comments_1 {display: none !important;} ' +

'table#toolbar2_value_Comments_1 {display: inline-table;} ' +

'table {border: 1px solid #cccccc !important;} ' +

'label[for=chkSrcvalue_Comments_1] {font-family: monospace;} ' +

'</style>';

jQuery(head).append(css);