<commit_before>var parameters = [];

function princ_getValueTable(vComp, vColuna) {
    var fRetorno = null;
    $('#' + vComp + ' tbody').on('click', 'tr', function() {
        var fValor = $('td', this).eq(vColuna).text();

        fRetorno = fValor;

    });
    return fRetorno;
}

function princ_changeClass(vComp, vClass) {
    document.getElementById(vComp).className = vClass;
}

function princ_toUpper(vComp, vVerifica) {
    if(vVerifica){
        vComp.value.toUpperCase();
    }else{
        vComp.value.toLowerCase();
    }
}

function toogleCase (s) {
    return s === s.toUpperCase()? s.toLowerCase() : s.toUpperCase();
}

function princ_showComp(vComp, vVisivel) {
    if (vComp != null || vVisivel != null) {
        if (vVisivel) {
            document.getElementById(vComp).style.display = "inline";
        }
        if (!vVisivel) {
            document.getElementById(vComp).style.display = "none";
        }
    }
}

function princ_changeValueComp(vComp, vValor) {
    if (vComp != null && vValor != null && vValor != undefined) {
        if (vComp.indexOf(":") != -1) {
            var param = vComp.split(":");
            var form = document.getElementById(param[0]);

            for (var i = 0; i < form.elements.length; i++) {
                if (form.elements[i].id == param[1]) {
                    form.elements[i].value = vValor;
                }
            }
        } else {
            document.getElementById(vComp).value = vValor;
        }
    } else {
        console.log("Component " + vComp + " not foud or value " + vValor + " inálido");
    }
}

function isShow(vComp) {
    var fRetorno = false;
    var fComp = "#" + vComp;
    if ($(fComp).is(':visible')) {
        fRetorno = true;
    }
    return fRetorno;
}

function princ_focus(vComp) {
    document.getElementById(vComp).focus();
}

function princ_extraiScript(texto) {
    var ini = 0;
    while (ini != -1) {
        ini = texto.indexOf('<script', ini);
        if (ini >= 0) {
            ini = texto.indexOf('>', ini) + 1;
            var fim = texto.indexOf('</script>', ini);
            codigo = texto.substring(ini, fim);
            novo = document.createElement("script");
            novo.text = codigo;
            document.body.appendChild(novo);
        }
    }
}

function princ_openAjax() {
    var ajax;
    try {
        ajax = new XMLHttpRequest(); // XMLHttpRequest para Firefox, Safari, dentre outros.
    } catch (ee) {
        try {
            ajax = new ActiveXObject("Msxml2.XMLHTTP"); // Para o Internet Explorer
        } catch (e) {
            try {
                ajax = new ActiveXObject("Microsoft.XMLHTTP"); // Para o Internet Explorer
            } catch (E) {
                ajax = false;
            }
        }
    }
    return ajax;
}

function princ_excAjax(vComp, vUrl) {
    var vRenderiza = document.getElementById(vComp);
    var ajax = princ_openAjax(); // Inicia o Ajax.
    ajax.open("GET", vUrl, true);
    ajax.onreadystatechange = function() {
        if (ajax.readyState == 1) // Quando estiver carregando, exibe: carregando...
        {
            vRenderiza.innerHTML = "Atualizando...";
        }
        if (ajax.readyState == 4) // Quando estiver tudo pronto.
        {
            if (ajax.status == 200) {
                var resultado = ajax.responseText;
                vRenderiza.innerHTML = resultado;
                var para = vUrl.split("?");
                if (para.length >= 2) {
                    parameters = [];
                    var val = para[1].split("&");
                    for (var i = 0; i < val.length; i++) {
                        parameters.push(JSON.parse('{"pa":"' + val[i].split("=")[0] + '","val":"' + val[i].split("=")[1] + '"}'));
                    }
                }
                princ_extraiScript(resultado);
            } else {
                vRenderiza.innerHTML = "Erro Ajax";
            }
        }
    };
    ajax.send(null); // submete
}

function princ_excAjaxJson(vUrl, funcao) {
    var ajax = princ_openAjax(); // Inicia o Ajax.
    ajax.open("GET", vUrl, true);
    ajax.onreadystatechange = function() {
        if (ajax.readyState == 1) // Quando estiver carregando, exibe: carregando...
        {
            vRenderiza.innerHTML = "Carregando...";
        }
        if (ajax.readyState == 4) // Quando estiver tudo pronto.
        {
            if (ajax.status == 200) {
                funcao(JSON.parse(ajax.responseText));
            } else {
                console.log("erro");
            }
        }
    };
    ajax.send(null); // submete
}

function princ_excAjaxJsonTipo(vUrl, funcao, tipo) {
    princ_exibirComp("loading", true);
    var ajax = princ_openAjax(); // Inicia o Ajax.
    ajax.open(tipo, vUrl, true);
    ajax.onreadystatechange = function() {
        if (ajax.readyState == 1) // Quando estiver carregando, exibe: carregando...
        {
            vRenderiza.innerHTML = "Carregando...";
        }
        if (ajax.readyState == 4) // Quando estiver tudo pronto.
        {
            if (ajax.status == 200) {
                funcao(JSON.parse(ajax.responseText));
                princ_exibirComp("loading", false);
            } else {
                console.log("erro " + ajax.status);
                princ_exibirComp("loading", false);
            }
        }
    };
    ajax.send(null); // submete
}

function princ_getValueComp(vComp) {
    try {
        if (vComp.indexOf(":") != -1) {
            var param = vComp.split(":");
            var form = document.getElementById(param[0]);
            for (var i = 0; i < form.elements.length; i++) {
                if (form.elements[i].id == param[1]) {
                    return form.elements[i].value;
                }
            }
        } else {
            return document.getElementById(vComp).value;
        }
    } catch (e) {
        console.log("Component not found --> " + vComp);
        console.log(e);
    }
}

function princ_disabledComp(vComp, vVerifica) {
    if (vVerifica) {
        document.getElementById(vComp).disabled = true;
    } else {
        document.getElementById(vComp).disabled = false;
    }
}

function princ_confirma(vMsg){
    bootbox.confirm(vMsg, function(result) {
        return result;
    });
}

function princ_openPopUp(vUrl, vWidth, vHeight) {
    window.open(vUrl, "mywindow", "menubar=1,resizable=1,width=" + vWidth + ",height=" + vHeight);
}

function princ_getIpURL(vUrl) {
    var fUrl = String(vUrl);
    var fPosicaoIni = fUrl.indexOf("//");
    fUrl = fUrl.substring((fPosicaoIni + 2), fUrl.length);
    var fPosicaoFim = fUrl.indexOf(":");
    var fIp = fUrl.substring(0, fPosicaoFim);
    return fIp;
}

function princ_obterParametroUrl(param) {
    var url = String(location.href).split("?");
    var params = url[1].split("&");
    for (var i = 0; i < params.length; i++) {
        var paramActual = params[i].split("=");
        if (paramActual[0] == param) {
            return paramActual[1];
        }
    }
}

function princ_format_date(vData, vTipo) {
    var fData = "";
    if (vData != null) {
        var data = new Date(vData);
        var dia = data.getDate();
        if (dia.toString().length == 1)
            dia = "0" + dia;
        var mes = data.getMonth() + 1;
        if (mes.toString().length == 1)
            mes = "0" + mes;
        var ano = data.getFullYear();
        //tempo
        if (vTipo == null || vTipo == 1) {
            var hora = data.getHours();
            var minutos = data.getMinutes();
            if (minutos < 10) {
                minutos = "0" + minutos;
            }
            var segunds = data.getSeconds();
            if (segunds < 10) {
                segunds = "0" + segunds;
            }
            return dia + "/" + mes + "/" + ano + " " + hora + ":" + minutos + ":" + segunds;
        } else if (vTipo == 2) {
            return dia + "/" + mes + "/" + ano;
        } else if (vTipo == 3) {
            var hora = data.getHours();
            var minutos = data.getMinutes();
            if (minutos < 10) {
                minutos = "0" + minutos;
            }
            var segunds = data.getSeconds();
            if (segunds < 10) {
                segunds = "0" + segunds;
            }
            return hora + ":" + minutos + ":" + segunds;
        }

    }

}

function princ_emptySelect(vComp) {
    document.getElementById(vComp).options.length = 1;
}

function princ_execAjaxJquery(vUrl) {
    var fRetorno = false;
    $.ajax({
        type: "POST",
        url: vUrl,
        dataType: "json",
        success: function(json) {
            fRetorno = true;
        }
    });
    return fRetorno;
}

function princ_emptyTable(vComp) {
    $("#" + vComp + " tbody tr").remove();
}

function princ_emptyDiv(vComp) {
    document.getElementById(vComp).innerHTML = "";
}

function princ_loadJS(url) {
    var scriptTag = document.createElement('script');
    scriptTag.src = url;
    document.body.appendChild(scriptTag);
}

function princ_loadSelect(comp, data) {
    if (data.length > 0) {
        for (var i = 0; i < data.length; i++) {
            console.log(data[i].guiche);
            var x = document.getElementById("checkin.fkguiche");
            var c = document.createElement("option");
            c.text = data[i].guiche;
            c.value = data[i].pkguiche;
            x.options.add(c, x.options.length + 1);

        }
    } else {
        console.log("limpar grade");
    }
}

function princ_saveForm(comp, func) {
    $('#' + comp).submit(function(event) {
        princ_exibirComp("loading", true);
        $.ajax({
                type: 'POST', // define the type of HTTP verb we want to use (POST for our form)
                url: this.action, // the url where we want to POST
                data: $("#" + this.id).serialize() + "&to=" + sessionStorage.getItem("to"),
                dataType: 'json', // what type of data do we expect back from the server
                encode: true
            })
            .done(function(data) {
                func(data);
                princ_exibirComp("loading", false);
            })
            .fail(function(data) {
                func(data);

            });
        princ_exibirComp("loading", false);
        event.preventDefault();
    });
}

function princ_emptyForm(form) {
    var form = document.getElementById(form);
    for (var i = 0; i < form.elements.length; i++) {
        if (form.elements[i].tagName == 'INPUT' || form.elements[i].tagName == 'SELECT') {
            form.elements[i].value = "";
        }
    }
}

function princ_onlyReadForm(form, check) {
    var form = document.getElementById(form);
    for (var i = 0; i < form.elements.length; i++) {
        if (form.elements[i].tagName == 'INPUT' || form.elements[i].tagName == 'SELECT') {
            if (check) {
                form.elements[i].disabled = true;
            } else {
                form.elements[i].disabled = false;
            }

        }
    }
}

function princ_checkForm(form) {
    var form = document.getElementById(form);
    for (var i = 0; i < form.elements.length; i++) {
        if (form.elements[i].required && form.elements[i].value == "") {
            console.log(form.elements[i].value);
            form.elements[i].focus();
            msg('warning', ' Existe campo Obrigatório');
            return false;
        }
    }
    return true;
}

