<commit_before><!--
  Copyright (C) 2010 Orbeon, Inc.

  This program is free software; you can redistribute it and/or modify it under the terms of the
  GNU Lesser General Public License as published by the Free Software Foundation; either version
  2.1 of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU Lesser General Public License for more details.

  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
  -->
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
      xmlns:xf="http://www.w3.org/2002/xforms"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
      xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
      xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
      xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
      xmlns:secure="java:org.orbeon.oxf.util.SecureUtils"
      xmlns:controlOps="java:org.orbeon.oxf.fb.ControlOps"
      xmlns:containerOps="java:org.orbeon.oxf.fb.ContainerOps"
      xmlns:sectionOps="java:org.orbeon.oxf.fb.SectionOps"
      xmlns:gridOps="java:org.orbeon.oxf.fb.GridOps">
    <xh:head>
        <!-- CSS -->
        <xh:link rel="stylesheet" type="text/css" href="/ops/yui/assets/skins/sam/resize.css"/>
        <xh:link rel="stylesheet" type="text/css" href="/ops/yui/assets/skins/sam/layout.css"/>
        <xh:link rel="stylesheet" href="/forms/orbeon/builder/resources/form-builder.css" type="text/css"/>

        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/cell/events.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/cell/action-icons.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/cell/placeholders.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/cell/static-upload.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/section-grid-repeat/position.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/section-grid-repeat/section-editor.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/section-grid-repeat/grid-repeat-editor.js"/>

        <!-- Include main XForms model -->
        <xi:include href="oxf:/forms/orbeon/builder/form/model.xml" xxi:omit-xml-base="true"/>
    </xh:head>
    <xh:body>

        <!-- For the summary page -->
        <xh:div class="fr-hidden">
            <xf:output id="application-name-control" bind="application-name-bind" class="fr-summary fr-search">
                <xf:label ref="$form-resources/application-name/label"/>
            </xf:output>
            <xf:output id="form-name-control" bind="form-name-bind" class="fr-summary fr-search">
                <xf:label ref="$form-resources/form-name/label"/>
            </xf:output>
            <xf:output id="title-control" bind="title-bind" class="fr-summary fr-search">
                <xf:label ref="$form-resources/title/label"/>
            </xf:output>
            <xf:output id="description-control" bind="description-bind" class="fr-summary fr-search">
                <xf:label ref="$form-resources/description/label"/>
            </xf:output>
        </xh:div>

        <xh:div class="fb-navbar navbar navbar-fixed-top">
            <xh:div class="navbar-inner">
                <xh:div class="container">
                    <xh:span class="fr-logo">
                        <xh:img src="/apps/fr/style/orbeon-navbar-logo.png" alt=""/>
                    </xh:span>
                    <xh:span class="brand">Form Builder</xh:span>

                    <xh:ul class="nav pull-right">
                        <xh:li>
                            <xh:a tabindex="-1" href="http://wiki.orbeon.com/forms/doc/user-guide/form-builder-user-guide" target="_blank">Form Builder User Guide</xh:a>
                        </xh:li>
                        <xh:li>
                            <xh:a tabindex="-1" href="http://www.orbeon.com/forms/screencast/form-builder" target="_blank">Form Builder Screencast</xh:a>
                        </xh:li>
                        <xh:li>
                            <fr:language-selector/>
                        </xh:li>
                    </xh:ul>
                </xh:div>
            </xh:div>
        </xh:div>

        <xh:div class="fb-bottom">

            <fr:status-icons/>
            <fr:messages/>

            <!-- XPath errors in edited form -->
            <xh:div class="fb-xpath-errors">
                <xf:output
                    class="alert"
                    ref="instance('fb-variables')/xpath-errors[xs:integer(.) gt 0]"
                    value="xxf:format-message($form-resources/messages/xpath-errors, xs:integer(.))"/>
            </xh:div>

            <xh:div class="fr-buttons">
                <!-- Back/Close -->
                <fr:close-button/>

                <!-- Test form -->
                <xf:group model="fr-error-summary-model" ref="instance('fr-error-summary-instance')/trigger" id="fb-test-button-group">
                    <xf:trigger id="fb-test-button">
                        <xf:label>
                            <xh:img src="/apps/fr/style/images/pixelmixer/gear_16.png" alt=""/>
                            <xh:span><xf:output value="$fr-resources/detail/labels/test"/></xh:span>
                        </xf:label>
                        <xf:action ev:event="DOMActivate">
                            <xxf:script>
                                <!-- Reset the displayed page as the iframe might show the result from a previous test -->
                                $('#fb-test-iframe')[0].contentWindow.location.href = "about:blank";
                                ORBEON.xforms.Document.dispatchEvent("fb-test-button-group", "show-fb-test-dialog");
                            </xxf:script>
                        </xf:action>
                    </xf:trigger>
                    <xf:action ev:event="show-fb-test-dialog">
                        <xxf:show dialog="fb-test-dialog"/>
                        <xf:send submission="fb-test-form-submission"/>
                    </xf:action>
                </xf:group>

                <!-- Publish form -->
                <xf:group model="fr-persistence-model" ref="instance('fr-triggers-instance')/publish">
                    <xf:trigger id="fb-publish-button" ref=".">
                        <xf:label>
                            <xh:img src="/apps/fr/style/images/pixelmixer/globe_16.png" alt=""/>
                            <xh:span><xf:output value="$fr-resources/detail/labels/publish"/></xh:span>
                        </xf:label>
                        <xf:action ev:event="DOMActivate">
                            <xxf:show dialog="fb-publish-dialog"/>
                        </xf:action>
                    </xf:trigger>
                </xf:group>

                <!-- Save as -->
                <xf:trigger id="fr-save-as-button" ref="instance('fb-triggers-instance')/save-as">
                    <xf:label>
                        <xh:img width="16" height="16" src="/apps/fr/style/images/silk/database_add.png" alt=""/>
                        <xh:span><xf:output value="$fr-resources/detail/labels/save-as-document"/></xh:span>
                    </xf:label>
                    <xf:action ev:event="DOMActivate">
                        <!-- Open the dialog in "save-as" mode -->
                        <xf:dispatch name="fb-show-dialog" targetid="dialog-form-settings">
                            <xxf:context name="title" value="xxf:bind('title-bind')"/>
                            <xxf:context name="description" value="xxf:bind('description-bind')"/>
                            <xxf:context name="mode" value="'save-as'"/>
                        </xf:dispatch>
                    </xf:action>
                </xf:trigger>

                <!-- "Save" from Form Runner -->
                <fr:save-button appearance="xxforms:primary"/>

            </xh:div>
        </xh:div>

        <xi:include href="oxf:/forms/orbeon/builder/form/toolbox.xml" xxi:omit-xml-base="true"/>

        <xh:div class="fb-main">
            <xh:div class="fb-main-inner">

                <xh:div class="navbar navbar-inverse">
                    <xh:div class="navbar-inner">
                        <xh:div class="container">
                            <!-- Custom logo upload is removed in 4.0 -->
                            <!--<fr:logo ref="xxf:bind('logo-bind')"/>-->
                            <xh:span class="fr-logo">
                                <xh:img src="/apps/fr/style/orbeon-navbar-logo.png" alt=""/>
                            </xh:span>
                            <fr:title ref="xxf:bind('title-bind')"/>

                            <!-- Form settings -->
                            <xf:trigger appearance="minimal" class="fb-form-settings-trigger pull-right">
                                <xf:label><xh:img src="/apps/fr/style/images/silk/cog.png" alt="" title="{$form-resources/dialog-form-settings/open/label}"/></xf:label>
                                <xf:action ev:event="DOMActivate">
                                    <!-- Open the dialog in "edit" mode --><commit_msg>Fix #556 "Disable Save As button in Form Builder"<commit_after><!--
  Copyright (C) 2010 Orbeon, Inc.

  This program is free software; you can redistribute it and/or modify it under the terms of the
  GNU Lesser General Public License as published by the Free Software Foundation; either version
  2.1 of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU Lesser General Public License for more details.

  The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
  -->
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
      xmlns:xf="http://www.w3.org/2002/xforms"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
      xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
      xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
      xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
      xmlns:secure="java:org.orbeon.oxf.util.SecureUtils"
      xmlns:controlOps="java:org.orbeon.oxf.fb.ControlOps"
      xmlns:containerOps="java:org.orbeon.oxf.fb.ContainerOps"
      xmlns:sectionOps="java:org.orbeon.oxf.fb.SectionOps"
      xmlns:gridOps="java:org.orbeon.oxf.fb.GridOps">
    <xh:head>
        <!-- CSS -->
        <xh:link rel="stylesheet" type="text/css" href="/ops/yui/assets/skins/sam/resize.css"/>
        <xh:link rel="stylesheet" type="text/css" href="/ops/yui/assets/skins/sam/layout.css"/>
        <xh:link rel="stylesheet" href="/forms/orbeon/builder/resources/form-builder.css" type="text/css"/>

        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/cell/events.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/cell/action-icons.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/cell/placeholders.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/cell/static-upload.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/section-grid-repeat/position.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/section-grid-repeat/section-editor.js"/>
        <xh:script type="text/javascript" src="/forms/orbeon/builder/resources/section-grid-repeat/grid-repeat-editor.js"/>

        <!-- Include main XForms model -->
        <xi:include href="oxf:/forms/orbeon/builder/form/model.xml" xxi:omit-xml-base="true"/>
    </xh:head>
    <xh:body>

        <!-- For the summary page -->
        <xh:div class="fr-hidden">
            <xf:output id="application-name-control" bind="application-name-bind" class="fr-summary fr-search">
                <xf:label ref="$form-resources/application-name/label"/>
            </xf:output>
            <xf:output id="form-name-control" bind="form-name-bind" class="fr-summary fr-search">
                <xf:label ref="$form-resources/form-name/label"/>
            </xf:output>
            <xf:output id="title-control" bind="title-bind" class="fr-summary fr-search">
                <xf:label ref="$form-resources/title/label"/>
            </xf:output>
            <xf:output id="description-control" bind="description-bind" class="fr-summary fr-search">
                <xf:label ref="$form-resources/description/label"/>
            </xf:output>
        </xh:div>

        <xh:div class="fb-navbar navbar navbar-fixed-top">
            <xh:div class="navbar-inner">
                <xh:div class="container">
                    <xh:span class="fr-logo">
                        <xh:img src="/apps/fr/style/orbeon-navbar-logo.png" alt=""/>
                    </xh:span>
                    <xh:span class="brand">Form Builder</xh:span>

                    <xh:ul class="nav pull-right">
                        <xh:li>
                            <xh:a tabindex="-1" href="http://wiki.orbeon.com/forms/doc/user-guide/form-builder-user-guide" target="_blank">Form Builder User Guide</xh:a>
                        </xh:li>
                        <xh:li>
                            <xh:a tabindex="-1" href="http://www.orbeon.com/forms/screencast/form-builder" target="_blank">Form Builder Screencast</xh:a>
                        </xh:li>
                        <xh:li>
                            <fr:language-selector/>
                        </xh:li>
                    </xh:ul>
                </xh:div>
            </xh:div>
        </xh:div>

        <xh:div class="fb-bottom">

            <fr:status-icons/>
            <fr:messages/>

            <!-- XPath errors in edited form -->
            <xh:div class="fb-xpath-errors">
                <xf:output
                    class="alert"
                    ref="instance('fb-variables')/xpath-errors[xs:integer(.) gt 0]"
                    value="xxf:format-message($form-resources/messages/xpath-errors, xs:integer(.))"/>
            </xh:div>

            <xh:div class="fr-buttons">
                <!-- Back/Close -->
                <fr:close-button/>

                <!-- Test form -->
                <xf:group model="fr-error-summary-model" ref="instance('fr-error-summary-instance')/trigger" id="fb-test-button-group">
                    <xf:trigger id="fb-test-button">
                        <xf:label>
                            <xh:img src="/apps/fr/style/images/pixelmixer/gear_16.png" alt=""/>
                            <xh:span><xf:output value="$fr-resources/detail/labels/test"/></xh:span>
                        </xf:label>
                        <xf:action ev:event="DOMActivate">
                            <xxf:script>
                                <!-- Reset the displayed page as the iframe might show the result from a previous test -->
                                $('#fb-test-iframe')[0].contentWindow.location.href = "about:blank";
                                ORBEON.xforms.Document.dispatchEvent("fb-test-button-group", "show-fb-test-dialog");
                            </xxf:script>
                        </xf:action>
                    </xf:trigger>
                    <xf:action ev:event="show-fb-test-dialog">
                        <xxf:show dialog="fb-test-dialog"/>
                        <xf:send submission="fb-test-form-submission"/>
                    </xf:action>
                </xf:group>

                <!-- Publish form -->
                <xf:group model="fr-persistence-model" ref="instance('fr-triggers-instance')/publish">
                    <xf:trigger id="fb-publish-button" ref=".">
                        <xf:label>
                            <xh:img src="/apps/fr/style/images/pixelmixer/globe_16.png" alt=""/>
                            <xh:span><xf:output value="$fr-resources/detail/labels/publish"/></xh:span>
                        </xf:label>
                        <xf:action ev:event="DOMActivate">
                            <xxf:show dialog="fb-publish-dialog"/>
                        </xf:action>
                    </xf:trigger>
                </xf:group>

                <!-- Save as -->
                <!--
                    #556: Disable Save As button in Form Builder (https://github.com/orbeon/orbeon-forms/issues/556)
                    #269: Save As must also copy attachments (https://github.com/orbeon/orbeon-forms/issues/269)
                -->
                <!--<xf:trigger id="fr-save-as-button" ref="instance('fb-triggers-instance')/save-as">-->
                    <!--<xf:label>-->
                        <!--<xh:img width="16" height="16" src="/apps/fr/style/images/silk/database_add.png" alt=""/>-->
                        <!--<xh:span><xf:output value="$fr-resources/detail/labels/save-as-document"/></xh:span>-->
                    <!--</xf:label>-->
                    <!--<xf:action ev:event="DOMActivate">-->
                        <!--&lt;!&ndash; Open the dialog in "save-as" mode &ndash;&gt;-->
                        <!--<xf:dispatch name="fb-show-dialog" targetid="dialog-form-settings">-->
                            <!--<xxf:context name="title" value="xxf:bind('title-bind')"/>-->
                            <!--<xxf:context name="description" value="xxf:bind('description-bind')"/>-->
                            <!--<xxf:context name="mode" value="'save-as'"/>-->
                        <!--</xf:dispatch>-->
                    <!--</xf:action>-->
                <!--</xf:trigger>-->

                <!-- "Save" from Form Runner -->
                <fr:save-button appearance="xxforms:primary"/>

            </xh:div>
        </xh:div>

        <xi:include href="oxf:/forms/orbeon/builder/form/toolbox.xml" xxi:omit-xml-base="true"/>

        <xh:div class="fb-main">
            <xh:div class="fb-main-inner">

                <xh:div class="navbar navbar-inverse">
                    <xh:div class="navbar-inner">
                        <xh:div class="container">
                            <!-- Custom logo upload is removed in 4.0 -->
                            <!--<fr:logo ref="xxf:bind('logo-bind')"/>-->
                            <xh:span class="fr-logo">
                                <xh:img src="/apps/fr/style/orbeon-navbar-logo.png" alt=""/>
                            </xh:span>
                            <fr:title ref="xxf:bind('title-bind')"/>

                            <!-- Form settings -->
                            <xf:trigger appearance="minimal" class="fb-form-settings-trigger pull-right">
                                <xf:label><xh:img src="/apps/fr/style/images/silk/cog.png" alt="" title="{$form-resources/dialog-form-settings/open/label}"/></xf:label>
                                <xf:action ev:event="DOMActivate">
                                    <!-- Open the dialog in "edit" mode -->
{'fraction_non_alphanumeric': 0.1619549102806605, 'fraction_numerical': 0.005367823730893104, 'mean_word_length': 1.662945820854887, 'pattern_counts': {'":': 0, '<': 301, '<?xml version=': 0, '>': 301, 'https://': 2, 'lorem ipsum': 0, 'www.': 14, 'xml': 46}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4817713', 'n_tokens_mistral': 5939, 'n_tokens_neox': 5631, 'n_words': 879}