Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Script references insertion
        ChatScriptHelper.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    = ChatUIHelper.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          = ChatUIHelper.GetWebpartLoadingDiv("ChatRoomNameWPLoading", "chat.wploading.roomname"),
            envelopeID          = "#envelope_" + ClientID
        }
            );
        string startupScript = String.Format("InitChatRoomNameWebpart({0});", json);

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatRoomName_" + ClientID, startupScript, true);
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Register chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Insert script references
        ChatHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterScriptFile(Page, "jquery/jquery-tmpl.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatRooms_files/ChatRooms.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/Scripts/ListPaging.js");

        if (EnableFiltering)
        {
            pnlChatRoomsFiltering.Visible = true;
        }
        // Prepare and run startup script
        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatRooms_" + ClientID, BuildStartupScript(), true);

        imgChatRoomsPrompt.ImageUrl        = GetImageUrl("CMSModules/CMS_Chat/lock24.png");
        imgChatRoomsCreatePrompt.ImageUrl  = GetImageUrl("CMSModules/CMS_Chat/message_add24.png");
        imgChatRoomsCreateError.ImageUrl   = GetImageUrl("CMSModules/CMS_Chat/error16.png");
        imgChatRoomsDeletePrompt.ImageUrl  = GetImageUrl("CMSModules/CMS_Chat/sign_forbidden24.png");
        imgChatRoomsAbandonPrompt.ImageUrl = GetImageUrl("CMSModules/CMS_Chat/sign_forbidden24.png");
        imgChatRoomsEditPrompt.ImageUrl    = GetImageUrl("CMSModules/CMS_Chat/message_edit24.png");
        imgChatRoomsEditError.ImageUrl     = GetImageUrl("CMSModules/CMS_Chat/error16.png");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Register chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Insert script references
        ChatScriptHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatLeaveRoom_files/ChatLeaveRoom.js");

        string redirectURL = RedirectURL.Length > 0 ? RedirectURL : ChatSettingsProvider.RedirectURLLeaveSetting;

        // Prepare and run startup script
        string startupScript = String.Format("InitChatLeaveRoom({{groupID:{0}, clientID:'{1}', btnChatLeaveRoom:{2},pnlContent:{3}, redirectURL:{4}, envelopeID: '#envelope_{1}' }});",
                                             ScriptHelper.GetString(GroupID),
                                             ClientID,
                                             ScriptHelper.GetString("#" + btnChatLeaveRoom.ClientID),
                                             ScriptHelper.GetString('#' + pnlChatLeaveRoom.ClientID),
                                             redirectURL.Length > 0 ? ScriptHelper.GetString(ChatHelper.GetDocumentAbsoluteUrl(redirectURL)) : "\"\""
                                             );

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatLeaveRoom_" + ClientID, startupScript, true);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Register chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Insert script references
        ChatScriptHelper.RegisterChatManager(Page);
        ChatScriptHelper.RegisterChatNotificationManager(Page);
        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatNotification_files/ChatNotification.js");

        btnRemoveAllNotifications.OnClientClick = "ChatManager.RemoveAllNotifications(); return false;";
        btnShow.Text  = ResHelper.GetString("chat.notification.bubble.show");
        btnClose.Text = ResHelper.GetString("chat.notification.bubble.close");

        // Prepare and run startup script
        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatNotification_" + ClientID, BuildStartupScript(), true);

        imgChatRoomsPrompt.ImageUrl = GetImageUrl("CMSModules/CMS_Chat/message_information24.png");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsVisible)
        {
            pnlOnlineUsersWP.Visible = false;
            return;
        }

        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Script references insertion
        ChatScriptHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/Scripts/ListPaging.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatOnlineUsers_files/ChatOnlineUsers.js");


        if (EnableFiltering)
        {
            pnlChatOnlineUsersFiltering.Visible = true;
        }
        if (InviteMode)
        {
            pnlChatOnlineUsersInvite.Visible = true;
        }

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "OnlineUsers_" + ClientID, BuildStartupScript(), true);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Script references insertion
        ChatScriptHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatErrors_files/ChatErrors.js");

        // Run script
        string startupScript = String.Format("InitErrorsWebpart({{errorTemplate:{0},contentClientID:{1}, clientID:'{2}', showDeleteAll:{3}, envelopeID: '#envelope_{2}' }});",
                                             ScriptHelper.GetString(ChatUIHelper.GetWebpartTransformation(ErrorTransformationName, "chat.error.transformation.errorwp.error")),
                                             ScriptHelper.GetString("#" + pnlChatErrors.ClientID),
                                             ClientID,
                                             ScriptHelper.GetString(ShowDeleteAllBtn ? ChatUIHelper.GetWebpartTransformation(ButtonDeleteAllTransformationName, "chat.error.transformation.errorwp.deleteallbtn") : "")
                                             );

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatErrors_" + ClientID, startupScript, true);
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Script references insertion
        ChatScriptHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterJQueryUI(Page);
        ScriptHelper.RegisterScriptFile(Page, "jquery/jquery-a-tools.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/Scripts/BBCodeParser.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatMessageSend_files/ChatMessageSend.js");

        imgInformationDialog.ImageUrl = GetImageUrl("General/Labels/Information.png");

        RoomID = ChatUIHelper.GetRoomIdFromQuery(RoomID, GroupID);

        // Register startup script
        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatMessageSend_" + ClientID, BuildStartupScript(), true);

        // Set link to documentation and tooltip for canned responses
        lnkCannedRespHelp.NavigateUrl = DocumentationHelper.GetDocumentationTopicUrl(CANNED_RESPONSES_HELP_TOPIC);
        lnkCannedRespHelp.ToolTip     = ResHelper.GetString("chat.cannedresponses.helplabel");
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Register to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Insert cript references
        ChatHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/Scripts/ListPaging.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/Scripts/ChatDialogs.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatRoomUsers_files/ChatRoomUsers.js");

        RoomID = ChatHelper.GetRoomIdFromQuery(RoomID, GroupID);

        if (EnableFiltering)
        {
            pnlChatRoomUsersFiltering.Visible = true;
        }

        // Set properties to invite webpart
        ChatSearchOnlineUsers.InviteMode = ChatOnlineUsersElem.InviteMode = true;
        ChatSearchOnlineUsers.IsSupport  = ChatOnlineUsersElem.IsSupport = IsSupport;
        ChatSearchOnlineUsers.GroupName  = ChatOnlineUsersElem.GroupName = GroupID;
        ChatSearchOnlineUsers.OnlineUserTransformationName = ChatOnlineUsersElem.OnlineUserTransformationName = "Chat.Transformations.ChatOnlineUser";
        ChatSearchOnlineUsers.PagingEnabled = ChatOnlineUsersElem.EnablePaging = true;
        int invitePagingItems = (ChatHelper.WPInviteModePagingItems > 0) ? ChatHelper.WPInviteModePagingItems : ChatHelper.WPPagingItems;

        if (!(invitePagingItems > 0))
        {
            invitePagingItems = PagingItems;
        }
        ChatOnlineUsersElem.ShowFilterItems    = invitePagingItems + 1;
        ChatSearchOnlineUsers.PagingItems      = ChatOnlineUsersElem.PagingItems = invitePagingItems;
        ChatSearchOnlineUsers.ResponseMaxUsers = (InviteSearchModeMaxUsers >= 0) ? InviteSearchModeMaxUsers : ChatHelper.WPSearchModeMaxUsers;
        ChatOnlineUsersElem.EnableFiltering    = true;

        if (InviteSearchMode == true)
        {
            ChatOnlineUsersElem.Visible = false;
        }
        else
        {
            ChatSearchOnlineUsers.Visible = false;
        }

        // Run startup script
        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatUsers_" + ClientID, BuildStartupScript(), true);

        imgChatRoomUsersInvitePrompt.ImageUrl = GetImageUrl("CMSModules/CMS_Chat/add24.png");
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int roomID = QueryHelper.GetInteger("roomid", 0);

        ChatRoomMessages.RoomID = roomID;

        ChatRoomInfo room = ChatRoomInfoProvider.GetChatRoomInfo(roomID);

        if (room != null)
        {
            ChatOnlineUserHelper.LogInCurrentCMSUser();
            ChatRoomUserHelper.JoinUserToRoom(room.ChatRoomID, ChatUserHelper.GetChatUserFromCMSUser(), room.ChatRoomPassword, false);
        }

        ChatRoomUsers.ChatUserTransformationName = "Chat.Transformations.CMSChatRoomUser";
        ChatRoomUsers.EnableFiltering            = true;
        ChatRoomUsers.ShowFilterItems            = 20;
        ChatRoomUsers.EnablePaging = true;
        ChatRoomUsers.PagingItems  = 30;
        ChatRoomUsers.ChatErrorDeleteAllButtonTransformationName = "Chat.Transformations.CMSChatErrorDeleteAllButton";
        ChatRoomUsers.ChatErrorTransformationName    = "Chat.Transformations.CMSChatError";
        ChatRoomUsers.ChatMessageTransformationName  = "Chat.Transformations.CMSChatMessage";
        ChatRoomUsers.ChatRoomUserTransformationName = "Chat.Transformations.CMSChatRoomUser";

        RoomName.ChatRoomNameTransformationName = "Chat.Transformations.CMSRoomName";
        RoomName.DisplayInitialTitle            = false;

        ChatNotification.NotificationTransformation = "Chat.Transformations.CMSChatNotification";
        ChatNotification.ChatErrorDeleteAllButtonTransformationName = "Chat.Transformations.CMSChatErrorDeleteAllButton";
        ChatNotification.ChatErrorTransformationName    = "Chat.Transformations.CMSChatError";
        ChatNotification.ChatMessageTransformationName  = "Chat.Transformations.CMSChatMessage";
        ChatNotification.ChatRoomUserTransformationName = "Chat.Transformations.CMSChatRoomUser";
        ChatNotification.EnableNotificationBubble       = false;

        ChatErrors.ErrorTransformationName           = "Chat.Transformations.CMSChatError";
        ChatErrors.ShowDeleteAllBtn                  = true;
        ChatErrors.ButtonDeleteAllTransformationName = "Chat.Transformations.CMSChatErrorDeleteAllButton";

        ChatRoomMessages.ChatMessageTransformationName = "Chat.Transformations.CMSChatMessage";
        ChatRoomMessages.Count     = 100;
        ChatRoomMessages.Direction = ChatRoomMessagesDirectionEnum.Down;


        // Registration to chat webservice
        AbstractCMSPage cmsPage = this.Page as AbstractCMSPage;

        if (cmsPage != null)
        {
            ChatHelper.RegisterChatSupportAJAXProxy(cmsPage);
        }
    }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (StopProcessing || !ViewMode.IsOneOf(ViewModeEnum.LiveSite, ViewModeEnum.Preview))
        {
            return;
        }

        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Script references insertion
        ScriptHelper.RegisterJQuery(Page);
        ScriptHelper.RegisterJQueryCookie(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/ChatSettings.ashx");

        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/AutoInitiatedChat_files/AutoInitiatedChat.js");

        int optID = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        // Run script
        string json = JsonConvert.SerializeObject(
            new
        {
            wpGUID        = InstanceGUID,
            clientID      = pnlInitiatedChat.ClientID,
            contentID     = pnlContent.ClientID,
            pnlErrorID    = pnlError.ClientID,
            lblErrorID    = lblError.ClientID,
            windowURL     = ChatUIHelper.GetChatRoomWindowURL(),
            trans         = ChatUIHelper.GetWebpartTransformation(TransformationName, "chat.error.transformation.initiatedchat.error"),
            guid          = optID,
            delay         = Delay * 1000,
            initiatorName = InitiatorName,
            messages      = MacroResolver.Resolve(Messages).Split('\n')
        },
            new JsonSerializerSettings {
            StringEscapeHandling = StringEscapeHandling.EscapeHtml
        }
            );
        string startupScript = string.Format("InitAutoInitiatedChat({0});", json);

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatAutoInitiatedChat_" + ClientID, startupScript, true);
    }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Register chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Insert script references
        ChatScriptHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatLogin_files/ChatLogin.js");

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatLogin_" + ClientID, BuildStartupScript(), true);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!((ViewMode == ViewModeEnum.LiveSite) || (ViewMode == ViewModeEnum.Preview)))
        {
            return;
        }

        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Script references insertion
        ScriptHelper.RegisterJQuery(Page);
        ScriptHelper.RegisterJQueryCookie(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/ChatSettings.ashx", false);

        ScriptHelper.RegisterScriptFile(Page, "jquery/jquery-tmpl.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/AutoInitiatedChat_files/AutoInitiatedChat.js");

        int optID = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        // Run script
        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            wpGUID        = InstanceGUID,
            clientID      = pnlInitiatedChat.ClientID,
            contentID     = pnlContent.ClientID,
            pnlErrorID    = pnlError.ClientID,
            lblErrorID    = lblError.ClientID,
            windowURL     = ChatHelper.GetChatRoomWindowURL(),
            trans         = ChatHelper.GetWebpartTransformation(TransformationName, "chat.error.transformation.initiatedchat.error"),
            guid          = optID,
            delay         = Delay * 1000,
            initiatorName = InitiatorName,
            messages      = CMSContext.ResolveMacros(Messages).Split('\n')
        }
            );
        string startupScript = string.Format("InitAutoInitiatedChat({0});", json);

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatAutoInitiatedChat_" + ClientID, startupScript, true);
    }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Register to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Insert cript references
        ChatHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatWebpart_files/ChatWebpart.js");

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatWebpart_" + ClientID, string.Format("InitChatWebpart('{0}');", pnlChatWebpartHeader.ClientID), true);

        SetUpWebparts();
    }
Ejemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!ViewMode.IsOneOf(ViewModeEnum.LiveSite, ViewModeEnum.Preview))
        {
            return;
        }

        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Script references insertion
        ScriptHelper.RegisterJQuery(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/ChatSettings.ashx");

        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/InitiatedChat_files/InitiatedChat.js");

        int optID = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        // Run script
        JavaScriptSerializer sr = new JavaScriptSerializer();
        string json             = sr.Serialize(
            new
        {
            clientID   = pnlInitiatedChat.ClientID,
            contentID  = pnlContent.ClientID,
            pnlErrorID = pnlError.ClientID,
            lblErrorID = lblError.ClientID,
            windowURL  = ChatHelper.GetChatRoomWindowURL(),
            trans      = ChatHelper.GetWebpartTransformation(TransformationName, "chat.error.transformation.initiatedchat.error"),
            guid       = optID,
            pingTick   = ChatHelper.GlobalPingIntervalSetting * 1000
        }
            );
        string startupScript = string.Format("InitInitiatedChatManager({0});", json);

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatInitiatedChat_" + ClientID, startupScript, true);
    }
Ejemplo n.º 15
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (!Visible || !ChatHelper.IsSupportChatPanelEnabled() || CMSPage.SignOutPending)
        {
            Visible = false;

            return;
        }

        // Set context menu for support chat
        imgChat.ImageUrl               = GetImageUrl("CMSModules/CMS_Chat/support_header_off.png");
        menuCont.MenuControlPath       = "~/CMSModules/Chat/Controls/SupportChatContextMenu.ascx";
        menuCont.MenuID                = ClientID + "m_chat_context_menu";
        menuCont.ParentElementClientID = ClientID;
        menuCont.Parameter             = "''";
        menuCont.RenderAsTag           = HtmlTextWriterTag.A;
        menuCont.MouseButton           = MouseButtonEnum.Left;
        menuCont.VerticalPosition      = VerticalPositionEnum.Bottom;
        menuCont.HorizontalPosition    = HorizontalPositionEnum.Left;

        imgHideBubble.ImageUrl      = GetImageUrl("CMSModules/CMS_Chat/hidebubble.png");
        imgHideBubble.AlternateText = ResHelper.GetString("chat.support.hidebubble");
        imgHideBubble.ToolTip       = ResHelper.GetString("chat.support.hidebubble");

        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Script references insertion
        ScriptHelper.RegisterJQuery(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/Controls/SupportChatHeader.js");

        // Create and launch startup script.
        RegisterStartupScript();
        CSSHelper.RegisterCSSLink(Page, "~/App_Themes/Design/Chat/ChatSupportHeader.css");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Registration to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Script references insertion

        ChatScriptHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatSupportRequest_files/ChatSupportRequest.js");

        // Create and store settings for popup chat window.
        int id = ChatPopupWindowSettingsHelper.Store(ChatMessageTransformationName, ChatRoomUserTransformationName, ChatErrorTransformationName, ChatErrorDeleteAllButtonTransformationName);

        string json = JsonConvert.SerializeObject(
            new
        {
            onlineUrl            = ChatUIHelper.GetChatRoomWindowURL(),
            clientID             = pnlSupportChatRequest.ClientID,
            guid                 = id,
            trans                = ChatUIHelper.GetWebpartTransformation(string.IsNullOrEmpty(ChatSupportRequestTransformationName) ? ChatSettingsProvider.TransformationSupportRequest : ChatSupportRequestTransformationName, "chat.error.transformation.request"),
            mailEnabled          = ChatSettingsProvider.IsSupportMailEnabledAndValid,
            pnlInformDialog      = "#" + pnlChatSupportRequestInfoDialog.ClientID,
            btnInformDialogClose = "#" + btnChatSupportRequestInformDialogClose.ClientID
        },
            new JsonSerializerSettings {
            StringEscapeHandling = StringEscapeHandling.EscapeHtml
        }
            );

        string startupScript = String.Format("ChatSupportRequest({0});", json);

        // Run startup script
        ScriptHelper.RegisterStartupScript(Page, typeof(string), "SupportChatRequest_" + ClientID, startupScript, true);
    }
Ejemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Register to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;
        if (cmsPage != null)
        {
            ChatScriptHelper.RegisterChatAJAXProxy(cmsPage);
        }

        // Insert script references
        ChatScriptHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterJQueryTemplates(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/Scripts/BBCodeParser.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/Scripts/SmileysResolver.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatRoomMessages_files/ChatRoomMessages.js");

        imgInformationDialog.ImageUrl = GetImageUrl("General/Labels/Information.png");

        RoomID = ChatUIHelper.GetRoomIdFromQuery(RoomID, GroupID);

        // Prepare and run startup script
        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatMessages_" + ClientID, BuildStartupScript(), true);
    }
Ejemplo n.º 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!ObjectFactory <ILicenseService> .StaticSingleton().IsFeatureAvailable(FeatureEnum.Chat))
        {
            ShowError();
            return;
        }

        // Register to chat webservice
        AbstractCMSPage cmsPage = Page as AbstractCMSPage;

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

        // Insert cript references
        ChatScriptHelper.RegisterChatManager(Page);
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatWebpart_files/ChatWebpart.js");

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatWebpart_" + ClientID, string.Format("InitChatWebpart('{0}');", pnlChatWebpartHeader.ClientID), true);

        SetUpWebparts();
    }
Ejemplo n.º 19
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.RegisterScriptFile(Page, "jquery/jquery-ui.js");
        ScriptHelper.RegisterScriptFile(Page, "jquery/jquery-a-tools.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/Scripts/BBCodeParser.js");
        ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatMessageSend_files/ChatMessageSend.js");

        imgInformationDialog.ImageUrl = GetImageUrl("General/Labels/Information.png");

        RoomID = ChatHelper.GetRoomIdFromQuery(RoomID, GroupID);

        // Register startup script
        ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatMessageSend_" + ClientID, BuildStartupScript(), true);
    }
