First move towards rewrite

This commit is contained in:
Matt Godbolt 2016-08-18 22:08:44 -05:00
parent ef7f5d74d7
commit 3600d7ac7e
71 changed files with 740 additions and 10914 deletions

1
.bowerrc Normal file
View File

@ -0,0 +1 @@
{ "directory": "static/ext" }

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
*.swp
/node_modules
.npm-updated
/.npm-updated
/.bower-updated
*.heapsnapshot

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="file://$PROJECT_DIR$" libraries="{gcc-explorer/node_modules}" />
<includedPredefinedLibrary name="Node.js Core" />
</component>
</project>

View File

@ -1,3 +1,8 @@
ifneq "" "$(NODE_DIR)"
NPM:=$(NODE_DIR)/bin/npm
NODE:=$(NODE_DIR)/bin/npm
default: run
else
ifeq "" "$(shell which npm)"
default:
@echo "Please install node.js"
@ -5,12 +10,14 @@ default:
@echo "On Ubuntu/Debian try: sudo apt-get install nodejs npm"
exit 1
else
NPM:= $(shell which npm)
NODE:= $(shell which node || which nodejs)
default: run
endif
endif
.PHONY: clean run test run-amazon c-preload optional-d-support prereqs
prereqs: optional-d-support node_modules c-preload
.PHONY: clean run test run-amazon c-preload optional-d-support prereqs node_modules bower_modules
prereqs: optional-d-support node_modules c-preload bower_modules
ifeq "" "$(shell which gdc)"
optional-d-support:
@ -22,12 +29,18 @@ endif
NODE_MODULES=.npm-updated
$(NODE_MODULES): package.json
npm install
$(NPM) install
@touch $@
BOWER_MODULES=.bower-updated
$(BOWER_MODULES): bower.json $(NODE_MODULES)
$(NODE) ./node_modules/bower/bin/bower install
@touch $@
LANG:=C++
node_modules: $(NODE_MODULES)
bower_modules: $(BOWER_MODULES)
test:
(cd test; $(NODE) test.js)
@ -35,12 +48,13 @@ test:
@echo Tests pass
clean:
rm -rf node_modules .npm-updated
rm -rf bower_modules node_modules .npm-updated .bower-updated
$(MAKE) -C d clean
$(MAKE) -C c-preload clean
run: node_modules optional-d-support c-preload
run: prereqs
$(NODE) ./node_modules/.bin/supervisor -e 'js|node|properties' --exec $(NODE) -- ./app.js --language $(LANG)
c-preload:
$(MAKE) -C c-preload

6
app.js
View File

@ -147,9 +147,9 @@ function clientOptionsHandler(compilers, fileSources) {
supportsBinary: !!compilerProps("supportsBinary"),
sources: sources
};
var text = "var OPTIONS = " + JSON.stringify(options) + ";";
var text = JSON.stringify(options);
return function getClientOptions(req, res) {
res.set('Content-Type', 'application/javascript');
res.set('Content-Type', 'application/json');
res.set('Cache-Control', 'public, max-age=' + staticMaxAgeMs);
res.end(text);
};
@ -421,7 +421,7 @@ findCompilers().then(function (compilers) {
.use(sStatic('static', {maxAge: staticMaxAgeMs}))
.use(bodyParser.json())
.use(restreamer())
.get('/client-options.js', clientOptionsHandler(compilers, fileSources))
.get('/client-options.json', clientOptionsHandler(compilers, fileSources))
.use('/source', getSource)
.use('/api', apiHandler(compilers))
.use('/g', shortUrlHandler)

26
bower.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "gcc-explorer",
"description": "Interactively investigate compiler output",
"main": "./app.js",
"authors": [
"Matt Godbolt"
],
"license": "BSD-2-Clause",
"homepage": "https://github.com/mattgodbolt/gcc-explorer",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"codemirror": "CodeMirror#^5.17.0",
"requirejs": "^2.2.0",
"underscore": "^1.8.3",
"golden-layout": "^1.5.1",
"jquery": "^3.1.0",
"bootstrap": "^3.3.7"
}
}

View File

