| <?xml version="1.0" encoding="UTF-8"?> |
| |
| <!-- |
| * Licensed to the Apache Software Foundation (ASF) under one or more |
| * contributor license agreements. See the NOTICE file distributed with |
| * this work for additional information regarding copyright ownership. |
| * The ASF licenses this file to You under the Apache License, Version 2.0 |
| * (the "License"); you may not use this file except in compliance with |
| * the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| --> |
| |
| <ui:composition template="/main.xhtml" |
| xmlns="http://www.w3.org/1999/xhtml" |
| xmlns:f="http://java.sun.com/jsf/core" |
| xmlns:tc="http://myfaces.apache.org/tobago/component" |
| xmlns:ui="http://java.sun.com/jsf/facelets"> |
| |
| <tc:script |
| file="#{request.contextPath}/content/20-component/110-wysiwyg/01-ckeditor/ckeditor/ckeditor.js"/> |
| <tc:script file="#{request.contextPath}/content/20-component/110-wysiwyg/01-ckeditor/demo-ckeditor.js"/> |
| |
| <!-- todo--> |
| <tc:badge value="Todo: This page needs to be refactored, still using jQuery..." markup="warning"/> |
| |
| <tc:section label="Installation"> |
| <p>Download <tc:link link="http://ckeditor.com/" target="_blank" label="CKEditor"/> |
| and unpack the ZIP file directly beside this XHTML-file. |
| Then restart this application (this is needed, because the resource manager needs to scan the content).</p> |
| </tc:section> |
| |
| <tc:section label="Editor"> |
| <p>This facelet contains two <code class="language-markup"><tc:script/></code> tags, |
| one for the CKEditor and the other for the integration in this application. |
| The <code class="language-markup"><tc:textarea/></code> contain |
| <code class="language-markup"><tc:dataAttribute name="html-editor" value=""/></code>, |
| to mark this textarea to be used as rich text editor. The rest does the script: demo-ckeditor.js</p> |
| |
| <tc:box id="sourceCodeBox" label="demo-ckeditor.js" collapsed="true" collapsedMode="hidden"> |
| <f:facet name="bar"> |
| <tc:buttons> |
| <tc:button label="show" omit="true"> |
| <tc:operation name="show" for="sourceCodeBox"/> |
| </tc:button> |
| <tc:button label="hide" omit="true"> |
| <tc:operation name="hide" for="sourceCodeBox"/> |
| </tc:button> |
| </tc:buttons> |
| </f:facet> |
| <pre><code class="language-javascript"><tc:out value="#{ckeditorController.source}"/></code></pre> |
| </tc:box> |
| |
| <tc:out markup="strong" rendered="#{not ckeditorController.editorAvailable}" |
| value="The CKEditor is not installed! Using the fallback textarea."/> |
| |
| <tc:out markup="strong" rendered="#{ckeditorController.contentSecurityPolicyMode == 'ON'}" |
| value="CSP is ON! CKEditor is not compatible with CSP!"/> |
| |
| <tc:textarea value="#{ckeditorController.text}"> |
| <tc:style width="400px" height="300px"/> |
| <tc:dataAttribute name="html-editor" value=""/> |
| </tc:textarea> |
| <tc:button label="Submit"/> |
| </tc:section> |
| </ui:composition> |