<commit_before><%@ Page Language="c#" ValidateRequest="false" CodeBehind="insertMacro.aspx.cs" AutoEventWireup="True"
    Inherits="umbraco.presentation.tinymce3.insertMacro" Trace="false" %>

<%@ Register TagPrefix="ui" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>{#advlink_dlg.title}</title>
    <base target="_self" />

    <ui:UmbracoClientDependencyLoader runat="server" ID="ClientLoader" />
    <umb:JsInclude ID="JsInclude2" runat="server" FilePath="ui/jquery.js" PathNameAlias="UmbracoClient"
        Priority="0" />
    <umb:JsInclude ID="JsInclude8" runat="server" FilePath="ui/default.js" PathNameAlias="UmbracoClient"
        Priority="4" />
    <umb:JsInclude ID="JsInclude1" runat="server" FilePath="tinymce3/tiny_mce_popup.js"
        PathNameAlias="UmbracoClient" Priority="100" />
    <umb:JsInclude ID="JsInclude3" runat="server" FilePath="tinymce3/utils/mctabs.js"
        PathNameAlias="UmbracoClient" Priority="101" />
    <umb:JsInclude ID="JsInclude4" runat="server" FilePath="tinymce3/utils/form_utils.js"
        PathNameAlias="UmbracoClient" Priority="102" />
    <umb:JsInclude ID="JsInclude5" runat="server" FilePath="tinymce3/utils/validate.js"
        PathNameAlias="UmbracoClient" Priority="103" />

    <style type="text/css">
        .propertyItemheader
        {
            width: 140px !important;
        }
        select, textarea, input.guiInputTextStandard
        {
            width: 200px;
        }
        .macroPane
        {
            height: 360px;
            overflow: auto;
        }
    </style>
    <script type="text/javascript">
        function umbracoEditMacroDo(fieldTag, macroName, renderedContent) {

            tinyMCEPopup.editor.execCommand("mceInsertContent", false, "test");

            // is it edit macro?
            if (!tinyMCE.activeEditor.dom.hasClass(elm, 'umbMacroHolder')) {


                while (!tinyMCE.activeEditor.dom.hasClass(elm, 'umbMacroHolder') && elm.parentNode) {
                    elm = elm.parentNode;
                }
            }


            if (elm.nodeName == "DIV" && tinyMCE.activeEditor.dom.getAttrib(elm, 'class').indexOf('umbMacroHolder') >= 0) {


                tinyMCE.activeEditor.dom.setOuterHTML(elm, renderedContent);
            }
            else {

                tinyMCEPopup.editor.execCommand("mceInsertContent", false, renderedContent);
            }

            //workaround for the chrome issue, seems to work if there is a small delay before the close function call
            id = window.setTimeout("tinyMCEPopup.close()", 10);

            //tinyMCEPopup.close();
        }

        function saveTreepickerValue(appAlias, macroAlias) {
            var treePicker = window.showModalDialog('../../dialogs/treePicker.aspx?app=' + appAlias + '&treeType=' + appAlias, 'treePicker', 'dialogWidth=350px;dialogHeight=300px;scrollbars=no;center=yes;border=thin;help=no;status=no')
            document.forms[0][macroAlias].value = treePicker;
            document.getElementById("label" + macroAlias).innerHTML = "</b><i>updated with id: " + treePicker + "</i><b><br/>";
        }

        var macroAliases = new Array();

        function registerAlias(alias) {
            macroAliases[macroAliases.length] = alias;
        }

        function pseudoHtmlEncode(text) {
            return text.replace(/\"/gi, "&amp;quot;").replace(/\</gi, "&amp;lt;").replace(/\>/gi, "&amp;gt;");
        }
        /*
        function init() {
        var inst = tinyMCEPopup.editor;
        var elm = inst.selection.getNode();
        }
        */
        function insertSomething() {
            tinyMCEPopup.close();
        }
    </script>

</head>
<body>
    <form id="Form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <input type="hidden" name="macroMode" value="<%=Request["mode"]%>" />
    <%if (Request["umb_macroID"] != null || Request["umb_macroAlias"] != null)
      {%>
    <input type="hidden" name="umb_macroID" value="<%=umbraco.helper.Request("umb_macroID")%>" />
    <input type="hidden" name="umb_macroAlias" value="<%=umbraco.helper.Request("umb_macroAlias")%>" />
    <% }%>
    <ui:Pane ID="pane_edit" runat="server" Visible="false">
        <div class="macroPane">
            <asp:PlaceHolder ID="macroProperties" runat="server" />
        </div>
    </ui:Pane>
    <asp:Panel ID="edit_buttons" runat="server" Visible="false">
        <p>
            <asp:Button ID="bt_renderMacro" OnClick="renderMacro_Click" runat="server" Text="ok">
            </asp:Button>
            <em>or </em><a id="cancelbtn" href="#" style="color: blue" onclick="tinyMCEPopup.close();">
                <%=umbraco.ui.Text("general", "cancel", this.getUser())%></a>
        </p>
    </asp:Panel>
    <ui:Pane ID="pane_insert" runat="server">
        <ui:PropertyPanel ID="pp_selectMacro" runat="server" Text="Select macro">
            <asp:DropDownList ID="umb_macroAlias" Width="150px" runat="server" />
        </ui:PropertyPanel>
    </ui:Pane>
    <asp:Panel ID="insert_buttons" runat="server">
        <p>
            <input type="submit" value="<%=umbraco.ui.Text("general", "ok", this.getUser())%>" />
            <em>or </em><a href="#" style="color: blue" onclick="tinyMCEPopup.close();">
                <%=umbraco.ui.Text("general", "cancel", this.getUser())%></a>
        </p>
    </asp:Panel>
    <div id="renderContent" style="display: none">
        <asp:PlaceHolder ID="renderHolder" runat="server"></asp:PlaceHolder>
    </div>
    </form>
    <script type="text/javascript" language="javascript">
        var inst; // =  tinyMCEPopup.editor;
        var elm; // = inst.selection.getNode();

        jQuery(document).ready(function () {
            //            tinyMCEPopup.onInit.add(init);
            inst = tinyMCEPopup.editor;
            elm = inst.selection.getNode();

    <asp:Literal ID="jQueryReady" runat="server"></asp:Literal>
            
        });

    </script>
</body>
</html>
<commit_msg>small update (related to chrome / macro)<commit_after><%@ Page Language="c#" ValidateRequest="false" CodeBehind="insertMacro.aspx.cs" AutoEventWireup="True"
    Inherits="umbraco.presentation.tinymce3.insertMacro" Trace="false" %>

<%@ Register TagPrefix="ui" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>{#advlink_dlg.title}</title>
    <base target="_self" />

    <ui:UmbracoClientDependencyLoader runat="server" ID="ClientLoader" />
    <umb:JsInclude ID="JsInclude2" runat="server" FilePath="ui/jquery.js" PathNameAlias="UmbracoClient"
        Priority="0" />
    <umb:JsInclude ID="JsInclude8" runat="server" FilePath="ui/default.js" PathNameAlias="UmbracoClient"
        Priority="4" />
    <umb:JsInclude ID="JsInclude1" runat="server" FilePath="tinymce3/tiny_mce_popup.js"
        PathNameAlias="UmbracoClient" Priority="100" />
    <umb:JsInclude ID="JsInclude3" runat="server" FilePath="tinymce3/utils/mctabs.js"
        PathNameAlias="UmbracoClient" Priority="101" />
    <umb:JsInclude ID="JsInclude4" runat="server" FilePath="tinymce3/utils/form_utils.js"
        PathNameAlias="UmbracoClient" Priority="102" />
    <umb:JsInclude ID="JsInclude5" runat="server" FilePath="tinymce3/utils/validate.js"
        PathNameAlias="UmbracoClient" Priority="103" />

    <style type="text/css">
        .propertyItemheader
        {
            width: 140px !important;
        }
        select, textarea, input.guiInputTextStandard
        {
            width: 200px;
        }
        .macroPane
        {
            height: 360px;
            overflow: auto;
        }
    </style>
    <script type="text/javascript">
        function umbracoEditMacroDo(fieldTag, macroName, renderedContent) {

            // is it edit macro?
            if (!tinyMCE.activeEditor.dom.hasClass(elm, 'umbMacroHolder')) {


                while (!tinyMCE.activeEditor.dom.hasClass(elm, 'umbMacroHolder') && elm.parentNode) {
                    elm = elm.parentNode;
                }
            }


            if (elm.nodeName == "DIV" && tinyMCE.activeEditor.dom.getAttrib(elm, 'class').indexOf('umbMacroHolder') >= 0) {


                tinyMCE.activeEditor.dom.setOuterHTML(elm, renderedContent);
            }
            else {

                tinyMCEPopup.editor.execCommand("mceInsertContent", false, renderedContent);
            }

            //workaround for the chrome issue, seems to work if there is a small delay before the close function call
            id = window.setTimeout("tinyMCEPopup.close()", 10);

            //tinyMCEPopup.close();
        }

        function saveTreepickerValue(appAlias, macroAlias) {
            var treePicker = window.showModalDialog('../../dialogs/treePicker.aspx?app=' + appAlias + '&treeType=' + appAlias, 'treePicker', 'dialogWidth=350px;dialogHeight=300px;scrollbars=no;center=yes;border=thin;help=no;status=no')
            document.forms[0][macroAlias].value = treePicker;
            document.getElementById("label" + macroAlias).innerHTML = "</b><i>updated with id: " + treePicker + "</i><b><br/>";
        }

        var macroAliases = new Array();

        function registerAlias(alias) {
            macroAliases[macroAliases.length] = alias;
        }

        function pseudoHtmlEncode(text) {
            return text.replace(/\"/gi, "&amp;quot;").replace(/\</gi, "&amp;lt;").replace(/\>/gi, "&amp;gt;");
        }
        /*
        function init() {
        var inst = tinyMCEPopup.editor;
        var elm = inst.selection.getNode();
        }
        */
        function insertSomething() {
            tinyMCEPopup.close();
        }
    </script>

</head>
<body>
    <form id="Form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <input type="hidden" name="macroMode" value="<%=Request["mode"]%>" />
    <%if (Request["umb_macroID"] != null || Request["umb_macroAlias"] != null)
      {%>
    <input type="hidden" name="umb_macroID" value="<%=umbraco.helper.Request("umb_macroID")%>" />
    <input type="hidden" name="umb_macroAlias" value="<%=umbraco.helper.Request("umb_macroAlias")%>" />
    <% }%>
    <ui:Pane ID="pane_edit" runat="server" Visible="false">
        <div class="macroPane">
            <asp:PlaceHolder ID="macroProperties" runat="server" />
        </div>
    </ui:Pane>
    <asp:Panel ID="edit_buttons" runat="server" Visible="false">
        <p>
            <asp:Button ID="bt_renderMacro" OnClick="renderMacro_Click" runat="server" Text="ok">
            </asp:Button>
            <em>or </em><a id="cancelbtn" href="#" style="color: blue" onclick="tinyMCEPopup.close();">
                <%=umbraco.ui.Text("general", "cancel", this.getUser())%></a>
        </p>
    </asp:Panel>
    <ui:Pane ID="pane_insert" runat="server">
        <ui:PropertyPanel ID="pp_selectMacro" runat="server" Text="Select macro">
            <asp:DropDownList ID="umb_macroAlias" Width="150px" runat="server" />
        </ui:PropertyPanel>
    </ui:Pane>
    <asp:Panel ID="insert_buttons" runat="server">
        <p>
            <input type="submit" value="<%=umbraco.ui.Text("general", "ok", this.getUser())%>" />
            <em>or </em><a href="#" style="color: blue" onclick="tinyMCEPopup.close();">
                <%=umbraco.ui.Text("general", "cancel", this.getUser())%></a>
        </p>
    </asp:Panel>
    <div id="renderContent" style="display: none">
        <asp:PlaceHolder ID="renderHolder" runat="server"></asp:PlaceHolder>
    </div>
    </form>
    <script type="text/javascript" language="javascript">
        var inst; // =  tinyMCEPopup.editor;
        var elm; // = inst.selection.getNode();

        jQuery(document).ready(function () {
            //            tinyMCEPopup.onInit.add(init);
            inst = tinyMCEPopup.editor;
            elm = inst.selection.getNode();

    <asp:Literal ID="jQueryReady" runat="server"></asp:Literal>
            
        });

    </script>
</body>
</html>

{'fraction_non_alphanumeric': 0.16259909839888076, 'fraction_numerical': 0.00932690812995492, 'mean_word_length': 2.6163575042158516, 'pattern_counts': {'":': 0, '<': 167, '<?xml version=': 0, '>': 169, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7320051', 'n_tokens_mistral': 4234, 'n_tokens_neox': 3951, 'n_words': 632}