links and lightgaller work

legacy_v1
Michael Winter 5 years ago
parent 08f2f31e48
commit 6dd4bea853

@ -34,7 +34,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).scroll(function(event) { $(window).scroll(function(event) {
@ -353,9 +353,26 @@ function populatePieces(type) {
documentButton.lightGallery({ documentButton.lightGallery({
selector: 'this', selector: 'this',
width: '90%', width: '90%',
//hash: false,
galleryId: 'score_viewer_'+index 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);
});
documentButton.on('onCloseAfter.lg', function(event, prevIndex, index){
window.history.pushState("object or string", "Title", "/");
//console.log("test");
})
}
} else { } else {
documentButton = $('<button id=piece_document_button_'+index+">").attr({title: "score"}).addClass('score_icon'); documentButton = $('<button id=piece_document_button_'+index+">").attr({title: "score"}).addClass('score_icon');
documentButton.css('visibility', 'hidden'); documentButton.css('visibility', 'hidden');

@ -47,6 +47,7 @@
Hash.prototype.destroy = function() { Hash.prototype.destroy = function() {
// Reset to old hash value // Reset to old hash value
if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) { if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) {
window.location.hash = this.oldHash; window.location.hash = this.oldHash;
} else { } else {
@ -57,6 +58,24 @@
} }
} }
// Reset to old hash value
/*
if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) {
if (history.replaceState) {
history.replaceState(null, null, this.oldHash);
} else {
window.location.hash = this.oldHash;
}
} else {
if (history.replaceState) {
history.replaceState(null, document.title, window.location.pathname + window.location.search);
} else {
window.location.hash = '';
}
}
this.core.$el.off('.lg.hash');
*/
}; };
$.fn.lightGallery.modules.hash = Hash; $.fn.lightGallery.modules.hash = Hash;

@ -182,6 +182,11 @@ router.get('/cv', function(req, res, next) {
request("http://legacy.unboundedpress.org/"+file).pipe(res); request("http://legacy.unboundedpress.org/"+file).pipe(res);
}); });
/* catch all */
router.get('/*', function(req, res, next) {
res.render('index', { title: 'Michael Winter' });
});
Handlebars.registerHelper("prettifyDayDate", function(resumeDate) { Handlebars.registerHelper("prettifyDayDate", function(resumeDate) {
if (!resumeDate) { if (!resumeDate) {
return 'present'; return 'present';

@ -9,11 +9,11 @@ block content
h2 h2
ul.inline-list ul.inline-list
li li
a#worksbutton(class='scroll-to-div', href='#', data-target='works') works a#worksbutton(class='scroll-to-div', href='#works', data-target='works') works
li li
a#eventsbutton(class='scroll-to-div', href='#', data-target='events') events a#eventsbutton(class='scroll-to-div', href='#events', data-target='events') events
li li
a#aboutbutton(class='scroll-to-div', href='#', data-target='about') about a#aboutbutton(class='scroll-to-div', href='#about', data-target='about') about
div#gallery.header-section div#gallery.header-section
div.header-inner div.header-inner

Loading…
Cancel
Save