Author: alevkovsky
Date: 2008-10-29 10:40:30 -0400 (Wed, 29 Oct 2008)
New Revision: 10965
Modified:
trunk/sandbox/ui/editor/src/main/config/component/editor.xml
trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
trunk/sandbox/ui/editor/src/main/templates/editor.jspx
Log:
RichEditor: adjust Faces suffix transferring
implement basic attributes
change editor initialization mode
Modified: trunk/sandbox/ui/editor/src/main/config/component/editor.xml
===================================================================
--- trunk/sandbox/ui/editor/src/main/config/component/editor.xml 2008-10-29 14:36:58 UTC
(rev 10964)
+++ trunk/sandbox/ui/editor/src/main/config/component/editor.xml 2008-10-29 14:40:30 UTC
(rev 10965)
@@ -26,6 +26,18 @@
</test>
</tag>
&ui_component_attributes;
+ <property>
+ <name>style</name>
+ <classname>java.lang.String</classname>
+ <description>CSS style(s) is/are to be applied when this component is
rendered</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>styleClass</name>
+ <classname>java.lang.String</classname>
+ <description>Corresponds to the HTML class attribute</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
<property hidden="true">
<name>type</name>
<classname>java.lang.String</classname>
@@ -58,14 +70,6 @@
</description>
<defaultvalue>"simple"</defaultvalue>
</property>
- <property hidden="true">
- <name>mode</name>
- <classname>java.lang.String</classname>
- <description>
- Attribute defines Editor mode
- </description>
- <defaultvalue>"textareas"</defaultvalue>
- </property>
<property>
<name>useSeamText</name>
<classname>java.lang.Boolean</classname>
Modified: trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
===================================================================
--- trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-10-29
14:36:58 UTC (rev 10964)
+++ trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-10-29
14:40:30 UTC (rev 10965)
@@ -59,10 +59,6 @@
public abstract String getTheme();
- public abstract void setMode(String mode);
-
- public abstract String getMode();
-
public abstract void setUseSeamText(Boolean useSeamText);
public abstract Boolean getUseSeamText();
Modified:
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
===================================================================
---
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-10-29
14:36:58 UTC (rev 10964)
+++
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-10-29
14:40:30 UTC (rev 10965)
@@ -106,11 +106,24 @@
}
protected String getFacesMappingSuffix(FacesContext context) {
- String suffix = WebXml.getInstance(context).getFacesServletSuffix();
- if (suffix == null) {
- suffix = "";
+ WebXml webXml = WebXml.getInstance(context);
+ String suffix = webXml.getFacesServletSuffix();
+ String prefix = webXml.getFacesServletPrefix();
+ String filterPrefix = webXml.getFacesFilterPrefix();
+ String filterSuffix = webXml.getFacesFilterSuffix();
+ if (filterPrefix != null) {
+ return "";
}
- return suffix;
+ if (filterSuffix != null) {
+ return filterSuffix;
+ }
+ if (prefix != null) {
+ return "";
+ }
+ if (suffix != null) {
+ return suffix;
+ }
+ return "";
}
}
Modified:
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java
===================================================================
---
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java 2008-10-29
14:36:58 UTC (rev 10964)
+++
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java 2008-10-29
14:40:30 UTC (rev 10965)
@@ -138,9 +138,24 @@
* @return
*/
private String getFacesMappingSuffix(InternetResource resource) {
- WebXml w = WebXml.getInstance();
- String suffix = w.getFacesServletSuffix();
- return suffix;
+ WebXml webXml = WebXml.getInstance();
+ String suffix = webXml.getFacesServletSuffix();
+ String prefix = webXml.getFacesServletPrefix();
+ String filterPrefix = webXml.getFacesFilterPrefix();
+ String filterSuffix = webXml.getFacesFilterSuffix();
+ if (filterPrefix != null) {
+ return "";
+ }
+ if (filterSuffix != null) {
+ return filterSuffix;
+ }
+ if (prefix != null) {
+ return "";
+ }
+ if (suffix != null) {
+ return suffix;
+ }
+ return "";
}
/**
Modified:
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
===================================================================
---
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-10-29
14:36:58 UTC (rev 10964)
+++
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-10-29
14:40:30 UTC (rev 10965)
@@ -15,13 +15,14 @@
obj.richfacesComponent="richfaces:editor";
this["rich:destructor"] = "destruct";
- Richfaces.Editor.extSuffix = params.suffix;
+ Richfaces.Editor.extSuffix = params.extSuffix;
this.tinyMCE_editor = null;
this.onInitInstanceCallbackFunction = tinyparams.onInitInstanceCallback;
tinyMCE.init({
- mode: tinyparams.mode,
+ mode: 'exact',
+ elements: this.editorTextAreaId,
theme: tinyparams.theme,
init_instance_callback : this.onInitInstanceCallback.bind(this)
});
Modified: trunk/sandbox/ui/editor/src/main/templates/editor.jspx
===================================================================
--- trunk/sandbox/ui/editor/src/main/templates/editor.jspx 2008-10-29 14:36:58 UTC (rev
10964)
+++ trunk/sandbox/ui/editor/src/main/templates/editor.jspx 2008-10-29 14:40:30 UTC (rev
10965)
@@ -13,8 +13,8 @@
<f:clientid var="clientId"/>
<h:styles>css/editor.xcss</h:styles>
<h:scripts>new org.ajax4jsf.javascript.AjaxScript(), new
org.ajax4jsf.javascript.PrototypeScript(), scripts/editor.js,
scripts/tiny_mce/tiny_mce_src.js</h:scripts>
- <div id="#{clientId}" x:passThruWithExclusions="id,value"
- class="rich-editor">
+ <div id="#{clientId}"
x:passThruWithExclusions="id,value,styleClass,class"
+ class="rich-editor #{component.attributes['styleClass']}"
style="#{component.attributes['style']}">
<textarea id="#{clientId}TextArea" name='#{clientId}TextArea'
style="width: #{component.attributes['width']}px; height:
#{component.attributes['height']}px; visibility: hidden">
@@ -23,7 +23,6 @@
<script type="text/javascript">
new RichEditor('#{clientId}',
{extSuffix:'#{this:getFacesMappingSuffix(context)}'}, {
- mode: '#{component.attributes["mode"]}',
theme: '#{component.attributes["theme"]}'}
);
</script>
Show replies by date