[kune-commits] r1635 - in trunk/src/main: java/cc/kune/chat/client java/cc/kune/chat/client/actions java/cc/kune/common/client/notify java/cc/kune/core/client/notify/msgs java/cc/kune/msgs/client webapp/others
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Tue Dec 6 03:42:43 CET 2011
Author: vjrj_
Date: 2011-12-06 03:42:39 +0100 (Tue, 06 Dec 2011)
New Revision: 1635
Modified:
trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java
trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java
trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java
trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierViewImpl.java
trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifyEvent.java
trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.java
trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.ui.xml
trunk/src/main/webapp/others/kune-client-actions.xml
Log:
CLOSED - # 58: NotifyUser messages with title has a bad bottom margin
http://kune.ourproject.org/issues/ticket/58
CLOSED - # 149: Improve the new chat notifications
http://kune.ourproject.org/issues/ticket/149
Modified: trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java 2011-12-06 01:42:07 UTC (rev 1634)
+++ trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java 2011-12-06 02:42:39 UTC (rev 1635)
@@ -24,17 +24,23 @@
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.calclab.hablar.signals.client.notifications.HablarNotifier;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.shared.EventBus;
import com.google.gwt.regexp.shared.MatchResult;
import com.google.gwt.regexp.shared.RegExp;
public class KuneChatNotifier implements HablarNotifier {
private final FileDownloadUtils downUtils;
+ private final EventBus eventBus;
private final I18nTranslationService i18n;
private final RegExp regExp;
- public KuneChatNotifier(final I18nTranslationService i18n, final FileDownloadUtils downUtils) {
+ public KuneChatNotifier(final I18nTranslationService i18n, final FileDownloadUtils downUtils,
+ final EventBus eventBus) {
this.i18n = i18n;
this.downUtils = downUtils;
+ this.eventBus = eventBus;
regExp = RegExp.compile("User (.*) says «(.*)»");
}
@@ -55,7 +61,12 @@
final MatchResult m = regExp.exec(userMessage);
final String user = m.getGroup(1);
NotifyUser.avatar(downUtils.getUserAvatar(user),
- i18n.t("User [%s] says «[%s]»", user, m.getGroup(2)));
+ i18n.t("User [%s] says «[%s]»", user, m.getGroup(2)), new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ ShowChatDialogEvent.fire(eventBus, true);
+ }
+ });
} else {
NotifyUser.info(userMessage);
}
Modified: trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java 2011-12-06 01:42:07 UTC (rev 1634)
+++ trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java 2011-12-06 02:42:39 UTC (rev 1635)
@@ -99,7 +99,7 @@
// notificationManager.addNotifier((BrowserPopupHablarNotifier)
// GWT.create(BrowserPopupHablarNotifier.class),
// true);
- notificationManager.addNotifier(new KuneChatNotifier(i18n, downUtils), true);
+ notificationManager.addNotifier(new KuneChatNotifier(i18n, downUtils, kuneEventBus), true);
final SignalsPreferencesPresenter preferencesPage = new SignalsPreferencesPresenter(session,
storageManager, hablarEventBus, preferences, new SignalsPreferencesWidget(), notificationManager);
Modified: trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java 2011-12-06 01:42:07 UTC (rev 1634)
+++ trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java 2011-12-06 02:42:39 UTC (rev 1635)
@@ -74,6 +74,7 @@
session.logout();
}
}
+
public class ChangeOnlineStatusAction extends AbstractExtendedAction {
private final ImageResource icon;
private final PresenceManager manager;
@@ -104,6 +105,7 @@
}
}
}
+ private static final int AWAY_TIMER_MILLSECS = 60000;
private static final String GROUP_CHAT_STATUS = "k-group-chat-status";
private static final String NO_STATUS = null;
@@ -203,7 +205,7 @@
}.schedule(1000);
}
} else {
- awayTimer.schedule(3000);
+ awayTimer.schedule(AWAY_TIMER_MILLSECS);
}
}
});
Modified: trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2011-12-06 01:42:07 UTC (rev 1634)
+++ trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2011-12-06 02:42:39 UTC (rev 1635)
@@ -26,6 +26,7 @@
import cc.kune.core.client.notify.spiner.ProgressShowEvent;
import cc.kune.core.shared.i18n.I18nTranslationService;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.resources.client.ImageResource;
@@ -44,8 +45,10 @@
askConfirmation(null, title, message, callback);
}
- public static void avatar(final String url, final String message) {
- eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.avatar.url(url), message));
+ public static void avatar(final String url, final String message, final ClickHandler clickHandler) {
+ final UserNotifyEvent event = new UserNotifyEvent(NotifyLevel.avatar.url(url), message);
+ event.setClickHandler(clickHandler);
+ eventBus.fireEvent(event);
}
public static void error(final String message) {
Modified: trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierViewImpl.java 2011-12-06 01:42:07 UTC (rev 1634)
+++ trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierViewImpl.java 2011-12-06 02:42:39 UTC (rev 1635)
@@ -26,6 +26,7 @@
import cc.kune.msgs.client.UserMessagesPanel;
import cc.kune.msgs.client.UserMessagesPresenter;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Widget;
@@ -62,6 +63,10 @@
popup.setCenterPosition();
}
});
+ final ClickHandler clickHandler = event.getClickHandler();
+ if (clickHandler != null) {
+ msg.addClickHandler(clickHandler);
+ }
event.setCloser(new UserNotifyEvent.UserNotifyCloser() {
@Override
public void close() {
Modified: trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifyEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifyEvent.java 2011-12-06 01:42:07 UTC (rev 1634)
+++ trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifyEvent.java 2011-12-06 02:42:39 UTC (rev 1635)
@@ -20,8 +20,8 @@
package cc.kune.core.client.notify.msgs;
import cc.kune.common.client.notify.NotifyLevel;
-import cc.kune.msgs.client.CloseCallback;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
@@ -69,8 +69,8 @@
return TYPE;
}
+ private ClickHandler clickHandler;
private final Boolean closeable;
- private CloseCallback closeCallback;
private UserNotifyCloser closer;
private java.lang.String id;
private final NotifyLevel level;
@@ -112,14 +112,14 @@
return TYPE;
}
+ public ClickHandler getClickHandler() {
+ return clickHandler;
+ }
+
public Boolean getCloseable() {
return closeable;
}
- public CloseCallback getCloseCallback() {
- return closeCallback;
- }
-
public UserNotifyCloser getCloser() {
return closer;
}
@@ -140,8 +140,8 @@
return title;
}
- public void setCloseCallback(final CloseCallback closeCallback) {
- this.closeCallback = closeCallback;
+ public void setClickHandler(final ClickHandler clickHandler) {
+ this.clickHandler = clickHandler;
}
public void setCloser(final UserNotifyCloser closer) {
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-12-06 01:42:07 UTC (rev 1634)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-12-06 02:42:39 UTC (rev 1635)
@@ -1,7 +1,9 @@
package cc.kune.msgs.client;
-public interface UserMessage {
+import com.google.gwt.event.dom.client.HasClickHandlers;
+public interface UserMessage extends HasClickHandlers {
+
void appendMsg(String message);
void close();
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.java 2011-12-06 01:42:07 UTC (rev 1634)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.java 2011-12-06 02:42:39 UTC (rev 1635)
@@ -30,6 +30,8 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
@@ -40,6 +42,7 @@
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasText;
+import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.InlineHTML;
import com.google.gwt.user.client.ui.PushButton;
@@ -67,6 +70,7 @@
private static int fadeMills = 5000;
private static final MsgTemplate MSG_NO_TITLE = GWT.create(MsgTemplate.class);
+
private static final MsgWithTitleTemplate MSG_WITH_TITLE = GWT.create(MsgWithTitleTemplate.class);
private static UserMessageWidgetUiBinder uiBinder = GWT.create(UserMessageWidgetUiBinder.class);
@@ -89,6 +93,9 @@
@UiField
InlineHTML label;
+ @UiField
+ HorizontalPanel panel;
+
private Timer time;
public UserMessageWidget(final NotifyLevel level, final String title, final String message,
@@ -132,6 +139,12 @@
}
@Override
+ public HandlerRegistration addClickHandler(final ClickHandler handler) {
+ panel.addStyleName("k-pointer");
+ return addDomHandler(handler, ClickEvent.getType());
+ }
+
+ @Override
public void appendMsg(final String message) {
resetTimer();
label.setHTML(sanitize(label.getHTML() + "<p>" + message + "</p>"));
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.ui.xml 2011-12-06 01:42:07 UTC (rev 1634)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.ui.xml 2011-12-06 02:42:39 UTC (rev 1635)
@@ -17,7 +17,7 @@
</ui:style>
<ui:with field='img'
type='cc.kune.msgs.client.resources.UserMessageImages'/>
- <g:HorizontalPanel verticalAlignment="ALIGN_MIDDLE"
+ <g:HorizontalPanel ui:field="panel" verticalAlignment="ALIGN_MIDDLE"
addStyleNames="k-msg, k-3corners, {style.k-msg-width}">
<g:SimplePanel addStyleNames="k-msg-icon">
<g:Image width="100%" ui:field="icon" height="100%"/>
Modified: trunk/src/main/webapp/others/kune-client-actions.xml
===================================================================
--- trunk/src/main/webapp/others/kune-client-actions.xml 2011-12-06 01:42:07 UTC (rev 1634)
+++ trunk/src/main/webapp/others/kune-client-actions.xml 2011-12-06 02:42:39 UTC (rev 1635)
@@ -5,6 +5,18 @@
<!-- List of Wave extensions to use in Kune ===================== -->
<waveExtensions>
+
+ <extension>
+ <name>WavePlan</name>
+ <installerUrl>http://sh1.sg.securlogic.com/wave/waveplan/manifest.xml
+ </installerUrl>
+ <gadgetUrl>http://sh1.sg.securlogic.com/wave/waveplan/waveplan.xml
+ </gadgetUrl>
+ <iconUrl>http://sh1.sg.securlogic.com/wave/waveplan/waveplan.png
+ </iconUrl>
+ <iconCss></iconCss>
+ </extension>
+
<extension>
<name>Image</name>
<installerUrl>http://everybodywave.appspot.com/gadget/image/xt.xml
@@ -411,6 +423,40 @@
<participants>ask</participants>
</guiActionDescriptor>
+
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>WavePlan</extensionName>
+ <name>New meet planer</name>
+ <path>New Gadget»Calendar</path>
+ <description>This gadget helps you to coordinate multi-participant schedules and make decisions in an intuitive manner.
+ </description>
+ <new-content-title>New meet planner</new-content-title>
+ <new-content-textintro></new-content-textintro>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId origTypeId="docs.folder" destTypeId="docs.doc"/>
+ <typeId origTypeId="docs.root" destTypeId="docs.doc"/>
+ <typeId origTypeId="blogs.blog" destTypeId="blogs.post"/>
+ <typeId origTypeId="lists.list" destTypeId="lists.post"/>
+ <!-- Add gadget in docs directly: -->
+ <typeId origTypeId="docs.doc" destTypeId="docs.doc"/>
+ <typeId origTypeId="blogs.post" destTypeId="blogs.post"/>
+ <typeId origTypeId="lists.post" destTypeId="lists.post"/>
+ <typeId origTypeId="wiki.wikipage" destTypeId="wiki.wikipage"/>
+ <typeId origTypeId="tasks.task" destTypeId="tasks.task"/>
+ </typeIds>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
+ used yet) -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
+
+
<!-- Media ================================================== -->
<guiActionDescriptor>
More information about the kune-commits
mailing list