/// <summary>
    /// Builds startup script.
    /// </summary>
    private string BuildStartupScript()
    {
        int id = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            onlineUserTemplate = ChatHelper.GetWebpartTransformation(OnlineUserTransformationName, "chat.error.transformation.users.onlineuser"),
            chatRoomWindowUrl  = ChatHelper.GetChatRoomWindowURL(Page),
            clientID           = ClientID,
            GUID            = id,
            contentClientID = pnlChatSearchOnlineUsers.ClientID,
            textbox         = txtChatSearchOnlineUsers.ClientID,
            button          = btnChatSearchOnlineUsers.ClientID,
            pnlPaging       = pnlChatSearchOnlineUsersPaging.ClientID,
            pagingEnabled   = PagingEnabled,
            pagingItems     = PagingItems > 0 ? PagingItems : ChatHelper.WPPagingItems,
            groupPagesBy    = GroupPagesBy >= 0 ? GroupPagesBy : ChatHelper.WPGroupPagesBy,
            maxUsers        = ResponseMaxUsers,
            inviteMode      = InviteMode,
            loadingDiv      = ChatHelper.GetWebpartLoadingDiv("ChatSearchOnlineUsersWPLoading", "chat.wploading.searchonlineusers"),
            resStrMoreFound = (ResponseMaxUsers > 0) ? String.Format(ResHelper.GetString("chat.searchonlineusers.morefound"), ResponseMaxUsers) : "",
            resStrNotFound  = ResHelper.GetString("chat.searchonlineusers.notfound"),
            pnlInfo         = pnlChatSearchOnlineUsersInfo.ClientID,
            resStrFound     = ResHelper.GetString("chat.searchonlineusers.results"),
            envelopeID      = "envelope_" + ClientID,
            groupID         = GroupName,
            invitePanel     = pnlChatSearchOnlineUsersInvite.ClientID
        }
            );

        return(String.Format("InitChatSearchOnlineUsersWebpart({0});", json));
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Builds startup script.
    /// </summary>
    private string BuildStartupScript()
    {
        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            roomID = RoomID,
            chatMessageTemplate = ChatHelper.GetWebpartTransformation(ChatMessageTransformationName, "chat.error.transformation.messages.message"),
            count                = (Count >= 0) ? Count : ChatHelper.FirstLoadMessagesCountSetting,
            contentClientID      = "#" + pnlChatRoomMessages.ClientID,
            displayInline        = DisplayInline,
            groupID              = GroupID,
            clientID             = ClientID,
            direction            = (int)Direction,
            enableBBCode         = (ChatHelper.EnableBBCodeSetting && EnableBBCode),
            loadingDiv           = ChatHelper.GetWebpartLoadingDiv("ChatMessagesWPLoading", "chat.wploading.messages"),
            envelopeID           = "#envelope_" + ClientID,
            pnlInformDialog      = "#" + pnlChatRoomMessagesInfoDialog.ClientID,
            btnInformDialogClose = "#" + btnChatMessageInformDialogClose.ClientID,
            container            = "#" + pnlChatRoomWebpart.ClientID
        }
            );

        return(String.Format("InitChatMessagesWebpart({0});", json));
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

        if (cmsPage != null)
        {
            ChatHelper.RegisterChatAJAXProxy(cmsPage);
        }

        // Script references insertion
        ChatHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatRoomName_files/ChatRoomName.js");

        // Run script
        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            roomNameTemplate    = ChatHelper.GetWebpartTransformation(ChatRoomNameTransformationName, "chat.error.transformation.namewp.error"),
            contentClientID     = "#" + pnlChatRoomName.ClientID,
            clientID            = ClientID,
            conversationTitle   = ResHelper.GetString("chat.title.privateconversation"),
            groupID             = GroupID,
            displayInitialTitle = DisplayInitialTitle,
            noRoomTitle         = InitialTitle,
            loadingDiv          = ChatHelper.GetWebpartLoadingDiv("ChatRoomNameWPLoading", "chat.wploading.roomname"),
            envelopeID          = "#envelope_" + ClientID
        }
            );
        string startupScript = String.Format("InitChatRoomNameWebpart({0});", json);

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatRoomName_" + ClientID, startupScript, true);
    }
    /// <summary>
    /// Builds startup script.
    /// </summary>
    private string BuildStartupScript()
    {
        int id = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            onlineUserTemplate = ChatHelper.GetWebpartTransformation(OnlineUserTransformationName, "chat.error.transformation.users.onlineuser"),
            chatRoomWindowUrl  = ChatHelper.GetChatRoomWindowURL(),
            clientID           = ClientID,
            GUID                  = id,
            contentClientID       = pnlChatOnlineUsers.ClientID,
            inviteMode            = InviteMode,
            pnlFilterClientID     = pnlChatOnlineUsersFiltering.ClientID,
            pnlPagingClientID     = pnlChatOnlineUsersPaging.ClientID,
            pagingItems           = PagingItems > 0 ? PagingItems : ChatHelper.WPPagingItems,
            pagingEnabled         = EnablePaging,
            btnFilter             = btnChatOnlineUsersFilter.ClientID,
            txtFilter             = txtChatOnlineUsersFilter.ClientID,
            filterEnabled         = EnableFiltering,
            pnlInfo               = pnlChatOnlineUsersInfo.ClientID,
            resStrNoFound         = ResHelper.GetString("chat.onlineusers.notfound"),
            resStrResults         = ResHelper.GetString("chat.onlineusers.results"),
            loadingDiv            = ChatHelper.GetWebpartLoadingDiv("ChatOnlineUsersWPLoading", "chat.wploading.onlineusers"),
            filterCount           = ShowFilterItems >= 0 ? ShowFilterItems : ChatHelper.WPShowFilterLimit,
            envelopeID            = "envelope_" + ClientID,
            resStrNoOneInviteMode = ResHelper.GetString("chat.onlineusers.invitemodenousers"),
            groupID               = GroupName,
            invitePanel           = pnlChatOnlineUsersInvite.ClientID
        }
            );

        return(String.Format("InitChatOnlineUsersWebpart({0});", json));
    }