function princ_addEvent(comp, ev, func) {
    if (comp != null || ev != null || func != null) {
        try {
            document.getElementById(comp).addEventListener(ev, func);
        } catch (e) {
            console.log("Problema para add no componente " + comp);
            console.log(e);
        }
    }
}

function princ_change_title(title) {
    document.title = title;
    princ_insertHTML("lbTitleForm", title);
}

function princ_toTab(tab) {
    $('.nav-tabs a[href="#' + tab + '"]').tab('show');
}

function princ_insertHTML(comp, valor) {
    document.getElementById(comp).innerHTML = valor;
}

function princ_appendHTML(comp, valor) {
    $("#" + comp).append(valor);
}

function getDayWeek(day) {
    return ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"][day]
}

function princ_json_to_str(data) {
    if (data != null) {
        return JSON.stringify(data);
    } else {
        console.log('json is null');
    }
}

function princ_str_to_json(str) {
    if (str != null) {
        return JSON.parse(str);
    } else {
        console.log('String is null');
    }

}

function princ_leftZero(value, qnt) {
    var qntActual = value.length;
    if (qnt > qntActual) {
        var zeros = "";
        for (var i = 0; i < (qnt - qntActual); i++) {
            zeros = zeros + "0";
        }
        return zeros + value;
    }
}

function princ_age(birthday) {
    var ageDifMs = Date.now() - new Date(birthday).getTime();
    var ageDate = new Date(ageDifMs);
    return Math.abs(ageDate.getUTCFullYear() - 1970);
}

function princ_substring(text, qnt) {
  if(text!=null && qnt != null && parseInt(qnt) > 0){
    return text.substring(0, qnt) + "...";
  }
    return "";
}

function addSessionStorage(item, valor){
    sessionStorage.setItem(item, valor);
}

function getSessionStorage(item){
    sessionStorage.getItem(item);
}

function removeAllSessionStorage(){
    sessionStorage.clear();
}
<commit_msg>Alterando descrição da funçao isShow<commit_after>var parameters = [];

function princ_getValueTable(vComp, vColuna) {
    var fRetorno = null;
    $('#' + vComp + ' tbody').on('click', 'tr', function() {
        var fValor = $('td', this).eq(vColuna).text();

        fRetorno = fValor;

    });
    return fRetorno;
}

function princ_changeClass(vComp, vClass) {
    document.getElementById(vComp).className = vClass;
}

function princ_toUpper(vComp, vVerifica) {
    if(vVerifica){
        vComp.value.toUpperCase();
    }else{
        vComp.value.toLowerCase();
    }
}

function toogleCase (s) {
    return s === s.toUpperCase()? s.toLowerCase() : s.toUpperCase();
}

function princ_showComp(vComp, vVisivel) {
    if (vComp != null || vVisivel != null) {
        if (vVisivel) {
            document.getElementById(vComp).style.display = "inline";
        }
        if (!vVisivel) {
            document.getElementById(vComp).style.display = "none";
        }
    }
}

function princ_changeValueComp(vComp, vValor) {
    if (vComp != null && vValor != null && vValor != undefined) {
        if (vComp.indexOf(":") != -1) {
            var param = vComp.split(":");
            var form = document.getElementById(param[0]);

            for (var i = 0; i < form.elements.length; i++) {
                if (form.elements[i].id == param[1]) {
                    form.elements[i].value = vValor;
                }
            }
        } else {
            document.getElementById(vComp).value = vValor;
        }
    } else {
        console.log("Component " + vComp + " not foud or value " + vValor + " inálido");
    }
}

function princ_isShow(vComp) {
    var fRetorno = false;
    var fComp = "#" + vComp;
    if ($(fComp).is(':visible')) {
        fRetorno = true;
    }
    return fRetorno;
}

function princ_focus(vComp) {
    document.getElementById(vComp).focus();
}

function princ_extraiScript(texto) {
    var ini = 0;
    while (ini != -1) {
        ini = texto.indexOf('<script', ini);
        if (ini >= 0) {
            ini = texto.indexOf('>', ini) + 1;
            var fim = texto.indexOf('</script>', ini);
            codigo = texto.substring(ini, fim);
            novo = document.createElement("script");
            novo.text = codigo;
            document.body.appendChild(novo);
        }
    }
}

function princ_openAjax() {
    var ajax;
    try {
        ajax = new XMLHttpRequest(); // XMLHttpRequest para Firefox, Safari, dentre outros.
    } catch (ee) {
        try {
            ajax = new ActiveXObject("Msxml2.XMLHTTP"); // Para o Internet Explorer
        } catch (e) {
            try {
                ajax = new ActiveXObject("Microsoft.XMLHTTP"); // Para o Internet Explorer
            } catch (E) {
                ajax = false;
            }
        }
    }
    return ajax;
}

function princ_excAjax(vComp, vUrl) {
    var vRenderiza = document.getElementById(vComp);
    var ajax = princ_openAjax(); // Inicia o Ajax.
    ajax.open("GET", vUrl, true);
    ajax.onreadystatechange = function() {
        if (ajax.readyState == 1) // Quando estiver carregando, exibe: carregando...
        {
            vRenderiza.innerHTML = "Atualizando...";
        }
        if (ajax.readyState == 4) // Quando estiver tudo pronto.
        {
            if (ajax.status == 200) {
                var resultado = ajax.responseText;
                vRenderiza.innerHTML = resultado;
                var para = vUrl.split("?");
                if (para.length >= 2) {
                    parameters = [];
                    var val = para[1].split("&");
                    for (var i = 0; i < val.length; i++) {
                        parameters.push(JSON.parse('{"pa":"' + val[i].split("=")[0] + '","val":"' + val[i].split("=")[1] + '"}'));
                    }
                }
                princ_extraiScript(resultado);
            } else {
                vRenderiza.innerHTML = "Erro Ajax";
            }
        }
    };
    ajax.send(null); // submete
}

function princ_excAjaxJson(vUrl, funcao) {
    var ajax = princ_openAjax(); // Inicia o Ajax.
    ajax.open("GET", vUrl, true);
    ajax.onreadystatechange = function() {
        if (ajax.readyState == 1) // Quando estiver carregando, exibe: carregando...
        {
            vRenderiza.innerHTML = "Carregando...";
        }
        if (ajax.readyState == 4) // Quando estiver tudo pronto.
        {
            if (ajax.status == 200) {
                funcao(JSON.parse(ajax.responseText));
            } else {
                console.log("erro");
            }
        }
    };
    ajax.send(null); // submete
}

function princ_excAjaxJsonTipo(vUrl, funcao, tipo) {
    princ_exibirComp("loading", true);
    var ajax = princ_openAjax(); // Inicia o Ajax.
    ajax.open(tipo, vUrl, true);
    ajax.onreadystatechange = function() {
        if (ajax.readyState == 1) // Quando estiver carregando, exibe: carregando...
        {
            vRenderiza.innerHTML = "Carregando...";
        }
        if (ajax.readyState == 4) // Quando estiver tudo pronto.
        {
            if (ajax.status == 200) {
                funcao(JSON.parse(ajax.responseText));
                princ_exibirComp("loading", false);
            } else {
                console.log("erro " + ajax.status);
                princ_exibirComp("loading", false);
            }
        }
    };
    ajax.send(null); // submete
}

function princ_getValueComp(vComp) {
    try {
        if (vComp.indexOf(":") != -1) {
            var param = vComp.split(":");
            var form = document.getElementById(param[0]);
            for (var i = 0; i < form.elements.length; i++) {
                if (form.elements[i].id == param[1]) {
                    return form.elements[i].value;
                }
            }
        } else {
            return document.getElementById(vComp).value;
        }
    } catch (e) {
        console.log("Component not found --> " + vComp);
        console.log(e);
    }
}

function princ_disabledComp(vComp, vVerifica) {
    if (vVerifica) {
        document.getElementById(vComp).disabled = true;
    } else {
        document.getElementById(vComp).disabled = false;
    }
}

function princ_confirma(vMsg){
    bootbox.confirm(vMsg, function(result) {
        return result;
    });
}

function princ_openPopUp(vUrl, vWidth, vHeight) {
    window.open(vUrl, "mywindow", "menubar=1,resizable=1,width=" + vWidth + ",height=" + vHeight);
}

function princ_getIpURL(vUrl) {
    var fUrl = String(vUrl);
    var fPosicaoIni = fUrl.indexOf("//");
    fUrl = fUrl.substring((fPosicaoIni + 2), fUrl.length);
    var fPosicaoFim = fUrl.indexOf(":");
    var fIp = fUrl.substring(0, fPosicaoFim);
    return fIp;
}

function princ_obterParametroUrl(param) {
    var url = String(location.href).split("?");
    var params = url[1].split("&");
    for (var i = 0; i < params.length; i++) {
        var paramActual = params[i].split("=");
        if (paramActual[0] == param) {
            return paramActual[1];
        }
    }
}

function princ_format_date(vData, vTipo) {
    var fData = "";
    if (vData != null) {
        var data = new Date(vData);
        var dia = data.getDate();
        if (dia.toString().length == 1)
            dia = "0" + dia;
        var mes = data.getMonth() + 1;
        if (mes.toString().length == 1)
            mes = "0" + mes;
        var ano = data.getFullYear();
        //tempo
        if (vTipo == null || vTipo == 1) {
            var hora = data.getHours();
            var minutos = data.getMinutes();
            if (minutos < 10) {
                minutos = "0" + minutos;
            }
            var segunds = data.getSeconds();
            if (segunds < 10) {
                segunds = "0" + segunds;
            }
            return dia + "/" + mes + "/" + ano + " " + hora + ":" + minutos + ":" + segunds;
        } else if (vTipo == 2) {
            return dia + "/" + mes + "/" + ano;
        } else if (vTipo == 3) {
            var hora = data.getHours();
            var minutos = data.getMinutes();
            if (minutos < 10) {
                minutos = "0" + minutos;
            }
            var segunds = data.getSeconds();
            if (segunds < 10) {
                segunds = "0" + segunds;
            }
            return hora + ":" + minutos + ":" + segunds;
        }

    }

}

function princ_emptySelect(vComp) {
    document.getElementById(vComp).options.length = 1;
}

function princ_execAjaxJquery(vUrl) {
    var fRetorno = false;
    $.ajax({
        type: "POST",
        url: vUrl,
        dataType: "json",
        success: function(json) {
            fRetorno = true;
        }
    });
    return fRetorno;
}

function princ_emptyTable(vComp) {
    $("#" + vComp + " tbody tr").remove();
}

function princ_emptyDiv(vComp) {
    document.getElementById(vComp).innerHTML = "";
}

function princ_loadJS(url) {
    var scriptTag = document.createElement('script');
    scriptTag.src = url;
    document.body.appendChild(scriptTag);
}

