@ -37,6 +37,56 @@ window.common = (function(global) {
|
||||
/>
|
||||
<style>
|
||||
body { padding: 0px 3px 0px 3px; }
|
||||
/* FORM RESET: */
|
||||
textarea,
|
||||
select,
|
||||
input[type="date"],
|
||||
input[type="datetime"],
|
||||
input[type="datetime-local"],
|
||||
input[type="email"],
|
||||
input[type="month"],
|
||||
input[type="number"],
|
||||
input[type="password"],
|
||||
input[type="search"],
|
||||
input[type="tel"],
|
||||
input[type="text"],
|
||||
input[type="time"],
|
||||
input[type="url"],
|
||||
input[type="week"] {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
-webkit-background-clip: padding;
|
||||
-moz-background-clip: padding;
|
||||
background-clip:padding-box;
|
||||
-webkit-border-radius:0;
|
||||
-moz-border-radius:0;
|
||||
-ms-border-radius:0;
|
||||
-o-border-radius:0;
|
||||
border-radius:0;
|
||||
-webkit-appearance:none;
|
||||
background-color:#fff;
|
||||
color:#000;
|
||||
outline:0;
|
||||
margin:0;
|
||||
padding:0;
|
||||
text-align: left;
|
||||
font-size:1em;
|
||||
height: 1.8em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
select, select, select {
|
||||
background:#fff
|
||||
url('data:image/png;base64,\
|
||||
R0lGODlhDQAEAIAAAAAAAP8A/yH5BAEHAAEAL\
|
||||
AAAAAANAAQAAAILhA+hG5jMDpxvhgIAOw==');
|
||||
background-repeat: no-repeat;
|
||||
background-position: 97% center;
|
||||
padding:0 25px 0 8px;
|
||||
font-size: .875em;
|
||||
}
|
||||
|
||||
// ! FORM RESET
|
||||
</style>
|
||||
`;
|
||||
const codeDisabledError = `
|
||||
|
@ -79,6 +79,9 @@ var links = {
|
||||
"Array.splice()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice",
|
||||
"Array.toString()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString",
|
||||
|
||||
// ======== STATEMENTS AND DECLARATIONS
|
||||
"Switch Statement": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch",
|
||||
|
||||
// ======== MATH METHODS
|
||||
"Math.max()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max",
|
||||
"Math.min()": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min",
|
||||
|
@ -644,31 +644,31 @@
|
||||
"title": "Where do I belong",
|
||||
"description": [
|
||||
"Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted.",
|
||||
"For example, <code>where([1,2,3,4], 1.5)</code> should return <code>1</code> because it is greater than <code>1</code> (index 0), but less than <code>2</code> (index 1).",
|
||||
"Likewise, <code>where([20,3,5], 19)</code> should return <code>2</code> because once the array has been sorted it will look like <code>[3,5,20]</code> and <code>19</code> is less than <code>20</code> (index 2) and greater than <code>5</code> (index 1).",
|
||||
"For example, <code>getIndexToIns([1,2,3,4], 1.5)</code> should return <code>1</code> because it is greater than <code>1</code> (index 0), but less than <code>2</code> (index 1).",
|
||||
"Likewise, <code>getIndexToIns([20,3,5], 19)</code> should return <code>2</code> because once the array has been sorted it will look like <code>[3,5,20]</code> and <code>19</code> is less than <code>20</code> (index 2) and greater than <code>5</code> (index 1).",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function where(arr, num) {",
|
||||
"function getIndexToIns(arr, num) {",
|
||||
" // Find my place in this sorted array.",
|
||||
" return num;",
|
||||
"}",
|
||||
"",
|
||||
"where([40, 60], 50);"
|
||||
"getIndexToIns([40, 60], 50);"
|
||||
],
|
||||
"tests": [
|
||||
"assert(where([10, 20, 30, 40, 50], 35) === 3, 'message: <code>where([10, 20, 30, 40, 50], 35)</code> should return <code>3</code>.');",
|
||||
"assert(where([10, 20, 30, 40, 50], 30) === 2, 'message: <code>where([10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.');",
|
||||
"assert(where([40, 60], 50) === 1, 'message: <code>where([40, 60], 50)</code> should return <code>1</code>.');",
|
||||
"assert(where([3, 10, 5], 3) === 0, 'message: <code>where([3, 10, 5], 3)</code> should return <code>0</code>.');",
|
||||
"assert(where([5, 3, 20, 3], 5) === 2, 'message: <code>where([5, 3, 20, 3], 5)</code> should return <code>2</code>.');",
|
||||
"assert(where([2, 20, 10], 19) === 2, 'message: <code>where([2, 20, 10], 19)</code> should return <code>2</code>.');",
|
||||
"assert(where([2, 5, 10], 15) === 3, 'message: <code>where([2, 5, 10], 15)</code> should return <code>3</code>.');"
|
||||
"assert(getIndexToIns([10, 20, 30, 40, 50], 35) === 3, 'message: <code>getIndexToIns([10, 20, 30, 40, 50], 35)</code> should return <code>3</code>.');",
|
||||
"assert(getIndexToIns([10, 20, 30, 40, 50], 30) === 2, 'message: <code>getIndexToIns([10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.');",
|
||||
"assert(getIndexToIns([40, 60], 50) === 1, 'message: <code>getIndexToIns([40, 60], 50)</code> should return <code>1</code>.');",
|
||||
"assert(getIndexToIns([3, 10, 5], 3) === 0, 'message: <code>getIndexToIns([3, 10, 5], 3)</code> should return <code>0</code>.');",
|
||||
"assert(getIndexToIns([5, 3, 20, 3], 5) === 2, 'message: <code>getIndexToIns([5, 3, 20, 3], 5)</code> should return <code>2</code>.');",
|
||||
"assert(getIndexToIns([2, 20, 10], 19) === 2, 'message: <code>getIndexToIns([2, 20, 10], 19)</code> should return <code>2</code>.');",
|
||||
"assert(getIndexToIns([2, 5, 10], 15) === 3, 'message: <code>getIndexToIns([2, 5, 10], 15)</code> should return <code>3</code>.');"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"isRequired": true,
|
||||
"solutions": [
|
||||
"function where(arr, num) {\n arr = arr.sort(function(a, b){return a-b;});\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] >= num)\n {\n return i;\n }\n }\n return arr.length;\n}"
|
||||
"function getIndexToIns(arr, num) {\n arr = arr.sort(function(a, b){return a-b;});\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] >= num)\n {\n return i;\n }\n }\n return arr.length;\n}"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Array.sort()"
|
||||
|
@ -651,7 +651,7 @@
|
||||
},
|
||||
{
|
||||
"id": "56533eb9ac21ba0edf2244af",
|
||||
"title": "Compound Assignment With +=",
|
||||
"title": "Compound Assignment With Augmented Addition",
|
||||
"description": [
|
||||
"In programming, it is common to use assignments to modify the contents of a variable. Remember that everything to the right of the equals sign is evaluated first, so we can say:",
|
||||
"<code>myVar = myVar + 5;</code>",
|
||||
@ -702,7 +702,7 @@
|
||||
},
|
||||
{
|
||||
"id": "56533eb9ac21ba0edf2244b0",
|
||||
"title": "Compound Assignment With -=",
|
||||
"title": "Compound Assignment With Augmented Subtraction",
|
||||
"description": [
|
||||
"Like the <code>+=</code> operator, <code>-=</code> subtracts a number from a variable.",
|
||||
"<code>myVar = myVar - 5;</code>",
|
||||
@ -752,7 +752,7 @@
|
||||
},
|
||||
{
|
||||
"id": "56533eb9ac21ba0edf2244b1",
|
||||
"title": "Compound Assignment With *=",
|
||||
"title": "Compound Assignment With Augmented Multiplication",
|
||||
"description": [
|
||||
"The <code>*=</code> operator multiplies a variable by a number.",
|
||||
"<code>myVar = myVar * 5;</code>",
|
||||
@ -802,7 +802,7 @@
|
||||
},
|
||||
{
|
||||
"id": "56533eb9ac21ba0edf2244b2",
|
||||
"title": "Compound Assignment With /=",
|
||||
"title": "Compound Assignment With Augmented Division",
|
||||
"description": [
|
||||
"The <code>/=</code> operator divides a variable by another number.",
|
||||
"<code>myVar = myVar / 5;</code>",
|
||||
@ -3446,6 +3446,9 @@
|
||||
"solutions": [
|
||||
"function myTest(val) {\n var answer = \"\";\n\n switch (val) {\n case 1:\n answer = \"alpha\";\n break;\n case 2:\n answer = \"beta\";\n break;\n case 3:\n answer = \"gamma\";\n break;\n case 4:\n answer = \"delta\";\n }\n return answer; \n}"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Switch Statement"
|
||||
],
|
||||
"tests": [
|
||||
"assert(myTest(1) === \"alpha\", 'message: <code>myTest(1) should have a value of \"alpha\"');",
|
||||
"assert(myTest(2) === \"beta\", 'message: <code>myTest(2) should have a value of \"beta\"');",
|
||||
|
@ -17,7 +17,7 @@
|
||||
"To get started, we should nest all of our HTML in a <code>div</code> element with the class <code>container-fluid</code>."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"<link href=\"http://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
||||
"<link href=\"https://fonts.googleapis.com/css?family=Lobster\" rel=\"stylesheet\" type=\"text/css\">",
|
||||
"<style>",
|
||||
" .red-text {",
|
||||
" color: red;",
|
||||
|
@ -684,7 +684,8 @@
|
||||
"id": "a5deed1811a43193f9f1c841",
|
||||
"title": "Drop it",
|
||||
"description": [
|
||||
"Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.",
|
||||
"Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns <code>true</code>.",
|
||||
"The second argument, <code>func</code>, is a function you'll use to test the first elements of the array to decide if you should drop it or not.",
|
||||
"Return the rest of the array, otherwise return an empty array.",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck. Try to pair program. Write your own code."
|
||||
],
|
||||
|
@ -342,7 +342,7 @@
|
||||
"assert(code.match(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?button\\s*?(?:'|\")/gi), 'message: Use the <code>$(\"button\")</code> selector.');",
|
||||
"assert(code.match(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?\\.btn\\s*?(?:'|\")/gi), 'message: Use the <code>$(\".btn\")</code> selector.');",
|
||||
"assert(code.match(/\\$\\s*?\\(\\s*?(?:'|\")\\s*?#target1\\s*?(?:'|\")/gi), 'message: Use the <code>$(\"#target1\")</code> selector.');",
|
||||
"assert(code.match(/addClass/g) && code.match(/addClass\\(\\s*?('|\")[\\w-]+\\1\\s*?\\)/g).length > 2, 'message: Only add one class with each of your three selectors.');",
|
||||
"assert(code.match(/addClass/g) && code.match(/addClass\\(\\s*?('|\")\\s*?[\\w-]+\\s*?\\1\\s*?\\)/g).length > 2, 'message: Only add one class with each of your three selectors.');",
|
||||
"assert($(\"#target1\").hasClass(\"animated\") && $(\"#target1\").hasClass(\"shake\") && $(\"#target1\").hasClass(\"btn-primary\"), 'message: Your <code>#target1</code> element should have the classes <code>animated</code>‚ <code>shake</code> and <code>btn-primary</code>.');",
|
||||
"assert(!code.match(/class.*animated/g), 'message: Only use jQuery to add these classes to the element.');"
|
||||
],
|
||||
|
@ -118,7 +118,34 @@
|
||||
""
|
||||
]
|
||||
],
|
||||
"titleEs": "Reclama tu certificado de Visualización de datos"
|
||||
"titleEs": "Reclama tu certificado de Visualización de datos",
|
||||
"descriptionFr": [
|
||||
[
|
||||
"//i.imgur.com/Et3iD74.jpg",
|
||||
"Une image de note Certificat de Visualisation de données",
|
||||
"Ce défi vous permettra d’avoir votre Certificat de Visualisation de données vérifiée. Avant de vous donner votre certificat, il faut s’assurer que vous avez bien accomplie tous les projets de React et D3.js et il faut que vous acceptiez notre Academic Honesty Pledge. Cliquez sur le bouton si dessous pour démarrer le processus.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"//i.imgur.com/HArFfMN.jpg",
|
||||
"Une définition du plagiat : Plagiat (nom) – copier le travail d’un autre et le présenter comme étant le tien, sans mention de l’auteur original",
|
||||
"En cliquant si dessous, je garantie que tout le code que j’ai présenté A) est mon propre code ou celui de mon collaborateur, B) vient d’un projet open-source comme jQuery, ou C) contient les mentions nécessaires des auteurs. Vous nous donnez aussi la permission de vérifier vos solutions et de révoquer votre certificat en cas de détection de plagiat.",
|
||||
"#"
|
||||
],
|
||||
[
|
||||
"//i.imgur.com/14F2Van.jpg",
|
||||
"Une image du texte \"Data Visualization Certificate requirements\"",
|
||||
"On va confirmer maintenant que vous avez bien terminé nos projets de React et D3.js. Cliquez sur le bouton si dessous pour vérifier cela.",
|
||||
"#"
|
||||
],
|
||||
[
|
||||
"//i.imgur.com/16SIhHO.jpg",
|
||||
"Une image du mot \"Congratulations\"",
|
||||
"Félicitations! On vient d’ajouter votre Certificat de Visualisation de données à votre profile. Cette certificat est public et vérifiable, mais vous pouvez le cacher si vous désirer.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"titleFr":"Réclamer votre Certificat de Visualisation de données"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -29,12 +29,6 @@ block content
|
||||
a.btn.btn-lg.btn-block.btn-google-plus.btn-link-social(href='/link/google')
|
||||
i.fa.fa-google-plus
|
||||
| Add my Google+ to my portfolio
|
||||
.col-xs-12
|
||||
a.btn.btn-lg.btn-block.btn-primary.btn-link-social(href='/logout')
|
||||
| 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')
|
||||
| Email us at team@freecodecamp.com
|
||||
.spacer
|
||||
h2.text-center Account Settings
|
||||
.row
|
||||
|
@ -12,6 +12,12 @@ block content
|
||||
.col-xs-12
|
||||
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')
|
||||
| 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')
|
||||
| Email us at team@freecodecamp.com
|
||||
.spacer
|
||||
h1.text-center #{username}'s code portfolio
|
||||
hr
|
||||
|
Reference in New Issue
Block a user