Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CKeditor Code line Breaks Help
#1
Hi all,

I was wondering if someone could help me. This has got to be easy but I can figure it out. I have looked though the wiki and read a few posts from Connie but still HAZY.

Problem: How in the heck do I get the gsconfig.php file to recognize the custom config file.

I went through the steps but I am unclear on this bit. What should I be calling in the [] area? Do I use the brackets? Do I put in the whole file-name of the js file ?

I basically need a custom file to get the line break problem out the code editor. I attached a screenshot - the code is really messy and hard to work with. I know this is not a GS thing BUT Im sure people have the same problem Smile Again thank you in advance for any help!!!!

PHP Code:
# WYSIWYG toolbars (advanced, basic or [custom config]) 
#define('GSEDITORTOOL', 'advanced');

&

define('GSEDITOROPTIONS'"entities : false,customConfig : '../../../../theme/yourtheme-folder/yourconfigfile.js',skin: 'v2'"); 


Attached Files Thumbnail(s)
   
Reply
#2
hmm i have never seen source look liek that.
What gs version you on ?

and have you tried the beta ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
(2013-08-29, 00:10:39)shawn_a Wrote: hmm i have never seen source look liek that.
What gs version you on ?

and have you tried the beta ?

Hi Shawn! I'm on 3.2.1 I haven't tried beta. Messy huh LOL!
Reply
#4
I know line breaking is annoying by why is your source indented so far ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
PHP Code:
define('GSEDITOROPTIONS',
"enterMode: CKEDITOR.ENTER_BR,
shiftEnterMode : CKEDITOR.ENTER_P,
customConfig : '../../../../theme/cke_custom.js'
"


The beta has some of these fixed in it already.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#6
(2013-08-29, 00:14:43)shawn_a Wrote:
PHP Code:
define('GSEDITOROPTIONS',
"enterMode: CKEDITOR.ENTER_BR,
shiftEnterMode : CKEDITOR.ENTER_P,
customConfig : '../../../../theme/cke_custom.js'
"


So when I tell the config to use this file in this part...

define('GSEDITORTOOL', 'advanced');

Do I, for example, do this?

define('GSEDITORTOOL', 'cke_custom.js');


and....I dont know why its so indented! This is major reason I shy away from using editors. Smile
Reply
#7
GSEDITORTOOL has nothing to do with GSEDITOROPTIONS
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#8
So leave it as 'advanced'. I saw the [custom config] in comments and figured I needed to add something there. Sorry for the elementary questions!!
Reply
#9
I am using DW to code in because its more table friendly and copying into the editor. I'm not copying from the design window only the code window. Perhaps that is what making the code indent that way
Reply
#10
toolbar custom config is for a custom toolbar as a button array.

Why not just turn off the editor entirely, or is this just for this page ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#11
(2013-08-29, 00:25:54)shawn_a Wrote: toolbar custom config is for a custom toolbar as a button array.

Why not just turn off the editor entirely, or is this just for this page ?

I've got about 10 pages with tables of data on them Sad

I might just turn it off.

Thanks Shawn!!!
Reply
#12
Yeah in settings for that user, uncheck htmleditor. I am not sure the editor is adding that level of indenting. it does do wierd indenting when editing, it also removes stuff, like empty tags.

3.2.4 has some fixes for block level breaking and indentation.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#13
Shawn! Thank you for help as always!! Yeah these editors can be frustrating! I'm updating to 3.2.3 right now to be close to up-to-date.
Reply
#14
"block level breaking" sounds like some new dance craze
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#15
electric boogaloo style Smile
Reply
#16
Solved Thanks Shawn!

I had to mess around with that relative link a little but got it working. I set the indent to false which made it much better. Not ideal - but better.

The difference that I could see when changing the indent was that when I changed it back to true - for some reason the tables, td's were not affected like the divs were.

Set it to false and everything including the tables, td's etc get shifted over.


Attached Files Thumbnail(s)
       
Reply
#17
I wonder if there is a way to set the indentation method, say 2 spaces, instead of gigantic tabs.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#18
Can you post your source so i can test modifiying the cke writer ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#19
This is what I added to 3.2.4 config

PHP Code:
// Override default block element source formatting
CKEDITOR.on'instanceReady', function( ev ) {
    var 
blockTags = ['div','h1','h2','h3','h4','h5','h6','p','pre','li','blockquote','ul','ol','table','thead','tbody','tfoot','td','th',];
    var 
rules = {
        
indent           true,
        
breakBeforeOpen  true,
        
breakAfterOpen   false,
        
breakBeforeClose false,
        
breakAfterClose  true
    
};

    for (var 
i=0i<blockTags.lengthi++) {
        
ev.editor.dataProcessor.writer.setRulesblockTags[i], rules );
    }
}); 
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#20
(2013-08-29, 01:32:41)shawn_a Wrote: Can you post your source so i can test modifiying the cke writer ?

