This is a migrated thread and some comments may be shown as answers.

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

7 Answers 75 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Yavuz Bogazci
Top achievements
Rank 1
Yavuz Bogazci asked on 28 Sep 2009, 06:55 PM
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

7 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 29 Sep 2009, 06:05 AM
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.
0
Yavuz Bogazci
Top achievements
Rank 1
answered on 29 Sep 2009, 07:05 AM
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
0
Stanimir
Telerik team
answered on 29 Sep 2009, 07:27 AM
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.
0
Yavuz Bogazci
Top achievements
Rank 1
answered on 29 Sep 2009, 08:13 AM
Cant i do this by custom button click at the position of my cursor?
0
Stanimir
Telerik team
answered on 29 Sep 2009, 08:27 AM
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.
0
Yavuz Bogazci
Top achievements
Rank 1
answered on 29 Sep 2009, 11:32 AM
Hi,

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

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

thank you
yavuz
0
Stanimir
Telerik team
answered on 01 Oct 2009, 07:06 AM
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.
Tags
WebParts for SharePoint
Asked by
Yavuz Bogazci
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Yavuz Bogazci
Top achievements
Rank 1
Share this question
or