我不明白导致spaceShared插件在textarea中间添加新工具栏的原因。
最近我将插件SharedSpaces添加到我的CkEditor中,并从我从SharedSpaces获取的示例中获取代码,即便如此,我在textareas之间获取工具栏。
我的HTML代码:
<div id="topSpace">
</div>
<form action="sample_posteddata.php" id="editorsForm" method="post">
<p>
<label for="editor1">
Editor 1 (uses the shared toolbar and elements path):</label>
<textarea cols="80" id="editor1" name="editor1" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>
</p>
<p>
<label for="editor2">
Editor 2 (uses the shared toolbar and elements path):</label>
<textarea cols="80" id="editor2" name="editor2" rows="3"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>
</p>
<p>
<label for="editor3">
Editor 3 (uses the shared toolbar only):</label>
<textarea cols="80" id="editor3" name="editor3" rows="3"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>
</p>
<p>
<label for="editor4">
Editor 4 (no shared spaces):</label>
<textarea cols="80" id="editor4" name="editor4" rows="3"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>
</p>
<p>
<input type="submit" value="Submit" />
</p>
</form>
<div id="bottomSpace">
</div
Javascript部分
<script type="text/javascript">
//<![CDATA[
// Create all editor instances at the end of the page, so we are sure
// that the "bottomSpace" div is available in the DOM (IE issue).
CKEDITOR.replace( 'editor1',
{
sharedSpaces :
{
top : 'topSpace',
bottom : 'bottomSpace'
},
// Removes the maximize plugin as it's not usable
// in a shared toolbar.
// Removes the resizer as it's not usable in a
// shared elements path.
removePlugins : 'maximize'
} );
CKEDITOR.replace( 'editor2',
{
sharedSpaces :
{
top : 'topSpace',
bottom : 'bottomSpace'
},
// Removes the maximize plugin as it's not usable
// in a shared toolbar.
// Removes the resizer as it's not usable in a
// shared elements path.
removePlugins : 'maximize'
} );
CKEDITOR.replace( 'editor3',
{
sharedSpaces :
{
top : 'topSpace',
bottom : 'bottomSpace'
},
// Removes the maximize plugin as it's not usable
// in a shared toolbar.
removePlugins : 'maximize, elementspath',
} );
CKEDITOR.replace( 'editor4' );
//]]>
</script>
如何修复它或删除出现的不需要的工具栏
答案 0 :(得分:1)
我在你附上的样本中看到两个问题:
一些质量低劣的第三方插件会抛出错误并使用console.log
(原文如此!)。从我看到的是一些源代码编辑器和最有可能的字数插件。从构建中删除它们。
与sharedspace sample一样,您需要移除与floatingspace
冲突的sharedspace
插件。
在此之后一切都应该没问题。
答案 1 :(得分:0)
您正在使用一些额外的插件(如单词计数器和浮动工具栏),可能它们尚未开发用于同时具有多个编辑器的页面以及共享空间配置。