<commit_before>function render_rusalad_result(containerId, features, jobname, buildno, imagesUrl, appContext) {
    var container = document.getElementById(containerId);

    var header = document.createElement('h1');
    header.appendChild(document.createTextNode('Russian Salad test report for build ' + buildno));
    var historyLink = document.createElement('a');
    historyLink.setAttribute("href", "#history");
    historyLink.appendChild(document.createTextNode("history"));
    header.appendChild(document.createTextNode(" ("));
    header.appendChild(historyLink);
    header.appendChild(document.createTextNode(")"));
    container.appendChild(header);

    $(historyLink).fancybox({
        'hideOnContentClick':false,
        'overlayOpacity':.6,
        'zoomSpeedIn':400,
        'zoomSpeedOut':400,
        'frameWidth':200,
        'frameHeight':100,
        'callbackOnShow':function () {
            render_rs_history("fancy_div", appContext + '/job/' + jobname + '/' + buildno + '/RSDynamic/History/', jobname, imagesUrl, appContext);
        }
    });

    var featureColCount = 1;

    for (var featureId = 0; featureId < features.length; featureId++) {
        var feature = features[featureId];

        var tf = document.createElement('table');
        tf.setAttribute('class', 'pane');
        var tfb = document.createElement('tbody');
        var tfhr = document.createElement('tr');
        var tfhc = document.createElement('td');
        tfhc.appendChild(document.createTextNode(feature.featureName));
        tfhc.setAttribute('colspan', featureColCount);
        tfhc.setAttribute('class', 'pane-header');
        tfhr.appendChild(tfhc);
        tfb.appendChild(tfhr);

        for (var scenarioId = 0; scenarioId < feature.scenarios.length; scenarioId++) {
            var scenario = feature.scenarios[scenarioId];
            var scenarioSuffix = featureId + '_' + scenarioId;
            var detailId = containerId + '_scenario_' + scenarioSuffix;
            var tfbr = document.createElement('tr');

            var tfbc = document.createElement('td');

            // Prepare scenario digest
            var digest = document.createElement('div');
            digest.setAttribute('style', 'display: block; width: 100%; text-align: left; cursor: pointer; text-decoration: underline;');
            digest.setAttribute('onclick', 'expand_scenario("' + detailId + '")');
            digest.setAttribute('id', detailId + '_digest1');

            var tfbi = document.createElement('img');
            var scenarioImgName = scenario.passed ? 'blue' : 'yellow';
            if (scenario.status == 'undefined') {
                scenarioImgName = 'red';
            }
            tfbi.setAttribute('src', imagesUrl + '/16x16/' + scenarioImgName + '.png');
            tfbi.setAttribute('width', '16');
            tfbi.setAttribute('height', '16');
            digest.appendChild(tfbi);

            digest.appendChild(document.createTextNode(scenario.scenarioName));

            // Prepare scenario digest (expanded)
            var digest2 = document.createElement('div');
            digest2.setAttribute('style', 'display: none; width: 100%; text-align: left; cursor: pointer; text-decoration: underline;');
            digest2.setAttribute('onclick', 'expand_scenario("' + detailId + '")');
            digest2.setAttribute('id', detailId + '_digest2');

            var tfbi2 = document.createElement('img');
            tfbi2.setAttribute('src', imagesUrl + '/16x16/' + scenarioImgName + '.png');
            tfbi2.setAttribute('width', '16');
            tfbi2.setAttribute('height', '16');
            digest2.appendChild(tfbi2);

            digest2.appendChild(document.createTextNode(scenario.scenarioName + ' (click to collapse)'));

            // Prepare scenario detail
            var detail = document.createElement('div');
            detail.setAttribute('style', 'display: none; padding-left: 2em;');
            detail.setAttribute('id', detailId);

            var ts = document.createElement('table');
            ts.setAttribute('class', 'pane');
            ts.setAttribute('style', 'border: 0;');
            var tsb = document.createElement('tbody');

            for (var stepId = 0; stepId < scenario.steps.length; stepId++) {
                var step = scenario.steps[stepId];
                var tsr = document.createElement('tr');

                var imgName;
                switch (step.status) {
                    case "passed":
                        imgName = 'blue';
                        break;
                    case "unknown":
                        imgName = 'red';
                        break;
                    case "skipped":
                        imgName = 'grey';
                        break;
                    case "failed":
                        imgName = 'yellow';
                        break;
                    default:
                        imgName = 'red';
                }
                var stepImg = document.createElement('img');
                stepImg.setAttribute('src', imagesUrl + '/16x16/' + imgName + '.png');
                stepImg.setAttribute('width', '16');
                stepImg.setAttribute('height', '16');

                var tsc1 = document.createElement('td');
                tsc1.appendChild(stepImg);
                var formattedArgs = step.args.replace(/&lt;arg>(.*?)&lt;\/arg>/g, "<b>$1</b>");
                tsc1.innerHTML = tsc1.innerHTML + step.keyword + formattedArgs;

                tsr.appendChild(tsc1);
                tsb.appendChild(tsr);
            }

            if (scenario.videoFile) {
                var tvr = document.createElement('tr');
                var tvc1 = document.createElement('td');
                tvc1.appendChild(document.createTextNode('Video report available: '));
                var tva = document.createElement('a');
                var videoName = appContext + '/job/' + jobname + '/' + buildno + '/RSDynamic/Files/' + feature.safeName + '/' + scenario.videoFile;
                $(tva).hover(function(){
                    videoName=$(this).attr('href').replace('.mkv#', '');
                });
                tva.setAttribute("href", videoName + ".mkv#");
                tva.appendChild(document.createTextNode(scenario.videoFile));
                $(tva).fancybox({
                    'hideOnContentClick':false,
                    'overlayOpacity':.6,
                    'zoomSpeedIn':400,
                    'zoomSpeedOut':400,
                    'callbackOnShow':function () {
                        player = $f("fancy_div", appContext + '/plugin/rusalad-plugin/flowplayer/flowplayer-3.2.7.swf', {
                            play:{opacity:0},
                            clip:{
                                autoPlay:true,
                                autoBuffering:true,
                                url:videoName + ".flv",
                                captionUrl:videoName + ".xml",
                                onStart:function (clip) {
                                    var wrap = jQuery(this.getParent());
                                    var clipwidth = clip.metaData.width;
                                    var clipheight = clip.metaData.height;
                                    if (clipwidth > 800) {
                                        clipheight = clipheight * 800 / clipwidth;
                                        clipwidth = 800;
                                    }
                                    var pos = $.fn.fancybox.getViewport();<commit_msg>Implemented version warning on RuSalad report page<commit_after>function render_rusalad_result(containerId, features, jobname, buildno, imagesUrl, appContext) {
    var container = document.getElementById(containerId);

    var versionWarning = document.createElement('div');
    versionWarning.setAttribute('style', 'display:none');
    versionWarning.setAttribute('class', 'warning');
    container.appendChild(versionWarning);

    var header = document.createElement('h1');
    header.appendChild(document.createTextNode('Russian Salad test report for build ' + buildno));
    var historyLink = document.createElement('a');
    historyLink.setAttribute("href", "#history");
    historyLink.appendChild(document.createTextNode("history"));
    header.appendChild(document.createTextNode(" ("));
    header.appendChild(historyLink);
    header.appendChild(document.createTextNode(")"));
    container.appendChild(header);

    $.getJSON(appContext + '/job/' + jobname + '/RSDynamic/Version/',
        function (data, textStatus, jqXHR) {
            if (data == null) {
                return;
            }
            if (data.message != null) {
                versionWarning.innerHTML = data.message + ' Current version is ' + data.currentVersion + '. Latest version is ' + data.latestVersion + '.';
                versionWarning.setAttribute('style', 'display:block');
            }
        });

    $(historyLink).fancybox({
        'hideOnContentClick':false,
        'overlayOpacity':.6,
        'zoomSpeedIn':400,
        'zoomSpeedOut':400,
        'frameWidth':200,
        'frameHeight':100,
        'callbackOnShow':function () {
            render_rs_history("fancy_div", appContext + '/job/' + jobname + '/' + buildno + '/RSDynamic/History/', jobname, imagesUrl, appContext);
        }
    });

    var featureColCount = 1;

    for (var featureId = 0; featureId < features.length; featureId++) {
        var feature = features[featureId];

        var tf = document.createElement('table');
        tf.setAttribute('class', 'pane');
        var tfb = document.createElement('tbody');
        var tfhr = document.createElement('tr');
        var tfhc = document.createElement('td');
        tfhc.appendChild(document.createTextNode(feature.featureName));
        tfhc.setAttribute('colspan', featureColCount);
        tfhc.setAttribute('class', 'pane-header');
        tfhr.appendChild(tfhc);
        tfb.appendChild(tfhr);

        for (var scenarioId = 0; scenarioId < feature.scenarios.length; scenarioId++) {
            var scenario = feature.scenarios[scenarioId];
            var scenarioSuffix = featureId + '_' + scenarioId;
            var detailId = containerId + '_scenario_' + scenarioSuffix;
            var tfbr = document.createElement('tr');

            var tfbc = document.createElement('td');

            // Prepare scenario digest
            var digest = document.createElement('div');
            digest.setAttribute('style', 'display: block; width: 100%; text-align: left; cursor: pointer; text-decoration: underline;');
            digest.setAttribute('onclick', 'expand_scenario("' + detailId + '")');
            digest.setAttribute('id', detailId + '_digest1');

            var tfbi = document.createElement('img');
            var scenarioImgName = scenario.passed ? 'blue' : 'yellow';
            if (scenario.status == 'undefined') {
                scenarioImgName = 'red';
            }
            tfbi.setAttribute('src', imagesUrl + '/16x16/' + scenarioImgName + '.png');
            tfbi.setAttribute('width', '16');
            tfbi.setAttribute('height', '16');
            digest.appendChild(tfbi);

            digest.appendChild(document.createTextNode(scenario.scenarioName));

            // Prepare scenario digest (expanded)
            var digest2 = document.createElement('div');
            digest2.setAttribute('style', 'display: none; width: 100%; text-align: left; cursor: pointer; text-decoration: underline;');
            digest2.setAttribute('onclick', 'expand_scenario("' + detailId + '")');
            digest2.setAttribute('id', detailId + '_digest2');

            var tfbi2 = document.createElement('img');
            tfbi2.setAttribute('src', imagesUrl + '/16x16/' + scenarioImgName + '.png');
            tfbi2.setAttribute('width', '16');
            tfbi2.setAttribute('height', '16');
            digest2.appendChild(tfbi2);

            digest2.appendChild(document.createTextNode(scenario.scenarioName + ' (click to collapse)'));

            // Prepare scenario detail
            var detail = document.createElement('div');
            detail.setAttribute('style', 'display: none; padding-left: 2em;');
            detail.setAttribute('id', detailId);

            var ts = document.createElement('table');
            ts.setAttribute('class', 'pane');
            ts.setAttribute('style', 'border: 0;');
            var tsb = document.createElement('tbody');

            for (var stepId = 0; stepId < scenario.steps.length; stepId++) {
                var step = scenario.steps[stepId];
                var tsr = document.createElement('tr');

                var imgName;
                switch (step.status) {
                    case "passed":
                        imgName = 'blue';
                        break;
                    case "unknown":
                        imgName = 'red';
                        break;
                    case "skipped":
                        imgName = 'grey';
                        break;
                    case "failed":
                        imgName = 'yellow';
                        break;
                    default:
                        imgName = 'red';
                }
                var stepImg = document.createElement('img');
                stepImg.setAttribute('src', imagesUrl + '/16x16/' + imgName + '.png');
                stepImg.setAttribute('width', '16');
                stepImg.setAttribute('height', '16');

                var tsc1 = document.createElement('td');
                tsc1.appendChild(stepImg);
                var formattedArgs = step.args.replace(/&lt;arg>(.*?)&lt;\/arg>/g, "<b>$1</b>");
                tsc1.innerHTML = tsc1.innerHTML + step.keyword + formattedArgs;

                tsr.appendChild(tsc1);
                tsb.appendChild(tsr);
            }

            if (scenario.videoFile) {
                var tvr = document.createElement('tr');
                var tvc1 = document.createElement('td');
                tvc1.appendChild(document.createTextNode('Video report available: '));
                var tva = document.createElement('a');
                var videoName = appContext + '/job/' + jobname + '/' + buildno + '/RSDynamic/Files/' + feature.safeName + '/' + scenario.videoFile;
                $(tva).hover(function () {
                    videoName = $(this).attr('href').replace('.mkv#', '');
                });
                tva.setAttribute("href", videoName + ".mkv#");
                tva.appendChild(document.createTextNode(scenario.videoFile));
                $(tva).fancybox({
                    'hideOnContentClick':false,
                    'overlayOpacity':.6,
                    'zoomSpeedIn':400,
                    'zoomSpeedOut':400,
                    'callbackOnShow':function () {
                        player = $f("fancy_div", appContext + '/plugin/rusalad-plugin/flowplayer/flowplayer-3.2.7.swf', {
                            play:{opacity:0},
                            clip:{
                                autoPlay:true,
                                autoBuffering:true,
                                url:videoName + ".flv",
                                captionUrl:videoName + ".xml",
                                onStart:function (clip) {
                                    var wrap = jQuery(this.getParent());
                                    var clipwidth = clip.metaData.width;
                                    var clipheight = clip.metaData.height;
                                    if (clipwidth > 800) {
                                        clipheight = clipheight * 800 / clipwidth;
                                        clipwidth = 800;
                                    }
                                    var pos = $.fn.fancybox.getViewport();
{'fraction_non_alphanumeric': 0.1299165673420739, 'fraction_numerical': 0.011417100558308763, 'mean_word_length': 1.7605194805194806, 'pattern_counts': {'":': 8, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7546996', 'n_tokens_mistral': 4122, 'n_tokens_neox': 3892, 'n_words': 749}