Skip to content

Commit df12b47

Browse files
committed
new assignment and exercise08
1 parent 935c1a3 commit df12b47

32 files changed

+7995
-2015
lines changed
File renamed without changes.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
24+
# nyc test coverage
25+
.nyc_output
26+
27+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
28+
.grunt
29+
30+
# Bower dependency directory (https://bower.io/)
31+
bower_components
32+
33+
# node-waf configuration
34+
.lock-wscript
35+
36+
# Compiled binary addons (https://nodejs.org/api/addons.html)
37+
build/Release
38+
39+
# Dependency directories
40+
node_modules/
41+
jspm_packages/
42+
43+
# TypeScript v1 declaration files
44+
typings/
45+
46+
# Optional npm cache directory
47+
.npm
48+
49+
# Optional eslint cache
50+
.eslintcache
51+
52+
# Optional REPL history
53+
.node_repl_history
54+
55+
# Output of 'npm pack'
56+
*.tgz
57+
58+
# Yarn Integrity file
59+
.yarn-integrity
60+
61+
# dotenv environment variables file
62+
.env
63+
.env.test
64+
65+
# parcel-bundler cache (https://parceljs.org/)
66+
.cache
67+
68+
# next.js build output
69+
.next
70+
71+
# nuxt.js build output
72+
.nuxt
73+
74+
# vuepress build output
75+
.vuepress/dist
76+
77+
# Serverless directories
78+
.serverless/
79+
80+
# FuseBox cache
81+
.fusebox/
82+
83+
# DynamoDB Local files
84+
.dynamodb/
85+
86+
*.swp
File renamed without changes.
File renamed without changes.

Lesson06/exercise08/result/__tests__/calc.test.js renamed to Lesson06/assignment_solution/result/__tests__/calc.test.js

File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<title>Calculator</title>
6+
<link rel="stylesheet" type="text/css" href="css/style.css">
7+
</head>
8+
<body onload="load()">
9+
<div id="calculator">
10+
<!-- Screen and clear key -->
11+
<div class="top">
12+
<span id="clear">C</span>
13+
<div id="screen"></div>
14+
</div>
15+
16+
<div class="keys">
17+
<!-- operators and other keys -->
18+
<span id="seven">7</span>
19+
<span id="eight">8</span>
20+
<span id="nine">9</span>
21+
<span id="add" class="operator">+</span>
22+
<span id="four">4</span>
23+
<span id="five">5</span>
24+
<span id="six">6</span>
25+
<span id="minus" class="operator">-</span>
26+
<span id="one">1</span>
27+
<span id="two">2</span>
28+
<span id="three">3</span>
29+
<span id="divide" class="operator">÷</span>
30+
<span id="zero">0</span>
31+
<span id="decimal">.</span>
32+
<span id="equals" class="eval">=</span>
33+
<span id="multiply" class="operator">x</span>
34+
</div>
35+
</div>
36+
<script type="text/javascript" src="js/index.js"></script>
37+
</body>
38+
</html>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
server: {
3+
command: 'npm start',
4+
port: 8080,
5+
},
6+
}

Lesson06/exercise08/result/js/index.js renamed to Lesson06/assignment_solution/result/js/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ function load() {
1313
for (let i = 0; i < btns.length; i++) {
1414
let decimalAdded = false; // Flag used to avoid two decimal
1515

16+
/* eslint-disable */
1617
btns[i].addEventListener("click", function() {
18+
/* eslint-enable */
1719
btnValue = this.innerHTML;
1820
input = inputScreen.innerHTML;
1921

@@ -38,7 +40,9 @@ function load() {
3840
if (input) {
3941
// If the argument is an expression, eval() evaluates the expression.
4042
// If the argument is one or more JavaScript statements, eval() executes the statements.
43+
/* eslint-disable */
4144
inputScreen.innerHTML = eval(input);
45+
/* eslint-enable */
4246
}
4347
decimalAdded = false;
4448
break;

0 commit comments

Comments
 (0)