Custom Function question

Last post 12-07-2004, 1:26 PM by demmett. 2 replies.
Sort Posts: Previous Next
  •  12-06-2004, 9:21 PM 2884

    Custom Function question

    I am trying to write a custom function that does the following:
    Surrounds the selected text with the following tags <span class="pull'>selected text</span>
     
    Any advice or sample code on how to do this would be greatly appreciated.
  •  12-06-2004, 10:00 PM 2886 in reply to 2884

    Re: Custom Function question

    demmett,

    Please check the WinIE.js:

    Line 490:
    .....
    case
    "setStyle":
    .......

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-07-2004, 1:26 PM 2901 in reply to 2886

    Re: Custom Function question

    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'" ..... 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()
                                                               
      %>
    <% dim content content = "Type here..." Dim editor Set editor = New CuteEditor 'Create a new editor class object ' editor2.subsequent = true editor.ID = "Editor" 'Set the ID of this editor class editor.Text = content 'Set the initial HTML value of editor control editor.ParagraphsList = "Normal,Heading 1,Heading 2,Heading 3,Formatted,Definition Term,Dave Test1,Dave Test2,Dave Test3" editor.FilesPath = "/NewHay/EditorTool/CuteEditor_Files" editor.ImageGalleryPath = "/NewHay/Images/Uploaded" editor.MaxImageSize = 50 ' editor2.Height = 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" editor.CustomAddons = """ class=""button"" onclick=""_Format(Editor,'setStyle','pull');"" type=""btn"" border=""0"">Insert HTML1" editor.Draw() %><%                                                                          dim content             content = "Type here..."                                     Dim editor             Set editor = New CuteEditor 'Create a new editor class object                                                                                                                    '            editor2.subsequent = true             editor.ID = "Editor" 'Set the ID of this editor class             editor.Text = content 'Set the initial HTML value of editor control             editor.ParagraphsList = "Normal,Heading 1,Heading 2,Heading 3,Formatted,Definition Term,Dave Test1,Dave Test2,Dave Test3"             editor.FilesPath = "/NewHay/EditorTool/CuteEditor_Files"             editor.ImageGalleryPath = "/NewHay/Images/Uploaded"             editor.MaxImageSize = 50       '      editor2.Height = 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" editor.CustomAddons = """ class=""button"" onclick=""_Format(Editor,'setStyle','pull');"" type=""btn"" border=""0"">Insert HTML1"             editor.Draw()                                                                    %>
View as RSS news feed in XML