<commit_before>// Copyright (c) 2014 <NAME>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, 51 Franklin Street, Suite 500 Boston, MA 02110-1335 USA

// Note: This code is inspired by the Python Turtle Blocks project
// (https://github.com/walterbender/turtleart), but implemented from
// scratch. -- <NAME>, October 2014.

define(function (require) {
    var activity = require('sugar-web/activity/activity');
    var icon = require('sugar-web/graphics/icon');
    require('easel');
    require('activity/artwork');
    require('activity/utils');
    require('activity/munsell');
    require('activity/trash');
    require('activity/turtle');
    require('activity/palette');
    require('activity/blocks');  

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

        // Initialize the activity.
        activity.setup();

        // Colorize the activity icon.
        var activityButton = docById('activity-button');
        var colors;  // I should be getting the XO colors here?
        activity.getXOColor(function (error, colors) {
            icon.colorize(activityButton, colors);
        });

        //
        var canvas = docById('myCanvas');

        var stage;
        var turtles;
        var palettes;
        var blocks;

        // default values
        var defaultBackgroundColor = [70, 80, 20];
        var defaultDelay = 500;  // MS

        var turtleDelay = defaultDelay;

        // Used to track mouse state for mouse button block
        var stageMouseDown = false;

        var fastButton = docById('fast-button');
        var slowButton = docById('slow-button');
        var clearButton = docById('clear-button');
        var paletteButton = docById('palette-button');
        var blockButton = docById('hide-blocks-button');
        var copyButton = docById('copy-button');
        var pasteButton = docById('paste-button');
        var cartesianButton = docById('cartesian-button');
        var polarButton = docById('polar-button');
        var openButton = docById('open-button');
        var saveButton = docById('save-button');
        var stopTurtleButton = docById('stop-turtle-button');

	if (screen.width < 1024) {
	    copyButton.style.visibility = 'hidden';
	    pasteButton.style.visibility = 'hidden';
	    cartesianButton.style.visibility = 'hidden';
	    polarButton.style.visibility = 'hidden';
	    openButton.style.visibility = 'hidden';
	    saveButton.style.visibility = 'hidden';
	}

        fastButton.onclick = function () {
            turtleDelay = 1;
            runLogoCommands();
        }

        slowButton.onclick = function () {
            turtleDelay = defaultDelay;
            runLogoCommands();
        }

        var stopTurtle = false;
        stopTurtleButton.onclick = function () {
            doStopTurtle();
        }

        paletteButton.onclick = function () {<commit_msg>hide the stop button too<commit_after>// Copyright (c) 2014 <NAME>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with this library; if not, write to the Free Software
// Foundation, 51 Franklin Street, Suite 500 Boston, MA 02110-1335 USA

// Note: This code is inspired by the Python Turtle Blocks project
// (https://github.com/walterbender/turtleart), but implemented from
// scratch. -- <NAME>, October 2014.

define(function (require) {
    var activity = require('sugar-web/activity/activity');
    var icon = require('sugar-web/graphics/icon');
    require('easel');
    require('activity/artwork');
    require('activity/utils');
    require('activity/munsell');
    require('activity/trash');
    require('activity/turtle');
    require('activity/palette');
    require('activity/blocks');  

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

        // Initialize the activity.
        activity.setup();

        // Colorize the activity icon.
        var activityButton = docById('activity-button');
        var colors;  // I should be getting the XO colors here?
        activity.getXOColor(function (error, colors) {
            icon.colorize(activityButton, colors);
        });

        //
        var canvas = docById('myCanvas');

        var stage;
        var turtles;
        var palettes;
        var blocks;

        // default values
        var defaultBackgroundColor = [70, 80, 20];
        var defaultDelay = 500;  // MS

        var turtleDelay = defaultDelay;

        // Used to track mouse state for mouse button block
        var stageMouseDown = false;

        var fastButton = docById('fast-button');
        var slowButton = docById('slow-button');
        var stopTurtleButton = docById('stop-turtle-button');
        var clearButton = docById('clear-button');
        var paletteButton = docById('palette-button');
        var blockButton = docById('hide-blocks-button');
        var copyButton = docById('copy-button');
        var pasteButton = docById('paste-button');
        var cartesianButton = docById('cartesian-button');
        var polarButton = docById('polar-button');
        var openButton = docById('open-button');
        var saveButton = docById('save-button');
        var stopButton = docById('stop-button');

	if (screen.width < 1024) {
	    copyButton.style.visibility = 'hidden';
	    pasteButton.style.visibility = 'hidden';
	    cartesianButton.style.visibility = 'hidden';
	    polarButton.style.visibility = 'hidden';
	    openButton.style.visibility = 'hidden';
	    saveButton.style.visibility = 'hidden';
	    stopButton.style.visibility = 'hidden';
	}

        fastButton.onclick = function () {
            turtleDelay = 1;
            runLogoCommands();
        }

        slowButton.onclick = function () {
            turtleDelay = defaultDelay;
            runLogoCommands();
        }

        var stopTurtle = false;
        stopTurtleButton.onclick = function () {
            doStopTurtle();
        }

        paletteButton.onclick = function () {
{'fraction_non_alphanumeric': 0.11571623052488277, 'fraction_numerical': 0.01119346543639389, 'mean_word_length': 2.5510204081632653, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '567138', 'n_tokens_mistral': 1882, 'n_tokens_neox': 1727, 'n_words': 523}