PageSourceSearch

https://vdiplomacy.com/javascript/help.js?ver=1.711

js vdiplomacy.com collected 2026-10-02 14:14:29 UTC 1,827 bytes, 51 lines download raw bytes

1/*
2    Copyright (C) 2004-2010 Kestas J. Kuliukas
3
4	This file is part of webDiplomacy.
5
6    webDiplomacy is free software: you can redistribute it and/or modify
7    it under the terms of the GNU Affero General Public License as published by
8    the Free Software Foundation, either version 3 of the License, or
9    (at your option) any later version.
10
11    webDiplomacy is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU Affero General Public License
17    along with webDiplomacy.  If not, see <http://www.gnu.org/licenses/>.
18 */
19// See doc/javascript.txt for information on JavaScript in webDiplomacy
20
21/* 
22 * Helper functions for tutorial mode modal operations
23*/
24
25function indexForward(index, tutorial = true) {
26    if (tutorial) {
27        document.getElementsByClassName("tutorial")[index - 1].style["display"] = "none";
28        document.getElementsByClassName("tutorial")[index].style["display"] = "block";
29        document.getElementsByClassName("tutorial-header")[0].scrollIntoView();
30    }
31}
32
33function endTutorial() {
34    document.cookie.split("; ").forEach((c) => {
35        if (c.includes("wD-Tutorial")) {
36            unsetCookie(c.substring(0, c.indexOf("=")));
37        }
38    });
39    hideHelp();
40}
41
42function unsetCookie(name) {
43    var date = new Date();
44    date.setTime(Date.now()+(-1 * 24 * 60 * 60 * 1000));
45    var expiration = "; expires=" + date.toGMTString();
46    document.cookie = name + "=" + expiration + "; path=/";
47}
48
49function hideHelp() {
50    document.getElementsByClassName("tutorial-wrap")[0].style["display"] = "none";
51}

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.