Bug #16225 mentions and replies http links not working in some email notifications
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@178462 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
45c305c16c
commit
83c3b07fc2
|
@ -12,12 +12,14 @@ import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.KeyPressEvent;
|
import com.google.gwt.event.dom.client.KeyPressEvent;
|
||||||
import com.google.gwt.event.shared.HandlerManager;
|
import com.google.gwt.event.shared.HandlerManager;
|
||||||
|
import com.google.gwt.event.shared.HandlerRegistration;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiFactory;
|
import com.google.gwt.uibinder.client.UiFactory;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.uibinder.client.UiHandler;
|
import com.google.gwt.uibinder.client.UiHandler;
|
||||||
import com.google.gwt.user.client.Timer;
|
import com.google.gwt.user.client.Timer;
|
||||||
import com.google.gwt.user.client.Window;
|
import com.google.gwt.user.client.Window;
|
||||||
|
import com.google.gwt.user.client.Window.ClosingHandler;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
|
@ -41,6 +43,8 @@ public class AddCommentTemplate extends Composite {
|
||||||
private boolean isEditing = false;
|
private boolean isEditing = false;
|
||||||
private HTMLPanel commentPanel;
|
private HTMLPanel commentPanel;
|
||||||
private Comment toEdit;
|
private Comment toEdit;
|
||||||
|
private ClosingHandler closingHandler;
|
||||||
|
private HandlerRegistration handlerRegistration;
|
||||||
|
|
||||||
@UiField HTMLPanel mainPanel;
|
@UiField HTMLPanel mainPanel;
|
||||||
@UiField Image avatarImage;
|
@UiField Image avatarImage;
|
||||||
|
@ -66,16 +70,6 @@ public class AddCommentTemplate extends Composite {
|
||||||
cancelButton.setVisible(false);
|
cancelButton.setVisible(false);
|
||||||
commentTextArea.setHeight("30px");
|
commentTextArea.setHeight("30px");
|
||||||
commentTextArea.setContext(owner.getVREContext());
|
commentTextArea.setContext(owner.getVREContext());
|
||||||
|
|
||||||
// add onWindowClosing handler to alert the user who didn't share post if really wants to leave
|
|
||||||
Window.addWindowClosingHandler(new Window.ClosingHandler() {
|
|
||||||
public void onWindowClosing(Window.ClosingEvent closingEvent) {
|
|
||||||
String currentText = commentTextArea.getText();
|
|
||||||
if(!currentText.isEmpty()){
|
|
||||||
closingEvent.setMessage("Do you really want to leave the page?");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* called on edit comment
|
* called on edit comment
|
||||||
|
@ -103,17 +97,19 @@ public class AddCommentTemplate extends Composite {
|
||||||
mainPanel.setStyleName("single-comment");
|
mainPanel.setStyleName("single-comment");
|
||||||
commentTextArea.addStyleName("comment-dark-color");
|
commentTextArea.addStyleName("comment-dark-color");
|
||||||
submitButton.setText("Edit");
|
submitButton.setText("Edit");
|
||||||
|
closingHandler = new Window.ClosingHandler() {
|
||||||
// add onWindowClosing handler to alert the user who didn't share post if really wants to leave
|
|
||||||
Window.addWindowClosingHandler(new Window.ClosingHandler() {
|
|
||||||
public void onWindowClosing(Window.ClosingEvent closingEvent) {
|
public void onWindowClosing(Window.ClosingEvent closingEvent) {
|
||||||
String currentText = commentTextArea.getText();
|
String currentText = commentTextArea.getText();
|
||||||
if(!currentText.isEmpty()){
|
if(!currentText.isEmpty()){
|
||||||
closingEvent.setMessage("Do you really want to leave the page?");
|
closingEvent.setMessage("Do you really want to leave the page?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
handlerRegistration = Window.addWindowClosingHandler(closingHandler);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** Used by AddCommentTemplate to instantiate SuperPosedTextArea */
|
/** Used by AddCommentTemplate to instantiate SuperPosedTextArea */
|
||||||
@UiFactory SuperPosedTextArea build() {
|
@UiFactory SuperPosedTextArea build() {
|
||||||
|
@ -123,11 +119,21 @@ public class AddCommentTemplate extends Composite {
|
||||||
public void setFocus() {
|
public void setFocus() {
|
||||||
commentTextArea.setFocus(true);
|
commentTextArea.setFocus(true);
|
||||||
submitButton.setVisible(true);
|
submitButton.setVisible(true);
|
||||||
|
cancelButton.setVisible(true);
|
||||||
//it needs a timer otherwise it won't work
|
//it needs a timer otherwise it won't work
|
||||||
Timer t = new Timer() {
|
Timer t = new Timer() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
setCaretPositionToBegin(commentTextArea.getAreaId());
|
setCaretPositionToBegin(commentTextArea.getAreaId());
|
||||||
|
closingHandler = new Window.ClosingHandler() {
|
||||||
|
public void onWindowClosing(Window.ClosingEvent closingEvent) {
|
||||||
|
String currentText = commentTextArea.getText();
|
||||||
|
if(!currentText.isEmpty()){
|
||||||
|
closingEvent.setMessage("Do you really want to leave the page?");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
handlerRegistration = Window.addWindowClosingHandler(closingHandler);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
t.schedule(200);
|
t.schedule(200);
|
||||||
|
@ -156,6 +162,8 @@ public class AddCommentTemplate extends Composite {
|
||||||
}
|
}
|
||||||
this.getWidget().setVisible(false);
|
this.getWidget().setVisible(false);
|
||||||
owner.setCommentingDisabled(false);
|
owner.setCommentingDisabled(false);
|
||||||
|
handlerRegistration.removeHandler();
|
||||||
|
GWT.log(" handlerRegistration.removeHandler();");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -185,6 +193,7 @@ public class AddCommentTemplate extends Composite {
|
||||||
SingleComment sc = new SingleComment(toEdit, owner, true);
|
SingleComment sc = new SingleComment(toEdit, owner, true);
|
||||||
commentPanel.add(sc);
|
commentPanel.add(sc);
|
||||||
}
|
}
|
||||||
|
handlerRegistration.removeHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -196,6 +205,16 @@ public class AddCommentTemplate extends Composite {
|
||||||
commentTextArea.removeStyleName("nwfeed-error");
|
commentTextArea.removeStyleName("nwfeed-error");
|
||||||
}
|
}
|
||||||
submitButton.setVisible(true);
|
submitButton.setVisible(true);
|
||||||
|
cancelButton.setVisible(true);
|
||||||
|
closingHandler = new Window.ClosingHandler() {
|
||||||
|
public void onWindowClosing(Window.ClosingEvent closingEvent) {
|
||||||
|
String currentText = commentTextArea.getText();
|
||||||
|
if(!currentText.isEmpty()){
|
||||||
|
closingEvent.setMessage("Do you really want to leave the page?");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
handlerRegistration = Window.addWindowClosingHandler(closingHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiHandler("commentTextArea")
|
@UiHandler("commentTextArea")
|
||||||
|
|
|
@ -671,7 +671,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
|
|
||||||
//if there are users who liked this post they get notified, asynchronously with this thread
|
//if there are users who liked this post they get notified, asynchronously with this thread
|
||||||
ArrayList<Like> favorites = getAllLikesByPost(feedid);
|
ArrayList<Like> favorites = getAllLikesByPost(feedid);
|
||||||
Thread likesThread = new Thread(new LikeNotificationsThread(commentText, nm, favorites, feedOwnerId, comment.getKey()));
|
Thread likesThread = new Thread(new LikeNotificationsThread(escapedCommentText, nm, favorites, feedOwnerId, comment.getKey()));
|
||||||
likesThread.start();
|
likesThread.start();
|
||||||
|
|
||||||
//notify the other users who commented this post (excluding the ones above)
|
//notify the other users who commented this post (excluding the ones above)
|
||||||
|
@ -724,7 +724,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
toPass.add(new GenericItemBean(userBean.getId(), userBean.getName(), userBean.getAlternativeName(), userBean.getThumbnailURL()));
|
toPass.add(new GenericItemBean(userBean.getId(), userBean.getName(), userBean.getAlternativeName(), userBean.getThumbnailURL()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread thread = new Thread(new MentionNotificationsThread(comment.getFeedid(), commentText, nm, null, toPass));
|
Thread thread = new Thread(new MentionNotificationsThread(comment.getFeedid(), escapedCommentText, nm, null, toPass));
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue