Merge pull request #1183 from benmcmahon100/patch-6

Combined UI Fixes
This commit is contained in:
Quincy Larson
2015-07-02 13:46:33 -07:00
4 changed files with 222 additions and 177 deletions

View File

@ -349,6 +349,48 @@ $(document).ready(function() {
}); });
}; };
//fakeiphone positioning hotfix
if($('.iphone-position').html() !==undefined || $('.iphone').html() !== undefined){
var startIphonePosition = parseInt($('.iphone-position').css('top').replace('px', ''));
var startIphone = parseInt($('.iphone').css('top').replace('px', ''));
$(window).on('scroll', function(){
if((($('.courseware-height').height() + $('.courseware-height').offset().top)-$(window).scrollTop()-$('.iphone-position').height()) <= 0){
$('.iphone-position').css('top', startIphonePosition+(($('.courseware-height').height() + $('.courseware-height').offset().top)-$(window).scrollTop()-$('.iphone-position').height()));
$('.iphone').css('top', startIphonePosition+(($('.courseware-height').height() + $('.courseware-height').offset().top)-$(window).scrollTop()-$('.iphone-position').height())+120);
}
else{
$('.iphone-position').css('top', startIphonePosition);
$('.iphone').css('top', startIphone);
}
});
}
if($('.scroll-locker') != undefined){
function lockTop(initOff){
$(window).scroll(function() {
if ($(window).width() >= 992) {
if ((($('.scroll-locker').offset().top - $(window).scrollTop()) + $('.scroll-locker').height()) >= ($('.fcc-footer').offset().top - $(window).scrollTop())) {
$('.scroll-locker').css('position', 'fixed').css('top', initOff).css('width', $($('.scroll-locker').parent()).width()).css('max-height', '75%').css('overflow-y', 'auto').css('overflow-x', 'hidden');
$('.well').css('margin-right', '6px');
}
else {
$('.scroll-locker').css('position', 'fixed').css('bottom', $('.fcc-footer') - (($('.scroll-locker').offset().top - $(window).scrollTop()) + $('.scroll-locker').height()) - ($('.fcc-footer').offset().top - $(window).scrollTop())).css('width', $($('.scroll-locker').parent()).width()).css('max-height', '75%').css('overflow-y', 'auto').css('overflow-x', 'hidden');
$('.well').css('margin-right', '6px');
}
}
else {
$('.scroll-locker').css('position', 'inherit').css('top', 'inherit').css('width', '100%').css('max-height', '').css('overflow-y', 'auto').css('overflow-x', 'hidden');
$('.well').css('margin-right', '');
}
});
}
var initOff = ($('.scroll-locker').offset().top - $(window).scrollTop());
lockTop(initOff);
$(window).on('resize', function(){
lockTop(initOff);
});
}
$('#comment-button').on('click', commentSubmitButtonHandler); $('#comment-button').on('click', commentSubmitButtonHandler);
}); });

View File

