Skip to content

Commit 3386ec0

Browse files
committed
fixed some bugs
1 parent 250441f commit 3386ec0

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

New/dev/hangman.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function getWord() {
1313

1414

1515
//I check if there is JSON otherwise I load it
16-
if (true)//(typeof JSON == 'undefined')
16+
if (typeof JSON == 'undefined')
1717
{
1818
var headID = document.getElementsByTagName("head")[0];
1919
var newScript = document.createElement('script');

New/hangman.appcache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# v1 - desktop - 2011-10-31
2+
# v2 - desktop - 2011-10-31
33

44
CACHE:
55
img/gallow1.gif
@@ -23,7 +23,7 @@ style_desktop.php
2323
style.php
2424

2525
FALLBACK:
26-
/hangman.php
26+
hangman.php offline.php
2727

2828
NETWORK:
2929
*

New/hangman_js.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
header("Content-Type: text/javascript; charset=utf-8");
3-
#header("Cache-Control: max-age=31536000, public");
3+
header("Cache-Control: max-age=31536000, public");
44
?>
55
document.getElementById("guessword").innerHTML="";
66
function getWord(){var a=new Array("abate","aberrant","abscond","accolade","acerbic","acumen","adulation","adulterate","aesthetic","aggrandize","alacrity","alchemy","amalgamate","ameliorate","amenable","anachronism","anomaly","approbation","archaic","arduous","ascetic","assuage","astringent","audacious","austere","avarice","aver","axiom","bolster","bombast","bombastic","bucolic","burgeon","cacophony","canon","canonical","capricious","castigation","catalyst","caustic","censure","chary","chicanery",
@@ -10,7 +10,8 @@ function getWord(){var a=new Array("abate","aberrant","abscond","accolade","acer
1010
"paean","parody","pedagogy","pedantic","penurious","penury","perennial","perfidy","perfunctory","pernicious","perspicacious","peruse","pervade","pervasive","phlegmatic","pine","pious","pirate","pith","pithy","placate","platitude","plethora","plummet","polemical","pragmatic","prattle","precipitate","precursor","predilection","preen","prescience","presumptuous","prevaricate","pristine","probity","proclivity","prodigal","prodigious","profligate","profuse","proliferate","prolific","propensity","prosaic",
1111
"pungent","putrefy","quaff","qualm","querulous","query","quiescence","quixotic","quotidian","rancorous","rarefy","recalcitrant","recant","recondite","redoubtable","refulgent","refute","relegate","renege","repudiate","rescind","reticent","reverent","rhetoric","salubrious","sanction","satire","sedulous","shard","solicitous","solvent","soporific","sordid","sparse","specious","spendthrift","sporadic","spurious","squalid","squander","static","stoic","stupefy","stymie","subpoena","subtle","succinct","superfluous",
1212
"supplant","surfeit","synthesis","tacit","tenacity","terse","tirade","torpid","torque","tortuous","tout","transient","trenchant","truculent","ubiquitous","unfeigned","untenable","urbane","vacillate","variegated","veracity","vexation","vigilant","vilify","virulent","viscous","vituperate","volatile","voracious","waver","zealous");return a[parseInt(Math.random()*a.length)]}
13-
if(true){var headID=document.getElementsByTagName("head")[0];var newScript=document.createElement("script");newScript.type="text/javascript";newScript.src="json2_js.php";headID.appendChild(newScript)}var HANGMAN;function save_to_localstorage(key,value){if(Modernizr.localstorage)localStorage.setItem(key,JSON.stringify(value))}function initialize_hangman(){HANGMAN=new Object;HANGMAN["played"]=0;HANGMAN["won"]=0;HANGMAN["level"]="medium";HANGMAN["curgame"]=new Object;return HANGMAN}
13+
if(typeof JSON=="undefined"){var headID=document.getElementsByTagName("head")[0];var newScript=document.createElement("script");newScript.type="text/javascript";newScript.src="json2_js.php";headID.appendChild(newScript)}var HANGMAN;function save_to_localstorage(key,value){if(Modernizr.localstorage)localStorage.setItem(key,JSON.stringify(value))}
14+
function initialize_hangman(){HANGMAN=new Object;HANGMAN["played"]=0;HANGMAN["won"]=0;HANGMAN["level"]="medium";HANGMAN["curgame"]=new Object;return HANGMAN}
1415
function new_hangman_game(hangman_var){hangman_var["curgame"]=new Object;var newword=getWord();hangman_var["curgame"]["word"]=newword.toUpperCase();if(hangman_var["level"]=="easy")hangman_var["curgame"]["rem_chances"]=12;else if(hangman_var["level"]=="medium")hangman_var["curgame"]["rem_chances"]=6;else if(hangman_var["level"]=="hard")hangman_var["curgame"]["rem_chances"]=3;hangman_var["curgame"]["game_started"]=false;hangman_var["curgame"]["game_status"]="play";hangman_var["curgame"]["letter_guessed"]=
1516
new Object;return hangman_var}
1617
function show_set_level(level){if(level=="easy"){document.getElementById("level_easy").className+=" levelset";document.getElementById("level_medium").className=document.getElementById("level_medium").className.replace(/(?:^|\s)levelset(?!\S)/,"");document.getElementById("level_hard").className=document.getElementById("level_hard").className.replace(/(?:^|\s)levelset(?!\S)/,"")}else if(level=="medium"){document.getElementById("level_easy").className=document.getElementById("level_easy").className.replace(/(?:^|\s)levelset(?!\S)/,"");

New/offline.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
#Include the settings
33
require_once 'settings.php';
44
# Set the cache control header
5-
#header("Cache-Control: max-age=604800");
5+
header("Cache-Control: max-age=604800");
66
?>
77
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="en"
88
xml:lang="en"><head><meta charset="UTF-8" /><meta name="viewport"
99
content="width=device-width,initial-scale=1.0" /><title>Hangman</title><link rel="stylesheet" type="text/css"
10-
href="style.php"/><link rel="canonical"
11-
href="http://<?php echo $_SERVER['SERVER_NAME'].$path_parts['dirname'] ?>/hangman.php"/></head>
10+
href="style.php"/></head>
1211
<body>
1312
<div class="offline">
1413
<h1>You seem to be offline!<br/>Try to access the game sections manually.</h1>

0 commit comments

Comments
 (0)