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"); }
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) { // 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) { // 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); }
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) { // 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); }
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.RegisterJQueryTemplates(Page); 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) { // Get information about chat room this window has been opened for. int roomId = QueryHelper.GetInteger("windowroomid", 0); try { ChatUserHelper.VerifyChatUserHasJoinRoomRights(roomId); } catch (ChatServiceException) { DisplayError(); return; } ChatRoomInfo room = ChatRoomInfoProvider.GetChatRoomInfo(roomId); if (room == null) { DisplayError(); return; } // Script references insertion ScriptHelper.RegisterJQuery(Page); ChatScriptHelper.RegisterChatManager(Page); ChatScriptHelper.RegisterChatNotificationManager(Page); ScriptHelper.RegisterScriptFile(Page, "~/CMSScripts/jquery/jquery-resize.js"); ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/Pages/Scripts/ChatRoomWindow.js"); SetWebpartsUp(room.ChatRoomIsSupport); lblTitle.Text = HTMLHelper.HTMLEncode(room.ChatRoomDisplayName) + " – " + GetString(room.ChatRoomIsSupport ? "chat.title.support" : "chat.title.privateconversation"); string json = JsonConvert.SerializeObject( new { roomId, pnlChatRoomWindowClientId = pnlChatRoomWindow.ClientID, pnlTopClientId = pnlTop.ClientID, pnlBottomClientId = pnlBottom.ClientID, ChatRoomMessagesClientId = ChatRoomMessagesElem.ClientID, btnCloseClientId = btnCloseWindow.ClientID, isSupport = room.ChatRoomIsSupport, notificationManagerOptions = new { eventName = "newmessage", soundFile = ChatSettingsProvider.EnableSoundSupportChat ? ResolveUrl("~/CMSModules/Chat/CMSPages/Sound/Chat_message.mp3") : String.Empty, notifyTitle = GetString("chat.general.newmessages") }, title = lblTitle.Text }, new JsonSerializerSettings { StringEscapeHandling = StringEscapeHandling.EscapeHtml } ); string startupScript = String.Format("ChatSupportWindow({0});", json); ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatSupportWindow", startupScript, true); }
protected void Page_Load(object sender, EventArgs e) { // Register to chat webservice AbstractCMSPage cmsPage = Page as AbstractCMSPage; if (cmsPage != null) { ChatScriptHelper.RegisterChatAJAXProxy(cmsPage); } // Insert cript references ChatScriptHelper.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 = ChatUIHelper.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 = (ChatSettingsProvider.WPInviteModePagingItems > 0) ? ChatSettingsProvider.WPInviteModePagingItems : ChatSettingsProvider.WPPagingItems; if (!(invitePagingItems > 0)) { invitePagingItems = PagingItems; } ChatOnlineUsersElem.ShowFilterItems = invitePagingItems + 1; ChatSearchOnlineUsers.PagingItems = ChatOnlineUsersElem.PagingItems = invitePagingItems; ChatSearchOnlineUsers.ResponseMaxUsers = (InviteSearchModeMaxUsers >= 0) ? InviteSearchModeMaxUsers : ChatSettingsProvider.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"); }
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) { // 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); }
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); }
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(); }