function princ_loadSelect(comp, data) {
    if (data.length > 0) {
        for (var i = 0; i < data.length; i++) {
            console.log(data[i].guiche);
            var x = document.getElementById("checkin.fkguiche");
            var c = document.createElement("option");
            c.text = data[i].guiche;
            c.value = data[i].pkguiche;
            x.options.add(c, x.options.length + 1);

        }
    } else {
        console.log("limpar grade");
    }
}

function princ_saveForm(comp, func) {
    $('#' + comp).submit(function(event) {
        princ_exibirComp("loading", true);
        $.ajax({
                type: 'POST', // define the type of HTTP verb we want to use (POST for our form)
                url: this.action, // the url where we want to POST
                data: $("#" + this.id).serialize() + "&to=" + sessionStorage.getItem("to"),
                dataType: 'json', // what type of data do we expect back from the server
                encode: true
            })
            .done(function(data) {
                func(data);
                princ_exibirComp("loading", false);
            })
            .fail(function(data) {
                func(data);

            });
        princ_exibirComp("loading", false);
        event.preventDefault();
    });
}

function princ_emptyForm(form) {
    var form = document.getElementById(form);
    for (var i = 0; i < form.elements.length; i++) {
        if (form.elements[i].tagName == 'INPUT' || form.elements[i].tagName == 'SELECT') {
            form.elements[i].value = "";
        }
    }
}

function princ_onlyReadForm(form, check) {
    var form = document.getElementById(form);
    for (var i = 0; i < form.elements.length; i++) {
        if (form.elements[i].tagName == 'INPUT' || form.elements[i].tagName == 'SELECT') {
            if (check) {
                form.elements[i].disabled = true;
            } else {
                form.elements[i].disabled = false;
            }

        }
    }
}

function princ_checkForm(form) {
    var form = document.getElementById(form);
    for (var i = 0; i < form.elements.length; i++) {
        if (form.elements[i].required && form.elements[i].value == "") {
            console.log(form.elements[i].value);
            form.elements[i].focus();
            msg('warning', ' Existe campo Obrigatório');
            return false;
        }
    }
    return true;
}

function princ_addEvent(comp, ev, func) {
    if (comp != null || ev != null || func != null) {
        try {
            document.getElementById(comp).addEventListener(ev, func);
        } catch (e) {
            console.log("Problema para add no componente " + comp);
            console.log(e);
        }
    }
}

function princ_change_title(title) {
    document.title = title;
    princ_insertHTML("lbTitleForm", title);
}

function princ_toTab(tab) {
    $('.nav-tabs a[href="#' + tab + '"]').tab('show');
}

function princ_insertHTML(comp, valor) {
    document.getElementById(comp).innerHTML = valor;
}

function princ_appendHTML(comp, valor) {
    $("#" + comp).append(valor);
}

function getDayWeek(day) {
    return ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"][day]
}

function princ_json_to_str(data) {
    if (data != null) {
        return JSON.stringify(data);
    } else {
        console.log('json is null');
    }
}

function princ_str_to_json(str) {
    if (str != null) {
        return JSON.parse(str);
    } else {
        console.log('String is null');
    }

}

function princ_leftZero(value, qnt) {
    var qntActual = value.length;
    if (qnt > qntActual) {
        var zeros = "";
        for (var i = 0; i < (qnt - qntActual); i++) {
            zeros = zeros + "0";
        }
        return zeros + value;
    }
}

function princ_age(birthday) {
    var ageDifMs = Date.now() - new Date(birthday).getTime();
    var ageDate = new Date(ageDifMs);
    return Math.abs(ageDate.getUTCFullYear() - 1970);
}

function princ_substring(text, qnt) {
  if(text!=null && qnt != null && parseInt(qnt) > 0){
    return text.substring(0, qnt) + "...";
  }
    return "";
}

function addSessionStorage(item, valor){
    sessionStorage.setItem(item, valor);
}

function getSessionStorage(item){
    sessionStorage.getItem(item);
}

function removeAllSessionStorage(){
    sessionStorage.clear();
}
<|endoftext|>


