diff --git a/m1.lesson5_6.flights-server-stage1/public/file2.html b/m1.lesson5_6.flights-server-stage1/public/file2.html index 61b5a3b..8f8e401 100644 --- a/m1.lesson5_6.flights-server-stage1/public/file2.html +++ b/m1.lesson5_6.flights-server-stage1/public/file2.html @@ -3,42 +3,87 @@ Demo File 2 - - + + + + -
-

Demo File 2

- -
- - -
- - - - - - - - - - - - - -
flights
No.FromToDepartureArrivalBy
-
- - +
+

Demo File 2

+ + +
+ + +
+ + + + + + + + + + + + + +
flights
No.FromToDepartureArrivalBy
+
+ + + + + + \ No newline at end of file diff --git a/m1.lesson7.jQuery.wack-a-mole-by-Chaim/wackAmole.html b/m1.lesson7.jQuery.wack-a-mole-by-Chaim/wackAmole.html new file mode 100644 index 0000000..8993356 --- /dev/null +++ b/m1.lesson7.jQuery.wack-a-mole-by-Chaim/wackAmole.html @@ -0,0 +1,154 @@ + + + + + + Memory + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+
+ + +
+ +
+
+

Instruction

+
    +
  1. Select the board size.
  2. +
  3. Match any two cards with the same icon, by clicking on them.
  4. +
  5. If you find a matched pair, these cards will stay open.
  6. +
  7. TThe game is finished when you matched the all available pairs.
  8. +
+ +
+ +
+ + + + + + + +
+ + + \ No newline at end of file diff --git a/m1.lesson8_Lodash-flights-server-by-chaim/privateFile.html b/m1.lesson8_Lodash-flights-server-by-chaim/privateFile.html new file mode 100644 index 0000000..b9a9acd --- /dev/null +++ b/m1.lesson8_Lodash-flights-server-by-chaim/privateFile.html @@ -0,0 +1,10 @@ + + + + + Private File + + +

Private File - should not have access from client

+ + \ No newline at end of file diff --git a/m1.lesson8_Lodash-flights-server-by-chaim/public/file1.html b/m1.lesson8_Lodash-flights-server-by-chaim/public/file1.html new file mode 100644 index 0000000..68a4a76 --- /dev/null +++ b/m1.lesson8_Lodash-flights-server-by-chaim/public/file1.html @@ -0,0 +1,10 @@ + + + + + Demo File + + +

Demo File 1

+ + \ No newline at end of file diff --git a/m1.lesson8_Lodash-flights-server-by-chaim/public/file2.html b/m1.lesson8_Lodash-flights-server-by-chaim/public/file2.html new file mode 100644 index 0000000..94fd8d5 --- /dev/null +++ b/m1.lesson8_Lodash-flights-server-by-chaim/public/file2.html @@ -0,0 +1,86 @@ + + + + + Demo File 2 + + + + + +
+

Demo File 2

+ + +
+ + +
+ + + + + + + + + + + + + +
flights
No.FromToDepartureArrivalBy
+
+ + + + + + + + \ No newline at end of file diff --git a/m1.lesson8_Lodash-flights-server-by-chaim/public/flights.json b/m1.lesson8_Lodash-flights-server-by-chaim/public/flights.json new file mode 100644 index 0000000..b038fbe --- /dev/null +++ b/m1.lesson8_Lodash-flights-server-by-chaim/public/flights.json @@ -0,0 +1,66 @@ +[ + { + "id": "ISR-6090", + "from": "Tel-Aviv", + "to": "Barcelona", + "departure": "2018-03-25 21:40", + "arrival": "2018-03-25 1:20", + "by": "El Al" + }, + { + "id": "ISR-6091", + "from": "Tel-Aviv", + "to": "Barcelona", + "departure": "2018-03-26 21:40", + "arrival": "2018-03-27 1:20", + "by": "El Al" + }, + { + "id": "IND-791", + "from": "Mumbai", + "to": "Tel-Aviv", + "departure": "2018-03-27 13:40", + "arrival": "2018-03-28 1:20", + "by": "Air India" + }, + { + "id": "IND-795", + "from": "Tel-Aviv", + "to": "Mumbai", + "departure": "2018-03-28 15:00", + "arrival": "2018-03-27 22:20", + "by": "Air India" + }, + { + "id": "FRC-500", + "from": "Tel-Aviv", + "to": "Paris", + "departure": "2018-03-20 15:00", + "arrival": "2018-03-20 19:20", + "by": "Air France" + }, + { + "id": "FRC-430", + "from": "Paris", + "to": "Tel-Aviv", + "departure": "2018-03-20 16:00", + "arrival": "2018-03-20 20:45", + "by": "Air France" + }, + { + "id": "ANT-430", + "from": "Paris", + "to": "Antarctica", + "departure": "2018-03-22 14:00", + "arrival": "2018-03-22 20:45", + "by": "Antarctica Air" + }, + { + "id": "ANT-431", + "from": "Antarctica", + "to": "Tel-Aviv", + "departure": "2018-03-23 10:00", + "arrival": "2018-03-23 20:45", + "by": "Antarctica Air" + } +] \ No newline at end of file diff --git a/m1.lesson8_Lodash-flights-server-by-chaim/public/style.css b/m1.lesson8_Lodash-flights-server-by-chaim/public/style.css new file mode 100644 index 0000000..dde39a1 --- /dev/null +++ b/m1.lesson8_Lodash-flights-server-by-chaim/public/style.css @@ -0,0 +1,34 @@ +body { + padding: 20px; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif +} + +section { + margin: 20px 0; +} + +h1 { + color: rgb(8, 70, 88); + text-shadow: 0 2px 3px #555; +} + +table { + border: 1px royalblue solid; + border-collapse: collapse; +} + +table caption { + color: #222; + text-shadow: 0 2px 3px #555; + padding: 10px; + font-size: 20px; +} + +table thead tr { + border-bottom: 1px royalblue solid; +} + +table td { + padding: 5px; +} + diff --git a/m1.lesson8_Lodash-flights-server-by-chaim/server.js b/m1.lesson8_Lodash-flights-server-by-chaim/server.js new file mode 100644 index 0000000..bb90af6 --- /dev/null +++ b/m1.lesson8_Lodash-flights-server-by-chaim/server.js @@ -0,0 +1,38 @@ +const http = require('http'); +const fs = require('fs'); +const url = require('url'); + +const contentTypes = new Map(); +contentTypes.set('html', 'text/html'); +contentTypes.set('js', 'text/javascript'); +contentTypes.set('css', 'text/css'); +contentTypes.set('json', 'application/json'); + + +http.createServer(function (req, res) { + const reqUrl = url.parse(req.url); + const ext = reqUrl.pathname.split('.')[1]; + const fileName = reqUrl.pathname.substr(1); + const cType = contentTypes.get(ext); + + + fs.readFile('public/' + fileName, function(err, data) { + if(err) { + if(err.code == 'ENOENT'){ + res.writeHead(404, {'Content-Type': 'text/plain'}); + res.write('Resource no found'); + } + else { + res.writeHead(500, {'Content-Type': 'text/plain'}); + res.write('Server Error'); + } + } else { + res.writeHead(200, {'Content-Type': cType}); + res.write(data); + } + res.end(); + }); +}).listen(8080, function () { + console.log('Client is available at http://localhost:8080'); +}); +