<commit_before>
var d = [];
var s;

var duplicatorService = 'https://localhost:8000';

var app = new Vue({
    el: "#app",
    // validator: null, // private reference
    data: {
        app: {
            error: false
        },
        isCreatingApp: false,
        showAppCreated: false,
        selected: "",
        options: d,
        newAppOwner: "",
        newAppName: ""
    },
    // define methods under the `methods` object
    methods: {
        createApp: function (event) {
            // `this` inside methods points to the Vue instance

            if(!this.validate())
            {
                return;
            }

            // Save copy of Vue instance for later use
            var vueInstance = this;
            vueInstance.isCreatingApp = true;

            console.log('Selected template app id: ' + this.selected.appId);
            console.log('Onwer of new app: ' + this.newAppOwner);
            console.log('Name of new app: ' + this.newAppName);

            $.getJSON(duplicatorService + '/duplicateKeepScript?templateAppId=' + this.selected.appId + '&appName=' + this.newAppName + '&ownerUserId=' + this.newAppOwner, {}, function (data) {
                console.log('App created');
                console.log(data);

                vueInstance.isCreatingApp = false;

                var msgSuccess = 'Success!  Your new app is available <a href="https://ip.of.server/sense/app/' + data.newAppId + '" target="_blank">here</a>.';
                notie.alert({type: 'success', text: msgSuccess });
            });
        },

        toggleAppCreated() { this.showAppCreated = !this.showAppCreated; },

        validate:function()
        {
            this.$validator.validateAll();<commit_msg>Make success notification stay until clicked<commit_after>
var d = [];
var s;

var duplicatorService = 'https://localhost:8000';

var app = new Vue({
    el: "#app",
    // validator: null, // private reference
    data: {
        app: {
            error: false
        },
        isCreatingApp: false,
        showAppCreated: false,
        selected: "",
        options: d,
        newAppOwner: "",
        newAppName: ""
    },
    // define methods under the `methods` object
    methods: {
        createApp: function (event) {
            // `this` inside methods points to the Vue instance

            if(!this.validate())
            {
                return;
            }

            // Save copy of Vue instance for later use
            var vueInstance = this;
            vueInstance.isCreatingApp = true;

            console.log('Selected template app id: ' + this.selected.appId);
            console.log('Onwer of new app: ' + this.newAppOwner);
            console.log('Name of new app: ' + this.newAppName);

            $.getJSON(duplicatorService + '/duplicateKeepScript?templateAppId=' + this.selected.appId + '&appName=' + this.newAppName + '&ownerUserId=' + this.newAppOwner, {}, function (data) {
                console.log('App created');
                console.log(data);

                vueInstance.isCreatingApp = false;

                var msgSuccess = 'Success!  Your new app is available <a href="https://ip.of.server/sense/app/' + data.newAppId + '" target="_blank">here</a>.';
                notie.alert({type: 'success', text: msgSuccess, stay: true });
            });
        },

        toggleAppCreated() { this.showAppCreated = !this.showAppCreated; },

        validate:function()
        {
            this.$validator.validateAll();
{'fraction_non_alphanumeric': 0.12894064186310708, 'fraction_numerical': 0.002272081794944618, 'mean_word_length': 1.8727569331158238, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, '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': '2815436', 'n_tokens_mistral': 990, 'n_tokens_neox': 947, 'n_words': 234}