Search in sources :

Example 21 with DialogButton

use of com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton in project openmeetings by apache.

the class SipDialerDialog method onInitialize.

@Override
protected void onInitialize() {
    setTitle(Model.of(getString("1003")));
    call = new DialogButton("call", getString("1448"));
    close = new DialogButton("close", getString("85"));
    super.onInitialize();
}
Also used : DialogButton(com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton)

Example 22 with DialogButton

use of com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton in project openmeetings by apache.

the class ForgetPasswordDialog method onInitialize.

@Override
protected void onInitialize() {
    setTitle(Model.of(getString("312")));
    send = new DialogButton("send", getString("317"));
    cancel = new DialogButton("cancel", getString("lbl.cancel"));
    add(form);
    confirmDialog = new NonClosableMessageDialog("confirmDialog", getString("312"), getString("321")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(IPartialPageRequestHandler handler, DialogButton button) {
            s.open(handler);
        }
    };
    add(confirmDialog);
    super.onInitialize();
}
Also used : DialogButton(com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton) NonClosableMessageDialog(org.apache.openmeetings.web.util.NonClosableMessageDialog) IPartialPageRequestHandler(org.apache.wicket.core.request.handler.IPartialPageRequestHandler)

Example 23 with DialogButton

use of com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton in project openmeetings by apache.

the class SignInDialog method onInitialize.

@Override
protected void onInitialize() {
    getTitle().setObject(getString("108"));
    loginBtn = new DialogButton("login", getString("112")) {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isIndicating() {
            return true;
        }
    };
    registerBtn = new DialogButton("register", getString("123"));
    super.onInitialize();
}
Also used : DialogButton(com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton)

Example 24 with DialogButton

use of com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton in project openmeetings by apache.

