1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut-pastebin synced 2025-06-09 07:06:25 -04:00
perlbuut-pastebin/templates/viewer.html
2017-03-28 00:59:11 -04:00

85 lines
2.1 KiB
HTML
Executable file

[% BLOCK body_style %]
<style type="text/css" media="screen">
#editor {
margin: auto;
position: relative !important;
width: 100%;
}
html, body, #content {
width: 100%;
}
@font-face {
font-family: "FiraCode";
src: url("/static/fonts/FiraCode-Regular.woff2") format('woff2');
}
</style>
[% END %]
[% BLOCK page_header %]
<div class="row">
<div class="col-md-3">
<b>Who: </b>[% who | html %]
</div>
<div class="col-md-3">
<b>When: </b>[% when %]
</div>
<div class="col-md-6">
<b>What: </b>[% what | html %]
</div>
</div>
[% END %]
[% BLOCK body %]
<form action="/edit/[% paste_id %]" method="GET" id="form">
<div id="content" class="container">
<div class="panel">
<div class="panel-heading">
[% PROCESS page_header %]
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<pre id="editor">[% paste | html %]</pre>
</div>
</div>
<div class="row">
<div id="eval" class="col-md-12">
<h3>Program Output:</h3>
<pre>[% eval | html %]</pre>
</div>
</div>
<div class="panel-footer">
<input value="Fork and Edit" type="submit" id="submit" />
</div>
</div>
</div>
</form>
<script src="/static/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
//editor.setTheme("ace/theme/twilight");
editor.session.setMode("ace/mode/perl");
editor.setReadOnly(true);
editor.setOptions({maxLines: Infinity, fontFamily: ['FiraCode']});
/*function resizeAce() {
var h = window.innerHeight;
var ch = h - 400;
var m = ch > 360 ? ch : 360;
// $('#editor').css('height', m.toString() + 'px');
};
$(window).on('resize', function () {
resizeAce();
});
resizeAce();*/
$("#submit").on('click', function () {
$("#paste").text(editor.getValue()); // copy to the textarea
});
</script>
[% END %]