@ -18,102 +18,103 @@ block content
.row(ng-controller="pairedWithController") .row(ng-controller="pairedWithController")
.col-xs-12.col-sm-12.col-md-4.col-lg-3 .col-xs-12.col-sm-12.col-md-4.col-lg-3
#testCreatePanel.well .scroll-locker
h3.text-center.negative-10= name #testCreatePanel.well
.positive-15.positive-15-bottom h3.text-center.negative-10= name
h4.text-center.bonfire-flames Difficulty:&thinsp; .positive-15.positive-15-bottom
if (difficulty == "0") h4.text-center.bonfire-flames Difficulty:&thinsp;
i.ion-ios-flame-outline if (difficulty == "0")
i.ion-ios-flame-outline i.ion-ios-flame-outline
i.ion-ios-flame-outline i.ion-ios-flame-outline
i.ion-ios-flame-outline i.ion-ios-flame-outline
i.ion-ios-flame-outline i.ion-ios-flame-outline
if (difficulty == "1") i.ion-ios-flame-outline
i.ion-ios-flame if (difficulty == "1")
i.ion-ios-flame-outline i.ion-ios-flame
i.ion-ios-flame-outline i.ion-ios-flame-outline
i.ion-ios-flame-outline i.ion-ios-flame-outline
i.ion-ios-flame-outline i.ion-ios-flame-outline
if (difficulty == "2") i.ion-ios-flame-outline
i.ion-ios-flame if (difficulty == "2")
i.ion-ios-flame i.ion-ios-flame
i.ion-ios-flame-outline i.ion-ios-flame
i.ion-ios-flame-outline i.ion-ios-flame-outline
i.ion-ios-flame-outline i.ion-ios-flame-outline
if (difficulty == "3") i.ion-ios-flame-outline
i.ion-ios-flame if (difficulty == "3")
i.ion-ios-flame i.ion-ios-flame
i.ion-ios-flame i.ion-ios-flame
i.ion-ios-flame-outline i.ion-ios-flame
i.ion-ios-flame-outline i.ion-ios-flame-outline
if (difficulty == "4") i.ion-ios-flame-outline
i.ion-ios-flame if (difficulty == "4")
i.ion-ios-flame i.ion-ios-flame
i.ion-ios-flame i.ion-ios-flame
i.ion-ios-flame i.ion-ios-flame
i.ion-ios-flame-outline i.ion-ios-flame
if (difficulty == "5") i.ion-ios-flame-outline
i.ion-ios-flame if (difficulty == "5")
i.ion-ios-flame i.ion-ios-flame
i.ion-ios-flame i.ion-ios-flame
i.ion-ios-flame i.ion-ios-flame
i.ion-ios-flame i.ion-ios-flame
.row i.ion-ios-flame
.col-xs-12 .row
.bonfire-instructions
for sentence in details
p.wrappable.negative-10!= sentence
.negative-bottom-margin-30
#MDN-links
p.negative-10 Here are some helpful links:
for link, index in MDNlinks
.negative-10
ul: li: a(href=""+link, target="_blank") !{MDNkeys[index]}
if (user)
form.form-horizontal(novalidate='novalidate', name='completedWithForm')
.form-group.text-center.negative-10
.col-xs-12 .col-xs-12
// extra field to distract password tools like lastpass from injecting css into our username field .bonfire-instructions
input.form-control(ng-show="false") for sentence in details
input.form-control#completed-with(name="existingUser", placeholder="Your pair's username if pairing", existing-username='', ng-model="existingUser") p.wrappable.negative-10!= sentence
.col-xs-12(ng-cloak, ng-show="completedWithForm.$error.exists && !completedWithForm.existingUser.$pristine && existingUser.length > 0") .negative-bottom-margin-30
alert(type='danger') #MDN-links
span.ion-close-circled p.negative-10 Here are some helpful links:
| Username not found for link, index in MDNlinks
label.negative-10.btn.btn-primary.btn-block#submitButton .negative-10
i.fa.fa-play ul: li: a(href=""+link, target="_blank") !{MDNkeys[index]}
| &nbsp; Run code (ctrl + enter)
.button-spacer if (user)
.btn-group.input-group.btn-group-justified form.form-horizontal(novalidate='novalidate', name='completedWithForm')
label.btn.btn-success#trigger-reset-modal .form-group.text-center.negative-10
i.fa.fa-refresh .col-xs-12
| &nbsp; Reset // extra field to distract password tools like lastpass from injecting css into our username field
label.btn.btn-success#trigger-help-modal input.form-control(ng-show="false")
i.fa.fa-medkit input.form-control#completed-with(name="existingUser", placeholder="Your pair's username if pairing", existing-username='', ng-model="existingUser")
| &nbsp; Help .col-xs-12(ng-cloak, ng-show="completedWithForm.$error.exists && !completedWithForm.existingUser.$pristine && existingUser.length > 0")
label.btn.btn-success#trigger-pair-modal alert(type='danger')
i.fa.fa-user-plus span.ion-close-circled
| &nbsp; Pair | Username not found
label.btn.btn-success#trigger-issue-modal label.negative-10.btn.btn-primary.btn-block#submitButton
i.fa.fa-bug i.fa.fa-play
| &nbsp; Bug | &nbsp; Run code (ctrl + enter)
.button-spacer .button-spacer
form.code .btn-group.input-group.btn-group-justified
.form-group.codeMirrorView label.btn.btn-success#trigger-reset-modal
textarea#codeOutput(style='display: none;') i.fa.fa-refresh
br | &nbsp; Reset
#testSuite.negative-10 label.btn.btn-success#trigger-help-modal
br i.fa.fa-medkit
script(type="text/javascript"). | &nbsp; Help
var tests = !{JSON.stringify(tests)}; label.btn.btn-success#trigger-pair-modal
var challengeSeed = !{JSON.stringify(challengeSeed)}; i.fa.fa-user-plus
var challenge_Id = !{JSON.stringify(challengeId)}; | &nbsp; Pair
var challenge_Name = !{JSON.stringify(name)}; label.btn.btn-success#trigger-issue-modal
var started = Math.floor(Date.now()); i.fa.fa-bug
var challengeType = !{JSON.stringify(challengeType)}; | &nbsp; Bug
var _ = R; .button-spacer
var dashed = !{JSON.stringify(dashedName)}; form.code
.form-group.codeMirrorView
textarea#codeOutput(style='display: none;')
br
#testSuite.negative-10
br
script(type="text/javascript").
var tests = !{JSON.stringify(tests)};
var challengeSeed = !{JSON.stringify(challengeSeed)};
var challenge_Id = !{JSON.stringify(challengeId)};
var challenge_Name = !{JSON.stringify(name)};
var started = Math.floor(Date.now());
var challengeType = !{JSON.stringify(challengeType)};
var _ = R;
var dashed = !{JSON.stringify(dashedName)};
.col-xs-12.col-sm-12.col-md-8 .col-xs-12.col-sm-12.col-md-8
#mainEditorPanel #mainEditorPanel

