some more code cleanup and UI optimizations

This commit is contained in:
Ralf Teusner
2016-09-09 16:10:43 +02:00
parent 542ec78076
commit 2b621e2de6
5 changed files with 8 additions and 15 deletions

View File

@ -139,9 +139,7 @@ var CodeOceanEditor = {
},
handleKeyPress: function (event) {
if (event.which === this.ALT_1_KEY_CODE) {
this.showWorkspaceTab(event);
} else if (event.which === this.ALT_R_KEY_CODE) {
if (event.which === this.ALT_R_KEY_CODE) {
$('#run').trigger('click');
} else if (event.which === this.ALT_S_KEY_CODE) {
$('#assess').trigger('click');
@ -276,7 +274,6 @@ var CodeOceanEditor = {
$(document).on('click', '#results a', this.showOutput.bind(this));
$(document).on('keypress', this.handleKeyPress.bind(this));
this.initializeFileTreeButtons();
this.initializeWorkflowButtons();
this.initializeWorkspaceButtons();
this.initializeRequestForComments()
},
@ -324,12 +321,9 @@ var CodeOceanEditor = {
$('[data-tooltip]').tooltip();
},
initializeWorkflowButtons: function () {
$('#start').on('click', this.showWorkspaceTab.bind(this));
$('#submit').on('click', this.submitCode.bind(this));
},
initializeWorkspaceButtons: function () {
$('#submit').on('click', this.submitCode.bind(this));
$('#assess').on('click', this.scoreCode.bind(this));
$('#dropdown-render, #render').on('click', this.renderCode.bind(this));
$('#dropdown-run, #run').on('click', this.runCode.bind(this));
@ -452,8 +446,7 @@ var CodeOceanEditor = {
var file = $(event.target).data('file');
var line = $(event.target).data('line');
this.showWorkspaceTab(null);
// set active file ?!?!
// set active file, only needed for codepilot, so skipped for now
var frame = $('div.frame[data-filename="' + file + '"]');
this.showFrame(frame);

View File

@ -156,6 +156,7 @@ CodeOceanEditorSubmissions = {
if ($('#test').is(':visible')) {
this.createSubmission('#test', null, function(response) {
this.showSpinner($('#test'));
$('#score_div').addClass('hidden');
var url = response.test_url.replace(this.FILENAME_URL_PLACEHOLDER, this.active_file.filename);
this.initializeSocketForTesting(url);
}.bind(this));

View File

@ -107,10 +107,11 @@ button i.fa-spin {
.sidebar-col-collapsed {
-webkit-transition: width 2s;
transition: width 2s;
width:52px;
width:67px;
float:left;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
.sidebar-col {
@ -125,8 +126,6 @@ button i.fa-spin {
.editor-col {
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
width:auto;
height:100%;
overflow:hidden;

View File

@ -1,4 +1,4 @@
button.btn class=local_assigns.fetch(:classes, 'btn-primary') *local_assigns.fetch(:data, {}) disabled=local_assigns.fetch(:disabled, false) id=id title=local_assigns[:title] type='button'
button.btn class=local_assigns.fetch(:classes, 'btn-primary btn-sm') *local_assigns.fetch(:data, {}) disabled=local_assigns.fetch(:disabled, false) id=id title=local_assigns[:title] type='button'
i.fa.fa-circle-o-notch.fa-spin
i class=icon
= label

View File

@ -1,6 +1,6 @@
div id='output_sidebar_collapsed'
= render('editor_button', classes: 'btn-block btn-primary btn-sm', data: {:'data-toggle' => 'tooltip', :'data-placement' => 'left'}, title: t('exercises.editor.expand_output_sidebar'), icon: 'fa fa-plus-square', id: 'toggle-sidebar-output-collapsed', label: '')
div id='output_sidebar_uncollapsed' class='hidden col-sm-12' data-message-no-output=t('exercises.implement.no_output')
div id='output_sidebar_uncollapsed' class='hidden col-sm-12 enforce-bottom-margin' data-message-no-output=t('exercises.implement.no_output')
.row
= render('editor_button', classes: 'btn-block btn-primary btn-sm', icon: 'fa fa-minus-square', id: 'toggle-sidebar-output', label: t('exercises.editor.collapse_output_sidebar'))