From 43e99db8c12c5d0a8a9b12dff5c748dcc1bce4af Mon Sep 17 00:00:00 2001 From: 9k5m Date: Fri, 15 Apr 2016 23:24:58 +0200 Subject: [PATCH 01/28] German Translation of jQuery Challenges --- .../jquery.json | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) diff --git a/seed/challenges/01-front-end-development-certification/jquery.json b/seed/challenges/01-front-end-development-certification/jquery.json index ed8430f735..00173ab56c 100644 --- a/seed/challenges/01-front-end-development-certification/jquery.json +++ b/seed/challenges/01-front-end-development-certification/jquery.json @@ -59,6 +59,16 @@ "Dentro de tu elemento script, agrega este código: $(document).ready(function () { A continuación, ciérralo en la línea siguiente (aún dentro de tu elemento script) con: })", "Más adelante aprenderemos más acerca de funciones. Lo importante es saber que el código que pongas dentro de esta función (function) se ejecutará tan pronto como tu navegador haya cargado la página.", "Esto es importante porque sin tu función de documento listo, tu código puede ejecutarse antes de que se haya presentado el HTML, lo que podría causar errores." + ], + "titleDe": "Lerne, wie Script Tags und Document Ready funktionieren", + "descriptionDe": [ + "Jetzt sind wir bereit jQuery zu lernen, das populärste JavaScript-Tool aller Zeiten. Mach dir über JavaScript keine Sorgen - über dieses werden wir bald sprechen.", + "Bevor wir jQuery nutzen können, müssen wir erst ein paar Dinge zu unserem HTML hinzufügen.", + "Füge als erstes ein script Element am Beginn deiner Seite ein. Vergewissere dich, dass du das Element in der nächsten Zeile geschlossen hast.", + "Dein Browser wird jegliches JavaScript, jQuery eingeschlossen, innerhalb eines script Elements ausführen.", + "Füge innerhalb deines script Elements folgenden Code hinzu: $(document).ready(function() {. Schließe ihn danach in der nächsten Zeile (noch immer innerhalb deines script Elements) mit: });", + "Wir werden später noch mehr über Funktionen lernen. Wichtig zu wissen ist, dass der Code innerhalb der Funktion ausgeführt wird, sobald der Browser die Seite geladen hat.", + "Das ist wichtig, denn ohne deine Document Ready Funktion könnte dein Code ausgeführt werden, bevor das HTML gerendert wurde - was zu Fehlern führen kann." ] }, { @@ -117,6 +127,15 @@ "Por ejemplo, hagamos que todos tus elementos button reboten. Sólo tienes que añadir este código dentro de la función de documento listo: ", "$(\"button\").addClass(\"animated bounce\")", "Ten en cuenta que ya hemos incluido tanto la biblioteca jQuery como la biblioteca Animate.css en segundo plano para que pueda utilizarlos en el editor. Así que estás usando jQuery para aplicar la clase bounce de Animate.css a tus elementos button." + ], + "titleDe": "HTML-Elemente mit Selektoren durch jQuery auswählen", + "descriptionDe": [ + "Jetzt haben wir eine Document Ready Funktion.", + "Lass uns unser erstes jQuery Statement schreiben. Alle jQuery Funktionen starten mit einem $, für gewöhnlich als Dollar-Zeichen Operator bezeichnet.", + "jQuery wählt oft HTML-Elemente mit einem Selektor aus, um dann mit diesen Elementen etwas zu machen.", + "Zum Beispiel, lasse alle deine Button Elemente hüpfen. Dazu musst du nur folgenden Code in deine Document Ready Funktion hinzufügen:", + "$(\"button\").addClass(\"animated bounce\");", + "Beachte, dass wir bereits jQuery und Animate.css im Hintergrund hinzugefügt haben, damit du diese im Editor nutzen kannst. Du nutzt also jQuery um die bounce Klasse von Animate.css zu deinen Button Elementen hinzuzufügen." ] }, { @@ -177,6 +196,16 @@ "A continuación, utiliza la función .addClass() de jQuery para agregar las clases animated y shake.", "Por ejemplo, podrías hacer que todos los elementos con la clase text-primary se sacudieran añadiendo lo siguiente a tu función de documento listo:", "$(\".text-primary\").addClass(\"animated shake\");" + ], + "titleDe": "Elemente anhand von Klassen mit jQuery auswählen", + "descriptionDe": [ + "Siehst du, wie wir alle deine Button Elemente hüpfen haben lassen? Wir haben sie mit $(\"button\") ausgewählt, dann CSS-Klassen mit .addClass(\"animated bounce\"); hinzugefügt.", + "Du hast gerade jQuery's .addClass() Funktion genutzt, die dir erlaubt, Klassen zu Elemente hinzuzufügen.", + "Wähle als erstes deine div Elemente mit der Klasse well, indem du den $(\".well\") Selektor nutzt.", + "Bedenke, dass du - genauso wie bei CSS-Deklarationen - einen . vor den Namen der Klasse setzen musst.", + "Dann nutze die jQuery Funktion .addClass() um die Klassen animated und shake hinzuzufügen.", + "Zum Beispiel könntest du alle Elemente mit der Klasse text-primary schütteln lassen, indem du folgendes zu deiner Document Ready Funktion hinzufügst:", + "$(\".text-primary\").addClass(\"animated shake\");" ] }, { @@ -238,6 +267,15 @@ "A continuación, utiliza la función .addClass() de jQuery para agregar las clases animated y fadeOut.", "He aquí cómo haces que desaparezca el elemento button con la identificación target6:", "$(\"#target6\").addClass(\"animated fadeOut\")." + ], + "titleDe": "Elemente anhand der ID mit jQuery auswählen", + "descriptionDe": [ + "Du kannst Elemente auch anhand deren ID-Attributs auswählen.", + "Wähle als erstes dein Button Element mit der ID target3, indem du den $(\"#target3\") Selektor nutzt.", + "Bedenke, dass du - genauso wie bei CSS-Deklarationen - eine # vor den Namen der Klasse setzen musst.", + "Dann nutze die jQuery Funktion .addClass() um die Klassen animated und fadeOut hinzuzufügen.", + "So könntest du das Button Element mit der ID target6 ausblenden lassen:", + "$(\"#target6\").addClass(\"animated fadeOut\")." ] }, { @@ -294,6 +332,11 @@ "descriptionEs": [ "Estas animaciones eran divertidas al principio, pero ahora se están volviendo una distracción.", "Elimina esas tres funciones jQuery de tu función de documento listo, pero deja intacta la declaración de la función de documento listo." + ], + "titleDe": "Lösche deine jQuery Funktionen", + "descriptionDe": [ + "Anfangs waren diese Animationen noch cool, jetzt sind sie aber ein wenig störend.", + "Lösche alle drei jQuery Funktionen deiner Document Ready Funktion, aber lasse die Document Ready Funktion selbst intakt." ] }, { @@ -356,6 +399,15 @@ "Agregar la clase animated a todos los elementos con tipo button.", "Agregar la clase shake a todos los botones con clase .btn.", "Agregar la clase btn-primary al botón con identificación #target1." + ], + "titleDe": "Wähle das gleiche Element mit mehreren jQuery Selektoren aus", + "descriptionDe": [ + "Bis jetzt kennst du drei verschiedene Wege um Elemente auszuwählen: mit dem Element-Typ: $(\"button\"), mit der Element-Klasse: $(\".btn\"), und der Element-ID: $(\"#target1\").", + "Auch wenn es möglich ist, mehrere Klassen in einem einzigen .addClass() Aufruf hinzuzufügen, lass uns jetzt die Klassen in drei verschiedenen Wegen dem Element hinzufügen.", + "Nutze jeden der oben erwähnten jQuery Selektoren und die addClass() Funktion:", + "Füge die Klasse animated zu allen Elementen des Typs button hinzu.", + "Füge die Klasse shake zu allen Buttons mit der Klasse .btn hinzu.", + "Füge die Klasse btn-primary zu dem Button mit der ID #target1 hinzu." ] }, { @@ -414,6 +466,13 @@ "He aquí cómo puedes hacerlo para un botón específico:", "$(\"#target2\").removeClass(\"btn-default\");", "Vamos a quitar la clase btn-default de todos nuestros elementos button." + ], + "titleDe": "Entferne Klassen von einem Element mit jQuery", + "descriptionDe": [ + "Genauso wie du Klassen mit der jQuery Funktion addClass() hinzufügen kannst, kannst du mit der jQuery Funktion removeClass() Klassen entfernen.", + "So könntest du das bei einem spezifischen Button machen:", + "$(\"#target2\").removeClass(\"btn-default\");", + "Lass uns alle btn-default Klassen von unseren Button Elementen entfernen." ] }, { @@ -478,6 +537,16 @@ "Esto es un poco diferente a una declaración normal CSS, porque la propiedad CSS y su valor están entre comillas y separadas por una coma en lugar de dos puntos.", "Elimina tus selectores jQuery, dejando en blanco la función de documento listo.", "Selecciona target1 y cambia su color a rojo." + ], + "titleDe": "Das CSS eines Elements mit jQuery ändern", + "descriptionDe": [ + "Wir können auch das CSS eines HTML-Elements mit jQuery verändern.", + "jQuery hat die Funktion .css(), welche dir erlaubt, das CSS eines Elements zu ändern.", + "So können wir die Farbe einer ID zu Blau ändern:", + "$(\"#target1\").css(\"color\", \"blue\");", + "Das ist ein wenig anders als eine normale CSS-Deklaration, weil die CSS-Eigenschaft und deren Wert in Anführungszeichen sind und durch ein Komma anstatt eines Doppelpunkts getrennt werden.", + "Lösche deine jQuery Selektoren, damit eine leere Document Ready Funktion übrig bleibt.", + "Wähle target1 und ändere dessen Farbe zu Rot." ] }, { @@ -538,6 +607,15 @@ "He aquí cómo puedes desactivar todos los botones:", "$(\"button\").prop(\"disabled\", true);", "Desactiva sólo el botón target1." + ], + "titleDe": "Elemente mit jQuery deaktivieren", + "descriptionDe": [ + "Du kannst auch die nicht-CSS Eigenschaften eines HTML-Elements mit jQuery ändern. Zum Beispiel kannst du Buttons deaktivieren.", + "Wenn du einen Button deaktivierst, wird er grau unterlegt und kann nicht mehr geklickt werden.", + "jQuery hat eine Funktion namens .prop(), die es dir erlaubt, die Eigenschaften von Elementen anzupassen.", + "So kannst du alle Buttons deaktivieren:", + "$(\"button\").prop(\"disabled\", true);", + "Deaktiviere nur den target1 Button." ] }, { @@ -600,6 +678,15 @@ "$(\"h3\").html(\"<i>jQuery Playground</i>\");", "jQuery también tiene una función similar llamada .text() que sólo altera el texto sin añadir etiquetas.", "Cambia el botón con identificación target4 de forma que su texto quede en itálicas." + ], + "titleDe": "Ändere den Text innerhalb eines Elements mit jQuery", + "descriptionDe": [ + "Mit jQuery kannst du den Text zwischen dem Start- und dem End-Tag eines Elements ändern. Du kannst sogar das HTML-Markup ändern.", + "jQuery hat eine Funktion namens .html(), die dich HTML-Tags und Text innerhalb eines Elements hinzufügen lässt. Jeglicher Content der sich vorher innerhalb des Elements befand, wird mit jenem Content ersetzt, den du durch diese Funktion bereitstellst.", + "So kannst du den Text unserer Überschrift überschreiben und hervorheben:", + "$(\"h3\").html(\"<em>jQuery Playground</em>\");", + "jQuery hat auch eine weitere ähnliche Funktion namens .text(), welche nur den Text ändert, ohne Tags hinzuzufügen. In anderen Worten: diese Funktion evaluiert keinerlei HTML-Tags, die an sie übergeben werden, sondern behandelt diese als Text, den du mit der Funktion ersetzen willst.", + "Ändere den Button mit der ID target4 indem du seinen Text hervorhebst." ] }, { @@ -654,6 +741,12 @@ "Ahora quitemos un elemento HTML de tu página usando jQuery.", "jQuery tiene una función llamada .remove() que eliminará un elemento HTML por completo", "Elimina el elemento con identificación target4 de la página utilizando la función .remove()." + ], + "titleDe": "Entferne ein Element mit jQuery", + "descriptionDe": [ + "Lass uns jetzt ein HTML-Element mit jQuery von deiner Seite entfernen.", + "jQuery hat eine Funktion namens .remove(), die ein HTML-Element komplett entfernt.", + "Entferne das Element target4 von der Seite, indem du die .remove() Funktion nutzt." ] }, { @@ -714,6 +807,14 @@ "Por ejemplo, si quisiéramos mover target4 de nuestro pozo (well) derecho a nuestro pozo izquierdo, usaríamos:", "$(\"#target4\").appendTo(\"#left-well\");", "Mueve tu elemento target2 de tu left-well a tu right-well." + ], + "titleDe": "Verwende appendTo um Elemente mit jQuery zu verschieben.", + "descriptionDe": [ + "Lass uns jetzt versuchen, ein Element von einem div zum Nächsten zu verschieben.", + "jQuery hat eine Funktion namens appendTo(), die es dir erlaubt HTML-Elemente auszuwählen und diese zu einem anderen Element anzuhängen.", + "Wenn wir zum Beispiel target4 von right-well zu left-well verschieben wollen, würden wir folgenden Code nutzen:", + "$(\"#target4\").appendTo(\"#left-well\");", + "Verschiebe dein target2 Element von left-well zu right-well." ] }, { @@ -777,6 +878,15 @@ "$(\"#target2\").clone().appendTo(\"#right-well\");", "¿Te diste cuenta que esto implica pegar dos funciones jQuery? Esto se conoce como encadenamiento y es una manera conveniente de hacer las cosas con jQuery. ", "Clona tu elemento target5 y añadelo a tu left-well." + ], + "titleDe": "Ein Element kopieren mit jQuery", + "descriptionDe": [ + "Neben der Möglichkeit Elemente zu verschieben, können diese auch von einem Platz zum nächsten kopiert werden.", + "jQuery hat eine Funktion namens clone(), die eine Kopie eines Elements anfertigt.", + "Wenn wir zum Beispiel target2 von left-well zu right-well kopieren wollen, würden wir folgenden Code nutzen:", + "$(\"#target2\").clone().appendTo(\"#right-well\");", + "Ist dir aufgefallen, dass wir dazu zwei jQuery Funktionen miteinander verknüpfen? Das nennt sich function chaining und ist eine praktische Art um mit jQuery zu Lösungen zu kommen.", + "Kopiere dein target5 Element und verschiebe es zu left-well." ] }, { @@ -844,6 +954,15 @@ "He aquí un ejemplo de cómo se utiliza la función parent() si quisieras darle al elemento padre del elemento left-well un color de fondo azul:", "$(\"#left-well\").parent().css(\"background-color\", \"blue\")", "Dale al padre del elemento #target1 un color de fondo (background-color) rojo." + ], + "titleDe": "Wähle das Eltern-Element mit jQuery aus", + "descriptionDe": [ + "Jedes HTML-Element hat ein Eltern-Element, von dem es Eigenschaften erbt.", + "Dein jQuery Playground h3 Element hat zum Beispiel das Eltern-Element <div class=\"container-fluid\">, welches das body Element als Eltern-Element hat.", + "jQuery hat eine Funktion namens parent(), die es dir erlaubt auf die Eltern-Elemente eines von dir ausgewählten Elements zuzugreifen.", + "Hier ist ein Beispiel, wie du die parent() Funktion nutzen kannst, wenn du dem Eltern-Element des left-well Elements eine blaue Hintergrundfarbe geben willst:", + "$(\"#left-well\").parent().css(\"background-color\", \"blue\")", + "Gib dem Eltern-Element des #target1 Elements eine rote Hintergrundfarbe." ] }, { @@ -909,6 +1028,15 @@ "He aquí un ejemplo de cómo se utiliza la función children() para darle a los hijos de tu elemento left-well el color azul:", "$(\"#left-well\").children().css(\"color\", \"blue\")", "Da a todos los hijos de tu elemento right-well el color naranja." + ], + "titleDe": "Wähle Kinder-Elemente mit jQuery aus", + "descriptionDe": [ + "Viele HTML-Elemente haben Kinder-Elemente, die ihre Eigenschaften von ihren Eltern-Elementen erben.", + "Zum Beispiel ist jedes HTML-Element ein Kind-Element des body Elements und dein \"jQuery Playground\" h3 Element ist ein Kind-Element deines <div class=\"container-fluid\"> Elements.", + "jQuery hat eine Funktion namens children(), die es dir erlaubt, auf die Kinder-Elemente des von dir ausgewählten Elements zuzugreifen.", + "Hier ist ein Beispiel, wie du die children() Funktion nutzen kannst, wenn du den Kinder-Elementen von left-well die Farbe Blau geben willst:", + "$(\"#left-well\").children().css(\"color\", \"blue\")", + "Gib allen Kinder-Elementen von #right-well die Farbe Orange." ] }, { @@ -975,6 +1103,15 @@ "He aquí cómo le asignarás la clase bounce al tercer elemento de cada pozo:", "$(\".target:nth-child(3)\").addClass(\"animated bounce\");", "Haz que rebote el segundo hijo de cada uno de los elementos de tus pozos. Debes elegir los hijos de elementos con clase target." + ], + "titleDe": "Wähle ein spezifisches Kinder-Element mit jQuery aus", + "descriptionDe": [ + "Du hast gesehen, warum ID-Attribute so praktisch sind, um Elemente mit jQuery Selektoren auszuwählen. Leider hast du aber nicht immer so praktische IDs, mit denen du arbeiten kannst.", + "Zum Glück hat jQuery einige Tricks auf Lager, um die richtigen Elemente auszuwählen.", + "jQuery nutzt CSS-Selektoren um Elemente auszuwählen. Der target:nth-child(n) CSS-Selektor erlaubt dir das n-te Element aus einer Zielklasse oder Element-Typ zu wählen.", + "Hier siehst du, wie du dem dritten Kind-Element einer jeden Vertiefung eine bounce Klasse hinzufügen kannst.", + "$(\".target:nth-child(3)\").addClass(\"animated bounce\");", + "Lasse das zweite Kind-Element jeder Vertiefung hüpfen. Dazu musst das Kind-Element mit der target Klasse auswählen." ] }, { @@ -1040,6 +1177,14 @@ "He aquí cómo elegirías todos los elementos impares con clase target y como les agregarías unas clases:", "$(\".target:odd\").addClass(\"animated shake\");", "Intenta seleccionar todos los elementos de número par y agrégales las clases animated y shake." + ], + "titleDe": "Wähle gerade Zahlen mit jQuery aus", + "descriptionDe": [ + "Du kannst auch alle geradzahligen Elemente auswählen.", + "Hier siehst du, wie du ungeradzahlige Elemente mit der Klasse target auswählen und ihnen folgende Klassen geben kannst:", + "$(\".target:odd\").addClass(\"animated shake\");", + "Bedenke, dass jQuery null-indexiert ist; das bedeutet, dass - kontraintuitiverweise - :odd das zweite Element, das vierte Element und so weiter auswählt.", + "Versuche alle geradzahligen Elemente auszuwählen und ihnen die Klassen animated und shake hinzuzufügen." ] }, { @@ -1103,6 +1248,13 @@ "jQuery también puede elegir el elemento body.", "Así es como haríamos que el cuerpo entero desapareciera: $(\"body\").addClass('animated fadeOut');", "Pero vamos a hacer algo más dramático. Añade las clases animated y hinge a tu elemento body." + ], + "titleDe": "Mit jQuery die gesamte Seite modifizieren", + "descriptionDe": [ + "Genug mit unserem jQuery Spielplatz herumgespielt. Reißen wir ihn ein!", + "jQuery kann auch das body Element auswählen.", + "Hier siehst du, wie wir den gesamten body Bereich ausblenden können: $(\"body\").addClass(\"animated fadeOut\");", + "Aber lass uns noch etwas Dramatischeres machen. Füge die Klassen animated und hinge zu deinem body Element hinzu." ] } ] From 136c365bf402ea8d9427cb63dfd34fec187194dc Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Sun, 17 Apr 2016 11:04:23 -0700 Subject: [PATCH 02/28] Update MDN charCodeAt link to be more accurate --- seed/bonfireMDNlinks.js | 2 +- .../01-front-end-development-certification/basic-bonfires.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/bonfireMDNlinks.js b/seed/bonfireMDNlinks.js index 43e382a176..12d13e26ab 100644 --- a/seed/bonfireMDNlinks.js +++ b/seed/bonfireMDNlinks.js @@ -43,7 +43,7 @@ var links = { // ======== STRING METHODS "String.charAt()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt", - "String.charCodeAt()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt", + "String.prototype.charCodeAt()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt", "String.concat()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat", "String.indexOf()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf", "String.fromCharCode()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode", diff --git a/seed/challenges/01-front-end-development-certification/basic-bonfires.json b/seed/challenges/01-front-end-development-certification/basic-bonfires.json index 630dcbe61e..81cfc4c7ff 100644 --- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json @@ -715,7 +715,7 @@ ], "type": "bonfire", "MDNlinks": [ - "String.charCodeAt()", + "String.prototype.charCodeAt()", "String.fromCharCode()" ], "challengeType": 5, From 1782be15416478321e88acd6e94be17b5c323d58 Mon Sep 17 00:00:00 2001 From: BKinahan Date: Sun, 17 Apr 2016 23:17:14 +0000 Subject: [PATCH 03/28] Amend Exact Change tests for format consistency --- .../advanced-bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/advanced-bonfires.json b/seed/challenges/01-front-end-development-certification/advanced-bonfires.json index 9e0bb1c285..2dfd853cb5 100644 --- a/seed/challenges/01-front-end-development-certification/advanced-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/advanced-bonfires.json @@ -148,7 +148,7 @@ "assert.isString(checkCashRegister(19.50, 20.00, [[\"PENNY\", 0.01], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]), 'message: checkCashRegister(19.50, 20.00, [[\"PENNY\", 0.01], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]) should return a string.');", "assert.isString(checkCashRegister(19.50, 20.00, [[\"PENNY\", 0.50], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]), 'message: checkCashRegister(19.50, 20.00, [[\"PENNY\", 0.50], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]) should return a string.');", "assert.deepEqual(checkCashRegister(19.50, 20.00, [[\"PENNY\", 1.01], [\"NICKEL\", 2.05], [\"DIME\", 3.10], [\"QUARTER\", 4.25], [\"ONE\", 90.00], [\"FIVE\", 55.00], [\"TEN\", 20.00], [\"TWENTY\", 60.00], [\"ONE HUNDRED\", 100.00]]), [[\"QUARTER\", 0.50]], 'message: checkCashRegister(19.50, 20.00, [[\"PENNY\", 1.01], [\"NICKEL\", 2.05], [\"DIME\", 3.10], [\"QUARTER\", 4.25], [\"ONE\", 90.00], [\"FIVE\", 55.00], [\"TEN\", 20.00], [\"TWENTY\", 60.00], [\"ONE HUNDRED\", 100.00]]) should return [[\"QUARTER\", 0.50]].');", - "assert.deepEqual(checkCashRegister(3.26, 100.00, [[\"PENNY\", 1.01], [\"NICKEL\", 2.05], [\"DIME\", 3.10], [\"QUARTER\", 4.25], [\"ONE\", 90.00], [\"FIVE\", 55.00], [\"TEN\", 20.00], [\"TWENTY\", 60.00], [\"ONE HUNDRED\", 100.00]]), [[\"TWENTY\", 60.00], [\"TEN\", 20.00], [\"FIVE\", 15], [\"ONE\", 1], [\"QUARTER\", 0.50], [\"DIME\", 0.20], [\"PENNY\", 0.04]], 'message: checkCashRegister(3.26, 100.00, [[\"PENNY\", 1.01], [\"NICKEL\", 2.05], [\"DIME\", 3.10], [\"QUARTER\", 4.25], [\"ONE\", 90.00], [\"FIVE\", 55.00], [\"TEN\", 20.00], [\"TWENTY\", 60.00], [\"ONE HUNDRED\", 100.00]]) should return [[\"TWENTY\", 60.00], [\"TEN\", 20.00], [\"FIVE\", 15], [\"ONE\", 1], [\"QUARTER\", 0.50], [\"DIME\", 0.20], [\"PENNY\", 0.04]].');", + "assert.deepEqual(checkCashRegister(3.26, 100.00, [[\"PENNY\", 1.01], [\"NICKEL\", 2.05], [\"DIME\", 3.10], [\"QUARTER\", 4.25], [\"ONE\", 90.00], [\"FIVE\", 55.00], [\"TEN\", 20.00], [\"TWENTY\", 60.00], [\"ONE HUNDRED\", 100.00]]), [[\"TWENTY\", 60.00], [\"TEN\", 20.00], [\"FIVE\", 15.00], [\"ONE\", 1.00], [\"QUARTER\", 0.50], [\"DIME\", 0.20], [\"PENNY\", 0.04]], 'message: checkCashRegister(3.26, 100.00, [[\"PENNY\", 1.01], [\"NICKEL\", 2.05], [\"DIME\", 3.10], [\"QUARTER\", 4.25], [\"ONE\", 90.00], [\"FIVE\", 55.00], [\"TEN\", 20.00], [\"TWENTY\", 60.00], [\"ONE HUNDRED\", 100.00]]) should return [[\"TWENTY\", 60.00], [\"TEN\", 20.00], [\"FIVE\", 15.00], [\"ONE\", 1.00], [\"QUARTER\", 0.50], [\"DIME\", 0.20], [\"PENNY\", 0.04]].');", "assert.deepEqual(checkCashRegister(19.50, 20.00, [[\"PENNY\", 0.01], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]), \"Insufficient Funds\", 'message: checkCashRegister(19.50, 20.00, [[\"PENNY\", 0.01], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]) should return \"Insufficient Funds\".');", "assert.deepEqual(checkCashRegister(19.50, 20.00, [[\"PENNY\", 0.01], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 1.00], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]), \"Insufficient Funds\", 'message: checkCashRegister(19.50, 20.00, [[\"PENNY\", 0.01], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 1.00], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]) should return \"Insufficient Funds\".');", "assert.deepEqual(checkCashRegister(19.50, 20.00, [[\"PENNY\", 0.50], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]), \"Closed\", 'message: checkCashRegister(19.50, 20.00, [[\"PENNY\", 0.50], [\"NICKEL\", 0], [\"DIME\", 0], [\"QUARTER\", 0], [\"ONE\", 0], [\"FIVE\", 0], [\"TEN\", 0], [\"TWENTY\", 0], [\"ONE HUNDRED\", 0]]) should return \"Closed\".');" From adca4e8a009013ba5dff1a4ec554b797db39cbff Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Tue, 19 Apr 2016 00:08:29 -0700 Subject: [PATCH 04/28] Add code tags to Get JSON challenge plus linting --- .../json-apis-and-ajax.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/seed/challenges/01-front-end-development-certification/json-apis-and-ajax.json b/seed/challenges/01-front-end-development-certification/json-apis-and-ajax.json index d9198a6935..493bad9cb3 100644 --- a/seed/challenges/01-front-end-development-certification/json-apis-and-ajax.json +++ b/seed/challenges/01-front-end-development-certification/json-apis-and-ajax.json @@ -138,7 +138,7 @@ "These properties and their values are often referred to as \"key-value pairs\".", "Let's get the JSON from Free Code Camp's Cat Photo API.", "Here's the code you can put in your click event to do this:", - "
$.getJSON(\"/json/cats.json\", function(json) {
$(\".message\").html(JSON.stringify(json));
});
", + "
$.getJSON(\"/json/cats.json\", function(json) {
$(\".message\").html(JSON.stringify(json));
});
", "Once you've added this, click the \"Get Message\" button. Your Ajax function will replace the \"The message will go here\" text with the raw JSON output from the Free Code Camp Cat Photo API." ], "challengeSeed": [ @@ -175,11 +175,11 @@ "" ], "tests": [ - "assert(code.match(/\\$\\s*?\\(\\s*?(\\\"|\\')\\#getMessage(\\\"|\\')\\s*?\\)\\s*?\\.\\s*?on\\s*?\\(\\s*?(\\\"|\\')click(\\\"|\\')\\s*?\\,\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/gi), 'message: You should have a click handler on the getMessage button to trigger the AJAX request.');", + "assert(code.match(/\\$\\s*?\\(\\s*?(\\\"|\\')\\#getMessage(\\\"|\\')\\s*?\\)\\s*?\\.\\s*?on\\s*?\\(\\s*?(\\\"|\\')click(\\\"|\\')\\s*?\\,\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/gi), 'message: You should have a click handler on the getMessage button to trigger the AJAX request.');", "assert(code.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi), 'message: You should have at least one closing set of brackets and parenthesis.');", "assert(code.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi) && code.match(/\\,\\s*?function\\s*?\\(\\s*?\\w*?\\s*?\\)\\s*?\\{/gi) && code.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi).length === code.match(/\\s*?function\\s*?\\(\\s*?\\w*?\\s*?\\)\\s*?\\{/gi).length, 'message: Each callback function should have a closing set of brackets and parenthesis.');", - "assert(code.match(/\\$\\s*?\\.\\s*?getJSON\\s*?\\(\\s*?(\\\"|\\')\\/json\\/cats\\.json(\\\"|\\')\\s*?\\,\\s*?function\\s*?\\(\\s*?json\\s*?\\)\\s*?\\{/gi), 'message: You should be making use of the getJSON method given in the description to load data from the json file.');", - "assert(code.match(/\\$\\s*?\\(\\s*?(\\\"|\\')\\.message(\\\"|\\')\\s*?\\)\\s*?\\.\\s*?html\\s*?\\(\\s*?JSON\\s*?\\.\\s*?stringify\\s*?\\(\\s*?json\\s*?\\)\\s*?\\)/gi), 'message: Don't forget to make the .html change the contents of the message box so that it contains the result of the getJSON.');" + "assert(code.match(/\\$\\s*?\\.\\s*?getJSON\\s*?\\(\\s*?(\\\"|\\')\\/json\\/cats\\.json(\\\"|\\')\\s*?\\,\\s*?function\\s*?\\(\\s*?json\\s*?\\)\\s*?\\{/gi), 'message: You should be making use of the getJSON method given in the description to load data from the JSON file.');", + "assert(code.match(/\\$\\s*?\\(\\s*?(\\\"|\\')\\.message(\\\"|\\')\\s*?\\)\\s*?\\.\\s*?html\\s*?\\(\\s*?JSON\\s*?\\.\\s*?stringify\\s*?\\(\\s*?json\\s*?\\)\\s*?\\)/gi), 'message: Don't forget to make the .html change the contents of the message box so that it contains the result of the getJSON.');" ], "type": "waypoint", "challengeType": 0, @@ -192,19 +192,19 @@ "Estas propiedades y sus valores a menudo se denominan \" pares llave-valor\".", "Vamos a obtener el JSON de la API de fotos de gato de Free Code Camp.", "Aquí está el código que puedes poner en tu evento de pulsación para lograrlo:", - "
$.getJSON(\"/json/cats.json\", function(json) {
$(\".message\").html(JSON.stringify(json));
});
", + "
$.getJSON(\"/json/cats.json\", function(json) {
$(\".message\").html(JSON.stringify(json));
});
", "Una vez lo añadas, pulsa el botón \"Get Message\". Tu función Ajax sustituirá el texto \"The message will go here\" con la salida JSON en bruto de la API de fotos de gato de Free Code Camp." ], "titlePt": "Obter um JSON com o método getJSON do jQuery", "descriptionPt": [ - "Também é possivel solicitar os dados de uma fonte externa. É aqui onde as API's entram em jogo. ", + "Também é possivel solicitar os dados de uma fonte externa. É aqui onde as API's entram em jogo.", "Lembre que as API's - Interface de Programação de Aplicativos - são ferramentas que os computadores usam para se comunicar entre si.", "A maioria das API's transferem de dados para web em um formato chamado JSON. JSON significa notação de objeto JavaScript (JavaScript Object Notation).", - "Você já usou JSON para criar objetos em JavaScript. O JSON não é mais que as propriedades de um objeto e seus valores atuais, separados entre { e um }. ", + "Você já usou JSON para criar objetos em JavaScript. O JSON não é mais que as propriedades de um objeto e seus valores atuais, separados entre { e um }.", "Estas propriedades e seus valores são muitas vezes denominados de \" pares chave-valor\".", "Vamos obter o JSON da API de fotos de gatos do Free Code Camp.", "Aqui esta o código que você pode por no nosso evento de clique para fazer isso:", - "
$.getJSON(\"/json/cats.json\", function(json) {
$(\".message\").html(JSON.stringify(json));
});
", + "
$.getJSON(\"/json/cats.json\", function(json) {
$(\".message\").html(JSON.stringify(json));
});
", "Uma vez adicionadas, aperte o botão \"Get Message\". Sua função Ajax substituirá o texto \"The message will go here\" com a saída bruta do JSON da API de gatos do Free Code Camp." ] }, From 0baf2dc4f39c40f9c9850ca5322abb7e9451c8d5 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 20 Apr 2016 08:15:51 +0100 Subject: [PATCH 05/28] Added closing code tags Changed location of code tags --- .../basic-javascript.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json index c8c51b9d0a..7a791ece7c 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -3507,11 +3507,11 @@ "function switchOfStuff(val) {\n var answer = \"\";\n\n switch(val) {\n case \"a\":\n answer = \"apple\";\n break;\n case \"b\":\n answer = \"bird\";\n break;\n case \"c\":\n answer = \"cat\";\n break;\n default:\n answer = \"stuff\";\n }\n return answer; \n}" ], "tests": [ - "assert(switchOfStuff(\"a\") === \"apple\", 'message: switchOfStuff(\"a\") should have a value of \"apple\"');", - "assert(switchOfStuff(\"b\") === \"bird\", 'message: switchOfStuff(\"b\") should have a value of \"bird\"');", - "assert(switchOfStuff(\"c\") === \"cat\", 'message: switchOfStuff(\"c\") should have a value of \"cat\"');", - "assert(switchOfStuff(\"d\") === \"stuff\", 'message: switchOfStuff(\"d\") should have a value of \"stuff\"');", - "assert(switchOfStuff(4) === \"stuff\", 'message: switchOfStuff(4) should have a value of \"stuff\"');", + "assert(switchOfStuff(\"a\") === \"apple\", 'message: switchOfStuff(\"a\") should have a value of \"apple\"');", + "assert(switchOfStuff(\"b\") === \"bird\", 'message: switchOfStuff(\"b\") should have a value of \"bird\"');", + "assert(switchOfStuff(\"c\") === \"cat\", 'message: switchOfStuff(\"c\") should have a value of \"cat\"');", + "assert(switchOfStuff(\"d\") === \"stuff\", 'message: switchOfStuff(\"d\") should have a value of \"stuff\"');", + "assert(switchOfStuff(4) === \"stuff\", 'message: switchOfStuff(4) should have a value of \"stuff\"');", "assert(!/else/g.test(code) || !/if/g.test(code), 'message: You should not use any if or else statements');", "assert(code.match(/break/g).length > 2, 'message: You should have at least 3 break statements');" ], From 5d76fc05a007cfb1e42982fc8f2183ce7b0eda43 Mon Sep 17 00:00:00 2001 From: Sharang Dashputre Date: Thu, 21 Apr 2016 02:22:50 +0530 Subject: [PATCH 06/28] Added test cases for 'no repeats please' --- .../advanced-bonfires.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/advanced-bonfires.json b/seed/challenges/01-front-end-development-certification/advanced-bonfires.json index 9e0bb1c285..bd780e6770 100644 --- a/seed/challenges/01-front-end-development-certification/advanced-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/advanced-bonfires.json @@ -244,7 +244,10 @@ "assert.strictEqual(permAlone('aabb'), 8, 'message: permAlone(\"aabb\") should return 8.');", "assert.strictEqual(permAlone('abcdefa'), 3600, 'message: permAlone(\"abcdefa\") should return 3600.');", "assert.strictEqual(permAlone('abfdefa'), 2640, 'message: permAlone(\"abfdefa\") should return 2640.');", - "assert.strictEqual(permAlone('zzzzzzzz'), 0, 'message: permAlone(\"zzzzzzzz\") should return 0.');" + "assert.strictEqual(permAlone('zzzzzzzz'), 0, 'message: permAlone(\"zzzzzzzz\") should return 0.');", + "assert.strictEqual(permAlone('a'), 1, 'message: permAlone(\"a\") should return 1.');", + "assert.strictEqual(permAlone('aaab'), 0, 'message: permAlone(\"aaab\") should return 0.');", + "assert.strictEqual(permAlone('aaabb'), 12, 'message: permAlone(\"aaabb\") should return 12.');" ], "type": "bonfire", "MDNlinks": [ From 724f41733792effad8e01643140b20a7526f8d07 Mon Sep 17 00:00:00 2001 From: DusanSacha Date: Thu, 21 Apr 2016 08:16:58 +0200 Subject: [PATCH 07/28] Added hint to JS increment challenge --- .../basic-javascript.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json index 2bd43fd648..6b583a7fb9 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -433,7 +433,8 @@ "i = i + 1;", "Note
The entire line becomes i++;, eliminating the need for the equal sign.", "

Instructions

", - "Change the code to use the ++ operator on myVar." + "Change the code to use the ++ operator on myVar.", + "Hint
Learn more about Arithmetic operators - Increment (++)." ], "releasedOn": "January 1, 2016", "challengeSeed": [ From 455bdcd0b24c7b4de170aca5a0eff19580bbd28b Mon Sep 17 00:00:00 2001 From: kkas Date: Thu, 21 Apr 2016 23:25:59 +0900 Subject: [PATCH 08/28] Add a unit to bonfire Map the Debris --- .../advanced-bonfires.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed/challenges/01-front-end-development-certification/advanced-bonfires.json b/seed/challenges/01-front-end-development-certification/advanced-bonfires.json index 9e0bb1c285..b31fff947e 100644 --- a/seed/challenges/01-front-end-development-certification/advanced-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/advanced-bonfires.json @@ -368,7 +368,7 @@ "The array will contain objects in the format {name: 'name', avgAlt: avgAlt}.", "You can read about orbital periods on wikipedia.", "The values should be rounded to the nearest whole number. The body being orbited is Earth.", - "The radius of the earth is 6367.4447 kilometers, and the GM value of earth is 398600.4418", + "The radius of the earth is 6367.4447 kilometers, and the GM value of earth is 398600.4418 km3s-2.", "Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code." ], "challengeSeed": [ @@ -398,7 +398,7 @@ "El arreglo debe contener objetos en el formato {name: 'name', avgAlt: avgAlt}.", "Puedes leer acerca de períodos orbitales en wikipedia.", "Los valores deben estar redondeados al número entero más próximo. El cuerpo orbitado es la Tierra", - "El radio de la Tierra es 6367.4447 kilómetros, y el valor GM del planeta es de 398600.4418", + "El radio de la Tierra es 6367.4447 kilómetros, y el valor GM del planeta es de 398600.4418 km3s-2.", "Recuerda utilizar Read-Search-Ask si te sientes atascado. Intenta programar en pareja. Escribe tu propio código." ] }, From aeea02d7fc0756561c7145635032e73bd37f36cd Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra Date: Mon, 18 Apr 2016 15:43:35 +0000 Subject: [PATCH 09/28] Update the Sign in and Sign up Pages --- server/boot/user.js | 10 ++++ server/views/account/deprecated-signin.jade | 56 +++++++++++++++++++++ server/views/account/show.jade | 2 +- server/views/account/signin.jade | 27 +++++----- 4 files changed, 79 insertions(+), 16 deletions(-) create mode 100644 server/views/account/deprecated-signin.jade diff --git a/server/boot/user.js b/server/boot/user.js index 8d9984e2ab..3f3e57b049 100644 --- a/server/boot/user.js +++ b/server/boot/user.js @@ -148,6 +148,7 @@ module.exports = function(app) { router.post('/reset-password', postReset); router.get('/email-signup', getEmailSignup); router.get('/email-signin', getEmailSignin); + router.get('/deprecated-signin', getDepSignin); router.get( '/toggle-lockdown-mode', sendNonUserToMap, @@ -225,6 +226,15 @@ module.exports = function(app) { res.redirect('/'); } + function getDepSignin(req, res) { + if (req.user) { + return res.redirect('/'); + } + return res.render('account/deprecated-signin', { + title: 'Sign in to Free Code Camp using a Deprecated Login' + }); + } + function getEmailSignin(req, res) { if (req.user) { return res.redirect('/'); diff --git a/server/views/account/deprecated-signin.jade b/server/views/account/deprecated-signin.jade new file mode 100644 index 0000000000..57ebf22aab --- /dev/null +++ b/server/views/account/deprecated-signin.jade @@ -0,0 +1,56 @@ +extends ../layout +block content + .text-center + h2 Sign in with one of these options if you used them as your original login methods : + br + a.btn.btn-lg.btn-block.btn-social.btn-facebook(href='/auth/facebook') + i.fa.fa-facebook + | Sign in with Facebook + a.btn.btn-lg.btn-block.btn-social.btn-google(href='/auth/google') + i.fa.fa-google + | Sign in with Google + a.btn.btn-lg.btn-block.btn-social.btn-linkedin(href='/auth/linkedin') + i.fa.fa-linkedin + | Sign in with LinkedIn + a.btn.btn-lg.btn-block.btn-social.btn-twitter(href='/auth/twitter') + i.fa.fa-twitter + | Sign in with Twitter + br + p + strong IMPORTANT NOTICE + br + em These options are under deprecation and will be removed soon. + br + em After you are signed in, go to the settings page and add GitHub and/or Email as your sign in option + + script. + $(document).ready(function() { + var method = localStorage.getItem('lastSigninMethod'), + btnSelector = 'a.btn.btn-lg.btn-block.btn-social'; + if (method) { + try { + var obj = JSON.parse(method); + } catch(e) { + console.error('Invalid sign in object stored', method); + return; + } + $.each($(btnSelector), function(i, item) { + if ( + $(item).attr('href') === obj.methodLink && + $(item).hasClass(obj.methodClass) + ) { + $(item).addClass('active'); + $(item).attr('title', 'This is your last signin method'); + return false; + } + }); + } + + $(btnSelector).click(function() { + var obj = {}; + $(this).removeClass('active'); + obj.methodClass = $(this).attr('class').split(' ').pop(); + obj.methodLink = $(this).attr('href'); + localStorage.setItem('lastSigninMethod', JSON.stringify(obj)); + }); + }); diff --git a/server/views/account/show.jade b/server/views/account/show.jade index 568fd5ea4d..53375e3d2b 100644 --- a/server/views/account/show.jade +++ b/server/views/account/show.jade @@ -14,7 +14,7 @@ block content a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='/settings') | Update your settings .col-xs-12 - a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='/logout') + a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='/signout') | Sign me out of Free Code Camp .col-xs-12 a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='mailto:team@freecodecamp.com') diff --git a/server/views/account/signin.jade b/server/views/account/signin.jade index deda558ea7..ee5c28588c 100644 --- a/server/views/account/signin.jade +++ b/server/views/account/signin.jade @@ -2,26 +2,23 @@ extends ../layout block content .text-center h2 Sign in with one of these options: + a.btn.btn-lg.btn-block.btn-social.btn-primary(href='/email-signin') + i.fa.fa-envelope + | Sign in with Email a.btn.btn-lg.btn-block.btn-social.btn-github(href='/auth/github') i.fa.fa-github | Sign in with GitHub - a.btn.btn-lg.btn-block.btn-social.btn-facebook(href='/auth/facebook') - i.fa.fa-facebook - | Sign in with Facebook - a.btn.btn-lg.btn-block.btn-social.btn-google(href='/auth/google') - i.fa.fa-google - | Sign in with Google - a.btn.btn-lg.btn-block.btn-social.btn-linkedin(href='/auth/linkedin') - i.fa.fa-linkedin - | Sign in with LinkedIn - a.btn.btn-lg.btn-block.btn-social.btn-twitter(href='/auth/twitter') - i.fa.fa-twitter - | Sign in with Twitter br p - a(href="/email-signup") Or sign up using your email address here. - p - a(href="/email-signin") If you originally signed up using your email address, you can sign in here. + a(href="/deprecated-signin") Or click here to signin with one of the deprecated methods. + + h2 New to Free Code Camp ? Sign up now: + a.btn.btn-lg.btn-block.btn-social.btn-primary(href='/email-signup') + i.fa.fa-envelope + | Sign up with Email + a.btn.btn-lg.btn-block.btn-social.btn-github(href='/auth/github') + i.fa.fa-github + | Sign up with GitHub script. $(document).ready(function() { From 6c291148d4849483f7659fafae52c926c4df04ce Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Fri, 22 Apr 2016 12:26:02 -0700 Subject: [PATCH 10/28] improve the ux of the signin page --- server/views/account/signin.jade | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/server/views/account/signin.jade b/server/views/account/signin.jade index ee5c28588c..9ce4163c12 100644 --- a/server/views/account/signin.jade +++ b/server/views/account/signin.jade @@ -1,7 +1,23 @@ extends ../layout block content .text-center - h2 Sign in with one of these options: + h2 New to Free Code Camp? + br + .button-spacer + | Sign up now: + a.btn.btn-lg.btn-block.btn-social.btn-primary(href='/email-signup') + i.fa.fa-envelope + | Sign up with Email + a.btn.btn-lg.btn-block.btn-social.btn-github(href='/auth/github') + i.fa.fa-github + | Sign up with GitHub + .spacer + hr + .spacer + h2 Are you a returning camper? + br + .button-spacer + | Sign in with one of these options: a.btn.btn-lg.btn-block.btn-social.btn-primary(href='/email-signin') i.fa.fa-envelope | Sign in with Email @@ -10,15 +26,7 @@ block content | Sign in with GitHub br p - a(href="/deprecated-signin") Or click here to signin with one of the deprecated methods. - - h2 New to Free Code Camp ? Sign up now: - a.btn.btn-lg.btn-block.btn-social.btn-primary(href='/email-signup') - i.fa.fa-envelope - | Sign up with Email - a.btn.btn-lg.btn-block.btn-social.btn-github(href='/auth/github') - i.fa.fa-github - | Sign up with GitHub + a(href="/deprecated-signin") Click here if you previously signed in using a different method. script. $(document).ready(function() { From 55ef14b9a636ce7db8802050a44e490d2fdfc9bc Mon Sep 17 00:00:00 2001 From: ttymed Date: Fri, 22 Apr 2016 17:31:16 +0800 Subject: [PATCH 11/28] added keybindings for focus on codemirror through Mousetrap --- client/commonFramework/bindings.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/commonFramework/bindings.js b/client/commonFramework/bindings.js index 0c4d5b6fc4..18b98fb29e 100644 --- a/client/commonFramework/bindings.js +++ b/client/commonFramework/bindings.js @@ -2,7 +2,8 @@ window.common = (function(global) { const { $, Rx: { Observable }, - common = { init: [] } + common = { init: [] }, + Mousetrap } = global; common.ctrlEnterClickHandler = function ctrlEnterClickHandler(e) { @@ -42,6 +43,11 @@ window.common = (function(global) { ); }); + // set focus keybind + Mousetrap.bind(['command+shift+e', 'ctrl+shift+e'], () => { + common.editor.focus(); + }); + // video checklist binding $('.challenge-list-checkbox').on('change', function() { var checkboxId = $(this).parent().parent().attr('id'); From 11dcd74f64fafe96015e44cea4d881871db22a1d Mon Sep 17 00:00:00 2001 From: bteng22 Date: Tue, 29 Mar 2016 20:12:40 -0700 Subject: [PATCH 12/28] adding newline before appending tail to combinedCode to prevent tail from being cut off by trailing comments in code editor setting initialValue of reduce to newline for arrayToNewLineString to prevent cutting off code if trailing comments in json --- client/commonFramework/init.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/commonFramework/init.js b/client/commonFramework/init.js index ff4130efd1..e054bab6c1 100644 --- a/client/commonFramework/init.js +++ b/client/commonFramework/init.js @@ -28,7 +28,7 @@ window.common = (function(global) { seedData = Array.isArray(seedData) ? seedData : [seedData]; return seedData.reduce(function(seed, line) { return '' + seed + line + '\n'; - }, ''); + }, '\n'); }; common.seed = common.arrayToNewLineString(common.challengeSeed); From a6927a3a52dc5d119cf3513ae5c0452b38095c77 Mon Sep 17 00:00:00 2001 From: Temo Totev Date: Sat, 23 Apr 2016 22:38:20 -0700 Subject: [PATCH 13/28] Remove duplicate object key --- .jshintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.jshintrc b/.jshintrc index 7d01fdaf66..fe8c79be7b 100644 --- a/.jshintrc +++ b/.jshintrc @@ -16,7 +16,6 @@ "strict": false, // Require `use strict` pragma in every file. "trailing": true, // Prohibit trailing whitespaces. "smarttabs": false, // Suppresses warnings about mixed tabs and spaces - "esnext": true, // Allow ES6 maybe :p "globals": { // Globals variables. "jasmine": true, "angular": true, From 6039d29282ad8687e1fe35cb778de7bb742eff19 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Mon, 25 Apr 2016 16:57:30 -0700 Subject: [PATCH 14/28] Add count of campers who have earned all three certs to about page (#8288) * add count of campers who have earned all three certs to about page * refactor to get tests to pass --- server/boot/about.js | 29 ++++++++++++++++++++++++++--- server/views/resources/about.jade | 4 ++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/server/boot/about.js b/server/boot/about.js index 7e596394f3..4c58825eea 100644 --- a/server/boot/about.js +++ b/server/boot/about.js @@ -16,6 +16,15 @@ function getCertCount(userCount, cert) { ::timeCache(2, 'hours'); } +function getAllThreeCertsCount(userCount) { + return userCount({ + isFrontEndCert: true, + isDataVisCert: true, + isBackEndCert: true + }) + ::timeCache(2, 'hours'); +} + export default function about(app) { const router = app.loopback.Router(); const User = app.models.User; @@ -23,6 +32,7 @@ export default function about(app) { const frontEndCount$ = getCertCount(userCount, 'isFrontEndCert'); const dataVisCount$ = getCertCount(userCount, 'isDataVisCert'); const backEndCount$ = getCertCount(userCount, 'isBackEndCert'); + const allThreeCount$ = getAllThreeCertsCount(userCount); function showAbout(req, res, next) { const daysRunning = moment().diff(new Date('10/15/2014'), 'days'); @@ -31,17 +41,30 @@ export default function about(app) { frontEndCount$, dataVisCount$, backEndCount$, - (frontEndCount = 0, dataVisCount = 0, backEndCount = 0) => ({ + allThreeCount$, + ( + frontEndCount = 0, + dataVisCount = 0, + backEndCount = 0, + allThreeCount = 0 + ) => ({ frontEndCount, dataVisCount, - backEndCount + backEndCount, + allThreeCount }) ) - .doOnNext(({ frontEndCount, dataVisCount, backEndCount }) => { + .doOnNext(({ + frontEndCount, + dataVisCount, + backEndCount, + allThreeCount + }) => { res.render('resources/about', { frontEndCount: numberWithCommas(frontEndCount), dataVisCount: numberWithCommas(dataVisCount), backEndCount: numberWithCommas(backEndCount), + allThreeCount: numberWithCommas(allThreeCount), daysRunning, title: dedent` About our Open Source Community, our social media presence, diff --git a/server/views/resources/about.jade b/server/views/resources/about.jade index d80eab4a32..a4d00fb9f3 100644 --- a/server/views/resources/about.jade +++ b/server/views/resources/about.jade @@ -38,6 +38,10 @@ block content span.tag Back End: span.text-primary #{backEndCount} | earned + li.nowrap + span.tag All three: + span.text-primary #{allThreeCount} + | earned .spacer .row .col-xs-12.col-sm-10.col-sm-offset-1.col-md-6.col-md-offset-3 From c3cb9e39beeecb7191c6fc8724091436b010a119 Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Tue, 26 Apr 2016 23:22:45 -0700 Subject: [PATCH 15/28] Remove trailing whitespace from about.js --- server/boot/about.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/server/boot/about.js b/server/boot/about.js index 4c58825eea..c58153577d 100644 --- a/server/boot/about.js +++ b/server/boot/about.js @@ -17,10 +17,10 @@ function getCertCount(userCount, cert) { } function getAllThreeCertsCount(userCount) { - return userCount({ - isFrontEndCert: true, - isDataVisCert: true, - isBackEndCert: true + return userCount({ + isFrontEndCert: true, + isDataVisCert: true, + isBackEndCert: true }) ::timeCache(2, 'hours'); } @@ -54,12 +54,12 @@ export default function about(app) { allThreeCount }) ) - .doOnNext(({ - frontEndCount, - dataVisCount, - backEndCount, - allThreeCount - }) => { + .doOnNext(({ + frontEndCount, + dataVisCount, + backEndCount, + allThreeCount + }) => { res.render('resources/about', { frontEndCount: numberWithCommas(frontEndCount), dataVisCount: numberWithCommas(dataVisCount), From 6b42ec11fe0a570819bda7c81595ef7a0cdee84f Mon Sep 17 00:00:00 2001 From: Evan N Date: Wed, 27 Apr 2016 13:58:10 -0400 Subject: [PATCH 16/28] Removed the quotation marks from the message and fixed the merge squash --- .../basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json index 2d4007353b..9e6d4bbf1f 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -971,7 +971,7 @@ ], "tests": [ "assert(code.match(/\\\\\"/g).length === 4 && code.match(/[^\\\\]\"/g).length === 2, 'message: You should use two double quotes (") and four escaped double quotes (\") ');", - "assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\"\", 'message: Variable myStr should equal to (\"I am a \"double quoted\" string inside \"double quotes\"\").');" + "assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\"\", 'message: Variable myStr should equal to (I am a \"double quoted\" string inside \"double quotes\").');" ], "type": "waypoint", "challengeType": 1, From 68788a3786e723bfe6f6af2fe78f5684b868e37a Mon Sep 17 00:00:00 2001 From: rshafto Date: Wed, 27 Apr 2016 21:53:20 -0400 Subject: [PATCH 17/28] Update basic-bonfires.json --- .../01-front-end-development-certification/basic-bonfires.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-bonfires.json b/seed/challenges/01-front-end-development-certification/basic-bonfires.json index 81cfc4c7ff..8cd435739d 100644 --- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json @@ -542,7 +542,8 @@ "assert(mutation([\"Mary\", \"Aarmy\"]) === true, 'message: mutation([\"Mary\", \"Aarmy\"]) should return true.');", "assert(mutation([\"Alien\", \"line\"]) === true, 'message: mutation([\"Alien\", \"line\"]) should return true.');", "assert(mutation([\"floor\", \"for\"]) === true, 'message: mutation([\"floor\", \"for\"]) should return true.');", - "assert(mutation([\"hello\", \"neo\"]) === false, 'message: mutation([\"hello\", \"neo\"]) should return false.');" + "assert(mutation([\"hello\", \"neo\"]) === false, 'message: mutation([\"hello\", \"neo\"]) should return false.');", + "assert(mutation([\"voodoo\", \"no\"]) === false, 'message: mutation([\"voodoo\", \"no\"]) should return false.');" ], "type": "bonfire", "isRequired": true, From fed3327bcfd288d6717e81e1f7b2d7b8ba08292a Mon Sep 17 00:00:00 2001 From: Jose Tello Date: Wed, 27 Apr 2016 22:43:23 -0700 Subject: [PATCH 18/28] Add test case for front-end challenge. --- .../basic-javascript.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json index 6b583a7fb9..7ad325ccf7 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -2734,7 +2734,7 @@ "assert(testStrict(10) === \"Not Equal\", 'message: testStrict(10) should return \"Not Equal\"');", "assert(testStrict(7) === \"Equal\", 'message: testStrict(7) should return \"Equal\"');", "assert(testStrict(\"7\") === \"Not Equal\", 'message: testStrict(\"7\") should return \"Not Equal\"');", - "assert(code.match(/val\\s*===\\s*\\d+/g).length > 0, 'message: You should use the === operator');" + "assert(code.match(/(val\\s*===\\s*\\d+)|(\\d+\\s*===\\s*val)/g).length > 0, 'message: You should use the === operator');" ], "type": "waypoint", "challengeType": 1, From 40d604e0aafe0a73c5868be164626086873454d0 Mon Sep 17 00:00:00 2001 From: Carlos El Halabi Date: Sat, 30 Apr 2016 00:13:25 -0430 Subject: [PATCH 19/28] Fix incorrect facts on the description of Challenge: Fill in the Blank with Placeholder Text --- .../01-front-end-development-certification/html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/html5-and-css.json b/seed/challenges/01-front-end-development-certification/html5-and-css.json index 6685ae4827..7ba4020dea 100644 --- a/seed/challenges/01-front-end-development-certification/html5-and-css.json +++ b/seed/challenges/01-front-end-development-certification/html5-and-css.json @@ -317,7 +317,7 @@ ], "title": "Fill in the Blank with Placeholder Text", "description": [ - "Web developers traditionally use lorem ipsum text as placeholder text. It's called lorem ipsum text because those are the first two words of a famous passage by Cicero of Ancient Rome.", + "Web developers traditionally use lorem ipsum text as placeholder text. The 'lorem ipsum' text is randomly scraped from a famous passage by Cicero of Ancient Rome.", "Lorem ipsum text has been used as placeholder text by typesetters since the 16th century, and this tradition continues on the web.", "Well, 5 centuries is long enough. Since we're building a CatPhotoApp, let's use something called kitty ipsum text.", "Replace the text inside your p element with the first few words of this kitty ipsum text: Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff." From c7a2d9bb718fb85ffa9eb9a566df0c6c96dcbc65 Mon Sep 17 00:00:00 2001 From: Ihudiya Finda Ogburu Date: Sat, 30 Apr 2016 17:35:18 -0500 Subject: [PATCH 20/28] Merge pull request #8351 from iogburu/patch-1 * Updated Instructions Updated Instructions for "Use Responsive Design with Bootstrap Fluid Containers" section in order to inform users who may jump around in the tutorials where they can learn how to build the Cat Photo App. --- .../01-front-end-development-certification/bootstrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/bootstrap.json b/seed/challenges/01-front-end-development-certification/bootstrap.json index 55ef24f68a..323a88e233 100644 --- a/seed/challenges/01-front-end-development-certification/bootstrap.json +++ b/seed/challenges/01-front-end-development-certification/bootstrap.json @@ -8,7 +8,7 @@ "id": "bad87fee1348bd9acde08712", "title": "Use Responsive Design with Bootstrap Fluid Containers", "description": [ - "Now let's go back to our Cat Photo App. This time, we'll style it using the popular Bootstrap responsive CSS framework.", + "In the HTML5 and CSS section of FreeCodeCamp we built a Cat Photo App. Now let's go back to it. This time, we'll style it using the popular Bootstrap responsive CSS framework.", "Bootstrap will figure out how wide your screen is and respond by resizing your HTML elements - hence the name Responsive Design.", "With responsive design, there is no need to design a mobile version of your website. It will look good on devices with screens of any width.", "You can add Bootstrap to any app just by including it by adding the following code to the top of your HTML:", From 725819a5f8da015a4fab33e5826a3d516bbb2243 Mon Sep 17 00:00:00 2001 From: BrianZ1 Date: Sat, 30 Apr 2016 18:41:58 -0400 Subject: [PATCH 21/28] Fix wording ambiguity for Personal Portfolio (#8345) Fix wording ambiguity for Personal Portfolio --- .../01-front-end-development-certification/basic-ziplines.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-ziplines.json b/seed/challenges/01-front-end-development-certification/basic-ziplines.json index e95954309a..156b6f5fae 100644 --- a/seed/challenges/01-front-end-development-certification/basic-ziplines.json +++ b/seed/challenges/01-front-end-development-certification/basic-ziplines.json @@ -180,7 +180,7 @@ "Objective: Build a CodePen.io app that is functionally similar to this: https://codepen.io/FreeCodeCamp/full/YqLyXB/.", "Rule #1: Don't look at the example project's code. Figure it out for yourself.", "Rule #2: Fulfill the below user stories. Use whichever libraries you need. Give it your own personal style.", - "Rule #3: You may use your own CSS and frameworks other than Bootstrap.", + "Rule #3: You can use Bootstrap, or any other framework of your choice.", "User Story: I can access all of the portfolio webpage's content just by scrolling.", "User Story: I can click different buttons that will take me to the portfolio creator's different social media pages.", "User Story: I can see thumbnail images of different projects the portfolio creator has built (if you haven't built any websites before, use placeholders.)", From 179c65b461d3c4d89930a99f92d4814e062ad4eb Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Sun, 24 Apr 2016 17:49:13 -0700 Subject: [PATCH 22/28] Constrain Style HTML Body test need semicolon --- .../01-front-end-development-certification/html5-and-css.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seed/challenges/01-front-end-development-certification/html5-and-css.json b/seed/challenges/01-front-end-development-certification/html5-and-css.json index 6685ae4827..a0f8a0cf53 100644 --- a/seed/challenges/01-front-end-development-certification/html5-and-css.json +++ b/seed/challenges/01-front-end-development-certification/html5-and-css.json @@ -3830,7 +3830,8 @@ ], "tests": [ "assert($(\"body\").css(\"background-color\") === \"rgb(0, 0, 0)\", 'message: Give your body element the background-color of black.');", - "assert(code.match(/