Javascript NiceEdit Configuration
Asked Answered
C

2

8

I'm trying to use nicedit

Currently I'm using this to add nicedit to all text areas:

<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>

How do I configure these wysiwygs? I found I can configure single boxes by:

new nicEditor({fullPanel : true}).panelInstance('area2');

But how do I do this when using bkLib.onDomLoaded(nicEditors.allTextAreas); ?

I'm baffled.

Thanks!

For what it's worth, We also have jquery running as well.

Coolth answered 16/10, 2010 at 0:16 Comment(1)
Did you find a solution? The documentation isn't very clear on this. I tried this but no luck: bkLib.onDomLoaded(function() { nicEditors.allTextAreas( new nicEditor({fullPanel : true}) ) });Ephrayim
O
11

This is the right answer to question... This is really missing in the documentation of NicEdit. With this is possible to configure all textareas with the same custom config.

   bkLib.onDomLoaded(function() {
      nicEditors.allTextAreas({buttonList : ['bold','italic','underline']});
   }); 
Op answered 10/8, 2011 at 10:52 Comment(0)
S
0

download nicedit-latest.js and use it.

in nicedit-latest.js find

if(type&&(hasButton||this.ne.options.fullPanel))

(it is somewhere on line 40.)

than delete it and its brackets

{ }

but not this line between the brackets

this.panelButtons.push(new type(this.panelElm,buttonName,options,this.ne));if(!hasButton){this.buttonList.push(buttonName)}

save and try again. all textareas will have the full panel :)

Subhuman answered 24/6, 2014 at 12:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.