<commit_before>/// <reference path="../../lib/jquery.d.ts" />
/// <reference path="../main.ts" />
/// <reference path="../gui/project.ts" />
/// <reference path="../gui/property.ts" />
/// <reference path="activity.ts" />

module Activity {

    export class Verifier extends Activity {
        private changed : boolean
        private editor: any;
        private addCcsPropertyList: JQuery;
        private addTccsPropertyList: JQuery;
        private propertyTableBody: JQuery;
        private verifyAllButton: JQuery;
        private verifyStopButton: JQuery;
        private currentVerifyingProperty = null;
        private clockInterval;
        private propsToVerify = [];
        private startTime;
        private currentShownPropertyForm = null;
        private propertyForms = {};
        private formulaEditor : any;
        private toolMenuOptions = {};
        private rowClickHandlers = {};

        constructor(container: string, button: string) {
            super(container, button);

            this.project = Project.getInstance();
            this.addCcsPropertyList = $("#add-property");
            this.addTccsPropertyList = $("#add-time-property");
            this.propertyTableBody = $("#property-table").find("tbody");
            this.verifyAllButton = $("#verify-all");
            this.verifyStopButton = $("#verify-stop");

            this.addCcsPropertyList.find("li.property-item").on("click", (e) => this.addProperty(e));
            this.addTccsPropertyList.find("li.property-item").on("click", (e) => this.addProperty(e));
            this.verifyAllButton.on("click", () => {
                this.verifyAllButton.prop("disabled", true);
                this.verifyAll() 
                });
            this.verifyStopButton.on("click", () => {
                this.propsToVerify = [];
                if (this.currentVerifyingProperty) {
                    try {
                        this.currentVerifyingProperty.abortVerification();
                    } catch (error) {
                        console.log("Error stopping verification of property " + this.currentVerifyingProperty + ": " + error);
                    }
                    this.verifactionEnded(PropertyStatus.unknown);
                }
            });

            $(document).on("ccs-changed", () => this.changed = true); // on CCS change event (reset everything)

            this.editor = ace.edit("hml-editor");
            this.editor.setTheme("ace/theme/crisp");
            this.editor.getSession().setMode("ace/mode/hml");
            this.editor.getSession().setUseWrapMode(true);
            this.editor.setOptions({
                enableBasicAutocompletion: true,
                showPrintMargin: false,
                fontSize: 14,
                fontFamily: "Inconsolata"
            });

            this.formulaEditor = ace.edit("hml-formula");
            this.formulaEditor.setTheme("ace/theme/crisp");
            this.formulaEditor.getSession().setMode("ace/mode/hml");
            this.formulaEditor.getSession().setUseWrapMode(true);
            this.formulaEditor.setOptions({
                enableBasicAutocompletion: true,
                showPrintMargin: false,
                fontSize: 14,
                fontFamily: "Inconsolata",
                showLineNumbers: false,
                minLines: 1,
                maxLines: 1
            });

            this.propertyForms = 
            {
                hmlform :
                    {
                        container : $("#hml-form"),
                        processList : $("#hml-process"),
                    }, 
                twoprocesslistform :
                    {
                        container : $("#two-processlist-form"),
                        firstProcessList : $('#first-processlist'),
                        secondProcessList : $('#second-processlist'),
                    }            
            };

            this.toolMenuOptions = {
                "edit": {
                    id:"#property-edit",
                    label: "Edit",
                    click: (e) => this.editProperty(e)
                }, 
                "delete": {
                    id: "#property-delete",
                    label: "Delete",
                    click: (e) => this.deleteProperty(e)
                },
                "play": {
                    id: "#property-playgame",
                    label: "Play",
                    click: (e) => this.playGame(e)
                },
                "distinguishing" : {
                    id: "#property-distinguishing",
                    label: "Distinguishing formula",
                    click: (e) => this.generateDistinguishingFormula(e)
                }
            };

            this.rowClickHandlers = {
                "collapse" : {
                    id:"#property-collapse-btn",
                    click : (e) => this.onCollapseClick(e),
                },
                "status" : {
                    id : "#property-status-btn",
                    click : (e) => this.playGame(e)
                },
                "description": {
                    id : "#property-description-btn",
                    click : (e) => this.editProperty(e)
                },
                "verify": {
                    id : "#property-verify-btn",
                    click : (e) => this.verify(e)
                }
            }<commit_msg>Verifier: renamed context menu items<commit_after>/// <reference path="../../lib/jquery.d.ts" />
/// <reference path="../main.ts" />
/// <reference path="../gui/project.ts" />
/// <reference path="../gui/property.ts" />
/// <reference path="activity.ts" />

module Activity {

    export class Verifier extends Activity {
        private changed : boolean
        private editor: any;
        private addCcsPropertyList: JQuery;
        private addTccsPropertyList: JQuery;
        private propertyTableBody: JQuery;
        private verifyAllButton: JQuery;
        private verifyStopButton: JQuery;
        private currentVerifyingProperty = null;
        private clockInterval;
        private propsToVerify = [];
        private startTime;
        private currentShownPropertyForm = null;
        private propertyForms = {};
        private formulaEditor : any;
        private toolMenuOptions = {};
        private rowClickHandlers = {};

        constructor(container: string, button: string) {
            super(container, button);

            this.project = Project.getInstance();
            this.addCcsPropertyList = $("#add-property");
            this.addTccsPropertyList = $("#add-time-property");
            this.propertyTableBody = $("#property-table").find("tbody");
            this.verifyAllButton = $("#verify-all");
            this.verifyStopButton = $("#verify-stop");

            this.addCcsPropertyList.find("li.property-item").on("click", (e) => this.addProperty(e));
            this.addTccsPropertyList.find("li.property-item").on("click", (e) => this.addProperty(e));
            this.verifyAllButton.on("click", () => {
                this.verifyAllButton.prop("disabled", true);
                this.verifyAll() 
                });
            this.verifyStopButton.on("click", () => {
                this.propsToVerify = [];
                if (this.currentVerifyingProperty) {
                    try {
                        this.currentVerifyingProperty.abortVerification();
                    } catch (error) {
                        console.log("Error stopping verification of property " + this.currentVerifyingProperty + ": " + error);
                    }
                    this.verifactionEnded(PropertyStatus.unknown);
                }
            });

            $(document).on("ccs-changed", () => this.changed = true); // on CCS change event (reset everything)

            this.editor = ace.edit("hml-editor");
            this.editor.setTheme("ace/theme/crisp");
            this.editor.getSession().setMode("ace/mode/hml");
            this.editor.getSession().setUseWrapMode(true);
            this.editor.setOptions({
                enableBasicAutocompletion: true,
                showPrintMargin: false,
                fontSize: 14,
                fontFamily: "Inconsolata"
            });

            this.formulaEditor = ace.edit("hml-formula");
            this.formulaEditor.setTheme("ace/theme/crisp");
            this.formulaEditor.getSession().setMode("ace/mode/hml");
            this.formulaEditor.getSession().setUseWrapMode(true);
            this.formulaEditor.setOptions({
                enableBasicAutocompletion: true,
                showPrintMargin: false,
                fontSize: 14,
                fontFamily: "Inconsolata",
                showLineNumbers: false,
                minLines: 1,
                maxLines: 1
            });

            this.propertyForms = 
            {
                hmlform :
                    {
                        container : $("#hml-form"),
                        processList : $("#hml-process"),
                    }, 
                twoprocesslistform :
                    {
                        container : $("#two-processlist-form"),
                        firstProcessList : $('#first-processlist'),
                        secondProcessList : $('#second-processlist'),
                    }            
            };

            this.toolMenuOptions = {
                "edit": {
                    id: "#property-edit",
                    label: "Edit Property",
                    click: (e) => this.editProperty(e)
                }, 
                "delete": {
                    id: "#property-delete",
                    label: "Delete Property",
                    click: (e) => this.deleteProperty(e)
                },
                "play": {
                    id: "#property-playgame",
                    label: "Play Game",
                    click: (e) => this.playGame(e)
                },
                "distinguishing" : {
                    id: "#property-distinguishing",
                    label: "Generate Distinguishing Formula",
                    click: (e) => this.generateDistinguishingFormula(e)
                }
            };

            this.rowClickHandlers = {
                "collapse" : {
                    id:"#property-collapse-btn",
                    click : (e) => this.onCollapseClick(e),
                },
                "status" : {
                    id : "#property-status-btn",
                    click : (e) => this.playGame(e)
                },
                "description": {
                    id : "#property-description-btn",
                    click : (e) => this.editProperty(e)
                },
                "verify": {
                    id : "#property-verify-btn",
                    click : (e) => this.verify(e)
                }
            }
{'fraction_non_alphanumeric': 0.12561756633119853, 'fraction_numerical': 0.0010978956999085087, 'mean_word_length': 1.3467153284671534, 'pattern_counts': {'":': 12, '<': 13, '<?xml version=': 0, '>': 39, 'https://': 0, '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': '205956', 'n_tokens_mistral': 2751, 'n_tokens_neox': 2563, 'n_words': 443}