diff --git a/javascript-basics-01/Step_1.html b/javascript-basics-01/Step_1.html index de81630..95b12fa 100644 --- a/javascript-basics-01/Step_1.html +++ b/javascript-basics-01/Step_1.html @@ -3,6 +3,7 @@ Step 1 + diff --git a/javascript-basics-01/Step_1.html + Step_1.js b/javascript-basics-01/Step_1.html + Step_1.js new file mode 100644 index 0000000..e97462e --- /dev/null +++ b/javascript-basics-01/Step_1.html + Step_1.js @@ -0,0 +1,2 @@ +var name ; +alert("name"); \ No newline at end of file diff --git a/javascript-basics-01/Step_2.html b/javascript-basics-01/Step_2.html index a214720..6e2e8c7 100644 --- a/javascript-basics-01/Step_2.html +++ b/javascript-basics-01/Step_2.html @@ -3,6 +3,7 @@ Step 2 + diff --git a/javascript-basics-01/Step_2.html + Step_2.js b/javascript-basics-01/Step_2.html + Step_2.js new file mode 100644 index 0000000..d282d90 --- /dev/null +++ b/javascript-basics-01/Step_2.html + Step_2.js @@ -0,0 +1,5 @@ +var name="Doe"; +var surname="john"; +var city="New-York"; +alert("Nom:"+name+"\nprenom:"+surname+"\nville:"+city); + diff --git a/javascript-basics-01/Step_3.html b/javascript-basics-01/Step_3.html index 20b2a19..c859be6 100644 --- a/javascript-basics-01/Step_3.html +++ b/javascript-basics-01/Step_3.html @@ -3,6 +3,7 @@ Step 3 + diff --git a/javascript-basics-01/Step_3.html + Step_3.js b/javascript-basics-01/Step_3.html + Step_3.js new file mode 100644 index 0000000..8177b37 --- /dev/null +++ b/javascript-basics-01/Step_3.html + Step_3.js @@ -0,0 +1,2 @@ +var name=prompt("what's your name ?"); +alert("hello, "+name) \ No newline at end of file diff --git a/javascript-basics-01/Step_4.html b/javascript-basics-01/Step_4.html index 12c8942..aa108e9 100644 --- a/javascript-basics-01/Step_4.html +++ b/javascript-basics-01/Step_4.html @@ -3,6 +3,7 @@ Step 4 +
diff --git a/javascript-basics-01/Step_4.html + Step_4.js b/javascript-basics-01/Step_4.html + Step_4.js new file mode 100644 index 0000000..b32c83a --- /dev/null +++ b/javascript-basics-01/Step_4.html + Step_4.js @@ -0,0 +1,4 @@ +var name=prompt("enter your name"); +var surname=prompt("enter your surname"); +var city=prompt("enter your city"); +alert("Nom:"+name+"\nprenom:"+surname+"\nville:"+city); \ No newline at end of file diff --git a/javascript-basics-01/Step_5.html b/javascript-basics-01/Step_5.html index 60479f2..9d0394e 100644 --- a/javascript-basics-01/Step_5.html +++ b/javascript-basics-01/Step_5.html @@ -3,6 +3,7 @@ Step 5 + diff --git a/javascript-basics-01/Step_5.html + Step_5.js b/javascript-basics-01/Step_5.html + Step_5.js new file mode 100644 index 0000000..e263621 --- /dev/null +++ b/javascript-basics-01/Step_5.html + Step_5.js @@ -0,0 +1,4 @@ +var num1=prompt("enter the first number"); +var num2=prompt("enter the second number"); +var result=num1*num2; +alert("result is "+result); \ No newline at end of file diff --git a/javascript-basics-01/Step_6.html b/javascript-basics-01/Step_6.html index b019dcc..a2c1da1 100644 --- a/javascript-basics-01/Step_6.html +++ b/javascript-basics-01/Step_6.html @@ -3,6 +3,7 @@ Step 6 + diff --git a/javascript-basics-01/Step_6.html + Step_6.js b/javascript-basics-01/Step_6.html + Step_6.js new file mode 100644 index 0000000..5809b14 --- /dev/null +++ b/javascript-basics-01/Step_6.html + Step_6.js @@ -0,0 +1,4 @@ +var num1=prompt("enter the first number"); +var num2=prompt("enter the second number"); +var result=num1%num2; +alert("result is "+result); \ No newline at end of file diff --git a/javascript-basics-01/Step_7.html b/javascript-basics-01/Step_7.html index 05ff583..849f95d 100644 --- a/javascript-basics-01/Step_7.html +++ b/javascript-basics-01/Step_7.html @@ -3,6 +3,7 @@ Step 7 + diff --git a/javascript-basics-01/Step_7.html + Step_7.js b/javascript-basics-01/Step_7.html + Step_7.js new file mode 100644 index 0000000..99b7a30 --- /dev/null +++ b/javascript-basics-01/Step_7.html + Step_7.js @@ -0,0 +1,6 @@ +var shoe=prompt("enter your shoe number"); +var birth=prompt("enter your birth year"); +function res(){ +result=(((((shoe*2)+5)*50)-birth)+1766); +alert("result is "+result);} +res(); \ No newline at end of file diff --git a/javascript-basics-01/Step_8.html b/javascript-basics-01/Step_8.html index 75804e8..fa0f56e 100644 --- a/javascript-basics-01/Step_8.html +++ b/javascript-basics-01/Step_8.html @@ -3,6 +3,7 @@ Step 8 + diff --git a/javascript-basics-01/Step_8.html + Step_8.js b/javascript-basics-01/Step_8.html + Step_8.js new file mode 100644 index 0000000..199f869 --- /dev/null +++ b/javascript-basics-01/Step_8.html + Step_8.js @@ -0,0 +1,8 @@ +var age=prompt("enter your age"); +function result(){ + if (age>18){ + alert("you are over 18 "); + } + else alert("you are under 18"); +} +result(); \ No newline at end of file diff --git a/javascript-basics-02/step 1/Step_1.js b/javascript-basics-02/step 1/Step_1.js new file mode 100644 index 0000000..bc944dc --- /dev/null +++ b/javascript-basics-02/step 1/Step_1.js @@ -0,0 +1,18 @@ +var pic=document.querySelector("#image1"); +pic.addEventListener('mouseover',ChangeImage); +pic.addEventListener('mouseout',ReturnImage); + +function ChangeImage(){ + image = document.getElementById('image1'); + image.src=('images/image1_2.jpg'); + + +} +function ReturnImage(){ + image = document.getElementById('image1'); + image.src=('images/image1.jpg'); + + +} + + diff --git a/javascript-basics-02/step 1/index.html b/javascript-basics-02/step 1/index.html index 5ad09a6..6def271 100644 --- a/javascript-basics-02/step 1/index.html +++ b/javascript-basics-02/step 1/index.html @@ -3,8 +3,10 @@ Step 1 + + diff --git a/javascript-basics-02/step 2/Step_2.js b/javascript-basics-02/step 2/Step_2.js new file mode 100644 index 0000000..bce522c --- /dev/null +++ b/javascript-basics-02/step 2/Step_2.js @@ -0,0 +1,6 @@ +var inp=document.querySelector("#name"); +inp.addEventListener("blur",unfocuse); +function unfocuse(){ + document.getElementById('name'); + alert("thank you for participating!"); +} \ No newline at end of file diff --git a/javascript-basics-02/step 2/index.html b/javascript-basics-02/step 2/index.html index cf25790..38b7b48 100644 --- a/javascript-basics-02/step 2/index.html +++ b/javascript-basics-02/step 2/index.html @@ -9,4 +9,5 @@
+ diff --git a/javascript-basics-02/step 3/Step_3.js b/javascript-basics-02/step 3/Step_3.js new file mode 100644 index 0000000..ddf73c2 --- /dev/null +++ b/javascript-basics-02/step 3/Step_3.js @@ -0,0 +1,8 @@ +var inp=document.querySelector("#name"); +var d=document.querySelector("#di"); +inp.addEventListener("input",ind); +function ind(){ + inp = document.getElementById('name') + d = document.getElementById('di'); + d.innerHTML = inp.value; +} \ No newline at end of file diff --git a/javascript-basics-02/step 3/index.html b/javascript-basics-02/step 3/index.html index 308c0b8..93c9a17 100644 --- a/javascript-basics-02/step 3/index.html +++ b/javascript-basics-02/step 3/index.html @@ -7,6 +7,8 @@
+
+ diff --git a/javascript-basics-02/step 4/Step_4.js b/javascript-basics-02/step 4/Step_4.js new file mode 100644 index 0000000..a014a71 --- /dev/null +++ b/javascript-basics-02/step 4/Step_4.js @@ -0,0 +1,7 @@ +function fun(){ + var answer = window.confirm("clear the form?"); +if (answer) { + document.getElementById("frm").reset(); +} + +} \ No newline at end of file diff --git a/javascript-basics-02/step 4/index.html b/javascript-basics-02/step 4/index.html index f5086df..8ada41a 100644 --- a/javascript-basics-02/step 4/index.html +++ b/javascript-basics-02/step 4/index.html @@ -5,11 +5,12 @@ Step 4 -
+ - +
+ diff --git a/javascript-basics-02/step 5/Step_5.js b/javascript-basics-02/step 5/Step_5.js new file mode 100644 index 0000000..8a4f36d --- /dev/null +++ b/javascript-basics-02/step 5/Step_5.js @@ -0,0 +1,14 @@ +function changeImage(){ + document.getElementById('image1').src = "images/image1_2.jpg"; + document.getElementById('image2').src = "images/image2_2.jpg"; + document.getElementById('image3').src = "images/image3_2.jpg"; + document.getElementById('image4').src = "images/image4_2.jpg"; + document.getElementById('image5').src = "images/image5_2.jpg"; +} +function returnImage(){ + document.getElementById('image1').src = "images/image1.jpg"; + document.getElementById('image2').src = "images/image2.jpg"; + document.getElementById('image3').src = "images/image3.jpg"; + document.getElementById('image4').src = "images/image4.jpg"; + document.getElementById('image5').src = "images/image5.jpg"; +} \ No newline at end of file diff --git a/javascript-basics-02/step 5/index.html b/javascript-basics-02/step 5/index.html index fe14eb9..c892e56 100644 --- a/javascript-basics-02/step 5/index.html +++ b/javascript-basics-02/step 5/index.html @@ -3,14 +3,18 @@ Step 5 +
- - - - - + + + + +
+ + + diff --git a/javascript-basics-02/step 6/Step_6.js b/javascript-basics-02/step 6/Step_6.js new file mode 100644 index 0000000..8a4f36d --- /dev/null +++ b/javascript-basics-02/step 6/Step_6.js @@ -0,0 +1,14 @@ +function changeImage(){ + document.getElementById('image1').src = "images/image1_2.jpg"; + document.getElementById('image2').src = "images/image2_2.jpg"; + document.getElementById('image3').src = "images/image3_2.jpg"; + document.getElementById('image4').src = "images/image4_2.jpg"; + document.getElementById('image5').src = "images/image5_2.jpg"; +} +function returnImage(){ + document.getElementById('image1').src = "images/image1.jpg"; + document.getElementById('image2').src = "images/image2.jpg"; + document.getElementById('image3').src = "images/image3.jpg"; + document.getElementById('image4').src = "images/image4.jpg"; + document.getElementById('image5').src = "images/image5.jpg"; +} \ No newline at end of file diff --git a/javascript-basics-02/step 6/index.html b/javascript-basics-02/step 6/index.html index 2eecf4f..0d917e1 100644 --- a/javascript-basics-02/step 6/index.html +++ b/javascript-basics-02/step 6/index.html @@ -5,10 +5,11 @@ Step 6 - - - - - + + + + + + diff --git a/javascript-basics-03/step 1/Step_1.js b/javascript-basics-03/step 1/Step_1.js new file mode 100644 index 0000000..53d59a0 --- /dev/null +++ b/javascript-basics-03/step 1/Step_1.js @@ -0,0 +1,4 @@ +function bord(){ + var pic = document.getElementById("image1"); + pic.style["border"] = "3px solid red"; +} \ No newline at end of file diff --git a/javascript-basics-03/step 1/index.html b/javascript-basics-03/step 1/index.html index eb4909d..7734802 100644 --- a/javascript-basics-03/step 1/index.html +++ b/javascript-basics-03/step 1/index.html @@ -5,6 +5,7 @@ Step 1 - + + diff --git a/javascript-basics-03/step 2/Step_2.js b/javascript-basics-03/step 2/Step_2.js new file mode 100644 index 0000000..18139f3 --- /dev/null +++ b/javascript-basics-03/step 2/Step_2.js @@ -0,0 +1,7 @@ +function fun(nbr) { + if (nbr === 2) { + document.getElementById('texte').style.display = "none"; + } else { + document.getElementById('texte').style.display = "block"; + } +} \ No newline at end of file diff --git a/javascript-basics-03/step 2/index.html b/javascript-basics-03/step 2/index.html index aeff7fa..315c59b 100644 --- a/javascript-basics-03/step 2/index.html +++ b/javascript-basics-03/step 2/index.html @@ -5,10 +5,11 @@ Step 2 -Show -Hide -
+Show +Hide +

