jQuery Radial Menu

by parksd

HTML

<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script>
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script>
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.dv.js"></script>
<link rel="stylesheet" href="http://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css">
<link rel="stylesheet" href="http://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css">
<div>
    <!-- Target element for the igHtmlEditor -->
    <!-- <div id="htmlEditor"></div>
     -->
    <div style="position:absolute; left:150px; top:250px; z-index:1; visibility:hidden">
        <!-- Target element for the igRadialMenu -->
        <div id="radialMenu"></div>
    </div>
</div>

JavaScript

$(function() {
// create the html editor
    $("#htmlEditor").igHtmlEditor({
        width: "98%",
        height: "450px"
    });

    $("#htmlEditor").igHtmlEditor("setContent", "The Radial Menu control is essentially a context menu presenting its items in a circular arrangement around a center button. The circular arrangement of the items speeds up items selection, because each item is equally positioned in relation to the center. The Radial Menu supports different item types for choosing numerical values, color values or performs actions. Sub-Items are also supported.<br/>By default the only visible part of the Radial Menu is the center button. When the user click on the center button, the Radial Menu opens and shows the root level menu items. Clicking on the center button when the root level items are shown closes the Radial Menu. To navigate Sub-Items the user should click the arrows in the outer ring and the corresponding sub-items group will be displayed. Clicking on the center button when a sub-items group is shown will display the items on the previous level.", "html");

    function buttonClick(ui) {
        var name = ui.item.name;
        $("#htmlEditor").igHtmlEditor("executeAction", name);
        var cbElement = document.getElementById("cbCloseOnClick");
        if (cbElement && cbElement.checked) {
            $("#radialMenu").igRadialMenu("option", "isOpen", false);
        }
    }

    //Change color
    function rgbaToRgb(rgbaColor) {
        // remove the "a" from "rgba"
        var result = rgbaColor.replace("rgba(", "rgb(");
        // remove the alpha channel
        result = result.replace(",1)", ")");
        return result;
    }

    function setForeColor(color) {
        $("#htmlEditor").igHtmlEditor("executeAction", "forecolor", color);
    }

    function setBackColor(color) {
        $("#htmlEditor").igHtmlEditor("executeAction", "backcolor", color);
    }

    //Change text size
    function setFontSize(_size) {
        if (_size...