Several enhancements for the handling of the new labels and hints:

- Hints are now shown for ControlLinks
- The standard theme uses an better symbol
- Hints and new style labels now work for DHTMLEditors, and widgets Date, Time and DateTime


git-svn-id: https://svn.libreccm.org/ccm/trunk@2755 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-07-11 18:38:38 +00:00
parent 112910e484
commit c510e1566a
12 changed files with 531 additions and 479 deletions

View File

@ -23,7 +23,6 @@ import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ContentSection;
/** /**
* *
* *
@ -42,26 +41,26 @@ public class CMSDHTMLEditor extends DHTMLEditor {
super(model, super(model,
ContentSection.getConfig().getDHTMLEditorConfig()); ContentSection.getConfig().getDHTMLEditorConfig());
addPlugins(); addPlugins();
hideButtons(); hideButtons();
} }
private void addPlugins() { private void addPlugins() {
String[] plugins = ContentSection.getConfig().getDHTMLEditorPlugins(); String[] plugins = ContentSection.getConfig().getDHTMLEditorPlugins();
if (plugins != null) { if (plugins != null) {
for (int i = 0 ; i < plugins.length ; i++) { for (int i = 0; i < plugins.length; i++) {
addPlugin(plugins[i]); addPlugin(plugins[i]);
} }
} }
} }
private void hideButtons() { private void hideButtons() {
String[] hiddenButtons = ContentSection.getConfig().getDHTMLEditorHiddenButtons(); String[] hiddenButtons = ContentSection.getConfig().getDHTMLEditorHiddenButtons();
if (hiddenButtons != null) { if (hiddenButtons != null) {
for (int i = 0 ; i < hiddenButtons.length ; i++) { for (int i = 0; i < hiddenButtons.length; i++) {
hideButton(hiddenButtons[i]); hideButton(hiddenButtons[i]);
} }
} }
} }
} }

View File

@ -281,6 +281,7 @@ public class DHTMLEditor extends TextArea {
Element editor = parent.newChildElement(getElementTag(), BEBOP_XML_NS); Element editor = parent.newChildElement(getElementTag(), BEBOP_XML_NS);
editor.addAttribute("name", getName()); editor.addAttribute("name", getName());
generateDescriptionXML(state, editor);
// Set the needed config params so they don't have to be hardcoded in the theme // Set the needed config params so they don't have to be hardcoded in the theme
editor.addAttribute("editor_url", Web.getWebappContextPath().concat(getEditorURL())); editor.addAttribute("editor_url", Web.getWebappContextPath().concat(getEditorURL()));

View File

@ -324,6 +324,7 @@ public class Date extends Widget implements BebopConstants {
date.addAttribute("label", (String) getLabel().localize(ps.getRequest())); date.addAttribute("label", (String) getLabel().localize(ps.getRequest()));
} }
exportAttributes(date); exportAttributes(date);
generateDescriptionXML(ps, date);
generateLocalizedWidget(ps, date); generateLocalizedWidget(ps, date);
// If Element could be null insert an extra widget to clear entry // If Element could be null insert an extra widget to clear entry

View File

@ -112,6 +112,8 @@ public class DateTime extends Widget implements BebopConstants {
m_date.generateLocalizedWidget(ps, datetime); m_date.generateLocalizedWidget(ps, datetime);
m_time.generateLocalizedWidget(ps, datetime); m_time.generateLocalizedWidget(ps, datetime);
generateDescriptionXML(ps, datetime);
// If Element could be null insert a extra widget to clear entry // If Element could be null insert a extra widget to clear entry
if (!hasValidationListener(new NotNullValidationListener())) { if (!hasValidationListener(new NotNullValidationListener())) {
datetime.newChildElement("NoDateTime"); datetime.newChildElement("NoDateTime");

View File

@ -18,7 +18,6 @@
*/ */
package com.arsdigita.bebop.form; package com.arsdigita.bebop.form;
import com.arsdigita.xml.Element; import com.arsdigita.xml.Element;
import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.PageState;
@ -28,22 +27,20 @@ import com.arsdigita.bebop.parameters.ParameterModel;
// in a constant which is used when generating XML // in a constant which is used when generating XML
import com.arsdigita.bebop.util.BebopConstants; import com.arsdigita.bebop.util.BebopConstants;
/** /**
* A class representing a textarea field in an HTML form. * A class representing a textarea field in an HTML form.
* *
* @author Karl Goldstein * @author Karl Goldstein
* @author Uday Mathur * @author Uday Mathur
* @author Rory Solomon * @author Rory Solomon
* @author Michael Pih * @author Michael Pih
* @version $Id: TextArea.java 287 2005-02-22 00:29:02Z sskracic $ * @version $Id: TextArea.java 287 2005-02-22 00:29:02Z sskracic $
*/ */
public class TextArea extends Widget implements BebopConstants { public class TextArea extends Widget implements BebopConstants {
/** /**
* Constant for specifying <tt>OFF</tt> value for the * Constant for specifying <tt>OFF</tt> value for the
* <tt>WRAP</tt> attribute of this image input. See <a * <tt>WRAP</tt> attribute of this image input. See <a
* href="http://developer.netscape.com/docs/manuals/htmlguid/tags10.htm#1340340">here</a> * href="http://developer.netscape.com/docs/manuals/htmlguid/tags10.htm#1340340">here</a>
* for a description of what this attribute does. * for a description of what this attribute does.
*/ */
@ -51,7 +48,7 @@ public class TextArea extends Widget implements BebopConstants {
/** /**
* Constant for specifying <tt>HARD</tt> value for the * Constant for specifying <tt>HARD</tt> value for the
* <tt>WRAP</tt> attribute of this image input. * See <a * <tt>WRAP</tt> attribute of this image input. * See <a
* //href="http://developer.netscape.com/docs/manuals/htmlguid/tags10.htm#1340340">here</a> * //href="http://developer.netscape.com/docs/manuals/htmlguid/tags10.htm#1340340">here</a>
* for a description of what this attribute does. * for a description of what this attribute does.
*/ */
@ -59,7 +56,7 @@ public class TextArea extends Widget implements BebopConstants {
/** /**
* Constant for specifying <tt>SOFT</tt> value for the * Constant for specifying <tt>SOFT</tt> value for the
* <tt>WRAP</tt> attribute of this image input. See <a * <tt>WRAP</tt> attribute of this image input. See <a
* href="http://developer.netscape.com/docs/manuals/htmlguid/tags10.htm#1340340">here</a> * href="http://developer.netscape.com/docs/manuals/htmlguid/tags10.htm#1340340">here</a>
* for a description of what this attribute does. * for a description of what this attribute does.
*/ */
@ -68,13 +65,9 @@ public class TextArea extends Widget implements BebopConstants {
// ------------------------------------- // -------------------------------------
// * * * Fields * * * // * * * Fields * * *
// ------------------------------------- // -------------------------------------
// ------------------------------------- // -------------------------------------
// * * * Methods * * * // * * * Methods * * *
// ------------------------------------- // -------------------------------------
public TextArea(String name) { public TextArea(String name) {
super(name); super(name);
} }
@ -104,42 +97,42 @@ public class TextArea extends Widget implements BebopConstants {
} }
/** /**
* Returns a string naming the type of this widget. * Returns a string naming the type of this widget.
*/ */
public String getType() { public String getType() {
return "textarea"; return "textarea";
} }
/** /**
* Sets the <tt>ROWS</tt> attribute for the <tt>TEXTAREA</tt> tag. * Sets the <tt>ROWS</tt> attribute for the <tt>TEXTAREA</tt> tag.
*/ */
public void setRows(int rows) { public void setRows(int rows) {
setAttribute("rows", String.valueOf(rows)); setAttribute("rows", String.valueOf(rows));
} }
/** /**
* Sets the <tt>COLS</tt> attribute for the <tt>TEXTAREA</tt> tag. * Sets the <tt>COLS</tt> attribute for the <tt>TEXTAREA</tt> tag.
*/ */
public void setCols(int cols) { public void setCols(int cols) {
setAttribute("cols", String.valueOf(cols)); setAttribute("cols", String.valueOf(cols));
} }
/** /**
* Sets the <tt>WRAP</tt> attribute for the <tt>TEXTAREA</tt> tag. * Sets the <tt>WRAP</tt> attribute for the <tt>TEXTAREA</tt> tag.
*/ */
public void setWrap(int wrap) { public void setWrap(int wrap) {
String wrapString = null; String wrapString = null;
switch (wrap) { switch (wrap) {
case OFF: case OFF:
wrapString = "off"; wrapString = "off";
break; break;
case HARD: case HARD:
wrapString = "hard"; wrapString = "hard";
break; break;
case SOFT: case SOFT:
wrapString = "soft"; wrapString = "soft";
break; break;
} }
if (wrapString != null) { if (wrapString != null) {
@ -149,45 +142,48 @@ public class TextArea extends Widget implements BebopConstants {
/** /**
* Set the default value (text) * Set the default value (text)
*
* @deprecated [since 17Aug2001] use {@link Widget#setDefaultValue(Object)} * @deprecated [since 17Aug2001] use {@link Widget#setDefaultValue(Object)}
*/ */
public void setValue( String text ) { public void setValue(String text) {
this.setDefaultValue(text); this.setDefaultValue(text);
} }
/** /**
* Is this a compound widget? * Is this a compound widget?
*
* @return false * @return false
*/ */
public boolean isCompound() { public boolean isCompound() {
return false; return false;
} }
/** The XML tag. /**
* @return The tag to be used for the top level DOM element * The XML tag.
* generated for this type of Widget. */ *
* @return The tag to be used for the top level DOM element generated for this type of Widget.
*/
protected String getElementTag() { protected String getElementTag() {
return BEBOP_TEXTAREA; return BEBOP_TEXTAREA;
} }
/** /**
* Generates the DOM for the textarea widget. * Generates the DOM for the textarea widget.
* <p>Generates DOM fragment: * <p>
* <p><code>&lt;bebop:textarea name=... value=... [onXXX=...]/> * Generates DOM fragment:
* </code> * <p>
* <code>&lt;bebop:textarea name=... value=... [onXXX=...]/>
* </code>
*/ */
public void generateWidget( PageState state, Element parent ) { public void generateWidget(PageState state, Element parent) {
Element textarea = parent.newChildElement(getElementTag(), BEBOP_XML_NS); Element textarea = parent.newChildElement(getElementTag(), BEBOP_XML_NS);
textarea.addAttribute("name", getName()); textarea.addAttribute("name", getName());
if (getLabel() != null) generateDescriptionXML(state, textarea);
textarea.addAttribute("label",
(String)getLabel().localize(state.getRequest()));
ParameterData pData = getParameterData(state); ParameterData pData = getParameterData(state);
if( null != pData ) { if (null != pData) {
String value = pData.marshal(); String value = pData.marshal();
if ( value == null ) { if (value == null) {
value = ""; value = "";
} }
textarea.addAttribute("value", value); textarea.addAttribute("value", value);

View File

@ -21,7 +21,13 @@ package com.arsdigita.bebop.form;
import com.arsdigita.bebop.Form; import com.arsdigita.bebop.Form;
import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormData;
import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.parameters.*; import com.arsdigita.bebop.parameters.DateTimeParameter;
import com.arsdigita.bebop.parameters.NotNullValidationListener;
import com.arsdigita.bebop.parameters.NumberInRangeValidationListener;
import com.arsdigita.bebop.parameters.ParameterData;
import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.TimeParameter;
import com.arsdigita.bebop.util.BebopConstants; import com.arsdigita.bebop.util.BebopConstants;
import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.globalization.GlobalizationHelper;
import com.arsdigita.util.Assert; import com.arsdigita.util.Assert;
@ -258,6 +264,7 @@ public class Time extends Widget implements BebopConstants {
Element time = parent.newChildElement(getElementTag(), BEBOP_XML_NS); Element time = parent.newChildElement(getElementTag(), BEBOP_XML_NS);
time.addAttribute("name", getParameterModel().getName()); time.addAttribute("name", getParameterModel().getName());
generateDescriptionXML(ps, time);
generateLocalizedWidget(ps, time); generateLocalizedWidget(ps, time);
// If Element could be null insert a extra widget to clear entry // If Element could be null insert a extra widget to clear entry

View File

@ -52,18 +52,16 @@ import com.arsdigita.xml.Element;
* </p> * </p>
* *
* <p> * <p>
* A widget may correspond to a standard HTML form element, or to a more * A widget may correspond to a standard HTML form element, or to a more specific element or set of
* specific element or set of elements, such as a date widget that allows * elements, such as a date widget that allows input of month, day and year (and possibly time as
* input of month, day and year (and possibly time as well).</p> * well).</p>
* *
* <p> * <p>
* This class and its subclasses provide methods to set all element attributes * This class and its subclasses provide methods to set all element attributes except for
* except for <code>VALUE</code>, which is typically dependent on the request. * <code>VALUE</code>, which is typically dependent on the request. At the time of a request, a
* At the time of a request, a widget object merges a dynamically specified * widget object merges a dynamically specified value or set of values with its own set of
* value or set of values with its own set of persistent attributes to render * persistent attributes to render the final HTML for the widget. Other dynamic attributes may be
* the final HTML for the widget. Other dynamic attributes may be associated * associated with the form component via a <code>WidgetPeer</code> associated with the widget.</p>
* with the form component via a <code>WidgetPeer</code> associated with the
* widget.</p>
* *
* @author Karl Goldstein * @author Karl Goldstein
* @author Uday Mathur * @author Uday Mathur
@ -71,7 +69,7 @@ import com.arsdigita.xml.Element;
* @version $Id: Widget.java 1537 2007-03-23 15:33:34Z chrisgilbert23 $ * @version $Id: Widget.java 1537 2007-03-23 15:33:34Z chrisgilbert23 $
*/ */
public abstract class Widget extends DescriptiveComponent public abstract class Widget extends DescriptiveComponent
implements Cloneable, BebopConstants { implements Cloneable, BebopConstants {
private static final Logger s_log = Logger.getLogger(Widget.class); private static final Logger s_log = Logger.getLogger(Widget.class);
@ -80,7 +78,9 @@ public abstract class Widget extends DescriptiveComponent
private ParameterListener m_forwardParameter = null; private ParameterListener m_forwardParameter = null;
private PrintListener m_printListener; private PrintListener m_printListener;
private Form m_form; private Form m_form;
/** The optional (localized) label (or title) of this widget. */ /**
* The optional (localized) label (or title) of this widget.
*/
// Use parent's class' instead // Use parent's class' instead
// private GlobalizedMessage m_label; // private GlobalizedMessage m_label;
@ -96,7 +96,6 @@ public abstract class Widget extends DescriptiveComponent
static final String ON_CHANGE = "onChange"; static final String ON_CHANGE = "onChange";
static final String ON_KEY_UP = "onKeyUp"; static final String ON_KEY_UP = "onKeyUp";
/** /**
* Constructor, creates a new widget. * Constructor, creates a new widget.
* *
@ -110,8 +109,8 @@ public abstract class Widget extends DescriptiveComponent
* Constructor, creates a new widget. * Constructor, creates a new widget.
* *
* <p> * <p>
* Each new widget is associated with a ParameterModel describing the * Each new widget is associated with a ParameterModel describing the data object(s) submitted
* data object(s) submitted from the widget. * from the widget.
* *
* @param model * @param model
*/ */
@ -121,7 +120,6 @@ public abstract class Widget extends DescriptiveComponent
m_parameterModel = model; m_parameterModel = model;
} }
/** /**
* Returns true if the widget consists of multiple HTML elements. * Returns true if the widget consists of multiple HTML elements.
* *
@ -130,8 +128,7 @@ public abstract class Widget extends DescriptiveComponent
public abstract boolean isCompound(); public abstract boolean isCompound();
/** /**
* Returns a string naming the type of this widget. Must be implemented by * Returns a string naming the type of this widget. Must be implemented by subclasses!
* subclasses!
* *
* @return * @return
*/ */
@ -143,11 +140,13 @@ public abstract class Widget extends DescriptiveComponent
*/ */
protected ParameterListener createParameterListener() { protected ParameterListener createParameterListener() {
return new ParameterListener() { return new ParameterListener() {
@Override @Override
public void validate(ParameterEvent evt) public void validate(ParameterEvent evt)
throws FormProcessException { throws FormProcessException {
fireValidation(new ParameterEvent(Widget.this, evt.getParameterData())); fireValidation(new ParameterEvent(Widget.this, evt.getParameterData()));
} }
}; };
} }
@ -161,18 +160,18 @@ public abstract class Widget extends DescriptiveComponent
} }
protected void fireValidation(ParameterEvent evt) protected void fireValidation(ParameterEvent evt)
throws FormProcessException { throws FormProcessException {
Assert.isLocked(this); Assert.isLocked(this);
PageState ps = evt.getPageState(); PageState ps = evt.getPageState();
if ( (!validateInvisible() && !ps.isVisibleOnPage(this)) if ((!validateInvisible() && !ps.isVisibleOnPage(this))
|| ((m_guard != null) && m_guard.shouldValidate(ps)) ) { || ((m_guard != null) && m_guard.shouldValidate(ps))) {
return; return;
} }
for (Iterator it for (Iterator it
= m_listeners.getListenerIterator(ParameterListener.class); = m_listeners.getListenerIterator(ParameterListener.class);
it.hasNext();) { it.hasNext();) {
((ParameterListener) it.next()).validate(evt); ((ParameterListener) it.next()).validate(evt);
} }
@ -198,6 +197,7 @@ public abstract class Widget extends DescriptiveComponent
* Test for existens of a particular type of ValidationListener * Test for existens of a particular type of ValidationListener
* *
* @param listener Subtype of ParameterListern which is tested for * @param listener Subtype of ParameterListern which is tested for
*
* @return true if subtype is in the list * @return true if subtype is in the list
*/ */
public boolean hasValidationListener(ParameterListener listener) { public boolean hasValidationListener(ParameterListener listener) {
@ -208,17 +208,18 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Adds a print listener for this widget. Only one print listener can * Adds a print listener for this widget. Only one print listener can be set for a widget, since
* be set for a widget, since the <code>PrintListener</code> is expected * the <code>PrintListener</code> is expected to modify the target of the
* to modify the target of the <code>PrintEvent</code>. * <code>PrintEvent</code>.
* *
* @param listener the print listener * @param listener the print listener
* @throws IllegalArgumentException <code>listener</code> is null *
* @throws IllegalArgumentException <code>listener</code> is null
* @throws TooManyListenersException a print listener has previously been added * @throws TooManyListenersException a print listener has previously been added
* @pre listener != null * @pre listener != null
*/ */
public void addPrintListener(PrintListener listener) public void addPrintListener(PrintListener listener)
throws TooManyListenersException, IllegalArgumentException { throws TooManyListenersException, IllegalArgumentException {
if (listener == null) { if (listener == null) {
throw new IllegalArgumentException("Argument listener can not be null"); throw new IllegalArgumentException("Argument listener can not be null");
} }
@ -229,17 +230,17 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Set the print listener for this widget. Since there can only be one * Set the print listener for this widget. Since there can only be one print listener for a
* print listener for a widget, this lets you just set it and avoid * widget, this lets you just set it and avoid writing a try/catch block for
* writing a try/catch block for "TooManyListenersException". Any existing * "TooManyListenersException". Any existing listener will be overwritten.
* listener will be overwritten.
* *
* @param listener the print listener * @param listener the print listener
*
* @throws IllegalArgumentException <code>listener</code> is null * @throws IllegalArgumentException <code>listener</code> is null
* @pre listener != null * @pre listener != null
*/ */
public void setPrintListener(PrintListener listener) public void setPrintListener(PrintListener listener)
throws IllegalArgumentException { throws IllegalArgumentException {
if (listener == null) { if (listener == null) {
throw new IllegalArgumentException("Argument listener can not be null"); throw new IllegalArgumentException("Argument listener can not be null");
} }
@ -247,19 +248,18 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Remove a previously added print listener. * Remove a previously added print listener. If <code>listener</code> is not the listener that
* If <code>listener</code> is not the listener that has been added with * has been added with {@link #addPrintListener addPrintListener}, an IllegalArgumentException
* {@link #addPrintListener addPrintListener}, an IllegalArgumentException
* will be thrown. * will be thrown.
* *
* @param listener the listener that had been added with * @param listener the listener that had been added with <code>addPrintListener</code>
* <code>addPrintListener</code> *
* @throws IllegalArgumentException <code>listener</code> is not the * @throws IllegalArgumentException <code>listener</code> is not the currently registered print
* currently registered print listener or is <code>null</code>. * listener or is <code>null</code>.
* @pre listener != null * @pre listener != null
*/ */
public void removePrintListener(PrintListener listener) public void removePrintListener(PrintListener listener)
throws IllegalArgumentException { throws IllegalArgumentException {
if (listener == null) { if (listener == null) {
throw new IllegalArgumentException("listener can not be null"); throw new IllegalArgumentException("listener can not be null");
} }
@ -270,9 +270,8 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Registers the ParameterModel of this Widget with the containing Form. * Registers the ParameterModel of this Widget with the containing Form. This method is used by
* This method is used by the Bebop framework and should not be used by * the Bebop framework and should not be used by application developers.
* application developers.
* *
* @param form * @param form
* @param model * @param model
@ -285,43 +284,43 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Sets the Form Object for this Widget. * Sets the Form Object for this Widget. This method will throw an exception if the _form
* This method will throw an exception if the _form pointer is already set. * pointer is already set. To explicity change the m_form pointer the developer must first call
* To explicity change the m_form pointer the developer must first call
* setForm(null) * setForm(null)
* *
* @param form The <code>Form</code> Object for this Widget * @param form The <code>Form</code> Object for this Widget
*
* @exception IllegalStateException if form already set. * @exception IllegalStateException if form already set.
*/ */
public void setForm(final Form form) { public void setForm(final Form form) {
if (m_form != null && form != null) { if (m_form != null && form != null) {
throw new IllegalStateException("Form " + form.getName() throw new IllegalStateException("Form " + form.getName()
+ " already set for " + " already set for "
+ getName()); + getName());
} }
m_form = form; m_form = form;
} }
/** /**
* Gets the Form Object for this Widget. * Gets the Form Object for this Widget. Throws an exception if the Widget doesn't belong to a
* Throws an exception if the Widget doesn't belong to a form. * form.
* *
* @return the {@link Form} Object for this Widget. * @return the {@link Form} Object for this Widget.
*
* @post return != null * @post return != null
*/ */
public Form getForm() throws RuntimeException { public Form getForm() throws RuntimeException {
if (m_form == null) { if (m_form == null) {
throw new RuntimeException("Widget " + this + " (" + getName() + ") " throw new RuntimeException("Widget " + this + " (" + getName() + ") "
+ "isn't associated with any Form"); + "isn't associated with any Form");
} }
return m_form; return m_form;
} }
/** /**
* Sets the <tt>ONFOCUS</tt> attribute for the HTML tags that compose * Sets the <tt>ONFOCUS</tt> attribute for the HTML tags that compose this element.
* this element.
* *
* @param javascriptCode * @param javascriptCode
*/ */
@ -330,8 +329,7 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Sets the <tt>ONBLUR</tt> attribute for the HTML tags that compose * Sets the <tt>ONBLUR</tt> attribute for the HTML tags that compose this element.
* this element.
* *
* @param javascriptCode * @param javascriptCode
*/ */
@ -340,8 +338,7 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Sets the <tt>ONSELECT</tt> attribute for the HTML tags that compose * Sets the <tt>ONSELECT</tt> attribute for the HTML tags that compose this element.
* this element.
* *
* @param javascriptCode * @param javascriptCode
*/ */
@ -350,8 +347,7 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Sets the <tt>ONCHANGE</tt> attribute for the HTML tags that compose * Sets the <tt>ONCHANGE</tt> attribute for the HTML tags that compose this element.
* this element.
* *
* @param javascriptCode * @param javascriptCode
*/ */
@ -360,8 +356,7 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Sets the <tt>ON_KEY_UP</tt> attribute for the HTML tags that compose * Sets the <tt>ON_KEY_UP</tt> attribute for the HTML tags that compose this element.
* this element.
* *
* @param javascriptCode * @param javascriptCode
*/ */
@ -370,9 +365,8 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Sets the default value in the parameter model for this element. * Sets the default value in the parameter model for this element. This is a static property and
* This is a static property and this method should not be invoked * this method should not be invoked at request time (not even in a PrintListener).
* at request time (not even in a PrintListener).
* *
* @param value * @param value
*/ */
@ -381,9 +375,8 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Marks this widget as readonly, which has the effect of preventing the * Marks this widget as readonly, which has the effect of preventing the user from modifying the
* user from modifying the widget's contents. * widget's contents. This method can only be called on unlocked widgets.
* This method can only be called on unlocked widgets.
*/ */
public void setReadOnly() { public void setReadOnly() {
Assert.isUnlocked(this); Assert.isUnlocked(this);
@ -391,9 +384,8 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Marks this widget as disabled, which has the effect of preventing the * Marks this widget as disabled, which has the effect of preventing the widget's value being
* widget's value being submitted with the form, and will typically cause * submitted with the form, and will typically cause the widget to be 'grayed out' on the form.
* the widget to be 'grayed out' on the form.
* This method can only be called on unlocked widgets. * This method can only be called on unlocked widgets.
*/ */
public void setDisabled() { public void setDisabled() {
@ -405,8 +397,9 @@ public abstract class Widget extends DescriptiveComponent
* Sets a popup hint for the widget. * Sets a popup hint for the widget.
* *
* @param hint * @param hint
* @deprecated refactor to use a GlobalizedMessage instead and use *
* setHint(GlobalizedMessage hint) * @deprecated refactor to use a GlobalizedMessage instead and use setHint(GlobalizedMessage
* hint)
*/ */
public void setHint(String hint) { public void setHint(String hint) {
Assert.isUnlocked(this); Assert.isUnlocked(this);
@ -424,7 +417,6 @@ public abstract class Widget extends DescriptiveComponent
// Assert.isUnlocked(this); // Assert.isUnlocked(this);
// setAttribute("hint", (String) hint.localize()); // setAttribute("hint", (String) hint.localize());
// } // }
/** /**
* Sets a Label for the widget. * Sets a Label for the widget.
* *
@ -434,7 +426,6 @@ public abstract class Widget extends DescriptiveComponent
// public void setLabel(GlobalizedMessage label) { // public void setLabel(GlobalizedMessage label) {
// m_label = label; // m_label = label;
// } // }
/** /**
* Sets a Label for the widget. * Sets a Label for the widget.
* *
@ -444,7 +435,6 @@ public abstract class Widget extends DescriptiveComponent
// public GlobalizedMessage getLabel() { // public GlobalizedMessage getLabel() {
// return m_label; // return m_label;
// } // }
/** /**
* Gets the default value in the parameter model for this element. * Gets the default value in the parameter model for this element.
* *
@ -463,30 +453,28 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* The "pass in" property determines whether the value for this parameter * The "pass in" property determines whether the value for this parameter is generally passed in
* is generally passed in from the outside. * from the outside. If this property is <code>true</code>, the model always tries to get the
* If this property is <code>true</code>, the model always tries to get the * parameter value from the request, no matter whether the request is the initial request or a
* parameter value from the request, no matter whether the request is the * submission of the form to which the widget belongs.
* initial request or a submission of the form to which the widget belongs.
* *
* <p> * <p>
* If this property is <code>false</code>, the parameter value is only read * If this property is <code>false</code>, the parameter value is only read from the request if
* from the request if it is a submission of the form containing the widget. * it is a submission of the form containing the widget.
* *
* <p> * <p>
* By default, this property is <code>false</code>. * By default, this property is <code>false</code>.
* *
* @return <code>true</code> if an attempt should always be made to * @return <code>true</code> if an attempt should always be made to retrieve the parameter value
* retrieve the parameter value from the request. * from the request.
*/ */
public final boolean isPassIn() { public final boolean isPassIn() {
return getParameterModel().isPassIn(); return getParameterModel().isPassIn();
} }
/** /**
* Set whether this parameter should be treated as a "pass in" parameter. * Set whether this parameter should be treated as a "pass in" parameter. This is a static
* This is a static property of the ParameterModel and this method should * property of the ParameterModel and this method should not be invoked at request-time.
* not be invoked at request-time.
* *
* @see #isPassIn * @see #isPassIn
* @param v <code>true</code> if this parameter is a pass in parameter. * @param v <code>true</code> if this parameter is a pass in parameter.
@ -497,10 +485,8 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* The ParameterModel is normally set via the constructors. * The ParameterModel is normally set via the constructors. This method is only rarely needed.
* This method is only rarely needed. * Please note that the previous ParameterModel and all its listeners will be lost.
* Please note that the previous ParameterModel and all its listeners
* will be lost.
* *
* @param parameterModel * @param parameterModel
*/ */
@ -510,11 +496,10 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Allows access to underlying parameterModel. The ParameterModel contains * Allows access to underlying parameterModel. The ParameterModel contains static
* static (request-independent) properties of a Widget such as its name, * (request-independent) properties of a Widget such as its name, default value and its
* default value and its listeners. The ParameterModel can not be modified * listeners. The ParameterModel can not be modified once Page.lock() has been invoked (not even
* once Page.lock() has been invoked (not even in a PrintListener). * in a PrintListener). This is done after the Page has been built, normally at server startup.
* This is done after the Page has been built, normally at server startup.
* *
* @return * @return
*/ */
@ -524,15 +509,14 @@ public abstract class Widget extends DescriptiveComponent
/** /**
* <p> * <p>
* This method creates the DOM for the widget. The method is called by the * This method creates the DOM for the widget. The method is called by the Bebop framework and
* Bebop framework and should not be invoked by application developers. * should not be invoked by application developers.
* </p> * </p>
* *
* <p> * <p>
* The method first fires the print event allowing application developers * The method first fires the print event allowing application developers to set certain
* to set certain properties of the Widget at request time in a * properties of the Widget at request time in a PrintListener. The methods generateWidget and
* PrintListener. The methods generateWidget and generateErrors will then * generateErrors will then be invoked to generate either of the following
* be invoked to generate either of the following
* </p> * </p>
* *
* <p> * <p>
@ -580,8 +564,7 @@ public abstract class Widget extends DescriptiveComponent
/** /**
* The XML tag. * The XML tag.
* *
* @return The tag to be used for the top level DOM element generated for * @return The tag to be used for the top level DOM element generated for this type of Widget.
* this type of Widget.
*/ */
protected String getElementTag() { protected String getElementTag() {
return BEBOP_FORMWIDGET; return BEBOP_FORMWIDGET;
@ -605,11 +588,11 @@ public abstract class Widget extends DescriptiveComponent
widget.addAttribute("type", getType()); widget.addAttribute("type", getType());
widget.addAttribute("name", getName()); widget.addAttribute("name", getName());
widget.addAttribute("class", getName().replace(".", " ")); widget.addAttribute("class", getName().replace(".", " "));
generateDescriptionXML(state,widget); generateDescriptionXML(state, widget);
// if (m_label != null) { // if (m_label != null) {
// widget.addAttribute("label", // widget.addAttribute("label",
// (String) m_label.localize(state.getRequest())); // (String) m_label.localize(state.getRequest()));
// } // }
exportAttributes(widget); exportAttributes(widget);
String value = null; String value = null;
ParameterData p = getParameterData(state); ParameterData p = getParameterData(state);
@ -625,8 +608,7 @@ public abstract class Widget extends DescriptiveComponent
/** /**
* Generates the XML for the given widget. * Generates the XML for the given widget.
* <p> * <p>
* Generates XML fragment: * Generates XML fragment: <code>&lt;bebop:formErrors message=... id=name>
* <code>&lt;bebop:formErrors message=... id=name>
* &lt;/bebop:formErrors></code> * &lt;/bebop:formErrors></code>
* </p> * </p>
* *
@ -646,15 +628,15 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Get the value associated with this widget in the request described by * Get the value associated with this widget in the request described by <code>ps</code>. The
* <code>ps</code>. * type of the returned object depends on the <code>ParameterModel</code> underlying this
* The type of the returned object depends on the <code>ParameterModel</code> * widget. This method is typically called in a FormProcessListener to access the value that was
* underlying this widget. This method is typically called in a * submitted for a Widget in the Form.
* FormProcessListener to access the value that was submitted for a Widget
* in the Form.
* *
* @param ps describes the request currently being processed * @param ps describes the request currently being processed
*
* @return * @return
*
* @pre ps != null * @pre ps != null
* @post may return null * @post may return null
*/ */
@ -676,22 +658,22 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Set the value of the parameter associated with this widget to a new value. * Set the value of the parameter associated with this widget to a new value. The exact type of
* The exact type of <code>value</code> depends on the * <code>value</code> depends on the <code>ParameterModel</code> underlying the widget. This
* <code>ParameterModel</code> underlying the widget. This method is typically * method is typically called in a FormInitListener to initialize the value of a Widget in the
* called in a FormInitListener to initialize the value of a Widget in the
* Form at request time. * Form at request time.
* *
* @param ps * @param ps
* @param value * @param value
*
* @pre ps != null * @pre ps != null
* @post value == getValue(ps) * @post value == getValue(ps)
* *
* @throws IllegalStateException the form to which the widget belongs has * @throws IllegalStateException the form to which the widget belongs has not been processed
* not been processed yet. * yet.
*/ */
public void setValue(PageState ps, Object value) public void setValue(PageState ps, Object value)
throws IllegalStateException { throws IllegalStateException {
Assert.exists(ps, "PageState"); Assert.exists(ps, "PageState");
ParameterData p = getParameterData(ps); ParameterData p = getParameterData(ps);
// set value in session if it is being held - allows // set value in session if it is being held - allows
@ -706,9 +688,9 @@ public abstract class Widget extends DescriptiveComponent
} else { } else {
throw new IllegalStateException("Cannot set value for widget '" + getName() throw new IllegalStateException("Cannot set value for widget '" + getName()
+ "': corresponding form '" + "': corresponding form '"
+ getForm().getName() + getForm().getName()
+ "' has not been processed yet."); + "' has not been processed yet.");
} }
} }
@ -724,7 +706,9 @@ public abstract class Widget extends DescriptiveComponent
/** /**
* *
* @param ps * @param ps
*
* @return the parameter value for this widget * @return the parameter value for this widget
*
* @post returns null if the FormData are missing * @post returns null if the FormData are missing
*/ */
protected ParameterData getParameterData(PageState ps) { protected ParameterData getParameterData(PageState ps) {
@ -737,11 +721,10 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Respond to an incoming request by calling <code>respond</code> on the * Respond to an incoming request by calling <code>respond</code> on the form to which the
* form to which the widget belongs. This method is called by the Bebop * widget belongs. This method is called by the Bebop framework and should not be invoked by
* framework and should not be invoked by application developers. It is * application developers. It is somewhat questionable that this method should ever be called,
* somewhat questionable that this method should ever be called, rather * rather than having {@link Form#respond Form.respond()} called directly.
* than having {@link Form#respond Form.respond()} called directly.
* *
* @throws javax.servlet.ServletException * @throws javax.servlet.ServletException
* @pre state != null * @pre state != null
@ -759,8 +742,8 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Specify a Widget. ValidationGuard implementation to use to determine if * Specify a Widget. ValidationGuard implementation to use to determine if this widget should
* this widget should run its validation listeners. * run its validation listeners.
* *
* @param guard the Widget.ValidationGuard. * @param guard the Widget.ValidationGuard.
*/ */
@ -770,12 +753,13 @@ public abstract class Widget extends DescriptiveComponent
} }
/** /**
* Inner interface used to determine if the validation listeners should be * Inner interface used to determine if the validation listeners should be run for this widget
* run for this widget or not. * or not.
*/ */
public interface ValidationGuard { public interface ValidationGuard {
boolean shouldValidate(PageState ps); boolean shouldValidate(PageState ps);
} }
/** /**
@ -792,6 +776,7 @@ public abstract class Widget extends DescriptiveComponent
* Adds an error to be displayed with this parameter. * Adds an error to be displayed with this parameter.
* *
* @param error A string showing the error to the user. * @param error A string showing the error to the user.
*
* @deprecated refactor to use addError(GlobalizedMessage) instead. * @deprecated refactor to use addError(GlobalizedMessage) instead.
*/ */
public void addError(String error) { public void addError(String error) {
@ -802,4 +787,5 @@ public abstract class Widget extends DescriptiveComponent
public String toString() { public String toString() {
return super.toString() + " [" + getName() + "]"; return super.toString() + " [" + getName() + "]";
} }
} }

View File

@ -443,7 +443,7 @@ div#left {
width: 25%; width: 25%;
} }
div#left, div#right{ div#left, div#right {
top: 0 !important; top: 0 !important;
bottom: 0; bottom: 0;
} }
@ -1482,9 +1482,11 @@ input#draft_search:active {
#content form fieldset { #content form fieldset {
border: none; border: none;
margin: 0.5em 0em 1em 0.3em; margin: 0.5em 0em 1em 0.3em;
border-top: 1px dotted #0776A0; /*border-top: 1px dotted #0776A0; */
border-bottom: 1px dotted #0776A0; /*border-bottom: 1px dotted #0776A0; */
padding: 0.3em 0em; border: 1px dotted #0776A0;
/*padding: 0.3em 0em;*/
padding: 1em;
color: #0776A0; color: #0776A0;
font-weight: bold; font-weight: bold;
} }
@ -1570,6 +1572,10 @@ div.bebopGridPanel{
margin-top: 15px; margin-top: 15px;
} }
.hint {
font-size: 1.6em;
}
.hint:hover:after { .hint:hover:after {
position: absolute; position: absolute;
box-shadow: 0 0 5px #4a4a4a; box-shadow: 0 0 5px #4a4a4a;
@ -1579,7 +1585,9 @@ div.bebopGridPanel{
top: auto; top: auto;
right: auto; right: auto;
width: 30%; width: 30%;
background-image: inear-gradient(top, #eeeeee, #cccccc); font-size: 0.63em;
z-index: 65535;
background-image: linear-gradient(top, #eeeeee, #cccccc);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc)); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc); background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc); background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);

View File

@ -31,282 +31,291 @@
<!-- Autor: Sören Bernstein --> <!-- Autor: Sören Bernstein -->
<xsl:stylesheet <xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0" xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:cms="http://www.arsdigita.com/cms/1.0" xmlns:cms="http://www.arsdigita.com/cms/1.0"
xmlns:nav="http://ccm.redhat.com/navigation" xmlns:nav="http://ccm.redhat.com/navigation"
xmlns:mandalay="http://mandalay.quasiweb.de" xmlns:mandalay="http://mandalay.quasiweb.de"
exclude-result-prefixes="xsl bebop cms nav mandalay" exclude-result-prefixes="xsl bebop cms nav mandalay"
version="1.0"> version="1.0">
<!-- DE Benutze DHTML-Editor (HTMLArea) --> <!-- DE Benutze DHTML-Editor (HTMLArea) -->
<!-- EN Use DHTML-Editor (HTMLArea) --> <!-- EN Use DHTML-Editor (HTMLArea) -->
<xsl:template match="bebop:dhtmleditor"> <xsl:template match="bebop:dhtmleditor">
<xsl:variable name="firstMatch"> <xsl:variable name="firstMatch">
<xsl:value-of select="//bebop:dhtmleditor/@name"/> <xsl:value-of select="//bebop:dhtmleditor/@name"/>
</xsl:variable> </xsl:variable>
<xsl:if test="@name=$firstMatch"> <xsl:if test="@name=$firstMatch">
<script type="text/javascript"> <script type="text/javascript">
_editor_url = "/assets/htmlarea/"; _editor_url = "/assets/htmlarea/";
_editor_lang = "en"; _editor_lang = "en";
var numEd = 0; var numEd = 0;
</script> </script>
<script type="text/javascript" src="/assets/htmlarea/htmlarea.js"/> <script type="text/javascript" src="/assets/htmlarea/htmlarea.js"/>
<script type="text/javascript"> <script type="text/javascript">
<xsl:for-each select="bebop:plugin"> <xsl:for-each select="bebop:plugin">
HTMLArea.loadPlugin("<xsl:value-of select="@name"/>"); HTMLArea.loadPlugin("<xsl:value-of select="@name"/>");
</xsl:for-each> </xsl:for-each>
// Using Styled.js didn't seem to work anymore with htmlarea 3.0rc3, // Using Styled.js didn't seem to work anymore with htmlarea 3.0rc3,
// so instead we configure the editor here // so instead we configure the editor here
var css_plugin_args = { var css_plugin_args = {
combos : [ combos : [
{ label: "Style", { label: "Style",
options: { "None" : "", options: { "None" : "",
"Main" : "main", "Main" : "main",
"Dark" : "dark", "Dark" : "dark",
"Medium" : "medium", "Medium" : "medium",
"Light" : "light" "Light" : "light"
}
}
]
};
<xsl:for-each select="//bebop:dhtmleditor">
var config_<xsl:value-of select="@name"/> = null;
var editor_<xsl:value-of select="@name"/> = null;
</xsl:for-each>
function initDocument() {
<xsl:for-each select="//bebop:dhtmleditor">
config_<xsl:value-of select="@name"/> = new HTMLArea.Config();
editor_<xsl:value-of select="@name"/> = new HTMLArea("ta_<xsl:value-of select="@name"/>", config_<xsl:value-of select="@name"/>);
config_<xsl:value-of select="@name"/>.registerButton("insertlink", "Insert link", _editor_url + "images/ed_link.gif", false, function(editor) {
<!-- Modified to add the open in new window button NJ-20062403-->
<!-- editor._popupDialog("insert_link.html", function(param) {
if (!param) { // user must have pressed Cancel
return false;
} }
var furl = param["f_url"];
var sel = editor._getSelection();
var range = editor._createRange(sel);
editor._doc.execCommand("createlink", false, furl);
}, null); -->
var sel = editor._getSelection();
var range = editor._createRange(sel);
var compare = 0;
if (HTMLArea.is_ie) {
compare = range.compareEndPoints("StartToEnd", range);
} else {
compare = range.compareBoundaryPoints(range.START_TO_END, range);
}
if (compare == 0) {
alert("You need to select some text before creating a link");
return;
}
editor._popupDialog("insert_link.html", function(param) {
if (!param) { // user must have pressed Cancel
return false;
} }
var sel = editor._getSelection(); ]
var range = editor._createRange(sel); };
if (range.insertNode) { // Standards compliant version
var link = document.createElement("a"); <xsl:for-each select="//bebop:dhtmleditor">
var linkText = range.extractContents(); var config_<xsl:value-of select="@name"/> = null;
link.href=param["f_url"]; var editor_<xsl:value-of select="@name"/> = null;
if (param["f_external"]) link.target="_blank"; </xsl:for-each>
link.appendChild(linkText);
range.insertNode(link); function initDocument() {
} else if (range.pasteHTML) { // Alternative non standards version <xsl:for-each select="//bebop:dhtmleditor">
var target = ""; config_<xsl:value-of select="@name"/> = new HTMLArea.Config();
if (param["f_external"]) { editor_<xsl:value-of select="@name"/> = new HTMLArea("ta_<xsl:value-of select="@name"/>", config_<xsl:value-of select="@name"/>);
config_<xsl:value-of select="@name"/>.registerButton("insertlink", "Insert link", _editor_url + "images/ed_link.gif", false, function(editor) {
<!-- Modified to add the open in new window button NJ-20062403-->
<!-- editor._popupDialog("insert_link.html", function(param) {
if (!param) { // user must have pressed Cancel
return false;
}
var furl = param["f_url"];
var sel = editor._getSelection();
var range = editor._createRange(sel);
editor._doc.execCommand("createlink", false, furl);
}, null); -->
var sel = editor._getSelection();
var range = editor._createRange(sel);
var compare = 0;
if (HTMLArea.is_ie) {
compare = range.compareEndPoints("StartToEnd", range);
} else {
compare = range.compareBoundaryPoints(range.START_TO_END, range);
}
if (compare == 0) {
alert("You need to select some text before creating a link");
return;
}
editor._popupDialog("insert_link.html", function(param) {
if (!param) { // user must have pressed Cancel
return false;
}
var sel = editor._getSelection();
var range = editor._createRange(sel);
if (range.insertNode) { // Standards compliant version
var link = document.createElement("a");
var linkText = range.extractContents();
link.href=param["f_url"];
if (param["f_external"]) link.target="_blank";
link.appendChild(linkText);
range.insertNode(link);
} else if (range.pasteHTML) { // Alternative non standards version
var target = "";
if (param["f_external"]) {
target='target="_blank"'; target='target="_blank"';
} }
range.pasteHTML('&lt;a href="' + param["f_url"] + '"' + target + '&gt;' + range.text + '&lt;/a&gt;'); range.pasteHTML('&lt;a href="' + param["f_url"] + '"' + target + '&gt;' + range.text + '&lt;/a&gt;');
}
}, null);
});
config_<xsl:value-of select="@name"/>.sizeIncludesToolbar = false;
config_<xsl:value-of select="@name"/>.statusBar = false;
config_<xsl:value-of select="@name"/>.toolbar = [[ "formatblock", "space", "bold", "italic", "underline", "strikethrough", "separator", "subscript", "superscript", "separator", "copy", "cut", "paste", "space", "undo", "redo", "space", "removeformat", "killword" ], [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "lefttoright", "righttoleft", "separator", "orderedlist", "unorderedlist", "outdent", "indent", "separator", "textindicator", "separator", "inserthorizontalrule", "insertlink", "insertimage", "inserttable", "htmlmode", "separator", "popupeditor", "separator" ]];
<xsl:if test="bebop:config/@hidden-buttons">
config_<xsl:value-of select="@name"/>.hideSomeButtons("<xsl:value-of select="bebop:config/@hidden-buttons"/>");
</xsl:if>
editor_<xsl:value-of select="@name"/>.config.pageStyle = "@import url(/assets/htmlarea/htmlarea.css);";
<xsl:for-each select="bebop:plugin">
<xsl:choose>
<xsl:when test="@name = 'CSS'">
editor_<xsl:value-of select="../@name"/>.registerPlugin(<xsl:value-of select="@name"/>, css_plugin_args);
</xsl:when>
<xsl:otherwise>
editor_<xsl:value-of select="../@name"/>.registerPlugin(<xsl:value-of select="@name"/>);
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
setTimeout(function() {editor_<xsl:value-of select="@name"/>.generate();}, 500*numEd);
numEd++;
</xsl:for-each>
} }
}, null);
});
config_<xsl:value-of select="@name"/>.sizeIncludesToolbar = false; HTMLArea.init();
config_<xsl:value-of select="@name"/>.statusBar = false; HTMLArea.onload = initDocument;
config_<xsl:value-of select="@name"/>.toolbar = [[ "formatblock", "space", "bold", "italic", "underline", "strikethrough", "separator", "subscript", "superscript", "separator", "copy", "cut", "paste", "space", "undo", "redo", "space", "removeformat", "killword" ], [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "lefttoright", "righttoleft", "separator", "orderedlist", "unorderedlist", "outdent", "indent", "separator", "textindicator", "separator", "inserthorizontalrule", "insertlink", "insertimage", "inserttable", "htmlmode", "separator", "popupeditor", "separator" ]];
<xsl:if test="bebop:config/@hidden-buttons">
config_<xsl:value-of select="@name"/>.hideSomeButtons("<xsl:value-of select="bebop:config/@hidden-buttons"/>");
</xsl:if>
editor_<xsl:value-of select="@name"/>.config.pageStyle = "@import url(/assets/htmlarea/htmlarea.css);";
<xsl:for-each select="bebop:plugin"> function wordClean_<xsl:value-of select="@name"/>() {
<xsl:choose> editor_<xsl:value-of select="@name"/>._wordClean();
<xsl:when test="@name = 'CSS'"> }
editor_<xsl:value-of select="../@name"/>.registerPlugin(<xsl:value-of select="@name"/>, css_plugin_args); </script>
</xsl:when> <!--
<xsl:otherwise> <style type="text/css">
editor_<xsl:value-of select="../@name"/>.registerPlugin(<xsl:value-of select="@name"/>); textarea { background-color: #fff; border: 1px solid 00f; }
</xsl:otherwise> </style>
</xsl:choose> -->
</xsl:for-each>
setTimeout(function() {editor_<xsl:value-of select="@name"/>.generate();}, 500*numEd);
numEd++;
</xsl:for-each>
}
HTMLArea.init();
HTMLArea.onload = initDocument;
function wordClean_<xsl:value-of select="@name"/>() {
editor_<xsl:value-of select="@name"/>._wordClean();
}
</script>
<!--
<style type="text/css">
textarea { background-color: #fff; border: 1px solid 00f; }
</style>
-->
</xsl:if>
<div style="width:560px; border:1px outset #666;">
<textarea id="ta_{@name}" name="{@name}" rows="{@rows}" cols="{@cols}" wrap="{@wrap}" style="width:100%">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>
</div>
</xsl:template>
<!-- DE Benutze FCKEditor -->
<!-- EN Use FCKEditor -->
<xsl:template match="bebop:fckeditor">
<xsl:variable name="firstMatch">
<xsl:value-of select="//bebop:fckeditor/@name"/>
</xsl:variable>
<!-- EN Start of the FCKeditor component code -->
<xsl:if test="@name=$firstMatch">
<script type="text/javascript">
_editor_url = "/assets/fckeditor/";
_editor_lang = "en";
var numEd = 0;
</script>
<script type="text/javascript" src="/assets/fckeditor/fckeditor.js"/>
<script type="text/javascript">
<xsl:for-each select="//bebop:fckeditor">
var editor_<xsl:value-of select="@name"/> = null;
</xsl:for-each>
window.onload = function() {
<xsl:for-each select="//bebop:fckeditor">
editor_<xsl:value-of select="@name"/> = new FCKeditor("ta_<xsl:value-of select="@name"/>") ;
editor_<xsl:value-of select="@name"/>.Width =
<xsl:choose>
<xsl:when test="@metadata.width">
'<xsl:value-of select="@metadata.width"/>';
</xsl:when>
<xsl:otherwise>
'100%';
</xsl:otherwise>
</xsl:choose>
editor_<xsl:value-of select="@name"/>.Height =
<xsl:choose>
<xsl:when test="@metadata.height">
'<xsl:value-of select="@metadata.height"/>';
</xsl:when>
<xsl:otherwise>
'400';
</xsl:otherwise>
</xsl:choose>
editor_<xsl:value-of select="@name"/>.BasePath = "/assets/fckeditor/" ;
editor_<xsl:value-of select="@name"/>.PluginsPath = editor_<xsl:value-of select="@name"/>.BasePath + "editor/plugins/" ;
<xsl:if test="bebop:config/@path">
editor_<xsl:value-of select="//bebop:fckeditor/@name"/>.Config['CustomConfigurationsPath'] = "<xsl:value-of select="//bebop:fckeditor/bebop:config/@path"/>";
</xsl:if>
editor_<xsl:value-of select="@name"/>.ToolbarSet = "Basic";
editor_<xsl:value-of select="@name"/>.ReplaceTextarea();
}
</xsl:for-each>
</script>
<!--
<style type="text/css">
textarea { background-color: #fff; border: 1px solid 00f; }
</style>
-->
</xsl:if>
<!-- EN End of FCKeditor setup -->
<textarea id="ta_{@name}" name="{@name}" style="width:100%" rows="{@rows}" cols="{@cols}" wrap="{@wrap}">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>
</xsl:template>
<!-- DE Benutze Xinha -->
<!-- EN Use Xinha -->
<xsl:template match="bebop:xinha">
<xsl:variable name="firstMatch">
<xsl:value-of select="//bebop:xinha/@name"/>
</xsl:variable>
<xsl:if test="@name=$firstMatch">
<script type="text/javascript">
_editor_url = "<xsl:value-of select="@editor_url"/>";
_editor_lang ="<xsl:value-of select="$lang"/>";
<!-- _editor_skin = "silva";-->
<!-- DE Definiere, welche Textareas zu Xinha-Editoren werden sollen -->
<!-- EN Define all textares which should become xinha editors -->
xinha_editors = [
<xsl:for-each select="//bebop:xinha">
'ta_<xsl:value-of select="@name"/>'<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
];
<!-- DE Lade die angegebenen Plugins falls angegeben -->
<!-- EN Load the mentioned plugins if any-->
xinha_plugins = null;
<xsl:if test="bebop:plugin">
xinha_plugins = [
<xsl:for-each select="bebop:plugin">
'<xsl:value-of select="@name"/>'<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
];
</xsl:if> </xsl:if>
</script>
<!-- DE Lade die externe JavaScript-Datei für Xinha --> <xsl:call-template name="processLabel">
<script type="text/javascript" src="{@editor_src}"/> <xsl:with-param name="widget" select="."/>
</xsl:call-template>
<div style="width:560px; border:1px outset #666;">
<textarea id="ta_{@name}" name="{@name}" rows="{@rows}" cols="{@cols}" wrap="{@wrap}" style="width:100%">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>
</div>
<!-- DE Lade die angegebene Konfiguration --> </xsl:template>
<script type="text/javascript">
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="bebop:config[@name='XinhaConfig']">
<xsl:value-of select="bebop:config[@name='XinhaConfig']/@path"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="bebop:config[@name='Xinha.Config']/@path"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</script>
</xsl:if> <!-- DE Benutze FCKEditor -->
<!-- EN Use FCKEditor -->
<xsl:template match="bebop:fckeditor">
<textarea id="ta_{@name}" name="{@name}" rows="{@rows}" cols="{@cols}" wrap="{@wrap}" style="width:100%"> <xsl:variable name="firstMatch">
<xsl:value-of disable-output-escaping="no" select="text()"/> <xsl:value-of select="//bebop:fckeditor/@name"/>
</textarea> </xsl:variable>
</xsl:template>
<!-- EN Start of the FCKeditor component code -->
<xsl:if test="@name=$firstMatch">
<script type="text/javascript">
_editor_url = "/assets/fckeditor/";
_editor_lang = "en";
var numEd = 0;
</script>
<script type="text/javascript" src="/assets/fckeditor/fckeditor.js"/>
<script type="text/javascript">
<xsl:for-each select="//bebop:fckeditor">
var editor_<xsl:value-of select="@name"/> = null;
</xsl:for-each>
window.onload = function() {
<xsl:for-each select="//bebop:fckeditor">
editor_<xsl:value-of select="@name"/> = new FCKeditor("ta_<xsl:value-of select="@name"/>") ;
editor_<xsl:value-of select="@name"/>.Width =
<xsl:choose>
<xsl:when test="@metadata.width">
'<xsl:value-of select="@metadata.width"/>';
</xsl:when>
<xsl:otherwise>
'100%';
</xsl:otherwise>
</xsl:choose>
editor_<xsl:value-of select="@name"/>.Height =
<xsl:choose>
<xsl:when test="@metadata.height">
'<xsl:value-of select="@metadata.height"/>';
</xsl:when>
<xsl:otherwise>
'400';
</xsl:otherwise>
</xsl:choose>
editor_<xsl:value-of select="@name"/>.BasePath = "/assets/fckeditor/" ;
editor_<xsl:value-of select="@name"/>.PluginsPath = editor_<xsl:value-of select="@name"/>.BasePath + "editor/plugins/" ;
<xsl:if test="bebop:config/@path">
editor_<xsl:value-of select="//bebop:fckeditor/@name"/>.Config['CustomConfigurationsPath'] = "<xsl:value-of select="//bebop:fckeditor/bebop:config/@path"/>";
</xsl:if>
editor_<xsl:value-of select="@name"/>.ToolbarSet = "Basic";
editor_<xsl:value-of select="@name"/>.ReplaceTextarea();
}
</xsl:for-each>
</script>
<!--
<style type="text/css">
textarea { background-color: #fff; border: 1px solid 00f; }
</style>
-->
</xsl:if>
<!-- EN End of FCKeditor setup -->
<xsl:call-template name="processLabel">
<xsl:with-param name="widget" select="."/>
</xsl:call-template>
<textarea id="ta_{@name}" name="{@name}" style="width:100%" rows="{@rows}" cols="{@cols}" wrap="{@wrap}">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>
</xsl:template>
<!-- DE Benutze Xinha -->
<!-- EN Use Xinha -->
<xsl:template match="bebop:xinha">
<xsl:variable name="firstMatch">
<xsl:value-of select="//bebop:xinha/@name"/>
</xsl:variable>
<xsl:if test="@name=$firstMatch">
<script type="text/javascript">
_editor_url = "<xsl:value-of select="@editor_url"/>";
_editor_lang ="<xsl:value-of select="$lang"/>";
<!-- _editor_skin = "silva";-->
<!-- DE Definiere, welche Textareas zu Xinha-Editoren werden sollen -->
<!-- EN Define all textares which should become xinha editors -->
xinha_editors = [
<xsl:for-each select="//bebop:xinha">
'ta_<xsl:value-of select="@name"/>'<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
];
<!-- DE Lade die angegebenen Plugins falls angegeben -->
<!-- EN Load the mentioned plugins if any-->
xinha_plugins = null;
<xsl:if test="bebop:plugin">
xinha_plugins = [
<xsl:for-each select="bebop:plugin">
'<xsl:value-of select="@name"/>'<xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
];
</xsl:if>
</script>
<!-- DE Lade die externe JavaScript-Datei für Xinha -->
<script type="text/javascript" src="{@editor_src}"/>
<!-- DE Lade die angegebene Konfiguration -->
<script type="text/javascript">
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="bebop:config[@name='XinhaConfig']">
<xsl:value-of select="bebop:config[@name='XinhaConfig']/@path"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="bebop:config[@name='Xinha.Config']/@path"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</script>
</xsl:if>
<xsl:call-template name="processLabel">
<xsl:with-param name="widget" select="."/>
</xsl:call-template>
<textarea id="ta_{@name}" name="{@name}" rows="{@rows}" cols="{@cols}" wrap="{@wrap}" style="width:100%">
<xsl:value-of disable-output-escaping="no" select="text()"/>
</textarea>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -112,6 +112,18 @@
<img alt="{$alt}" title="{$title}" src="{$src}"/> <img alt="{$alt}" title="{$title}" src="{$src}"/>
</xsl:if> </xsl:if>
<xsl:apply-templates/> <xsl:apply-templates/>
<xsl:if test="string-length(./@hint) &gt; 0">
<span class="hint">
<xsl:attribute name="content">
<xsl:value-of select="@hint"/>
</xsl:attribute>
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'bebop'"/>
<xsl:with-param name="setting" select="'hintSymbol'"/>
<xsl:with-param name="default" select="'(?)'"/>
</xsl:call-template>
</span>
</xsl:if>
</a> </a>
</xsl:template> </xsl:template>

View File

@ -208,15 +208,45 @@
<fieldset class="date"> <fieldset class="date">
<legend> <legend>
<xsl:value-of select="@label"/> <xsl:value-of select="@label"/>
<xsl:if test="string-length(./@hint) &gt; 0">
<span class="hint">
<xsl:attribute name="content">
<xsl:value-of select="@hint"/>
</xsl:attribute>
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'bebop'"/>
<xsl:with-param name="setting" select="'hintSymbol'"/>
<xsl:with-param name="default" select="'(?)'"/>
</xsl:call-template>
</span>
</xsl:if>
</legend> </legend>
<xsl:apply-templates/> <xsl:apply-templates/>
</fieldset> </fieldset>
</xsl:template> </xsl:template>
<xsl:template match="bebop:time"> <xsl:template match="bebop:time">
<span class="time"> <!--<span class="time">
<xsl:apply-templates/> <xsl:apply-templates/>
</span> </span>-->
<fieldset>
<legend>
<xsl:value-of select="@label"/>
<xsl:if test="string-length(./@hint) &gt; 0">
<span class="hint">
<xsl:attribute name="content">
<xsl:value-of select="@hint"/>
</xsl:attribute>
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'bebop'"/>
<xsl:with-param name="setting" select="'hintSymbol'"/>
<xsl:with-param name="default" select="'(?)'"/>
</xsl:call-template>
</span>
</xsl:if>
</legend>
<xsl:apply-templates/>
</fieldset>
</xsl:template> </xsl:template>
<xsl:template match="bebop:fieldset"> <xsl:template match="bebop:fieldset">

View File

@ -24,8 +24,9 @@
<setting id="padding/showPadding">false</setting> <setting id="padding/showPadding">false</setting>
<setting id="padding/borderColor">cccccc</setting> <setting id="padding/borderColor">cccccc</setting>
<!--<setting id="hintSymbol">(?)</setting>-->
<!--<setting id="hintSymbol">&#x2753;</setting>--> <!--<setting id="hintSymbol">&#x2753;</setting>-->
<setting id="hintSymbol">(?)</setting> <setting id="hintSymbol">&#x24d8;</setting>
<setting id="table/setImage/checkboxChecked">/images/bebop/checkBoxChecked.gif</setting> <setting id="table/setImage/checkboxChecked">/images/bebop/checkBoxChecked.gif</setting>
<setting id="table/setImage/checkboxUnchecked">/images/bebop/checkBoxUnchecked.gif</setting> <setting id="table/setImage/checkboxUnchecked">/images/bebop/checkBoxUnchecked.gif</setting>