Go Results Highlighter3.0.4

by Artur Barcicki

Manual binding

Example Tournament - After Round 3
PlaceNameClubLevelScore123PointsSOSSOSOS
1Player 8AAA2 Kyu286+5+2+379241
2Player 4BBB4 Kyu278+3+1-280238
3Player 6BBB3 Kyu274+2-7+280237
4Player 2CCC3 Kyu273-6+5+279241
5Player 3CCC5 Kyu267+1-4-181236
6Player 7AAA5 Kyu261-4-8+180237
7Player 1AAA6 Kyu265-8+3-178240
8Player 5BBB8 Kyu252-7-6-079238
<!-- html -->
<table id="binding-example-1"><!-- results placeholder --></table>
<button rel="binding-example-1">Add Go Results Highlighter!</button>// javascript
document.addEventListener('DOMContentLoaded', () => {
    let button = document.querySelector('[rel="binding-example-1"]');
    let table = document.getElementById('binding-example-1');

    if (button && table) {
        button.addEventListener('click', () => {
            new GoResultsHighlighter(table);

            button.textContent = 'Go Results Highlighter is working.';
            button.disabled = true;
        });
    }
});

jQuery binding

Example Tournament - After Round 3
PlaceNameClubLevelScore123PointsSOSSOSOS
1Player 8AAA2 Kyu286+5+2+379241
2Player 4BBB4 Kyu278+3+1-280238
3Player 6BBB3 Kyu274+2-7+280237
4Player 2CCC3 Kyu273-6+5+279241
5Player 3CCC5 Kyu267+1-4-181236
6Player 7AAA5 Kyu261-4-8+180237
7Player 1AAA6 Kyu265-8+3-178240
8Player 5BBB8 Kyu252-7-6-079238
<!-- html -->
<table id="binding-example-2"><!-- results placeholder --></table>
<button rel="binding-example-2">Add Go Results Highlighter!</button>// javascript
$(document).ready(() => {
    let $button = $('[rel="binding-example-2"]');
    let $table = $('#binding-example-2');

    if ($button && $table) {
        $button.click(() => {
            $table.goResultsHighlighter();
            $button
                .attr('disabled', true)
                .html('Go Results Highlighter is working.');
        });
    }
});