<commit_before>/*
this function extens the current FMS object (at this point is empty, created in index.html)
. _.extend: Copy all of the properties in the source objects over to the destination object,
and return the destination object. It's in-order, so the last source will override
properties of the same name in previous arguments.
http://underscorejs.org/#extend
*/
(function (FMS, Backbone, _, $) {
    _.extend(FMS, {
        appRouter: Backbone.Router.extend({
            currentView: null,
            reverse: false,

            routes: {
                '': 'home',
                'home': 'home',
                'offline': 'offline',
                'around': 'around',
                'search': 'search',
                'existing': 'existing',
                'photo': 'photo',
                'details': 'details',
                'details_extra': 'details_extra',
                'submit-start': 'submitStart',
                'submit': 'submit',
                'submit-email': 'submitEmail',
                'submit-name': 'submitName',
                'submit-name-set-password': '<PASSWORD>',
                'submit-password': '<PASSWORD>',
                'submit-set-password': '<PASSWORD>',
                'save_offline': 'saveOffline',
                'sent': 'sent',
                'reports': 'reports',
                'login': 'login'
            },

            initialize: function() {
              console.log("initialized router");
            },

            pause: function() {
                if (this.currentView && this.currentView.updateCurrentDraft) {
                    this.currentView.updateCurrentDraft();
                }
            },

            back: function(e) {
                if (this.currentView && this.currentView.back) {
                    this.currentView.back(e);
                }
            },

            reverseTransition: function() {
                this.reverse = true;
            },

            around: function(){
                var aroundView = new FMS.AroundView({ model: FMS.currentDraft });
                FMS.aroundView = aroundView;
                this.changeView(aroundView);
            },

            search: function(){
                var searchView = new FMS.SearchView({ model: FMS.currentDraft, msg: FMS.searchMessage });
                this.changeView(searchView);
            },

            existing: function(){
                var existingView = new FMS.ExistingView({ model: FMS.currentDraft });
                this.changeView(existingView);
            },

            home: function(){
                var homeView = new FMS.HomeView({ model: FMS.currentDraft });
                this.changeView(homeView);
            },

            offline: function() {
                var offlineView = new FMS.OfflineView({ model: FMS.currentDraft });
                this.changeView(offlineView);
            },

            photo: function(){
                var photoView = new FMS.PhotoView({ model: FMS.currentDraft });
                this.changeView(photoView);
            },

            details: function(){
                var detailsView = new FMS.DetailsView({ model: FMS.currentDraft });
                this.changeView(detailsView);<commit_msg>HACK, return to home when press a button of menu<commit_after>/*
this function extens the current FMS object (at this point is empty, created in index.html)
. _.extend: Copy all of the properties in the source objects over to the destination object,
and return the destination object. It's in-order, so the last source will override
properties of the same name in previous arguments.
http://underscorejs.org/#extend
*/
(function (FMS, Backbone, _, $) {
    _.extend(FMS, {
        appRouter: Backbone.Router.extend({
            currentView: null,
            reverse: false,

            routes: {
                '': 'home',
                'home': 'home',
                'offline': 'offline',
                'around': 'around',
                'search': 'search',
                'existing': 'existing',
                'photo': 'photo',
                'details': 'details',
                'details_extra': 'details_extra',
                'submit-start': 'submitStart',
                'submit': 'submit',
                'submit-email': 'submitEmail',
                'submit-name': 'submitName',
                'submit-name-set-password': '<PASSWORD>',
                'submit-password': '<PASSWORD>',
                'submit-set-password': '<PASSWORD>',
                'save_offline': 'saveOffline',
                'sent': 'sent',
                'reports': 'reports',
                'login': 'login'
            },

            initialize: function() {
              console.log("initialized router");
            },

            pause: function() {
                if (this.currentView && this.currentView.updateCurrentDraft) {
                    this.currentView.updateCurrentDraft();
                }
            },

            back: function(e) {
                if (this.currentView && this.currentView.back) {
                    this.currentView.back(e);
                }
            },

            reverseTransition: function() {
                this.reverse = true;
            },

            around: function(){
                var aroundView = new FMS.AroundView({ model: FMS.currentDraft });
                FMS.aroundView = aroundView;
                this.changeView(aroundView);
            },

            search: function(){
                var searchView = new FMS.SearchView({ model: FMS.currentDraft, msg: FMS.searchMessage });
                this.changeView(searchView);
            },

            existing: function(){
                //var existingView = new FMS.ExistingView({ model: FMS.currentDraft });
                //this.changeView(existingView);
				var aroundView = new FMS.AroundView({ model: FMS.currentDraft });
                FMS.aroundView = aroundView;
                this.changeView(aroundView);
            },

            home: function(){
                var homeView = new FMS.HomeView({ model: FMS.currentDraft });
                this.changeView(homeView);
            },

            offline: function() {
                var offlineView = new FMS.OfflineView({ model: FMS.currentDraft });
                this.changeView(offlineView);
            },

            photo: function(){
                var photoView = new FMS.PhotoView({ model: FMS.currentDraft });
                this.changeView(photoView);
            },

            details: function(){
                var detailsView = new FMS.DetailsView({ model: FMS.currentDraft });
                this.changeView(detailsView);
{'fraction_non_alphanumeric': 0.11716540122078309, 'fraction_numerical': 0.0, 'mean_word_length': 1.4973977695167286, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3900509', 'n_tokens_mistral': 1735, 'n_tokens_neox': 1638, 'n_words': 397}