Joseph Dacre Carlyle (Carlisle, 4 juin 1758 - Newcastle upon Tyne, 12 avril 1804) est un orientaliste anglais.Après ses études à l'université de Cambridge, il y devint professeur d'arabe. En 1799, il fut attaché par le gouvernement britannique à l'ambassade de Lord Elgin dans l'Empire ottoman. Il était chargé d'explorer les bibliothèques de la région (principalement celle du Sérail) pour y découvrir (et y acquérir) des manuscrits inédits de textes antiques. Il se rendit aussi en Égypte, en Terre sainte et au mont Athos. Sa mission fut, de son point de vue, un échec. Il acheta quelques centaines d'ouvrages, principalement dans les bazars de Constantinople, mais aucun ne contenait de texte inédit. Cependant, la façon dont certains manuscrits avaient été acquis, principalement ceux du patriarche de Jérusalem Anthème Ier, ainsi que la querelle entamée sur la plaine de Troie entre Carlyle et un autre professeur de Cambridge, Edward Daniel Clarke, allaient être utilisées, après la mort de Carlyle, contre Lord Elgin, dans les controverses autour de l'acquisition des « marbres d'Elgin ».De retour en Grande-Bretagne à l'automne 1801, Joseph Dacre Carlyle entama une traduction en arabe de la Bible. Sa mort en avril 1804 coupa court à ce travail.

