Additional Custom Button questions

Last post 12-14-2004, 2:26 PM by demmett. 2 replies.
Sort Posts: Previous Next
  •  12-14-2004, 10:41 AM 3010

    Additional Custom Button questions

    OK, Now I have 2 additional questions. 
    1) I have 1 style in the listbox called Heading (code highlighted in blue).
            If a user selects some text say 123 and then selects Heading we end up getting:
            <FONT class=heading>123</font> ...... which is what we should get. 
            If a user should select 123 again and select Heading, we then get:
            <FONT class=heading><FONT class=heading><FONT class=heading>123</font></font></font>.
            Why did it add the FONT tags again?
            Why did it add 2 additional FONT tags the 2nd time?

    2) I added a custom button that when clicked calls the _Format function passing the parameters "Editor,'setStyle','pull'" .....
           pretty much the same as what the style listbox does. But when a user selects some text say 123 and then
           clicks this custom button it generates the following:
           123<FONT class=pull></FONT>
           When I try and debug the code, I see that when it looks to see what text is selected it comes back with "".
           Is there something I am missing??
             
     <%
         dim temp_styledropdownMenuNames,temp_styledropdownMenuList
         dim content
         content =  "Type here..."                        
         Dim editor
         Set editor = New CuteEditor  'Create a new editor class object                                                      
                                                                
         editor.ID = "Editor" 'Set the ID of this editor class
         editor.Text = content 'Set the initial HTML value of editor control
         editor.MaxImageSize = 50
         editor.Template = "Save,New,Print,Separator,Cut,Copy,Paste,PasteText,PasteWord,Delete,Separator,Undo,Redo,Separator,G_Start,ToggleBorder,AbsolutePosition,G_End,G_Start,Separator,Char,InsertText,G_End,G_Start,Separator,ImageGallery,G_End,G_Start,Separator,InsertTable,AddRow,DeleteRow,AddColumn,DeleteColumn,Separator,AddCell,DeleteCell,MergeCell,SplitCell,Separator,EditRow,EditCell,G_End,G_Start,Break,Bold,Italic,Underline,G_End,G_Start,Separator,JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone,Separator,FontColor,HighLight,G_End,G_Start,Separator,InsertOrderedList,InsertUnorderedList,Separator,Indent,Outdent,G_End,G_Start,Separator,Subscript,Superscript,Strikethrough,Separator,InsertTime,InsertDate,Separator,Hr,Link,UnLink,DownloadableFiles,Separator,RemoveFormat,SelectAll,SelectNone,Help,G_End,break,styleDropDown,paragraphDropDown,zoomDropDown"

         temp_styledropdownMenuNames     = "Heading"
         temp_styledropdownMenuList            = "Heading"
         editor.StyleDropDownMenuNames = temp_styledropdownMenuNames      
         editor.StyleDropDownMenuList  = temp_styledropdownMenuList
                                                               
    editor.CustomAddons = "<span title=""Custom Addons"" class=""button"" onclick=""_Format(Editor,'setStyle','pull');"" type=""btn"" border=""0"">Insert HTML1</span>"

                editor.Draw()
                                                               
      %>

  •  12-14-2004, 12:13 PM 3014 in reply to 3010

    Re: Additional Custom Button questions

    demmett,

    1.   Why did it add the FONT tags again? Why did it add 2 additional FONT tags the 2nd time?

    In the next version, we will use span tag instead of font tag.

    For example, you select a class read color <span class=readcolor>Some Text</span>

    If so select the another class, it will remove the existing class, and add the new class as followings:

    <span class=hightlight>Some Text</span>

    Right now you can use the "remove format" button before you apply a new class.


     
  •  12-14-2004, 2:26 PM 3018 in reply to 3014

    Re: Additional Custom Button questions

    An ideas about Item # 2:

    2) I added a custom button that when clicked calls the _Format function passing the parameters "Editor,'setStyle','pull'" .....
           pretty much the same as what the style listbox does. But when a user selects some text say 123 and then
           clicks this custom button it generates the following:
           123<FONT class=pull></FONT>
           When I try and debug the code, I see that when it looks to see what text is selected it comes back with "".
           Is there something I am missing??
View as RSS news feed in XML