<commit_before>﻿/* 
 * The MIT License
 *
 * Copyright (c) 2016 - 2017, <NAME>
 *
 */

// Ajax periodic calls (ajax function is in views/main.php)
var ajaxInterval = setInterval(ajaxCall, 10000); // Time: 10s

// change a var value for AJAX call
function tabNum(n) {
    clearInterval(ajaxInterval); // stop making calls
    window.tab = n;
    ajaxCall();
    ajaxInterval = setInterval(ajaxCall, 10000); // Time: 10s
}

// change .active clas from tabs
var selector, elems, makeActive;

selector = '#tabs li';

elems = document.querySelectorAll(selector);

makeActive = function() {
    for (var i = 0; i < elems.length; i++)
        elems[i].classList.remove('active');

    this.classList.add('active');
};

for (var i = 0; i < elems.length; i++)
    elems[i].addEventListener('mousedown', makeActive);

// generate a random color for the "add task" modal
function colorGen() {
    var text = "#";
    var charset = "ABCDEF0123456789";

    for (var i = 0; i < 6; i++)
        text += charset.charAt(Math.floor(Math.random() * charset.length));

    document.getElementById("inColor").setAttribute("value", text);
}

// clear textarea from the form when closed
function eraseText() {
    document.getElementById("addtasktextarea").value = "";
}

// copy tab id and paste in the form (to make the first form tab visible always be the selected)
function catch_tab(tab_id) {
    var select = document.getElementById("tabselect");
    select.getElementById(tab_id).selected = "true";
}



/////// OLD BUT GOLD, no lo estoy usando, puede servir ///////


// script que oculta los elementos de id mensaje a los 3 segundos
setTimeout("document.getElementById(\"mensaje\").style.display = \"none\"", 3000);<commit_msg>fixed some js<commit_after>﻿/* 
 * The MIT License
 *
 * Copyright (c) 2016 - 2017, <NAME>
 *
 */

// Ajax periodic calls (ajax function is in views/main.php)
var ajaxInterval = setInterval(ajaxCall, 10000); // Time: 10s

// change a var value for AJAX call
function tabNum(n) {
    clearInterval(ajaxInterval); // stop making calls
    window.tab = n;
    ajaxCall();
    ajaxInterval = setInterval(ajaxCall, 10000); // Time: 10s
}

// change .active clas from tabs
var selector, elems, makeActive;

selector = '#tabs li';

elems = document.querySelectorAll(selector);

makeActive = function() {
    for (var i = 0; i < elems.length; i++)
        elems[i].classList.remove('active');

    this.classList.add('active');
};

for (var i = 0; i < elems.length; i++)
    elems[i].addEventListener('mousedown', makeActive);

// generate a random color for the "add task" modal
function colorGen() {
    var text = "#";
    var charset = "ABCDEF0123456789";

    for (var i = 0; i < 6; i++)
        text += charset.charAt(Math.floor(Math.random() * charset.length));

    document.getElementById("inColor").setAttribute("value", text);
}

// clear textarea from the form when closed
function eraseText() {
    document.getElementById("addtasktextarea").value = "";
}

// copy tab id and paste in the form (to make the first form tab visible always be the selected)
function catch_tab(tab_id) {
    var id = tab_id;
    var select = document.getElementById("tabselect");
    select.getElementById(id).selected = "true";
}



/////// OLD BUT GOLD, no lo estoy usando, puede servir ///////


// script que oculta los elementos de id mensaje a los 3 segundos
setTimeout("document.getElementById(\"mensaje\").style.display = \"none\"", 3000);
{'fraction_non_alphanumeric': 0.14571843251088534, 'fraction_numerical': 0.023802612481857766, 'mean_word_length': 3.4928292046936114, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, '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': '183970', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1047, 'n_words': 336}