+ diff --git a/javascript-basics-03/step 3/Step_3.js b/javascript-basics-03/step 3/Step_3.js new file mode 100644 index 0000000..db12609 --- /dev/null +++ b/javascript-basics-03/step 3/Step_3.js @@ -0,0 +1,11 @@ +function fun(nbr){ + if (nbr===1){ + document.getElementById('text').style.color="green"; + } + if (nbr===2){ + document.getElementById('text').style.color="red"; + } + if (nbr===3){ + document.getElementById('text').style.color="blue"; + } +} \ No newline at end of file diff --git a/javascript-basics-03/step 3/index.html b/javascript-basics-03/step 3/index.html index 0db3888..e0ea240 100644 --- a/javascript-basics-03/step 3/index.html +++ b/javascript-basics-03/step 3/index.html @@ -10,9 +10,10 @@

Tara, originellement nommée Antarctica puis Seamaster, est une goélette française destinée à la fois à l'exploration et à la défense de l'environnement. Dans le cadre de l'Année polaire internationale, en 2007-2008, ce voilier est utilisé en Arctique par l'expédition Tara Arctic dans le but de faire des relevés permettant de mieux comprendre les changements climatiques qui s'opèrent en Arctique. En 2009, dans le cadre de l'expédition Tara Oceans, Tara parcourt les mers et les océans dans une circumnavigation de trois ans afin d'étudier le piégeage des molécules de gaz carbonique (CO2) par les micro-organismes marins comme le plancton. En avril 2016, une nouvelle expédition est montée Tara Pacific dont l'objectif est de comprendre le corail, menacé par des facteurs humains et climatiques1.

