Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
lte --> lt [thanks S/N]
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Pilgrim committed Apr 27, 2010
1 parent 151f6ae commit e6eea23
Show file tree
Hide file tree
Showing 39 changed files with 73 additions and 42 deletions.
2 changes: 1 addition & 1 deletion detect.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Detecting HTML5 Features - Dive Into HTML5</title>
<!--[if lte IE 9]><script src=j/html5.js></script><![endif]-->
<!--[if lt IE 9]><script src=j/html5.js></script><![endif]-->
<link rel="shortcut icon" href=favicon.ico>
<link rel=alternate type=application/atom+xml href=http://hg.diveintohtml5.org/hgweb.cgi/atom-log>
<link rel=stylesheet href=screen.css>
Expand Down
2 changes: 1 addition & 1 deletion examples/blog-html5.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>My Weblog</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="alternate" type="application/atom+xml" title="My Weblog feed" href="/feed/" />
<link rel="search" type="application/opensearchdescription+xml" title="My Weblog search" href="opensearch.xml" />
Expand Down
2 changes: 1 addition & 1 deletion examples/event-plus-microdata.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>Mark Pilgrim&#8217;s event calendar</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<style>
time{float:none;font-size:inherit;margin:inherit}
Expand Down
2 changes: 1 addition & 1 deletion examples/event.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>Mark Pilgrim&#8217;s event calendar</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
</head>
<body class="eventcal">
Expand Down
33 changes: 32 additions & 1 deletion examples/halma.js
Expand Up @@ -4,13 +4,17 @@ var kPieceWidth = 50;
var kPieceHeight= 50;
var kPixelWidth = 1 + (kBoardWidth * kPieceWidth);
var kPixelHeight= 1 + (kBoardHeight * kPieceHeight);

var gCanvasElement;
var gDrawingContext;
var gPattern;

var gPieces;
var gNumPieces;
var gSelectedPieceIndex;
var gSelectedPieceHasMoved;
var gMoveCount;
var gGameInProgress;

