fix 'undefined' dates in safari; update document title; add 'selected' class to logo
This commit is contained in:
parent
559ba82789
commit
ffc3ff61e7
3 changed files with 16 additions and 12 deletions
|
@ -42,15 +42,16 @@ p:last-child {
|
||||||
height: 256px;
|
height: 256px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
#icon.selected {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
#menu {
|
#menu {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 80px;
|
left: 80px;
|
||||||
top: 288px;
|
top: 288px;
|
||||||
height: 400px;
|
height: 400px;
|
||||||
//border-radius: 8px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
//box-shadow: 0 0 16px rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
}
|
||||||
#menu > div {
|
#menu > div {
|
||||||
width: 148px;
|
width: 148px;
|
||||||
|
|
|
@ -18,10 +18,9 @@ Ox.getJSON('json/pandora.json?' + +new Date(), function(pandora) {
|
||||||
.html('=>'),
|
.html('=>'),
|
||||||
tourIndex = 0;
|
tourIndex = 0;
|
||||||
|
|
||||||
|
|
||||||
Ox.forEach(pandora.pages, function(data, page) {
|
Ox.forEach(pandora.pages, function(data, page) {
|
||||||
var $element, text;
|
var $element, text;
|
||||||
if (page == '') {
|
if (page == 'home') {
|
||||||
$element = $('<img>')
|
$element = $('<img>')
|
||||||
.attr({id: 'icon', src: 'png/icon256.png'})
|
.attr({id: 'icon', src: 'png/icon256.png'})
|
||||||
.appendTo($body);
|
.appendTo($body);
|
||||||
|
@ -33,7 +32,7 @@ Ox.getJSON('json/pandora.json?' + +new Date(), function(pandora) {
|
||||||
}
|
}
|
||||||
$element.bind({
|
$element.bind({
|
||||||
click: function() {
|
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() {
|
function loadPage() {
|
||||||
var hash = window.location.hash.substr(1).split('.'),
|
var hash = window.location.hash.substr(1).split('.'),
|
||||||
page = hash[0],
|
page = hash[0] || 'home',
|
||||||
part = parseInt(hash[1], 10) || 1,
|
part = parseInt(hash[1], 10) || 1,
|
||||||
text;
|
text;
|
||||||
if (pandora.pages[page]) {
|
if (!pandora.pages[page]) {
|
||||||
$('#menu > div').removeClass('selected');
|
window.location.hash = '';
|
||||||
page != '' && $('#menu > .' + page).addClass('selected');
|
} 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') {
|
if (page == 'news') {
|
||||||
text = pandora.pages.news.map(function(item) {
|
text = pandora.pages.news.map(function(item) {
|
||||||
return '<div class="title">' + item[0] + '</div>'
|
return '<div class="title">' + item[0] + '</div>'
|
||||||
+ '<div class="date">'
|
+ '<div class="date">'
|
||||||
+ Ox.formatDate(item[1], '%A, %B %e, %Y')
|
+ Ox.formatDate(Ox.parseDate(item[1]), '%A, %B %e, %Y')
|
||||||
+ '</div>'
|
+ '</div>'
|
||||||
+ '<div class="text">' + item[2] + '</div>';
|
+ '<div class="text">' + item[2] + '</div>';
|
||||||
}).join('');
|
}).join('');
|
||||||
|
@ -191,7 +194,7 @@ Ox.getJSON('json/pandora.json?' + +new Date(), function(pandora) {
|
||||||
text = pandora.pages[page].replace('{version}', '');
|
text = pandora.pages[page].replace('{version}', '');
|
||||||
}
|
}
|
||||||
$head.empty().append(
|
$head.empty().append(
|
||||||
page == '' ? 'pan.do/ra — open media archive'
|
page == 'home' ? 'pan.do/ra — open media archive'
|
||||||
: page == 'tour' ? $('<span>')
|
: page == 'tour' ? $('<span>')
|
||||||
.addClass('button' + (page == 1 ? 'disabled' : ''))
|
.addClass('button' + (page == 1 ? 'disabled' : ''))
|
||||||
.attr({title: 'first'})
|
.attr({title: 'first'})
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"pages": {
|
"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 — 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 — 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>",
|
"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": [
|
"news": [
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in a new issue