$.ajaxSetup({cache: false, dataType: "text"}); var _tracer = new Tracer(); var initEditor = function (id) { var editor = ace.edit(id); editor.setTheme("ace/theme/tomorrow_night_eighties"); editor.session.setMode("ace/mode/javascript"); editor.$blockScrolling = Infinity; return editor; }; var dataEditor = initEditor('data'); var codeEditor = initEditor('code'); dataEditor.on('change', function () { try { eval(dataEditor.getValue()); _tracer = tracer; } catch (err) { } _tracer.reset(); }); var loadFile = function (category, algorithm, file, explanation) { lastData = null; $('#explanation').html(explanation); dataEditor.setValue(''); codeEditor.setValue(''); var dir = './algorithm/' + category + '/' + algorithm + '/' + file + '/'; $.get(dir + 'data.js', function (data) { dataEditor.setValue(data, -1); $.get(dir + 'code.js', function (data) { codeEditor.setValue(data, -1); }); }).fail(function (jqXHR, textStatus, errorThrown) { alert("AJAX call failed: " + textStatus + ", " + errorThrown); }); }; var loadAlgorithm = function (category, algorithm) { $('#list > button').removeClass('active'); $('[data-category="' + category + '"][data-algorithm="' + algorithm + '"]').addClass('active'); $('#btn_description').click(); $('#category').text(list[category].name); $('#algorithm, #desc_title').text(list[category].list[algorithm]); $('#desc_def').html(''); $('#desc_app').empty(); $('#desc_time').html(''); $('#desc_space').html(''); $('#desc_ref').empty(); $('.files_bar').empty(); $('#explanation').html(''); dataEditor.setValue(''); codeEditor.setValue(''); var dir = './algorithm/' + category + '/' + algorithm + '/'; $.getJSON(dir + 'config.json', function (data) { $('#desc_def').html(data.def); $('#desc_app').empty(); data.apps.forEach(function (app) { $('#desc_app').append($('