Author: pyaschenko
Date: 2008-10-28 09:55:57 -0400 (Tue, 28 Oct 2008)
New Revision: 10940
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/tiny_mce/tiny_mce_src.js
trunk/sandbox/ui/editor/src/main/templates/editor.jspx
Log:
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-28
13:28:49 UTC (rev 10939)
+++
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-10-28
13:55:57 UTC (rev 10940)
@@ -1,29 +1,28 @@
if (!window.Richfaces) window.Richfaces = {};
Richfaces.Editor = {};
Richfaces.Editor.REGEXP_CSS =
/(\/tiny_mce\/(?:themes|plugins)\/[\w\.\\\/]*[\w\.]+\.)(c|C)[sS]{2}$/;
-/*Richfaces.Editor.getResourceURL = function (baseURL, type) {
- return Richfaces.Editor.ResourceHTML.replace("$1", baseURL);
-};*/
+Richfaces.Editor.extSuffix = ".jsf";
-
RichEditor = Class.create();
Object.extend(RichEditor.prototype, {
- initialize: function(id, parameters, suffix) {
+ initialize: function(id, params, tinyparams) {
+ //TODO: suffix
this.id = id;
this.editorTextAreaId = this.id +'TextArea';
- this.params = parameters;
- this.suffix = suffix;
var obj = $(this.id);
obj.component = this;
obj.richfacesComponent="richfaces:editor";
this["rich:destructor"] = "destruct";
- tinymce.extSuffix = this.suffix;
+ Richfaces.Editor.extSuffix = params.suffix;
+ this.tinyMCE_editor = null;
+ this.onInitInstanceCallback = tinyparams.onInitInstanceCallback;
+
tinyMCE.init({
- mode: this.params.mode,
- theme: this.params.theme,
+ mode: this.tinyparams.mode,
+ theme: this.tinyparams.theme,
init_instance_callback : this.onInitInstanceCallback.bind(this)
});
@@ -43,10 +42,9 @@
this.tinyMCE_editor.save();
},
- onInitInstanceCallback: function() {
+ onInitInstanceCallback: function(inst) {
this.tinyMCE_editor = tinyMCE.get(this.editorTextAreaId);
-
- //TODO add user init_instance_callback function
+ if (this.onInitInstanceCallback) this.onInitInstanceCallback.call(this, inst);
}
Modified:
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js
===================================================================
---
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js 2008-10-28
13:28:49 UTC (rev 10939)
+++
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js 2008-10-28
13:55:57 UTC (rev 10940)
@@ -410,7 +410,7 @@
// RF: added by PY
u = u.replace(Richfaces.Editor.REGEXP_CSS, function($1,$2,$3){return
$2+($3=='c' ? "xcss":"XCSS");});
- if (this.extSuffix) u += this.extSuffix;
+ if (Richfaces && Richfaces.Editor) u += Richfaces.Editor.extSuffix;
// RF: end
if (!this.query)
Modified: trunk/sandbox/ui/editor/src/main/templates/editor.jspx
===================================================================
--- trunk/sandbox/ui/editor/src/main/templates/editor.jspx 2008-10-28 13:28:49 UTC (rev
10939)
+++ trunk/sandbox/ui/editor/src/main/templates/editor.jspx 2008-10-28 13:55:57 UTC (rev
10940)
@@ -22,10 +22,9 @@
</textarea>
<script type="text/javascript">
- new RichEditor('#{clientId}', {
- mode: '#{component.attributes['mode']}',
- theme: '#{component.attributes['theme']}'},
- '#{this:getFacesMappingSuffix(context)}'
+ new RichEditor('#{clientId}',
{extSuffix:'#{this:getFacesMappingSuffix(context)}'}, {
+ mode: '#{component.attributes["mode"]}',
+ theme: '#{component.attributes["theme"]}'}
);
</script>
</div>
Show replies by date