You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2021/02/19 06:49:21 UTC

[myfaces-tobago] branch master updated: doc: TinyMCE example

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 241fa29  doc: TinyMCE example
241fa29 is described below

commit 241fa297971cfdf839253116727f44c0ed330031
Author: Udo Schnurpfeil <ud...@irian.eu>
AuthorDate: Fri Feb 19 07:36:07 2021 +0100

    doc: TinyMCE example
---
 .../myfaces/tobago/example/demo/TinyMceController.java   |  6 +-----
 .../20-component/110-wysiwyg/00-tinymce/TinyMCE.xhtml    | 16 +++++++++-------
 .../00-tinymce/{tinymce.js => init-tinymce.js}           |  0
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TinyMceController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TinyMceController.java
index 4092688..515af10 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TinyMceController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TinyMceController.java
@@ -43,10 +43,6 @@ public class TinyMceController extends SourceFileReader implements Serializable
   }
 
   public String getSource() {
-    return getSource("tinymce.js");
-  }
-
-  public boolean isEditorAvailable() {
-    return getSource("tinymce/js/tinymce/tinymce.min.js") != null;
+    return getSource("init-tinymce.js");
   }
 }
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/110-wysiwyg/00-tinymce/TinyMCE.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/110-wysiwyg/00-tinymce/TinyMCE.xhtml
index 0d0a096..7f5b3b8 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/110-wysiwyg/00-tinymce/TinyMCE.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/110-wysiwyg/00-tinymce/TinyMCE.xhtml
@@ -24,28 +24,30 @@
                 xmlns:ui="http://java.sun.com/jsf/facelets">
 
   <tc:script file="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js" referrerpolicy="origin"/>
-  <tc:script file="#{request.contextPath}/content/20-component/110-wysiwyg/00-tinymce/tinymce.js"/>
+  <tc:script file="#{request.contextPath}/content/20-component/110-wysiwyg/00-tinymce/init-tinymce.js"/>
 
   <tc:section label="Setup">
     <p>
-      This demo uses the CDN of TinyMCE.
+      This demo uses the CDN of TinyMCE as a showcase.
+      There are other integration possibilities.
       For more information to setup see <tc:link image="fa-edit" link="https://www.tiny.cloud/" label="TinyMCE"/>.
     </p>
 
     <p>
-      The setup needs an entry in <code>tobago-config.xml</code>, because of CSP.
+      The setup needs entries in <code>tobago-config.xml</code> for CSP.
+      More infomation about these entries you find also on their webside.
     </p>
 
     <p>
       This page contains two <code class="language-markup">&lt;tc:script/></code> tags,
-      one for the TinyMCE and the other for the integration in this application.
+      one for the TinyMCE itself and the other for the initialization in this demo.
       The <code class="language-markup">&lt;tc:textarea/></code> contain
       <code class="language-markup">&lt;tc:dataAttribute name="html-editor" value="tinymce"/></code>,
-      to mark this textarea to be used as rich text editor. The initialization is initialted by the
-      <code>tinymce.js</code> script.
+      to mark this textarea to be used as rich text editor. The initialization is done by the
+      <code>init-tinymce.js</code> script.
     </p>
 
-    <tc:box id="sourceCodeBox" label="tinymce.js" collapsed="true" collapsedMode="hidden">
+    <tc:box id="sourceCodeBox" label="init-tinymce.js" collapsed="true" collapsedMode="hidden">
       <f:facet name="bar">
         <tc:buttons>
           <tc:button label="show" omit="true">
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/110-wysiwyg/00-tinymce/tinymce.js b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/110-wysiwyg/00-tinymce/init-tinymce.js
similarity index 100%
rename from tobago-example/tobago-example-demo/src/main/webapp/content/20-component/110-wysiwyg/00-tinymce/tinymce.js
rename to tobago-example/tobago-example-demo/src/main/webapp/content/20-component/110-wysiwyg/00-tinymce/init-tinymce.js