the class RoomPanel method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    // let's refresh user in client
    cm.update(getClient().updateUser(userDao));
    Component accessDenied = new WebMarkupContainer(ACCESS_DENIED_ID).setVisible(false);
    room.add(AttributeModifier.append(ATTR_CLASS, r.getType().name()));
    room.add(menu = new RoomMenuPanel("menu", this));
    room.add(AttributeModifier.append("data-room-id", r.getId()));
    if (interview) {
        room.add(new WebMarkupContainer("wb-area").add(wb));
    } else {
        Droppable<BaseFileItem> wbArea = new Droppable<BaseFileItem>("wb-area") {

            private static final long serialVersionUID = 1L;

            @Override
            public void onConfigure(JQueryBehavior behavior) {
                super.onConfigure(behavior);
                behavior.setOption("hoverClass", Options.asString("ui-state-hover"));
                behavior.setOption("accept", Options.asString(".recorditem, .fileitem, .readonlyitem"));
            }

            @Override
            public void onDrop(AjaxRequestTarget target, Component component) {
                Object o = component.getDefaultModelObject();
                if (wb.isVisible() && o instanceof BaseFileItem) {
                    BaseFileItem f = (BaseFileItem) o;
                    if (sidebar.getFilesPanel().isSelected(f)) {
                        for (Entry<String, BaseFileItem> e : sidebar.getFilesPanel().getSelected().entrySet()) {
                            wb.sendFileToWb(e.getValue(), false);
                        }
                    } else {
                        wb.sendFileToWb(f, false);
                    }
                }
            }
        };
        room.add(wbArea.add(wb));
    }
    room.add(roomEnter);
    room.add(sidebar = new RoomSidebar("sidebar", this));
    add(roomClosed = new RedirectMessageDialog("room-closed", "1098", r.isClosed(), r.getRedirectURL()));
    if (r.isClosed()) {
        room.setVisible(false);
    } else if (cm.listByRoom(r.getId()).size() >= r.getCapacity()) {
        accessDenied = new ExpiredMessageDialog(ACCESS_DENIED_ID, getString("99"), menu);
        room.setVisible(false);
    } else if (r.getId().equals(WebSession.get().getRoomId())) {
    // secureHash/invitationHash, already checked
    } else {
        boolean allowed = false;
        String deniedMessage = null;
        if (r.isAppointment()) {
            Appointment a = apptDao.getByRoom(r.getId());
            if (a != null && !a.isDeleted()) {
                boolean isOwner = a.getOwner().getId().equals(getUserId());
                allowed = isOwner;
                log.debug("appointed room, isOwner ? {}", isOwner);
                if (!allowed) {
                    for (MeetingMember mm : a.getMeetingMembers()) {
                        if (getUserId().equals(mm.getUser().getId())) {
                            allowed = true;
                            break;
                        }
                    }
                }
                if (allowed) {
                    Calendar c = WebSession.getCalendar();
                    if (isOwner || c.getTime().after(a.getStart()) && c.getTime().before(a.getEnd())) {
                        eventDetail = new EventDetailDialog(EVENT_DETAILS_ID, a);
                    } else {
                        allowed = false;
                        deniedMessage = String.format("%s %s - %s", getString("error.hash.period"), getDateFormat().format(a.getStart()), getDateFormat().format(a.getEnd()));
                    }
                }
            }
        } else {
            allowed = r.getIspublic() || (r.getOwnerId() != null && r.getOwnerId().equals(getUserId()));
            log.debug("public ? " + r.getIspublic() + ", ownedId ? " + r.getOwnerId() + " " + allowed);
            if (!allowed) {
                User u = getClient().getUser();
                for (RoomGroup ro : r.getGroups()) {
                    for (GroupUser ou : u.getGroupUsers()) {
                        if (ro.getGroup().getId().equals(ou.getGroup().getId())) {
                            allowed = true;
                            break;
                        }
                    }
                    if (allowed) {
                        break;
                    }
                }
            }
        }
        if (!allowed) {
            if (deniedMessage == null) {
                deniedMessage = getString("1599");
            }
            accessDenied = new ExpiredMessageDialog(ACCESS_DENIED_ID, deniedMessage, menu);
            room.setVisible(false);
        }
    }
    waitForModerator = new MessageDialog("wait-for-moderator", getString("204"), getString("696"), DialogButtons.OK, DialogIcon.LIGHT) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(IPartialPageRequestHandler handler, DialogButton button) {
        // no-op
        }
    };
    waitApplyModeration = new MessageDialog("wait-apply-moderation", getString("204"), getString(r.isModerated() ? "641" : "498"), DialogButtons.OK, DialogIcon.LIGHT) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(IPartialPageRequestHandler handler, DialogButton button) {
        // no-op
        }
    };
    add(room, accessDenied, eventDetail, waitForModerator, waitApplyModeration);
    if (r.isWaitForRecording()) {
        add(new MessageDialog("wait-for-recording", getString("1316"), getString("1315"), DialogButtons.OK, DialogIcon.LIGHT) {

            private static final long serialVersionUID = 1L;

            @Override
            public void onConfigure(JQueryBehavior behavior) {
                super.onConfigure(behavior);
                behavior.setOption("autoOpen", true);
                behavior.setOption("resizable", false);
            }

            @Override
            public void onClose(IPartialPageRequestHandler handler, DialogButton button) {
            // no-op
            }
        });
    } else {
        add(new WebMarkupContainer("wait-for-recording").setVisible(false));
    }
    if (room.isVisible()) {
        add(new NicknameDialog("nickname", this));
        add(download);
        add(new BaseWebSocketBehavior("media"));
    } else {
        add(new WebMarkupContainer("nickname").setVisible(false));
    }
    add(clientKicked = new MessageDialog("client-kicked", getString("797"), getString("606"), DialogButtons.OK, DialogIcon.ERROR) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(IPartialPageRequestHandler handler, DialogButton button) {
            menu.exit(handler);
        }
    });
}
Also used : Appointment(org.apache.openmeetings.db.entity.calendar.Appointment) DialogButton(com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton) User(org.apache.openmeetings.db.entity.user.User) GroupUser(org.apache.openmeetings.db.entity.user.GroupUser) GroupUser(org.apache.openmeetings.db.entity.user.GroupUser) MeetingMember(org.apache.openmeetings.db.entity.calendar.MeetingMember) RoomSidebar(org.apache.openmeetings.web.room.sidebar.RoomSidebar) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) MessageDialog(com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog) Component(org.apache.wicket.Component) JQueryBehavior(com.googlecode.wicket.jquery.core.JQueryBehavior) Droppable(com.googlecode.wicket.jquery.ui.interaction.droppable.Droppable) Calendar(java.util.Calendar) RoomMenuPanel(org.apache.openmeetings.web.room.menu.RoomMenuPanel) IPartialPageRequestHandler(org.apache.wicket.core.request.handler.IPartialPageRequestHandler) BaseWebSocketBehavior(org.apache.wicket.protocol.ws.api.BaseWebSocketBehavior) BaseFileItem(org.apache.openmeetings.db.entity.file.BaseFileItem) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) JSONObject(com.github.openjson.JSONObject) RoomGroup(org.apache.openmeetings.db.entity.room.RoomGroup)

