<commit_before><!DOCTYPE html>
<html>

<!--
   Template of the enceladus test-finch
-->
<template id="descText">
    <style>
     /* css style information - empty */
    </style>
    <div class="outer">
        <section id="textSection">
           Hello, this is the content of the Enceladus-Finch, to test the connection to the chrome GPII connector
        </section>
        <div class="content">
            <content></content>
        </div>
    </div>
</template>

<!--
   The finch implementation
-->
<script type="text/javascript">

    document.enceladusComponent = document.enceladusComponent || {};
    document.enceladusComponent.descr = {};

    var _finchPrototype  = {},
        _finchImportTag = document.querySelector('link[href="../../Finches/darwin-description/darwin-description.html"]');
       _finchPrototype._import = _finchImportTag.import;

    var _enceladusComponent_local = document.enceladusComponent;

    /**
     * This function establishes a connection to Chrome GPII extension
     * using the extension's unique ID that is defined in the extension implementation.
     *
     * This function is called when the browser creates a new element (WebComponent) of typ "Enceladus"
     * See: "createdCallback".
     *
     * See this URL for more information on the WebComponent lifecycle callbacks:
     * https://developer.mozilla.org/en-US/docs/Web/Web_Components/Custom_Elements
     *
     */
    function establishConnectionToTheChromeGPIIExtension(){
        var extensionId = "bkoobcbgaajfpjhfkahlmghbeneedodc"; /* Unique ID of the chrome extension */
        var solutionId = "my.DARWIN_example.com"; /* Just a simple identifier. A better one has to be defined later. */

        /* Connection to the chrome extension.
         * If successful, web socket connection is established  */
        var port = chrome.runtime.connect(extensionId);
        port.postMessage({type: "connectionRequest", solutionId: solutionId});

        /* Listener, which listens to massages coming from the chrome extension  */
        port.onMessage.addListener(function (msg) {
            if (msg.accepted) {
                console.log("## got an okay from the extension side, now let's wait for settings ...");
            }
            /* Whenever the settings (user settings) change, the component will be notified */
            if (msg.settings) {
                console.log("## got new settings: " + JSON.stringify(msg.settings));
            }
        });
    }

    /**
     * The WebComponent lifecycle callbacks.
     */
    _finchPrototype.descr_proto =  Object.create(HTMLElement.prototype, {
        /*
         * Called after the element is created.
         * On create the WebComponent will load to default template into the component's shadow DOM and
         * establish a connection to the chrome extension.
         */
        createdCallback: {
            value: function () {

                /* Get the reference to the components shadow DOM. */
                this.shadow = this.createShadowRoot();

                /* Load the default shadowDOM implementation - aka. the default appearance */
                var template = _finchPrototype._import.querySelector('#descText');
                var clone = document.importNode(template.content, true);
                _enceladusComponent_local.shadow = this.shadow;
                this.shadow.appendChild(clone);

                /* Establish a connection to the chrome extension. */
                establishConnectionToTheChromeGPIIExtension.apply(this);
            }
        }
    });

    /**
     * Register the enceladus WebComponent in the web browser as a new custom element
     */
    _enceladusComponent_local.descr = document.registerElement('darwin-enceladus', {
        prototype: _finchPrototype.descr_proto
    });

</script>
</html>

<commit_msg>Minor clean up<commit_after><!DOCTYPE html>
<html>

<!--
   Template of the enceladus test-finch
-->
    <template id="descText">
        <style>
         /* css style information - empty */
        </style>
        <div class="outer">
            <section id="textSection">
               Hello, this is the content of the Enceladus-Finch, to test the connection to the chrome GPII connector
            </section>
            <div class="content">
                <content></content>
            </div>
        </div>
    </template>

<!--
   The finch implementation
-->
    <script type="text/javascript">

        document.enceladusComponent = document.enceladusComponent || {};
        document.enceladusComponent.descr = {};

        var _finchPrototype  = {},
            _finchImportTag = document.querySelector('link[href="../../Finches/darwin-description/darwin-description.html"]');
           _finchPrototype._import = _finchImportTag.import;

        var _enceladusComponent_local = document.enceladusComponent;

        /**
         * This function establishes a connection to Chrome GPII extension
         * using the extension's unique ID that is defined in the extension implementation.
         *
         * This function is called when the browser creates a new element (WebComponent) of typ "Enceladus"
         * See: "createdCallback".
         *
         * See this URL for more information on the WebComponent lifecycle callbacks:
         * https://developer.mozilla.org/en-US/docs/Web/Web_Components/Custom_Elements
         *
         */
        function establishConnectionToTheChromeGPIIExtension(){
            var extensionId = "bkoobcbgaajfpjhfkahlmghbeneedodc"; /* Unique ID of the chrome extension */
            var solutionId = "my.DARWIN_example.com"; /* Just a simple identifier. A better one has to be defined later. */

            /* Connection to the chrome extension.
             * If successful, web socket connection is established  */
            var port = chrome.runtime.connect(extensionId);
            port.postMessage({type: "connectionRequest", solutionId: solutionId});

            /* Listener, which listens to massages coming from the chrome extension  */
            port.onMessage.addListener(function (msg) {
                if (msg.accepted) {
                    console.log("## got an okay from the extension side, now let's wait for settings ...");
                }
                /* Whenever the settings (user settings) change, the component will be notified */
                if (msg.settings) {
                    console.log("## got new settings: " + JSON.stringify(msg.settings));
                }
            });
        }

        /**
         * The WebComponent lifecycle callbacks.
         */
        _finchPrototype._proto =  Object.create(HTMLElement.prototype, {
            /*
             * Called after the element is created.
             * On create the WebComponent will load to default template into the component's shadow DOM and
             * establish a connection to the chrome extension.
             */
            createdCallback: {
                value: function () {

                    /* Get the reference to the components shadow DOM. */
                    this.shadow = this.createShadowRoot();

                    /* Load the default shadowDOM implementation - aka. the default appearance */
                    var template = _finchPrototype._import.querySelector('#descText');
                    var clone = document.importNode(template.content, true);
                    _enceladusComponent_local.shadow = this.shadow;
                    this.shadow.appendChild(clone);

                    /* Establish a connection to the chrome extension. */
                    establishConnectionToTheChromeGPIIExtension.apply(this);
                }
            }
        });

        /**
         * Register the enceladus WebComponent in the web browser as a new custom element
         */
        _enceladusComponent_local.descr = document.registerElement('darwin-enceladus', {
            prototype: _finchPrototype._proto
        });

    </script>
</html>


{'fraction_non_alphanumeric': 0.09485870783020042, 'fraction_numerical': 0.0, 'mean_word_length': 2.0935695032730073, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1682255', 'n_tokens_mistral': 2056, 'n_tokens_neox': 1973, 'n_words': 590}