Open single feed separately enhancement implemeented #1818
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@78962 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ba35eca785
commit
224c71c22b
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/news-feed-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<classpathentry kind="src" output="target/news-feed-1.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
|
@ -31,5 +31,5 @@
|
|||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/news-feed-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
<classpathentry kind="output" path="target/news-feed-1.1.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#Tue Apr 02 15:59:20 CEST 2013
|
||||
#Thu Jul 11 11:44:03 CEST 2013
|
||||
eclipse.preferences.version=1
|
||||
jarsExcludedFromWebInfLib=
|
||||
lastWarOutDir=/Users/massi/Documents/workspace/news-feed/target/news-feed-1.0.0-SNAPSHOT
|
||||
lastWarOutDir=/Users/massi/Documents/workspace/news-feed/target/news-feed-1.1.0-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlets.user.NewsFeed.1-1-0" date="2013-07-08">
|
||||
<Change>Open single feed separately enhancement implemeented #1818</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets.user.NewsFeed.1-0-0"
|
||||
date="2013-04-19">
|
||||
<Change>Mavenized</Change>
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -13,7 +13,7 @@
|
|||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>news-feed</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
|
||||
<name>gCube News Feed Portlet</name>
|
||||
<description>
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package org.gcube.portlets.user.newsfeed.client.event;
|
||||
|
||||
import org.gcube.portlets.user.newsfeed.client.templates.TweetTemplate;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
|
||||
|
||||
public class OpenFeedEvent extends GwtEvent<OpenFeedEventHandler> {
|
||||
public static Type<OpenFeedEventHandler> TYPE = new Type<OpenFeedEventHandler>();
|
||||
|
||||
private TweetTemplate toShow;
|
||||
|
||||
|
||||
public TweetTemplate getToShow() {
|
||||
return toShow;
|
||||
}
|
||||
|
||||
public OpenFeedEvent(TweetTemplate toShow) {
|
||||
this.toShow = toShow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type<OpenFeedEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispatch(OpenFeedEventHandler handler) {
|
||||
handler.onOpenFeed(this);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package org.gcube.portlets.user.newsfeed.client.event;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
public interface OpenFeedEventHandler extends EventHandler {
|
||||
void onOpenFeed(OpenFeedEvent event);
|
||||
}
|
|
@ -24,6 +24,8 @@ import org.gcube.portlets.user.newsfeed.client.event.DeleteFeedEvent;
|
|||
import org.gcube.portlets.user.newsfeed.client.event.DeleteFeedEventHandler;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.EditCommentEvent;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.EditCommentEventHandler;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.OpenFeedEvent;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.OpenFeedEventHandler;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.SeeCommentsEvent;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.SeeCommentsEventHandler;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.SeeLikesEvent;
|
||||
|
@ -164,6 +166,13 @@ public class NewsFeedPanel extends Composite {
|
|||
doDeleteFeed(event.getToDelete());
|
||||
}
|
||||
});
|
||||
|
||||
eventBus.addHandler(OpenFeedEvent.TYPE, new OpenFeedEventHandler() {
|
||||
@Override
|
||||
public void onOpenFeed(OpenFeedEvent event) {
|
||||
doShowFeed(event.getToShow());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -709,6 +718,11 @@ public class NewsFeedPanel extends Composite {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void doShowFeed(final TweetTemplate toShow) {
|
||||
String feedKey = toShow.getFeedKey();
|
||||
Window.Location.assign(Window.Location.getHref() + ((Window.Location.getHref().contains("?")) ? "&oid="+feedKey : "?oid="+feedKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* set the filter type status for automatic reloading of tweets
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.gcube.portal.databook.shared.Feed;
|
|||
import org.gcube.portal.databook.shared.UserInfo;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.AddLikeEvent;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.DeleteFeedEvent;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.OpenFeedEvent;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.SeeCommentsEvent;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.SeeLikesEvent;
|
||||
import org.gcube.portlets.user.newsfeed.client.event.StopTimerEvent;
|
||||
|
@ -98,10 +99,11 @@ public class TweetTemplate extends Composite {
|
|||
@UiField
|
||||
HTML closeImage;
|
||||
@UiField
|
||||
HTML openImage;
|
||||
@UiField
|
||||
VerticalPanel previewPanel;
|
||||
@UiField
|
||||
Label messageSeparator;
|
||||
|
||||
/**
|
||||
* used when fetching tweets from server
|
||||
* @param myUserInfo
|
||||
|
@ -122,10 +124,13 @@ public class TweetTemplate extends Composite {
|
|||
this.eventBus = eventBus;
|
||||
this.isUsers = myFeed.isUsers();
|
||||
myComments = new ArrayList<SingleComment>();
|
||||
closeImage.setStyleName("closeImage");
|
||||
if (isUsers) {
|
||||
closeImage.setStyleName("closeImage");
|
||||
closeImage.setTitle("Delete");
|
||||
}
|
||||
openImage.setStyleName("openImage");
|
||||
openImage.setTitle("Open this feed separately");
|
||||
//show if the user has already liked this
|
||||
if (myFeed.isLiked()) {
|
||||
likeArea.setHTML(NewsFeedPanel.LIKED_LABEL);
|
||||
|
@ -214,12 +219,14 @@ public class TweetTemplate extends Composite {
|
|||
public void onHover(MouseOutEvent event) {
|
||||
if (isUsers)
|
||||
closeImage.removeStyleName("uiCloseButton");
|
||||
openImage.removeStyleName("uiOpenButton");
|
||||
}
|
||||
|
||||
@UiHandler("contentArea")
|
||||
public void onHover(MouseOverEvent event) {
|
||||
if (isUsers)
|
||||
closeImage.addStyleName("uiCloseButton");
|
||||
openImage.addStyleName("uiOpenButton");
|
||||
}
|
||||
|
||||
@UiHandler("closeImage")
|
||||
|
@ -227,6 +234,13 @@ public class TweetTemplate extends Composite {
|
|||
if (isUsers)
|
||||
eventBus.fireEvent(new DeleteFeedEvent(this));
|
||||
}
|
||||
|
||||
@UiHandler("openImage")
|
||||
void onOpenFeedClick(ClickEvent e) {
|
||||
eventBus.fireEvent(new OpenFeedEvent(this));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@UiHandler("seeMore")
|
||||
|
|
|
@ -29,8 +29,9 @@
|
|||
</div>
|
||||
<g:VerticalPanel ui:field="commentsPanel"></g:VerticalPanel>
|
||||
</div>
|
||||
<div class="div-table-col close">
|
||||
<div class="div-table-col close">
|
||||
<g:HTML height="15px" ui:field="closeImage"></g:HTML>
|
||||
<g:HTML height="15px" ui:field="openImage"></g:HTML>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -95,8 +95,8 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
if (user == null) {
|
||||
_log.warn("USER IS NULL setting testing user and Running OUTSIDE PORTAL");
|
||||
user = "test.user";
|
||||
// user = "luca.frosini";
|
||||
// SessionManager.getInstance().getASLSession(sessionID, user).setScope("/gcube/devsec/devVRE");
|
||||
user = "massimiliano.assante";
|
||||
SessionManager.getInstance().getASLSession(sessionID, user).setScope("/gcube/devsec/devVRE");
|
||||
}
|
||||
else {
|
||||
withinPortal = true;
|
||||
|
|
|
@ -224,7 +224,14 @@ table {
|
|||
width: 15px;
|
||||
}
|
||||
|
||||
.uiOpenButton {
|
||||
background: url(images/open-sep.png) 0px 2px no-repeat;
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
}
|
||||
|
||||
.closeImage {
|
||||
float: left;
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
}
|
||||
|
@ -239,6 +246,22 @@ table {
|
|||
background: url(images/close.png) 0px -32px no-repeat;
|
||||
}
|
||||
|
||||
.openImage {
|
||||
float: right;
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
}
|
||||
|
||||
.openImage:hover {
|
||||
background: url(images/open-sep.png) 0px -14px no-repeat;
|
||||
cursor: pointer;
|
||||
cursor: hand;
|
||||
}
|
||||
|
||||
.openImage:active {
|
||||
background: url(images/open-sep.png) 0px -30px no-repeat;
|
||||
}
|
||||
|
||||
.uiEditButton {
|
||||
background: url(images/edit.png) 0px 0px no-repeat;
|
||||
height: 15px;
|
||||
|
@ -457,7 +480,7 @@ a.link:hover {
|
|||
.div-table-col.close {
|
||||
padding-left: 5px;
|
||||
vertical-align: top;
|
||||
width: 15px;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
.div-table-col.photo {
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Loading…
Reference in New Issue