equal
deleted
inserted
replaced
6 |
6 |
7 <style type="text/css"> |
7 <style type="text/css"> |
8 * {padding: 0; margin: 0; } |
8 * {padding: 0; margin: 0; } |
9 body |
9 body |
10 { |
10 { |
11 background: url('https://hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Themes/Nature/Sky.png') fixed no-repeat bottom left; |
11 background: url('//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Themes/Nature/Sky.png') fixed no-repeat bottom left; |
12 background-color: #0B203D; |
12 background-color: #0B203D; |
13 color: #FFD902; |
13 color: #FFD902; |
14 -moz-background-size: 200%; |
14 -moz-background-size: 200%; |
15 background-size: 100% 100%; |
15 background-size: 100% 100%; |
16 font-family: sans-serif; |
16 font-family: sans-serif; |
40 margin-left: 20px; |
40 margin-left: 20px; |
41 float: left; |
41 float: left; |
42 height: 32px; |
42 height: 32px; |
43 width: 32px; |
43 width: 32px; |
44 color: transparent; |
44 color: transparent; |
45 background-image: url("https://hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Graphics/Hedgehog/Idle.png"); |
45 background-image: url("//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Graphics/Hedgehog/Idle.png"); |
46 } |
46 } |
47 .girder |
47 .girder |
48 { |
48 { |
49 width: 100%; |
49 width: 100%; |
50 height: 30px; |
50 height: 30px; |
51 clear: left; |
51 clear: left; |
52 background-image: url('https://hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Themes/Nature/Girder.png'); |
52 background-image: url('//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Themes/Nature/Girder.png'); |
53 background-repeat: repeat-x; |
53 background-repeat: repeat-x; |
54 } |
54 } |
55 .hide { visibility: hidden; } |
55 .hide { visibility: hidden; } |
56 a div |
56 a div |
57 { |
57 { |
142 { |
142 { |
143 // Load list of hats |
143 // Load list of hats |
144 if (!IS_LOCAL) { |
144 if (!IS_LOCAL) { |
145 // Request list of hats from repository URL |
145 // Request list of hats from repository URL |
146 var xml=new XMLHttpRequest(); |
146 var xml=new XMLHttpRequest(); |
147 xml.open("GET", "https://hg.hedgewars.org/hedgewars/file/tip/share/hedgewars/Data/Graphics/Hats/"); |
147 xml.open("GET", "//hg.hedgewars.org/hedgewars/file/tip/share/hedgewars/Data/Graphics/Hats/"); |
148 xml.addEventListener("error", on_xml_error); |
148 xml.addEventListener("error", on_xml_error); |
149 xml.onload = on_xml_loaded; |
149 xml.onload = on_xml_loaded; |
150 xml.send(); |
150 xml.send(); |
151 } |
151 } |
152 else |
152 else |
195 } |
195 } |
196 var h = document.body.appendChild(a.cloneNode(true)); |
196 var h = document.body.appendChild(a.cloneNode(true)); |
197 if (IS_LOCAL) |
197 if (IS_LOCAL) |
198 h.href = "../share/hedgewars/Data/Graphics/Hats/"+masks[i]+".png"; |
198 h.href = "../share/hedgewars/Data/Graphics/Hats/"+masks[i]+".png"; |
199 else |
199 else |
200 h.href = "https://hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Graphics/Hats/"+masks[i]+".png"; |
200 h.href = "//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Graphics/Hats/"+masks[i]+".png"; |
201 |
201 |
202 img = new Image(); |
202 img = new Image(); |
203 img.onload = function() { |
203 img.onload = function() { |
204 var name = this.id.substr(7); |
204 var name = this.id.substr(7); |
205 if (this.height === 32) { |
205 if (this.height === 32) { |
233 continue; |
233 continue; |
234 var link = document.createElement("a"); |
234 var link = document.createElement("a"); |
235 if (IS_LOCAL) |
235 if (IS_LOCAL) |
236 link.href = "../share/hedgewars/Data/Graphics/Hats/"+masks[i]+".png"; |
236 link.href = "../share/hedgewars/Data/Graphics/Hats/"+masks[i]+".png"; |
237 else |
237 else |
238 link.href = "https://hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Graphics/Hats/"+masks[i]+".png"; |
238 link.href = "//hg.hedgewars.org/hedgewars/raw-file/tip/share/hedgewars/Data/Graphics/Hats/"+masks[i]+".png"; |
239 link.appendChild(document.createTextNode(masks[i])); |
239 link.appendChild(document.createTextNode(masks[i])); |
240 pm.appendChild(link); |
240 pm.appendChild(link); |
241 if (i < missingMasks.length -1) |
241 if (i < missingMasks.length -1) |
242 pm.appendChild(document.createTextNode(", ")); |
242 pm.appendChild(document.createTextNode(", ")); |
243 } |
243 } |
365 // Select theme according to drop-down list value |
365 // Select theme according to drop-down list value |
366 function switchTheme() |
366 function switchTheme() |
367 { |
367 { |
368 var prefix; |
368 var prefix; |
369 if (!IS_LOCAL) |
369 if (!IS_LOCAL) |
370 prefix = "https://hg.hedgewars.org/hedgewars/raw-file/tip"; |
370 prefix = "//hg.hedgewars.org/hedgewars/raw-file/tip"; |
371 else |
371 else |
372 prefix = ".."; |
372 prefix = ".."; |
373 document.body.style.backgroundImage='url("'+prefix+'/share/hedgewars/Data/Themes/'+this.value+'/Sky.png")'; |
373 document.body.style.backgroundImage='url("'+prefix+'/share/hedgewars/Data/Themes/'+this.value+'/Sky.png")'; |
374 if (themes[this.value]) |
374 if (themes[this.value]) |
375 girder.style.backgroundImage='url("'+prefix+'/share/hedgewars/Data/Themes/'+this.value+'/Girder.png")'; |
375 girder.style.backgroundImage='url("'+prefix+'/share/hedgewars/Data/Themes/'+this.value+'/Girder.png")'; |