<commit_before>/* ==========================================================================
   Released Under the MIT Licence -- http://opensource.org/licenses/MIT
   ========================================================================== */

var minutes, second, seconds; // "second" is the interval and "seconds" is part of the secToMin(); function
var counter = 1500;

//-------------------- Time Unit Conversion Code ------------------------------------------------//

var secToMin = function (input) {
    "use strict";
    minutes = String(Math.floor(input / 60));
    seconds = input % 60;
    // Leading zero for second values under 10
    if (seconds < 10) {
        String(seconds);
        seconds = "0" + seconds;
    } else {
        String(seconds);
    }
    return minutes + ":" + seconds;
};

var minToSec = function (input) {
    "use strict";
    return input * 60;
};

//-------------------- Timer Code ---------------------------------------------------------------//

var stopTimer = function () {
    "use strict";
    window.clearInterval(second);
};

var timer = function () {
    "use strict";
    counter -= 1;
    $("title, #time").text(secToMin(counter));
    if (counter === 0) {
        stopTimer();
        document.getElementById("alarm").play();
    }
};

var startTimer = function () {
    "use strict";
    window.clearInterval(second); // To ensure that there is only one timer running, cancel any previous ones.
    second = window.setInterval("timer()", 1000);
};

//-------------------- Pomomdoro Code -----------------------------------------------------------//

var pomodorino = function () {
    "use strict";
    counter = 1500; // 25 Minutes
    startTimer();
    $("#start").css("display", "none");
    $("#stop").css("display", "inline");
};

var shortBreak = function () {
    "use strict";
    counter = 300; // 5 Minutes
    startTimer();
    $("#start").css("display", "none");
    $("#stop").css("display", "inline");
};

var longBreak = function () {
    "use strict";
    counter = 900; // 15 Minutes
    startTimer();
    $("#start").css("display", "none");
    $("#stop").css("display", "inline");
};

//-------------------- User Interaction Code ----------------------------------------------------//

$(document).ready(function () {
    "use strict";
    $("#pomodorino").click(function () {
        pomodorino();
    });
    $("#sb").click(function () {
        shortBreak();
    });
    $("#lb").click(function () {
        longBreak();
    });
    $("#start").click(function () {
        startTimer();
        $("#start").css("display", "none");
        $("#stop").css("display", "inline");
    });
    $("#stop").click(function () {
        stopTimer();
        $("#stop").css("display", "none");
        $("#start").css("display", "inline");
    });
});<commit_msg>1.1.1 Bug-fix<commit_after>/* ==========================================================================
   Released Under the MIT Licence -- http://opensource.org/licenses/MIT
   ========================================================================== */

var minutes, second, seconds; // "second" is the interval and "seconds" is part of the secToMin(); function
var counter = 1500;

//-------------------- Time Unit Conversion Code ------------------------------------------------//

var secToMin = function (input) {
    "use strict";
    minutes = String(Math.floor(input / 60));
    seconds = input % 60;
    // Leading zero for second values under 10
    if (seconds < 10) {
        String(seconds);
        seconds = "0" + seconds;
    } else {
        String(seconds);
    }
    return minutes + ":" + seconds;
};

var minToSec = function (input) {
    "use strict";
    return input * 60;
};

//-------------------- Timer Code ---------------------------------------------------------------//

var stopTimer = function () {
    "use strict";
    window.clearInterval(second);
};

var timer = function () {
    "use strict";
    counter -= 1;
    $("title, #time").text(secToMin(counter));
    if (counter === 0) {
        stopTimer();
        document.getElementById("alarm").play();
    }
};

var startTimer = function () {
    "use strict";
    window.clearInterval(second); // To ensure that there is only one timer running, cancel any previous ones.
    second = window.setInterval("timer()", 1000);
};

//-------------------- Pomomdoro Code -----------------------------------------------------------//

var pomodorino = function () {
    "use strict";
    counter = 1500; // 25 Minutes
    $("title, #time").text(secToMin(counter));
    startTimer();
    $("#start").css("display", "none");
    $("#stop").css("display", "inline");
};

var shortBreak = function () {
    "use strict";
    counter = 300; // 5 Minutes
    $("title, #time").text(secToMin(counter));
    startTimer();
    $("#start").css("display", "none");
    $("#stop").css("display", "inline");
};

var longBreak = function () {
    "use strict";
    counter = 900; // 15 Minutes
    $("title, #time").text(secToMin(counter));
    startTimer();
    $("#start").css("display", "none");
    $("#stop").css("display", "inline");
};

//-------------------- User Interaction Code ----------------------------------------------------//

$(document).ready(function () {
    "use strict";
    $("#pomodorino").click(function () {
        pomodorino();
    });
    $("#sb").click(function () {
        shortBreak();
    });
    $("#lb").click(function () {
        longBreak();
    });
    $("#start").click(function () {
        startTimer();
        $("#start").css("display", "none");
        $("#stop").css("display", "inline");
    });
    $("#stop").click(function () {
        stopTimer();
        $("#stop").css("display", "none");
        $("#start").css("display", "inline");
    });
});
{'fraction_non_alphanumeric': 0.3285689684863096, 'fraction_numerical': 0.012915446874461856, 'mean_word_length': 2.0093264248704665, 'pattern_counts': {'":': 2, '<': 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': '7404894', 'n_tokens_mistral': 1593, 'n_tokens_neox': 1518, 'n_words': 371}