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

[Solved] RadEditor-Add Inline styles to <ul> tag when applying bullets

3 Answers 20 Views
RadEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
t
Top achievements
Rank 1
t asked on 09 Nov 2010, 02:10 PM
Hi ,

Is it possible to add inline styles to the <ul> tag while applying bullets?

For example when i click on the the bullets button on top of the editor it should add the style tag to ul <ul style="list-style-type:disc;">
or if circles are applied the generated html should look like this <ul style="list-style-type:circle;">.
any type of suggestions are appreciated .

Thanks
T


3 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 09 Nov 2010, 03:58 PM
Hi t,

Could you confirm exactly which version of RadEditor for MOSS are you using?


All the best,
Stanimir
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
t
Top achievements
Rank 1
answered on 09 Nov 2010, 04:34 PM

Version 2010.1.519.35

 

 FOR Sharepoint  2010

Thanks for the prompt reply .
0
Stanimir
Telerik team
answered on 10 Nov 2010, 10:50 AM
Hi t,

Here is what you can do:
1. Add the following code to the ConfigFile.xml or ListConfigFile.xml, which are located in the Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\RadEditorSharePoint\6.x.x.x__1f131a624888eeed\Resources folder:
<property name="OnClientCommandExecuted">OnClientCommandExecuted</property>

2. Add the following javascript code to the SPEditorTools.js, which is located in the mentioned above folder:
function OnClientCommandExecuted(editor, args)
{
    var commandName = args.get_commandName();
    var selectedElement = editor.getSelectedElement();
    var listParentNode = null;
    switch (commandName)
    {
        case "InsertOrderedList":
            listParentNode = Telerik.Web.UI.Editor.Utils.getElementParentByTag(selectedElement, "OL");
            editListParentNode(listParentNode);
            break;
        case "InsertUnorderedList":
            listParentNode = Telerik.Web.UI.Editor.Utils.getElementParentByTag(selectedElement, "UL");
            editListParentNode(listParentNode);
            break;
    }
}
 
function editListParentNode(node)
{
    if (node)
    {
        node.style.listStyleType = "circle";
    }
}

If you do not want to override the default execution of  InsertOrderedList or InsertUnorderedList, you can create a custom tool http://www.telerik.com/help/aspnet-ajax/sp2010-add_custom_buttons.html. And implement the functionality in it. Also review the following online demo: http://demos.telerik.com/aspnet-ajax/editor/examples/customtools/defaultcs.aspx



All the best,
Stanimir
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RadEditor
Asked by
t
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
t
Top achievements
Rank 1
Share this question
or