pictures table
This commit is contained in:
@@ -69,14 +69,15 @@ function initProject(sProjectCodeName){
|
||||
self.tmp('first_exec', false);
|
||||
self.vars('project', self.vars(['projects', sProjectCodeName]));
|
||||
|
||||
//Spot Messages
|
||||
$.when(
|
||||
//Markers: Spot Messages & Pictures
|
||||
self.get(
|
||||
'messages',
|
||||
'markers',
|
||||
function(){},
|
||||
{project_id: self.vars(['project', 'id'])},
|
||||
function(e){console.log(e);}
|
||||
),
|
||||
//Project Geojson: Hike track
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
url: self.vars(['project', 'geofile']),
|
||||
@@ -100,6 +101,8 @@ function initPosts() {
|
||||
relative_time: 'Nouveau message'
|
||||
};
|
||||
getPost(asPoster).appendTo($Poster.show());
|
||||
|
||||
autosize($('#post'));
|
||||
|
||||
$('#submit').click(function(){
|
||||
if($Poster.checkForm())
|
||||
@@ -167,7 +170,7 @@ function initSpotMessages(aoMessages, aoTracks) {
|
||||
}).addTo(oMap);
|
||||
|
||||
//Centering map
|
||||
if(self.vars(['project', 'mode'])==self.consts.modes.blog)
|
||||
if(self.vars(['project', 'mode'])==self.consts.modes.blog && aoMessages.length > 0)
|
||||
{
|
||||
//Zoom on last message
|
||||
var oLastMsg = aoMessages[aoMessages.length-1];
|
||||
@@ -233,7 +236,7 @@ function initSpotMessages(aoMessages, aoTracks) {
|
||||
if(oMsg.pics) {
|
||||
var $Pics = $('<div>', {'class':'pics'});
|
||||
$.each(oMsg.pics, function(iKey, asPic){
|
||||
$Pics.append($('<a>', {href: asPic.path, 'data-lightbox': self.consts.title, 'data-title': asPic.formatted_time})
|
||||
$Pics.append($('<a>', {href: asPic.pic_path, 'data-lightbox': self.consts.title, 'data-title': asPic.formatted_time})
|
||||
.append($('<img>', {'src': asPic.thumb_path})));
|
||||
});
|
||||
$Tooltip
|
||||
@@ -385,7 +388,7 @@ function getPost(asPost) {
|
||||
break;
|
||||
case 'picture':
|
||||
var $Image = $('<img>', {'src': asPost.thumb_path/*, 'style':'transform:rotate('+asPost.rotate+'deg);'*/});
|
||||
$Body = $('<a>', {href: asPost.path, 'data-lightbox': self.consts.title, 'data-title': sAbsTime}).append($Image);
|
||||
$Body = $('<a>', {href: asPost.pic_path, 'data-lightbox': self.consts.title, 'data-title': 'Photo ajouté le '+sAbsTime+' (prise le '+asPost.taken_on_formatted+')'}).append($Image);
|
||||
break;
|
||||
case 'post':
|
||||
$Body = $('<div>')
|
||||
@@ -394,7 +397,7 @@ function getPost(asPost) {
|
||||
break;
|
||||
case 'poster':
|
||||
$Body = $('<p>', {'class':'message'})
|
||||
.append($('<input>', {type:'text', id:'post', name:'post', placeholder:'Message'}))
|
||||
.append($('<textarea>', {id:'post', name:'post', placeholder:'Message', 'class':'autoExpand', rows:'1'}))
|
||||
.append($('<input>', {type:'text', id:'name', name:'name', placeholder:'Nom'}))
|
||||
.append($('<button>', {type:'button', id:'submit', name:'submit'}).addIcon('fa-send'));
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user