Default the source to the builtins

dev/git-series/gccdum
Matt Godbolt 8 years ago
parent 4b19ef7162
commit b929014e75

@ -334,7 +334,8 @@ function getClientOptions(req, res) {
sharing_enabled: props.get('gcc-explorer', 'clientSharingEnabled', true),
github_ribbon_enabled: props.get('gcc-explorer', 'clientGitHubRibbonEnabled', true),
urlshortener: props.get('gcc-explorer', 'clientURLShortener', 'google'),
defaultCompiler: props.get('gcc-explorer', 'defaultCompiler', '')
defaultCompiler: props.get('gcc-explorer', 'defaultCompiler', ''),
defaultSource: props.get('gcc-explorer', 'defaultSource', '')
};
res.end("var OPTIONS = " + JSON.stringify(options) + ";");
}

@ -2,6 +2,7 @@
port=10240
compileTimeoutMs=1000
compilers=/usr/bin/g++-4.4:/usr/bin/g++-4.5:/usr/bin/g++-4.6:/usr/bin/g++-4.7:/usr/bin/clang++:/usr/bin/g++
defaultSource=builtin
compileFilename=example.cpp
postProcess=c++filt
cacheMb=200

@ -233,9 +233,10 @@ function initialise() {
});
$.getJSON("/sources", function (results) {
$('.source option').remove();
var source = window.localStorage.source || OPTIONS.defaultSource;
$.each(results, function (index, arg) {
$('.files .source').append($('<option value="' + arg.urlpart + '">' + arg.name + '</option>'));
if (window.localStorage.source == arg.urlpart) {
if (source == arg.urlpart) {
$('.files .source').val(arg.urlpart);
}
});

Loading…
Cancel
Save