Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Porting to 1.5.x of the fixes for tinyMCE InLineEditBehavior

  • Loading branch information...
commit acc9abe5d5c8b6681350b7fb9eb7236be19487a9 1 parent 6fe0eff
bitstorm authored
10 jdk-1.5-parent/tinymce-parent/tinymce/src/main/java/wicket/contrib/tinymce/InPlaceEditBehavior.java
View
@@ -75,7 +75,13 @@ public void onComponentTag(Component component, ComponentTag tag)
};
}
- protected String getRenderOnDomReadyJavascript(IHeaderResponse response)
+ @Override
+ public void renderHead(Component c, IHeaderResponse response) {
+ super.renderHead(c, response);
+ response.renderJavaScript(getRenderJavascript(response), null);
+ }
+
+ protected String getRenderOnDomReadyJavascript()
{
return null;
}
@@ -85,7 +91,7 @@ protected String getRenderJavascript(IHeaderResponse response)
return "" //
+ "function " + getStartEditorScriptName()
+ "() {" //
- + getAddTinyMceSettingsScript(Mode.none, Collections.EMPTY_LIST) //
+ + getAddTinyMceSettingsScript(Mode.none, Collections.<Component>emptyList()) //
+ " tinyMCE.execCommand('mceAddControl',true,'"
+ getComponent().getMarkupId(true)
+ "');" //
2  jdk-1.5-parent/tinymce-parent/tinymce/src/main/java/wicket/contrib/tinymce/InPlaceSaveBehavior.java
View
@@ -153,6 +153,6 @@ private final String getWicketPostScript()
{
return generateCallbackScript(
"wicketAjaxPost('" + getCallbackUrl() + "', Wicket.Form.encode('" + PARAM_HTMLCONT +
- "') + '=' + Wicket.Form.encode(content) + '&'").toString();
+ "') + '=' + content + '&'").toString();
}
}
11 jdk-1.5-parent/tinymce-parent/tinymce/src/main/java/wicket/contrib/tinymce/TinyMceBehavior.java
View
@@ -86,10 +86,15 @@ public void renderHead(Component c, IHeaderResponse response)
TinyMCESettings.lazyLoadTinyMCEResource(response);
}
- String renderOnDomReady = getAddTinyMceSettingsScript(Mode.exact,
- Collections.singletonList(component));
- response.renderOnDomReadyJavaScript(renderOnDomReady);
+ String renderOnDomReady = getRenderOnDomReadyJavascript();
+ if (renderOnDomReady != null) {
+ response.renderOnDomReadyJavaScript(renderOnDomReady);
+ }
}
+
+ protected String getRenderOnDomReadyJavascript() {
+ return getAddTinyMceSettingsScript(Mode.exact, Collections.singletonList(component));
+ }
private boolean mayRenderJavascriptDirect()
Please sign in to comment.
Something went wrong with that request. Please try again.