Ejemplo n.º 20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int roomID = QueryHelper.GetInteger("roomid", 0);

        ChatRoomMessages.RoomID = roomID;

        ChatRoomInfo room = ChatRoomInfoProvider.GetChatRoomInfo(roomID);

        if (room != null)
        {
            if (!room.ChatRoomEnabled)
            {
                CSSHelper.RegisterBootstrap(Page);
                CSSHelper.RegisterDesignMode(Page);
                ShowError(GetString("chat.errormessage.roomdisabled"));
                pnlChatView.Visible = false;

                return;
            }

            ChatOnlineUserHelper.LogInChatUser(ChatUserHelper.GetChatUserFromCMSUser(MembershipContext.AuthenticatedUser), false);
            ChatRoomUserHelper.JoinUserToRoom(room.ChatRoomID, ChatUserHelper.GetChatUserFromCMSUser(), room.ChatRoomPassword, false);
        }

        ChatRoomUsers.ChatUserTransformationName = "Chat.Transformations.CMSChatRoomUser";
        ChatRoomUsers.EnableFiltering            = true;
        ChatRoomUsers.ShowFilterItems            = ChatHelper.WPShowFilterLimit;
        ChatRoomUsers.EnablePaging = true;
        ChatRoomUsers.PagingItems  = ChatHelper.WPPagingItems;
        ChatRoomUsers.GroupPagesBy = ChatHelper.WPGroupPagesBy;
        ChatRoomUsers.ChatErrorDeleteAllButtonTransformationName = "Chat.Transformations.CMSChatErrorDeleteAllButton";
        ChatRoomUsers.ChatErrorTransformationName    = "Chat.Transformations.CMSChatError";
        ChatRoomUsers.ChatMessageTransformationName  = "Chat.Transformations.CMSChatMessage";
        ChatRoomUsers.ChatRoomUserTransformationName = "Chat.Transformations.CMSChatRoomUser";

        RoomName.ChatRoomNameTransformationName = "Chat.Transformations.CMSRoomName";
        RoomName.DisplayInitialTitle            = false;

        ChatNotification.NotificationTransformation = "Chat.Transformations.CMSChatNotification";
        ChatNotification.ChatErrorDeleteAllButtonTransformationName = "Chat.Transformations.CMSChatErrorDeleteAllButton";
        ChatNotification.ChatErrorTransformationName    = "Chat.Transformations.CMSChatError";
        ChatNotification.ChatMessageTransformationName  = "Chat.Transformations.CMSChatMessage";
        ChatNotification.ChatRoomUserTransformationName = "Chat.Transformations.CMSChatRoomUser";
        ChatNotification.EnableNotificationBubble       = false;

        ChatErrors.ErrorTransformationName           = "Chat.Transformations.CMSChatError";
        ChatErrors.ShowDeleteAllBtn                  = true;
        ChatErrors.ButtonDeleteAllTransformationName = "Chat.Transformations.CMSChatErrorDeleteAllButton";

        ChatRoomMessages.ChatMessageTransformationName = "Chat.Transformations.CMSChatMessage";
        ChatRoomMessages.Count     = 100;
        ChatRoomMessages.Direction = ChatRoomMessagesDirectionEnum.Down;


        // Registration to chat webservice
        AbstractCMSPage cmsPage = this.Page as AbstractCMSPage;

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