added relative_url_root to some more javascript calls (ace file path, file template path).

This commit is contained in:
Ralf Teusner
2016-10-06 16:32:20 +02:00
parent 58dac37d77
commit 59119e43d5
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
var CodeOceanEditor = {
//ACE-Editor-Path
ACE_FILES_PATH: '/assets/ace/',
// ruby part adds the relative_url_root, if it is set.
ACE_FILES_PATH: '<%= (defined? config.relative_url_root) && config.relative_url_root != nil && config.relative_url_root != "" ? config.relative_url_root : "" %>' + '/assets/ace/',
THEME: 'ace/theme/textmate',
//Color-Encoding for Percentages in Progress Bars (For submissions)

View File

@ -152,8 +152,9 @@ $(function() {
};
var updateFileTemplates = function(fileType) {
var rel_url_root = '<%= (defined? config.relative_url_root) && config.relative_url_root != nil && config.relative_url_root != "" ? config.relative_url_root : "" %>';
var jqxhr = $.ajax({
url: '/file_templates/by_file_type/' + fileType + '.json',
url: rel_url_root + '/file_templates/by_file_type/' + fileType + '.json',
dataType: 'json'
});
jqxhr.done(function(response) {