8

我正在尝试使用nicedit

目前我正在使用它来将 nicedit 添加到所有文本区域:

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

如何配置这些所见即所得?我发现我可以通过以下方式配置单个框:

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

但是使用时我该怎么做bkLib.onDomLoaded(nicEditors.allTextAreas);呢?

我很困惑。

谢谢!

对于它的价值,我们也运行 jquery。

4

2 回答 2

11

这是问题的正确答案......这在 NicEdit 的文档中确实缺失。这样就可以使用相同的自定义配置来配置所有文本区域。

   bkLib.onDomLoaded(function() {
      nicEditors.allTextAreas({buttonList : ['bold','italic','underline']});
   }); 
于 2011-08-10T10:52:09.173 回答
0

下载 nicedit-latest.js 并使用它。

在 nicedit-latest.js 中找到

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

(它在第 40 行的某处。)

而不是删除它及其括号

{ }

但不是括号之间的这条线

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

保存并重试。所有文本区域都将具有完整的面板:)

于 2014-06-24T12:08:07.763 回答