Support for CKEditor (replaces FCKEditor) in standard theme engine

git-svn-id: https://svn.libreccm.org/ccm/trunk@4777 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2017-06-13 07:02:38 +00:00
parent 9583369005
commit b851db5f68
1 changed files with 13 additions and 54 deletions

View File

@ -186,74 +186,33 @@
<!-- DE Benutze FCKEditor -->
<!-- EN Use FCKEditor -->
<xsl:template match="bebop:fckeditor">
<xsl:template match="bebop:ckeditor">
<xsl:variable name="first-match">
<xsl:value-of select="//bebop:fckeditor/@name"/>
<xsl:value-of select="//bebop:ckeditor/@name"/>
</xsl:variable>
<!-- EN Start of the FCKeditor component code -->
<!-- EN Start of the CKeditor component code -->
<xsl:if test="@name=$first-match">
<script type="text/javascript">
_editor_url = "/assets/fckeditor/";
_editor_lang = "en";
var numEd = 0;
<script type="text/javascript" src="/assets/ckeditor/ckeditor.js">
</script>
<script type="text/javascript" src="/assets/fckeditor/fckeditor.js"/>
<script type="text/javascript">
<xsl:for-each select="//bebop:fckeditor">
var editor_<xsl:value-of select="@name"/> = null;
</xsl:for-each>
<xsl:value-of select="concat('ckeditorConfig = \'', //bebop:ckeditor/bebop:config/@path ,'\'')" />
window.onload = function() {
<xsl:for-each select="//bebop:fckeditor">
editor_<xsl:value-of select="@name"/> = new FCKeditor("ta_<xsl:value-of select="@name"/>") ;
editor_<xsl:value-of select="@name"/>.Width =
<xsl:choose>
<xsl:when test="@metadata.width">
'<xsl:value-of select="@metadata.width"/>';
</xsl:when>
<xsl:otherwise>
'100%';
</xsl:otherwise>
</xsl:choose>
editor_<xsl:value-of select="@name"/>.Height =
<xsl:choose>
<xsl:when test="@metadata.height">
'<xsl:value-of select="@metadata.height"/>';
</xsl:when>
<xsl:otherwise>
'400';
</xsl:otherwise>
</xsl:choose>
editor_<xsl:value-of select="@name"/>.BasePath = "/assets/fckeditor/" ;
editor_<xsl:value-of select="@name"/>.PluginsPath = editor_<xsl:value-of select="@name"/>.BasePath + "editor/plugins/" ;
<xsl:if test="bebop:config/@path">
editor_<xsl:value-of select="//bebop:fckeditor/@name"/>.Config['CustomConfigurationsPath'] = "<xsl:value-of select="//bebop:fckeditor/bebop:config/@path"/>";
</xsl:if>
editor_<xsl:value-of select="@name"/>.ToolbarSet = "Basic";
editor_<xsl:value-of select="@name"/>.ReplaceTextarea();
}
</xsl:for-each>
CKEditor.replaceAll(
'ckeditor',
customConfig: ckeditorConfig);
};
</script>
<!--
<style type="text/css">
textarea { background-color: #fff; border: 1px solid 00f; }
</style>
-->
</xsl:if>
<!-- EN End of FCKeditor setup -->
<!-- EN End of CKeditor setup -->
<xsl:call-template name="process-label">
<xsl:with-param name="widget" select="."/>
</xsl:call-template>
<textarea id="ta_{@name}" name="{@name}" style="width:100%" rows="{@rows}" cols="{@cols}" wrap="{@wrap}">
<textarea id="ta_{@name}" name="{@name}" class="ckeditor" style="width:100%" rows="{@rows}" cols="{@cols}" wrap="{@wrap}">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>