<commit_before>'use strict';
var isInit = true,
    helpers = require('../../utils/widgets/helper'),
    navigationProperty = require('../../utils/widgets/navigation-property'),
    // additional requires
    viewModel = require('./browseHistoryView-view-model'),
    modBrowse = require('../../lib/modBrowse/modBrowse.js');

// additional functions
function pageLoaded(args) {
    var page = args.object;

    helpers.platformInit(page);
    page.bindingContext = viewModel;
    // additional pageLoaded

    if (isInit) {
        isInit = false;

        // additional pageInit
        modBrowse.getHistory(function(items) {
            var menuItems = [];
            for(var i = 0; i < items.length; i++) {
                var item = items[i];
                menuItems.push({
                    "title": "[" + item + "]",
                    "url" : item,
                    "icon": "\ue0dd"
                },);
            }
            navigationViewModel.set('menuItems', menuItems);
        });
    }
}

// START_CUSTOM_CODE_homeView
// Add custom code here. For more information about custom code, see http://docs.telerik.com/platform/screenbuilder/troubleshooting/how-to-keep-custom-code-changes
var view = require("ui/core/view");
function menuItemTap(args) {
    helpers.navigate(viewModel.menuItems[args.index]);
}

exports.menuItemTap = menuItemTap;
// END_CUSTOM_CODE_homeView
exports.pageLoaded = pageLoaded;<commit_msg>fix viewModel<commit_after>'use strict';
var isInit = true,
    helpers = require('../../utils/widgets/helper'),
    navigationProperty = require('../../utils/widgets/navigation-property'),
    // additional requires
    viewModel = require('./browseHistoryView-view-model'),
    modBrowse = require('../../lib/modBrowse/modBrowse.js');

// additional functions
function pageLoaded(args) {
    var page = args.object;

    helpers.platformInit(page);
    page.bindingContext = viewModel;
    // additional pageLoaded

    if (isInit) {
        isInit = false;

        // additional pageInit
        modBrowse.getHistory(function(items) {
            var menuItems = [];
            for(var i = 0; i < items.length; i++) {
                var item = items[i];
                menuItems.push({
                    "title": "[" + item + "]",
                    "url" : item,
                    "icon": "\ue0dd"
                },);
            }
            viewModel.set('menuItems', menuItems);
        });
    }
}

// START_CUSTOM_CODE_homeView
// Add custom code here. For more information about custom code, see http://docs.telerik.com/platform/screenbuilder/troubleshooting/how-to-keep-custom-code-changes
var view = require("ui/core/view");
function menuItemTap(args) {
    helpers.navigate(viewModel.menuItems[args.index]);
}

exports.menuItemTap = menuItemTap;
// END_CUSTOM_CODE_homeView
exports.pageLoaded = pageLoaded;
{'fraction_non_alphanumeric': 0.14006968641114984, 'fraction_numerical': 0.0013937282229965157, 'mean_word_length': 2.3229166666666665, 'pattern_counts': {'":': 4, '<': 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': '4265761', 'n_tokens_mistral': 860, 'n_tokens_neox': 827, 'n_words': 156}