View File

@ -21,45 +21,46 @@ block content
script(src='/js/lib/codemirror/addon/emmet/emmet.js') script(src='/js/lib/codemirror/addon/emmet/emmet.js')
.row.courseware-height .row.courseware-height
.col-xs-12.col-sm-12.col-md-3.col-lg-3 .col-xs-12.col-sm-12.col-md-3.col-lg-3
.well .scroll-locker
.row .well
.col-xs-12 .row
h3.text-center.negative-10= name .col-xs-12
.bonfire-instructions h3.text-center.negative-10= name
for sentence in details .bonfire-instructions
p.wrappable.negative-10!= sentence for sentence in details
.negative-bottom-margin-30 p.wrappable.negative-10!= sentence
if (user) .negative-bottom-margin-30
label.btn.btn-primary.btn-block.negative-10#next-courseware-button if (user)
.ion-checkmark-circled label.btn.btn-primary.btn-block.negative-10#next-courseware-button
| &nbsp; Go to my next challenge (ctrl + enter) .ion-checkmark-circled
.button-spacer | &nbsp; Go to my next challenge (ctrl + enter)
.btn-group.input-group.btn-group-justified .button-spacer
label.btn.btn-success#trigger-help-modal .btn-group.input-group.btn-group-justified
i.fa.fa-medkit label.btn.btn-success#trigger-help-modal
| &nbsp; Help i.fa.fa-medkit
label.btn.btn-success#trigger-issue-modal | &nbsp; Help
i.fa.fa-bug label.btn.btn-success#trigger-issue-modal
| &nbsp; Bug i.fa.fa-bug
script. | &nbsp; Bug
var userLoggedIn = true;
else
.button-spacer
a.btn.signup-btn.btn-block.btn-block.negative-15(href='/login') Sign in so you can save your progress
script. script.
var userLoggedIn = false; var userLoggedIn = true;
.button-spacer else
ul#testSuite.list-group .button-spacer
br a.btn.signup-btn.btn-block.btn-block.negative-15(href='/login') Sign in so you can save your progress
script(type="text/javascript"). script.
$('#next-courseware-button').attr('disabled', 'disabled'); var userLoggedIn = false;
var tests = !{JSON.stringify(tests)}; .button-spacer
var challengeSeed = !{JSON.stringify(challengeSeed)}; ul#testSuite.list-group
var challenge_Id = !{JSON.stringify(challengeId)}; br
var challenge_Name = !{JSON.stringify(name)}; script(type="text/javascript").
var prodOrDev = !{JSON.stringify(environment)}; $('#next-courseware-button').attr('disabled', 'disabled');
var challengeType = !{JSON.stringify(challengeType)}; var tests = !{JSON.stringify(tests)};
var started = Math.floor(Date.now()); var challengeSeed = !{JSON.stringify(challengeSeed)};
var challenge_Id = !{JSON.stringify(challengeId)};
var challenge_Name = !{JSON.stringify(name)};
var prodOrDev = !{JSON.stringify(environment)};
var challengeType = !{JSON.stringify(challengeType)};
var started = Math.floor(Date.now());
.col-xs-12.col-sm-12.col-md-5.col-lg-6 .col-xs-12.col-sm-12.col-md-5.col-lg-6
#mainEditorPanel #mainEditorPanel
form.code form.code

