gergelypolonkai-web-jekyll/_layouts/default.html
Gergely Polonkai e9996808be Remove Google stuff
Plus button and Analytics.
2018-09-21 13:56:14 +02:00

116 lines
4.0 KiB
HTML

<!DOCTYPE html>
<html>
<head>
{% include head.html %}
</head>
<body>
{% include header.html %}
<div class="container" id="main-container">
{{content}}
{% if page.name != 'about.html' %}
<div class="well well-sm small">
<div class="pull-left" id="about-well-image">
<a href="{{ site_url }}/about/">
<img src="{{'/images/profile.svg' | prepend: site.baseurl}}" alt="">
</a>
</div>
{% include about.html %}
<div class="clearfix"></div>
</div>
{% endif %}
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#tagcloud-button').click(function() {
$('#tag-cloud').toggle('slow');
});
});
jQuery.extend_if_has = function(desc, source, array) {
for (var i=array.length;i--;) {
if (typeof source[array[i]] != 'undefined') {
desc[array[i]] = source[array[i]];
}
}
return desc;
};
(function($) {
$.fn.tilda = function(eval, options) {
if ($('body').data('tilda')) {
return $('body').data('tilda').terminal;
}
this.addClass('tilda');
options = options || {};
eval = eval || function(command, term) {
term.echo("you don't set eval for tilda");
};
var settings = {
prompt: 'guest@gergely.polonkai.eu> ',
name: 'tilda',
height: 400,
enabled: false,
greetings: 'Welcome to my Terminal. Type `help\' to list the available commands.\n\nPowered by http://terminal.jcubic.pl',
keypress: function(e) {
if (e.which == 96) {
return false;
}
}
};
if (options) {
$.extend(settings, options);
}
this.append('<div class="td"></div>');
var self = this;
self.terminal = this.find('.td').terminal(eval, settings);
var focus = false;
$(document.documentElement).keypress(function(e) {
console.log(e);
if (e.which == 96) {
self.slideToggle('fast');
self.terminal.focus(focus = !focus);
self.terminal.attr({
scrollTop: self.terminal.attr("scrollHeight")
});
}
});
$('body').data('tilda', this);
this.hide();
return self;
};
})(jQuery);
String.prototype.strip = function(char) {
return this.replace(new RegExp("^\\s*"), '')
.replace(new RegExp("\\s*$"), '');
}
jQuery(document).ready(function($) {
$('#tilda').tilda(function(command, terminal) {
command = command.strip();
switch (command) {
case 'help':
terminal.echo('about - Go to the about page');
terminal.echo(' ');
terminal.echo('More commands will follow soon!');
break;
case 'about':
location = '{{ site_url }}/about/';
break;
default:
terminal.echo(command + ': command not found');
break;
}
});
});
</script>
<div id="tilda"></div>
</body>
</html>