Ejemplo n.º 5
0
    /// <summary>
    /// Builds startup script.
    /// </summary>
    private string BuildStartupScript()
    {
        int id = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            roomID                        = RoomID,
            chatUserTemplate              = ChatHelper.GetWebpartTransformation(ChatUserTransformationName, "chat.error.transformation.users.user"),
            oneToOneURL                   = ChatHelper.GetChatRoomWindowURL(Page),
            contentClientID               = pnlChatRoomUsers.ClientID,
            clientID                      = ClientID,
            groupID                       = GroupID,
            sortByStatus                  = SortByStatus,
            GUID                          = id,
            pnlChatRoomUsersInvitePrompt  = pnlChatRoomUsersInvitePrompt.ClientID,
            pnlChatRoomUsersInvite        = pnlChatRoomUsersInvite.ClientID,
            chatOnlineUsersElem           = ChatOnlineUsersElem.ClientID,
            chatSearchOnlineUsersElem     = ChatSearchOnlineUsers.ClientID,
            loadingDiv                    = ChatHelper.GetWebpartLoadingDiv("ChatRoomUsersWPLoading", "chat.wploading.roomusers"),
            btnChatRoomUsersInvite        = btnChatRoomUsersInvite.ClientID,
            btnChatRoomsDeletePromptClose = btnChatRoomsDeletePromptClose.ClientID,
            pnlFilterClientID             = pnlChatRoomUsersFiltering.ClientID,
            pnlPagingClientID             = pnlChatRoomUsersPaging.ClientID,
            pagingItems                   = PagingItems > 0 ? PagingItems : ChatHelper.WPPagingItems,
            groupPagesBy                  = GroupPagesBy >= 0 ? GroupPagesBy : ChatHelper.WPGroupPagesBy,
            pagingEnabled                 = EnablePaging,
            btnFilter                     = btnChatRoomUsersFilter.ClientID,
            txtFilter                     = txtChatRoomUsersFilter.ClientID,
            filterEnabled                 = EnableFiltering,
            pnlInfo                       = pnlChaRoomUsersInfo.ClientID,
            resStrNoFound                 = ResHelper.GetString("chat.searchonlineusers.notfound"),
            resStrResults                 = ResHelper.GetString("chat.searchonlineusers.results"),
            filterCount                   = ShowFilterItems >= 0 ? ShowFilterItems : ChatHelper.WPShowFilterLimit,
            envelopeID                    = "envelope_" + ClientID,
            inviteSearchMode              = InviteSearchMode,
            inviteEnabled                 = InviteEnabled
        }
            );

        return(String.Format("InitChatUsersWebpart({0});", json));
    }
