IDEMPIERE-563 HTML Editor for text fields. Revert back to ckeditor. The new 4.0.1 release is working fine again.

This commit is contained in:
Heng Sin Low 2013-01-23 10:55:48 +08:00
parent 577ee64113
commit 4bd63b66f4
7 changed files with 88 additions and 27 deletions

View File

@ -21,7 +21,8 @@ Bundle-ClassPath: WEB-INF/classes/,
WEB-INF/lib/atmosphere-compat-jbossweb-1.0.4.jar,
WEB-INF/lib/atmosphere-compat-tomcat-1.0.4.jar,
WEB-INF/lib/atmosphere-compat-tomcat7-1.0.4.jar,
WEB-INF/lib/atmosphere-runtime-1.0.4.jar
WEB-INF/lib/atmosphere-runtime-1.0.4.jar,
.
Export-Package: metainfo.zk,
org.adempiere.webui,
org.adempiere.webui.acct,

View File

@ -25,7 +25,6 @@ import org.adempiere.webui.adwindow.ADWindow;
import org.adempiere.webui.adwindow.AbstractADWindowContent;
import org.adempiere.webui.component.Combobox;
import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.event.ContextMenuEvent;
import org.adempiere.webui.event.ContextMenuListener;
import org.adempiere.webui.event.DialogEvents;
@ -231,8 +230,6 @@ public class WStringEditor extends WEditor implements ContextMenuListener
adwindowContent = findADWindowContent();
final WTextEditorDialog dialog = new WTextEditorDialog(this.getColumnName(), getDisplay(),
isReadWrite(), gridField.getFieldLength());
dialog.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
dialog.setSizable(true);
dialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener<Event>() {
@Override
public void onEvent(Event event) throws Exception {

View File

@ -21,6 +21,7 @@ import org.adempiere.webui.component.Tabpanels;
import org.adempiere.webui.component.Tabs;
import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.Window;
import org.zkforge.ckez.CKeditor;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
@ -29,8 +30,6 @@ import org.zkoss.zul.Html;
import org.zkoss.zul.Separator;
import org.zkoss.zul.Vlayout;
import fi.jawsy.jawwa.zk.cleditor.Cleditor;
/**
*
* @author Low Heng Sin
@ -48,8 +47,9 @@ public class WTextEditorDialog extends Window implements EventListener<Event>{
private boolean cancelled;
private Tabbox tabbox;
private Textbox textBox;
private Cleditor editor;
private CKeditor editor;
private Label status;
private Tab htmlTab;
/**
*
@ -71,8 +71,9 @@ public class WTextEditorDialog extends Window implements EventListener<Event>{
private void init() {
setBorder("normal");
setHeight("450px");
setWidth("700px");
setWidth("800px");
setStyle("position: absolute;");
setSizable(false);
Vlayout vbox = new Vlayout();
appendChild(vbox);
@ -85,8 +86,8 @@ public class WTextEditorDialog extends Window implements EventListener<Event>{
tabbox.appendChild(tabs);
Tabpanels tabPanels = new Tabpanels();
tabbox.appendChild(tabPanels);
tabbox.setVflex("true");
tabbox.setHflex("true");
tabbox.setVflex("1");
tabbox.setHflex("1");
Tab tab = new Tab("Text");
tabs.appendChild(tab);
@ -97,21 +98,17 @@ public class WTextEditorDialog extends Window implements EventListener<Event>{
textBox.setCols(80);
textBox.setRows(30);
textBox.setEnabled(editable);
textBox.setVflex("true");
textBox.setHflex("true");
textBox.setHflex("1");
textBox.setVflex("1");
tabPanel.appendChild(textBox);
tab = new Tab("HTML");
tabs.appendChild(tab);
htmlTab = new Tab("HTML");
tabs.appendChild(htmlTab);
tabPanel = new Tabpanel();
tabPanels.appendChild(tabPanel);
if (editable) {
editor = new Cleditor();
tabPanel.appendChild(editor);
editor.setWidth("100%");
editor.setHeight("100%");
editor.setValue(text);
createEditor(tabPanel);
} else {
Div div = new Div();
div.setHeight("100%");
@ -143,6 +140,16 @@ public class WTextEditorDialog extends Window implements EventListener<Event>{
tabbox.addEventListener(Events.ON_SELECT, this);
}
private void createEditor(org.zkoss.zul.Tabpanel tabPanel) {
editor = new CKeditor();
editor.setCustomConfigurationsPath("/js/ckeditor/config.js");
editor.setToolbar("MyToolbar");
tabPanel.appendChild(editor);
editor.setVflex("1");
editor.setWidth("100%");
editor.setValue(text);
}
/**
* @param event
*/

View File

@ -0,0 +1,12 @@
CKEDITOR.editorConfig = function(config) {
config.resize_enabled = false;
config.toolbar = 'MyToolbar';
config.toolbar_MyToolbar = [
[ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript',
'Superscript', 'TextColor', 'BGColor', '-', 'Cut', 'Copy',
'Paste', 'Link', 'Unlink' ],
[ 'Undo', 'Redo', '-', 'JustifyLeft', 'JustifyCenter',
'JustifyRight', 'JustifyBlock' ],
[ 'Table', 'Smiley', 'SpecialChar', 'PageBreak',
'Styles', 'Format', 'Font', 'FontSize', 'Maximize'] ];
};

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="lib" path="lib/jawwa-zk-cleditor-0.4.1.jar" sourcepath="lib/src/jawwa-zk-cleditor-0.4.1-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ckez.jar" sourcepath="lib/src/ckez-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/calendar.jar" sourcepath="lib/src/calendar-source.jar"/>
<classpathentry exported="true" kind="lib" path="lib/asm.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cglib.jar"/>

View File

@ -128,7 +128,7 @@ Bundle-ClassPath: .,
lib/zel.jar,
lib/zkbind.jar,
lib/calendar.jar,
lib/jawwa-zk-cleditor-0.4.1.jar
lib/ckez.jar
Export-Package: Lib,
Lib.collections,
Lib.compiler,
@ -188,7 +188,6 @@ Export-Package: Lib,
date,
doc,
drb,
fi.jawsy.jawwa.zk.cleditor,
io,
irb,
irb.cmd,
@ -518,6 +517,7 @@ Export-Package: Lib,
org.python.tests.props,
org.python.util,
org.w3c.dom.html,
org.zkforge.ckez,
org.zkforge.json.simple,
org.zkforge.json.simple.parser,
org.zkforge.timeline,
@ -693,19 +693,63 @@ Export-Package: Lib,
uri,
web,
web.aud,
web.ckez.html,
web.ckez.img,
web.dsp.action.html,
web.html,
web.img,
web.jawwa.ext.cleditor,
web.jawwa.ext.cleditor.images,
web.js.calendar,
web.js.calendar.css,
web.js.calendar.img,
web.js.calendar.lang,
web.js.calendar.mold,
web.js.ckez,
web.js.ckez.ext.CKeditor,
web.js.ckez.ext.CKeditor.adapters,
web.js.ckez.ext.CKeditor.lang,
web.js.ckez.ext.CKeditor.plugins,
web.js.ckez.ext.CKeditor.plugins.a11yhelp.dialogs,
web.js.ckez.ext.CKeditor.plugins.a11yhelp.dialogs.lang,
web.js.ckez.ext.CKeditor.plugins.about.dialogs,
web.js.ckez.ext.CKeditor.plugins.clipboard.dialogs,
web.js.ckez.ext.CKeditor.plugins.colordialog.dialogs,
web.js.ckez.ext.CKeditor.plugins.dialog,
web.js.ckez.ext.CKeditor.plugins.div.dialogs,
web.js.ckez.ext.CKeditor.plugins.fakeobjects.images,
web.js.ckez.ext.CKeditor.plugins.find.dialogs,
web.js.ckez.ext.CKeditor.plugins.flash.dialogs,
web.js.ckez.ext.CKeditor.plugins.flash.images,
web.js.ckez.ext.CKeditor.plugins.forms.dialogs,
web.js.ckez.ext.CKeditor.plugins.forms.images,
web.js.ckez.ext.CKeditor.plugins.iframe.dialogs,
web.js.ckez.ext.CKeditor.plugins.iframe.images,
web.js.ckez.ext.CKeditor.plugins.image.dialogs,
web.js.ckez.ext.CKeditor.plugins.image.images,
web.js.ckez.ext.CKeditor.plugins.link.dialogs,
web.js.ckez.ext.CKeditor.plugins.link.images,
web.js.ckez.ext.CKeditor.plugins.liststyle.dialogs,
web.js.ckez.ext.CKeditor.plugins.magicline.images,
web.js.ckez.ext.CKeditor.plugins.pagebreak.images,
web.js.ckez.ext.CKeditor.plugins.pastefromword.filter,
web.js.ckez.ext.CKeditor.plugins.preview,
web.js.ckez.ext.CKeditor.plugins.scayt,
web.js.ckez.ext.CKeditor.plugins.scayt.dialogs,
web.js.ckez.ext.CKeditor.plugins.showblocks.images,
web.js.ckez.ext.CKeditor.plugins.smiley.dialogs,
web.js.ckez.ext.CKeditor.plugins.smiley.images,
web.js.ckez.ext.CKeditor.plugins.specialchar.dialogs,
web.js.ckez.ext.CKeditor.plugins.specialchar.dialogs.lang,
web.js.ckez.ext.CKeditor.plugins.table.dialogs,
web.js.ckez.ext.CKeditor.plugins.tabletools.dialogs,
web.js.ckez.ext.CKeditor.plugins.templates.dialogs,
web.js.ckez.ext.CKeditor.plugins.templates.templates,
web.js.ckez.ext.CKeditor.plugins.templates.templates.images,
web.js.ckez.ext.CKeditor.plugins.wsc,
web.js.ckez.ext.CKeditor.plugins.wsc.dialogs,
web.js.ckez.ext.CKeditor.skins.moono,
web.js.ckez.ext.CKeditor.skins.moono.images,
web.js.gmaps,
web.js.gmaps.ext,
web.js.jawwa.cleditor,
web.js.timelinez,
web.js.timelinez.css,
web.js.timelinez.ext,

View File

@ -28,5 +28,5 @@ bin.includes = META-INF/,\
lib/zel.jar,\
lib/zkbind.jar,\
lib/calendar.jar,\
lib/jawwa-zk-cleditor-0.4.1.jar
lib/ckez.jar
source.. = src/