View File

@ -16,50 +16,51 @@ block content
script(src='/js/lib/coursewares/sandbox.js') script(src='/js/lib/coursewares/sandbox.js')
.row .row
.col-xs-12.col-sm-12.col-md-4.bonfire-top .col-xs-12.col-sm-12.col-md-4.bonfire-top
#testCreatePanel .scroll-locker
h1.text-center= name #testCreatePanel
.well h1.text-center= name
.row .well
.col-xs-12 .row
.bonfire-instructions .col-xs-12
p.wrappable= brief .bonfire-instructions
#brief-instructions p.wrappable= brief
#more-info.btn.btn-primary.btn-block.btn-primary-ghost #brief-instructions
span.ion-arrow-down-b #more-info.btn.btn-primary.btn-block.btn-primary-ghost
| More information span.ion-arrow-down-b
#long-instructions.row.hide | More information
.col-xs-12 #long-instructions.row.hide
for sentence in details .col-xs-12
p.wrappable!= sentence for sentence in details
#less-info.btn.btn-primary.btn-block.btn-primary-ghost p.wrappable!= sentence
span.ion-arrow-up-b #less-info.btn.btn-primary.btn-block.btn-primary-ghost
| Less information span.ion-arrow-up-b
#submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter) | Less information
.button-spacer #submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter)
.btn-group.input-group.btn-group-justified .button-spacer
label.btn.btn-success#trigger-help-modal .btn-group.input-group.btn-group-justified
i.fa.fa-medkit label.btn.btn-success#trigger-help-modal
| &nbsp; Help i.fa.fa-medkit
label.btn.btn-success#trigger-pair-modal | &nbsp; Help
i.fa.fa-user-plus label.btn.btn-success#trigger-pair-modal
| &nbsp; Pair i.fa.fa-user-plus
label.btn.btn-success#trigger-issue-modal | &nbsp; Pair
i.fa.fa-bug label.btn.btn-success#trigger-issue-modal
| &nbsp; Bug i.fa.fa-bug
.spacer | &nbsp; Bug
form.code .spacer
.form-group.codeMirrorView form.code
textarea#codeOutput(style='display: none;') .form-group.codeMirrorView
br textarea#codeOutput(style='display: none;')
#testSuite br
br #testSuite
script(type="text/javascript"). br
var tests = !{JSON.stringify(tests)}; script(type="text/javascript").
var challengeSeed = !{JSON.stringify(challengeSeed)}; var tests = !{JSON.stringify(tests)};
var challenge_Id = !{JSON.stringify(challengeId)}; var challengeSeed = !{JSON.stringify(challengeSeed)};
var challenge_Name = !{JSON.stringify(name)}; var challenge_Id = !{JSON.stringify(challengeId)};
var challengeType = !{JSON.stringify(challengeType)}; var challenge_Name = !{JSON.stringify(name)};
var started = Math.floor(Date.now()); var challengeType = !{JSON.stringify(challengeType)};
var started = Math.floor(Date.now());
.col-xs-12.col-sm-12.col-md-8 .col-xs-12.col-sm-12.col-md-8
#mainEditorPanel #mainEditorPanel