-
-
-
+
+
+
+ diff --git a/javascript-basics-03/step 4/Step_4.js b/javascript-basics-03/step 4/Step_4.js new file mode 100644 index 0000000..ba5a9a1 --- /dev/null +++ b/javascript-basics-03/step 4/Step_4.js @@ -0,0 +1,13 @@ +function match(){ + var pass=document.getElementById('password'); + var conf=document.getElementById('confirmation'); + + if (pass.value==conf.value){ + pass.style["border"] = "3px solid green"; + conf.style["border"] = "3px solid green"; + } + else{ + pass.style["border"] = "3px solid red"; + conf.style["border"] = "3px solid red"; + } +} diff --git a/javascript-basics-03/step 4/index.html b/javascript-basics-03/step 4/index.html index cab276b..1d2b56d 100644 --- a/javascript-basics-03/step 4/index.html +++ b/javascript-basics-03/step 4/index.html @@ -8,7 +8,8 @@
- +
+ diff --git a/javascript-basics-04-tdd/questions.js b/javascript-basics-04-tdd/questions.js index d56a923..23caf2d 100644 --- a/javascript-basics-04-tdd/questions.js +++ b/javascript-basics-04-tdd/questions.js @@ -1,101 +1,118 @@ const stringSize = (text) => { - + return text.length; } const replaceCharacterE = (text) => { - + return text.replace("e"," ") } const concatString = (text1, text2) => { - + return text1+text2; } const showChar5 = (text) => { - + return text.slice(4,5) } const showChar9 = (text) => { - + return text.slice(0,9) } const toCapitals = (text) => { - + return text.toUpperCase() } const toLowerCase = (text) => { - + return text.toLowerCase() } const removeSpaces = (text) => { - + return text.trim() } const IsString = (text) => { - + if (typeof (text) === 'string'){ + return true + } } const getExtension = (text) => { + return text.split('.').pop() } const countSpaces = (text) => { - + return text.split(" ").length - 1 } const InverseString = (text) => { - + return text.split('').reverse().join('') + } const power = (x, y) => { + return Math.pow(x,y) } const absoluteValue = (num) => { + return Math.abs(num) } const absoluteValueArray = (array) => { + return array.map(Math.abs) } const circleSurface = (radius) => { + return Math.round (Math.PI * radius * radius); } const hypothenuse = (ab, ac) => { + return Math.hypot(ab, ac) } const BMI = (weight, height) => { + return Number((weight / (height * height)).toFixed(2)) } const createLanguagesArray = () => { - + return array=["Html","CSS","Java","PHP"] } const createNumbersArray = () => { - + return array=[0,1,2,3,4,5] } const replaceElement = (languages) => { + languages.splice(2, 1, "Javascript"); + return languages; } const addElement = (languages) => { + languages.push("Ruby","Python"); + return languages; } const addNumberElement = (numbers) => { - + numbers.unshift(-2,-1); + return numbers; } const removeFirst = (languages) => { - + languages.shift(1); + return languages; } const removeLast = (languages) => { - + languages.pop(5); + return languages; } const convertStrToArr = (social_arr) => { - + return social_arr.split(',') } const convertArrToStr = (languages) => { - + return languages.toString() } const sortArr = (social_arr) => { - + return social_arr.sort() } const invertArr = (social_arr) => { - + return social_arr.reverse() } \ No newline at end of file