misc/graves_js_anim.xhtml
author alfadur
Mon, 25 Mar 2024 00:23:41 +0300
changeset 16027 14fe5bfe9862
parent 16007 20adaa127663
permissions -rw-r--r--
grow network buffer periodically
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     1
<!DOCTYPE HTML>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     2
<html xmlns="http://www.w3.org/1999/xhtml">
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     3
<head>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     4
<!-- There is, at present, no official xsd for (X)HTML5. A pity. Usefulness would depend on the parser and extensions made by the site.  -->
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     5
    <title>Hedgewars Graves</title>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     6
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     7
    <style type="text/css">
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     8
* {padding: 0; margin: 0; }
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
     9
body
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    10
{
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    11
    background: url('//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Themes/Nature/Sky.png') fixed no-repeat bottom left;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    12
    background-color: #0B203D;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    13
    color: #FFD902;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    14
    -moz-background-size: 200%;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    15
    background-size: 100% 100%;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    16
    font-family: sans-serif;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    17
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    18
form, p
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    19
{
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    20
    background-color: #0B203D;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    21
    padding: 1em;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    22
    margin: 1em;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    23
    border-style: solid;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    24
    border-radius: 5px;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    25
    border-width: 2px;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    26
    border-color: #FFD902;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    27
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    28
h1 {
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    29
    text-shadow: 0 0 2px white;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    30
    color: black;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    31
    margin:10px;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    32
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    33
a {
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    34
    color: #BFBED0;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    35
    text-decoration: none;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    36
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    37
.grave
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    38
{
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    39
    margin-top: 12px;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    40
    margin-left: 20px;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    41
    float: left;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    42
    height: 32px;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    43
    width: 32px;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    44
    color: transparent;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    45
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    46
.girder
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    47
{
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    48
    width: 100%;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    49
    height: 30px;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    50
    clear: left;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    51
    background-image: url('//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Themes/Nature/Girder.png');
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    52
    background-repeat: repeat-x;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    53
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    54
.hide { visibility: hidden; }
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    55
a div
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    56
{
15629
c61dddd7c1a8 Graves preview page: Change grave margin
Wuzzy <Wuzzy2@mail.ru>
parents: 15628
diff changeset
    57
    margin-top: 6px;
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    58
    height: 32px;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    59
    width: 32px;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    60
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    61
    </style>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    62
    <script type="application/ecmascript">
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    63
//<![CDATA[
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
    64
let IS_LOCAL=false; // set to true to fetch flags locally. Useful for testing.
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
    65
let graves;
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    66
if (IS_LOCAL) {
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    67
/* JavaScript version of a sprite sheet - this could be pretty trivially done in pure HTML, but maintenance
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    68
would be easier with a server-side portion. list of sprites could be gotten from server, but would require XSS whitelisting */
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    69
// Last updated: 1.0.0
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    70
graves=["Badger","Bone","bp2","bubble","Cherry","chest","Clover","coffin",
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    71
"deadhog","dragonball","Duck2","Earth","Egg","eyecross","Flower","Ghost",
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    72
"Grave","heart","money","mouton1","octopus","Old_Apple","pi","plant2",
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    73
"plant3","Plinko","pokeball","pyramid","ring","Rip","Rubberduck","Simple",
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    74
"Simple_reversed","skull","star","Statue","TV","Whisky","Yin_and_Yang"];
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    75
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    76
else
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    77
{
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    78
graves = [];
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    79
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    80
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
    81
let themes = {
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    82
// Last updated: 1.0.0
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    83
"Art":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    84
"Beach":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    85
"Bamboo":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    86
"Bath":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    87
//"Blox":0, //unused, has no Sky.png or Border.png
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    88
"Brick":0,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    89
"Cake":0,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    90
"Castle":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    91
"Cave":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    92
"City":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    93
"Cheese":0,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    94
"Christmas":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    95
"Compost":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    96
"CrazyMission":0,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    97
"Deepspace":0,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    98
"Desert":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
    99
"EarthRise":0,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   100
"Eyes":0,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   101
"Freeway":0,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   102
"Fruit":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   103
"Halloween":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   104
"Hell":0,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   105
"Hoggywood":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   106
"Island":0,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   107
"Jungle":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   108
"Golf":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   109
"Nature":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   110
"Olympics":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   111
"Planes":0,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   112
"Sheep":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   113
"Snow":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   114
"Stage":1,
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   115
"Underwater":1};
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   116
let girder;
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   117
let animationInterval;
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   118
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   119
on_xml_loaded = function(ex)
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   120
{
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   121
    let resp = this.responseText;
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   122
    let r = />([^<]*).png</g;
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   123
    let x;
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   124
    while(x = r.exec(resp))
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   125
    {
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   126
        graves.push(x[1]);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   127
    }
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   128
    on_graves_loaded();
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   129
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   130
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   131
on_xml_error = function()
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   132
{
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   133
    let p = document.createElement("p");
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   134
    p.appendChild(document.createTextNode("ERROR: List of graves could not be fetched from the server!"));
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   135
    document.body.appendChild(p);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   136
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   137
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   138
window.onload = function()
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   139
{
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   140
    // Load list of graves
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   141
    if (!IS_LOCAL) {
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   142
        // Request list of graves from repository URL
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   143
        let xml=new XMLHttpRequest();
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   144
        xml.open("GET", "//hg.hedgewars.org/hedgewars/file/tip/share/hedgewars/Data/Graphics/Graves/");
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   145
        xml.addEventListener("error", on_xml_error);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   146
        xml.onload = on_xml_loaded;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   147
        xml.send();
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   148
    }
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   149
    else
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   150
    {
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   151
        on_graves_loaded();
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   152
    }
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   153
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   154
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   155
on_graves_loaded = function()
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   156
{
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   157
    // Render girders
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   158
    let s = document.styleSheets[0].cssRules;
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   159
    for(let i=0;i<s.length;i++)
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   160
    {
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   161
        if (s[i].selectorText.toLowerCase() === ".girder")
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   162
            girder = s[i];
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   163
    }
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   164
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   165
    let a = document.createElement("a");
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   166
    let g = document.createElement("div");
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   167
    g.className="girder";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   168
    a.className="grave";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   169
    a.appendChild(document.createElement("div"));
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   170
    a.lastChild.appendChild(document.createTextNode(""));
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   171
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   172
    // Render graves
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   173
    let missingGraves = [];
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   174
    let img;
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   175
    let j = 0;
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   176
    let toDelete = [];
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   177
    for (let i=0;i<graves.length;i++)
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   178
    {
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   179
        let h = document.body.appendChild(a.cloneNode(true));
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   180
        if (IS_LOCAL)
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   181
            h.href = "../share/hedgewars/Data/Graphics/Graves/"+graves[i]+".png";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   182
        else
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   183
            h.href = "//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Graphics/Graves/"+graves[i]+".png";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   184
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   185
        h.lastChild.style.backgroundImage = 'url("'+h.href+'")';
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   186
        h.title = graves[i];
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   187
        h.idle = Math.floor(Math.random()*16);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   188
        if (j%8 === 7 || i === graves.length-1)
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   189
            document.body.appendChild(g.cloneNode(false));
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   190
        j++;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   191
    }
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   192
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   193
    // Quick and dirty animation
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   194
    animationInterval = setInterval(animateGraves, 128);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   195
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   196
    // Theme selection drop-down list
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   197
    let form = document.body.appendChild(document.createElement("form"));
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   198
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   199
    let opt = document.createElement("option");
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   200
    opt.appendChild(document.createTextNode(""));
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   201
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   202
    let label = document.createElement("label");
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   203
    label.htmlFor = "theme_select";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   204
    label.appendChild(document.createTextNode("Theme: "));
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   205
    form.appendChild(label);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   206
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   207
    let sel = form.appendChild(document.createElement("select"));
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   208
    sel.id = "theme_select";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   209
    sel.onchange = switchTheme;
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   210
    for(let theme in themes)
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   211
    {
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   212
        sel.appendChild(opt.cloneNode(true));
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   213
        sel.lastChild.value = theme;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   214
        sel.lastChild.lastChild.data = theme;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   215
        if(theme === "Nature")
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   216
            sel.lastChild.selected = true;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   217
    }
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   218
    form.appendChild(document.createElement("br"));
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   219
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   220
    // Checkbox: Switch animation
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   221
    let chk = document.createElement("input");
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   222
    chk.id = "anim";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   223
    chk.type = "checkbox";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   224
    chk.onclick = switchAnim;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   225
    chk.checked = true;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   226
    form.appendChild(chk);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   227
    label = document.createElement("label");
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   228
    label.htmlFor = "anim";
16006
f81fe8250ed9 Clean up flag/grave/hats XHTML preview pages
Wuzzy <Wuzzy@disroot.org>
parents: 15629
diff changeset
   229
    label.appendChild(document.createTextNode(" Animate graves"));
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   230
    form.appendChild(label);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   231
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   232
    form.appendChild(document.createElement("br"));
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   233
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   234
    // Checkbox: Hide girders
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   235
    chk = document.createElement("input");
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   236
    chk.id = "hide_girders";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   237
    chk.type = "checkbox";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   238
    chk.onclick = hideGirders;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   239
    chk.checked = true;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   240
    form.appendChild(chk);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   241
    label = document.createElement("label");
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   242
    label.htmlFor = "hide_girders";
16006
f81fe8250ed9 Clean up flag/grave/hats XHTML preview pages
Wuzzy <Wuzzy@disroot.org>
parents: 15629
diff changeset
   243
    label.appendChild(document.createTextNode(" Show girders"));
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   244
    form.appendChild(label);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   245
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   246
    document.body.appendChild(form);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   247
16006
f81fe8250ed9 Clean up flag/grave/hats XHTML preview pages
Wuzzy <Wuzzy@disroot.org>
parents: 15629
diff changeset
   248
    switchTheme();
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   249
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   250
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   251
function animateGraves()
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   252
{
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   253
    let a = document.getElementsByTagName("a");
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   254
    for (let i=0;i<a.length;i++)
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   255
    {
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   256
        if (a[i].className !== "grave")
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   257
            continue;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   258
        // Cycle thru animation frames
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   259
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   260
        let maskName = a[i].title;
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   261
        // Grave
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   262
        a[i].firstChild.style.backgroundPosition=Math.floor(a[i].idle/16)*-32+"px "+(a[i].idle%16)*-32+"px";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   263
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   264
        // Next frame
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   265
        a[i].idle++;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   266
        if (a[i].idle > 15)
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   267
            a[i].idle = 0;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   268
    }
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   269
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   270
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   271
// Turn on or off grave animation
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   272
function switchAnim()
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   273
{
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   274
    if (animationInterval)
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   275
    {
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   276
        clearInterval(animationInterval);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   277
        animationInterval = null;
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   278
    }
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   279
    else animationInterval = setInterval(animateGraves, 128);
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   280
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   281
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   282
// Turn on or off girders
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   283
function hideGirders()
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   284
{
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   285
    let g = document.getElementsByClassName("girder");
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   286
    for(let i=0;i<g.length;i++)
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   287
        if (this.checked)
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   288
            g[i].className = "girder";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   289
        else
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   290
            g[i].className = "girder hide";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   291
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   292
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   293
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   294
// Select theme according to drop-down list value
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   295
function switchTheme()
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   296
{
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   297
    let prefix;
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   298
    if (!IS_LOCAL)
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   299
        prefix = "//hg.hedgewars.org/hedgewars/raw-file/tip";
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   300
    else
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   301
        prefix = "..";
16007
20adaa127663 Replace 'var' with 'let' in flag/grave/hat XHTML previews
Wuzzy <Wuzzy@disroot.org>
parents: 16006
diff changeset
   302
    let theme = this.value || "Nature";
16006
f81fe8250ed9 Clean up flag/grave/hats XHTML preview pages
Wuzzy <Wuzzy@disroot.org>
parents: 15629
diff changeset
   303
    document.body.style.backgroundImage='url("'+prefix+'/share/hedgewars/Data/Themes/'+theme+'/Sky.png")';
f81fe8250ed9 Clean up flag/grave/hats XHTML preview pages
Wuzzy <Wuzzy@disroot.org>
parents: 15629
diff changeset
   304
    if (themes[theme])
f81fe8250ed9 Clean up flag/grave/hats XHTML preview pages
Wuzzy <Wuzzy@disroot.org>
parents: 15629
diff changeset
   305
        girder.style.backgroundImage='url("'+prefix+'/share/hedgewars/Data/Themes/'+theme+'/Girder.png")';
15628
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   306
    else
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   307
        girder.style.backgroundImage='url("'+prefix+'/share/hedgewars/Data/Graphics/Girder.png")';
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   308
}
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   309
//]]>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   310
    </script>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   311
</head>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   312
<body>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   313
<h1>List of Hedgewars graves</h1>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   314
<noscript>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   315
<p><strong>ERROR</strong>: We're so sorry, but this webpage only works with JavaScript enabled. It seems JavaScript is disabled or not supported in your browser.<br/>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   316
Normally, this webpage would display an animated preview of the graves in Hedgewars.</p>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   317
</noscript>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   318
</body>
969bc30928da Add flags and graves preview pages
Wuzzy <Wuzzy2@mail.ru>
parents:
diff changeset
   319
</html>