@ -31,7 +31,8 @@
"temp": "0.8.x"
},
"devDependencies": {
"supervisor": "0.3.1"
"supervisor": "0.3.1",
"bower": "*"
},
"scripts": {
"test": "make test"

View File

Before

Width:  |  Height:  |  Size: 519 B

After

Width:  |  Height:  |  Size: 519 B

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

363
static-old/index.html Normal file
View File

@ -0,0 +1,363 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Compiler Explorer</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="ext/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="ext/codemirror/codemirror.css" rel="stylesheet">
<link href="ext/golden-layout/goldenlayout-base.css" rel="stylesheet">
<link href="ext/golden-layout/goldenlayout-light-theme.css" rel="stylesheet">
<link href="gcc.css" rel="stylesheet">
<script src="client-options.js"></script>
<script src="ext/codemirror/codemirror.js"></script>
<script src="asm-mode.js"></script>
<script src="ext/jquery/jquery-2.2.2.min.js"></script>
<script src="ext/golden-layout/goldenlayout.min.js"></script>
<script src="ext/jquery-ui-1.11.4/jquery-ui.min.js"></script>
<script src="ext/rison.js"></script>
<script src="ext/underscore-min.js"></script>
<script src="ext/clipboard.min.js"></script>
<script src="compiler.js"></script>
<script src="gcc.js"></script>
<script src="ext/bootstrap/js/bootstrap.min.js"></script>
<script src="ext/lz-string/lz-string-1.3.3-min.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', OPTIONS.googleAnalyticsAccount]);
_gaq.push(['_trackPageview']);
setTimeout(function () {
"use strict";
function create_script_element(id, url) {
var el = document.createElement('script');
el.type = 'text/javascript';
el.async = true;
el.id = id;
el.src = url;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(el, s);
}
create_script_element('urlshortener', 'urlshorten-' + OPTIONS.urlshortener + ".js");
if (OPTIONS.googleAnalyticsEnabled)
create_script_element('ga', ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js');
if (OPTIONS.sharingEnabled) {
create_script_element('gp', 'https://apis.google.com/js/plusone.js');
create_script_element('twitter-wjs', '//platform.twitter.com/widgets.js');
(function(document, i) {
var f,s=document.getElementById(i);
f=document.createElement('iframe');
f.src='//api.flattr.com/button/view/?uid=mattgodbolt&button=compact&url='+encodeURIComponent(document.URL);
f.title='Flattr';
f.height=20;
f.width=110;
f.style.borderWidth=0;
s.appendChild(f);
}(document, 'flattr_button'));
}
}, 0);
</script>
</head>
<body>
<div class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Compiler Explorer - <span class="language-name"></span></a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li class="if-github-enabled">
<a href="https://github.com/mattgodbolt/gcc-explorer">Source on GitHub</a>
</li>
<li class="dropdown if-share-enabled">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Donate<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="navbar-text"><a href="https://www.changetip.com/tipme/mattgodbolt">ChangeTip.Me</a></li>
<li class="navbar-text" id="flattr_button"></li>
</ul>
</li>
<li class="dropdown if-share-enabled">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Share<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="social">
<g:plusone annotation="inline" width="150"></g:plusone>
</li>
<li class="social"><a href="https://twitter.com/share" class="twitter-share-button"
data-via="mattgodbolt">Tweet</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">About<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://plus.google.com/112384289668860490877" rel="publisher">Google+ page</a>
</li>
<li><a href="https://plus.google.com/105166465490735292917" rel="author">About Matt</a></li>
<li><a href="mailto:matt@godbolt.org">Contact Matt</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="codeEditor" class="template">
<textarea>// Type your code here, or load an example.</textarea>
</div>
<div id="compiler" class="template">
<div class="panel-body">
<div class="params">
<form class="well well-sm form-inline">
<table>
<tbody>
<tr>
<td class="dropdown compilers-container">
<button type="button" title="Compiler to use" class="btn btn-default dropdown-toggle compiler-selection" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="compiler">g++</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu compilers">
</ul>
</td>
<td>
<input accesskey="" title="Options to pass to compiler" class="compiler-options" placeholder="compiler options" type="text" value="" style="width:90%">
</td>
</tr>
</tbody>
</table>
</form>
</div>
<div class="asm">
<textarea>Awaiting...</textarea>
</div>
<div class="output">
<div class="result">
<div class="topbar">Compiler output &mdash; <span class="compilerVersion"></span></div>
<div class="output">
<div class="template"></div>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid" id="#root"><!--
<ul id="draggablePanelList" class="list-unstyled">
<li class="panel panel-primary col-md-3">
<div class="panel-heading"><span class="title">Code editor</span></div>
<div class="panel-body">
<div id="commonParams">
<form class="well form-inline files">
<div>
<label>Source: <select class="source"></select></label>
<label>Name: <select class="filename"></select></label>
<button id="new-slot" class="btn btn-sm" title="Open a new slot.">New slot</button>
<button id="new-diff" class="btn btn-sm" title="Open a new diff.">New diff</button>
</div>
<div class="btn-group btn-group-sm">
<button class="btn btn-sm load">Load</button>
<button class="btn btn-sm save">Save</button>
<button class="btn btn-sm saveas">Save as...</button>
<button class="btn btn-sm fulllink" title="Permanent, full URL to this page">Full link</button>
<button class="btn btn-sm shortlink" title="Permanent link to this page as a short link">Short link</button>
</div>
<div class="btn-group btn-group-sm filter">
<button class="btn btn-sm" type="button" value="binary"
title="Compile to binary and disassemble the output">Binary
</button>
<button class="btn btn-sm active nonbinary" type="button"
title="Filter unused labels from the output" value="labels">Unused labels
</button>
<button class="btn btn-sm active nonbinary" type="button"
title="Filter all assembler directives from the output" value="directives">Directives
</button>
<button class="btn btn-sm active nonbinary" type="button"
title="Remove all lines which are only comments from the output" value="commentOnly">
Comment-only lines
</button>
<button class="btn btn-sm" type="button" title="Output disassembly in Intel syntax"
value="intel">Intel syntax
</button>
<button class="btn btn-sm" type="button"
title="Colourise lines so one can see how the source maps to the output"
value="colouriseAsm">Colourise
</button>
</div>
<div class="collapse permalink-collapse">
<div class="input-group input-group-sm permalink">
<input type="text" class="form-control input-sm" placeholder="Loading" readonly id="permalink" size="1024">
<span class="input-group-btn">
<button class="btn btn-sm btn-default clippy" type="button" data-clipboard-target="#permalink"
title="Copy to clipboard">
<img src="ext/clippy.svg" class="clippy" width="13px" alt="Copy to clipboard">
</button>
</span>
</div>
</div>
</form>
</div>
<div class="editor">
<div class="topbar indented">
Code editor
<span class="pull-right input-group input-group-sm">
<button accesskey="a" title="Automatically build when you stop typing"
class="btn btn-default btn-sm autocompile active">
<span class="glyphicon glyphicon-play-circle"></span>
</button>
</span>
</div>
<textarea>// Type your code here, or load an example.</textarea>
</div>
<div class="modal fade" id="saveDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4>Save as...</h4>
</div>
<div class="modal-body">
<label>Filename: <input class="save-filename" style="width: 30em;" type="text"></label>
</div>
<div class="modal-footer">
<a href="#" data-dismiss="modal" class="btn btn-default">Cancel</a>
<a href="#" class="btn btn-primary save">Save</a>
</div>
</div>
</div>
</div>
</div>
</li>
<li class="panel panel-primary col-md-3 template slot" id="slotTemplate">
<div class="panel-heading">
<span class="title">Slot template (should *not* be visible)</span>
<span class="closeButton unicodeCross unselectable characterIcon">&#10006;</span>
</div>
<div class="panel-body">
<div class="params">
<form class="well well-sm form-inline">
<table>
<tbody>
<tr>
<td>
<p class="leaderSlotIcon unselectable characterIcon unselectedCharacterIcon">&#9734;</p>
<td class="dropdown compilers-container">
&lt;!&ndash; the accesskey is set in static/compiler.js &ndash;&gt;
<button accesskey="" type="button" title="Compiler to use (alt-C)" class="btn btn-default dropdown-toggle compiler-selection" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="compiler">g++</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu compilers">
</ul>
</td>
<td>
&lt;!&ndash; the accesskey is set in static/compiler.js &ndash;&gt;
<input accesskey="" title="Options to pass to compiler (alt-O)" class="compiler-options" placeholder="compiler options" type="text" value="" style="width:90%">
</td>
</tr>
</tbody>
</table>
<div class="btn-group btn-group-sm filter">
&lt;!&ndash; Place slot-specific buttons here. &ndash;&gt;
</div>
</form>
</div>
<div class="asm">
<div class="topbar indented">Assembly output</div>
<textarea>Awaiting...</textarea>
</div>
<div class="output">
<div class="result">
<div class="topbar">Compiler output &mdash; <span class="compilerVersion"></span></div>
<div class="output">
<div class="template"></div>
</div>
</div>
</div>
</div>
<li class="panel panel-primary col-md-3 template diff" id="diffTemplate">
<div class="panel-heading"><span class="title">Diff template (should *not* be visible)</span><span class="closeButton unicodeCross unselectable characterIcon">&#10006;</span></div>
<div class="panel-body">
<div class="params">
<form class="well well-sm form-inline">
<table>
<tbody>
<tr>
<td class="dropdown compilers-container before">
<button type="button"
title="Slot before" class="btn btn-default dropdown-toggle diff-before-button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="slotName">before</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu slotNameList">
</ul>
</td>
<td> <span class="compilers-container unicode-arrow unselectable" >&#8658;</span> </td>
<td class="dropdown compilers-container after">
<button type="button"
title="Slot after" class="btn btn-default dropdown-toggle diff-after-button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="slotName">after</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu slotNameList">
</ul>
</td>
<td> <span class="compilers-container unicode-arrow reverse-diff unselectable characterIcon">&#8646;</span> </td>
</tr>
</tbody>
</table>
</form>
</div>
<div class="diffText">
<div class="topbar indented">Diff output</div>
<textarea>Awaiting...</textarea>
</div>
</div>
</li>
</ul>
--></div>
<div class="template lang c">// Type your code here, or load an example.
int square(int num) {
return num * num;
}
</div>
<div class="template lang rust">// Type your code here, or load an example.
pub fn square(num: i32) -&gt; i32 {
num * num
}
</div>
<div class="template lang go">// Type your code here, or load an example.
// Your function name should start with a capital letter.
package main
func Square(x int) int {
return x * x
}
func main() {}
</div>
<div class="template lang d">// Type your code here, or load an example.
int square(int num) {
return num * num;
}
</div>
<script type="text/javascript">
$(function () {
if (!OPTIONS.sharingEnabled)
$('.if-share-enabled').remove();
if (!OPTIONS.githubEnabled)
$('.if-github-enabled').remove();
});
</script>
</body>
</html>

1
static/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
ext

38
static/analytics.js Normal file
View File

@ -0,0 +1,38 @@
define(function (require, exports) {
"use strict";
var options = require('options');
exports.initialise = function () {
var _gaq = _gaq || [];
_gaq.push(['_setAccount', options.googleAnalyticsAccount]);
_gaq.push(['_trackPageview']);
setTimeout(function () {
function create_script_element(id, url) {
var el = document.createElement('script');
el.type = 'text/javascript';
el.async = true;
el.id = id;
el.src = url;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(el, s);
}
if (options.googleAnalyticsEnabled)
create_script_element('ga', ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js');
if (options.sharingEnabled) {
create_script_element('gp', 'https://apis.google.com/js/plusone.js');
create_script_element('twitter-wjs', '//platform.twitter.com/widgets.js');
(function (document, i) {
var f, s = document.getElementById(i);
f = document.createElement('iframe');
f.src = '//api.flattr.com/button/view/?uid=mattgodbolt&button=compact&url=' + encodeURIComponent(document.URL);
f.title = 'Flattr';
f.height = 20;
f.width = 110;
f.style.borderWidth = 0;
s.appendChild(f);
}(document, 'flattr_button'));
}
}, 0);
};
});

View File

@ -22,69 +22,73 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
CodeMirror.defineMode("asm", function () {
function tokenString(quote) {
return function (stream) {
var escaped = false, next, end = false;
while ((next = stream.next()) !== null) {
if (next == quote && !escaped) {
end = true;
break;
define(function (require) {
"use strict";
var CodeMirror = require('codemirror');
CodeMirror.defineMode("asm", function () {
function tokenString(quote) {
return function (stream) {
var escaped = false, next, end = false;
while ((next = stream.next()) !== null) {
if (next == quote && !escaped) {
end = true;
break;
}
escaped = !escaped && next == "\\";
}
escaped = !escaped && next == "\\";
}
return "string";
};
}
return "string";
};
}
var x86_32regName = /\b[re]?(ax|bx|cx|dx|si|di|bp|ip|sp)\b/;
var x86_64regName = /r[\d]+[d]?/;
var x86_xregName = /[xy]mm\d+/;
var x86_keywords = /PTR|BYTE|[DQ]?WORD|XMMWORD|YMMWORD/;
var labelName = /\.L\w+/;
var x86_32regName = /\b[re]?(ax|bx|cx|dx|si|di|bp|ip|sp)\b/;
var x86_64regName = /r[\d]+[d]?/;
var x86_xregName = /[xy]mm\d+/;
var x86_keywords = /PTR|BYTE|[DQ]?WORD|XMMWORD|YMMWORD/;
var labelName = /\.L\w+/;
return {
token: function (stream) {
if (stream.match(/\/\*([^*]|[*][^\/])*\**\//)) {
return "comment";
}
if (stream.match(/^.+:$/)) {
return "variable-2";
}
if (stream.sol() && stream.match(/^\s*\.\w+/)) {
return "header";
}
if (stream.sol() && stream.match(/^\s+\w+/)) {
return "keyword";
}
if (stream.eatSpace()) return null;
if (stream.match(x86_32regName)
return {
token: function (stream) {
if (stream.match(/\/\*([^*]|[*][^\/])*\**\//)) {
return "comment";
}
if (stream.match(/^.+:$/)) {
return "variable-2";
}
if (stream.sol() && stream.match(/^\s*\.\w+/)) {
return "header";
}
if (stream.sol() && stream.match(/^\s+\w+/)) {
return "keyword";
}
if (stream.eatSpace()) return null;
if (stream.match(x86_32regName)
|| stream.match(x86_64regName)
|| stream.match(x86_xregName)) {
return "variable-3";
return "variable-3";
}
if (stream.match(x86_keywords)) return "keyword";
if (stream.match(labelName)) return "variable-2";
var ch = stream.next();
if (ch == '"' || ch == "'") {
return tokenString(ch)(stream);
}
if (/[\[\]{}\(\),;\:]/.test(ch)) return null;
if (/[\d$]/.test(ch) || (ch == '-' && stream.peek().match(/[0-9]/))) {
stream.eatWhile(/[\w\.]/);
return "number";
}
if (ch == '%') {
stream.eatWhile(/\w+/);
return "variable-3";
}
if (ch == '#') {
stream.eatWhile(/.*/);
return "comment";
}
return "word";
}
if (stream.match(x86_keywords)) return "keyword";
if (stream.match(labelName)) return "variable-2";
var ch = stream.next();
if (ch == '"' || ch == "'") {
return tokenString(ch)(stream);
}
if (/[\[\]{}\(\),;\:]/.test(ch)) return null;
if (/[\d$]/.test(ch) || (ch == '-' && stream.peek().match(/[0-9]/))) {
stream.eatWhile(/[\w\.]/);
return "number";
}
if (ch == '%') {
stream.eatWhile(/\w+/);
return "variable-3";
}
if (ch == '#') {
stream.eatWhile(/.*/);
return "comment";
}
return "word";
}
};
});
};
});
CodeMirror.defineMIME("text/x-asm", "asm");
CodeMirror.defineMIME("text/x-asm", "asm");
});

57
static/editor.js Normal file
View File

@ -0,0 +1,57 @@
define(function (require) {
"use strict";
var CodeMirror = require('codemirror');
require('codemirror/mode/clike/clike');
require('codemirror/mode/d/d');
require('codemirror/mode/go/go');
require('codemirror/mode/rust/rust');
require('asm-mode');
return function Editor(container, lang) {
var domRoot = container.getElement();
var cmMode;
switch (lang.toLowerCase()) {
default:
cmMode = "text/x-c++src";
break;
case "c":
cmMode = "text/x-c";
break;
case "rust":
cmMode = "text/x-rustsrc";
break;
case "d":
cmMode = "text/x-d";
break;
case "go":
cmMode = "text/x-go";
break;
}
var cppEditor = CodeMirror.fromTextArea(domRoot.find("textarea")[0], {
lineNumbers: true,
matchBrackets: true,
useCPP: true,
mode: cmMode
});
// With reference to "fix typing '#' in emacs mode"
// https://github.com/mattgodbolt/gcc-explorer/pull/131
cppEditor.setOption("extraKeys", {
"Alt-F": false
});
// cppEditor.on("change", function () {
// if ($('.autocompile').hasClass('active')) {
// onEditorChange();
// }
// });
function resize() {
cppEditor.setSize(domRoot.width(), domRoot.height());
cppEditor.refresh();
}
container.on('resize', resize);
container.on('open', resize);
container.setTitle(lang + " source");
};
});

3
static/explorer.css Normal file
View File

@ -0,0 +1,3 @@
.template {
display: none;
}

View File

@ -1,587 +0,0 @@
/*!
* Bootstrap v3.3.6 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
.btn-default,
.btn-primary,
.btn-success,
.btn-info,
.btn-warning,
.btn-danger {
text-shadow: 0 -1px 0 rgba(0, 0, 0, .2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
}
.btn-default:active,
.btn-primary:active,
.btn-success:active,
.btn-info:active,
.btn-warning:active,
.btn-danger:active,
.btn-default.active,
.btn-primary.active,
.btn-success.active,
.btn-info.active,
.btn-warning.active,
.btn-danger.active {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
}
.btn-default.disabled,
.btn-primary.disabled,
.btn-success.disabled,
.btn-info.disabled,
.btn-warning.disabled,
.btn-danger.disabled,
.btn-default[disabled],
.btn-primary[disabled],
.btn-success[disabled],
.btn-info[disabled],
.btn-warning[disabled],
.btn-danger[disabled],
fieldset[disabled] .btn-default,
fieldset[disabled] .btn-primary,
fieldset[disabled] .btn-success,
fieldset[disabled] .btn-info,
fieldset[disabled] .btn-warning,
fieldset[disabled] .btn-danger {
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-default .badge,
.btn-primary .badge,
.btn-success .badge,
.btn-info .badge,
.btn-warning .badge,
.btn-danger .badge {
text-shadow: none;
}
.btn:active,
.btn.active {
background-image: none;
}
.btn-default {
text-shadow: 0 1px 0 #fff;
background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%);
background-image: -o-linear-gradient(top, #fff 0%, #e0e0e0 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0));
background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #dbdbdb;
border-color: #ccc;
}
.btn-default:hover,
.btn-default:focus {
background-color: #e0e0e0;
background-position: 0 -15px;
}
.btn-default:active,
.btn-default.active {
background-color: #e0e0e0;
border-color: #dbdbdb;
}
.btn-default.disabled,
.btn-default[disabled],
fieldset[disabled] .btn-default,
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled.focus,
.btn-default[disabled].focus,
fieldset[disabled] .btn-default.focus,
.btn-default.disabled:active,
.btn-default[disabled]:active,
fieldset[disabled] .btn-default:active,
.btn-default.disabled.active,
.btn-default[disabled].active,
fieldset[disabled] .btn-default.active {
background-color: #e0e0e0;
background-image: none;
}
.btn-primary {
background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);
background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88));
background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #245580;
}
.btn-primary:hover,
.btn-primary:focus {
background-color: #265a88;
background-position: 0 -15px;
}
.btn-primary:active,
.btn-primary.active {
background-color: #265a88;
border-color: #245580;
}
.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled.focus,
.btn-primary[disabled].focus,
fieldset[disabled] .btn-primary.focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
background-color: #265a88;
background-image: none;
}
.btn-success {
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641));
background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #3e8f3e;
}
.btn-success:hover,
.btn-success:focus {
background-color: #419641;
background-position: 0 -15px;
}
.btn-success:active,
.btn-success.active {
background-color: #419641;
border-color: #3e8f3e;
}
.btn-success.disabled,
.btn-success[disabled],
fieldset[disabled] .btn-success,
.btn-success.disabled:hover,
.btn-success[disabled]:hover,
fieldset[disabled] .btn-success:hover,
.btn-success.disabled:focus,
.btn-success[disabled]:focus,
fieldset[disabled] .btn-success:focus,
.btn-success.disabled.focus,
.btn-success[disabled].focus,
fieldset[disabled] .btn-success.focus,
.btn-success.disabled:active,
.btn-success[disabled]:active,
fieldset[disabled] .btn-success:active,
.btn-success.disabled.active,
.btn-success[disabled].active,
fieldset[disabled] .btn-success.active {
background-color: #419641;
background-image: none;
}
.btn-info {
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2));
background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #28a4c9;
}
.btn-info:hover,
.btn-info:focus {
background-color: #2aabd2;
background-position: 0 -15px;
}
.btn-info:active,
.btn-info.active {
background-color: #2aabd2;
border-color: #28a4c9;
}
.btn-info.disabled,
.btn-info[disabled],
fieldset[disabled] .btn-info,
.btn-info.disabled:hover,
.btn-info[disabled]:hover,
fieldset[disabled] .btn-info:hover,
.btn-info.disabled:focus,
.btn-info[disabled]:focus,
fieldset[disabled] .btn-info:focus,
.btn-info.disabled.focus,
.btn-info[disabled].focus,
fieldset[disabled] .btn-info.focus,
.btn-info.disabled:active,
.btn-info[disabled]:active,
fieldset[disabled] .btn-info:active,
.btn-info.disabled.active,
.btn-info[disabled].active,
fieldset[disabled] .btn-info.active {
background-color: #2aabd2;
background-image: none;
}
.btn-warning {
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316));
background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #e38d13;
}
.btn-warning:hover,
.btn-warning:focus {
background-color: #eb9316;
background-position: 0 -15px;
}
.btn-warning:active,
.btn-warning.active {
background-color: #eb9316;
border-color: #e38d13;
}
.btn-warning.disabled,
.btn-warning[disabled],
fieldset[disabled] .btn-warning,
.btn-warning.disabled:hover,
.btn-warning[disabled]:hover,
fieldset[disabled] .btn-warning:hover,
.btn-warning.disabled:focus,
.btn-warning[disabled]:focus,
fieldset[disabled] .btn-warning:focus,
.btn-warning.disabled.focus,
.btn-warning[disabled].focus,
fieldset[disabled] .btn-warning.focus,
.btn-warning.disabled:active,
.btn-warning[disabled]:active,
fieldset[disabled] .btn-warning:active,
.btn-warning.disabled.active,
.btn-warning[disabled].active,
fieldset[disabled] .btn-warning.active {
background-color: #eb9316;
background-image: none;
}
.btn-danger {
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a));
background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #b92c28;
}
.btn-danger:hover,
.btn-danger:focus {
background-color: #c12e2a;
background-position: 0 -15px;
}
.btn-danger:active,
.btn-danger.active {
background-color: #c12e2a;
border-color: #b92c28;
}
.btn-danger.disabled,
.btn-danger[disabled],
fieldset[disabled] .btn-danger,
.btn-danger.disabled:hover,
.btn-danger[disabled]:hover,
fieldset[disabled] .btn-danger:hover,
.btn-danger.disabled:focus,
.btn-danger[disabled]:focus,
fieldset[disabled] .btn-danger:focus,
.btn-danger.disabled.focus,
.btn-danger[disabled].focus,
fieldset[disabled] .btn-danger.focus,
.btn-danger.disabled:active,
.btn-danger[disabled]:active,
fieldset[disabled] .btn-danger:active,
.btn-danger.disabled.active,
.btn-danger[disabled].active,
fieldset[disabled] .btn-danger.active {
background-color: #c12e2a;
background-image: none;
}
.thumbnail,
.img-thumbnail {
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
background-color: #e8e8e8;
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
background-repeat: repeat-x;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
background-color: #2e6da4;
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
background-repeat: repeat-x;
}
.navbar-default {
background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%);
background-image: -o-linear-gradient(top, #fff 0%, #f8f8f8 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8));
background-image: linear-gradient(to bottom, #fff 0%, #f8f8f8 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .active > a {
background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2));
background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);
background-repeat: repeat-x;
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);