Example 25 with DialogButton

use of com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton in project openmeetings by apache.

the class MainPanel method onInitialize.

@Override
protected void onInitialize() {
    menu = new MenuPanel("menu", getMainMenu());
    add(topControls.setOutputMarkupPlaceholderTag(true).setMarkupId("topControls"));
    add(contents.add(getClient() == null || panel == null ? EMPTY : panel).setOutputMarkupId(true).setMarkupId("contents"));
    topControls.add(menu.setVisible(false), topLinks.setVisible(false).setOutputMarkupPlaceholderTag(true).setMarkupId("topLinks"));
    topLinks.add(new AjaxLink<Void>("messages") {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            updateContents(PROFILE_MESSAGES, target);
        }
    });
    topLinks.add(new AjaxLink<Void>("profile") {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            updateContents(PROFILE_EDIT, target);
        }
    });
    final AboutDialog about = new AboutDialog("aboutDialog");
    topLinks.add(new AjaxLink<Void>("about") {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            about.open(target);
        }
    });
    if (getApplication().getDebugSettings().isDevelopmentUtilitiesEnabled()) {
        add(new DebugBar("dev").setOutputMarkupId(true));
    } else {
        add(new EmptyPanel("dev").setVisible(false));
    }
    add(new OmAjaxClientInfoBehavior());
    add(about, chat = new ChatPanel("chatPanel"));
    add(newMessage = new MessageDialog("newMessageDialog", new CompoundPropertyModel<>(new PrivateMessage())) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(IPartialPageRequestHandler handler, DialogButton button) {
            BasePanel bp = getCurrentPanel();
            if (send.equals(button) && bp != null) {
                bp.onNewMessageClose(handler);
            }
        }
    });
    add(userInfo = new UserInfoDialog("userInfoDialog", newMessage));
    add(new AbstractDefaultAjaxBehavior() {

        private static final long serialVersionUID = 1L;

        @Override
        protected void respond(AjaxRequestTarget target) {
            userInfo.open(target, getParam(getComponent(), PARAM_USER_ID).toLong());
        }

        @Override
        public void renderHead(Component component, IHeaderResponse response) {
            super.renderHead(component, response);
            response.render(new PriorityHeaderItem(getNamedFunction("showUserInfo", this, explicit(PARAM_USER_ID))));
        }
    });
    add(new AbstractDefaultAjaxBehavior() {

        private static final long serialVersionUID = 1L;

        @Override
        protected void respond(AjaxRequestTarget target) {
            ContactsHelper.addUserToContactList(getParam(getComponent(), PARAM_USER_ID).toLong());
        }

        @Override
        public void renderHead(Component component, IHeaderResponse response) {
            super.renderHead(component, response);
            response.render(new PriorityHeaderItem(getNamedFunction("addContact", this, explicit(PARAM_USER_ID))));
        }
    });
    add(new AbstractDefaultAjaxBehavior() {

        private static final long serialVersionUID = 1L;

        @Override
        protected void respond(AjaxRequestTarget target) {
            newMessage.reset(true).open(target, getParam(getComponent(), PARAM_USER_ID).toOptionalLong());
        }

        @Override
        public void renderHead(Component component, IHeaderResponse response) {
            super.renderHead(component, response);
            response.render(new PriorityHeaderItem(getNamedFunction("privateMessage", this, explicit(PARAM_USER_ID))));
        }
    });
    add(inviteUser = new InviteUserToRoomDialog("invite-to-room"));
    add(new AbstractDefaultAjaxBehavior() {

        private static final long serialVersionUID = 1L;

        @Override
        protected void respond(AjaxRequestTarget target) {
            inviteUser.open(target, getParam(getComponent(), PARAM_USER_ID).toLong());
        }

        @Override
        public void renderHead(Component component, IHeaderResponse response) {
            super.renderHead(component, response);
            response.render(new PriorityHeaderItem(getNamedFunction("inviteUser", this, explicit(PARAM_USER_ID))));
        }
    });
    topLinks.add(new ConfirmableAjaxBorder("logout", getString("310"), getString("634")) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            getSession().invalidate();
            setResponsePage(Application.get().getSignInPageClass());
        }
    });
    super.onInitialize();
}
Also used : DebugBar(org.apache.wicket.devutils.debugbar.DebugBar) DialogButton(com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton) AboutDialog(org.apache.openmeetings.web.user.AboutDialog) EmptyPanel(org.apache.wicket.markup.html.panel.EmptyPanel) IPartialPageRequestHandler(org.apache.wicket.core.request.handler.IPartialPageRequestHandler) ChatPanel(org.apache.openmeetings.web.user.chat.ChatPanel) InviteUserToRoomDialog(org.apache.openmeetings.web.user.InviteUserToRoomDialog) MenuPanel(org.apache.openmeetings.web.common.menu.MenuPanel) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) UserInfoDialog(org.apache.openmeetings.web.user.UserInfoDialog) PriorityHeaderItem(org.apache.wicket.markup.head.PriorityHeaderItem) AbstractDefaultAjaxBehavior(org.apache.wicket.ajax.AbstractDefaultAjaxBehavior) IHeaderResponse(org.apache.wicket.markup.head.IHeaderResponse) MessageDialog(org.apache.openmeetings.web.user.MessageDialog) PrivateMessage(org.apache.openmeetings.db.entity.user.PrivateMessage) Component(org.apache.wicket.Component)

