fix 'undefined' dates in safari; update document title; add 'selected' class to logo

This commit is contained in:
rolux 2012-07-02 12:40:40 +02:00
parent 559ba82789
commit ffc3ff61e7
3 changed files with 16 additions and 12 deletions

View file

@ -42,15 +42,16 @@ p:last-child {
height: 256px;
cursor: pointer;
}
#icon.selected {
cursor: default;
}
#menu {
position: absolute;
left: 80px;
top: 288px;
height: 400px;
//border-radius: 8px;
text-align: center;
//box-shadow: 0 0 16px rgba(0, 0, 0, 0.5);
}
#menu > div {
width: 148px;

View file

@ -18,10 +18,9 @@ Ox.getJSON('json/pandora.json?' + +new Date(), function(pandora) {
.html('=>'),
tourIndex = 0;
Ox.forEach(pandora.pages, function(data, page) {
var $element, text;
if (page == '') {
if (page == 'home') {
$element = $('<img>')
.attr({id: 'icon', src: 'png/icon256.png'})
.appendTo($body);
@ -33,7 +32,7 @@ Ox.getJSON('json/pandora.json?' + +new Date(), function(pandora) {
}
$element.bind({
click: function() {
window.location.hash = page;
window.location.hash = page == 'home' ? '' : page;
}
});
});
@ -54,17 +53,21 @@ Ox.getJSON('json/pandora.json?' + +new Date(), function(pandora) {
function loadPage() {
var hash = window.location.hash.substr(1).split('.'),
page = hash[0],
page = hash[0] || 'home',
part = parseInt(hash[1], 10) || 1,
text;
if (pandora.pages[page]) {
$('#menu > div').removeClass('selected');
page != '' && $('#menu > .' + page).addClass('selected');
if (!pandora.pages[page]) {
window.location.hash = '';
} else {
document.title = 'pan.do/ra - open media archive - ' + page;
$('#icon').add('#menu > div').removeClass('selected');
(page == 'home' ? $('#icon') : $('#menu > .' + page))
.addClass('selected');
if (page == 'news') {
text = pandora.pages.news.map(function(item) {
return '<div class="title">' + item[0] + '</div>'
+ '<div class="date">'
+ Ox.formatDate(item[1], '%A, %B %e, %Y')
+ Ox.formatDate(Ox.parseDate(item[1]), '%A, %B %e, %Y')
+ '</div>'
+ '<div class="text">' + item[2] + '</div>';
}).join('');
@ -191,7 +194,7 @@ Ox.getJSON('json/pandora.json?' + +new Date(), function(pandora) {
text = pandora.pages[page].replace('{version}', '');
}
$head.empty().append(
page == '' ? 'pan.do/ra &mdash; open media archive'
page == 'home' ? 'pan.do/ra &mdash; open media archive'
: page == 'tour' ? $('<span>')
.addClass('button' + (page == 1 ? 'disabled' : ''))
.attr({title: 'first'})

View file

@ -1,6 +1,6 @@
{
"pages": {
"": "<p class=\"serif large\"><b>pan.do/ra</b> |panˈdôrə| <span class=\"sans\">Greek Mythology</span></p><p class=\"serif\">Pandora (Πανδώρα, \"all-gifted\" or \"all-giving\", from πᾶς \"all\" and δῶρον \"gift\") was the first mortal woman. She was created by Zeus and sent to earth with a box of evils in revenge for Prometheus' theft of fire. Out of curiosity, Pandora opened the box and released all the evils &mdash; leaving only hope inside.</p><p><img src=\"jpg/home.jpg\"></p>",
"home": "<p class=\"serif large\"><b>pan.do/ra</b> |panˈdôrə| <span class=\"sans\">Greek Mythology</span></p><p class=\"serif\">Pandora (Πανδώρα, \"all-gifted\" or \"all-giving\", from πᾶς \"all\" and δῶρον \"gift\") was the first mortal woman. She was created by Zeus and sent to earth with a box of evils in revenge for Prometheus' theft of fire. Out of curiosity, Pandora opened the box and released all the evils &mdash; leaving only hope inside.</p><p><img src=\"jpg/home.jpg\"></p>",
"about": "<p><b>pan.do/ra</b> is a free, open source media archive platform. It allows you to manage large, decentralized collections of video, to collaboratively create metadata and time-based annotations, and to serve your archive as a desktop-class web application.</p><p><img src=\"jpg/about.jpg\"></p>",
"news": [
[