PageSourceSearch

https://www.boatrace-toda.jp/assets/js/race_table_series.js?ver=20230605

js boatrace-toda.jp collected 2026-10-02 11:15:30 UTC 19,421 bytes, 260 lines download raw bytes

1
2// ===========================================================================================
3// 節間成績
4//
5// 開催日数についてはseries_info.jsで定義されたKIKANを参照する
6// レースの区部を判別するrcdはxmlから取得できない為、KIKANの数字を最終日とする(準優日は判別不可)
7// ===========================================================================================
8
9var raceTableSeriesBlock = null;
10
11// ファイルロード時に関数を読み込む
12$(document).ready(function () {
13    // テーブルの値の変更はクリック時に行う ファイルロード時に呼び出しても動作しない
14    $(document).on("click", "#act01-02", function () {
15        getXmlRaceTableSeries();
16    });
17
18});
19
20// 節間成績のxml取得
21function getXmlRaceTableSeries() {
22    download('./xml/kaisai/' + DATE + "/race_table_series_" + zero2(RACE_NO) + ".xml", 'xml', function (xml) {
23        raceTableSeriesBlock = xml;
24        setDataRaceTableSeries();
25        console.log(KIKAN);
26    });
27}
28
29// 節間成績のデータをセット
30function setDataRaceTableSeries() {
31    // 開催日数に対応したテーブルのthになるよう修正 <tr id="setukan-tr">内のすべての要素をhtmlごと入れ替え
32    if (KIKAN != 7) {
33        let html = '<th name="custom-head-name"></th>';
34        for (let i = 1; i <= 7; i++) {
35            if (KIKAN == i) {
36                let finalTh = "<th colspan='2' id='setukan-day" + i + "' style='border-right:none'>最終日</th>";
37                html += finalTh;
38                // 開催日数が7日に満たない場合は、最終日以降を空で埋めてforループを抜ける
39                for (let j = i + 1; j <= 7; j++) {
40                    let th = "<th colspan='2' id='setukan-day" + j + "' style='width:0px;border-left:none;border-top:none;border-right:none;'></th>";
41                    html += th;
42                    for (let l = 1; l <= 6; l++) {
43                    $("*[name=setukan-sinnyu" + l + "-" + (j - 1) + "-1]").css({"border-right":"none"});
44                    $("*[name=setukan-sinnyu" + l + "-" + (j - 1) + "-2]").css({"border-right":"none"});
45                    $("*[name=setukan-sinnyu" + l + "-" + j + "-1]").css({"border-left":"none","border-right":"none"});
46                    $("*[name=setukan-sinnyu" + l + "-" + j + "-2]").css({"border-left":"none","border-right":"none"});
47
48                    $("*[name=setukan-st" + l + "-" + (j - 1) + "-1]").css({"border-right":"none"});
49                    $("*[name=setukan-st" + l + "-" + (j - 1) + "-2]").css({"border-right":"none"});
50                    $("*[name=setukan-st" + l + "-" + j + "-1]").css({"border-left":"none","border-right":"none"});
51                    $("*[name=setukan-st" + l + "-" + j + "-2]").css({"border-left":"none","border-right":"none"});
52
53                    $("*[name=setukan-chaku" + l + "-" + (j - 1) + "-1]").css({"border-right":"none"});
54                    $("*[name=setukan-chaku" + l + "-" + (j - 1) + "-2]").css({"border-right":"none"});
55                    $("*[name=setukan-chaku" + l + "-" + j + "-1]").css({"border-left":"none","border-right":"none"});
56                    $("*[name=setukan-chaku" + l + "-" + j + "-2]").css({"border-left":"none","border-right":"none"});
57                    }
58                }
59                break;
60            } else {
61                i == 1 ? html += "<th colspan='2' id='setukan-day" + i + "'>初日</th>" : html += "<th colspan='2' id='setukan-day" + i + "'>" + i + "日目</th>";
62            }
63        }
64        $("#setukan-tr").html(html);
65
66        // 出走表カスタマイズ部分のテーブルの頭を更新 機能しないためコメントアウト
67        for (i = 1; i <= 7; i++) {
68            if (i == KIKAN) {
69                $("#custom-setukan-day" + i).html("最終日");
70                $("#custom-setukan-day" + i).css("border-right", "none");
71            } else if (i > KIKAN) {
72                $("#custom-setukan-day" + i).html("");
73                $("#custom-setukan-day" + i).css("border", "none");
74                $("#custom-setukan-day" + i).css("border-bottom", "1px solid #dee2e6");
75            }
76        }
77        // let head1 = "<th colspan=\"2\" name=\"zenkoku-and-toda-view\">勝率<br>2連率</th>" +
78        // "<th name=\"custom_motor\">No.<br>2連率</th><th name=\"custom_boat\">No.<br>2連率</th>;
79        // let head2 = "<!-- 全国過去3節 --><th class=\"zenkoku-view\">グレード / 場 / 期間<br>成績</th><th class=\"zenkoku-view\">グレード / 場 / 期間<br>成績</th>" +
80        // "<th class=\"zenkoku-view\">グレード / 場 / 期間<br>成績</th><!-- 戸田過去3節 --><th class=\"toda-view\">グレード / 期間<br>成績</th>" +
81        // "<th class=\"toda-view\">グレード / 期間<br>成績</th><th class=\"toda-view\">グレード / 期間<br>成績</th><!-- モーター3節 -->" +
82        // "<th class=\"motor-view\">グレード / 選手名 / 級別<br>成績</th><th class=\"motor-view\">グレード / 選手名 / 級別<br>成績</th>" +
83        // "<th class=\"motor-view\">グレード / 選手名 / 級別<br>成績</th><!-- 枠番別過去10走 --><th class=\"wakuban-view\"></th>" +
84        // "<th class=\"wakuban-view\">1走前</th><th class=\"wakuban-view\">2走前</th><th class=\"wakuban-view\">3走前</th>" +
85        // "<th class=\"wakuban-view\">4走前</th><th class=\"wakuban-view\">5走前</th><th class=\"wakuban-view\">6走前</th>" +
86        // "<th class=\"wakuban-view\">7走前</th><th class=\"wakuban-view\">8走前</th><th class=\"wakuban-view\">9走前</th>" +
87        // "<th class=\"wakuban-view\">10走前</th><!-- 得点率早見表 --><th class=\"tokuten-view\">得点</th><th class=\"tokuten-view\">得点率</th><th class=\"tokuten-view\">順位</th>";
88        // $("#syussou-setukan-head").html(head1 + html + head2);
89    }
90    if (KIKAN == 7 && FDATE == '20230604' ) {
91        let html = '<th name="custom-head-name"></th>';
92        for (let i = 1; i <= 7; i++) {
93            if (KIKAN == i) {
94                let finalTh = "<th colspan='2' id='setukan-day" + i + "' style='border-right:none'>最終日</th>";
95                html += finalTh;
96                // 開催日数が7日に満たない場合は、最終日以降を空で埋めてforループを抜ける
97                for (let j = i + 1; j <= 7; j++) {
98                    let th = "<th colspan='2' id='setukan-day" + j + "' style='width:0px;border-left:none;border-top:none;border-right:none;'></th>";
99                    html += th;
100                    for (let l = 1; l <= 6; l++) {
101                    $("*[name=setukan-sinnyu" + l + "-" + (j - 1) + "-1]").css({"border-right":"none"});
102                    $("*[name=setukan-sinnyu" + l + "-" + (j - 1) + "-2]").css({"border-right":"none"});
103                    $("*[name=setukan-sinnyu" + l + "-" + j + "-1]").css({"border-left":"none","border-right":"none"});
104                    $("*[name=setukan-sinnyu" + l + "-" + j + "-2]").css({"border-left":"none","border-right":"none"});
105
106                    $("*[name=setukan-st" + l + "-" + (j - 1) + "-1]").css({"border-right":"none"});
107                    $("*[name=setukan-st" + l + "-" + (j - 1) + "-2]").css({"border-right":"none"});
108                    $("*[name=setukan-st" + l + "-" + j + "-1]").css({"border-left":"none","border-right":"none"});
109                    $("*[name=setukan-st" + l + "-" + j + "-2]").css({"border-left":"none","border-right":"none"});
110
111                    $("*[name=setukan-chaku" + l + "-" + (j - 1) + "-1]").css({"border-right":"none"});
112                    $("*[name=setukan-chaku" + l + "-" + (j - 1) + "-2]").css({"border-right":"none"});
113                    $("*[name=setukan-chaku" + l + "-" + j + "-1]").css({"border-left":"none","border-right":"none"});
114                    $("*[name=setukan-chaku" + l + "-" + j + "-2]").css({"border-left":"none","border-right":"none"});
115                    }
116                }
117                break;
118            } else {
119                i == 1 ? html += "<th colspan='2' id='setukan-day" + i + "'>順延</th>" : i == 2 ? html += "<th colspan='2' id='setukan-day" + i + "'>初日</th>" : html += "<th colspan='2' id='setukan-day" + i + "'>" + ( i - 1 ) + "日目</th>";
120            }
121        }
122        $("#setukan-tr").html(html);
123
124        // 出走表カスタマイズ部分のテーブルの頭を更新 機能しないためコメントアウト
125        for (i = 1; i <= 7; i++) {
126            if (i == KIKAN) {
127                $("#custom-setukan-day" + i).html("最終日");
128                $("#custom-setukan-day" + i).css("border-right", "none");
129            } else if (i > KIKAN) {
130                $("#custom-setukan-day" + i).html("");
131                $("#custom-setukan-day" + i).css("border", "none");
132                $("#custom-setukan-day" + i).css("border-bottom", "1px solid #dee2e6");
133            }
134        }
135	}
136
137    $(raceTableSeriesBlock).find("table").each(function () {
138        $(this).find("record").each(function () {
139            var no = $(this).find("teiban").text();
140            // 進入のレコード
141            $("*[name=setukan-sinnyu" + no + "-1-1]").html($(this).find("sin1-1").text());
142            $("*[name=setukan-sinnyu" + no + "-1-2]").html($(this).find("sin1-2").text());
143            $("*[name=setukan-sinnyu" + no + "-2-1]").html($(this).find("sin2-1").text());
144            $("*[name=setukan-sinnyu" + no + "-2-2]").html($(this).find("sin2-2").text());
145            $("*[name=setukan-sinnyu" + no + "-3-1]").html($(this).find("sin3-1").text());
146            $("*[name=setukan-sinnyu" + no + "-3-2]").html($(this).find("sin3-2").text());
147            $("*[name=setukan-sinnyu" + no + "-4-1]").html($(this).find("sin4-1").text());
148            $("*[name=setukan-sinnyu" + no + "-4-2]").html($(this).find("sin4-2").text());
149            $("*[name=setukan-sinnyu" + no + "-5-1]").html($(this).find("sin5-1").text());
150            $("*[name=setukan-sinnyu" + no + "-5-2]").html($(this).find("sin5-2").text());
151            $("*[name=setukan-sinnyu" + no + "-6-1]").html($(this).find("sin6-1").text());
152            $("*[name=setukan-sinnyu" + no + "-6-2]").html($(this).find("sin6-2").text());
153            $("*[name=setukan-sinnyu" + no + "-7-1]").html($(this).find("sin7-1").text());
154            $("*[name=setukan-sinnyu" + no + "-7-2]").html($(this).find("sin7-2").text());
155            $("*[name=setukan-sinnyu" + no + "-1-1]").removeClass(function(index, className) {
156                return (className.match(/\bwaku\S+/g) || []).join(' ');
157            });
158            $("*[name=setukan-sinnyu" + no + "-1-1]").removeClass(function(index, className) {
159                return (className.match(/\bwaku\S+/g) || []).join(' ');
160            });
161            $("*[name=setukan-sinnyu" + no + "-1-2]").removeClass(function(index, className) {
162                return (className.match(/\bwaku\S+/g) || []).join(' ');
163            });
164            $("*[name=setukan-sinnyu" + no + "-2-1]").removeClass(function(index, className) {
165                return (className.match(/\bwaku\S+/g) || []).join(' ');
166            });
167            $("*[name=setukan-sinnyu" + no + "-2-2]").removeClass(function(index, className) {
168                return (className.match(/\bwaku\S+/g) || []).join(' ');
169            });
170            $("*[name=setukan-sinnyu" + no + "-3-1]").removeClass(function(index, className) {
171                return (className.match(/\bwaku\S+/g) || []).join(' ');
172            });
173            $("*[name=setukan-sinnyu" + no + "-3-2]").removeClass(function(index, className) {
174                return (className.match(/\bwaku\S+/g) || []).join(' ');
175            });
176            $("*[name=setukan-sinnyu" + no + "-4-1]").removeClass(function(index, className) {
177                return (className.match(/\bwaku\S+/g) || []).join(' ');
178            });
179            $("*[name=setukan-sinnyu" + no + "-4-2]").removeClass(function(index, className) {
180                return (className.match(/\bwaku\S+/g) || []).join(' ');
181            });
182            $("*[name=setukan-sinnyu" + no + "-5-1]").removeClass(function(index, className) {
183                return (className.match(/\bwaku\S+/g) || []).join(' ');
184            });
185            $("*[name=setukan-sinnyu" + no + "-5-2]").removeClass(function(index, className) {
186                return (className.match(/\bwaku\S+/g) || []).join(' ');
187            });
188            $("*[name=setukan-sinnyu" + no + "-6-1]").removeClass(function(index, className) {
189                return (className.match(/\bwaku\S+/g) || []).join(' ');
190            });
191            $("*[name=setukan-sinnyu" + no + "-6-2]").removeClass(function(index, className) {
192                return (className.match(/\bwaku\S+/g) || []).join(' ');
193            });
194            $("*[name=setukan-sinnyu" + no + "-7-1]").removeClass(function(index, className) {
195                return (className.match(/\bwaku\S+/g) || []).join(' ');
196            });
197            $("*[name=setukan-sinnyu" + no + "-7-2]").removeClass(function(index, className) {
198                return (className.match(/\bwaku\S+/g) || []).join(' ');
199            });
200//            $("*[name=setukan-sinnyu" + no + "-1-1]").addClass("waku" + $(this).find("sin1-1").text() + "");
201//            $("*[name=setukan-sinnyu" + no + "-1-2]").addClass("waku" + $(this).find("sin1-2").text() + "");
202//            $("*[name=setukan-sinnyu" + no + "-2-1]").addClass("waku" + $(this).find("sin2-1").text() + "");
203//            $("*[name=setukan-sinnyu" + no + "-2-2]").addClass("waku" + $(this).find("sin2-2").text() + "");
204//            $("*[name=setukan-sinnyu" + no + "-3-1]").addClass("waku" + $(this).find("sin3-1").text() + "");
205//            $("*[name=setukan-sinnyu" + no + "-3-2]").addClass("waku" + $(this).find("sin3-2").text() + "");
206//            $("*[name=setukan-sinnyu" + no + "-4-1]").addClass("waku" + $(this).find("sin4-1").text() + "");
207//            $("*[name=setukan-sinnyu" + no + "-4-2]").addClass("waku" + $(this).find("sin4-2").text() + "");
208//            $("*[name=setukan-sinnyu" + no + "-5-1]").addClass("waku" + $(this).find("sin5-1").text() + "");
209//            $("*[name=setukan-sinnyu" + no + "-5-2]").addClass("waku" + $(this).find("sin5-2").text() + "");
210//            $("*[name=setukan-sinnyu" + no + "-6-1]").addClass("waku" + $(this).find("sin6-1").text() + "");
211//            $("*[name=setukan-sinnyu" + no + "-6-2]").addClass("waku" + $(this).find("sin6-2").text() + "");
212//            $("*[name=setukan-sinnyu" + no + "-7-1]").addClass("waku" + $(this).find("sin7-1").text() + "");
213//            $("*[name=setukan-sinnyu" + no + "-7-2]").addClass("waku" + $(this).find("sin7-2").text() + "");
214            $("*[name=setukan-sinnyu" + no + "-1-1]").addClass("waku" + $(this).find("teiban1-1").text() + "");
215            $("*[name=setukan-sinnyu" + no + "-1-2]").addClass("waku" + $(this).find("teiban1-2").text() + "");
216            $("*[name=setukan-sinnyu" + no + "-2-1]").addClass("waku" + $(this).find("teiban2-1").text() + "");
217            $("*[name=setukan-sinnyu" + no + "-2-2]").addClass("waku" + $(this).find("teiban2-2").text() + "");
218            $("*[name=setukan-sinnyu" + no + "-3-1]").addClass("waku" + $(this).find("teiban3-1").text() + "");
219            $("*[name=setukan-sinnyu" + no + "-3-2]").addClass("waku" + $(this).find("teiban3-2").text() + "");
220            $("*[name=setukan-sinnyu" + no + "-4-1]").addClass("waku" + $(this).find("teiban4-1").text() + "");
221            $("*[name=setukan-sinnyu" + no + "-4-2]").addClass("waku" + $(this).find("teiban4-2").text() + "");
222            $("*[name=setukan-sinnyu" + no + "-5-1]").addClass("waku" + $(this).find("teiban5-1").text() + "");
223            $("*[name=setukan-sinnyu" + no + "-5-2]").addClass("waku" + $(this).find("teiban5-2").text() + "");
224            $("*[name=setukan-sinnyu" + no + "-6-1]").addClass("waku" + $(this).find("teiban6-1").text() + "");
225            $("*[name=setukan-sinnyu" + no + "-6-2]").addClass("waku" + $(this).find("teiban6-2").text() + "");
226            $("*[name=setukan-sinnyu" + no + "-7-1]").addClass("waku" + $(this).find("teiban7-1").text() + "");
227            $("*[name=setukan-sinnyu" + no + "-7-2]").addClass("waku" + $(this).find("teiban7-2").text() + "");
228            // STのレコード
229            $("*[name=setukan-st" + no + "-1-1]").html($(this).find("st1-1").text().replace("0.", "."));
230            $("*[name=setukan-st" + no + "-1-2]").html($(this).find("st1-2").text().replace("0.", "."));
231            $("*[name=setukan-st" + no + "-2-1]").html($(this).find("st2-1").text().replace("0.", "."));
232            $("*[name=setukan-st" + no + "-2-2]").html($(this).find("st2-2").text().replace("0.", "."));
233            $("*[name=setukan-st" + no + "-3-1]").html($(this).find("st3-1").text().replace("0.", "."));
234            $("*[name=setukan-st" + no + "-3-2]").html($(this).find("st3-2").text().replace("0.", "."));
235            $("*[name=setukan-st" + no + "-4-1]").html($(this).find("st4-1").text().replace("0.", "."));
236            $("*[name=setukan-st" + no + "-4-2]").html($(this).find("st4-2").text().replace("0.", "."));
237            $("*[name=setukan-st" + no + "-5-1]").html($(this).find("st5-1").text().replace("0.", "."));
238            $("*[name=setukan-st" + no + "-5-2]").html($(this).find("st5-2").text().replace("0.", "."));
239            $("*[name=setukan-st" + no + "-6-1]").html($(this).find("st6-1").text().replace("0.", "."));
240            $("*[name=setukan-st" + no + "-6-2]").html($(this).find("st6-2").text().replace("0.", "."));
241            $("*[name=setukan-st" + no + "-7-1]").html($(this).find("st7-1").text().replace("0.", "."));
242            $("*[name=setukan-st" + no + "-7-2]").html($(this).find("st7-2").text().replace("0.", "."));
243            // 着のレコード
244            $("*[name=setukan-chaku" + no + "-1-1]").html($(this).find("chaku1-1").text());
245            $("*[name=setukan-chaku" + no + "-1-2]").html($(this).find("chaku1-2").text());
246            $("*[name=setukan-chaku" + no + "-2-1]").html($(this).find("chaku2-1").text());
247            $("*[name=setukan-chaku" + no + "-2-2]").html($(this).find("chaku2-2").text());
248            $("*[name=setukan-chaku" + no + "-3-1]").html($(this).find("chaku3-1").text());
249            $("*[name=setukan-chaku" + no + "-3-2]").html($(this).find("chaku3-2").text());
250            $("*[name=setukan-chaku" + no + "-4-1]").html($(this).find("chaku4-1").text());
251            $("*[name=setukan-chaku" + no + "-4-2]").html($(this).find("chaku4-2").text());
252            $("*[name=setukan-chaku" + no + "-5-1]").html($(this).find("chaku5-1").text());
253            $("*[name=setukan-chaku" + no + "-5-2]").html($(this).find("chaku5-2").text());
254            $("*[name=setukan-chaku" + no + "-6-1]").html($(this).find("chaku6-1").text());
255            $("*[name=setukan-chaku" + no + "-6-2]").html($(this).find("chaku6-2").text());
256            $("*[name=setukan-chaku" + no + "-7-1]").html($(this).find("chaku7-1").text());
257            $("*[name=setukan-chaku" + no + "-7-2]").html($(this).find("chaku7-2").text());
258        });
259    });
260}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.