Pre View configurating

This commit is contained in:
Nathan Leniz
2015-01-20 02:19:39 -05:00
parent cc3fa8e5f7
commit bb87cc4bb3
3 changed files with 5 additions and 8 deletions

View File

@ -45,11 +45,6 @@ var api = {
} else { } else {
print('output', data.output); print('output', data.output);
} }
},
console: {
log: function(msg) {
console.log(msg);
}
} }
}; };
@ -69,7 +64,7 @@ var requests;
// (re)initializes the plugin // (re)initializes the plugin
var reset = function() { var reset = function() {
requests = 0; requests = 0;
plugin = new jailed.Plugin(path+'plugin.js', api); plugin = new jailed.Plugin(path+'plugin_v0.1.1.js', api);
plugin.whenDisconnected( function() { plugin.whenDisconnected( function() {
// give some time to handle the last responce // give some time to handle the last responce
setTimeout( function() { setTimeout( function() {

View File

@ -76,6 +76,7 @@ block content
'}\n\n' + '}\n\n' +
'test();'); 'test();');
myCodeMirror.setSize("100%", 500); myCodeMirror.setSize("100%", 500);
var codeOutput = CodeMirror.fromTextArea(document.getElementById("codeOutput"), { var codeOutput = CodeMirror.fromTextArea(document.getElementById("codeOutput"), {
lineNumbers: false, lineNumbers: false,
mode: "text", mode: "text",
@ -196,8 +197,9 @@ block content
var output; var output;
$('#testInputs').find('input').each(function () { $('#testInputs').find('input').each(function () {
if ($(this).val() != null && $(this).val().length !== 0) { if ($(this).val() != null && $(this).val().length !== 0) {
inputs.push($(this).val());
} else { } else {
var keepGoing = prompt("You have submitted a test with empty input. Enter yes to continue."); //var keepGoing = prompt("You have submitted a test with empty input. Enter yes to continue.");
if (/yes/.test(keepGoing.toLowerCase())) { if (/yes/.test(keepGoing.toLowerCase())) {
inputs.push($(this).val()); inputs.push($(this).val());
} else { } else {
@ -221,7 +223,7 @@ block content
.addClass("glyphicon glyphicon-remove-sign") .addClass("glyphicon glyphicon-remove-sign")
.css("float", "right") .css("float", "right")
.click(function () { .click(function () {
var input = prompt("This will remove the test permanently.\n If you want to do this, type delete"); //var input = prompt("This will remove the test permanently.\n If you want to do this, type delete");
if (/delete/.test(input.toLowerCase())) { if (/delete/.test(input.toLowerCase())) {
$(this).parent().remove(); $(this).parent().remove();
} }