diff --git a/compile_server/app/templates/code_page.html b/compile_server/app/templates/code_page.html
index 87ea27d..4e5b20b 100644
--- a/compile_server/app/templates/code_page.html
+++ b/compile_server/app/templates/code_page.html
@@ -31,6 +31,8 @@
.done(function( json ) {
// On success, create editors for each of the resources
+ // First create the tabs
+
var ul = $( '
' )
ul.appendTo($("#editor_area"));
@@ -48,14 +50,17 @@
+ resource.basename + '').appendTo(li)
})
+ // Then fill the contents of the tabs
+
var content = $( '
' )
content.appendTo($("#editor_area"));
counter = 0;
+ var editors = []
+
json.resources.forEach(function(resource){
counter++;
- // a title
var div = $('
');
@@ -63,10 +68,6 @@
editordiv.appendTo(div)
div.appendTo(content);
- $('#' + "tab_" + counter + "-tab" + ' a').click(function (e) {
- e.preventDefault()
- $(this).tab('show')
- })
// ACE editors...
var editor = ace.edit(resource.basename + '_editor');
@@ -74,8 +75,19 @@
// ... and their contents
editor.insert(resource.contents);
+ editor.filename = resource.basename
// TODO: place the cursor at 1,1
+
+ // Append the editor to the list of editors
+ editors.push(editor)
+ })
+
+ button = $('