How can i create a custom button wich inserts a div at the cursor position?

8 posts, 0 answers
  1. Yavuz Bogazci
    Yavuz Bogazci avatar
    7 posts
    Member since:
    Sep 2009

    Posted 28 Sep 2009 Link to this post

    Hi,

    i am using the rad editor in our companies sharepoint environment. I need to add a cutom button to the rad editor which inserts a div with a little bit default html at the cursor position.

    Is this possible? How can i do that?

    thank you
    yavuz
  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 29 Sep 2009 Link to this post

    Hello Yavuz,

    You can find the instructions for adding Custom Buttons in the following help article http://www.telerik.com/help/aspnet-ajax/add_custom_buttons.html.


    Greetings,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

  3. Yavuz Bogazci
    Yavuz Bogazci avatar
    7 posts
    Member since:
    Sep 2009

    Posted 29 Sep 2009 Link to this post

    Hi,

    thank you very much. It works! But now my second question:

    I want to insert a Table of Contents via Custom Buttom Click in my Content Parts. This is possible with this Script:

    http://cf-bill.blogspot.com/2005/09/javascript-build-toc.html

    I have inserted this script into a toc.js file and put it on my webserver. Now i want to inject this:

    <script src="toc.js" type="text/javascript"></script>

    into my document. In the head part or the body part. How can i do that?

    thank you
    yavuz
  4. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 29 Sep 2009 Link to this post

    Hello Yavuz,

    You can do this by using the SharePoint designer. Add the script reference either in the master page of your MOSS site or in the page where you want to use it.


    Greetings,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Yavuz Bogazci
    Yavuz Bogazci avatar
    7 posts
    Member since:
    Sep 2009

    Posted 29 Sep 2009 Link to this post

    Cant i do this by custom button click at the position of my cursor?
  6. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 29 Sep 2009 Link to this post

    Hi Yavuz,

    Could you clarify what is exactly the functionality that you are trying to achieve? Are you trying to insert the following code in the content of the RadEditor for MOSS and afterwards to save it in SharePoint?
    <script src="toc.js" type="text/javascript"></script>

    Or you want to load the toc.js in a page layout.


    Kind regards,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Yavuz Bogazci
    Yavuz Bogazci avatar
    7 posts
    Member since:
    Sep 2009

    Posted 29 Sep 2009 Link to this post

    Hi,

    i only want to insert the following string into the page:

    <script src="toc.js" type="text/javascript"></script>

    thank you
    yavuz
  8. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 01 Oct 2009 Link to this post

    Hi Yavuz Bogazci,

    If you want to paste html in the RadEditor you can use the PasteHtml client side method. More information you can find in the following url http://www.telerik.com/help/aspnet/editor/pastehtml.html.
    For example:
    editor.PasteHtml('&nbsp;<script src="toc.js" type="text/javascript"></script>'); 

    The &nbsp; is needed beacause of an issue when you are pasting code that start with script tag.


    Greetings,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top