galleries almost set

legacy_v1
Michael Winter 5 years ago
parent 46290225ee
commit 79c84d74b6

@ -18,6 +18,9 @@ $(document).ready(function() {
populateAbout(); populateAbout();
populateGallerySelector(); populateGallerySelector();
if (window.location.href.split('/').pop().substring(0,3) != "#lg") {
window.history.replaceState("object or string", "Title", "/");
}
} }
$( window ).resize(function() { $( window ).resize(function() {
@ -34,7 +37,7 @@ $(document).ready(function() {
$('html, body').animate({ $('html, body').animate({
scrollTop: $(target).offset().top - 210 scrollTop: $(target).offset().top - 210
}, 500); }, 500);
window.history.pushState("object or string", "Title", this.getAttribute('data-target')); //window.history.pushState("object or string", "Title", this.getAttribute('data-target'));
}); });
$(window).scroll(function(event) { $(window).scroll(function(event) {
@ -353,22 +356,18 @@ function populatePieces(type) {
documentButton.lightGallery({ documentButton.lightGallery({
selector: 'this', selector: 'this',
width: '90%', width: '90%',
//hash: false, hash: false,
galleryId: 'score_viewer_'+index galleryId: "score_viewer_"+index
}); });
if(typeof doc != 'undefined'){ if(typeof doc != 'undefined'){
} else{ } else{
documentButton.on('onSlideItemLoad.lg', function(event, index){ documentButton.on('onSlideItemLoad.lg', function(event, index){
window.history.pushState(null, null, "/scores/" + score_data.filename); window.history.replaceState(null, null, "/scores/" + score_data.filename);
//location.replace("/scores/" + score_data.filename);
//window.location.hash = "test";
//console.log(window.location.hash);
}); });
documentButton.on('onCloseAfter.lg', function(event, prevIndex, index){ documentButton.on('onCloseAfter.lg', function(event, prevIndex, index){
window.history.pushState("object or string", "Title", "/"); window.history.replaceState("object or string", "Title", "/");
//console.log("test");
}) })
} }
@ -733,20 +732,39 @@ console.log(href);
documentButton = $('<button id=piece_document_button_'+index+" onclick=' window.open('" + href.replace(/\//g, '\/') + "','_blank')>") documentButton = $('<button id=piece_document_button_'+index+" onclick=' window.open('" + href.replace(/\//g, '\/') + "','_blank')>")
.attr({title: "view"}).addClass('score_icon'); .attr({title: "view"}).addClass('score_icon');
} else { } else {
console.log(href);
documentButton = $('<button id=piece_document_button_'+index+" data-iframe='true' data-src='"+href+download+"'>") documentButton = $('<button id=piece_document_button_'+index+" data-iframe='true' data-src='"+href+download+"'>")
.attr({title: "view"}).addClass('score_icon'); .attr({title: "view"}).addClass('score_icon');
documentButton.lightGallery({ documentButton.lightGallery({
selector: 'this', selector: 'this',
width: '90%', width: '90%',
hash: false,
galleryId: 'pub_viewer_'+index galleryId: 'pub_viewer_'+index
}); });
if(typeof doc != 'undefined'){ if(typeof doc != 'undefined'){
documentButton.on('onSlideItemLoad.lg', function(event, index){
window.history.replaceState(null, null, href);
});
documentButton.on('onCloseAfter.lg', function(event, prevIndex, index){
window.history.replaceState("object or string", "Title", "/");
})
} else{ } else{
documentButton.on('onBeforeSlide.lg', function(event, prevIndex, index){ documentButton.on('onBeforeSlide.lg', function(event, prevIndex, index){
$('.lg-inner').css('background-color', 'white') $('.lg-inner').css('background-color', 'white')
}); });
documentButton.on('onSlideItemLoad.lg', function(event, index){
window.history.replaceState("object or string", "Title", "/redirect=" + href);
});
documentButton.on('onCloseAfter.lg', function(event, prevIndex, index){
window.history.replaceState("object or string", "Title", "/");
})
} }
} }

@ -139,6 +139,13 @@ router.get('/cv', function(req, res, next) {
}); });
}); });
/* redirect catch */
router.get('/redirect=*', function(req, res, next) {
var link = req.url.split('=').pop();
request(link).pipe(res);
});
router.get('/*/*', function(req, res) { router.get('/*/*', function(req, res) {
var db = req.db; var db = req.db;
var splitreq = req.url.split('/'); var splitreq = req.url.split('/');
@ -177,16 +184,20 @@ router.get('/cv', function(req, res, next) {
*/ */
//legacy file handler //legacy file handler
/*
router.get('/*.*', function(req, res) { router.get('/*.*', function(req, res) {
var file = req.url.split('/').pop() var file = req.url.split('/').pop()
request("http://legacy.unboundedpress.org/"+file).pipe(res); request("http://legacy.unboundedpress.org/"+file).pipe(res);
}); });
*/
/* catch all*/ /* catch all*/
router.get('/*', function(req, res, next) { router.get('/*', function(req, res, next) {
res.render('index', { title: 'Michael Winter' }); res.render('index', { title: 'Michael Winter' });
}); });
Handlebars.registerHelper("prettifyDayDate", function(resumeDate) { Handlebars.registerHelper("prettifyDayDate", function(resumeDate) {
if (!resumeDate) { if (!resumeDate) {
return 'present'; return 'present';

Loading…
Cancel
Save