Better handling of # variables + bump simplebar to v5.2.1
This commit is contained in:
@@ -30,9 +30,9 @@ map_linz = LINZ (New Zealand)
|
|||||||
map_usgs = USGS (USA)
|
map_usgs = USGS (USA)
|
||||||
map_natgeo = National Geographic (USA)
|
map_natgeo = National Geographic (USA)
|
||||||
|
|
||||||
pic = Picture
|
image = Picture
|
||||||
pics = Pictures
|
images = Pictures
|
||||||
pic_taken = taken on $0
|
image_taken = taken on $0
|
||||||
video = Video
|
video = Video
|
||||||
video_taken = shot on $0
|
video_taken = shot on $0
|
||||||
add_on = added on $0
|
add_on = added on $0
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ map_linz = LINZ (Nouvelle-Zélande)
|
|||||||
map_usgs = USGS (États-Unis)
|
map_usgs = USGS (États-Unis)
|
||||||
map_natgeo = National Geographic (États-Unis)
|
map_natgeo = National Geographic (États-Unis)
|
||||||
|
|
||||||
pic = Photo
|
image = Photo
|
||||||
pics = Photos
|
images = Photos
|
||||||
pic_taken = prise le $0
|
image_taken = prise le $0
|
||||||
video = Vidéo
|
video = Vidéo
|
||||||
video_taken = filmée le $0
|
video_taken = filmée le $0
|
||||||
add_on = ajoutée le $0
|
add_on = ajoutée le $0
|
||||||
@@ -89,7 +89,7 @@ conf_preheader = Merci de rester en contact !
|
|||||||
conf_thanks_sub = C'est tout bon !
|
conf_thanks_sub = C'est tout bon !
|
||||||
conf_body_para_1 = C'est gentil de venir voir où j'en suis. Promis, je vous tiendrais au courant de mon avancée.
|
conf_body_para_1 = C'est gentil de venir voir où j'en suis. Promis, je vous tiendrais au courant de mon avancée.
|
||||||
conf_body_para_2 = En général, j'envoie un message une fois par jour. Lorsque je passe à des endroits sympas, j'en envoie un supplémentaire (ascension de sommets, ce genre de choses). J'utilise une balise GPS pour envoyer le signal, je n'ai donc pas besoin de réseau téléphonique pour que cela fonctionne. Cependant, il peut m'arriver d'appuyer sur le bouton. Donc pas de raison de s'inquiéter si vous ne recevez pas de messages pendant une journée ou deux.
|
conf_body_para_2 = En général, j'envoie un message une fois par jour. Lorsque je passe à des endroits sympas, j'en envoie un supplémentaire (ascension de sommets, ce genre de choses). J'utilise une balise GPS pour envoyer le signal, je n'ai donc pas besoin de réseau téléphonique pour que cela fonctionne. Cependant, il peut m'arriver d'appuyer sur le bouton. Donc pas de raison de s'inquiéter si vous ne recevez pas de messages pendant une journée ou deux.
|
||||||
conf_body_para_3 = If I've posted some pictures recently, you should also get them in this email.
|
conf_body_para_3 = Si j'ai ajouté des photos sur le site récemment, vous devriez aussi les retrouver dans cet email.
|
||||||
conf_body_conclusion= A bientôt sur les chemins !
|
conf_body_conclusion= A bientôt sur les chemins !
|
||||||
conf_signature = --François
|
conf_signature = --François
|
||||||
|
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ function initPage(asHash) {
|
|||||||
else {
|
else {
|
||||||
self.tmp('$Projects', $('#projects'));
|
self.tmp('$Projects', $('#projects'));
|
||||||
self.tmp('$Map', $('#map'));
|
self.tmp('$Map', $('#map'));
|
||||||
|
self.tmp('$Poster', $('#poster'));
|
||||||
self.tmp('$PostList', $('#posts_list'));
|
self.tmp('$PostList', $('#posts_list'));
|
||||||
self.tmp('$Feed', $('#feed'));
|
self.tmp('$Feed', $('#feed'));
|
||||||
self.tmp('$Settings', $('#settings'));
|
self.tmp('$Settings', $('#settings'));
|
||||||
@@ -233,7 +234,7 @@ function initProject(sProjectCodeName, oFocusPost){
|
|||||||
|
|
||||||
//Show/Hide Poster Panel
|
//Show/Hide Poster Panel
|
||||||
var bHistoMode = (self.vars(['project', 'mode']) == self.consts.modes.histo);
|
var bHistoMode = (self.vars(['project', 'mode']) == self.consts.modes.histo);
|
||||||
$('#poster').toggle(!bHistoMode);
|
self.tmp('$Poster').toggle(!bHistoMode);
|
||||||
|
|
||||||
//Feed auto-update
|
//Feed auto-update
|
||||||
updateFeed(true, false, function(){focusOnPost(oFocusPost);});
|
updateFeed(true, false, function(){focusOnPost(oFocusPost);});
|
||||||
@@ -248,14 +249,14 @@ function initPosts() {
|
|||||||
formatted_time: '',
|
formatted_time: '',
|
||||||
relative_time: oSpot.lang('post_new_message')
|
relative_time: oSpot.lang('post_new_message')
|
||||||
};
|
};
|
||||||
$('#poster').append(getPost(asPoster));
|
self.tmp('$Poster').append(getPost(asPoster));
|
||||||
|
|
||||||
//Auto-adjust text area height
|
//Auto-adjust text area height
|
||||||
autosize($('#post'));
|
autosize($('#post'));
|
||||||
|
|
||||||
//Add post Event handling
|
//Add post Event handling
|
||||||
$('#submit').click(function(){
|
$('#submit').click(function(){
|
||||||
if($('#poster').checkForm())
|
if(self.tmp('$Poster').checkForm())
|
||||||
{
|
{
|
||||||
self.get(
|
self.get(
|
||||||
'add_post',
|
'add_post',
|
||||||
@@ -564,8 +565,11 @@ function initSpotMessages(aoMessages, aoTracks, bNoFeed) {
|
|||||||
|
|
||||||
//Centering map
|
//Centering map
|
||||||
var bWithFeedPanel = (!bNoFeed && !isMobile());
|
var bWithFeedPanel = (!bNoFeed && !isMobile());
|
||||||
if(self.vars(['project', 'mode'])==self.consts.modes.blog && aoMessages.length > 0)
|
if(
|
||||||
{
|
self.vars(['project', 'mode']) == self.consts.modes.blog &&
|
||||||
|
aoMessages.length > 0 &&
|
||||||
|
self.getHash()[2] != 'message'
|
||||||
|
) {
|
||||||
//Zoom on last message
|
//Zoom on last message
|
||||||
var oLastMsg = aoMessages[aoMessages.length-1];
|
var oLastMsg = aoMessages[aoMessages.length-1];
|
||||||
oMap.setView(L.latLng(oLastMsg.latitude, oLastMsg.longitude), 15);
|
oMap.setView(L.latLng(oLastMsg.latitude, oLastMsg.longitude), 15);
|
||||||
@@ -609,7 +613,7 @@ function initSpotMessages(aoMessages, aoTracks, bNoFeed) {
|
|||||||
$Medias.append(getMediaLink(asMedia, 'marker'));
|
$Medias.append(getMediaLink(asMedia, 'marker'));
|
||||||
});
|
});
|
||||||
$Tooltip
|
$Tooltip
|
||||||
.append($('<p>').addIcon('fa-media fa-fw fa-lg').append(oSpot.lang('pics')))
|
.append($('<p>').addIcon('fa-media fa-fw fa-lg').append(oSpot.lang('images')))
|
||||||
.append($Medias);
|
.append($Medias);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -735,15 +739,14 @@ function focusOnPost(oFocusPost) {
|
|||||||
var $Post = oSpot.tmp('$PostList').find(sElemId);
|
var $Post = oSpot.tmp('$PostList').find(sElemId);
|
||||||
var bGetToTop = (oSpot.tmp('$PostList').height() - (($Post.length > 0)?$Post.position().top:0) >= $(window).height());
|
var bGetToTop = (oSpot.tmp('$PostList').height() - (($Post.length > 0)?$Post.position().top:0) >= $(window).height());
|
||||||
if($Post.length > 0 && (bGetToTop || self.tmp('out-of-data'))) {
|
if($Post.length > 0 && (bGetToTop || self.tmp('out-of-data'))) {
|
||||||
self.tmp('simple-bar').getScrollElement().scrollTop = $Post.position().top;
|
self.tmp('simple-bar').getScrollElement().scrollTop = $Post.position().top + self.tmp('$Poster').outerHeight(true);
|
||||||
if(oFocusPost.type=='media' || oFocusPost.type=='message') $Post.find('a.drill').click();
|
if(oFocusPost.type=='media' || oFocusPost.type=='message') $Post.find('a.drill').click();
|
||||||
}
|
}
|
||||||
else if(!self.tmp('out-of-data')) updateFeed(false, false, function() {focusOnPost(oFocusPost);});
|
else if(!self.tmp('out-of-data')) updateFeed(false, false, function() {focusOnPost(oFocusPost);});
|
||||||
else console.log('Missing element ID '+sElemId);
|
else console.log('Missing element ID '+sElemId);
|
||||||
|
|
||||||
//Reset Hash
|
//Reset Hash
|
||||||
var asHash = self.getHash();
|
flushHash(['post', 'message']);
|
||||||
self.setHash(asHash.page, [asHash.items[0]]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -768,6 +771,7 @@ function getPost(asPost) {
|
|||||||
case 'message':
|
case 'message':
|
||||||
$Body = $('<div>', {'class':'body-box'})
|
$Body = $('<div>', {'class':'body-box'})
|
||||||
.data('id', asPost.id_message)
|
.data('id', asPost.id_message)
|
||||||
|
.data('clicked', false)
|
||||||
.append($('<p>').addIcon('fa-coords', true).append(getGoogleMapsLink(asPost)))
|
.append($('<p>').addIcon('fa-coords', true).append(getGoogleMapsLink(asPost)))
|
||||||
.append($('<p>').addIcon('fa-time', true).append(sAbsTime))
|
.append($('<p>').addIcon('fa-time', true).append(sAbsTime))
|
||||||
.append((self.tmp('site_tz_notice')!='')?$('<p>').addIcon('fa-timezone', true).append(self.tmp('site_tz_notice')):'')
|
.append((self.tmp('site_tz_notice')!='')?$('<p>').addIcon('fa-timezone', true).append(self.tmp('site_tz_notice')):'')
|
||||||
@@ -778,17 +782,19 @@ function getPost(asPost) {
|
|||||||
.addIcon('fa-message fa-stack-2x')
|
.addIcon('fa-message fa-stack-2x')
|
||||||
)
|
)
|
||||||
.click(function(){
|
.click(function(){
|
||||||
var oMarker = oSpot.tmp(['markers', $(this).parent().data('id')]);
|
var $Parent = $(this).parent();
|
||||||
|
var oMarker = oSpot.tmp(['markers', $Parent.data('id')]);
|
||||||
if(isMobile()) {
|
if(isMobile()) {
|
||||||
toggleFeedPanel(false, 'panToInstant');
|
toggleFeedPanel(false, 'panToInstant');
|
||||||
self.tmp('map').setView(oMarker.getLatLng(), 15);
|
oSpot.tmp('map').setView(oMarker.getLatLng(), 15);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var iOffset = (isFeedPanelOpen()?1:-1)*self.tmp('$Feed').outerWidth(true)/2 - (isSettingsPanelOpen()?1:-1)*self.tmp('$Settings').outerWidth(true)/2;
|
var iOffset = (isFeedPanelOpen()?1:-1)*self.tmp('$Feed').outerWidth(true)/2 - (isSettingsPanelOpen()?1:-1)*self.tmp('$Settings').outerWidth(true)/2;
|
||||||
var iRatio = -1 * iOffset / $('body').outerWidth(true);
|
var iRatio = -1 * iOffset / $('body').outerWidth(true);
|
||||||
self.tmp('map').setOffsetView(iRatio, oMarker.getLatLng(), 15);
|
oSpot.tmp('map').setOffsetView(iRatio, oMarker.getLatLng(), 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$Parent.data('clicked', true);
|
||||||
if(!oMarker.isPopupOpen()) oMarker.openPopup();
|
if(!oMarker.isPopupOpen()) oMarker.openPopup();
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@@ -799,7 +805,8 @@ function getPost(asPost) {
|
|||||||
},
|
},
|
||||||
function(){
|
function(){
|
||||||
var oMarker = oSpot.tmp(['markers', $(this).data('id')]);
|
var oMarker = oSpot.tmp(['markers', $(this).data('id')]);
|
||||||
if(oMarker.isPopupOpen()) oMarker.closePopup();
|
if(oMarker.isPopupOpen() && !$(this).data('clicked')) oMarker.closePopup();
|
||||||
|
$(this).data('clicked', false);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -839,15 +846,13 @@ function getWmtsApiUrl(sMapId, iLat, iLng, iZoom) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getMediaLink(asData, sType) {
|
function getMediaLink(asData, sType) {
|
||||||
var bVideo = (asData.subtype == 'video');
|
|
||||||
|
|
||||||
var $PostedOn =
|
var $PostedOn =
|
||||||
$('<span>', {'class': 'lb-caption-line', title: oSpot.lang(bVideo?'video':'pic')+' '+oSpot.lang('add_on', asData.posted_on_formatted)})
|
$('<span>', {'class': 'lb-caption-line', title: oSpot.lang(asData.subtype)+' '+oSpot.lang('add_on', asData.posted_on_formatted)})
|
||||||
.addIcon('fa-upload fa-lg fa-fw', true)
|
.addIcon('fa-upload fa-lg fa-fw', true)
|
||||||
.append(asData.posted_on_formatted);
|
.append(asData.posted_on_formatted);
|
||||||
|
|
||||||
var $TakenOn = (asData.taken_on == '0000-00-00 00:00:00')?'':
|
var $TakenOn = (asData.taken_on == '0000-00-00 00:00:00')?'':
|
||||||
$('<span>', {'class': 'lb-caption-line', title: oSpot.lang(bVideo?'video':'pic')+' '+oSpot.lang(bVideo?'video_taken':'pic_taken', asData.taken_on_formatted)})
|
$('<span>', {'class': 'lb-caption-line', title: oSpot.lang(asData.subtype)+' '+oSpot.lang(asData.subtype+'_taken', asData.taken_on_formatted)})
|
||||||
.addIcon('fa-'+asData.subtype+'-shot fa-lg fa-fw', true)
|
.addIcon('fa-'+asData.subtype+'-shot fa-lg fa-fw', true)
|
||||||
.append(asData.taken_on_formatted);
|
.append(asData.taken_on_formatted);
|
||||||
|
|
||||||
@@ -862,12 +867,13 @@ function getMediaLink(asData, sType) {
|
|||||||
'class': 'drill',
|
'class': 'drill',
|
||||||
'href': asData.media_path,
|
'href': asData.media_path,
|
||||||
'data-lightbox': sType+'-medias',
|
'data-lightbox': sType+'-medias',
|
||||||
'data-video': (bVideo?'true':'false'),
|
'data-type': asData.subtype,
|
||||||
|
'data-id': asData.id_media,
|
||||||
'data-title': $Title.html(),
|
'data-title': $Title.html(),
|
||||||
'data-orientation': asData.rotate
|
'data-orientation': asData.rotate
|
||||||
})
|
})
|
||||||
.append($('<img>', {'src': asData.thumb_path, title: oSpot.lang(bVideo?'click_watch':'click_zoom')}))
|
.append($('<img>', {'src': asData.thumb_path, title: oSpot.lang((asData.subtype == 'video')?'click_watch':'click_zoom')}))
|
||||||
.append($('<span>', {'class': 'drill-icon'}).addIcon('fa-drill-'+(bVideo?'video':'picture')));
|
.append($('<span>', {'class': 'drill-icon'}).addIcon('fa-drill-'+asData.subtype));
|
||||||
|
|
||||||
return $Link;
|
return $Link;
|
||||||
}
|
}
|
||||||
@@ -880,4 +886,18 @@ function getGoogleMapsLink(asInfo) {
|
|||||||
rel: 'noreferrer'
|
rel: 'noreferrer'
|
||||||
}).text(asInfo.lat_dms+' '+asInfo.lon_dms);
|
}).text(asInfo.lat_dms+' '+asInfo.lon_dms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateHash(sType, iId) {
|
||||||
|
sType = sType || '';
|
||||||
|
iId = iId || 0;
|
||||||
|
|
||||||
|
var asHash = self.getHash();
|
||||||
|
if(iId) self.setHash(asHash.page, [asHash.items[0], sType, iId]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function flushHash(asTypes) {
|
||||||
|
asTypes = asTypes || [];
|
||||||
|
var asHash = self.getHash();
|
||||||
|
if(asHash.items.length > 1 && (asTypes.length == 0 || asTypes.indexOf(asHash.items[1]) != -1)) self.setHash(asHash.page, [asHash.items[0]]);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -123,7 +123,7 @@
|
|||||||
this.$container = this.$lightbox.find('.lb-container');
|
this.$container = this.$lightbox.find('.lb-container');
|
||||||
this.$image = this.$lightbox.find('.lb-image');
|
this.$image = this.$lightbox.find('.lb-image');
|
||||||
this.$nav = this.$lightbox.find('.lb-nav');
|
this.$nav = this.$lightbox.find('.lb-nav');
|
||||||
|
|
||||||
//ADDED-START
|
//ADDED-START
|
||||||
if(self.options.hasVideo) {
|
if(self.options.hasVideo) {
|
||||||
this.$video = $('<video class="lb-video" controls autoplay></video>');
|
this.$video = $('<video class="lb-video" controls autoplay></video>');
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
//ADDED-END
|
//ADDED-END
|
||||||
|
|
||||||
// Store css values for future lookup
|
// Store css values for future lookup
|
||||||
this.containerPadding = {
|
this.containerPadding = {
|
||||||
top: parseInt(this.$container.css('padding-top'), 10),
|
top: parseInt(this.$container.css('padding-top'), 10),
|
||||||
@@ -232,23 +232,23 @@
|
|||||||
$window.on('resize', $.proxy(this.sizeOverlay, this));
|
$window.on('resize', $.proxy(this.sizeOverlay, this));
|
||||||
|
|
||||||
this.sizeOverlay();
|
this.sizeOverlay();
|
||||||
|
|
||||||
//ADDED-START
|
//ADDED-START
|
||||||
this.$nav.mousewheel((e) => {
|
this.$nav.mousewheel((e) => {
|
||||||
var asImg = self.album[this.currentImageIndex];
|
var asImg = self.album[this.currentImageIndex];
|
||||||
if(!asImg.video) {
|
if(!asImg.type != 'video') {
|
||||||
asTransform = this.$image.css('transform').replace(/[^0-9\-.,]/g, '').split(',');
|
asTransform = this.$image.css('transform').replace(/[^0-9\-.,]/g, '').split(',');
|
||||||
var fOldZoom = parseFloat(asTransform[0] || 1);
|
var fOldZoom = parseFloat(asTransform[0] || 1);
|
||||||
var fOldTranslateX = parseFloat(asTransform[4] || 0);
|
var fOldTranslateX = parseFloat(asTransform[4] || 0);
|
||||||
var fOldTranslateY = parseFloat(asTransform[5] || 0);
|
var fOldTranslateY = parseFloat(asTransform[5] || 0);
|
||||||
var fOldZoom = parseFloat(asTransform[0] || 1);
|
var fOldZoom = parseFloat(asTransform[0] || 1);
|
||||||
var fNewZoom = Math.min(Math.max(fOldZoom + e.deltaY / 10, 1), Math.max(asImg.width/this.$image.width(), asImg.height/this.$image.height()));
|
var fNewZoom = Math.min(Math.max(fOldZoom + e.deltaY / 10, 1), Math.max(asImg.width/this.$image.width(), asImg.height/this.$image.height()));
|
||||||
|
|
||||||
var fTransX = fOldTranslateX + (fNewZoom - fOldZoom) * (this.$image.width()/2 - e.offsetX);
|
var fTransX = fOldTranslateX + (fNewZoom - fOldZoom) * (this.$image.width()/2 - e.offsetX);
|
||||||
var fTransY = fOldTranslateY + (fNewZoom - fOldZoom) * (this.$image.height()/2 - e.offsetY);
|
var fTransY = fOldTranslateY + (fNewZoom - fOldZoom) * (this.$image.height()/2 - e.offsetY);
|
||||||
var fTransMaxX = (fNewZoom - 1) * this.$image.width() / 2;
|
var fTransMaxX = (fNewZoom - 1) * this.$image.width() / 2;
|
||||||
var fTransMaxY = (fNewZoom - 1) * this.$image.height() / 2;
|
var fTransMaxY = (fNewZoom - 1) * this.$image.height() / 2;
|
||||||
|
|
||||||
fTransX = Math.max(Math.min(fTransX, fTransMaxX), fTransMaxX * -1);
|
fTransX = Math.max(Math.min(fTransX, fTransMaxX), fTransMaxX * -1);
|
||||||
fTransY = Math.max(Math.min(fTransY, fTransMaxY), fTransMaxY * -1);
|
fTransY = Math.max(Math.min(fTransY, fTransMaxY), fTransMaxY * -1);
|
||||||
|
|
||||||
@@ -269,7 +269,8 @@
|
|||||||
title: $link.attr('data-title') || $link.attr('title')
|
title: $link.attr('data-title') || $link.attr('title')
|
||||||
//ADDED-START
|
//ADDED-START
|
||||||
, orientation: $link.attr('data-orientation')
|
, orientation: $link.attr('data-orientation')
|
||||||
, video: (self.options.hasVideo && typeof $link.attr('data-video') !== 'undefined' && $link.attr('data-video') === 'true')
|
, type: $link.attr('data-type')
|
||||||
|
, id: $link.attr('data-id')
|
||||||
//ADDED-END
|
//ADDED-END
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -311,7 +312,7 @@
|
|||||||
left: left + 'px'
|
left: left + 'px'
|
||||||
})*/.fadeIn(this.options.fadeDuration);
|
})*/.fadeIn(this.options.fadeDuration);
|
||||||
//ADDED-END
|
//ADDED-END
|
||||||
|
|
||||||
// Disable scrolling of the page while open
|
// Disable scrolling of the page while open
|
||||||
if (this.options.disableScrolling) {
|
if (this.options.disableScrolling) {
|
||||||
$('body').addClass('lb-disable-scrolling');
|
$('body').addClass('lb-disable-scrolling');
|
||||||
@@ -339,9 +340,9 @@
|
|||||||
this.$image.css({'--scale': '1', '--translate-x': '0', '--translate-y': '0'});
|
this.$image.css({'--scale': '1', '--translate-x': '0', '--translate-y': '0'});
|
||||||
self.$lightbox.find('.lb-dataContainer').css({width:'200px', height:'30px'});
|
self.$lightbox.find('.lb-dataContainer').css({width:'200px', height:'30px'});
|
||||||
//ADDED-END
|
//ADDED-END
|
||||||
|
|
||||||
this.$outerContainer.addClass('animating');
|
this.$outerContainer.addClass('animating');
|
||||||
|
|
||||||
//ADDED-START
|
//ADDED-START
|
||||||
var getMaxSizes = function(iMediaWidth, iMediaHeight, sMediaType) {
|
var getMaxSizes = function(iMediaWidth, iMediaHeight, sMediaType) {
|
||||||
var iWindowWidth = $(window).width();
|
var iWindowWidth = $(window).width();
|
||||||
@@ -349,36 +350,38 @@
|
|||||||
var oBorder = (sMediaType=='image')?self.imageBorderWidth:self.videoBorderWidth;
|
var oBorder = (sMediaType=='image')?self.imageBorderWidth:self.videoBorderWidth;
|
||||||
var iMaxMediaWidth = iWindowWidth - self.containerPadding.left - self.containerPadding.right - oBorder.left - oBorder.right;
|
var iMaxMediaWidth = iWindowWidth - self.containerPadding.left - self.containerPadding.right - oBorder.left - oBorder.right;
|
||||||
var iMaxMediaHeight = iWindowHeight - self.containerPadding.top - self.containerPadding.bottom - oBorder.top - oBorder.bottom - self.options.positionFromTop;
|
var iMaxMediaHeight = iWindowHeight - self.containerPadding.top - self.containerPadding.bottom - oBorder.top - oBorder.bottom - self.options.positionFromTop;
|
||||||
|
|
||||||
var iDataMaxWidth = self.$lightbox.find('.lb-dataContainer').width(), iDataMaxHeight = self.$lightbox.find('.lb-dataContainer').height();
|
var iDataMaxWidth = self.$lightbox.find('.lb-dataContainer').width(), iDataMaxHeight = self.$lightbox.find('.lb-dataContainer').height();
|
||||||
var iImageRatio = iMediaWidth / iMediaHeight;
|
var iImageRatio = iMediaWidth / iMediaHeight;
|
||||||
|
|
||||||
//Case horizontal
|
//Case horizontal
|
||||||
var iHeightH = Math.min(iMaxMediaHeight, iMediaHeight);
|
var iHeightH = Math.min(iMaxMediaHeight, iMediaHeight);
|
||||||
var iWidthH = Math.min(iHeightH * iImageRatio, iMaxMediaWidth - iDataMaxWidth);
|
var iWidthH = Math.min(iHeightH * iImageRatio, iMaxMediaWidth - iDataMaxWidth);
|
||||||
var iSurfaceH = Math.min(iHeightH, iWidthH / iImageRatio) * iWidthH;
|
var iSurfaceH = Math.min(iHeightH, iWidthH / iImageRatio) * iWidthH;
|
||||||
|
|
||||||
//Case vertical
|
//Case vertical
|
||||||
var iWidthV = Math.min(iMaxMediaWidth, iMediaWidth);
|
var iWidthV = Math.min(iMaxMediaWidth, iMediaWidth);
|
||||||
var iHeightV = Math.min(iWidthV / iImageRatio, iMaxMediaHeight - iDataMaxHeight);
|
var iHeightV = Math.min(iWidthV / iImageRatio, iMaxMediaHeight - iDataMaxHeight);
|
||||||
var iSurfaceV = Math.min(iWidthV, iHeightV * iImageRatio) * iHeightV;
|
var iSurfaceV = Math.min(iWidthV, iHeightV * iImageRatio) * iHeightV;
|
||||||
|
|
||||||
var sDirection = (iSurfaceV > iSurfaceH)?'vertical':'horizontal';
|
var sDirection = (iSurfaceV > iSurfaceH)?'vertical':'horizontal';
|
||||||
|
|
||||||
if(sDirection == 'vertical') iMaxMediaHeight -= iDataMaxHeight;
|
if(sDirection == 'vertical') iMaxMediaHeight -= iDataMaxHeight;
|
||||||
else iMaxMediaWidth -= iDataMaxWidth;
|
else iMaxMediaWidth -= iDataMaxWidth;
|
||||||
|
|
||||||
return {maxWidth: iMaxMediaWidth, maxHeight: iMaxMediaHeight, direction: sDirection};
|
return {maxWidth: iMaxMediaWidth, maxHeight: iMaxMediaHeight, direction: sDirection};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
updateHash('media', self.album[imageNumber].id);
|
||||||
|
|
||||||
if(self.options.hasVideo) {
|
if(self.options.hasVideo) {
|
||||||
var $lbContainer = this.$lightbox.find('.lb-container');
|
var $lbContainer = this.$lightbox.find('.lb-container');
|
||||||
var $hasVideoNav = $lbContainer.hasClass('lb-video-nav');
|
var $hasVideoNav = $lbContainer.hasClass('lb-video-nav');
|
||||||
|
|
||||||
if(self.album[imageNumber].video) {
|
if(self.album[imageNumber].type == 'video') {
|
||||||
this.$video.on('loadedmetadata', function(){
|
this.$video.on('loadedmetadata', function(){
|
||||||
var $This = $(this);
|
var $This = $(this);
|
||||||
|
|
||||||
var oMaxSizes = getMaxSizes(this.videoWidth, this.videoHeight, 'video');
|
var oMaxSizes = getMaxSizes(this.videoWidth, this.videoHeight, 'video');
|
||||||
maxVideoWidth = oMaxSizes.maxWidth;
|
maxVideoWidth = oMaxSizes.maxWidth;
|
||||||
maxVideoHeight = oMaxSizes.maxHeight;
|
maxVideoHeight = oMaxSizes.maxHeight;
|
||||||
@@ -394,7 +397,7 @@
|
|||||||
maxVideoWidth = self.options.maxWidth || this.videoWidth || maxVideoWidth;
|
maxVideoWidth = self.options.maxWidth || this.videoWidth || maxVideoWidth;
|
||||||
maxVideoHeight = self.options.maxHeight || this.videoHeight || maxVideoHeight;
|
maxVideoHeight = self.options.maxHeight || this.videoHeight || maxVideoHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Is the current image's width or height is greater than the maxImageWidth or maxImageHeight
|
//Is the current image's width or height is greater than the maxImageWidth or maxImageHeight
|
||||||
//option than we need to size down while maintaining the aspect ratio.
|
//option than we need to size down while maintaining the aspect ratio.
|
||||||
if((this.videoWidth > maxVideoWidth) || (this.videoHeight > maxVideoHeight)) {
|
if((this.videoWidth > maxVideoWidth) || (this.videoHeight > maxVideoHeight)) {
|
||||||
@@ -412,14 +415,14 @@
|
|||||||
}
|
}
|
||||||
$This.width(videoWidth);
|
$This.width(videoWidth);
|
||||||
$This.height(videoHeight);
|
$This.height(videoHeight);
|
||||||
|
|
||||||
self.sizeContainer($This.width(), $This.height(), 'video');
|
self.sizeContainer($This.width(), $This.height(), 'video');
|
||||||
$This.off('loadedmetadata');
|
$This.off('loadedmetadata');
|
||||||
});
|
});
|
||||||
|
|
||||||
this.currentImageIndex = imageNumber;
|
this.currentImageIndex = imageNumber;
|
||||||
this.$video.attr('src', self.album[imageNumber].link);
|
this.$video.attr('src', self.album[imageNumber].link);
|
||||||
|
|
||||||
if(!$hasVideoNav) $lbContainer.addClass('lb-video-nav');
|
if(!$hasVideoNav) $lbContainer.addClass('lb-video-nav');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -447,7 +450,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$preloader = $(preloader);
|
$preloader = $(preloader);
|
||||||
|
|
||||||
//ADDED-START
|
//ADDED-START
|
||||||
if(Math.abs(self.album[imageNumber].orientation) == 90) {
|
if(Math.abs(self.album[imageNumber].orientation) == 90) {
|
||||||
var sWidth = preloader.width;
|
var sWidth = preloader.width;
|
||||||
@@ -473,7 +476,7 @@
|
|||||||
maxImageHeight = oMaxSizes.maxHeight;
|
maxImageHeight = oMaxSizes.maxHeight;
|
||||||
self.$lightbox.removeClass('vertical horizontal').addClass(oMaxSizes.direction);
|
self.$lightbox.removeClass('vertical horizontal').addClass(oMaxSizes.direction);
|
||||||
//ADDED-END
|
//ADDED-END
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SVGs that don't have width and height attributes specified are reporting width and height
|
SVGs that don't have width and height attributes specified are reporting width and height
|
||||||
values of 0 in Firefox 47 and IE11 on Windows. To fix, we set the width and height to the max
|
values of 0 in Firefox 47 and IE11 on Windows. To fix, we set the width and height to the max
|
||||||
@@ -534,7 +537,7 @@
|
|||||||
// Stretch overlay to fit the viewport
|
// Stretch overlay to fit the viewport
|
||||||
Lightbox.prototype.sizeOverlay = function(e) {
|
Lightbox.prototype.sizeOverlay = function(e) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We use a setTimeout 0 to pause JS execution and let the rendering catch-up.
|
We use a setTimeout 0 to pause JS execution and let the rendering catch-up.
|
||||||
Why do this? If the `disableScrolling` option is set to true, a class is added to the body
|
Why do this? If the `disableScrolling` option is set to true, a class is added to the body
|
||||||
@@ -556,7 +559,7 @@
|
|||||||
}
|
}
|
||||||
//ADDED-END
|
//ADDED-END
|
||||||
};
|
};
|
||||||
|
|
||||||
// Animate the size of the lightbox to fit the image we are showing
|
// Animate the size of the lightbox to fit the image we are showing
|
||||||
// This method also shows the the image.
|
// This method also shows the the image.
|
||||||
//ADDED-START
|
//ADDED-START
|
||||||
@@ -575,7 +578,7 @@
|
|||||||
var newWidth = imageWidth + this.containerPadding.left + this.containerPadding.right + mediaBorderWidth.left + mediaBorderWidth.right;
|
var newWidth = imageWidth + this.containerPadding.left + this.containerPadding.right + mediaBorderWidth.left + mediaBorderWidth.right;
|
||||||
var newHeight = imageHeight + this.containerPadding.top + this.containerPadding.bottom + mediaBorderWidth.top + mediaBorderWidth.bottom;
|
var newHeight = imageHeight + this.containerPadding.top + this.containerPadding.bottom + mediaBorderWidth.top + mediaBorderWidth.bottom;
|
||||||
//ADDED-END
|
//ADDED-END
|
||||||
|
|
||||||
function postResize() {
|
function postResize() {
|
||||||
//ADDED-START
|
//ADDED-START
|
||||||
//self.$lightbox.find('.lb-dataContainer').width(newWidth);
|
//self.$lightbox.find('.lb-dataContainer').width(newWidth);
|
||||||
@@ -606,13 +609,13 @@
|
|||||||
// Display the image and its details and begin preload neighboring images.
|
// Display the image and its details and begin preload neighboring images.
|
||||||
Lightbox.prototype.showImage = function() {
|
Lightbox.prototype.showImage = function() {
|
||||||
this.$lightbox.find('.lb-loader').stop(true).hide();
|
this.$lightbox.find('.lb-loader').stop(true).hide();
|
||||||
|
|
||||||
//ADDED-START
|
//ADDED-START
|
||||||
//this.$lightbox.find('.lb-image').fadeIn(this.options.imageFadeDuration);
|
//this.$lightbox.find('.lb-image').fadeIn(this.options.imageFadeDuration);
|
||||||
if(this.options.hasVideo && this.album[this.currentImageIndex].video) this.$lightbox.find('.lb-video').fadeIn(this.options.imageFadeDuration);
|
if(this.options.hasVideo && this.album[this.currentImageIndex].type == 'video') this.$lightbox.find('.lb-video').fadeIn(this.options.imageFadeDuration);
|
||||||
else this.$lightbox.find('.lb-image').fadeIn(this.options.imageFadeDuration);
|
else this.$lightbox.find('.lb-image').fadeIn(this.options.imageFadeDuration);
|
||||||
//ADDED-END
|
//ADDED-END
|
||||||
|
|
||||||
this.updateNav();
|
this.updateNav();
|
||||||
this.updateDetails();
|
this.updateDetails();
|
||||||
this.preloadNeighboringImages();
|
this.preloadNeighboringImages();
|
||||||
@@ -743,17 +746,18 @@
|
|||||||
// Closing time. :-(
|
// Closing time. :-(
|
||||||
Lightbox.prototype.end = function() {
|
Lightbox.prototype.end = function() {
|
||||||
this.disableKeyboardNav();
|
this.disableKeyboardNav();
|
||||||
|
|
||||||
//ADDED-START
|
//ADDED-START
|
||||||
if(this.options.hasVideo) {
|
if(this.options.hasVideo) {
|
||||||
var $lbContainer = this.$lightbox.find('.lb-container');
|
var $lbContainer = this.$lightbox.find('.lb-container');
|
||||||
var $hasVideoNav = $lbContainer.hasClass('lb-video-nav');
|
var $hasVideoNav = $lbContainer.hasClass('lb-video-nav');
|
||||||
this.$video.attr('src', '');
|
this.$video.attr('src', '');
|
||||||
|
|
||||||
if($hasVideoNav) $lbContainer.removeClass('lb-video-nav');
|
if($hasVideoNav) $lbContainer.removeClass('lb-video-nav');
|
||||||
}
|
}
|
||||||
|
flushHash();
|
||||||
//ADDED-END
|
//ADDED-END
|
||||||
|
|
||||||
$(window).off('resize', this.sizeOverlay);
|
$(window).off('resize', this.sizeOverlay);
|
||||||
this.$nav.off('mousewheel');
|
this.$nav.off('mousewheel');
|
||||||
this.$lightbox.fadeOut(this.options.fadeDuration);
|
this.$lightbox.fadeOut(this.options.fadeDuration);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ $fa-css-prefix: fa;
|
|||||||
|
|
||||||
.fa {
|
.fa {
|
||||||
@extend .fas;
|
@extend .fas;
|
||||||
|
|
||||||
&.push {
|
&.push {
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5rem;
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ $fa-css-prefix: fa;
|
|||||||
color: #CCC;
|
color: #CCC;
|
||||||
background: none;
|
background: none;
|
||||||
@extend .fa;
|
@extend .fa;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ $fa-css-prefix: fa;
|
|||||||
.#{$fa-css-prefix}-time:before { content: fa-content($fa-var-clock); }
|
.#{$fa-css-prefix}-time:before { content: fa-content($fa-var-clock); }
|
||||||
.#{$fa-css-prefix}-coords:before { content: fa-content($fa-var-compass); }
|
.#{$fa-css-prefix}-coords:before { content: fa-content($fa-var-compass); }
|
||||||
.#{$fa-css-prefix}-drill-video:before { content: fa-content($fa-var-play-circle); }
|
.#{$fa-css-prefix}-drill-video:before { content: fa-content($fa-var-play-circle); }
|
||||||
.#{$fa-css-prefix}-drill-picture:before { content: fa-content($fa-var-search); }
|
.#{$fa-css-prefix}-drill-image:before { content: fa-content($fa-var-search); }
|
||||||
.#{$fa-css-prefix}-drill-message:before { content: fa-content($fa-var-search-location); }
|
.#{$fa-css-prefix}-drill-message:before { content: fa-content($fa-var-search-location); }
|
||||||
.#{$fa-css-prefix}-upload:before { content: fa-content($fa-var-cloud-upload); }
|
.#{$fa-css-prefix}-upload:before { content: fa-content($fa-var-cloud-upload); }
|
||||||
.#{$fa-css-prefix}-video-shot:before { content: fa-content($fa-var-camcorder); }
|
.#{$fa-css-prefix}-video-shot:before { content: fa-content($fa-var-camcorder); }
|
||||||
|
|||||||
@@ -292,18 +292,24 @@ $legend-color: $post-color;
|
|||||||
}
|
}
|
||||||
|
|
||||||
#poster {
|
#poster {
|
||||||
textarea#post {
|
display: inline-block;
|
||||||
margin-bottom: 1em;
|
|
||||||
width: calc(100% - 2em);
|
|
||||||
}
|
|
||||||
|
|
||||||
input#name {
|
.post-item {
|
||||||
width: calc(100% - 6em);
|
margin-bottom: 0;
|
||||||
}
|
|
||||||
|
|
||||||
button#submit {
|
textarea#post {
|
||||||
margin-left: 1em;
|
margin-bottom: 1em;
|
||||||
margin-bottom: 0.5em;
|
width: calc(100% - 2em);
|
||||||
|
}
|
||||||
|
|
||||||
|
input#name {
|
||||||
|
width: calc(100% - 6em);
|
||||||
|
}
|
||||||
|
|
||||||
|
button#submit {
|
||||||
|
margin-left: 1em;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,7 +443,7 @@ $legend-color: $post-color;
|
|||||||
|
|
||||||
&.drill {
|
&.drill {
|
||||||
&:hover {
|
&:hover {
|
||||||
.drill-icon .fa-drill-picture, .drill-icon .fa-drill-video {
|
.drill-icon .fa-drill-image, .drill-icon .fa-drill-video {
|
||||||
color: rgba($media-bg, 0.75);
|
color: rgba($media-bg, 0.75);
|
||||||
}
|
}
|
||||||
.comment {
|
.comment {
|
||||||
@@ -448,7 +454,7 @@ $legend-color: $post-color;
|
|||||||
.drill-icon {
|
.drill-icon {
|
||||||
font-size: 3em;
|
font-size: 3em;
|
||||||
|
|
||||||
.fa-drill-picture {
|
.fa-drill-image {
|
||||||
color: transparent;
|
color: transparent;
|
||||||
}
|
}
|
||||||
.fa-drill-video {
|
.fa-drill-video {
|
||||||
@@ -689,7 +695,7 @@ $legend-color: $post-color;
|
|||||||
&.drill {
|
&.drill {
|
||||||
font-size: 2em;
|
font-size: 2em;
|
||||||
|
|
||||||
.fa-drill-picture {
|
.fa-drill-image {
|
||||||
color: transparent;
|
color: transparent;
|
||||||
}
|
}
|
||||||
.fa-drill-video {
|
.fa-drill-video {
|
||||||
@@ -697,7 +703,7 @@ $legend-color: $post-color;
|
|||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
.fa-drill-video, .fa-drill-picture {
|
.fa-drill-video, .fa-drill-image {
|
||||||
color: rgba(255, 255, 255, 0.75);
|
color: rgba(255, 255, 255, 0.75);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,6 @@
|
|||||||
display: block;
|
display: block;
|
||||||
height: 100%; /* Required for horizontal native scrollbar to not appear if parent is taller than natural height */
|
height: 100%; /* Required for horizontal native scrollbar to not appear if parent is taller than natural height */
|
||||||
width: auto;
|
width: auto;
|
||||||
visibility: visible;
|
|
||||||
max-width: 100%; /* Not required for horizontal scroll to trigger */
|
max-width: 100%; /* Not required for horizontal scroll to trigger */
|
||||||
max-height: 100%; /* Needed for vertical scroll to trigger */
|
max-height: 100%; /* Needed for vertical scroll to trigger */
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
@@ -132,8 +131,8 @@
|
|||||||
|
|
||||||
.simplebar-scrollbar {
|
.simplebar-scrollbar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 2px;
|
left: 0;
|
||||||
width: 7px;
|
right: 0;
|
||||||
min-height: 10px;
|
min-height: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,8 +141,8 @@
|
|||||||
content: '';
|
content: '';
|
||||||
background: black;
|
background: black;
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
left: 0;
|
left: 2px;
|
||||||
right: 0;
|
right: 2px;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 0.2s linear;
|
transition: opacity 0.2s linear;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user