[SOLVED] Change height of RichText editor

Moderator: crythias

Locked
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

[SOLVED] Change height of RichText editor

Post by Mothra »

Does anyone know how to change the default height of the text area used when composing/replying to tickets? It's currently 19 rows, but I find it's too tall for a laptop screen (1400x900) so I'd like to reduce it somewhat.

I looked in the CustomerTicketMessage.dtl and found a rows parameter, but this didn't do the trick (it was set to 15 anyway). I also looked through SysConfig but didn't find anything.

I'm presuming it may be buried somewhere in the CSS? If so, does anyone know where?
Last edited by Mothra on 25 Jan 2011, 10:59, edited 1 time in total.
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Change height of text editor (Agent/Customer compose/rep

Post by crythias »

The reply shows up as action AgentTicketCompose

the source renders as:

Code: Select all

  <textarea id="RichText" name="Body" rows="15" cols="82" 
grep -sir " rows=\"15" *

hmm. what do you know? it's in the dtls. :)

Kernel/Output/HTML/Standard/AgentTicketCompose.dtl

Code: Select all

<!-- dtl:block:RichText -->
                        <textarea id="RichText" name="Body" rows="15" cols="$Config{"Ticket::Frontend::TextAreaEmail"}" class="RichText Validate_Required $QData{"BodyInvalid"}">$Data{"ResponseFormat"}</textarea>
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Change height of text editor (Agent/Customer compose/rep

Post by crythias »

There's also id and class

Code: Select all

    <link rel="stylesheet" type="text/css" href="/otrs3-web/skins/Agent/default/css-cache/CommonCSS_07386066897b1c275dd992b340569e42.css" /> 
<!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="/otrs3-web/skins/Agent/default/css-cache/CommonCSS_IE7_dcc519ea312883c547f9efdf7524c83b.css" />
    <![endif]--> 
<!--[if IE 8]>
    <link rel="stylesheet" type="text/css" href="/otrs3-web/skins/Agent/default/css-cache/CommonCSS_IE8_2be54867d6f664bd195f8b0ad2e727a2.css" />
    <![endif]--> 
    <link rel="stylesheet" type="text/css" href="/otrs3-web/skins/Agent/default/css/thirdparty/ui-theme/jquery-ui.css" /> 
the css-cache gets generated from css in otrs/var/httpd/htdocs/skins/Agent/default/css


The only other places RichText shows up CSS wise seem to be in the skins area, though my bet is on specific .dtl files

Code: Select all

Agent/default/css/Core.Form.css: * @note    The RichText field needs to float, otherwise it breaks
Agent/default/css/Core.Form.css: *          RichTextField is for backwards compatibility.
Agent/default/css/Core.Form.css:fieldset.TableLike > .RichTextField, fieldset.TableLike > .FloatingField {
Agent/default/css/Core.Form.css:.RTL fieldset.TableLike > .RichTextField, .RTL fieldset.TableLike > .FloatingField {
Customer/ivory/css/Core.Default.css:#Messenger #RichText {
Customer/ivory/css/Core.Default.css:#RichText {
Customer/default/css/Core.Form.css:#RichText {
Customer/default/css/Core.Form.css:fieldset .RichTextHolder {
Customer/default/css/Core.Default.css: * @subsection  RichText Editor overwrites
Customer/default/css/Core.Default.css:form #cke_RichText {
Customer/default/css/Core.Default.css:form #cke_RichText span.cke_wrapper {
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Re: Change height of text editor (Agent/Customer compose/rep

Post by Mothra »

crythias wrote:The reply shows up as action AgentTicketCompose

the source renders as:

Code: Select all

  <textarea id="RichText" name="Body" rows="15" cols="82" 
grep -sir " rows=\"15" *

hmm. what do you know? it's in the dtls. :)

Kernel/Output/HTML/Standard/AgentTicketCompose.dtl

Code: Select all

<!-- dtl:block:RichText -->
                        <textarea id="RichText" name="Body" rows="15" cols="$Config{"Ticket::Frontend::TextAreaEmail"}" class="RichText Validate_Required $QData{"BodyInvalid"}">$Data{"ResponseFormat"}</textarea>
Yes, this is exactly what I found but, as I mentioned in the OP, the value of 15 does not correspond to the actual number of rows in the text area and changing the value to something else (e.g. "5") has no effect. Ergo, the height of the text area must be coming from somewhere else (maybe passed into the method call that generates the RichText editor?).
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Change height of text editor (Agent/Customer compose/rep

Post by crythias »

interestingly, rows="5" worked until it filled with the content...


http://docs.cksource.com/ckeditor_api/s ... ml#.height

otrs/var/httpd/htdocs/js/Core.UI.RichTextEditor.js

around line 74

Code: Select all

            height: Core.Config.Get('RichText.Height', 320),
change to something like:

Code: Select all

            height: 120,
 
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Re: Change height of text editor (Agent/Customer compose/rep

Post by Mothra »

Nope, still no luck.

I've tried all of the above and it has no effect on the height of the RichText editor.
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Re: Change height of text editor (Agent/Customer compose/rep

Post by Mothra »

Found it! Two ways of doing it - to change across the board, in SysConfig, Framework->Core::Web you'll find Frontend::RichTextHeight is set to 320, and changing this will adjust the height of the text editing area.

To apply to a particular theme, there is a RichTextEditor.dtl and a CustomerRichTextEditor.dtl. In either/both, change:

Code: Select all

Core.Config.Set('RichText.Height', '$Config{"Frontend::RichTextHeight"}');
to

Code: Select all

Core.Config.Set('RichText.Height', 120);
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
Locked