|
|
|
@ -17,12 +17,14 @@ import org.gcube.portlets.user.notifications.shared.NotificationConstants;
|
|
|
|
|
import org.gcube.portlets.user.notifications.shared.NotificationPreference;
|
|
|
|
|
|
|
|
|
|
import com.google.gwt.core.client.GWT;
|
|
|
|
|
import com.google.gwt.dom.client.Element;
|
|
|
|
|
import com.google.gwt.dom.client.Style.Position;
|
|
|
|
|
import com.google.gwt.dom.client.Style.Unit;
|
|
|
|
|
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
|
|
import com.google.gwt.event.dom.client.ClickHandler;
|
|
|
|
|
import com.google.gwt.user.client.Timer;
|
|
|
|
|
import com.google.gwt.user.client.Window;
|
|
|
|
|
import com.google.gwt.user.client.Window.Location;
|
|
|
|
|
import com.google.gwt.user.client.Window.ScrollEvent;
|
|
|
|
|
import com.google.gwt.user.client.Window.ScrollHandler;
|
|
|
|
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
|
|
@ -125,9 +127,30 @@ public class NotificationsPanel extends Composite {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if the url ends with "showsettings=true" open the settings modal automatically
|
|
|
|
|
if(Location.getHref().endsWith("showsettings=true")){
|
|
|
|
|
|
|
|
|
|
Timer t = new Timer() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
clickElement(notificationSettings.getElement());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
t.schedule(1000);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Simulate click event
|
|
|
|
|
* @param elem
|
|
|
|
|
*/
|
|
|
|
|
private static native void clickElement(Element elem) /*-{
|
|
|
|
|
elem.click();
|
|
|
|
|
}-*/;
|
|
|
|
|
|
|
|
|
|
private void showUserNotifications() {
|
|
|
|
|
showLoader();
|
|
|
|
@ -196,7 +219,7 @@ public class NotificationsPanel extends Composite {
|
|
|
|
|
int from = (fromStartingPoint == 0) ? NotificationConstants.NOTIFICATION_NUMBER_PRE+1 : fromStartingPoint;
|
|
|
|
|
fromStartingPoint = from;
|
|
|
|
|
final int quantity = NotificationConstants.NOTIFICATION_NUMBER_PER_REQUEST;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
notificationService.getUserNotificationsByRange(from, quantity, new AsyncCallback<HashMap<Date,ArrayList<Notification>>>() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(HashMap<Date, ArrayList<Notification>> notificationsPerDay) {
|
|
|
|
|