[kune-commits] r1059 - in trunk: . img/icons/ooffice-human src/main/java/org/ourproject/kune/app/public/css src/main/java/org/ourproject/kune/platf/client/services src/main/java/org/ourproject/kune/platf/client/ui/rte src/main/java/org/ourproject/kune/platf/client/ui/rte/img src/main/java/org/ourproject/kune/workspace/client src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions

vjrj vjrj at ourproject.org
Thu Mar 5 14:57:05 CET 2009


Author: vjrj
Date: 2009-03-05 14:57:02 +0100 (Thu, 05 Mar 2009)
New Revision: 1059

Added:
   trunk/img/icons/ooffice-human/README
Modified:
   trunk/COPYRIGHT
   trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css
   trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css
   trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
Log:
Incomplete - task Better RTE (Rich Text Editor) support

Modified: trunk/COPYRIGHT
===================================================================
--- trunk/COPYRIGHT	2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/COPYRIGHT	2009-03-05 13:57:02 UTC (rev 1059)
@@ -72,6 +72,12 @@
    published by the Free Software Foundation; either version 2 of
    the License, or (at your option) any later version.
 
+and others icons from openoffice.org-style-human debian package
+   Copyright 2002-2007 Sun Microsystems, Inc.
+   This product is made available subject to the terms of GNU Lesser General
+   Public License Version 2.1. A copy of the LGPL license can be found
+   http://www.openoffice.org/project/www/license.html
+
 others
 --------------------------------------------------------------------------------
 suco

Added: trunk/img/icons/ooffice-human/README
===================================================================
--- trunk/img/icons/ooffice-human/README	2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/img/icons/ooffice-human/README	2009-03-05 13:57:02 UTC (rev 1059)
@@ -0,0 +1 @@
+from openoffice.org-style-human debian package and res/commandimagelist directory

Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css	2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/richtext.css	2009-03-05 13:57:02 UTC (rev 1059)
@@ -13,4 +13,4 @@
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
 version: 2.4.1
-*/h1{font-size:138.5%;}h2{font-size:123.099998%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:700;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:700;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;width:11.9em;}body{font-family:arial, sans;margin:5px;}.k-rte-comment{border:1px dashed silver;font-size:85%;line-height:1.4;padding:1px;background-color:#D7FFD7;}
\ No newline at end of file
+*/h1{font-size:138.5%;}h2{font-size:123.099998%;}h3{font-size:108%;}h1,h2,h3{margin:1em 0;}h1,h2,h3,h4,h5,h6,strong{font-weight:700;}abbr,acronym{border-bottom:1px dotted #000;cursor:help;}em{font-style:italic;}blockquote,ul,ol,dl{margin:1em;}ol,ul,dl{margin-left:2em;}ol li{list-style:decimal outside;}ul li{list-style:disc outside;}dl dd{margin-left:1em;}th,td{border:1px solid #000;padding:.5em;}th{font-weight:700;text-align:center;}caption{margin-bottom:.5em;text-align:center;}p,fieldset,table,pre{margin-bottom:1em;}input[type=text],input[type=password],textarea{width:12.25em;width:11.9em;}body{font-family:arial, sans;margin:5px;}.k-rte-comment span{border:1px dashed silver;font-size:85%;line-height:1.4;padding:1px;background-color:#D7FFD7;}
\ No newline at end of file

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java	2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KunePlatformModule.java	2009-03-05 13:57:02 UTC (rev 1059)
@@ -267,9 +267,5 @@
         $(ToolGroup.class).createAll();
         $(Application.class).start();
         // $(HelloWorld.class);
-
-        // $(TestRTEDialog.class);
-        // $(TestRTEDialog.class);
-        // $(TestRTEDialog.class);
     }
 }
\ No newline at end of file

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java	2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RTEditorPresenter.java	2009-03-05 13:57:02 UTC (rev 1059)
@@ -37,6 +37,7 @@
 
     private static final String EDIT_MENU = "Edit";
     private static final String INSERT_MENU = "Insert";
+    private static final String FORMAT_MENU = "Format";
     private RTEditorView view;
     private boolean extended;
     private final AccessRolDTO accessRol;
@@ -52,8 +53,6 @@
     private ActionToolbarPushButtonDescriptor<Object> underline;
     private ActionToolbarPushButtonDescriptor<Object> strikethrough;
     private final Event0 onEdit;