Aggregations

DialogButton (com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton)26 IPartialPageRequestHandler (org.apache.wicket.core.request.handler.IPartialPageRequestHandler)10 MessageDialog (com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog)6 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)5 NonClosableMessageDialog (org.apache.openmeetings.web.util.NonClosableMessageDialog)3 JQueryBehavior (com.googlecode.wicket.jquery.core.JQueryBehavior)2 Room (org.apache.openmeetings.db.entity.room.Room)2 PrivateMessage (org.apache.openmeetings.db.entity.user.PrivateMessage)2 Component (org.apache.wicket.Component)2 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)2 EmptyPanel (org.apache.wicket.markup.html.panel.EmptyPanel)2 JSONObject (com.github.openjson.JSONObject)1 Droppable (com.googlecode.wicket.jquery.ui.interaction.droppable.Droppable)1 WysiwygEditor (com.googlecode.wicket.jquery.ui.plugins.wysiwyg.WysiwygEditor)1 DefaultWysiwygToolbar (com.googlecode.wicket.jquery.ui.plugins.wysiwyg.toolbar.DefaultWysiwygToolbar)1 Calendar (java.util.Calendar)1 FastDateFormat (org.apache.commons.lang3.time.FastDateFormat)1 StrongPasswordValidator (org.apache.openmeetings.core.util.StrongPasswordValidator)1 IWsClient (org.apache.openmeetings.db.entity.basic.IWsClient)1 WsClient (org.apache.openmeetings.db.entity.basic.WsClient)1