<commit_before>/*global module:false*/

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),

    watch: {
      src: {
          files: [ 'scripts/*.js' ],
          tasks: [ 'jshint' ]
      },
      tests: {
          files: [ 'test/*.js' ],
          tasks: [ 'jshint', 'mochaTest' ]
      },
      options: {
        spawn: false,
      },
    },
    jsonlint: {
      source: {
        src: [ 'package.json' ]
      },
      node: {
        src: [ 'node/timezones.json' ]
      },
    },
    jshint: {
      source: {
        src: [ 'scripts/*.js' ],
      },
      tests: {
        src: [ 'test/**/*.js', 'qunit-tests/**/test*.js' ],
      },
      node: {
        src: [ 'node/**/*.js' ],
      },
      grunt: {
        src: [ 'GruntFile.js' ],
      },
      options: {
        curly: true,        // Always put curly braces around blocks in loops and conditionals.
        eqeqeq: true,       // prohibits the use of == and != in favor of === and !==
        immed: true,        // Prohibits the use of immediate function invocations without wrapping them in parentheses
        latedef: true,      // Prohibits the use of a variable before it was defined.
        newcap: true,       // Capitalize names of constructor functions
        noarg: true,        // Prohibits the use of arguments.caller and arguments.callee
        sub: true,          // Suppresses warnings about using [] notation when it can be expressed in dot notation: person['name'] vs. person.name.
        undef: true,        // Prohibits the use of explicitly undeclared variables
        boss: false,        // Suppresses warnings about the use of assignments in cases where comparisons are expected
        eqnull: true,       // Suppresses warnings about == null comparisons.
        browser: true,      // Defines globals exposed by modern browsers (but not alert and console)
        node: true,         // Defines globals available when your code is running inside of the Node runtime environment
        globals: {
        }
      }
    },
    mochaTest: {
      tests: {
        options: {
          require: 'should'
        },
        src: [ 'test/*.js' ]
      }
    },
    qunit: {
      all: [ 'qunit-tests/*.html' ]
    },
    version: {
      minor: {
        options: {
          prefix: '[^\\-\\w]version[\'"]?\\s*[,:=]\\s*[\'"]?',
          release: 'minor'
        },
        src: [ 'package.json',
               'scripts/*.css',
               'scripts/*.js',
               'qunit-tests/*.html',
               'qunit-tests/*.js',
               'node/*.js',
               'test/*.js',
               'examples/*.html'
             ]
      }
    }
  });

  // Load tasks
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-mocha-test');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-version');
  grunt.loadNpmTasks('grunt-jsonlint');

  // Default task.
  grunt.registerTask('default', [ 'jsonlint', 'jshint', 'mochaTest', 'qunit' ]);
  grunt.registerTask('jshint-job', [ 'jshint' ]);
  grunt.registerTask('qunit-job', [ 'jshint', 'qunit' ]);
  grunt.registerTask('build', [ 'jsonlint', 'jshint', 'mochaTest', 'qunit', 'version' ]);
};
<commit_msg>Update version regex to exclude function parameters<commit_after>/*global module:false*/

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),

    watch: {
      src: {
          files: [ 'scripts/*.js' ],
          tasks: [ 'jshint' ]
      },
      tests: {
          files: [ 'test/*.js' ],
          tasks: [ 'jshint', 'mochaTest' ]
      },
      options: {
        spawn: false,
      },
    },
    jsonlint: {
      source: {
        src: [ 'package.json' ]
      },
      node: {
        src: [ 'node/timezones.json' ]
      },
    },
    jshint: {
      source: {
        src: [ 'scripts/*.js' ],
      },
      tests: {
        src: [ 'test/**/*.js', 'qunit-tests/**/test*.js' ],
      },
      node: {
        src: [ 'node/**/*.js' ],
      },
      grunt: {
        src: [ 'GruntFile.js' ],
      },
      options: {
        curly: true,        // Always put curly braces around blocks in loops and conditionals.
        eqeqeq: true,       // prohibits the use of == and != in favor of === and !==
        immed: true,        // Prohibits the use of immediate function invocations without wrapping them in parentheses
        latedef: true,      // Prohibits the use of a variable before it was defined.
        newcap: true,       // Capitalize names of constructor functions
        noarg: true,        // Prohibits the use of arguments.caller and arguments.callee
        sub: true,          // Suppresses warnings about using [] notation when it can be expressed in dot notation: person['name'] vs. person.name.
        undef: true,        // Prohibits the use of explicitly undeclared variables
        boss: false,        // Suppresses warnings about the use of assignments in cases where comparisons are expected
        eqnull: true,       // Suppresses warnings about == null comparisons.
        browser: true,      // Defines globals exposed by modern browsers (but not alert and console)
        node: true,         // Defines globals available when your code is running inside of the Node runtime environment
        globals: {
        }
      }
    },
    mochaTest: {
      tests: {
        options: {
          require: 'should'
        },
        src: [ 'test/*.js' ]
      }
    },
    qunit: {
      all: [ 'qunit-tests/*.html' ]
    },
    version: {
      minor: {
        options: {
          prefix: '[^\\-\\w]version[\'"]?\\s*[:=]\\s*[\'"]?',
          release: 'minor'
        },
        src: [ 'package.json',
               'scripts/*.css',
               'scripts/*.js',
               'qunit-tests/*.html',
               'qunit-tests/*.js',
               'node/*.js',
               'test/*.js',
               'examples/*.html'
             ]
      }
    }
  });

  // Load tasks
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-mocha-test');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-version');
  grunt.loadNpmTasks('grunt-jsonlint');

  // Default task.
  grunt.registerTask('default', [ 'jsonlint', 'jshint', 'mochaTest', 'qunit' ]);
  grunt.registerTask('jshint-job', [ 'jshint' ]);
  grunt.registerTask('qunit-job', [ 'jshint', 'qunit' ]);
  grunt.registerTask('build', [ 'jsonlint', 'jshint', 'mochaTest', 'qunit', 'version' ]);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
  'use strict';

  // check task runtime
  require('time-grunt')(grunt);

  // load generic configs
  var configs = require('dalek-build-tools');

  // project config
  grunt.initConfig({

    // load module meta data
    pkg: grunt.file.readJSON('package.json'),

    // define a src set of files for other tasks
    src: {
      lint: ['Gruntfile.js', 'lib/**/*.js', 'test/*.js'],
      complexity: ['lib/**/*.js'],
      test: ['test/*TEST.js'],
      src: ['lib/dalek.js']
    },

    // clean automatically generated helper files & docs
    clean: configs.clean,

    // speed up build by defining concurrent tasks
    concurrent: configs.concurrent,

    // linting
    jshint: configs.jshint,

    // testing
    mochaTest: configs.mocha,

    // code metrics
    complexity: configs.complexity,
    plato: configs.plato(grunt.file.readJSON('.jshintrc')),

    // api docs
    yuidoc: configs.yuidocs(),

    // up version, tag & commit
    bump: configs.bump({
      pushTo: 'git@github.com:dalekjs/dalek.git',
      files: ['package.json', 'CONTRIBUTORS.md', 'CHANGELOG.md']
    }),

    // generate contributors file
    contributors: configs.contributors,

    // compress artifacts
    compress: configs.compress,

    // prepare files for grunt-plato to
    // avoid error messages (weird issue...)
    preparePlato: {
      options: {
        folders: [
          'coverage',
          'report',
          'report/coverage',
          'report/complexity',
          'report/complexity/files',
          'report/complexity/files/_js',
          'report/complexity/files/_actions_js',
          'report/complexity/files/_assertions_js',
          'report/complexity/files/_reporter_js',
          'report/complexity/files/_config_js',
          'report/complexity/files/_driver_js',
          'report/complexity/files/_unit_js',
          'report/complexity/files/_suite_js',
          'report/complexity/files/_timer_js',
        ],
        files: [
          'report.history.json',
          'files/_js/report.history.json',
          'files/_actions_js/report.history.json',
          'files/_assertions_js/report.history.json',
          'files/_reporter_js/report.history.json',
          'files/_config_js/report.history.json',
          'files/_driver_js/report.history.json',
          'files/_unit_js/report.history.json',
          'files/_suite_js/report.history.json',
          'files/_timer_js/report.history.json',
        ]
      }
    },

    // prepare files & folders for coverage
    prepareCoverage: {
      options: {
        folders: ['coverage', 'report', 'report/coverage'],
        pattern: '[require("fs").realpathSync(__dirname + "/../lib/dalek.js"), require("fs").realpathSync(__dirname + "/../lib/dalek/")]'
      }
    },

    // add current timestamp to the html document
    includereplace: {
      dist: {
        options: {
          globals: {
            timestamp: '<%= grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss TT") %>'
          },
        },
        src: 'report/docs/*.html',
        dest: '.'
      }
    },

    // user docs
    documantix: {
      options: {
        header: 'dalekjs/dalekjs.com/master/assets/header.html',
        footer: 'dalekjs/dalekjs.com/master/assets/footer.html',
        target: 'report/docs'
      },

      // actions
      actions: {
        src: ['lib/dalek/actions.js'],
        options: {
          vars: {
            title: 'DalekJS - Documentation - Actions',
            desc: 'DalekJS - Documentation - Actions',
            docs: true
          }
        }
      },

      // assertions
      assertions: {
        src: ['lib/dalek/assertions.js'],
        options: {
          vars: {
            title: 'DalekJS - Documentation - Actions',
            desc: 'DalekJS - Documentation - Actions',
            docs: true
          }
        }
      },

      // config
      config: {
        src: ['lib/dalek/config.js'],
        options: {
          vars: {
            title: 'DalekJS - Documentation - Config',
            desc: 'DalekJS - Documentation - Config',
            docs: true
          }
        }
      },

    },

    // archive docs
    archive: {
      options: {
        files: ['config.html', 'actions.html', 'assertions.html']
      }
    },

    // release canary version
    'release-canary': {
      options: {
        files: []
      }
    }

  });

  // load 3rd party tasks
  require('load-grunt-tasks')(grunt);
  grunt.loadTasks('./node_modules/dalek-build-tools/tasks');
  grunt.loadNpmTasks('grunt-documantix');

  // define runner tasks
  grunt.registerTask('lint', 'jshint');

  // split test & docs for speed
  grunt.registerTask('test', ['clean:coverage', 'prepareCoverage', 'concurrent:test', 'generateCoverageBadge']);
  grunt.registerTask('docs', ['clean:reportZip', 'clean:report', 'preparePlato', 'concurrent:docs', 'documantix', 'includereplace', 'compress']);

  // release tasks
  grunt.registerTask('releasePatch', ['test', 'bump-only:patch', 'contributors', 'changelog', 'bump-commit']);
  grunt.registerTask('releaseMinor', ['test', 'bump-only:minor', 'contributors', 'changelog', 'bump-commit']);
  grunt.registerTask('releaseMajor', ['test', 'bump-only:major', 'contributors', 'changelog', 'bump-commit']);

  // clean, test, generate docs (the CI task)
  grunt.registerTask('all', ['clean', 'test', 'docs']);

};
<commit_msg>fix(build): fix build process<commit_after>module.exports = function(grunt) {
  'use strict';

  // check task runtime
  require('time-grunt')(grunt);

  // load generic configs
  var configs = require('dalek-build-tools');

  // project config
  grunt.initConfig({

    // load module meta data
    pkg: grunt.file.readJSON('package.json'),

    // define a src set of files for other tasks
    src: {
      lint: ['Gruntfile.js', 'lib/**/*.js', 'test/*.js'],
      complexity: ['lib/**/*.js'],
      test: ['test/*TEST.js'],
      src: ['lib/dalek.js']
    },

    // clean automatically generated helper files & docs
    clean: configs.clean,

    // speed up build by defining concurrent tasks
    concurrent: configs.concurrent,

    // linting
    jshint: configs.jshint,

    // testing
    mochaTest: configs.mocha,

    // code metrics
    complexity: configs.complexity,
    plato: configs.plato(grunt.file.readJSON('.jshintrc')),

    // api docs
    yuidoc: configs.yuidocs(),

    // up version, tag & commit
    bump: configs.bump({
      pushTo: 'git@github.com:dalekjs/dalek.git',
      files: ['package.json', 'CONTRIBUTORS.md', 'CHANGELOG.md']
    }),

    // generate contributors file
    contributors: configs.contributors,

    // compress artifacts
    compress: configs.compress,

    // prepare files for grunt-plato to
    // avoid error messages (weird issue...)
    preparePlato: {
      options: {
        folders: [
          'coverage',
          'report',
          'report/coverage',
          'report/complexity',
          'report/complexity/files',
          'report/complexity/files/_js',
          'report/complexity/files/_actions_js',
          'report/complexity/files/_assertions_js',
          'report/complexity/files/_reporter_js',
          'report/complexity/files/_config_js',
          'report/complexity/files/_driver_js',
          'report/complexity/files/_unit_js',
          'report/complexity/files/_suite_js',
          'report/complexity/files/_timer_js',
        ],
        files: [
          'report.history.json',
          'files/_js/report.history.json',
          'files/_actions_js/report.history.json',
          'files/_assertions_js/report.history.json',
          'files/_reporter_js/report.history.json',
          'files/_config_js/report.history.json',
          'files/_driver_js/report.history.json',
          'files/_unit_js/report.history.json',
          'files/_suite_js/report.history.json',
          'files/_timer_js/report.history.json',
        ]
      }
    },

    // prepare files & folders for coverage
    prepareCoverage: {
      options: {
        folders: ['coverage', 'report', 'report/coverage'],
        pattern: '[require("fs").realpathSync(__dirname + "/../lib/dalek.js"), require("fs").realpathSync(__dirname + "/../lib/dalek/")]'
      }
    },

    // add current timestamp to the html document
    includereplace: {
      dist: {
        options: {
          globals: {
            timestamp: '<%= grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss TT") %>'
          },
        },
        src: 'report/docs/*.html',
        dest: './'
      }
    },

    // user docs
    documantix: {
      options: {
        header: 'dalekjs/dalekjs.com/master/assets/header.html',
        footer: 'dalekjs/dalekjs.com/master/assets/footer.html',
        target: 'report/docs'
      },

      // actions
      actions: {
        src: ['lib/dalek/actions.js'],
        options: {
          vars: {
            title: 'DalekJS - Documentation - Actions',
            desc: 'DalekJS - Documentation - Actions',
            docs: true
          }
        }
      },

      // assertions
      assertions: {
        src: ['lib/dalek/assertions.js'],
        options: {
          vars: {
            title: 'DalekJS - Documentation - Actions',
            desc: 'DalekJS - Documentation - Actions',
            docs: true
          }
        }
      },

      // config
      config: {
        src: ['lib/dalek/config.js'],
        options: {
          vars: {
            title: 'DalekJS - Documentation - Config',
            desc: 'DalekJS - Documentation - Config',
            docs: true
          }
        }
      },

    },

    // archive docs
    archive: {
      options: {
        files: ['config.html', 'actions.html', 'assertions.html']
      }
    },

    // release canary version
    'release-canary': {
      options: {
        files: []
      }
    }

  });

  // load 3rd party tasks
  require('load-grunt-tasks')(grunt);
  grunt.loadTasks('./node_modules/dalek-build-tools/tasks');
  grunt.loadNpmTasks('grunt-documantix');

  // define runner tasks
  grunt.registerTask('lint', 'jshint');

  // split test & docs for speed
  grunt.registerTask('test', ['clean:coverage', 'prepareCoverage', 'concurrent:test', 'generateCoverageBadge']);
  grunt.registerTask('docs', ['clean:reportZip', 'clean:report', 'preparePlato', 'concurrent:docs', 'documantix', 'includereplace', 'compress']);

  // release tasks
  grunt.registerTask('releasePatch', ['test', 'bump-only:patch', 'contributors', 'changelog', 'bump-commit']);
  grunt.registerTask('releaseMinor', ['test', 'bump-only:minor', 'contributors', 'changelog', 'bump-commit']);
  grunt.registerTask('releaseMajor', ['test', 'bump-only:major', 'contributors', 'changelog', 'bump-commit']);

  // clean, test, generate docs (the CI task)
  grunt.registerTask('all', ['clean', 'test', 'docs']);

};
<|endoftext|>


