diff --git a/websheets.css b/websheets.css index f8c9b28..3f2c7a8 100644 --- a/websheets.css +++ b/websheets.css @@ -141,6 +141,22 @@ div.CodeMirror-cursors { font-weight: bold; width: 100%; font-size: 100%; + color: black; + border: 1px solid #a2a2a2; + border-radius: 2px; + cursor: pointer; + padding: 10px 5px; + background-color: #f8f6f6; +} + +.wscontainer button:hover:enabled{ + background-color: #eeeeee; +} + +.wscontainer button:disabled{ + color: #b9bcbe; + border: 1px solid #f8f6f6; + cursor: not-allowed; } code, pre, tt, .wscontainer .CodeMirror, .CodeMirror * { @@ -275,3 +291,28 @@ background: linear-gradient(to right, #ffccee 49%,#ffffff 51%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffccee', endColorstr='#ffffff',GradientType=1 ); /* IE6-9 */ } +.wscontainer.ws-fullscreen{ + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 999; +} + +.wscontainer.ws-fullscreen .exercise-body{ + padding: 0px 10px; + overflow: scroll; + overflow-x: hidden; +} + +.wscontainer.ws-fullscreen .results-wrapper{ + margin-top: 10px; +} + +.wscontainer.ws-fullscreen table.buttonTable{ + position: fixed; + bottom: 3px; + left: 0px; + z-index: 9999; +} \ No newline at end of file diff --git a/websheets.js b/websheets.js index 7871ecb..f63a7ae 100644 --- a/websheets.js +++ b/websheets.js @@ -131,17 +131,17 @@ websheets.createAt = function(slug, data, containerdiv, preview) {
\ \| \ + | \ \ | \ -\ + | \ \ | \ -\ + | \ \ @@ -149,9 +149,16 @@ websheets.createAt = function(slug, data, containerdiv, preview) { Go back to my solution \ \ | \ +\ + \ + | \
" - + jqXHR.responseText + ""); + + jqXHR.responseText + ""); + if(this_ws.fullscreen){ + $(this_ws.div).find('.results-wrapper')[0].scrollIntoView() + } }, success: function(data) { if ('error_span' in data && data['error_span'] != '') { - $(this_ws.div).find(".submitButton").removeAttr("disabled"); + $(this_ws.div).find(".submitButton").removeAttr("disabled"); $(this_ws.div).find(".results").html(data['error_span']); return; } if (!this_ws.reference_sol && data.reference_sol) { this_ws.reference_sol = data.reference_sol; - $(this_ws.div).find(".showrefButton").removeAttr("disabled"); - $(this_ws.div).find(".showrefButton").html("View reference solution"); + $(this_ws.div).find(".showrefButton").removeAttr("disabled"); + $(this_ws.div).find(".showrefButton").html("View reference solution"); } - //console.log(data); - this_ws.num_submissions++; + //console.log(data); + this_ws.num_submissions++; if (data.anon_reference_sol) this_ws.anon_reference_sol = data.anon_reference_sol; if (!this_ws.reference_sol && ["never", "infinity"].indexOf(this_ws.load_data.attempts_until_ref)==-1) this_ws.updateTriesButton(); - $(this_ws.div).find(".submitButton").removeAttr("disabled"); - if (data.category == 'Passed' && !this_ws.viewing_ref) { - $(this_ws.div).addClass("passed"); - $(this_ws.div).addClass("ever-passed"); - } - var results = data.results; + $(this_ws.div).find(".submitButton").removeAttr("disabled"); + if (data.category == 'Passed' && !this_ws.viewing_ref) { + $(this_ws.div).addClass("passed"); + $(this_ws.div).addClass("ever-passed"); + } + var results = data.results; if (data.epilogue) { $(this_ws.div).find(".after-results") .html("