🚨🍛 Updated with Glitch

pull/57/head
System 7 years ago committed by Jed Fox
parent 8b758bac5a
commit 90acaaface

@ -19,6 +19,7 @@ document.addEventListener('click', function (e) {
document.querySelector('main').outerHTML = json.html; document.querySelector('main').outerHTML = json.html;
// and change the file name in the header. // and change the file name in the header.
document.querySelector('.js-file-name').textContent = json.context.fileName; document.querySelector('.js-file-name').textContent = json.context.fileName;
document.querySelector('.js-file-name-link').href = 'https://github.com/j-f1/forked-super-tiny-compiler/tree/glitch/' + json.context.fileName;
// Finally, update the title bar and address bar, // Finally, update the title bar and address bar,
history.pushState(null, json.title, target.href); history.pushState(null, json.title, target.href);

@ -6,6 +6,9 @@ var path = require('path');
var ejs = require('ejs'); var ejs = require('ejs');
var fs = require('fs'); var fs = require('fs');
process.env.NWO = process.env.NWO || 'thejameskyle/the-super-tiny-compiler';
process.env.BRANCH = process.env.BRANCH || 'master';
// First, let's create the server, // First, let's create the server,
var app = express(); var app = express();
// add a `req.body` property to requests containing // add a `req.body` property to requests containing

@ -93,8 +93,10 @@
left: 300px; left: 300px;
right: 0; right: 0;
overflow: auto; overflow: auto;
}
main.is-code {
/* The topbar, the padding, and the last line */ /* The topbar, the padding, and the last line */
padding-bottom: calc(100vh - 2em - 1em - 2em); padding-bottom: calc(100vh - 2em - 1em - 0.7em);
} }
main pre#code { main pre#code {
padding-bottom: 0; padding-bottom: 0;
@ -289,19 +291,15 @@
<body> <body>
<div id="app"> <div id="app">
<header> <header>
<a href="https://github.com/thejameskyle/the-super-tiny-compiler"> <a href="https://github.com/<%= process.env.NWO %>/tree/<%= process.env.BRANCH %>/<%= fileName %>" class="js-file-name-link">
/Users/thejameskyle/code/the-super-tiny-compiler/<span class="js-file-name"><%= fileName %></span> /Users/you/code/the-super-tiny-compiler/<span class="js-file-name"><%= fileName %></span>
</a> </a>
<a class="right" href="https://github.com/thejameskyle/the-super-tiny-compiler"> <a class="right" href="https://github.com/<%= process.env.NWO %>">
Star this in GitHub Star this in GitHub
</a> </a>
<a class="right" href="https://twitter.com/thejameskyle"> <a class="right" href="https://glitch.com/edit/#!/<%= process.env.PROJECT_NAME %>">
Follow me on Twitter
</a>
<a class="right" href="https://glitch.com/edit/#!/the-super-tiny-compiler">
Remix this in Glitch Remix this in Glitch
</a> </a>
</header> </header>

Loading…
Cancel
Save