Improved.
This commit is contained in:
@@ -1,4 +1,15 @@
|
||||
function get_window_size() {
|
||||
/*
|
||||
To the extent possible under law, Niels Serup has waived all copyright and
|
||||
related or neighboring rights to this file. This file is available under the
|
||||
Creative Commons Zero 1.0 license, see
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
|
||||
This JavaScript file contains trivial code. It is required for aesthetic
|
||||
reasons only. Not loading it will not make a website depending on it less
|
||||
functional.
|
||||
*/
|
||||
|
||||
get_window_size = function() {
|
||||
if (window.innerHeight)
|
||||
return [window.innerHeight, window.innerWidth];
|
||||
else if (self.innerHeight)
|
||||
@@ -8,17 +19,17 @@ function get_window_size() {
|
||||
document.documentElement.clientWidth];
|
||||
else if (document.body)
|
||||
return [document.body.clientHeight, document.body.clientWidth];
|
||||
}
|
||||
};
|
||||
|
||||
function is_screen_media() {
|
||||
is_screen_media = function() {
|
||||
return (document.getElementsByTagName('link')[0].getAttribute('media').indexOf(
|
||||
'screen') != -1 || (document.styleSheets &&
|
||||
(document.styleSheets[0].media.mediaText.indexOf(
|
||||
'screen') != -1 || document.styleSheets[0].media.indexOf(
|
||||
'screen') != -1)));
|
||||
}
|
||||
};
|
||||
|
||||
function set_min_height() {
|
||||
set_min_height = function() {
|
||||
if (!is_screen_media())
|
||||
return;
|
||||
var ws, wh, ww, h
|
||||
@@ -34,7 +45,7 @@ function set_min_height() {
|
||||
|
||||
h = wh - h - menudiv.offsetHeight - 145
|
||||
bodydiv.style.minHeight = h + 'px'
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('load', function(event){
|
||||
menudiv = document.getElementById('menu');
|
||||
42
prestatic/extra.js
Normal file
42
prestatic/extra.js
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
To the extent possible under law, Niels Serup has waived all copyright and
|
||||
related or neighboring rights to this file. This file is available under the
|
||||
Creative Commons Zero 1.0 license, see
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
|
||||
This JavaScript file contains misc. code snippets designed to add extra
|
||||
features to a website. Not loading it will not make a website depending on it
|
||||
stop working.
|
||||
*/
|
||||
|
||||
add_external_document_writing_script = function(url, elem) {
|
||||
document.orig_write = document.write
|
||||
var content = ''
|
||||
document.write = function(msg) {
|
||||
content += msg + '\n';
|
||||
}
|
||||
|
||||
var done = function() {
|
||||
document.write = document.orig_write;
|
||||
elem.innerHTML = content;
|
||||
}
|
||||
|
||||
ns = document.createElement('script');
|
||||
ns.type = 'text/javascript';
|
||||
ns.src = url;
|
||||
ns.onload = function() {
|
||||
done();
|
||||
}
|
||||
ns.onreadystatechange= function() {
|
||||
if (this.readyState == 'complete')
|
||||
done();
|
||||
}
|
||||
document.body.appendChild(ns);
|
||||
};
|
||||
|
||||
add_fsf_widget = function(associate_id) {
|
||||
fsf_widget_size = 'normal';
|
||||
fsf_associate_id = associate_id + '';
|
||||
add_external_script('http://www.fsf.org/graphics/widget/global/widget.js',
|
||||
document.getElementById('fsfextern'));
|
||||
};
|
||||
@@ -1,15 +1,13 @@
|
||||
/*@preval
|
||||
/*@prexec
|
||||
page_bg = '#e8efef'
|
||||
*/
|
||||
@*/
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
/*@preval
|
||||
print(' background-color: ' + page_bg + ';')
|
||||
*/
|
||||
/*@preval 'background-color: ' + page_bg + ';\n'@*/
|
||||
font-family: 'Dejavu Sans', 'Nimbus Sans', Helvetica, Arial, Verdana, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #000;
|
||||
@@ -32,9 +30,7 @@ print(' background-color: ' + page_bg + ';')
|
||||
}
|
||||
|
||||
#menulinks {
|
||||
/*@preval
|
||||
print(' background-color: ' + page_bg + ';')
|
||||
*/
|
||||
/*@preval 'background-color: ' + page_bg + ';\n'@*/
|
||||
display: inline-block;
|
||||
padding: 2px 0 2px 16px;
|
||||
font-size: 18px;
|
||||
@@ -100,10 +96,8 @@ print(' background-color: ' + page_bg + ';')
|
||||
padding-top: 14px;
|
||||
width: 750px;
|
||||
height: 91px;
|
||||
/*@preval
|
||||
print(' background: ' + page_bg +
|
||||
" url('/static/metanohi-logo.png') no-repeat center;")
|
||||
*/
|
||||
/*@preval 'background: ' + page_bg + \
|
||||
" url('/static/metanohi-logo.png') no-repeat center;\n"@*/
|
||||
}
|
||||
|
||||
a {
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
xsi:schemaLocation='http://www.w3.org/1999/xhtml
|
||||
http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd'>
|
||||
<head>
|
||||
<title>metanohi: <!--@eval
|
||||
print(page.title, end='')--></title>
|
||||
<title>metanohi: <!--@eval page.title@--></title>
|
||||
<meta name='author' content='Niels Serup' />
|
||||
<meta name='description'
|
||||
content='This is the personal website of Niels Serup. It hosts
|
||||
@@ -35,15 +34,15 @@ print(page.title, end='')--></title>
|
||||
<meta name='DCTERMS.modified' content='{modified}' />
|
||||
<meta name='DCTERMS.language' content='en' />
|
||||
<meta name='DCTERMS.isPartOf' content='http://metanohi.org/' />
|
||||
<meta name='DCTERMS.isVersionOf' content='<!--@eval print(page.core_url, end='')-->' />
|
||||
<meta name='DCTERMS.isVersionOf' content='<!--@eval page.core_url@-->' />
|
||||
<meta name='DCTERMS.audience' content='software developers' />
|
||||
<meta name='DCTERMS.audience' content='hackers' />
|
||||
<meta name='DCTERMS.audience' content='individuals' />
|
||||
<!--@eval
|
||||
<!--@exec
|
||||
if page.licenses:
|
||||
for x in page.licenses:
|
||||
print("""<link rel='copyright' href='{x.url}' />
|
||||
<meta name='DCTERMS.license' content='{x.url}' />""").format(x=x)-->
|
||||
<meta name='DCTERMS.license' content='{x.url}' />""").format(x=x)@-->
|
||||
<meta name='robots' content='ALL' />
|
||||
<link rel='icon' type='image/png' href='/favicon.png' />
|
||||
<!--
|
||||
@@ -51,21 +50,21 @@ if page.licenses:
|
||||
it for aesthetic reasons only. Not loading it will not make this website
|
||||
less functional.
|
||||
-->
|
||||
<script type='text/javascript' src='/static/basics.js'></script>
|
||||
<script type='text/javascript' src='/static/aesthetics.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<a id='minilogo' href='/'></a>
|
||||
<div id='menu'>
|
||||
<ul id='menulinks'>
|
||||
<!--@preval
|
||||
<!--@prexec
|
||||
for x in('projects', 'writings', 'films', 'about'):
|
||||
print(' ' * 14 + "<li><a href='/{x}/'>{x}</a></li>".format(x=x))-->
|
||||
print(' ' * 14 + "<li><a href='/{x}/'>{x}</a></li>".format(x=x))@-->
|
||||
</ul>
|
||||
</div>
|
||||
<div id='body'<!--@eval if page.fullpage: print(" class='full'", end='')-->>
|
||||
<!--@eval print(page.body)-->
|
||||
<div id='body'<!--@exec if page.fullpage: print(" class='full'", end='')@-->>
|
||||
<!--@eval page.body@-->
|
||||
<div id='metadata'>
|
||||
<!--@eval print(page.metadata_info)-->
|
||||
<!--@eval page.metadata_info@-->
|
||||
</div>
|
||||
</div>
|
||||
<div id='logo'>
|
||||
|
||||
Reference in New Issue
Block a user