Skip to content

Commit 6542592

Browse files
committed
Local testing no longer requires gulp; fix header navigation
Goal: make iteration faster by removing the gulp bundle & copy & copyback steps. There are four ways to load the pages: 1. On gh-pages (http://aimacode.github.io/aima-javascript/) 2. Locally (http://localhost/), from a webserver running in ./build/ 3. Locally (http://localhost/), from a webserver running in ./ 4. Locally (file:/// urls), without a webserver Prior to this change, (1) and (2) worked. This change makes (3) and (4) also work. The header.html file worked only for (2) and not for (1) which is the most important of these. With this change, all four work. gulp bundle was being used only to build "main.js", which loaded Bootstrap JS, Bootstrap CSS, and a site-wide CSS. It is not doing anything to the local html or js files. - Changed Bootstrap to load the same way we load JQuery and Two.JS: through a CDN. The CDN copy will be cached across sites. - Replaced the gulp-built main.js with a version that loads Bootstrap from the CDN. - Loaded the site-wide CSS directly from each page. - Moved common script to load header.html into main.js. - Moved the footer html to main.js. This will make it easier for us to modify the footer across pages. - Switched jquery from 1.10.2 to 1.12.4 to match Bootstrap 3's recommended version - Fixed typos (Stuart Russell's name, chapter titles) - Removed extra styles.css file (there were two and we were using only one) - Removed src/index.js as it was used to minify our own copy of Bootstrap and is no longer needed to load Bootstrap from CDN - Removed header.html from the home page, since the home page already has the chapters listed below the title. Also, there isn't a simple way to make header.html work in all the different use cases and also work on the home page. - Removed the large site header from the chapter pages, to better distinguish the home page from the chapter pages. - Updated gulpfile to match all these changes. There is no longer a "gulp bundle" or "gulp copyback"; gulp is only needed for deploying to gh-pages.
1 parent 5e4354e commit 6542592

File tree

34 files changed

+143
-502
lines changed

34 files changed

+143
-502
lines changed

1-Introduction/index.html

+3-12
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,11 @@
22
<html lang="en">
33
<head>
44
<title>1 Introduction</title>
5-
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
5+
<link rel="stylesheet" href="../styles.css">
6+
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
67
<script type="text/javascript" src="../main.js"></script>
7-
<script>
8-
$(function(){
9-
$('header').load("../header.html");
10-
});
11-
</script>
128
</head>
139
<body>
14-
<header>
15-
16-
</header>
1710

1811
<div class="row">
1912
<div class="col-sm-6 col-md-offset-3" id="content">
@@ -22,8 +15,6 @@ <h2>Introduction</h2>
2215
<p> Placeholder text </p>
2316
</div>
2417
</div>
25-
<footer class="container-fluid text-center">
26-
<img src="http://aima.cs.berkeley.edu/aima_logo.png">
27-
</footer>
18+
2819
</body>
2920
</html>

10-Classical-Planning/index.html

+3-18
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,18 @@
22
<html lang="en">
33
<head>
44
<title>10 Classical Planning </title>
5-
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
5+
<link rel="stylesheet" href="../styles.css">
6+
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
67
<script type="text/javascript" src="../main.js"></script>
7-
8-
<script>
9-
$(function(){
10-
$('header').load("../header.html");
11-
});
12-
</script>
138
</head>
149
<body>
15-
16-
<header>
17-
18-
</header>
1910

2011
<div class="row">
2112
<div class="col-sm-6 col-md-offset-3" id="content">
2213
<h1>Classical Planning</h1>
2314
<p>TODO</p>
24-
25-
2615
</div>
2716
</div>
28-
29-
<footer class="container-fluid text-center">
30-
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
31-
</footer>
32-
17+
3318
</body>
3419
</html>

11-Planning-And-Acting-In-The-Real-World/index.html

+2-15
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,11 @@
22
<html lang="en">
33
<head>
44
<title>11 Planning and Acting in The Real World </title>
5-
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
5+
<link rel="stylesheet" href="../styles.css">
6+
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
67
<script type="text/javascript" src="../main.js"></script>
7-
8-
<script>
9-
$(function(){
10-
$('header').load("../header.html");
11-
});
12-
</script>
138
</head>
149
<body>
15-
16-
<header>
17-
18-
</header>
1910

2011
<div class="row">
2112
<div class="col-sm-6 col-md-offset-3" id="content">
@@ -26,9 +17,5 @@ <h1>Planning and Acting in The Real World</h1>
2617
</div>
2718
</div>
2819

29-
<footer class="container-fluid text-center">
30-
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
31-
</footer>
32-
3320
</body>
3421
</html>

12-Knowledge-Representation/index.html

+2-15
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@
22
<html lang="en">
33
<head>
44
<title>12 Knowledge Representation </title>
5-
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
5+
<link rel="stylesheet" href="../styles.css">
6+
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
67
<script type="text/javascript" src="../main.js"></script>
7-
8-
<script>
9-
$(function(){
10-
$('header').load("../header.html");
11-
});
12-
</script>
138
</head>
149
<body>
1510

16-
<header>
17-
18-
</header>
19-
2011
<div class="row">
2112
<div class="col-sm-6 col-md-offset-3" id="content">
2213
<h1>Knowledge Representation</h1>
@@ -26,9 +17,5 @@ <h1>Knowledge Representation</h1>
2617
</div>
2718
</div>
2819

29-
<footer class="container-fluid text-center">
30-
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
31-
</footer>
32-
3320
</body>
3421
</html>

13-Quantifying-Uncertainity/index.html

+2-15
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,11 @@
22
<html lang="en">
33
<head>
44
<title>13 Quantifying Uncertainity</title>
5-
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
5+
<link rel="stylesheet" href="../styles.css">
6+
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
67
<script type="text/javascript" src="../main.js"></script>
7-
8-
<script>
9-
$(function(){
10-
$('header').load("../header.html");
11-
});
12-
</script>
138
</head>
149
<body>
15-
16-
<header>
17-
18-
</header>
1910

2011
<div class="row">
2112
<div class="col-sm-6 col-md-offset-3" id="content">
@@ -26,9 +17,5 @@ <h1>Quantifying Uncertainity</h1>
2617
</div>
2718
</div>
2819

29-
<footer class="container-fluid text-center">
30-
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
31-
</footer>
32-
3320
</body>
3421
</html>

14-Probabilistic-Reasoning/index.html

+2-15
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@
22
<html lang="en">
33
<head>
44
<title>14 Probabilistic Reasoning</title>
5-
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
5+
<link rel="stylesheet" href="../styles.css">
6+
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
67
<script type="text/javascript" src="../main.js"></script>
7-
8-
<script>
9-
$(function(){
10-
$('header').load("../header.html");
11-
});
12-
</script>
138
</head>
149
<body>
1510

16-
<header>
17-
18-
</header>
19-
2011
<div class="row">
2112
<div class="col-sm-6 col-md-offset-3" id="content">
2213
<h1>Probabilistic Reasoning</h1>
@@ -26,9 +17,5 @@ <h1>Probabilistic Reasoning</h1>
2617
</div>
2718
</div>
2819

29-
<footer class="container-fluid text-center">
30-
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
31-
</footer>
32-
3320
</body>
3421
</html>

15-Probabilistic-Reasoning-Over-Time/index.html

+2-15
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@
22
<html lang="en">
33
<head>
44
<title>15 Probabilistic Reasoning Over Time</title>
5-
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
5+
<link rel="stylesheet" href="../styles.css">
6+
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
67
<script type="text/javascript" src="../main.js"></script>
7-
8-
<script>
9-
$(function(){
10-
$('header').load("../header.html");
11-
});
12-
</script>
138
</head>
149
<body>
1510

16-
<header>
17-
18-
</header>
19-
2011
<div class="row">
2112
<div class="col-sm-6 col-md-offset-3" id="content">
2213
<h1>Probabilistic Reasoning Over Time</h1>
@@ -26,9 +17,5 @@ <h1>Probabilistic Reasoning Over Time</h1>
2617
</div>
2718
</div>
2819

29-
<footer class="container-fluid text-center">
30-
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
31-
</footer>
32-
3320
</body>
3421
</html>

16-Making-Simple-Decisions/index.html

+2-15
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@
22
<html lang="en">
33
<head>
44
<title>16 Making Simple Decisions</title>
5-
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
5+
<link rel="stylesheet" href="../styles.css">
6+
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
67
<script type="text/javascript" src="../main.js"></script>
7-
8-
<script>
9-
$(function(){
10-
$('header').load("../header.html");
11-
});
12-
</script>
138
</head>
149
<body>
1510

16-
<header>
17-
18-
</header>
19-
2011
<div class="row">
2112
<div class="col-sm-6 col-md-offset-3" id="content">
2213
<h1>Making Simple Decisions</h1>
@@ -26,9 +17,5 @@ <h1>Making Simple Decisions</h1>
2617
</div>
2718
</div>
2819

29-
<footer class="container-fluid text-center">
30-
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
31-
</footer>
32-
3320
</body>
3421
</html>

17-Making-Complex-Decisions/index.html

+2-15
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@
22
<html lang="en">
33
<head>
44
<title>17 Making Complex Decisions</title>
5-
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
5+
<link rel="stylesheet" href="../styles.css">
6+
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
67
<script type="text/javascript" src="../main.js"></script>
7-
8-
<script>
9-
$(function(){
10-
$('header').load("../header.html");
11-
});
12-
</script>
138
</head>
149
<body>
1510

16-
<header>
17-
18-
</header>
19-
2011
<div class="row">
2112
<div class="col-sm-6 col-md-offset-3" id="content">
2213
<h1>Making Complex Decisions</h1>
@@ -26,9 +17,5 @@ <h1>Making Complex Decisions</h1>
2617
</div>
2718
</div>
2819

29-
<footer class="container-fluid text-center">
30-
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
31-
</footer>
32-
3320
</body>
3421
</html>

18-Learning-From-Examples/index.html

+2-15
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,13 @@
22
<html lang="en">
33
<head>
44
<title>18 Learning From Examples</title>
5-
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
5+
<link rel="stylesheet" href="../styles.css">
6+
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
67
<script src="https://cdnjs.cloudflare.com/ajax/libs/two.js/0.6.0/two.min.js"></script>
78
<script type="text/javascript" src="../main.js"></script>
8-
9-
<script>
10-
$(function(){
11-
$('header').load("../header.html");
12-
});
13-
</script>
149
</head>
1510
<body>
1611

17-
<header>
18-
19-
</header>
20-
2112
<div class="row">
2213
<div class="col-sm-6 col-md-offset-3" id="content">
2314
<h1>Learning From Examples</h1>
@@ -27,9 +18,5 @@ <h1>Learning From Examples</h1>
2718
</div>
2819
</div>
2920

30-
<footer class="container-fluid text-center">
31-
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
32-
</footer>
33-
3421
</body>
3522
</html>

19-Knowledge-In-Learning/index.html

+2-15
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@
22
<html lang="en">
33
<head>
44
<title>19 Knowledge in Learning</title>
5-
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
5+
<link rel="stylesheet" href="../styles.css">
6+
<script src="http://code.jquery.com/jquery-1.12.4.js"></script>
67
<script type="text/javascript" src="../main.js"></script>
7-
8-
<script>
9-
$(function(){
10-
$('header').load("../header.html");
11-
});
12-
</script>
138
</head>
149
<body>
1510

16-
<header>
17-
18-
</header>
19-
2011
<div class="row">
2112
<div class="col-sm-6 col-md-offset-3" id="content">
2213
<h1>Knowledge in Learning</h1>
@@ -26,9 +17,5 @@ <h1>Knowledge in Learning</h1>
2617
</div>
2718
</div>
2819

29-
<footer class="container-fluid text-center">
30-
<img src="http://aima.cs.berkeley.edu/aima_logo.png"></img>
31-
</footer>
32-
3320
</body>
3421
</html>

0 commit comments

Comments
 (0)