added addComment form if there is at least on comment already on a tweet
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@94749 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3e9e5fb981
commit
aa935c0f79
|
@ -882,6 +882,7 @@ public class NewsFeedPanel extends Composite {
|
||||||
if (commentForm2Add)
|
if (commentForm2Add)
|
||||||
owner.showAddCommentForm();
|
owner.showAddCommentForm();
|
||||||
owner.updateCommentsNumberCount();
|
owner.updateCommentsNumberCount();
|
||||||
|
owner.showAddCommentForm();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class AddCommentTemplate extends Composite {
|
||||||
private static CommentTemplateUiBinder uiBinder = GWT.create(CommentTemplateUiBinder.class);
|
private static CommentTemplateUiBinder uiBinder = GWT.create(CommentTemplateUiBinder.class);
|
||||||
|
|
||||||
|
|
||||||
public final static String COMMENT_TEXT = "Add a comment ... use @ to mention someone";
|
public final static String COMMENT_TEXT = "Write a comment, use @ to mention someone";
|
||||||
public final static String ERROR_UPDATE_TEXT = "Looks like empty to me!";
|
public final static String ERROR_UPDATE_TEXT = "Looks like empty to me!";
|
||||||
public static final String avatar_default = GWT.getModuleBaseURL() + "../images/Avatar_default.png";
|
public static final String avatar_default = GWT.getModuleBaseURL() + "../images/Avatar_default.png";
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class AddCommentTemplate extends Composite {
|
||||||
@UiField SuperPosedTextArea commentTextArea;
|
@UiField SuperPosedTextArea commentTextArea;
|
||||||
@UiField Div highlighterDIV;
|
@UiField Div highlighterDIV;
|
||||||
@UiField Button submitButton;
|
@UiField Button submitButton;
|
||||||
@UiField Button cancelButton;
|
@UiField Button cancelButton; //obsolete
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,6 +60,8 @@ public class AddCommentTemplate extends Composite {
|
||||||
owner = caller;
|
owner = caller;
|
||||||
avatarImage.setPixelSize(30, 30);
|
avatarImage.setPixelSize(30, 30);
|
||||||
avatarImage.setUrl(myUserInfo.getAvatarId());
|
avatarImage.setUrl(myUserInfo.getAvatarId());
|
||||||
|
submitButton.setVisible(false);
|
||||||
|
cancelButton.setVisible(false);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* called on edit comment
|
* called on edit comment
|
||||||
|
@ -87,7 +89,7 @@ public class AddCommentTemplate extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFocus() {
|
public void setFocus() {
|
||||||
commentTextArea.setFocus(true);
|
//commentTextArea.setFocus(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiHandler("submitButton")
|
@UiHandler("submitButton")
|
||||||
|
@ -150,6 +152,7 @@ public class AddCommentTemplate extends Composite {
|
||||||
commentTextArea.addStyleName("comment-dark-color");
|
commentTextArea.addStyleName("comment-dark-color");
|
||||||
commentTextArea.removeStyleName("error");
|
commentTextArea.removeStyleName("error");
|
||||||
}
|
}
|
||||||
|
submitButton.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiHandler("commentTextArea")
|
@UiHandler("commentTextArea")
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class SuperPosedTextArea extends TextArea {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ArrayList<PickingUser> users) {
|
public void onSuccess(ArrayList<PickingUser> users) {
|
||||||
pickUserDlg = new PickUsersDialog(users, eventBus, 450);
|
pickUserDlg = new PickUsersDialog(users, eventBus, 460);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -74,7 +74,6 @@ public class SuperPosedTextArea extends TextArea {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
myAutoSize(areaId);
|
myAutoSize(areaId);
|
||||||
setCaretPositionToBegin(areaId);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
t.schedule(200);
|
t.schedule(200);
|
||||||
|
|
|
@ -219,6 +219,7 @@ public class TweetTemplate extends Composite {
|
||||||
for (Comment comment : myFeed.getComments()) {
|
for (Comment comment : myFeed.getComments()) {
|
||||||
addComment(new SingleComment(comment, this, (comment.getUserid().equals(myUserInfo.getUsername()))));
|
addComment(new SingleComment(comment, this, (comment.getUserid().equals(myUserInfo.getUsername()))));
|
||||||
}
|
}
|
||||||
|
showAddCommentForm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,8 +336,10 @@ public class TweetTemplate extends Composite {
|
||||||
if (! commentsFetched && totalComments > 2) { //if so, need to load all comments before adding a comment
|
if (! commentsFetched && totalComments > 2) { //if so, need to load all comments before adding a comment
|
||||||
fireSeeComments(true);
|
fireSeeComments(true);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
showAddCommentForm();
|
showAddCommentForm();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
GWT.log("Commenting disabled");
|
GWT.log("Commenting disabled");
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,6 +110,10 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
}
|
}
|
||||||
return SessionManager.getInstance().getASLSession(sessionID, user);
|
return SessionManager.getInstance().getASLSession(sessionID, user);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* when packaging test will fail if the user is not set to test.user
|
||||||
|
* @return .
|
||||||
|
*/
|
||||||
public String getDevelopmentUser() {
|
public String getDevelopmentUser() {
|
||||||
String user = "test.user";
|
String user = "test.user";
|
||||||
//user = "massimiliano.assante";
|
//user = "massimiliano.assante";
|
||||||
|
|
|
@ -17,7 +17,7 @@ table {
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
cursor: text;
|
cursor: text;
|
||||||
width: 525px;
|
width: 460px;
|
||||||
height: 54px;
|
height: 54px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ table {
|
||||||
|
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
|
|
||||||
width: 450px;
|
width: 460px;
|
||||||
min-height: 40px;
|
min-height: 40px;
|
||||||
|
|
||||||
word-wrap: break-word; /* this is very important when usere paste long links*/
|
word-wrap: break-word; /* this is very important when usere paste long links*/
|
||||||
|
@ -58,7 +58,7 @@ table {
|
||||||
|
|
||||||
border: 1px solid #C3CDE7;
|
border: 1px solid #C3CDE7;
|
||||||
|
|
||||||
width: 450px;
|
width: 460px;
|
||||||
min-height: 40px;
|
min-height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue