most of the way through making the wcm tinymce extensions available from create html. still need to address:

- IE issues
- how to handle uploaded files from the create html context
- break out the filepicker backing code into its own bean (it's mingled into the XFormsBean at the moment)

also reorganizing and pruning the xforms unit test tree.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5613 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2007-05-03 21:26:41 +00:00
parent 5c0ece107f
commit 9c3197d467
13 changed files with 362 additions and 287 deletions

View File

@@ -788,6 +788,16 @@ public class CreateWebContentWizard extends BaseContentWizard
return this.startWorkflow;
}
/**
* Provides the url to the preview sandbox containing the asset currently
* being edited.
*/
public String getPreviewSandboxUrl()
{
return AVMConstants.buildWebappUrl(AVMConstants.getCorrespondingPreviewStoreName(this.avmBrowseBean.getSandbox()),
this.avmBrowseBean.getWebapp());
}
public String getSummary()
{
final ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());

View File

@@ -68,6 +68,7 @@ public class XFormsProcessor
? "dojo.js.uncompressed.js"
: "dojo.js"),
"/scripts/ajax/ajax_helper.js",
"/scripts/ajax/tiny_mce_wcm_extensions.js",
"/scripts/ajax/xforms.js",
"/scripts/ajax/file_picker_widget.js",
"/scripts/upload_helper.js",
@@ -211,7 +212,7 @@ public class XFormsProcessor
}
final ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
js.append("alfresco.xforms.constants.resources = {\n");
js.append("alfresco.resources = {\n");
for (String k : BUNDLE_KEYS)
{
js.append(k).

View File

@@ -1,4 +1,4 @@
<%--
<!--
* Copyright (C) 2005-2007 Alfresco Software Limited.
* This program is free software; you can redistribute it and/or
@@ -20,18 +20,55 @@
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
* http://www.alfresco.com/legal/licensing
-->
<jsp:root version="1.2"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:pr="http://www.alfresco.org/alfresco/pr"
xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<f:verbatim>
<script language="javascript" type="text/javascript" src="<%=request.getContextPath()%>/scripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
<jsp:output doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8"/>
<jsp:directive.page isELIgnored="false"/>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/tiny_mce.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/tiny_mce_wcm_extensions.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/file_picker_widget.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/ajax_helper.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/dojo/dojo.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/upload_helper.js">&#160;</script>
<script language="javascript" type="text/javascript">
if (!String.prototype.startsWith)
{
String.prototype.startsWith = function(s)
{
return this.indexOf(s) == 0;
}
}
<!-- Init the Tiny MCE in-line HTML editor -->
var alfresco = typeof alfresco == "undefined" ? {} : alfresco;
alfresco.constants = typeof alfresco.constants == "undefined" ? {} : alfresco.constants;
alfresco.constants.WEBAPP_CONTEXT = "${pageContext.request.contextPath}";
alfresco.constants.AVM_WEBAPP_URL = "${WizardManager.bean.previewSandboxUrl}";
alfresco.resources = {
loading: "${msg.loading}",
ide: "${msg.idle}",
add_content: "${msg.add_content}",
go_up: "${msg.go_up}",
upload: "${msg.upload}",
path: "${msg.path}",
cancel: "${msg.cancel}"
};
<%-- Init the Tiny MCE in-line HTML editor --%>
tinyMCE.init({
theme : "advanced",
mode : "exact",
@@ -44,7 +81,9 @@
theme_advanced_buttons2_add : "separator,forecolor,backcolor",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_disable: "styleselect",
extended_valid_elements : "a[href|target|name],font[face|size|color|style],span[class|align|style]"
extended_valid_elements : "a[href|target|name],font[face|size|color|style],span[class|align|style]",
urlconverter_callback: "alfresco_TinyMCE_urlconverter_callback",
execcommand_callback: "alfresco_TinyMCE_execcommand_callback",
});
function saveContent(id, content)
@@ -54,12 +93,10 @@
var isIE = (document.all);
</script>
</script>
<div id='editor' style='width:100%; height:360px'>
</f:verbatim>
<div id='editor' style='width:100%; height:360px'>
<h:outputText value="#{WizardManager.bean.content}" escape="false" />
<f:verbatim>
</div>
</f:verbatim>
<h:inputHidden id="editor-output" value="#{WizardManager.bean.content}" />
</div>
<h:inputHidden id="editor-output" value="#{WizardManager.bean.content}" />
</jsp:root>

View File

@@ -41,9 +41,6 @@
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/mctabs.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/form_utils.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/themes/advanced/jscripts/image.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/dojo/dojo.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/ajax_helper.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/file_picker_widget.js">&#160;</script>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/xforms.css">&#160;</link>
<script type="text/javascript">
alfresco = tinyMCEPopup.windowOpener.alfresco;

View File

@@ -105,8 +105,8 @@ alfresco.AjaxHelper._updateLoaderDisplay = function()
{
var ajaxLoader = alfresco.AjaxHelper._getLoaderElement();
ajaxLoader.innerHTML = (alfresco.AjaxHelper._requests.length == 0
? alfresco.xforms.constants.resources["idle"]
: (alfresco.xforms.constants.resources["loading"] +
? alfresco.resources["idle"]
: (alfresco.resources["loading"] +
(alfresco.AjaxHelper._requests.length > 1
? " (" + alfresco.AjaxHelper._requests.length + ")"
: "...")));

View File

@@ -329,7 +329,7 @@ _showPicker: function(data)
addContentImage.setAttribute("src", alfresco.constants.WEBAPP_CONTEXT + "/images/icons/add.gif");
addContentLink.appendChild(addContentImage);
addContentLink.appendChild(d.createTextNode(alfresco.xforms.constants.resources["add_content"]));
addContentLink.appendChild(d.createTextNode(alfresco.resources["add_content"]));
var navigateToParentLink = d.createElement("a");
headerRightDiv.appendChild(navigateToParentLink);
@@ -358,7 +358,7 @@ _showPicker: function(data)
navigateToParentNodeImage.align = "absmiddle";
navigateToParentNodeImage.setAttribute("src", alfresco.constants.WEBAPP_CONTEXT + "/images/icons/up.gif");
navigateToParentLink.appendChild(navigateToParentNodeImage);
navigateToParentLink.appendChild(d.createTextNode(alfresco.xforms.constants.resources["go_up"]));
navigateToParentLink.appendChild(d.createTextNode(alfresco.resources["go_up"]));
headerRightDiv.style.position = "absolute";
headerRightDiv.style.height = headerDiv.style.height;
@@ -380,7 +380,7 @@ _showPicker: function(data)
cancelButton.type = "button";
cancelButton.filePickerWidget = this;
cancelButton.value = alfresco.xforms.constants.resources["cancel"];
cancelButton.value = alfresco.resources["cancel"];
footerDiv.appendChild(cancelButton);
cancelButton.style.margin = ((.5 * footerDiv.offsetHeight) -
@@ -547,7 +547,7 @@ _showAddContent: function(currentPath)
dojo.dom.removeChildren(w.addContentDiv);
var fileName = event.target.value.replace(/.*[\/\\]([^\/\\]+)/, "$1");
w.addContentDiv.appendChild(d.createTextNode(alfresco.xforms.constants.resources["upload"] + ": " + fileName));
w.addContentDiv.appendChild(d.createTextNode(alfresco.resources["upload"] + ": " + fileName));
var img = d.createElement("img");
img.setAttribute("src", alfresco.constants.WEBAPP_CONTEXT +
"/images/icons/process_animation.gif");
@@ -661,7 +661,7 @@ _openParentPathMenu: function(target, path)
pathTextDiv.style.fontWeight = "bold";
pathTextDiv.style.paddingLeft = "5px";
pathTextDiv.appendChild(d.createTextNode(alfresco.xforms.constants.resources["path"]));
pathTextDiv.appendChild(d.createTextNode(alfresco.resources["path"]));
this.parentPathMenu.appendChild(pathTextDiv);
var currentPathNodes = [];
for (var i = 0; i < parentNodes.length; i++)

View File

@@ -0,0 +1,225 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
////////////////////////////////////////////////////////////////////////////////
// TinyMCE extensions for wcm
//
// This script provides callbacks used for overriding the default image and
// link dialogs for presenting a file picker to browse the repository.
//
// This script requires tiny_mce.js, and some alfresco.constants to be
// loaded in advance.
////////////////////////////////////////////////////////////////////////////////
function alfresco_TinyMCE_urlconverter_callback(href, element, onsave)
{
// dojo.debug("request to convert " + href + " onsave = " + onsave);
if (onsave)
{
return (href && href.startsWith(alfresco.constants.AVM_WEBAPP_URL)
? href.substring(alfresco.constants.AVM_WEBAPP_URL.length)
: href);
}
else
{
return (href && href.startsWith("/")
? alfresco.constants.AVM_WEBAPP_URL + href
: href);
}
}
function alfresco_TinyMCE_execcommand_callback(editor_id, elm, command, user_interface, value)
{
if (command == "mceLink")
{
// BEGIN COPIED FROM ADVANCED THEME editor_template_src.js
var inst = tinyMCE.getInstanceById(editor_id);
var doc = inst.getDoc();
var selectedText = (tinyMCE.isMSIE
? doc.selection.createRange().text
: inst.getSel().toString());
if (!tinyMCE.linkElement &&
tinyMCE.selectedElement.nodeName.toLowerCase() != "img" &&
selectedText.length <= 0)
{
return true;
}
var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";
if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")
{
tinyMCE.linkElement = tinyMCE.selectedElement;
}
// Is anchor not a link
if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")
{
tinyMCE.linkElement = null;
}
if (tinyMCE.linkElement)
{
href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href');
target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target');
title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title');
onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');
// Try old onclick to if copy/pasted content
if (onclick == "")
{
onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
}
onclick = tinyMCE.cleanupEventStr(onclick);
href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
// Use mce_href if defined
mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');
if (mceRealHref != "")
{
href = mceRealHref;
if (tinyMCE.getParam('convert_urls'))
{
href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
}
}
action = "update";
}
var window_props = { file: alfresco.constants.WEBAPP_CONTEXT + "/jsp/wcm/tiny_mce_link_dialog.jsp",
width: 510 + tinyMCE.getLang('lang_insert_link_delta_width', 0),
height: 400 + tinyMCE.getLang('lang_insert_link_delta_height', 0) };
var dialog_props = { href: href,
target: target,
title: title,
onclick: onclick,
action: action,
className: style_class,
inline: "yes" };
tinyMCE.openWindow(window_props, dialog_props);
return true;
}
else if (command == "mceImage")
{
var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "",
title = "", onmouseover = "", onmouseout = "", action = "insert";
var img = tinyMCE.imgElement;
var inst = tinyMCE.getInstanceById(editor_id);
if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img")
{
img = tinyMCE.selectedElement;
tinyMCE.imgElement = img;
}
if (img)
{
// Is it a internal MCE visual aid image, then skip this one.
if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0)
{
return true;
}
src = tinyMCE.getAttrib(img, 'src');
alt = tinyMCE.getAttrib(img, 'alt');
// Try polling out the title
if (alt == "")
{
alt = tinyMCE.getAttrib(img, 'title');
}
// Fix width/height attributes if the styles is specified
if (tinyMCE.isGecko)
{
var w = img.style.width;
if (w != null && w.length != 0)
{
img.setAttribute("width", w);
}
var h = img.style.height;
if (h != null && h.length != 0)
{
img.setAttribute("height", h);
}
}
border = tinyMCE.getAttrib(img, 'border');
hspace = tinyMCE.getAttrib(img, 'hspace');
vspace = tinyMCE.getAttrib(img, 'vspace');
width = tinyMCE.getAttrib(img, 'width');
height = tinyMCE.getAttrib(img, 'height');
align = tinyMCE.getAttrib(img, 'align');
onmouseover = tinyMCE.getAttrib(img, 'onmouseover');
onmouseout = tinyMCE.getAttrib(img, 'onmouseout');
title = tinyMCE.getAttrib(img, 'title');
// Is realy specified?
if (tinyMCE.isMSIE)
{
width = img.attributes['width'].specified ? width : "";
height = img.attributes['height'].specified ? height : "";
}
//onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover));
//onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout));
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
// Use mce_src if defined
mceRealSrc = tinyMCE.getAttrib(img, 'mce_src');
if (mceRealSrc != "")
{
src = mceRealSrc;
if (tinyMCE.getParam('convert_urls'))
{
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
}
}
action = "update";
}
var window_props = { file: alfresco.constants.WEBAPP_CONTEXT + "/jsp/wcm/tiny_mce_image_dialog.jsp",
width: 510 + tinyMCE.getLang('lang_insert_image_delta_width', 0),
height: 400 + (tinyMCE.isMSIE ? 25 : 0) + tinyMCE.getLang('lang_insert_image_delta_height', 0) };
var dialog_props = { src: src,
alt: alt,
border: border,
hspace: hspace,
vspace: vspace,
width: width,
height: height,
align: align,
title: title,
onmouseover: onmouseover,
onmouseout: onmouseout,
action: action,
inline: "yes" };
tinyMCE.openWindow(window_props, dialog_props);
return true;
}
else
{
return false;
}
}

View File

@@ -20,8 +20,8 @@
//
// This script communicates with the XFormBean to produce and manage an xform.
//
// This script requires dojo.js, tiny_mce.js, and upload_helper.js to be
// loaded in advance.
// This script requires dojo.js, tiny_mce.js, tiny_mce_wcm_extensions.js, and
// upload_helper.js to be loaded in advance.
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
@@ -988,9 +988,9 @@ dojo.declare("alfresco.xforms.RichTextEditor",
{
this.hoverLayer = document.createElement("div");
dojo.html.setClass(this.hoverLayer, "xformsRichTextEditorHoverLayer");
this.hoverLayer.appendChild(document.createTextNode(alfresco.xforms.constants.resources["click_to_edit"]));
this.hoverLayer.appendChild(document.createTextNode(alfresco.resources["click_to_edit"]));
}
if (!this.hoverLayer.parentNode)
if (this.hoverLayer.parentNode != this.widget)
{
this.widget.appendChild(this.hoverLayer);
this.hoverLayer.style.lineHeight = this.hoverLayer.offsetHeight + "px";
@@ -1009,7 +1009,7 @@ dojo.declare("alfresco.xforms.RichTextEditor",
_hoverLayer_mouseoutHandler: function(event)
{
if (this.hoverLayer.parentNode)
if (this.hoverLayer.parentNode == this.widget)
{
this.widget.removeChild(this.hoverLayer);
}
@@ -1017,7 +1017,7 @@ dojo.declare("alfresco.xforms.RichTextEditor",
_hoverLayer_clickHandler: function(event)
{
if (this.hoverLayer.parentNode)
if (this.hoverLayer.parentNode == this.widget)
{
this.widget.removeChild(this.hoverLayer);
this._createTinyMCE();
@@ -1260,7 +1260,7 @@ dojo.declare("alfresco.xforms.ListSelect",
}
}
this._commitValueChange();
},
}
});
/**
@@ -1522,7 +1522,7 @@ dojo.declare("alfresco.xforms.DatePicker",
: null);
// XXXarielb - change to a static
this._noValueSet = (alfresco.xforms.constants.resources["eg"] + " " +
this._noValueSet = (alfresco.resources["eg"] + " " +
dojo.date.format(new Date(),
{datePattern: alfresco.xforms.constants.DATE_FORMAT,
selector: 'dateOnly'}));
@@ -1692,7 +1692,7 @@ dojo.declare("alfresco.xforms.TimePicker",
function(xform, xformsNode)
{
dojo.require("dojo.widget.TimePicker");
this._noValueSet = (alfresco.xforms.constants.resources["eg"] + " " +
this._noValueSet = (alfresco.resources["eg"] + " " +
dojo.date.format(new Date(),
{timePattern: alfresco.xforms.constants.TIME_FORMAT,
selector: "timeOnly"}));
@@ -1864,7 +1864,7 @@ dojo.declare("alfresco.xforms.DateTimePicker",
dojo.require("dojo.widget.DatePicker");
dojo.require("dojo.widget.TimePicker");
this._noValueSet = (alfresco.xforms.constants.resources["eg"] + " " +
this._noValueSet = (alfresco.resources["eg"] + " " +
dojo.date.format(new Date(),
{datePattern: alfresco.xforms.constants.DATE_TIME_FORMAT,
selector: "dateOnly"}));
@@ -4411,7 +4411,7 @@ dojo.declare("alfresco.xforms.XForm",
{
this.submitWidget = null;
var invalid = this.rootWidget.getWidgetsInvalidForSubmit();
_show_error(document.createTextNode(alfresco.xforms.constants.resources["validation_provide_values_for_required_fields"]));
_show_error(document.createTextNode(alfresco.resources["validation_provide_values_for_required_fields"]));
var error_list = document.createElement("ul");
for (var j = 0; j < invalid.length; j++)
{
@@ -4635,6 +4635,7 @@ dojo.html.toCamelCase = function(str)
////////////////////////////////////////////////////////////////////////////////
// tiny mce integration
////////////////////////////////////////////////////////////////////////////////
tinyMCE.init({
theme: "advanced",
mode: "exact",
@@ -4654,267 +4655,71 @@ tinyMCE.init({
urlconverter_callback: "alfresco_TinyMCE_urlconverter_callback"
});
function alfresco_TinyMCE_urlconverter_callback(href, element, onsave)
{
dojo.debug("request to convert " + href + " onsave = " + onsave);
if (onsave)
{
return (href && href.startsWith(alfresco.constants.AVM_WEBAPP_URL)
? href.substring(alfresco.constants.AVM_WEBAPP_URL.length)
: href);
}
else
{
return (href && href.startsWith("/")
? alfresco.constants.AVM_WEBAPP_URL + href
: href);
}
}
function alfresco_TinyMCE_execcommand_callback(editor_id, elm, command, user_interface, value)
{
if (command == "mceLink")
{
// BEGIN COPIED FROM ADVANCED THEME editor_template_src.js
var inst = tinyMCE.getInstanceById(editor_id);
var doc = inst.getDoc();
var selectedText = (tinyMCE.isMSIE
? doc.selection.createRange().text
: inst.getSel().toString());
if (!tinyMCE.linkElement &&
tinyMCE.selectedElement.nodeName.toLowerCase() != "img" &&
selectedText.length <= 0)
{
return true;
}
var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";
if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")
{
tinyMCE.linkElement = tinyMCE.selectedElement;
}
// Is anchor not a link
if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")
{
tinyMCE.linkElement = null;
}
if (tinyMCE.linkElement)
{
href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href');
target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target');
title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title');
onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');
// Try old onclick to if copy/pasted content
if (onclick == "")
{
onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
}
onclick = tinyMCE.cleanupEventStr(onclick);
href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
// Use mce_href if defined
mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');
if (mceRealHref != "")
{
href = mceRealHref;
if (tinyMCE.getParam('convert_urls'))
{
href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
}
}
action = "update";
}
var window_props = { file: alfresco.constants.WEBAPP_CONTEXT + "/jsp/wcm/tiny_mce_link_dialog.jsp",
width: 510 + tinyMCE.getLang('lang_insert_link_delta_width', 0),
height: 400 + tinyMCE.getLang('lang_insert_link_delta_height', 0) };
var dialog_props = { href: href,
target: target,
title: title,
onclick: onclick,
action: action,
className: style_class,
inline: "yes" };
tinyMCE.openWindow(window_props, dialog_props);
return true;
}
else if (command == "mceImage")
{
var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "",
title = "", onmouseover = "", onmouseout = "", action = "insert";
var img = tinyMCE.imgElement;
var inst = tinyMCE.getInstanceById(editor_id);
if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img")
{
img = tinyMCE.selectedElement;
tinyMCE.imgElement = img;
}
if (img)
{
// Is it a internal MCE visual aid image, then skip this one.
if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0)
{
return true;
}
src = tinyMCE.getAttrib(img, 'src');
alt = tinyMCE.getAttrib(img, 'alt');
// Try polling out the title
if (alt == "")
{
alt = tinyMCE.getAttrib(img, 'title');
}
// Fix width/height attributes if the styles is specified
if (tinyMCE.isGecko)
{
var w = img.style.width;
if (w != null && w.length != 0)
{
img.setAttribute("width", w);
}
var h = img.style.height;
if (h != null && h.length != 0)
{
img.setAttribute("height", h);
}
}
border = tinyMCE.getAttrib(img, 'border');
hspace = tinyMCE.getAttrib(img, 'hspace');
vspace = tinyMCE.getAttrib(img, 'vspace');
width = tinyMCE.getAttrib(img, 'width');
height = tinyMCE.getAttrib(img, 'height');
align = tinyMCE.getAttrib(img, 'align');
onmouseover = tinyMCE.getAttrib(img, 'onmouseover');
onmouseout = tinyMCE.getAttrib(img, 'onmouseout');
title = tinyMCE.getAttrib(img, 'title');
// Is realy specified?
if (tinyMCE.isMSIE)
{
width = img.attributes['width'].specified ? width : "";
height = img.attributes['height'].specified ? height : "";
}
//onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover));
//onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout));
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
// Use mce_src if defined
mceRealSrc = tinyMCE.getAttrib(img, 'mce_src');
if (mceRealSrc != "")
{
src = mceRealSrc;
if (tinyMCE.getParam('convert_urls'))
{
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
}
}
action = "update";
}
var window_props = { file: alfresco.constants.WEBAPP_CONTEXT + "/jsp/wcm/tiny_mce_image_dialog.jsp",
width: 510 + tinyMCE.getLang('lang_insert_image_delta_width', 0),
height: 400 + (tinyMCE.isMSIE ? 25 : 0) + tinyMCE.getLang('lang_insert_image_delta_height', 0) };
var dialog_props = { src: src,
alt: alt,
border: border,
hspace: hspace,
vspace: vspace,
width: width,
height: height,
align: align,
title: title,
onmouseover: onmouseover,
onmouseout: onmouseout,
action: action,
inline: "yes" };
tinyMCE.openWindow(window_props, dialog_props);
return true;
}
else
{
return false;
}
}
alfresco.xforms.widgetConfig =
{
"xf:group":
{
"*": { "minimal": { "className": alfresco.xforms.HGroup }, "*": { "className": alfresco.xforms.VGroup }}
"*": { "minimal": { className: alfresco.xforms.HGroup }, "*": { className: alfresco.xforms.VGroup }}
},
"xf:repeat":
{
"*": { "*": { "className": alfresco.xforms.Repeat } }
"*": { "*": { className: alfresco.xforms.Repeat } }
},
"xf:textarea":
{
"*": { "minimal": { "className": alfresco.xforms.PlainTextEditor },
"*": { "className": alfresco.xforms.RichTextEditor, params: [ "bold,italic,underline,separator,forecolor,backcolor,separator,link,unlink,image", "", "" ] },
"full": { "className": alfresco.xforms.RichTextEditor, params: ["bold,italic,underline,strikethrough,separator,fontselect,fontsizeselect", "link,unlink,image,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo,separator,forecolor,backcolor", "" ] }},
"*":
{
"minimal": { className: alfresco.xforms.PlainTextEditor },
"*": { className: alfresco.xforms.RichTextEditor, params: [ "bold,italic,underline,separator,forecolor,backcolor,separator,link,unlink,image", "", "" ] },
"full": { className: alfresco.xforms.RichTextEditor, params: ["bold,italic,underline,strikethrough,separator,fontselect,fontsizeselect", "link,unlink,image,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo,separator,forecolor,backcolor", "" ] }
}
},
"xf:upload":
{
"*": { "*": { "className": alfresco.xforms.FilePicker } }
"*": { "*": { className: alfresco.xforms.FilePicker } }
},
"xf:range":
{
"*": { "*": { "className": alfresco.xforms.NumericalRange } }
"*": { "*": { className: alfresco.xforms.NumericalRange } }
},
"xf:input":
{
"date": { "*": { "className": alfresco.xforms.DatePicker }},
"time": { "*": { "className": alfresco.xforms.TimePicker }},
"gDay": { "*": { "className": alfresco.xforms.DayPicker }},
"gMonth": { "*": { "className": alfresco.xforms.MonthPicker }},
"gYear": { "*": { "className": alfresco.xforms.YearPicker }},
"gMonthDay": { "*": { "className": alfresco.xforms.MonthDayPicker }},
"gYearMonth": { "*": { "className": alfresco.xforms.YearMonthPicker }},
"dateTime": { "*": { "className": alfresco.xforms.DateTimePicker }},
"*": { "*": { "className": alfresco.xforms.TextField }}
"date": { "*": { className: alfresco.xforms.DatePicker }},
"time": { "*": { className: alfresco.xforms.TimePicker }},
"gDay": { "*": { className: alfresco.xforms.DayPicker }},
"gMonth": { "*": { className: alfresco.xforms.MonthPicker }},
"gYear": { "*": { className: alfresco.xforms.YearPicker }},
"gMonthDay": { "*": { className: alfresco.xforms.MonthDayPicker }},
"gYearMonth": { "*": { className: alfresco.xforms.YearMonthPicker }},
"dateTime": { "*": { className: alfresco.xforms.DateTimePicker }},
"*": { "*": { className: alfresco.xforms.TextField }}
},
"xf:select1":
{
"boolean": { "*": { "className": alfresco.xforms.Checkbox }},
"*": { "full": { "className": alfresco.xforms.RadioSelect1},
"*": { "className": alfresco.xforms.ComboboxSelect1 }}
"boolean": { "*": { className: alfresco.xforms.Checkbox }},
"*": { "full": { className: alfresco.xforms.RadioSelect1},
"*": { className: alfresco.xforms.ComboboxSelect1 }}
},
"xf:select":
{
"*": { "full": { "className": alfresco.xforms.CheckboxSelect},
"*": { "className": alfresco.xforms.ListSelect }}
"*": { "full": { className: alfresco.xforms.CheckboxSelect},
"*": { className: alfresco.xforms.ListSelect }}
},
"xf:submit":
{
"*": { "*": { "className": alfresco.xforms.Submit } }
"*": { "*": { className: alfresco.xforms.Submit } }
},
"xf:trigger":
{
"*": { "*": { "className": alfresco.xforms.Trigger }}
"*": { "*": { className: alfresco.xforms.Trigger }}
},
"xf:switch":
{
"*": { "*": { "className": alfresco.xforms.SwitchGroup } }
"*": { "*": { className: alfresco.xforms.SwitchGroup } }
},
"xf:case":
{
"*": { "*": { "className": alfresco.xforms.CaseGroup }}
"*": { "*": { className: alfresco.xforms.CaseGroup }}
},
"chiba:data": { "*": { "*": null } },
"xf:label": { "*": { "*": null } },