Sure! It's just a table with data in it

Code:
<table border="0" cellpadding="0" cellspacing="0" id="fund-information" width="100%">
                        <tbody>
                            <tr>
                                <td width="64%">Ticker (Investor Class)</td>
                                <td align="right" valign="middle" width="36%">&nbsp;</td>
                            </tr>
                            <tr>
                                <td>Ticker (Institutional Class)</td>
                                <td align="right" valign="middle">&nbsp;</td>
                            </tr>
                            <tr>
                                <td>CUSIP (Investor Class)</td>
                                <td align="right" valign="middle">&nbsp;</td>
                            </tr>
                            <tr>
                                <td>CUSIP (Institutional Class)</td>
                                <td align="right" valign="middle">&nbsp;</td>
                            </tr>
                            <tr>
                                <td>Minimum Investment (Investor Class)</td>
                                <td align="right" valign="middle">xxxxx</td>
                            </tr>
                            <tr>
                                <td>Minimum Investment (Institutional Class)</td>
                                <td align="right" valign="middle">xxxxx</td>
                            </tr>
                            <tr>
                                <td>Expense Ratio (Investor Class)</td>
                                <td align="right" valign="middle">&nbsp;</td>
                            </tr>
                            <tr>
                                <td>Expense Ratio (Institutional Class)</td>
                                <td align="right" valign="middle">&nbsp;</td>
                            </tr>
                            <tr>
                                <td>Net Assets</td>
                                <td align="right" valign="middle">&nbsp;</td>
                            </tr>
                            <tr>
                                <td>Fund Inception</td>
                                <td align="right" valign="middle">&nbsp;</td>
                            </tr>
                            <tr>
                                <td>Primary Benchmark</td>
                                <td align="right" valign="middle">S&amp;P 500 Index</td>
                            </tr>
                            <tr>
                                <td>Secondary Benchmark</td>
                                <td align="right" valign="middle">Russell 3000 Index</td>
                            </tr>
                            <tr>
                                <td>Portfolio Managers</td>
                                <td align="right" valign="middle">&nbsp;</td>
                            </tr>
                        </tbody>
                    </table>

Correct in the config js file I have it has your code you posted.
Reply
#21
If I disable the HTML editor will it default to codemirror or is there something I have to do perhaps that would be better
Reply
#22
nah its just a normal textarea
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#23
aha textareas have a tabspace of 8 chars ( dumb )

some browsers you can modify

use admincss plugin and add this or something similar.

Code:
textarea, pre {
  -moz-tab-size:4;
  -o-tab-size:4;
  tab-size:4;
}

will be added to 3.2.4 for sure.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#24
(2013-08-29, 02:33:54)shawn_a Wrote: aha textareas have a tabspace of 8 chars ( dumb )

some browsers you can modify

use admincss plugin and add this or something similar.

Code:
textarea, pre {
  -moz-tab-size:4;
  -o-tab-size:4;
  tab-size:4;
}

will be added to 3.2.4 for sure.


Whoop!!! Thanks Shawn!!
Reply




Users browsing this thread: 2 Guest(s)