<commit_before>module.exports = function ( grunt ) {

	grunt.initConfig({

		pkg: grunt.file.readJSON('package.json'),

		meta: {
			banner: '/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.description %> | Author: <%= pkg.author %>, <%= grunt.template.today("yyyy") %> | License: <%= pkg.license %> */\n'
		},

		concat: {
			dist: {
				options: {
					stripBanners: true,
					banner: '<%= meta.banner %>'
				},
				files: {
					'dist/<%= pkg.name %>.js': ['<%= pkg.main %>']
				}
			}
		},

		uglify: {
			dist: {
				options: {
					banner: '<%= meta.banner %>'
				},
				files: {
					'dist/<%= pkg.name %>.min.js': ['<%= pkg.main %>']
				}
			}
		},

		bump: {
			options: {
				files: ['package.json', 'bower.json'],
				updateConfigs: ['pkg'],
				commit: true,
				commitMessage: 'Release %VERSION%',
				commitFiles: ['-a'],
				createTag: true,
				tagName: '%VERSION%',
				tagMessage: '',
				push: false
			}
		},

		jscs: {
			main: {
				options: {
					config: '.jscsrc'
				},
				files: {
					src: [
						'<%= pkg.main %>',
						'lib/**/*.js'
					]
				}
			}
		},

		jshint: {
			main: {
				options: {
					jshintrc: '.jshintrc'
				},
				src: [
					'<%= pkg.main %>',
					'lib/**/*.js'
				]
			}
		},

		browserify: {
			options: {
				browserifyOptions: {
					standalone: 'kist.querypoint'
				}
			},
			standalone: {
				options: {
					plugin: ['bundle-collapser/plugin']
				},
				files: {
					'compiled/<%= pkg.main %>': ['<%= pkg.main %>']
				}
			}
		},

		connect: {
			test:{
				options: {
					open: true
				}
			}
		},

		'compile-handlebars': {
			test: {
				templateData: {
					bower: '../../../bower_components',
					compiled: '../../../compiled',
					assets: 'assets',
					main: '<%= pkg.main %>'
				},
				partials: 'test/manual/templates/partials/**/*.hbs',
				template: 'test/manual/templates/*.hbs',
				output: 'compiled/test/manual/*.html'
			}
		},

		copy: {
			test: {}
		},

		concurrent: {
			options: {
				logConcurrentOutput: true
			},
			test: ['watch','connect:test:keepalive']
		},

		watch: {
			options: {
				spawn: false
			},
			hbs: {
				files: 'test/manual/**/*.hbs',
				tasks: ['compile-handlebars:test']
			},
			browserify: {
				files: ['<%= pkg.main %>', 'lib/**/*.js'],
				tasks: ['browserify:standalone']
			}
		},

	});

	require('load-grunt-tasks')(grunt);

	grunt.registerTask('test', function () {
		var tasks = ['compile-handlebars:test','copy:test','browserify:standalone'];
		if ( grunt.option('watch') ) {
			tasks.push('concurrent:test');
		}
		grunt.task.run(tasks);
	});

	grunt.registerTask('stylecheck', ['jshint:main', 'jscs:main']);
	grunt.registerTask('default', ['stylecheck', 'browserify:standalone', 'concat', 'uglify']);
	grunt.registerTask('releasePatch', ['bump-only:patch', 'default', 'bump-commit']);
	grunt.registerTask('releaseMinor', ['bump-only:minor', 'default', 'bump-commit']);
	grunt.registerTask('releaseMajor', ['bump-only:major', 'default', 'bump-commit']);

};
<commit_msg>Update build process<commit_after>module.exports = function ( grunt ) {

	grunt.initConfig({

		pkg: grunt.file.readJSON('package.json'),

		meta: {
			banner: '/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.description %> | Author: <%= pkg.author %>, <%= grunt.template.today("yyyy") %> | License: <%= pkg.license %> */\n'
		},

		concat: {
			dist: {
				options: {
					stripBanners: true,
					banner: '<%= meta.banner %>'
				},
				files: {
					'dist/<%= pkg.name %>.js': ['compiled/<%= pkg.main %>']
				}
			}
		},

		uglify: {
			dist: {
				options: {
					banner: '<%= meta.banner %>'
				},
				files: {
					'dist/<%= pkg.name %>.min.js': ['compiled/<%= pkg.main %>']
				}
			}
		},

		bump: {
			options: {
				files: ['package.json', 'bower.json'],
				updateConfigs: ['pkg'],
				commit: true,
				commitMessage: 'Release %VERSION%',
				commitFiles: ['-a'],
				createTag: true,
				tagName: '%VERSION%',
				tagMessage: '',
				push: false
			}
		},

		jscs: {
			main: {
				options: {
					config: '.jscsrc'
				},
				files: {
					src: [
						'<%= pkg.main %>',
						'lib/**/*.js'
					]
				}
			}
		},

		jshint: {
			main: {
				options: {
					jshintrc: '.jshintrc'
				},
				src: [
					'<%= pkg.main %>',
					'lib/**/*.js'
				]
			}
		},

		browserify: {
			options: {
				browserifyOptions: {
					standalone: 'kist.querypoint'
				}
			},
			standalone: {
				options: {
					plugin: ['bundle-collapser/plugin']
				},
				files: {
					'compiled/<%= pkg.main %>': ['<%= pkg.main %>']
				}
			}
		},

		connect: {
			test:{
				options: {
					open: true
				}
			}
		},

		'compile-handlebars': {
			test: {
				templateData: {
					bower: '../../../bower_components',
					compiled: '../../../compiled',
					assets: 'assets',
					main: '<%= pkg.main %>'
				},
				partials: 'test/manual/templates/partials/**/*.hbs',
				template: 'test/manual/templates/*.hbs',
				output: 'compiled/test/manual/*.html'
			}
		},

		copy: {
			test: {}
		},

		concurrent: {
			options: {
				logConcurrentOutput: true
			},
			test: ['watch','connect:test:keepalive']
		},

		watch: {
			options: {
				spawn: false
			},
			hbs: {
				files: 'test/manual/**/*.hbs',
				tasks: ['compile-handlebars:test']
			},
			browserify: {
				files: ['<%= pkg.main %>', 'lib/**/*.js'],
				tasks: ['browserify:standalone']
			}
		}

	});

	require('load-grunt-tasks')(grunt);

	grunt.registerTask('test', function () {
		var tasks = ['compile-handlebars:test','copy:test','browserify:standalone'];
		if ( grunt.option('watch') ) {
			tasks.push('concurrent:test');
		}
		grunt.task.run(tasks);
	});

	grunt.registerTask('stylecheck', ['jshint:main', 'jscs:main']);
	grunt.registerTask('default', ['stylecheck', 'browserify:standalone', 'concat', 'uglify']);
	grunt.registerTask('releasePatch', ['bump-only:patch', 'default', 'bump-commit']);
	grunt.registerTask('releaseMinor', ['bump-only:minor', 'default', 'bump-commit']);
	grunt.registerTask('releaseMajor', ['bump-only:major', 'default', 'bump-commit']);

};
<|endoftext|>


<commit_before>'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
};

module.exports = function (grunt) {
    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var yeomanConfig = {
        name: 'gpub',
        src: 'src',
        dist: 'dist',
        example:'example'
    };

    try {
        yeomanConfig.src = require('./component.json').appPath || yeomanConfig.src;
    } catch (e) {}

    grunt.initConfig({
        yeoman: yeomanConfig,
        livereload:{
            port: 35723
        },
        watch: {
            livereload: {
                files: [
                    '<%= yeoman.src %>/{,*/}*.html',
                    '{.tmp,<%= yeoman.src %>}/styles/{,*/}*.css',
                    '{.tmp,<%= yeoman.src %>}/scripts/{,*/}*.js',
                    '<%= yeoman.src %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ],
                tasks: ['livereload']
            }
        },
        connect: {
            options: {
                port: 9100,
                // Change this to '0.0.0.0' to access the server from outside.
                hostname: 'localhost'
            },
            livereload: {
                options: {
                    middleware: function (connect) {
                        return [
                            lrSnippet,
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, yeomanConfig.src)
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            },
            dev:{
                options: {}
            }
        },
        open: {
            server: {
                url: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= yeoman.src %>/{,*/}*.js'
            ]
        },
        karma: {
            options: {
                configFile: 'karma.conf.js',
                runnerPort: 9999,
                browsers: ['Chrome', 'Firefox']
            },
            unit: {
                reporters: 'dots'
            },
            continuous: {
                singleRun: true,
                browsers: ['PhantomJS']
            },
            ci: {
                singleRun: true,
                browsers: ['PhantomJS']
            }
        },
        concat: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/<%= yeoman.name %>.js': [
                        '.tmp/{,*/}*.js',
                        '<%= yeoman.src %>/{,*/}*.js'
                    ]
                }
            }
        },
        uglify: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/<%= yeoman.name %>.min.js': [
                        '<%= yeoman.dist %>/<%= yeoman.name %>.js'
                    ]
                }
            }
        },
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.src %>',
                    dest: '<%= yeoman.dist %>',
                    src: []
                }]
            }
        }
    });

    grunt.renameTask('regarde', 'watch');

    grunt.registerTask('server', [
        'clean:server',
        'livereload-start',
        'connect:livereload',
        'open',
        'watch'
    ]);

    grunt.registerTask('test', [
        'clean:server',
        'connect:test',
        'karma:ci'
    ]);

    grunt.registerTask('build', [
        'clean:dist',
        'jshint',
        'test',
        'concat',
        'copy',
        'uglify',
    ]);

    grunt.registerTask('default', ['build']);
};
<commit_msg>Gruntfile: Run server and show example.<commit_after>'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
};

module.exports = function (grunt) {
    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var config = {
        name: 'gpub',
        src: 'src',
        dist: 'dist',
        libs: 'libs',
        example:'examples'
    };

    try {
        config.src = require('./component.json').appPath || config.src;
    } catch (e) {}

    grunt.initConfig({
        config: config,
        livereload:{
            port: 35723
        },
        watch: {
            livereload: {
                files: [
                    '<%= config.example %>/*.html',
                    '<%= config.example %>/*.js',
                    '{.tmp,<%= config.src %>}/*.js'
                ],
                tasks: ['livereload']
            }
        },
        connect: {
            options: {
                port: 9100,
                // Change this to '0.0.0.0' to access the server from outside.
                hostname: 'localhost'
            },
            livereload: {
                options: {
                    middleware: function (connect) {
                        return [
                            lrSnippet,
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, config.src),
                            mountFolder(connect, config.libs),
                            mountFolder(connect, config.example)
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            },
            dev:{
                options: {}
            }
        },
        open: {
            server: {
                url: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= config.dist %>/*',
                        '!<%= config.dist %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= config.src %>/{,*/}*.js'
            ]
        },
        karma: {
            options: {
                configFile: 'karma.conf.js',
                runnerPort: 9999,
                browsers: ['Chrome', 'Firefox']
            },
            unit: {
                reporters: 'dots'
            },
            continuous: {
                singleRun: true,
                browsers: ['PhantomJS']
            },
            ci: {
                singleRun: true,
                browsers: ['PhantomJS']
            }
        },
        concat: {
            dist: {
                files: {
                    '<%= config.dist %>/<%= config.name %>.js': [
                        '.tmp/{,*/}*.js',
                        '<%= config.src %>/{,*/}*.js'
                    ]
                }
            }
        },
        uglify: {
            dist: {
                files: {
                    '<%= config.dist %>/<%= config.name %>.min.js': [
                        '<%= config.dist %>/<%= config.name %>.js'
                    ]
                }
            }
        },
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= config.src %>',
                    dest: '<%= config.dist %>',
                    src: []
                }]
            }
        }
    });

    grunt.renameTask('regarde', 'watch');

    grunt.registerTask('server', [
        'clean:server',
        'livereload-start',
        'connect:livereload',
        'open',
        'watch'
    ]);

    grunt.registerTask('test', [
        'clean:server',
        'connect:test',
        'karma:ci'
    ]);

    grunt.registerTask('build', [
        'clean:dist',
        'jshint',
        'test',
        'concat',
        'copy',
        'uglify',
    ]);

    grunt.registerTask('default', ['build']);
};
<|endoftext|>


<commit_before>'use strict';

/* globals module */
var out_app_engine_dir = 'out/app_engine';
var app_engine_path = 'temp/google-cloud-sdk/platform/google_appengine'

