diff --git a/css/stylesheet.css b/css/stylesheet.css
index 7c56f764..dc7f7627 100644
--- a/css/stylesheet.css
+++ b/css/stylesheet.css
@@ -1,4 +1,5 @@
-html, body {
+html,
+body {
margin: 0;
padding: 0;
overflow: hidden;
@@ -47,6 +48,7 @@ button {
button:hover {
background: rgba(0, 0, 0, .15) !important;
+ cursor: pointer;
}
button.active {
@@ -204,6 +206,12 @@ section {
box-sizing: border-box;
}
+#tab_desc h3 {
+ border-bottom: 1px solid rgb(81, 81, 81);
+ padding: 5px;
+ margin: 2px;
+}
+
#tab_desc > .wrapper a {
text-decoration: underline;
}
@@ -330,4 +338,4 @@ pre {
.mtbl-cell.notified {
background: #f00;
-}
+}
\ No newline at end of file
diff --git a/js/script.js b/js/script.js
index 4af6c2c5..01a4e0b9 100644
--- a/js/script.js
+++ b/js/script.js
@@ -1,6 +1,9 @@
-$.ajaxSetup({cache: false, dataType: "text"});
+$.ajaxSetup({
+ cache: false,
+ dataType: "text"
+});
-$(document).on('click', 'a', function (e) {
+$(document).on('click', 'a', function(e) {
e.preventDefault();
if (!window.open($(this).attr('href'), '_blank')) {
@@ -10,19 +13,21 @@ $(document).on('click', 'a', function (e) {
var tm = new TracerManager();
-$('#btn_interval input').on('change', function () {
+$('#btn_interval input').on('change', function() {
tm.interval = Number.parseFloat($(this).val() * 1000);
showInfoToast('Tracing interval has been set to ' + tm.interval / 1000 + ' second(s).');
});
var $module_container = $('.module_container');
ace.require("ace/ext/language_tools");
-var initEditor = function (id) {
+var initEditor = function(id) {
var editor = ace.edit(id);
editor.setOptions({
enableBasicAutocompletion: true,
enableSnippets: true,
- enableLiveAutocompletion: true
+ enableLiveAutocompletion: true,
+ fontFamily: "Source Code Pro",
+ fontSize: "10pt"
});
editor.setTheme("ace/theme/tomorrow_night_eighties");
editor.session.setMode("ace/mode/javascript");
@@ -32,37 +37,36 @@ var initEditor = function (id) {
var dataEditor = initEditor('data');
var codeEditor = initEditor('code');
var lastFile = null;
-dataEditor.on('change', function () {
+dataEditor.on('change', function() {
var data = dataEditor.getValue();
if (lastFile) cachedFile[lastFile].data = data;
try {
tm.deallocateAll();
eval(data);
- } catch (err) {
- } finally {
+ } catch (err) {} finally {
tm.visualize();
tm.removeUnallocated();
}
});
-codeEditor.on('change', function () {
+codeEditor.on('change', function() {
var code = codeEditor.getValue();
if (lastFile) cachedFile[lastFile].code = code;
});
var cachedFile = {};
var loading = false;
-var isScratchPaper = function (category, algorithm) {
+var isScratchPaper = function(category, algorithm) {
return category == null && algorithm == 'scratch_paper';
};
-var getAlgorithmDir = function (category, algorithm) {
+var getAlgorithmDir = function(category, algorithm) {
if (isScratchPaper(category, algorithm)) return './algorithm/scratch_paper/';
return './algorithm/' + category + '/' + algorithm + '/';
};
-var getFileDir = function (category, algorithm, file) {
+var getFileDir = function(category, algorithm, file) {
if (isScratchPaper(category, algorithm)) return './algorithm/scratch_paper/';
return './algorithm/' + category + '/' + algorithm + '/' + file + '/';
};
-var loadFile = function (category, algorithm, file, explanation) {
+var loadFile = function(category, algorithm, file, explanation) {
if (checkLoading()) return;
$('#explanation').html(explanation);
@@ -76,15 +80,15 @@ var loadFile = function (category, algorithm, file, explanation) {
cachedFile[dir] = {};
dataEditor.setValue('');
codeEditor.setValue('');
- var onFail = function (jqXHR, textStatus, errorThrown) {
+ var onFail = function(jqXHR, textStatus, errorThrown) {
loading = false;
alert("AJAX call failed: " + textStatus + ", " + errorThrown);
};
- $.get(dir + 'data.js', function (data) {
+ $.get(dir + 'data.js', function(data) {
cachedFile[dir].data = data;
dataEditor.setValue(data, -1);
- $.get(dir + 'code.js', function (code) {
+ $.get(dir + 'code.js', function(code) {
cachedFile[dir].code = code;
codeEditor.setValue(code, -1);
loading = false;
@@ -92,14 +96,14 @@ var loadFile = function (category, algorithm, file, explanation) {
}).fail(onFail);
}
};
-var checkLoading = function () {
+var checkLoading = function() {
if (loading) {
showErrorToast('Wait until it completes loading of previous file.');
return true;
}
return false;
};
-var showDescription = function (data) {
+var showDescription = function(data) {
var $container = $('#tab_desc > .wrapper');
$container.empty();
for (var key in data) {
@@ -110,7 +114,7 @@ var showDescription = function (data) {
} else if (Array.isArray(value)) {
var $ul = $('
');
$container.append($ul);
- value.forEach(function (li) {
+ value.forEach(function(li) {
$ul.append($('- ').html(li));
});
} else if (typeof value === "object") {
@@ -122,7 +126,7 @@ var showDescription = function (data) {
}
}
};
-var showAlgorithm = function (category, algorithm) {
+var showAlgorithm = function(category, algorithm) {
var $menu;
var category_name;
var algorithm_name;
@@ -148,12 +152,12 @@ var showAlgorithm = function (category, algorithm) {
dataEditor.setValue('');
codeEditor.setValue('');
};
-var showFiles = function (category, algorithm, files) {
+var showFiles = function(category, algorithm, files) {
$('.files_bar').empty();
var init = false;
for (var file in files) {
- (function (file, explanation) {
- var $file = $('