diff --git a/challenges/03-front-end-libraries/jquery.json b/challenges/03-front-end-libraries/jquery.json index 7d35e69ca..4287b92d4 100644 --- a/challenges/03-front-end-libraries/jquery.json +++ b/challenges/03-front-end-libraries/jquery.json @@ -5,7 +5,8 @@ "helpRoom": "Help", "required": [ { - "link": "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" + "link": + "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" } ], "challenges": [ @@ -23,19 +24,25 @@ ], "tests": [ { - "text": "Create a script element making sure it is valid and has a closing tag.", - "testString": "assert(code.match(/<\\/script\\s*>/g) && code.match(//g) && code.match(/<\\/script\\s*>/g).length === code.match(//g).length, 'Create a script element making sure it is valid and has a closing tag.');" + "text": + "Create a script element making sure it is valid and has a closing tag.", + "testString": + "assert(code.match(/<\\/script\\s*>/g) && code.match(//g) && code.match(/<\\/script\\s*>/g).length === code.match(//g).length, 'Create a script element making sure it is valid and has a closing tag.');" }, { - "text": "You should add $(document).ready(function() { to the beginning of your script element.", - "testString": "assert(code.match(/\\$\\s*?\\(\\s*?document\\s*?\\)\\.ready\\s*?\\(\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/g), 'You should add $(document).ready(function() { to the beginning of your script element.');" + "text": + "You should add $(document).ready(function() { to the beginning of your script element.", + "testString": + "assert(code.match(/\\$\\s*?\\(\\s*?document\\s*?\\)\\.ready\\s*?\\(\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/g), 'You should add $(document).ready(function() { to the beginning of your script element.');" }, { - "text": "Close your $(document).ready(function() { function with });", - "testString": "assert(code.match(/\\n*?\\s*?\\}\\s*?\\);/g), 'Close your $(document).ready(function() { function with });');" + "text": + "Close your $(document).ready(function() { function with });", + "testString": + "assert(code.match(/\\n*?\\s*?\\}\\s*?\\);/g), 'Close your $(document).ready(function() { function with });');" } ], - "challengeType": 0, + "challengeType": 6, "translations": { "de": { "title": "Lerne, wie Script Tags und Document Ready funktionieren", @@ -50,7 +57,8 @@ ] }, "es": { - "title": "Aprende cómo funcionan las etiquetas de programa y la función de documento listo.", + "title": + "Aprende cómo funcionan las etiquetas de programa y la función de documento listo.", "description": [ "Ahora estamos listos para aprender jQuery, la herramienta de JavaScript más popular de todos los tiempos. No te preocupes por JavaScript en si --lo cubriremos pronto.", "Antes de que podamos comenzar a usar jQuery, tenemos que añadir algunas cosas a nuestro HTML.", @@ -62,7 +70,8 @@ ] }, "fr": { - "title": "Apprendre comment fonctionnent les balises Script et Document Ready", + "title": + "Apprendre comment fonctionnent les balises Script et Document Ready", "description": [ "Nous sommes maintenant prêt à apprendre jQuery, l'outil JavaScript le plus populaire de tout les temps. Ne vous inquiétez pas à propos de JavaScript lui-même, nous y viendrons bientôt.", "Avant de pouvoir utiliser jQuery, nous avons besoin d'ajouter certaines choses à notre HTML.", @@ -114,7 +123,8 @@ "title": "Target HTML Elements with Selectors Using jQuery", "required": [ { - "link": "https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css" + "link": + "https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css" } ], "description": [ @@ -127,19 +137,24 @@ ], "tests": [ { - "text": "Use the jQuery addClass() function to give the classes animated and bounce to your button elements.", - "testString": "assert($(\"button\").hasClass(\"animated\") && $(\"button\").hasClass(\"bounce\"), 'Use the jQuery addClass() function to give the classes animated and bounce to your button elements.');" + "text": + "Use the jQuery addClass() function to give the classes animated and bounce to your button elements.", + "testString": + "assert($(\"button\").hasClass(\"animated\") && $(\"button\").hasClass(\"bounce\"), 'Use the jQuery addClass() function to give the classes animated and bounce to your button elements.');" }, { "text": "Only use jQuery to add these colors to the element.", - "testString": "assert(!code.match(/class.*animated/g), 'Only use jQuery to add these colors to the element.');" + "testString": + "assert(!code.match(/class.*animated/g), 'Only use jQuery to add these colors to the element.');" }, { - "text": "Your jQuery code should be within the $(document).ready(); function.", - "testString": "assert(code.match(/\\$\\(document\\)\\.ready\\(function.*(\\s|\\n)*.*button.*.addClass.*\\);/g), 'Your jQuery code should be within the $(document).ready(); function.');" + "text": + "Your jQuery code should be within the $(document).ready(); function.", + "testString": + "assert(code.match(/\\$\\(document\\)\\.ready\\(function.*(\\s|\\n)*.*button.*.addClass.*\\);/g), 'Your jQuery code should be within the $(document).ready(); function.');" } ], - "challengeType": 0, + "challengeType": 6, "translations": { "de": { "title": "HTML-Elemente mit Selektoren durch jQuery auswählen", @@ -222,7 +237,8 @@ "title": "Target Elements by Class Using jQuery", "required": [ { - "link": "https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css" + "link": + "https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css" } ], "description": [ @@ -236,15 +252,18 @@ ], "tests": [ { - "text": "Use the jQuery addClass() function to give the classes animated and shake to all your elements with the class well.", - "testString": "assert($(\".well\").hasClass(\"animated\") && $(\".well\").hasClass(\"shake\"), 'Use the jQuery addClass() function to give the classes animated and shake to all your elements with the class well.');" + "text": + "Use the jQuery addClass() function to give the classes animated and shake to all your elements with the class well.", + "testString": + "assert($(\".well\").hasClass(\"animated\") && $(\".well\").hasClass(\"shake\"), 'Use the jQuery addClass() function to give the classes animated and shake to all your elements with the class well.');" }, { "text": "Only use jQuery to add these classes to the element.", - "testString": "assert(!code.match(/class\\.\\*animated/g), 'Only use jQuery to add these classes to the element.');" + "testString": + "assert(!code.match(/class\\.\\*animated/g), 'Only use jQuery to add these classes to the element.');" } ], - "challengeType": 0, + "challengeType": 6, "translations": { "de": { "title": "Elemente anhand von Klassen mit jQuery auswählen", @@ -329,7 +348,8 @@ "title": "Target Elements by id Using jQuery", "required": [ { - "link": "https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css" + "link": + "https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css" } ], "description": [ @@ -342,19 +362,24 @@ ], "tests": [ { - "text": "Select the button element with the id of target3 and use the jQuery addClass() function to give it the class of animated.", - "testString": "assert($(\"#target3\").hasClass(\"animated\"), 'Select the button element with the id of target3 and use the jQuery addClass() function to give it the class of animated.');" + "text": + "Select the button element with the id of target3 and use the jQuery addClass() function to give it the class of animated.", + "testString": + "assert($(\"#target3\").hasClass(\"animated\"), 'Select the button element with the id of target3 and use the jQuery addClass() function to give it the class of animated.');" }, { - "text": "Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.", - "testString": "assert(($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\")) && code.match(/\\$\\(\\s*.#target3.\\s*\\)/g), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.');" + "text": + "Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.", + "testString": + "assert(($(\"#target3\").hasClass(\"fadeOut\") || $(\"#target3\").hasClass(\"fadeout\")) && code.match(/\\$\\(\\s*.#target3.\\s*\\)/g), 'Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.');" }, { "text": "Only use jQuery to add these classes to the element.", - "testString": "assert(!code.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.');" + "testString": + "assert(!code.match(/class.*animated/g), 'Only use jQuery to add these classes to the element.');" } ], - "challengeType": 0, + "challengeType": 6, "translations": { "de": { "title": "Elemente anhand der id mit jQuery auswählen", @@ -438,7 +463,8 @@ "title": "Delete Your jQuery Functions", "required": [ { - "link": "https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css" + "link": + "https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css" } ], "description": [ @@ -447,27 +473,35 @@ ], "tests": [ { - "text": "Delete all three of your jQuery functions from your document ready function.", - "testString": "assert(code.match(/\\{\\s*\\}\\);/g), 'Delete all three of your jQuery functions from your document ready function.');" + "text": + "Delete all three of your jQuery functions from your document ready function.", + "testString": + "assert(code.match(/\\{\\s*\\}\\);/g), 'Delete all three of your jQuery functions from your document ready function.');" }, { "text": "Leave your script element intact.", - "testString": "assert(code.match(/