コード例 #1
0
        public virtual void DisplayUserMessage(string title, string message, string icon)
        {
            BasePage.speechBubbleIcon ico = BasePage.speechBubbleIcon.info;
            try
            {
                ico = (BasePage.speechBubbleIcon)(Enum.Parse(typeof(BasePage.speechBubbleIcon), icon));
            }
            catch { }

            //TODO: Client tools does not work for this implementation since it is relying on the fact that the speech bubble script is
            //already loaded and is normally using the UmbracoSpeechBubbleBackEnd.js which is slightly different than the one needed for live
            //editing since it's doing some lazy loading with js!
            //ClientTools cTools = new ClientTools(Page);
            //cTools.ShowSpeechBubble(BasePage.speechBubbleIcon.info, title, message);


            ScriptManager.RegisterClientScriptBlock(Page, GetType(), new Guid().ToString(),
                                                    string.Concat("var sbTimer = setInterval(function() { if (typeof(UmbSpeechBubble) != 'undefined') {UmbSpeechBubble.ShowMessage('", EscapeJavascriptString(icon), "','", EscapeJavascriptString(title), "','", EscapeJavascriptString(message), "'); clearInterval(sbTimer); } }, 100);"), true);
        }
コード例 #2
0
ファイル: ClientTools.cs プロジェクト: SKDon/Triphulcas
 /// <summary>
 /// A reference to the umbraco UI component "speechbubble". The speechbubble appears in the lower right corner of the screen, notifying users of events
 /// </summary>
 /// <param name="i">The speechbubble icon.</param>
 /// <param name="header">The speechbubble header.</param>
 /// <param name="body">The body text</param>
 public ClientTools ShowSpeechBubble(BasePage.speechBubbleIcon i, string header, string body)
 {
     RegisterClientScript(string.Format(Scripts.ShowSpeechBubble, i.ToString(), header.Replace("'", "\\'"), body.Replace("'", "\\'")));
     return(this);
 }