<commit_before>var observable = require("data/observable");
var observableArray = require("data/observable-array");
var frame = require("ui/frame");
var view = require("ui/core/view");

var scrapbook;

function scrapbookPageModel(){
    var model = new observable.Observable({ 
        title: "null", 
        birthDate: null, 
        gender: null, 
        image: null,
        lat: null,
        long: null
    });

    model.calcAge = function(birthDate){
        var now = Date.now();
        var diff = Math.abs(now - birthDate) / 1000 / 31536000;

        return diff.toFixed(1);
    };
    
    return model;
}

exports.onLoaded = function(args) {
    var page = args.object;
    var scrapbook = new observable.Observable({
        pages: new observableArray.ObservableArray(),
        selectedPage: null
    });

    page.bindingContext = scrapbook;
};
<commit_msg>update tablet on load to get data from filesystem<commit_after>var observable = require("data/observable");
var observableArray = require("data/observable-array");
var frame = require("ui/frame");
var view = require("ui/core/view");

var scrapbook;

function scrapbookPageModel(){
    var model = new observable.Observable({ 
        title: "null", 
        birthDate: null, 
        gender: null, 
        image: null,
        lat: null,
        long: null
    });

    model.calcAge = function(birthDate){
        var now = Date.now();
        var diff = Math.abs(now - birthDate) / 1000 / 31536000;

        return diff.toFixed(1);
    };
    
    return model;
}

exports.onLoaded = function(args) {
    var page = args.object;
    var scrapbook = new observable.Observable({
        pages: new observableArray.ObservableArray(),
        selectedPage: null
    });

    var pages = fileSystemService.fileSystemService.getPages();

    if (pages.length !== 0) {
        pages.forEach(function (item) {
            var model = new scrapbookPageModel();
            
            model.id = item.id;
            model.title = item.title;
            model.gender = item.gender;
            model.birthDate = item.birthDate;
            model.image = item.image;
            model.lat = item.lat;
            model.long = item.long;
            
            scrapbook.pages.push(model);
        });
    }

    page.bindingContext = scrapbook;
};

{'fraction_non_alphanumeric': 0.11944803794739112, 'fraction_numerical': 0.01164294954721863, 'mean_word_length': 2.231197771587744, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2014193', 'n_tokens_mistral': 705, 'n_tokens_neox': 651, 'n_words': 161}