-    private ActionToolbarPushButtonDescriptor<Object> subscript;
-    private ActionToolbarPushButtonDescriptor<Object> superscript;
     private final TextEditorInsertElement insertElement;
 
     public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
@@ -146,8 +145,6 @@
             sndBar.setPushButtonPressed(bold, view.isBold());
             sndBar.setPushButtonPressed(italic, view.isItalic());
             sndBar.setPushButtonPressed(underline, view.isUnderlined());
-            sndBar.setPushButtonPressed(subscript, view.isSubscript());
-            sndBar.setPushButtonPressed(superscript, view.isSuperscript());
         }
         if (isExtended()) {
             sndBar.setPushButtonPressed(strikethrough, view.isStrikethrough());
@@ -183,7 +180,7 @@
             }
         });
         bold.setIconCls(getCssName(imgResources.bold()));
-        bold.setToolTip(i18n.t("Toggle Bold"));
+        bold.setToolTip(i18n.t("Bold"));
         bold.setShortcut(new ActionShortcut(true, 'B'));
         bold.setAddCondition(canBeBasic);
 
@@ -194,7 +191,7 @@
                     }
                 });
         italic.setIconCls(getCssName(imgResources.italic()));
-        italic.setToolTip(i18n.t("Toggle Italic"));
+        italic.setToolTip(i18n.t("Italic"));
         italic.setShortcut(new ActionShortcut(true, 'I'));
         italic.setAddCondition(canBeBasic);
         italic.setAddCondition(canBeBasic);
@@ -206,30 +203,31 @@
                     }
                 });
         underline.setIconCls(getCssName(imgResources.underline()));
-        underline.setToolTip(i18n.t("Toggle Underline"));
+        underline.setToolTip(i18n.t("Underline"));
         underline.setShortcut(new ActionShortcut(true, 'U'));
         underline.setAddCondition(canBeBasic);
 
-        subscript = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
-                new Listener0() {
+        ActionToolbarMenuDescriptor<Object> subscript = new ActionToolbarMenuDescriptor<Object>(accessRol,
+                ActionToolbarPosition.topbar, new Listener0() {
                     public void onEvent() {
                         view.toggleSubscript();
                     }
                 });
-        subscript.setIconCls(getCssName(imgResources.superscript()));
-        subscript.setToolTip(i18n.t("Toggle Subscript"));
+        subscript.setParentMenuTitle(i18n.t(FORMAT_MENU));
+        subscript.setTextDescription(i18n.t("Subscript"));
+        subscript.setIconCls(getCssName(imgResources.subscript()));
         subscript.setShortcut(new ActionShortcut(true, ','));
         subscript.setAddCondition(canBeBasic);
 
-        superscript = new ActionToolbarPushButtonDescriptor<Object>(accessRol, ActionToolbarPosition.topbar,
-                new Listener0() {
+        ActionToolbarMenuDescriptor<Object> superscript = new ActionToolbarMenuDescriptor<Object>(accessRol,
+                ActionToolbarPosition.topbar, new Listener0() {
                     public void onEvent() {
                         view.toggleSuperscript();
                     }
                 });
+        superscript.setParentMenuTitle(i18n.t(FORMAT_MENU));
+        superscript.setTextDescription(i18n.t("Superscript"));
         superscript.setIconCls(getCssName(imgResources.superscript()));
-        superscript.setToolTip(i18n.t("Toggle Superscript"));
-        superscript.setRightSeparator(ActionToolbarButtonSeparator.spacer);
         superscript.setShortcut(new ActionShortcut(true, '.'));
         superscript.setAddCondition(canBeBasic);
 
@@ -378,7 +376,7 @@
                     }
                 });
         strikethrough.setIconCls(getCssName(imgResources.strikeout()));
-        strikethrough.setToolTip(i18n.t("Toggle Strikethrough"));
+        strikethrough.setToolTip(i18n.t("Strikethrough"));
         strikethrough.setRightSeparator(ActionToolbarButtonSeparator.separator);
         strikethrough.setAddCondition(canBeExtended);
 
@@ -479,8 +477,6 @@
         sndActions.add(withNoItem(italic));
         sndActions.add(withNoItem(underline));
         sndActions.add(withNoItem(strikethrough));
-        sndActions.add(withNoItem(subscript));
-        sndActions.add(withNoItem(superscript));
         sndActions.add(withNoItem(justifyLeft));
         sndActions.add(withNoItem(justifyCentre));
         sndActions.add(withNoItem(justifyRight));
