<commit_before>var tpl = {

    // Hash of preloaded templates for the app
    templates:{},

    // Recursively pre-load all the templates for the app.
    // This implementation should be changed in a production environment. All the template files should be
    // concatenated in a single file.
    loadTemplates:function (names, callback) {

        var that = this;

        var loadTemplate = function (index) {
            var name = names[index];
            console.log('Loading template: ' + name + ', index: ' + index);
            $.get('templates/en/' + name + '.html', function (data) {
                that.templates[name] = data;
                index++;
                if (index < names.length) {
                    loadTemplate(index);
                } else {
                    callback();
                }
            });
        };

        loadTemplate(0);
    },

    // Get template by name from hash of preloaded templates
    get:function (name) {
        return this.templates[name];
    }

};


(function (FMS, Backbone, _, $) {
    _.extend(FMS, {
        templates: [
            'home', 'around', 'address_search', 'photo', 'details', 'submit', 'submit_email', 'submit_name', 'submit_password', 'sent'
        ],

        initialized: 0,
        users: new FMS.Users(),
        currentUser: null,
        currentLocation: null,
        currentPosition: null,

        currentDraft: new FMS.Draft(),
        allDrafts: new FMS.Drafts(),

        reportToView: null,

        saveCurrentDraft: function() {
            FMS.router.pause();
            FMS.allDrafts.add( FMS.currentDraft );
            FMS.currentDraft.save();
            localStorage.currentDraftID = FMS.currentDraft.cid;
        },

        loadCurrentDraft: function() {
            console.log( 'loading report' );
            if ( localStorage.currentDraftID && localStorage.currentDraftID != 'null' ) {
                var r = FMS.allDrafts.get( localStorage.currentDraftID );
                if ( r ) {
                    FMS.currentDraft = r;
                }
            }
            localStorage.currentDraftID = null;
        },

        initialize: function () {
            if ( this.initialized == 1 ) {
                return this;<commit_msg>use id and not cid as we cannot look up using when we reload<commit_after>var tpl = {

    // Hash of preloaded templates for the app
    templates:{},

    // Recursively pre-load all the templates for the app.
    // This implementation should be changed in a production environment. All the template files should be
    // concatenated in a single file.
    loadTemplates:function (names, callback) {

        var that = this;

        var loadTemplate = function (index) {
            var name = names[index];
            console.log('Loading template: ' + name + ', index: ' + index);
            $.get('templates/en/' + name + '.html', function (data) {
                that.templates[name] = data;
                index++;
                if (index < names.length) {
                    loadTemplate(index);
                } else {
                    callback();
                }
            });
        };

        loadTemplate(0);
    },

    // Get template by name from hash of preloaded templates
    get:function (name) {
        return this.templates[name];
    }

};


(function (FMS, Backbone, _, $) {
    _.extend(FMS, {
        templates: [
            'home', 'around', 'address_search', 'photo', 'details', 'submit', 'submit_email', 'submit_name', 'submit_password', 'sent'
        ],

        initialized: 0,
        users: new FMS.Users(),
        currentUser: null,
        currentLocation: null,
        currentPosition: null,

        currentDraft: new FMS.Draft(),
        allDrafts: new FMS.Drafts(),

        reportToView: null,

        saveCurrentDraft: function() {
            FMS.router.pause();
            FMS.allDrafts.add( FMS.currentDraft );
            FMS.currentDraft.save();
            localStorage.currentDraftID = FMS.currentDraft.id;
        },

        loadCurrentDraft: function() {
            console.log( 'loading report' );
            if ( localStorage.currentDraftID && localStorage.currentDraftID != 'null' ) {
                var r = FMS.allDrafts.get( localStorage.currentDraftID );
                if ( r ) {
                    FMS.currentDraft = r;
                }
            }
            localStorage.currentDraftID = null;
        },

        initialize: function () {
            if ( this.initialized == 1 ) {
                return this;
{'fraction_non_alphanumeric': 0.1137357830271216, 'fraction_numerical': 0.0013123359580052493, 'mean_word_length': 1.658720930232558, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4574342', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1216, 'n_words': 317}