moved method

This commit is contained in:
Hauke Klement
2015-03-14 12:25:53 +01:00
parent 4a14e93d2c
commit ebc06c09db

View File

@ -212,6 +212,30 @@ $(function() {
showTab(3);
};
var handleStderrOutputForFlowr = function(event) {
var flowrUrl = $('#flowrHint').data('url');
var json = JSON.parse(event.data);
var stderrOutput = '';
if (json.stderr) {
stderrOutput += json.stderr;
} else if (json.code) {
var flowrHintBody = $('#flowrHint .panel-body');
$.getJSON(flowrUrl + '&query=' + escape(stderrOutput), function(data) {
_.each(_.compact(data.queryResults), function(question, index) {
var collapsibleTileHtml = flowrResultHtml.replace(/{{collapseId}}/g, 'collapse-' + index).replace(/{{headingId}}/g, 'heading-' + index);
var resultTile = $(collapsibleTileHtml);
resultTile.find('h4 > a').text(question.title);
resultTile.find('.panel-body').append(question.body);
flowrHintBody.append(resultTile);
});
$('#flowrHint').fadeIn();
});
}
};
var handleTestResponse = function(response) {
clearOutput();
printOutput(response[0], false, 0);
@ -616,28 +640,4 @@ $(function() {
showFirstFile();
showRequestedTab();
}
var handleStderrOutputForFlowr = function(event) {
var flowrUrl = $('#flowrHint').data('url');
var json = JSON.parse(event.data);
var stderrOutput = '';
if (json.stderr) {
stderrOutput += json.stderr;
} else if (json.code) {
var flowrHintBody = $('#flowrHint .panel-body');
$.getJSON(flowrUrl + '&query=' + escape(stderrOutput), function(data) {
_.each(_.compact(data.queryResults), function(question, index) {
var collapsibleTileHtml = flowrResultHtml.replace(/{{collapseId}}/g, 'collapse-' + index).replace(/{{headingId}}/g, 'heading-' + index);
var resultTile = $(collapsibleTileHtml);
resultTile.find('h4 > a').text(question.title);
resultTile.find('.panel-body').append(question.body);
flowrHintBody.append(resultTile);
});
$('#flowrHint').fadeIn();
});
}
};
});