@@ -492,6 +488,8 @@
         topActions.add(withNoItem(paste));
         topActions.add(withNoItem(editHtml));
         topActions.add(withNoItem(hr));
+        topActions.add(withNoItem(subscript));
+        topActions.add(withNoItem(superscript));
         sndActions.add(withNoItem(hrButton));
         sndActions.add(withNoItem(decreaseIndent));
         sndActions.add(withNoItem(increaseIndent));

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java	2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java	2009-03-05 13:57:02 UTC (rev 1059)
@@ -10,8 +10,12 @@
 
 public class TestRTEDialog {
 
+    private final RTEditor editor;
+    private final BasicDialog dialog;
+
     public TestRTEDialog(RTEditor editor) {
-        BasicDialog dialog = new BasicDialog("Testing RTE", false, false, 400, 200);
+        this.editor = editor;
+        dialog = new BasicDialog("Testing RTE", false, false, 400, 200);
         final VerticalPanel vp = new VerticalPanel();
 
         vp.add(((ActionToolbarPanel<Object>) editor.getTopBar().getView()).getToolbar(ActionToolbarPosition.topbar));
@@ -19,7 +23,6 @@
         final RTEditorPanel editorPanel = (RTEditorPanel) editor.getEditorArea();
         vp.add(editorPanel.getRTE());
         editor.setExtended(true);
-        editor.attach();
         vp.setWidth("100%");
         dialog.add(vp);
         dialog.addListener(new WindowListenerAdapter() {
@@ -30,6 +33,14 @@
                 vp.setCellHeight(editorPanel.getRTE(), "" + newHeight);
             }
         });
+    }
+
+    public void setExtended(boolean extended) {
+        editor.setExtended(extended);
+    }
+
+    public void show() {
+        editor.attach();
         dialog.show();
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css	2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/rteimg.css	2009-03-05 13:57:02 UTC (rev 1059)
@@ -1,91 +1,91 @@
- at sprite .x-btn-icon .k-rte-underline {
+ at sprite div .k-rte-underline {
   gwt-image: 'underline';
 }
 
- at sprite .x-btn-icon .k-rte-superscript {
+ at sprite div .k-rte-superscript {
   gwt-image: 'superscript';
 }
 
- at sprite .x-btn-icon .k-rte-subscript {
+ at sprite div .k-rte-subscript {
   gwt-image: 'subscript';
 }
 
- at sprite .x-btn-icon .k-rte-strikeout {
+ at sprite div .k-rte-strikeout {
   gwt-image: 'strikeout';
 }
 
- at sprite .x-btn-icon .k-rte-removeFormat {
+ at sprite div .k-rte-removeFormat {
   gwt-image: 'removeFormat';
 }
 
- at sprite .x-btn-icon .k-rte-link {
+ at sprite div .k-rte-link {
   gwt-image: 'link';
 }
 
- at sprite .x-btn-icon .k-rte-linkbreak {
+ at sprite div .k-rte-linkbreak {
   gwt-image: 'linkbreak';
 }
 
- at sprite .x-btn-icon .k-rte-italic {
+ at sprite div .k-rte-italic {
   gwt-image: 'italic';
 }
 
- at sprite .x-btn-icon .k-rte-incrementindent {
+ at sprite div .k-rte-incrementindent {
   gwt-image: 'incrementindent';
 }
 
- at sprite .x-btn-icon .k-rte-images {
+ at sprite div .k-rte-images {
   gwt-image: 'images';
 }
 
- at sprite .x-btn-icon .k-rte-hfixedline {
+ at sprite div .k-rte-hfixedline {
   gwt-image: 'hfixedline';
 }
 
- at sprite .x-btn-icon .k-rte-fontheight {
+ at sprite div .k-rte-fontheight {
   gwt-image: 'fontheight';
 }
 
- at sprite .x-btn-icon .k-rte-fontcolor {
+ at sprite div .k-rte-fontcolor {
   gwt-image: 'fontcolor';
 }
 
- at sprite .x-btn-icon .k-rte-edithtml {
+ at sprite div .k-rte-edithtml {
   gwt-image: 'edithtml';
 }
 
- at sprite .x-btn-icon .k-rte-defaultnumbering {
+ at sprite div .k-rte-defaultnumbering {
   gwt-image: 'defaultnumbering';
 }
 
- at sprite .x-btn-icon .k-rte-defaultbullet {
+ at sprite div .k-rte-defaultbullet {
   gwt-image: 'defaultbullet';
 }
 
- at sprite .x-btn-icon .k-rte-decrementindent {
+ at sprite div .k-rte-decrementindent {
   gwt-image: 'decrementindent';
 }
 
- at sprite .x-btn-icon .k-rte-charfontname {
+ at sprite div .k-rte-charfontname {
   gwt-image: 'charfontname';
 }
 
- at sprite .x-btn-icon .k-rte-centerpara {
+ at sprite div .k-rte-centerpara {
   gwt-image: 'centerpara';
 }
 
- at sprite .x-btn-icon .k-rte-bold {
+ at sprite div .k-rte-bold {
   gwt-image: 'bold';
 }
 
- at sprite .x-btn-icon .k-rte-backcolor {
+ at sprite div .k-rte-backcolor {
   gwt-image: 'backcolor';
 }
 
- at sprite .x-btn-icon .k-rte-alignright {
+ at sprite div .k-rte-alignright {
   gwt-image: 'alignright';
 }
 
- at sprite .x-btn-icon .k-rte-alignleft {
+ at sprite div .k-rte-alignleft {
   gwt-image: 'alignleft';
 }
\ No newline at end of file

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java	2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/KuneWorkspaceModule.java	2009-03-05 13:57:02 UTC (rev 1059)
@@ -49,6 +49,7 @@
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
 import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
 import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
+import org.ourproject.kune.platf.client.ui.rte.TestRTEDialog;
 import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbarPresenter;
@@ -359,7 +360,7 @@
             public SiteOptions create() {
                 final SiteOptionsPresenter presenter = new SiteOptionsPresenter();
                 final SiteOptionsPanel panel = new SiteOptionsPanel(presenter, $(WorkspaceSkeleton.class),
-                        $(I18nUITranslationService.class), $$(I18nTranslator.class));
+                        $(I18nUITranslationService.class), $$(I18nTranslator.class), $$(TestRTEDialog.class));
                 presenter.init(panel);
                 return presenter;
             }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java	2009-03-04 00:11:14 UTC (rev 1058)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java	2009-03-05 13:57:02 UTC (rev 1059)
@@ -20,6 +20,7 @@
 package org.ourproject.kune.workspace.client.sitebar.siteoptions;
 
 import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.ui.rte.TestRTEDialog;
 import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
 import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
 
@@ -37,7 +38,8 @@
 public class SiteOptionsPanel implements SiteOptionsView {
 
     public SiteOptionsPanel(final SiteOptionsPresenter presenter, final WorkspaceSkeleton ws,
-            final I18nUITranslationService i18n, final Provider<I18nTranslator> translatorProvider) {
+            final I18nUITranslationService i18n, final Provider<I18nTranslator> translatorProvider,
+            final Provider<TestRTEDialog> editor) {
         final PushButton optionsButton = new PushButton("");
         // optionsButton.setText(i18n.t("Options"));
         optionsButton.setHTML(i18n.t("Options")
@@ -53,6 +55,22 @@
                 optionsMenu.showAt(sender.getAbsoluteLeft(), sender.getAbsoluteTop() + 10);
             }
         });
+
+        final Item testRTE = new Item(i18n.t("Test new RTE"), new BaseItemListenerAdapter() {
+            @Override
+            public void onClick(BaseItem item, EventObject e) {
+                editor.get().show();
+            }
+        }, "");
+
+        final Item testRTEbasic = new Item(i18n.t("Test new RTE (basic mode)"), new BaseItemListenerAdapter() {
+            @Override
+            public void onClick(BaseItem item, EventObject e) {
+                editor.get().setExtended(false);
+                editor.get().show();
+            }
+        }, "");
+
         final Item linkHelpInTrans = new Item(i18n.t("Help with the translation"), new BaseItemListenerAdapter() {
             @Override
             public void onClick(BaseItem item, EventObject e) {
@@ -68,8 +86,9 @@
                 Window.open("http://ourproject.org/tracker/?group_id=407", "_blank", null);
             }
         }, "images/kuneicon16.gif");
+        optionsMenu.addItem(testRTE);
+        optionsMenu.addItem(testRTEbasic);
         optionsMenu.addItem(linkHelpInTrans);
         optionsMenu.addItem(linkKuneBugs);
-
     }
 }




More information about the kune-commits mailing list