From 1cc633531bf5af2121b8d47e35750951dd7f6f93 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 24 Mar 2023 14:59:20 +0100 Subject: [PATCH 1/7] fake adding the read docs --- first-code/index.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/first-code/index.html b/first-code/index.html index f95f39e..8cf999f 100644 --- a/first-code/index.html +++ b/first-code/index.html @@ -203,6 +203,23 @@

Review title

+ + + + + From 55293cb214db217e0f7ee74d4cd050aa408907c2 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 24 Mar 2023 14:59:53 +0100 Subject: [PATCH 2/7] fake uplad files --- first-code/hello.js | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/first-code/hello.js b/first-code/hello.js index 179be58..8011e1d 100644 --- a/first-code/hello.js +++ b/first-code/hello.js @@ -88,4 +88,32 @@ console.log( newArrays ); const arraySplice = ['a', 'b', 'c', 'e', 'f']; arraySplice.splice(1, 4); //deleted e -console.log( arraySplice ); \ No newline at end of file +console.log( arraySplice ); + +function uploadFile() { + var input = document.getElementById("myFileUpload"); + var file = input.files[0]; + var formData = new FormData(); + + formData.append("file", file); + + var xhr = new XMLHttpRequest(); + xhr.open("POST", "/upload"); + xhr.send(formData); + } + + function readFile() { + var input = document.getElementById("myFileUpload"); + var file = input.files[0]; + if (file) { + var reader = new FileReader(); + reader.readAsText(file); + reader.onload = function(event) { + var contents = event.target.result; + console.log(reader.result); + alert(contents); + var fileContentsElement = document.getElementById("fileContents"); + fileContentsElement.textContent = contents; + }; + reader.readAsText(file); + }} \ No newline at end of file From bc8c323e3a6bd65fd2aa12b336b453dafbb9db34 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 24 Mar 2023 16:44:15 +0100 Subject: [PATCH 3/7] array looping --- README.md | 5 ++++- first-code/hello.js | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9392d19..5158ab1 100644 --- a/README.md +++ b/README.md @@ -113,4 +113,7 @@ values = ['1','2']; newValue = values.slice(1)// 1 only ``` -splice +Array searching and looping +--------------------------- + +https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach diff --git a/first-code/hello.js b/first-code/hello.js index 8011e1d..38422f2 100644 --- a/first-code/hello.js +++ b/first-code/hello.js @@ -116,4 +116,24 @@ function uploadFile() { fileContentsElement.textContent = contents; }; reader.readAsText(file); - }} \ No newline at end of file + }} + +const searchValues = ["a", "b", "c", "d"]; +console.log(searchValues.indexOf('c')); // 2 +console.log(searchValues.indexOf('f')); // -1 non exist values + +const searchSet = searchValues.filter(function(item){ + return item > 'b'; // c, d +}); +console.log(searchSet) + +const findValues = ["a", "bbbb", "c", "d"]; +const findSet = findValues.find(function(item){ + return item.length > 1; // b +}); +console.log(findSet) + +findValues.forEach(function(item) { + console.log(item) + +}); \ No newline at end of file From a57482451d5bf9af16dd446b9394f69a05d2d5f3 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Sun, 30 Apr 2023 21:54:41 +0200 Subject: [PATCH 4/7] test rst --- .vscode/settings.json | 3 +++ README.md | 10 ++++++++++ first-code/hello.js | 18 ++++++++++++++---- test.rst | 18 ++++++++++++++++++ 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 test.rst diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a7d0fc7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "esbonio.sphinx.confDir": "" +} \ No newline at end of file diff --git a/README.md b/README.md index 5158ab1..95ba3fb 100644 --- a/README.md +++ b/README.md @@ -117,3 +117,13 @@ Array searching and looping --------------------------- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach + +* array in DOM: + +variables +--------- +global +functional +use strict; + + diff --git a/first-code/hello.js b/first-code/hello.js index 38422f2..e3a09b0 100644 --- a/first-code/hello.js +++ b/first-code/hello.js @@ -125,15 +125,25 @@ console.log(searchValues.indexOf('f')); // -1 non exist values const searchSet = searchValues.filter(function(item){ return item > 'b'; // c, d }); -console.log(searchSet) +console.log(searchSet); const findValues = ["a", "bbbb", "c", "d"]; const findSet = findValues.find(function(item){ return item.length > 1; // b }); -console.log(findSet) +console.log(findSet); findValues.forEach(function(item) { - console.log(item) + console.log(item); -}); \ No newline at end of file +}); + +const container = document.getElementsByClassName('container'); + +console.log(container); +container[2].classList.add('d-none'); //remove picture of boots + +'use strict'; + +product = 126; +console.log(product); //error because of use strict \ No newline at end of file diff --git a/test.rst b/test.rst new file mode 100644 index 0000000..002fcea --- /dev/null +++ b/test.rst @@ -0,0 +1,18 @@ +.. title:: My Document +Paragraphs: +This is a paragraph. +Lists: +- Item 1 +- Item 2 +- Item 3 +Tables: +.. table:: My Table ++--------+--------+ +| Header | Header | ++========+========+ +| Cell 1 | Cell 2 | ++--------+--------+ +Directives: +.. figure:: my_image.png + :alt: My Image + :align: cent \ No newline at end of file From 0d69727b9f6bafb84fb94f7c430523bc62007fd9 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Sun, 30 Apr 2023 21:56:57 +0200 Subject: [PATCH 5/7] Update test.rst --- test.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test.rst b/test.rst index 002fcea..4b9a990 100644 --- a/test.rst +++ b/test.rst @@ -1,4 +1,5 @@ -.. title:: My Document +My Document +========= Paragraphs: This is a paragraph. Lists: From 51eb7eadd35f05bed46a3a03f7e19591a32fed6e Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Sun, 30 Apr 2023 21:57:52 +0200 Subject: [PATCH 6/7] Update test.rst --- test.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/test.rst b/test.rst index 4b9a990..5e65fc1 100644 --- a/test.rst +++ b/test.rst @@ -3,6 +3,7 @@ My Document Paragraphs: This is a paragraph. Lists: + - Item 1 - Item 2 - Item 3 From f697e3fe1b087b51af8be56c92598a4cce10f064 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Sun, 30 Apr 2023 21:58:28 +0200 Subject: [PATCH 7/7] Update test.rst --- test.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/test.rst b/test.rst index 5e65fc1..ce44cd8 100644 --- a/test.rst +++ b/test.rst @@ -9,6 +9,7 @@ Lists: - Item 3 Tables: .. table:: My Table + +--------+--------+ | Header | Header | +========+========+