Ejemplo n.º 6
0
    /// <summary>
    /// Builds startup script.
    /// </summary>
    private string BuildStartupScript()
    {
        string redirectURL = RedirectURL.Length > 0 ? RedirectURL : ChatHelper.RedirectURLJoinSetting;

        // Set all the transformation settings for chat room window
        int roomSettingsId = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            guid                              = roomSettingsId,
            clientID                          = ClientID,
            groupID                           = GroupID,
            pnlChatRoomsList                  = pnlChatRoomsList.ClientID,
            pnlChatRoomsPrompt                = pnlChatRoomsPrompt.ClientID,
            btnChatRoomsPromptSubmit          = btnChatRoomsPromptSubmit.ClientID,
            pnlChatRoomsCreatePrompt          = pnlChatRoomsCreatePrompt.ClientID,
            txtChatRoomsCreateName            = txtChatRoomsCreateName.ClientID,
            chkChatRoomsCreateIsPrivate       = chkChatRoomsCreateIsPrivate.ClientID,
            txtChatRoomsCreatePassword        = txtChatRoomsCreatePassword.ClientID,
            chkChatRoomsCreateAllowAnonym     = chkChatRoomsCreateAllowAnonym.ClientID,
            btnChatRoomsCreatePromptSubmit    = btnChatRoomsCreatePromptSubmit.ClientID,
            lblChatRoomsCreateError           = lblChatRoomsCreateError.ClientID,
            txtChatRoomsPromptInput           = txtChatRoomsPromptInput.ClientID,
            btnChatRoomsCreateRoom            = btnChatRoomsCreateRoom.ClientID,
            templateListItem                  = ChatHelper.GetWebpartTransformation(ListItemTransformation, "chat.error.transformation.rooms"),
            loadingDiv                        = ChatHelper.GetWebpartLoadingDiv("ChatRoomsWPLoading", "chat.wploading.rooms"),
            txtChatRoomsCreateDescription     = txtChatRoomsCreateDescription.ClientID,
            btnChatRoomsPromptClose           = btnChatRoomsPromptClose.ClientID,
            btnChatRoomsCreatePromptClose     = btnChatRoomsCreatePromptClose.ClientID,
            btnChatRoomsDeletePromptSubmit    = btnChatRoomsDeletePromptSubmit.ClientID,
            btnChatRoomsDeletePromptClose     = btnChatRoomsDeletePromptClose.ClientID,
            pnlChatRoomsDeletePrompt          = pnlChatRoomsDeletePrompt.ClientID,
            btnChatRoomsAbandonPromptSubmit   = btnChatRoomsAbandonPromptSubmit.ClientID,
            btnChatRoomsAbandonPromptClose    = btnChatRoomsAbandonPromptClose.ClientID,
            pnlChatRoomsAbandonPrompt         = pnlChatRoomsAbandonPrompt.ClientID,
            pnlChatRoomsEditPrompt            = pnlChatRoomsEditPrompt.ClientID,
            txtChatRoomsEditName              = txtChatRoomsEditName.ClientID,
            txtChatRoomsEditDescription       = txtChatRoomsEditDescription.ClientID,
            chkChatRoomsEditIsPrivate         = chkChatRoomsEditIsPrivate.ClientID,
            txtChatRoomsEditPassword          = txtChatRoomsEditPassword.ClientID,
            chkChatRoomsEditAllowAnonym       = chkChatRoomsEditAllowAnonym.ClientID,
            btnChatRoomsEditPromptSubmit      = btnChatRoomsEditPromptSubmit.ClientID,
            btnChatRoomsEditPromptClose       = btnChatRoomsEditPromptClose.ClientID,
            txtChatRoomsEditPasswordConfirm   = txtChatRoomsEditPasswordConfirm.ClientID,
            lblChatRoomsEditError             = lblChatRoomsEditError.ClientID,
            passwordTxt                       = ResHelper.GetString("chat.password") + ":",
            passwordNewTxt                    = ResHelper.GetString("chat.passwordnew") + ":",
            lblChatRoomsEditPasswordNew       = lblChatRoomsEditPasswordNew.ClientID,
            txtChatRoomsCreatePasswordConfirm = txtChatRoomsCreatePasswordConfirm.ClientID,
            pnlChatRoomsEditError             = pnlChatRoomsEditError.ClientID,
            chkChatRoomsHasPassword           = chkChatRoomsHasPassword.ClientID,
            pnlChatRoomsCreateError           = pnlChatRoomsCreateError.ClientID,
            pnlFilterClientID                 = pnlChatRoomsFiltering.ClientID,
            pnlPagingClientID                 = pnlChatRoomsPaging.ClientID,
            pagingItems                       = PagingItems > 0 ? PagingItems : ChatHelper.WPPagingItems,
            pagingEnabled                     = EnablePaging,
            btnFilter                         = btnChatRoomsFilter.ClientID,
            txtFilter                         = txtChatRoomsFilter.ClientID,
            filterEnabled                     = EnableFiltering,
            pnlInfo                           = pnlChatRoomsInfo.ClientID,
            resStrNoFound                     = ResHelper.GetString("chat.rooms.notfound"),
            resStrResults                     = ResHelper.GetString("chat.rooms.results"),
            resStrTooltipPopup                = ResHelper.GetString("chat.enterwithpopup"),
            filterCount                       = ShowFilterItems >= 0 ? ShowFilterItems : ChatHelper.WPShowFilterLimit,
            passwordPromptError               = pnlChatRoomsPromptPasswordError.ClientID,
            redirectURL                       = redirectURL.Length > 0 ? DocumentURLProvider.GetUrl(redirectURL) : "",
            redirectGroup                     = RedirectGroup,
            envelopeID                        = "envelope_" + ClientID,
            pnlErrorCreate                    = pnlChatRoomsCreateErrorConfirm.ClientID,
            pnlErrorEdit                      = pnlChatRoomsEditErrorConfirm.ClientID,
            enablePopup                       = EnablePopup,
            passwordNotMatchStr               = ResHelper.GetString("administration-user_edit_password.passwordsdonotmatch")
        }
            );

        return(String.Format("InitChatRooms({0})", json));
    }