galleries almost set

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

@ -18,7 +18,10 @@ $(document).ready(function() {
populateAbout();
populateGallerySelector();
}
if (window.location.href.split('/').pop().substring(0,3) != "#lg") {
window.history.replaceState("object or string", "Title", "/");
}
}
$( window ).resize(function() {
resetDivHeights();
@ -34,7 +37,7 @@ $(document).ready(function() {
$('html, body').animate({
scrollTop: $(target).offset().top - 210
}, 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) {
@ -353,22 +356,18 @@ function populatePieces(type) {
documentButton.lightGallery({
selector: 'this',
width: '90%',
//hash: false,
galleryId: 'score_viewer_'+index
hash: false,
galleryId: "score_viewer_"+index
});
if(typeof doc != 'undefined'){
} else{
documentButton.on('onSlideItemLoad.lg', function(event, index){
window.history.pushState(null, null, "/scores/" + score_data.filename);
//location.replace("/scores/" + score_data.filename);
//window.location.hash = "test";
//console.log(window.location.hash);
window.history.replaceState(null, null, "/scores/" + score_data.filename);
});
documentButton.on('onCloseAfter.lg', function(event, prevIndex, index){
window.history.pushState("object or string", "Title", "/");
//console.log("test");
window.history.replaceState("object or string", "Title", "/");
})
}
@ -733,20 +732,39 @@ console.log(href);
documentButton = $('<button id=piece_document_button_'+index+" onclick=' window.open('" + href.replace(/\//g, '\/') + "','_blank')>")
.attr({title: "view"}).addClass('score_icon');
} else {
console.log(href);
documentButton = $('<button id=piece_document_button_'+index+" data-iframe='true' data-src='"+href+download+"'>")
.attr({title: "view"}).addClass('score_icon');
documentButton.lightGallery({
selector: 'this',
width: '90%',
hash: false,
galleryId: 'pub_viewer_'+index
});
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{
documentButton.on('onBeforeSlide.lg', function(event, prevIndex, index){
$('.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) {
var db = req.db;
var splitreq = req.url.split('/');
@ -177,16 +184,20 @@ router.get('/cv', function(req, res, next) {
*/
//legacy file handler
/*
router.get('/*.*', function(req, res) {
var file = req.url.split('/').pop()
request("http://legacy.unboundedpress.org/"+file).pipe(res);
});
*/
/* catch all */
/* catch all*/
router.get('/*', function(req, res, next) {
res.render('index', { title: 'Michael Winter' });
});
Handlebars.registerHelper("prettifyDayDate", function(resumeDate) {
if (!resumeDate) {
return 'present';

Loading…
Cancel
Save