function Cell(row, column) {
this.row = row;
Expand Down Expand Up @@ -105,7 +109,23 @@ function isThereAPieceBetween(cell1, cell2) {
return false;
}

function isTheGameOver() {
for (var i = 0; i < gNumPieces; i++) {
if (gPieces[i].row > 2) {
return false;
}
if (gPieces[i].column < (kBoardWidth - 3)) {
return false;
}
}
return true;
}

function drawBoard() {
if (gGameInProgress && isTheGameOver()) {
endGame();
}

gDrawingContext.clearRect(0, 0, kPixelWidth, kPixelHeight);

gDrawingContext.beginPath();
Expand Down Expand Up @@ -164,9 +184,15 @@ function newGame() {
gSelectedPieceIndex = -1;
gSelectedPieceHasMoved = false;
gMoveCount = 0;
gGameInProgress = true;
drawBoard();
}

function endGame() {
gSelectedPieceIndex = -1;
gGameInProgress = false;
}

function init() {
gCanvasElement = document.createElement("canvas");
gCanvasElement.id = "c";
Expand All @@ -175,7 +201,12 @@ function init() {
document.body.appendChild(gCanvasElement);
gCanvasElement.addEventListener("click", onclick, false);
gDrawingContext = gCanvasElement.getContext("2d");
newGame();
var pastel = new Image();
pastel.src = "../i/pastel.png";
pastel.onload = function() {
gPattern = gDrawingContext.createPattern(pastel, "repeat");
newGame();
}
}

window.onload = init;
2 changes: 1 addition & 1 deletion examples/input-autofocus-with-fallback.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input autofocus> fallback - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-autofocus.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input autofocus> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-placeholder.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input placeholder> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-color.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=color> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-date.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=date> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-datetime-local.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=datetime-local> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-datetime.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=datetime> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-email.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=email> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-month.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=month> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-number-min-max-step.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=number> with attributes - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-number.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=number> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-range.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=range> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-search.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=search> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-tel.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=tel> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-time.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=time> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-url.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=url> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/input-type-week.html
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>&lt;input type=week> - Dive Into HTML5</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name=viewport content='initial-scale=1.0' />
Expand Down
2 changes: 1 addition & 1 deletion examples/organization-plus-microdata.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>Business listings</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
</head>
<body class="phonebook">
Expand Down
2 changes: 1 addition & 1 deletion examples/organization.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>Business listings</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
</head>
<body class="phonebook">
Expand Down
2 changes: 1 addition & 1 deletion examples/person-plus-microdata.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>About Mark Pilgrim</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/person.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>About Mark Pilgrim</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion examples/review-plus-microdata.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>Anna&#8217;s Pizzeria: review</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
</head>
<body class="review">
Expand Down
2 changes: 1 addition & 1 deletion examples/review.html
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>Anna&#8217;s Pizzeria: review</title>
<!--[if lte IE 9]><script src="../j/html5.js"></script><![endif]-->
<!--[if lt IE 9]><script src="../j/html5.js"></script><![endif]-->
<link rel="stylesheet" href="style-html5.css" />
</head>
<body class="review">
Expand Down
2 changes: 1 addition & 1 deletion extensibility.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Distributed Extensibility - Dive Into HTML5</title>
<!--[if lte IE 9]><script src=j/html5.js></script><![endif]-->
<!--[if lt IE 9]><script src=j/html5.js></script><![endif]-->
<link rel="shortcut icon" href=favicon.ico>
<link rel=alternate type=application/atom+xml href=http://hg.diveintohtml5.org/hgweb.cgi/atom-log>
<link rel=stylesheet href=screen.css>
Expand Down
2 changes: 1 addition & 1 deletion forms.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>A Form of Madness - Dive Into HTML5</title>
<!--[if lte IE 9]><script src=j/html5.js></script><![endif]-->
<!--[if lt IE 9]><script src=j/html5.js></script><![endif]-->
<link rel="shortcut icon" href=favicon.ico>
<link rel=alternate type=application/atom+xml href=http://hg.diveintohtml5.org/hgweb.cgi/atom-log>
<link rel=stylesheet href=screen.css>
Expand Down
2 changes: 1 addition & 1 deletion geolocation.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>You Are Here (And So Is Everybody Else) - Dive Into HTML5</title>
<!--[if lte IE 9]><script src=j/html5.js></script><![endif]-->
<!--[if lt IE 9]><script src=j/html5.js></script><![endif]-->
<link rel="shortcut icon" href=favicon.ico>
<link rel=alternate type=application/atom+xml href=http://hg.diveintohtml5.org/hgweb.cgi/atom-log>
<link rel=stylesheet href=screen.css>
Expand Down
2 changes: 1 addition & 1 deletion introduction.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Introduction - Dive Into HTML5</title>
<!--[if lte IE 9]><script src=j/html5.js></script><![endif]-->
<!--[if lt IE 9]><script src=j/html5.js></script><![endif]-->
<link rel="shortcut icon" href=favicon.ico>
<link rel=alternate type=application/atom+xml href=http://hg.diveintohtml5.org/hgweb.cgi/atom-log>
<link rel=stylesheet href=screen.css>
Expand Down
2 changes: 1 addition & 1 deletion offline.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Let&#8217;s Take This Offline - Dive Into HTML5</title>
<!--[if lte IE 9]><script src=j/html5.js></script><![endif]-->
<!--[if lt IE 9]><script src=j/html5.js></script><![endif]-->
<link rel="shortcut icon" href=favicon.ico>
<link rel=alternate type=application/atom+xml href=http://hg.diveintohtml5.org/hgweb.cgi/atom-log>
<link rel=stylesheet href=screen.css>
Expand Down
2 changes: 1 addition & 1 deletion past.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>How Did We Get Here? - Dive Into HTML5</title>
<!--[if lte IE 9]><script src=j/html5.js></script><![endif]-->
<!--[if lt IE 9]><script src=j/html5.js></script><![endif]-->
<link rel="shortcut icon" href=favicon.ico>
<link rel=alternate type=application/atom+xml href=http://hg.diveintohtml5.org/hgweb.cgi/atom-log>
<link rel=stylesheet href=screen.css>
Expand Down

0 comments on commit e6eea23

Please sign in to comment.