Re: Adding code snippets in JavaScirpt

  •  12-09-2013, 10:55 PM

    Re: Adding code snippets in JavaScirpt

    Dear frJericho,

     

    For Adding code snippets in Javascript, please refer the following demo (put the js in head node)

    1. <script type="text/javascript">  
    2.         function RichTextEditor_OnLoader(loader) {  
    3.             var config = loader._config;  
    4.             config.templategrouparray = [{  
    5.                 "text""leveltop",  
    6.                 "groups": [{ "text""leve1""groups":[], "templates": [{ "text""level1_1""href""""code""level1_1" }, { "text""level1_2""href""""code""level1_2" }] },  
    7.                     { "text""leve2""groups": [], "templates": [{ "text""level2_1""href""""code""level2_1" }, { "text""level2_2""href""""code""level2_2" }] }],  
    8.                 "templates": [{ "text""level0""href""""code""level0" }]  
    9.             }];  
    10.             config.templateitemarray = [{ "text""level0_1""href""""code""level0_1" }, { "text""level0_2""href""""code""level0_2" }];  
    11.         }  
    12.     </script>  
     

    If you want to customize the heading, you can open file "richtexteditor/dialogs/inserttemplate_dropdown.xml"

    <groupbox text="@codesnippet" dock="top" overflow="visible" margin="3"> 

     if you just want to change text, replace @codesnippet with your text

    if you want to use html tag, you need to use our jsml language, such as

     <label dock="top" text="MyTitle"></label>

     

    Regards,

    Jeff 

View Complete Thread