简体   繁体   English

tinymce编辑器。 按钮不显示

[英]tinymce editor. buttons not showing

im trying to use this the editor like in this tutorial http://kpachar.blogspot.de/2010/06/tinymce-as-jsf-2-composite-component.html unfortunately it doesnt work for me. 即时消息,我试图像本教程中一样使用此编辑器http://kpachar.blogspot.de/2010/06/tinymce-as-jsf-2-composite-component.html不幸的是,它对我不起作用。 i can see the textarea, but there are not bottons to edit. 我可以看到文本区域,但没有可编辑的按钮。

im having the editor in the same project on different places, but at the one place it works, at the other it does not. 我将编辑器放在不同地方的同一项目中,但是在一个地方可以使用,而在另一个地方则不能。

I tried it with different browsers, same problem everywhere. 我尝试使用不同的浏览器,到处都遇到相同的问题。 Firebug shows that the scripts im calling are included and alert proves it. Firebug表明包含了即时消息调用脚本,并且警报证明了这一点。

scripts I call: 我称之为的脚本:

<composite:implementation>
    <h:outputScript name="tiny_mce/tiny_mce.js" target="head"/>
    <h:outputScript name="editors/tinymce_init.js" />
    <h:inputTextarea id="textarea" value="#{cc.attrs.value}" rows="5" cols="80"
        styleClass="tinymce" />
</composite:implementation>

But the scripts called by the script tiny_mce.js cant load. 但是无法加载脚本tiny_mce.js调用的脚本。

Failed to load: http://localhost:8080/SOCIATO_Testcommunity/javax.faces.resource/tiny_mce/langs/en.js

Failed to load: http://localhost:8080/SOCIATO_Testcommunity/javax.faces.resource/tiny_mce/themes/simple/editor_template.js

Both files are in the "resources" folder but the server tries to find them in "javax.faces.resource". 这两个文件都在“ resources”文件夹中,但是服务器尝试在“ javax.faces.resource”中找到它们。 Other files(fe called by outputScript) find this files automatically. 其他文件(由outputScript调用)会自动找到此文件。 How can I tell the server where to find this scipts called by tiny_mce? 如何告诉服务器在哪里可以找到tiny_mce调用的这种密码?

Any idea, please? 有什么主意吗?

They're resolved relative to the location of the original script and their URLs need to match the URL pattern of the FacesServlet and thus need an additional .jsf or .xhtml suffix. 它们相对于原始脚本的位置已解析,并且它们的URL需要与FacesServlet的URL模式匹配,因此需要附加的.jsf.xhtml后缀。 You basically need to edit the TinyMCE JS source code to fix the URLs from where those dependencies are been loaded. 基本上,您需要编辑TinyMCE JS源代码,以修复从中加载这些依赖项的URL。 It's probably easier to just include them by <script> instead of <h:outputScript> . 仅通过<script>而不是<h:outputScript>包含它们可能更容易。

<script src="#{request.contextPath}/resources/tiny_mce/tiny_mce.js" />
<script src="#{request.contextPath}/resources/editors/tinymce_init.js" />

Or just adopt a component library which has already solved this for you, such as PrimeFaces or RichFaces. 或者只是采用已经为您解决了这一问题的组件库,例如PrimeFaces或RichFaces。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM