Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/JSSaini07/hackIDE into JSSa…
Browse files Browse the repository at this point in the history
…ini07-master

Conflicts:
	hackIDE/static/hackIDE/js/custom.js
  • Loading branch information
sahildua2305 committed Aug 13, 2016
2 parents fd11cb2 + cdd1b64 commit 7f81f04
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions hackIDE/static/hackIDE/js/custom.js
Expand Up @@ -2,7 +2,7 @@
* @Author: sahildua2305
* @Date: 2016-01-06 01:50:10
* @Last Modified by: Sahil Dua
* @Last Modified time: 2016-08-10 23:50:13
* @Last Modified time: 2016-08-13 13:13:25
*/


Expand Down Expand Up @@ -71,7 +71,7 @@ $(document).ready(function(){


checkForInitialData();

function showResultBox() {
$(".output-response-box").show();
$(".run-status").show();
Expand All @@ -83,7 +83,7 @@ $(document).ready(function(){
var run_status_memory = document.getElementById('run_status_memory').value;
var run_status_output = document.getElementById('run_status_output').value;
var run_status_stderr = document.getElementById('run_status_stderr').value;

if(compile_status == "OK") {
if(run_status_status == "AC") {
$(".output-io").show();
Expand Down Expand Up @@ -118,7 +118,7 @@ $(document).ready(function(){
$(".error-message").html(compile_status);
}
}

function checkForInitialData() {
var code_content = document.getElementById('saved_code_content').value;
var code_lang = document.getElementById('saved_code_lang').value;
Expand Down Expand Up @@ -183,9 +183,9 @@ $(document).ready(function(){
*
*/
function downloadFile(filename, text, lang) {

var ext = translateLangToExt(lang);

var zip = new JSZip()
zip.file(filename+"."+ext, text)
var downloaded = zip.generate({type : "blob"})
Expand Down Expand Up @@ -217,7 +217,7 @@ $(document).ready(function(){
updateContent();

var csrf_token = $(":input[name='csrfmiddlewaretoken']").val();

// if code_id present in url and updated compile URL
if(window.location.href.includes('code_id')) {
COMPILE_URL = '/../compile/';
Expand Down Expand Up @@ -337,7 +337,7 @@ $(document).ready(function(){
updateContent();

var csrf_token = $(":input[name='csrfmiddlewaretoken']").val();

// if code_id present in url and update run URL
if(window.location.href.includes('code_id')) {
RUN_URL = '/../run/';
Expand All @@ -363,14 +363,14 @@ $(document).ready(function(){
timeout: 10000,
success: function(response){
request_ongoing = false;

if(location.port == "")
$('#copy_code')[0].innerHTML = '<kbd>' + window.location.hostname + '/code_id=' + response.code_id + '/</kbd>';
else
$('#copy_code')[0].innerHTML = '<kbd>' + window.location.hostname + ':' + location.port +'/code_id=' + response.code_id + '/</kbd>';

$('#copy_code').css({'display': 'initial'});

// Change button text when this method is called
$("#run-code").html("Hack(run) it!");

Expand Down Expand Up @@ -580,7 +580,7 @@ $(document).ready(function(){
$("#show-settings").click(function(event){

event.stopPropagation();

// toggle visibility of the pane
$("#settings-pane").toggle();

Expand All @@ -603,7 +603,7 @@ $(document).ready(function(){
downloadFile("code", editorContent, $("#lang").val());

});

// when lang is changed
$("#lang").change(function(){

Expand Down Expand Up @@ -744,4 +744,11 @@ $(document).ready(function(){

});

// check if input box is to be show
if($('#custom-input').val()!="")
{
$('#custom-input-checkbox').click();
}


});

0 comments on commit 7f81f04

Please sign in to comment.