module.exports = function(grunt) {
  // configure project
  grunt.initConfig({
    // make node configurations available
    pkg: grunt.file.readJSON('package.json'),

    csslint: {
      options: {
        csslintrc: 'build/.csslintrc'
      },
      strict: {
        options: {
          import: 2
        },
        src: ['src/**/*.css'
        ]
      },
      lax: {
        options: {
          import: false
        },
        src: ['src/**/*.css'
        ]
      }
    },

    htmlhint: {
      html1: {
        src: [
          'src/**/*_template.html'
        ]
      }
    },

    eslint: {
      options: {
        configFile: 'build/.eslintrc'
      },
      target: ['src/**/*.js', '!src/**/enums.js', '!src/**/adapter.js' ]
    },

    shell: {
      pipInstall : {
        command: 'pip install --user --requirement requirements.txt'
      },
      ensureGcloudSDKIsInstalled: {
        command: 'python build/ensure_gcloud_sdk_is_installed.py'
      },
      runPythonTests: {
        command: ['python', 'build/run_python_tests.py',
                  app_engine_path, out_app_engine_dir].join(' ')
      },
      buildAppEnginePackage: {
        command: ['python', './build/build_app_engine_package.py', 'src',
                  out_app_engine_dir].join(' ')
      },
      buildAppEnginePackageWithTests: {
        command: ['python', './build/build_app_engine_package.py', 'src',
                  out_app_engine_dir, '--include-tests'].join(' ')
      },
      removePythonTestsFromOutAppEngineDir: {
        command: ['python', './build/remove_python_tests.py',
                  out_app_engine_dir].join(' ')
      },
      genJsEnums: {
        command: ['python', './build/gen_js_enums.py', 'src',
                  'src/web_app/js'].join(' ')
      },
      runUnitTests: {
        command: 'bash ./build/start-tests.sh'
      }
    },

    'grunt-chrome-build' : {
      apprtc: {
        options: {
          buildDir: 'out/chrome_app',
          zipFile: 'out/chrome_app/apprtc.zip',
          // If values for chromeBinary and keyFile are not provided, the packaging
          // step will be skipped.
          // chromeBinary should be set to the Chrome executable on your system.
          chromeBinary: null,
          // keyFile should be set to the key you want to use to create the crx package
          keyFile: null,
          appwindowHtmlSrc: 'src/web_app/html/index_template.html',
          appwindowHtmlDest: 'out/chrome_app/appwindow.html'
        },
        files: [
          {
            expand: true,
            cwd: 'src/web_app/chrome_app',
            src: [
              'manifest.json'
            ],
            dest: 'out/chrome_app/'
          },
          {
            expand: true,
            cwd: out_app_engine_dir,
            src: [
              '**/*.js',
              '**/*.css',
              '**/images/apprtc*.png',
              '!**/*.pem'
            ],
            dest: 'out/chrome_app/'
          },
          {
            expand: true,
            cwd: 'src/web_app',
            src: [
              'js/background.js',
              'js/appwindow.js',
              '!**/*.pem'
            ],
            dest: 'out/chrome_app/'
          }
        ],
      }
    },

    closurecompiler: {
      debug: {
        files: {
          // Destination: [source files]
          'out/app_engine/js/apprtc.debug.js': [
            'node_modules/webrtc-adapter/out/adapter.js',
            'src/web_app/js/analytics.js',
            'src/web_app/js/enums.js',
            'src/web_app/js/adapter.js',
            'src/web_app/js/appcontroller.js',
            'src/web_app/js/call.js',
            'src/web_app/js/constants.js',
            'src/web_app/js/infobox.js',
            'src/web_app/js/peerconnectionclient.js',
            'src/web_app/js/remotewebsocket.js',
            'src/web_app/js/roomselection.js',
            'src/web_app/js/sdputils.js',
            'src/web_app/js/signalingchannel.js',
            'src/web_app/js/stats.js',
            'src/web_app/js/storage.js',
            'src/web_app/js/util.js',
            'src/web_app/js/windowport.js',
          ]
        },
        options: {
          'compilation_level': 'WHITESPACE_ONLY',
          'language_in': 'ECMASCRIPT5',
          'formatting': 'PRETTY_PRINT'
        },
      },
    },
    karma: {
      unit: {
        configFile: 'karma.conf.js'
      }
    }
  });

  // Enable plugins.
  grunt.loadNpmTasks('grunt-contrib-csslint');
  grunt.loadNpmTasks('grunt-htmlhint');
  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-closurecompiler-new-grunt');
  grunt.loadNpmTasks('grunt-eslint');
  grunt.loadTasks('build/grunt-chrome-build');

  // Set default tasks to run when grunt is called without parameters.
  grunt.registerTask('default', ['runLinting', 'runPythonTests', 'build',
                                 'runUnitTests']);
  grunt.registerTask('runLinting', ['csslint', 'htmlhint', 'eslint']);
  grunt.registerTask('runPythonTests', ['shell:pipInstall',
                                        'shell:ensureGcloudSDKIsInstalled',
                                        'shell:buildAppEnginePackageWithTests',
                                        'shell:runPythonTests',
                                        'shell:removePythonTestsFromOutAppEngineDir']);
  grunt.registerTask('runUnitTests', ['shell:runUnitTests']),
  grunt.registerTask('build', ['shell:buildAppEnginePackage', 'shell:genJsEnums', 'closurecompiler:debug', 'grunt-chrome-build']);
};
<commit_msg>remove 'src/web_app/js/adapter.js'<commit_after>'use strict';

/* globals module */
var out_app_engine_dir = 'out/app_engine';
var app_engine_path = 'temp/google-cloud-sdk/platform/google_appengine'

module.exports = function(grunt) {
  // configure project
  grunt.initConfig({
    // make node configurations available
    pkg: grunt.file.readJSON('package.json'),

    csslint: {
      options: {
        csslintrc: 'build/.csslintrc'
      },
      strict: {
        options: {
          import: 2
        },
        src: ['src/**/*.css'
        ]
      },
      lax: {
        options: {
          import: false
        },
        src: ['src/**/*.css'
        ]
      }
    },

    htmlhint: {
      html1: {
        src: [
          'src/**/*_template.html'
        ]
      }
    },

    eslint: {
      options: {
        configFile: 'build/.eslintrc'
      },
      target: ['src/**/*.js', '!src/**/enums.js', '!src/**/adapter.js' ]
    },

    shell: {
      pipInstall : {
        command: 'pip install --user --requirement requirements.txt'
      },
      ensureGcloudSDKIsInstalled: {
        command: 'python build/ensure_gcloud_sdk_is_installed.py'
      },
      runPythonTests: {
        command: ['python', 'build/run_python_tests.py',
                  app_engine_path, out_app_engine_dir].join(' ')
      },
      buildAppEnginePackage: {
        command: ['python', './build/build_app_engine_package.py', 'src',
                  out_app_engine_dir].join(' ')
      },
      buildAppEnginePackageWithTests: {
        command: ['python', './build/build_app_engine_package.py', 'src',
                  out_app_engine_dir, '--include-tests'].join(' ')
      },
      removePythonTestsFromOutAppEngineDir: {
        command: ['python', './build/remove_python_tests.py',
                  out_app_engine_dir].join(' ')
      },
      genJsEnums: {
        command: ['python', './build/gen_js_enums.py', 'src',
                  'src/web_app/js'].join(' ')
      },
      runUnitTests: {
        command: 'bash ./build/start-tests.sh'
      }
    },

    'grunt-chrome-build' : {
      apprtc: {
        options: {
          buildDir: 'out/chrome_app',
          zipFile: 'out/chrome_app/apprtc.zip',
          // If values for chromeBinary and keyFile are not provided, the packaging
          // step will be skipped.
          // chromeBinary should be set to the Chrome executable on your system.
          chromeBinary: null,
          // keyFile should be set to the key you want to use to create the crx package
          keyFile: null,
          appwindowHtmlSrc: 'src/web_app/html/index_template.html',
          appwindowHtmlDest: 'out/chrome_app/appwindow.html'
        },
        files: [
          {
            expand: true,
            cwd: 'src/web_app/chrome_app',
            src: [
              'manifest.json'
            ],
            dest: 'out/chrome_app/'
          },
          {
            expand: true,
            cwd: out_app_engine_dir,
            src: [
              '**/*.js',
              '**/*.css',
              '**/images/apprtc*.png',
              '!**/*.pem'
            ],
            dest: 'out/chrome_app/'
          },
          {
            expand: true,
            cwd: 'src/web_app',
            src: [
              'js/background.js',
              'js/appwindow.js',
              '!**/*.pem'
            ],
            dest: 'out/chrome_app/'
          }
        ],
      }
    },

    closurecompiler: {
      debug: {
        files: {
          // Destination: [source files]
          'out/app_engine/js/apprtc.debug.js': [
            'node_modules/webrtc-adapter/out/adapter.js',
            'src/web_app/js/analytics.js',
            'src/web_app/js/enums.js',
            'src/web_app/js/appcontroller.js',
            'src/web_app/js/call.js',
            'src/web_app/js/constants.js',
            'src/web_app/js/infobox.js',
            'src/web_app/js/peerconnectionclient.js',
            'src/web_app/js/remotewebsocket.js',
            'src/web_app/js/roomselection.js',
            'src/web_app/js/sdputils.js',
            'src/web_app/js/signalingchannel.js',
            'src/web_app/js/stats.js',
            'src/web_app/js/storage.js',
            'src/web_app/js/util.js',
            'src/web_app/js/windowport.js',
          ]
        },
        options: {
          'compilation_level': 'WHITESPACE_ONLY',
          'language_in': 'ECMASCRIPT5',
          'formatting': 'PRETTY_PRINT'
        },
      },
    },
    karma: {
      unit: {
        configFile: 'karma.conf.js'
      }
    }
  });

  // Enable plugins.
  grunt.loadNpmTasks('grunt-contrib-csslint');
  grunt.loadNpmTasks('grunt-htmlhint');
  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-closurecompiler-new-grunt');
  grunt.loadNpmTasks('grunt-eslint');
  grunt.loadTasks('build/grunt-chrome-build');

  // Set default tasks to run when grunt is called without parameters.
  grunt.registerTask('default', ['runLinting', 'runPythonTests', 'build',
                                 'runUnitTests']);
  grunt.registerTask('runLinting', ['csslint', 'htmlhint', 'eslint']);
  grunt.registerTask('runPythonTests', ['shell:pipInstall',
                                        'shell:ensureGcloudSDKIsInstalled',
                                        'shell:buildAppEnginePackageWithTests',
                                        'shell:runPythonTests',
                                        'shell:removePythonTestsFromOutAppEngineDir']);
  grunt.registerTask('runUnitTests', ['shell:runUnitTests']),
  grunt.registerTask('build', ['shell:buildAppEnginePackage', 'shell:genJsEnums', 'closurecompiler:debug', 'grunt-chrome-build']);
};
<|endoftext|>


