diff --git a/source/java/org/alfresco/web/bean/content/CreateXmlContentTypeWizard.java b/source/java/org/alfresco/web/bean/content/CreateXmlContentTypeWizard.java
index a2d4cd8286..6c9553ec73 100644
--- a/source/java/org/alfresco/web/bean/content/CreateXmlContentTypeWizard.java
+++ b/source/java/org/alfresco/web/bean/content/CreateXmlContentTypeWizard.java
@@ -212,6 +212,12 @@ public class CreateXmlContentTypeWizard extends BaseWizardBean
*/
public String getPresentationTemplateType()
{
+ if (this.getPresentationTemplateFileName() != null)
+ {
+ // String s = this.getPresentationTemplateFileName();
+ // String extension =
+ this.presentationTemplateType = "XSL";
+ }
return this.presentationTemplateType;
}
diff --git a/source/java/org/alfresco/web/templating/xforms/XFormsInputMethod.java b/source/java/org/alfresco/web/templating/xforms/XFormsInputMethod.java
index 7d9f4c9c32..236f72091f 100644
--- a/source/java/org/alfresco/web/templating/xforms/XFormsInputMethod.java
+++ b/source/java/org/alfresco/web/templating/xforms/XFormsInputMethod.java
@@ -74,16 +74,25 @@ public class XFormsInputMethod
e.appendChild(result.createTextNode("djConfig = { isDebug: false };\n" +
"var WEBAPP_CONTEXT = \"" + cp + "\";\n"));
div.appendChild(e);
+
+ e = result.createElement("script");
+ e.setAttribute("type", "text/javascript");
+ e.setAttribute("src", cp + "/scripts/tiny_mce/tiny_mce_src.js");
+ e.appendChild(result.createTextNode("\n"));
+ div.appendChild(e);
+
e = result.createElement("script");
e.setAttribute("type", "text/javascript");
e.setAttribute("src", cp + "/scripts/ajax/dojo.js");
e.appendChild(result.createTextNode("\n"));
div.appendChild(e);
+
e = result.createElement("script");
e.setAttribute("type", "text/javascript");
e.setAttribute("src", cp + "/scripts/ajax/xforms.js");
e.appendChild(result.createTextNode("\n"));
div.appendChild(e);
+
ts.writeXML(result, out);
}
diff --git a/source/web/jsp/content/create-content-wizard/create-xml.jsp b/source/web/jsp/content/create-content-wizard/create-xml.jsp
index 0d29443c92..9ea46974f9 100644
--- a/source/web/jsp/content/create-content-wizard/create-xml.jsp
+++ b/source/web/jsp/content/create-content-wizard/create-xml.jsp
@@ -56,26 +56,28 @@ tim.generate(instanceData, tt, out);
diff --git a/source/web/jsp/dialog/edit-xml-inline.jsp b/source/web/jsp/dialog/edit-xml-inline.jsp
index 2c0cd1e521..1d6d946a09 100644
--- a/source/web/jsp/dialog/edit-xml-inline.jsp
+++ b/source/web/jsp/dialog/edit-xml-inline.jsp
@@ -214,27 +214,8 @@ final InstanceData instanceData = new InstanceData() {
diff --git a/source/web/scripts/ajax/xforms.js b/source/web/scripts/ajax/xforms.js
index d00c57ae62..9a782a3639 100644
--- a/source/web/scripts/ajax/xforms.js
+++ b/source/web/scripts/ajax/xforms.js
@@ -10,6 +10,21 @@ dojo.require("dojo.html.style");
dojo.hostenv.writeIncludes();
dojo.addOnLoad(xforms_init);
+tinyMCE.init({
+ theme : "advanced",
+ mode : "exact",
+ // elements : "editor",
+ save_callback : "saveContent",
+ add_unload_trigger: false,
+ add_form_submit_trigger: false,
+ theme_advanced_toolbar_location : "top",
+ theme_advanced_toolbar_align : "left",
+ theme_advanced_buttons1_add : "fontselect,fontsizeselect",
+ theme_advanced_buttons2_add : "separator,forecolor,backcolor",
+ theme_advanced_disable: "styleselect",
+ extended_valid_elements : "a[href|target|name],font[face|size|color|style],span[class|align|style]"
+});
+
//dojo.provide("alfresco.xforms.textarea");
//
//dojo.declare("alfresco.xforms.Widget",
@@ -134,32 +149,34 @@ function load_body(body, ui_element_stack)
cell = document.createElement("td");
row.appendChild(cell);
var nodeRef = document.createElement("div");
- nodeRef.setAttribute("style", "height: 200px; border: solid 1px black;");
+ nodeRef.setAttribute("style", "height: 200px; width: 100%; border: solid 1px black;");
cell.appendChild(nodeRef);
var id = o.getAttribute("id");
+ nodeRef.setAttribute("id", id);
var initial_value = get_initial_value(o) || "";
- nodeRef.appendChild(document.createTextNode(initial_value));
- var w = dojo.widget.createWidget("Editor",
- {
- widgetId: id,
- focusOnLoad: false,
- items: [ "|", "bold", "italic", "underline", "strikethrough", "|", "colorGroup", "|", "createLink", "insertImage" ]
- },
- nodeRef);
- dojo.event.connect(w,
- "setRichText",
- function(event)
- {
- dojo.event.connect(w._richText,
- "onBlur",
- function()
- {
- setXFormsValue(w.widgetId,
- w._richText.getEditorContent());
- });
-
- });
-
+ nodeRef.innerHTML = initial_value;
+ tinyMCE.addMCEControl(nodeRef, id);
+// var w = dojo.widget.createWidget("Editor",
+// {
+// widgetId: id,
+// focusOnLoad: false,
+// items: [ "|", "bold", "italic", "underline", "strikethrough", "|", "colorGroup", "|", "createLink", "insertImage" ]
+// },
+// nodeRef);
+// dojo.event.connect(w,
+// "setRichText",
+// function(event)
+// {
+// dojo.event.connect(w._richText,
+// "onBlur",
+// function()
+// {
+// setXFormsValue(w.widgetId,
+// w._richText.getEditorContent());
+// });
+//
+// });
+//
break;
case "xforms:input":
var id = o.getAttribute("id");
@@ -495,7 +512,8 @@ function fireAction(id)
load: function(type, data, evt)
{
document.submitTrigger.done = true;
- doSubmit();
+ document.submitTrigger.currentButton.click();
+ document.submitTrigger.currentButton = null;
},
error: function(type, e)
{
@@ -520,4 +538,33 @@ function setXFormsValue(id, value)
}
};
dojo.io.bind(req);
-}
\ No newline at end of file
+}
+
+function addSubmitHandlerToButton(b)
+{
+ var baseOnClick = b.onclick;
+ b.onclick = function(event)
+ {
+// alert("submitting xform from " + b.getAttribute("id") +
+// " b " + b +
+// " this " + this );
+ if (!document.submitTrigger.done)
+ {
+ // alert("not done, resubmitting");
+ tinyMCE.triggerSave();
+ document.submitTrigger.currentButton = this;
+ document.submitTrigger.buttonClick();
+ return false;
+ }
+ else
+ {
+ // alert("done - doing base click");
+ return baseOnClick(event);
+ }
+ }
+}
+
+function saveContent(id, content)
+{
+ setXFormsValue(id, content);
+}