<commit_before>define(["sugar-web/activity/activity","sugar-web/env","sugar-web/graphics/radiobuttonsgroup","mustache","moment-with-locales.min","webL10n"], function (activity,env,radioButtonsGroup,mustache,moment) {

    // Manipulate the DOM only when it is ready.
    requirejs(['domReady!'], function (doc) {

        // Initialize the activity.
        activity.setup();
        setTranslatedStrings();
        var array=["simple","none","none"];
        env.getEnvironment(function(err, environment) {
            currentenv = environment;
            
            // Load from datastore
            if (!environment.objectId) {
                console.log("New instance");
            } else {
                activity.getDatastoreObject().loadAsText(function(error, metadata, data) {
                    if (error==null && data!=null) {
                        console.log(data);
                        clock.changeFace(data[0]);
                        if(data[1]=="block"){
                            clock.changeWriteTime(true);
                            writeTime=true;
                        }
                        if(data[2]=="block"){
                            clock.changeWriteDate(true);
                            writeDate=true;;
                        }
                    }
                });
            }
        }); 

        var requestAnimationFrame = window.requestAnimationFrame ||
            window.mozRequestAnimationFrame ||
            window.webkitRequestAnimationFrame ||
            window.msRequestAnimationFrame;

        function Clock() {
            this.face = "simple";
            
            this.handAngles = {
                'hours': 0,
                'minutes': 0,
                'seconds': 0
            };

            this.colors = {
                'black': "#000000",
                'white': "#FFFFFF",
                'hours': "#005FE4",
                'minutes': "#00B20D",
                'seconds': "#E6000A"
            };
            
            this.writeTime = false;<commit_msg>Update activity.js<commit_after>define(["sugar-web/activity/activity","sugar-web/env","sugar-web/graphics/radiobuttonsgroup","mustache","moment-with-locales.min","webL10n"], function (activity,env,radioButtonsGroup,mustache,moment) {

    // Manipulate the DOM only when it is ready.
    requirejs(['domReady!'], function (doc) {

        // Initialize the activity.
        activity.setup();
        setTranslatedStrings();
        var array=["simple","none","none"];
        env.getEnvironment(function(err, environment) {
            currentenv = environment;
            
            // Load from datastore
            if (!environment.objectId) {
                console.log("New instance");
            } else {
                activity.getDatastoreObject().loadAsText(function(error, metadata, data) {
                    if (error==null && data!=null) {
                        face=data[0];
                        if(data[0]=="simple"){
                            simpleClockButton.onclick();
                        }else if(data[0]=="nice"){
                            niceClockButton.onclick();
                        }
                        if(data[1]=="block"){
                            writeTime=true;
                            writeTimeButton.onclick();
                        }
                        if(data[2]=="block"){
                            writeDate=true;
                            writeDateButton.onclick();
                        }
                    }
                });
            }
        }); 

        var requestAnimationFrame = window.requestAnimationFrame ||
            window.mozRequestAnimationFrame ||
            window.webkitRequestAnimationFrame ||
            window.msRequestAnimationFrame;

        function Clock() {
            this.face = "simple";
            
            this.handAngles = {
                'hours': 0,
                'minutes': 0,
                'seconds': 0
            };

            this.colors = {
                'black': "#000000",
                'white': "#FFFFFF",
                'hours': "#005FE4",
                'minutes': "#00B20D",
                'seconds': "#E6000A"
            };
            
            this.writeTime = false;
{'fraction_non_alphanumeric': 0.1204091120409112, 'fraction_numerical': 0.012552301255230125, 'mean_word_length': 1.2458246346555324, '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': '4319276', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1016, 'n_words': 158}