<commit_before>/**
 * Build system for the DJsMusic Client
 * @param {Object} grunt
 */
module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		cfg: {

	    },
	    clean: {
	      build: [
	        'build'
	      ]
	    },
		cssmin: {
	      production: {
	        expand: true,
	        cwd: 'css',
	        src: ['*.css', '!*.min.css'],
	        dest: 'build/css/'
	      }
	   },
	   requirejs: {
		  compile: {
		    options: {
		      mainConfigFile: "config.js",
		      out: "build/js/app.js"
			}
		  }
	   },
	   copy: {
		  html: {
		    files: [
		      // includes files within path
		      {src: ['index-production.html'], dest: 'build/', filter: 'isFile'},
		      {expand:true, src: ['bootstrap-3/**'], dest: 'build/'},
		      {expand:true, src: ['img/**'], dest: 'build/'},
		      {expand:true, src: ['js/tpl/*'], dest: 'build/'},
		      {expand:true, src: ['js/app/views/*'], dest: 'build/'},
		      {expand:true, src: ['js/app/models/*'], dest: 'build/'},
		      {expand:true, src: ['js/app/collections/*'], dest: 'build/'},
		      {src: ['404.html'], dest: 'build/', filter: 'isFile'}
		    ]
		  }
		},
		rename:{
			html: {
				files: [
					{src: ['build/index-production.html'], dest: 'build/index.html'}
				]
			}
		},
	   lineremover: {
	      html: {
	        files: [
	          {
	            expand: true,
	            cwd: 'build/',
	            src: ['**/*.html'],
	            dest: 'build/',
	            ext: '.html'
	          }
	        ]
	      },
	      xml: {
	        files: [
	          {
	            expand: true,
	            cwd: 'build/',
	            src: ['**/*.xml'],
	            dest: 'build/',
	            ext: '.xml'
	          }
	        ]
	      }
	    },
	    buildGhPages: {
		    options: {
		    },
		    production: {
		      	build_branch: "gh-pages",
		        dist: "build",
		        pull: true
		    },
	   },
	    shell: {
	      bumpVersion: {
	        command: 'npm version patch'
	      }
	    },
	    hashres: {
	      options: {
	        encoding: 'utf8',
	        fileNameFormat: '${name}.${hash}.cache.${ext}',
	        renameFiles: true
	      },
	      code: {
	        options: {
	        },
	        src: [
	          'build/js/*.js',
	          'build/css/styles.css',
	        ],
	        dest: 'build/**/*.html'
	      },
	      images: {
	        options: {
	        },
	        src: [
	          'build/**/*.png',
	          'build/**/*.jpg'
	        ],
	        dest: [
	          'build/**/*.html',
	          'build/**/*.js',
	          'build/**/*.css',
	          'build/**/*.md'
	        ]
	      }
	    },
	});
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-cssmin');
	grunt.loadNpmTasks('grunt-line-remover');
	grunt.loadNpmTasks('grunt-shell');
	grunt.loadNpmTasks('grunt-hashres');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-rename');
	grunt.loadNpmTasks('grunt-contrib-requirejs');
	grunt.loadNpmTasks('grunt-build-gh-pages');

	// Add the hashres to everything
	grunt.registerTask('cacheBust', [
	  'hashres:images',
	  'hashres:code'
	]);

	grunt.registerTask('release', [
	  'shell:bumpVersion'
	]);

	grunt.registerTask('test', [
	  'clean',
	  'copy:html',
	  'rename:html',
	  'requirejs:compile',
	  'cssmin:production',
	  'cacheBust',
	  'lineremover'
	]);

	grunt.registerTask('deploy', [
	  'buildGhPages:production',
	  'release'
	]);
};<commit_msg>Update dist folder<commit_after>/**
 * Build system for the DJsMusic Client
 * @param {Object} grunt
 */
module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		cfg: {

	    },
	    clean: {
	      build: [
	        'build'
	      ]
	    },
		cssmin: {
	      production: {
	        expand: true,
	        cwd: 'css',
	        src: ['*.css', '!*.min.css'],
	        dest: 'build/css/'
	      }
	   },
	   requirejs: {
		  compile: {
		    options: {
		      mainConfigFile: "config.js",
		      out: "build/js/app.js"
			}
		  }
	   },
	   copy: {
		  html: {
		    files: [
		      // includes files within path
		      {src: ['index-production.html'], dest: 'build/', filter: 'isFile'},
		      {expand:true, src: ['bootstrap-3/**'], dest: 'build/'},
		      {expand:true, src: ['img/**'], dest: 'build/'},
		      {expand:true, src: ['js/tpl/*'], dest: 'build/'},
		      {expand:true, src: ['js/app/views/*'], dest: 'build/'},
		      {expand:true, src: ['js/app/models/*'], dest: 'build/'},
		      {expand:true, src: ['js/app/collections/*'], dest: 'build/'},
		      {src: ['404.html'], dest: 'build/', filter: 'isFile'}
		    ]
		  }
		},
		rename:{
			html: {
				files: [
					{src: ['build/index-production.html'], dest: 'build/index.html'}
				]
			}
		},
	   lineremover: {
	      html: {
	        files: [
	          {
	            expand: true,
	            cwd: 'build/',
	            src: ['**/*.html'],
	            dest: 'build/',
	            ext: '.html'
	          }
	        ]
	      },
	      xml: {
	        files: [
	          {
	            expand: true,
	            cwd: 'build/',
	            src: ['**/*.xml'],
	            dest: 'build/',
	            ext: '.xml'
	          }
	        ]
	      }
	    },
	    buildGhPages: {
		    options: {
		    	dist: "build"
		    },
		    production: {
		      	build_branch: "gh-pages",
		        dist: "build",
		        pull: true
		    },
	   },
	    shell: {
	      bumpVersion: {
	        command: 'npm version patch'
	      }
	    },
	    hashres: {
	      options: {
	        encoding: 'utf8',
	        fileNameFormat: '${name}.${hash}.cache.${ext}',
	        renameFiles: true
	      },
	      code: {
	        options: {
	        },
	        src: [
	          'build/js/*.js',
	          'build/css/styles.css',
	        ],
	        dest: 'build/**/*.html'
	      },
	      images: {
	        options: {
	        },
	        src: [
	          'build/**/*.png',
	          'build/**/*.jpg'
	        ],
	        dest: [
	          'build/**/*.html',
	          'build/**/*.js',
	          'build/**/*.css',
	          'build/**/*.md'
	        ]
	      }
	    },
	});
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-cssmin');
	grunt.loadNpmTasks('grunt-line-remover');
	grunt.loadNpmTasks('grunt-shell');
	grunt.loadNpmTasks('grunt-hashres');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-rename');
	grunt.loadNpmTasks('grunt-contrib-requirejs');
	grunt.loadNpmTasks('grunt-build-gh-pages');

	// Add the hashres to everything
	grunt.registerTask('cacheBust', [
	  'hashres:images',
	  'hashres:code'
	]);

	grunt.registerTask('release', [
	  'shell:bumpVersion'
	]);

	grunt.registerTask('test', [
	  'clean',
	  'copy:html',
	  'rename:html',
	  'requirejs:compile',
	  'cssmin:production',
	  'cacheBust',
	  'lineremover'
	]);

	grunt.registerTask('deploy', [
	  'buildGhPages:production',
	  'release'
	]);
};<|endoftext|>


<commit_before><commit_msg>Use alternative fix for prefixing pseudo issues by @thysultan<commit_after><|endoftext|>


