avoid http links. new files

This commit is contained in:
j 2012-04-21 13:44:51 +02:00
commit 4055215553
15 changed files with 172 additions and 82 deletions

View file

@ -1,4 +1,5 @@
Ox.getJSON('json/pandora.json', function(pandora) {
$(function() {
var $body = $('body'),
@ -25,6 +26,7 @@ Ox.getJSON('json/pandora.json', function(pandora) {
.appendTo($body);
} else {
$element = $('<div>')
.addClass(page)
.html(page)
.appendTo($menu);
}
@ -40,7 +42,9 @@ Ox.getJSON('json/pandora.json', function(pandora) {
loadPage();
function loadPage() {
var page = window.location.hash.substr(1),
var hash = window.location.hash.substr(1).split('.'),
page = hash[0],
part = parseInt(hash[1], 10) || 1,
text;
if (pandora.pages[page]) {
$('#menu > div').removeClass('selected');
@ -67,7 +71,7 @@ Ox.getJSON('json/pandora.json', function(pandora) {
$('<img>')
.addClass('tour')
.attr({
src: pandora.pages.tour[tourIndex][0]
src: pandora.pages.tour[part - 1][0]
})
)
.bind({
@ -172,7 +176,7 @@ Ox.getJSON('json/pandora.json', function(pandora) {
.append($('<br>'))
.append($('<br>'))
.append(
$('<p>').html(pandora.pages.tour[tourIndex][1])
$('<p>').html(pandora.pages.tour[part - 1][1])
);
} else {
text = pandora.pages[page];
@ -180,31 +184,31 @@ Ox.getJSON('json/pandora.json', function(pandora) {
$head.empty().append(
page == '' ? 'pan.do/ra &mdash; open media archive'
: page == 'tour' ? $('<span>')
.addClass('button disabled')
.addClass('button' + (page == 1 ? 'disabled' : ''))
.attr({title: 'first'})
.html('tour')
.click(function() {
loadTour(0);
window.location.hash = 'tour';
})
: page
);
$text.empty().append(text);
if (page == 'tour') {
$prevButton
if (page == 'tour') {
$prevButton[
part == 1 ? 'addClass' : 'removeClass'
]('disabled')
.click(function() {
loadTour(-1);
window.location.hash = 'tour.' + (part - 1);
})
.appendTo($head);
$nextButton
$nextButton[
part == pandora.pages.tour.length
? 'addClass' : 'removeClass'
]('disabled')
.click(function() {
loadTour(1);
window.location.hash = 'tour.' + (part + 1);
})
.appendTo($head);
if (tourIndex == 0) {
$prevButton.addClass('disabled');
} else if (tourIndex == pandora.pages.tour.length - 1) {
$nextButton.addClass('disabled');
}
}
}
}
@ -233,13 +237,6 @@ Ox.getJSON('json/pandora.json', function(pandora) {
$p.css({opacity: 0.25});
}
function zoomIn($element, event) {
}
function zoomOut($element, e) {
}
});
});