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

@ -47,6 +47,7 @@
Hash.prototype.destroy = function() {
// Reset to old hash value
if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) {
window.location.hash = this.oldHash;
} 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;

@ -182,6 +182,11 @@ router.get('/cv', function(req, res, next) {
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) {
if (!resumeDate) {
return 'present';

@ -9,11 +9,11 @@ block content
h2
ul.inline-list
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
a#eventsbutton(class='scroll-to-div', href='#', data-target='events') events
a#eventsbutton(class='scroll-to-div', href='#events', data-target='events') events
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.header-inner

Loading…
Cancel
Save