<commit_before>module.exports = function( grunt ) {
    grunt.initConfig({
        responsive_images: {
            options : {
                newFilesOnly: false,
                sizes : [{
                    name : "ingame",
                    height : 64,
                    width: 64,
                    rename: false,
                    aspectRatio: false
                }]
            },
            default : {
                files : {
                    'web/teams/3dmax.png' : 'teams/3DMAX/logo-highres.png',
                    'web/teams/astanadragons.png' : 'teams/Astana Dragons/logo-highres.png',
                    'web/teams/bravadogaming.png' : 'teams/Bravado Gaming/logo-146x146.png',
                    'web/teams/clanmystik.png' : 'teams/Clan Mystik/logo-highres.png',
                    'web/teams/cloud9.png' : 'teams/Cloud9/logo-highres.png',
                    'web/teams/complexity.png' : 'teams/compLexity/logo-highres.png',
                    'web/teams/copenhagenwolves.png' : 'teams/Copenhagen Wolves/logo-highres.png',
                    'web/teams/counterlogicgaming.png' : 'teams/Counter Logic Gaming/logo-highres.png',
                    'web/teams/datteam.png' : 'teams/dAT Team/logo-257x257.png',
                    'web/teams/epsilonesports.png' : 'teams/Epsilon eSports/logo-highres.png',
                    'web/teams/escgaming.png' : 'teams/ESC Gaming/logo-highres.png',
                    'web/teams/flipsid3tactics.png' : 'teams/Flipsid3 Tactics/logo-highres.png',
                    'web/teams/fnatic.png' : 'teams/Fnatic/logo-highres.png',
                    'web/teams/gamers2.png' : 'teams/Gamers2/logo-highres.png',
                    'web/teams/hellraisers.png' : 'teams/HellRaisers/logo-highres.png',
                    'web/teams/ibuypower.png' : 'teams/iBUYPOWER/logo-highres.png',
                    'web/teams/inshock.png' : 'teams/INSHOCK/logo-highres.png',
                    'web/teams/kabumtd.png' : 'teams/KaBuM.TD/logo-highres.png',
                    'web/teams/lgbesports.png' : 'teams/LGB Esports/logo-highres.png',
                    'web/teams/londonconspiracy.png' : 'teams/London Conspiracy/logo-183x183.png',
                    'web/teams/mousesports.png' : 'teams/mousesports/logo-highres.png',
                    'web/teams/myxmg.png' : 'teams/MyXMG/logo-highres.png',
                    'web/teams/natusvincere.png' : 'teams/Natus Vincere/logo-highres.png',
                    'web/teams/ninjasinpyjamas.png' : 'teams/Ninjas in Pyjamas/logo-highres.png',
                    'web/teams/pentasports.png' : 'teams/PENTA Sports/logo-highres.png',
                    'web/teams/piter.png' : 'teams/PiTER/logo-highres.png',
                    'web/teams/planetkeydynamics.png' : 'teams/Planetkey Dynamics/logo-394x394.png',
                    'web/teams/reasongaming.png' : 'teams/Reason Gaming/logo-397x397.png',
                    'web/teams/teamdignitas.png' : 'teams/Team Dignitas/logo-highres.png',
                    'web/teams/teamenvyus.png' : 'teams/Team EnVyUs/logo-highres.png',
                    'web/teams/teamldlccom.png' : 'teams/Team LDLC.com/logo-highres.png',
                    'web/teams/teamliquid.png' : 'teams/Team Liquid/logo-highres.png',
                    'web/teams/teamproperty.png' : 'teams/Team Property/logo-287x287.png',
                    'web/teams/teamsolomid.png' : 'teams/Team SoloMid/logo-highres.png',
                    'web/teams/teamwolf.png' : 'teams/Team Wolf/logo-184x184.png',
                    'web/teams/titan.png' : 'teams/Titan/logo-highres.png',
                    'web/teams/verygames.png' : 'teams/VeryGames/logo-highres.png',
                    'web/teams/virtuspro.png' : 'teams/Virtus.Pro/logo-highres.png',
                    'web/teams/voxeminor.png' : 'teams/Vox Eminor/logo-highres.png',
                    'web/teams/k1ck.png' : 'teams/K1CK/logo-171x171.png',
                    'web/teams/games4u.png' : 'teams/Games4u/logo-234x234.png',
                    'web/teams/mythic.png' : 'teams/Mythic/logo-272x272.png',
                    'web/teams/elevate.png' : 'teams/eLevate/logo-highres.png',
                    'web/teams/sapphirekelownadotcom.png' : 'teams/SapphireKelownaDotCom/logo-298x298.png',
                    'web/teams/immunity.png' : 'teams/Immunity/logo-208x208.png',
                    'web/teams/thechiefs.png' : 'teams/The Chiefs/logo-236x236.png',
                    'web/teams/streamline.png' : 'teams/Streamline/logo-highres.png',
                    'web/teams/avantgarde.png' : 'teams/Avant Garde/logo-292x292.png',
                    'web/teams/trident.png' : 'teams/TRIDENT/logo-221x221.png',
                    'web/teams/volgare.png' : 'teams/VOLGARE/logo-200x200.png',
                    'web/teams/x6tence.png' : 'teams/x6tence/logo-170x170.png',
                    'web/teams/wizards.png' : 'teams/Wizards/logo-188x188.png',
                    'web/teams/publiclirse.png' : 'teams/Publiclir.se/logo-161x161.png',
                    'web/teams/playingducks.png' : 'teams/Playing Ducks/logo-436x436.png',
                    'web/teams/onlinebots.png' : 'teams/OnlineBOTS/logo-265x265.png',
                    'web/teams/badmonkeygaming.png' : 'teams/Bad Monkey Gaming/logo-highres.png',
                    'web/teams/affnity.png' : 'teams/affNity/logo-271x271.png',
                    'web/teams/ascendancy.png' : 'teams/Ascendancy/logo-187x187.png',
                    'web/teams/denialesports.png' : 'teams/Denial eSports/logo-231x231.png',
                    'web/teams/lunatikesports.png' : 'teams/LunatiK eSports/logo-highres.png',
                    'web/teams/gplay.png' : 'teams/GPlay/logo-355x355.png'
                }
            }
        },
        imagemin: {
            source: {
                options: {
                    optimizationLevel: 4
                },
                files: [{
                    expand: true,
                    cwd: 'teams/',
                    src: ['**/*.png'],
                    dest: 'teams/'
                }]
            },
            ingame: {
                options: {
                    optimizationLevel: 4
                },
                files: [{
                    expand: true,
                    cwd: 'web/teams/',
                    src: ['*.png'],
                    dest: 'web/teams/'
                }]
            }
        }
    });

    grunt.loadTasks( 'tasks' );

    grunt.loadNpmTasks( 'grunt-newer' );
    grunt.loadNpmTasks( 'grunt-contrib-imagemin' );
    grunt.loadNpmTasks( 'grunt-responsive-images' );

    grunt.registerTask( 'teamdata', [ 'teams', 'teams_zip' ] );
    grunt.registerTask( 'default', [ 'newer:imagemin:source', 'newer:responsive_images', 'newer:imagemin:ingame', 'teamdata' ] );
};
<commit_msg>Minor formatting fixes<commit_after>module.exports = function( grunt ) {
    grunt.initConfig({
        responsive_images: {
            options : {
                newFilesOnly: false,
                sizes : [{
                    name : 'ingame',
                    height : 64,
                    width: 64,
                    rename: false,
                    aspectRatio: false
                }]
            },
            default : {
                files : {
                    'web/teams/3dmax.png' : 'teams/3DMAX/logo-highres.png',
                    'web/teams/astanadragons.png' : 'teams/Astana Dragons/logo-highres.png',
                    'web/teams/bravadogaming.png' : 'teams/Bravado Gaming/logo-146x146.png',
                    'web/teams/clanmystik.png' : 'teams/Clan Mystik/logo-highres.png',
                    'web/teams/cloud9.png' : 'teams/Cloud9/logo-highres.png',
                    'web/teams/complexity.png' : 'teams/compLexity/logo-highres.png',
                    'web/teams/copenhagenwolves.png' : 'teams/Copenhagen Wolves/logo-highres.png',
                    'web/teams/counterlogicgaming.png' : 'teams/Counter Logic Gaming/logo-highres.png',
                    'web/teams/datteam.png' : 'teams/dAT Team/logo-257x257.png',
                    'web/teams/epsilonesports.png' : 'teams/Epsilon eSports/logo-highres.png',
                    'web/teams/escgaming.png' : 'teams/ESC Gaming/logo-highres.png',
                    'web/teams/flipsid3tactics.png' : 'teams/Flipsid3 Tactics/logo-highres.png',
                    'web/teams/fnatic.png' : 'teams/Fnatic/logo-highres.png',
                    'web/teams/gamers2.png' : 'teams/Gamers2/logo-highres.png',
                    'web/teams/hellraisers.png' : 'teams/HellRaisers/logo-highres.png',
                    'web/teams/ibuypower.png' : 'teams/iBUYPOWER/logo-highres.png',
                    'web/teams/inshock.png' : 'teams/INSHOCK/logo-highres.png',
                    'web/teams/kabumtd.png' : 'teams/KaBuM.TD/logo-highres.png',
                    'web/teams/lgbesports.png' : 'teams/LGB Esports/logo-highres.png',
                    'web/teams/londonconspiracy.png' : 'teams/London Conspiracy/logo-183x183.png',
                    'web/teams/mousesports.png' : 'teams/mousesports/logo-highres.png',
                    'web/teams/myxmg.png' : 'teams/MyXMG/logo-highres.png',
                    'web/teams/natusvincere.png' : 'teams/Natus Vincere/logo-highres.png',
                    'web/teams/ninjasinpyjamas.png' : 'teams/Ninjas in Pyjamas/logo-highres.png',
                    'web/teams/pentasports.png' : 'teams/PENTA Sports/logo-highres.png',
                    'web/teams/piter.png' : 'teams/PiTER/logo-highres.png',
                    'web/teams/planetkeydynamics.png' : 'teams/Planetkey Dynamics/logo-394x394.png',
                    'web/teams/reasongaming.png' : 'teams/Reason Gaming/logo-397x397.png',
                    'web/teams/teamdignitas.png' : 'teams/Team Dignitas/logo-highres.png',
                    'web/teams/teamenvyus.png' : 'teams/Team EnVyUs/logo-highres.png',
                    'web/teams/teamldlccom.png' : 'teams/Team LDLC.com/logo-highres.png',
                    'web/teams/teamliquid.png' : 'teams/Team Liquid/logo-highres.png',
                    'web/teams/teamproperty.png' : 'teams/Team Property/logo-287x287.png',
                    'web/teams/teamsolomid.png' : 'teams/Team SoloMid/logo-highres.png',
                    'web/teams/teamwolf.png' : 'teams/Team Wolf/logo-184x184.png',
                    'web/teams/titan.png' : 'teams/Titan/logo-highres.png',
                    'web/teams/verygames.png' : 'teams/VeryGames/logo-highres.png',
                    'web/teams/virtuspro.png' : 'teams/Virtus.Pro/logo-highres.png',
                    'web/teams/voxeminor.png' : 'teams/Vox Eminor/logo-highres.png',
                    'web/teams/k1ck.png' : 'teams/K1CK/logo-171x171.png',
                    'web/teams/games4u.png' : 'teams/Games4u/logo-234x234.png',
                    'web/teams/mythic.png' : 'teams/Mythic/logo-272x272.png',
                    'web/teams/elevate.png' : 'teams/eLevate/logo-highres.png',
                    'web/teams/sapphirekelownadotcom.png' : 'teams/SapphireKelownaDotCom/logo-298x298.png',
                    'web/teams/immunity.png' : 'teams/Immunity/logo-208x208.png',
                    'web/teams/thechiefs.png' : 'teams/The Chiefs/logo-236x236.png',
                    'web/teams/streamline.png' : 'teams/Streamline/logo-highres.png',
                    'web/teams/avantgarde.png' : 'teams/Avant Garde/logo-292x292.png',
                    'web/teams/trident.png' : 'teams/TRIDENT/logo-221x221.png',
                    'web/teams/volgare.png' : 'teams/VOLGARE/logo-200x200.png',
                    'web/teams/x6tence.png' : 'teams/x6tence/logo-170x170.png',
                    'web/teams/wizards.png' : 'teams/Wizards/logo-188x188.png',
                    'web/teams/publiclirse.png' : 'teams/Publiclir.se/logo-161x161.png',
                    'web/teams/playingducks.png' : 'teams/Playing Ducks/logo-436x436.png',
                    'web/teams/onlinebots.png' : 'teams/OnlineBOTS/logo-265x265.png',
                    'web/teams/badmonkeygaming.png' : 'teams/Bad Monkey Gaming/logo-highres.png',
                    'web/teams/affnity.png' : 'teams/affNity/logo-271x271.png',
                    'web/teams/ascendancy.png' : 'teams/Ascendancy/logo-187x187.png',
                    'web/teams/denialesports.png' : 'teams/Denial eSports/logo-231x231.png',
                    'web/teams/lunatikesports.png' : 'teams/LunatiK eSports/logo-highres.png',
                    'web/teams/gplay.png' : 'teams/GPlay/logo-355x355.png'
                }
            }
        },
        imagemin: {
            source: {
                options: {
                    optimizationLevel: 4
                },
                files: [{
                    expand: true,
                    cwd: 'teams/',
                    src: [ '**/*.png' ],
                    dest: 'teams/'
                }]
            },
            ingame: {
                options: {
                    optimizationLevel: 4
                },
                files: [{
                    expand: true,
                    cwd: 'web/teams/',
                    src: [ '*.png' ],
                    dest: 'web/teams/'
                }]
            }
        }
    });

    grunt.loadTasks( 'tasks' );

    grunt.loadNpmTasks( 'grunt-newer' );
    grunt.loadNpmTasks( 'grunt-contrib-imagemin' );
    grunt.loadNpmTasks( 'grunt-responsive-images' );

    grunt.registerTask( 'teamdata', [ 'teams', 'teams_zip' ] );
    grunt.registerTask( 'default', [ 'newer:imagemin:source', 'newer:responsive_images', 'newer:imagemin:ingame', 'teamdata' ] );
};
<|endoftext|>