From 19c24083488a4232e21cab0759f627f3e98d823e Mon Sep 17 00:00:00 2001 From: biellls Date: Mon, 27 Jul 2015 20:37:39 +0200 Subject: [PATCH 1/3] Change order of subarrays to cover all cases Since in all tests each subarray has a larger max than the previous subarray, if the user does not reset max for each subarray, the tests still pass. --- seed/challenges/basic-bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index b2a49c8ce3c..aae7c5ad2ea 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -308,7 +308,7 @@ ], "tests": [ "expect(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])).to.be.a('array');", - "(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.eql([5,27,39,1001]);", + "(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.eql([27,5,39,1001]);", "assert(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]).should.eql([9,35,97,1000000]));" ], "MDNlinks": [ From abfab7389b6296f9aa3db4e9653dd08015fe2401 Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Sat, 1 Aug 2015 19:55:40 +0100 Subject: [PATCH 2/3] Added the scrolling editor --- public/js/main_0.0.3.js | 4 ++++ server/views/coursewares/showHTML.jade | 9 +++++---- server/views/coursewares/showJS.jade | 11 ++++++----- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/public/js/main_0.0.3.js b/public/js/main_0.0.3.js index 5a19e61fe59..e502bd50d3a 100644 --- a/public/js/main_0.0.3.js +++ b/public/js/main_0.0.3.js @@ -311,6 +311,10 @@ $(document).ready(function() { $('#story-submit').on('click', storySubmitButtonHandler); + if($('.editorScrollDiv').html() !== 'undefined'){ + $('.editorScrollDiv').css("height",$(window).height()-($('.navbar').height()+$('.footer').height()+100) + "px"); + } + //fakeiphone positioning hotfix if($('.iphone-position').html() !==undefined || $('.iphone').html() !== undefined){ var startIphonePosition = parseInt($('.iphone-position').css('top').replace('px', '')); diff --git a/server/views/coursewares/showHTML.jade b/server/views/coursewares/showHTML.jade index 26ae70c991c..60cc98e1e25 100644 --- a/server/views/coursewares/showHTML.jade +++ b/server/views/coursewares/showHTML.jade @@ -65,10 +65,11 @@ block content var challengeType = !{JSON.stringify(challengeType)}; var started = Math.floor(Date.now()); .col-xs-12.col-sm-12.col-md-5.col-lg-6 - #mainEditorPanel - form.code - .form-group.codeMirrorView - textarea#codeEditor(autofocus=true, style='display: none;') + .editorScrollDiv(style = "overflow-y: scroll; overflow-x: hidden;") + #mainEditorPanel + form.code + .form-group.codeMirrorView + textarea#codeEditor(autofocus=true, style='display: none;') .col-md-4.col-lg-3 .hidden-xs.hidden-sm img.iphone-position.iframe-scroll(src="https://s3.amazonaws.com/freecodecamp/iphone6-frame.png") diff --git a/server/views/coursewares/showJS.jade b/server/views/coursewares/showJS.jade index 866c5e4fd15..8d178dc186e 100644 --- a/server/views/coursewares/showJS.jade +++ b/server/views/coursewares/showJS.jade @@ -66,11 +66,12 @@ block content var _ = R; var dashed = !{JSON.stringify(dashedName)}; .col-xs-12.col-sm-12.col-md-8 - #mainEditorPanel - form.code - .form-group.codeMirrorView - textarea#codeEditor(autofocus=true, style='display: none;') - script(src='/js/lib/coursewares/coursewaresJSFramework_0.0.6.js') + .editorScrollDiv(style = "overflow-y: scroll; overflow-x: hidden;") + #mainEditorPanel + form.code + .codeMirrorView + textarea#codeEditor(autofocus=true, style='display: none;') + script(src='/js/lib/coursewares/coursewaresJSFramework_0.0.6.js') #complete-courseware-dialog.modal(tabindex='-1') .modal-dialog.animated.zoomIn.fast-animation .modal-content From 608071df08e4ff21799ca55debe1dc5a68848cef Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Sat, 1 Aug 2015 20:01:47 +0100 Subject: [PATCH 3/3] added a width to make the scrolling editor look nice --- public/css/main.less | 1 + 1 file changed, 1 insertion(+) diff --git a/public/css/main.less b/public/css/main.less index 73bbb1f5893..68ffd44dc04 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -735,6 +735,7 @@ form.code span { #mainEditorPanel { height: 100%; + width: 99%; } .big-error-icon {