| Line 27... |
Line 27... |
| 27 |
'erreur-chargement' : 'Erreur lors du chargement de l\'observation',
|
27 |
'erreur-chargement' : 'Erreur lors du chargement de l\'observation',
|
| 28 |
'erreur-chargement-obs-utilisateur' : 'Erreur lors du chargement des observations de cet utilisateur',
|
28 |
'erreur-chargement-obs-utilisateur' : 'Erreur lors du chargement des observations de cet utilisateur',
|
| 29 |
'erreur-formulaire' : 'Erreur: impossible de charger le formulaire',
|
29 |
'erreur-formulaire' : 'Erreur: impossible de charger le formulaire',
|
| 30 |
'lieu-obs' : 'observé à',
|
30 |
'lieu-obs' : 'observé à',
|
| 31 |
'lieu-dit' : 'Lieu-dit',
|
31 |
'lieu-dit' : 'Lieu-dit',
|
| 32 |
'taxon-ou-image' : 'Veuillez transmettre au moins, soit une image, soit une espèce',
|
32 |
'taxon-ou-image' : 'Veuillez transmettre au moins, soit une image, soit une espèce',
|
| 33 |
'station' : 'Station',
|
33 |
'station' : 'Station',
|
| 34 |
'date-rue' : 'Un releve existe dejà à cette date pour cette rue.',
|
34 |
'date-rue' : 'Un releve existe dejà à cette date pour cette rue.',
|
| 35 |
'rechargement-page' : 'Êtes vous sûr de vouloir quiter la page?\nLes observations saisies mais non transmises seront perdues.',
|
35 |
'rechargement-page' : 'Êtes vous sûr de vouloir quiter la page?\nLes observations saisies mais non transmises seront perdues.',
|
| 36 |
'courriel-connu' : 'Un compte existe pour ce courriel, connectez-vous pour saisir votre observation'
|
36 |
'courriel-connu' : 'Un compte existe pour ce courriel, connectez-vous pour saisir votre observation'
|
| 37 |
},
|
37 |
},
|
| Line 211... |
Line 211... |
| 211 |
// Due to how HTML5 defines its semantics,
|
211 |
// Due to how HTML5 defines its semantics,
|
| 212 |
// the autofocus HTML attribute has no effect in Bootstrap modals.
|
212 |
// the autofocus HTML attribute has no effect in Bootstrap modals.
|
| 213 |
// To achieve the same effect, use some custom JavaScript
|
213 |
// To achieve the same effect, use some custom JavaScript
|
| 214 |
$( '#fenetre-modal' ).off( 'shown.bs.modal' ).on( 'shown.bs.modal' , function () {
|
214 |
$( '#fenetre-modal' ).off( 'shown.bs.modal' ).on( 'shown.bs.modal' , function () {
|
| 215 |
$( '#myInput' ).trigger( 'focus' );
|
215 |
$( '#myInput' ).trigger( 'focus' );
|
| 216 |
if( lthis.valOk( $( '#modale-aide-img' ) ) ) {
|
216 |
if( valOk( $( '#modale-aide-img' ) ) ) {
|
| 217 |
lthis.redimentionnerImgAide();
|
217 |
lthis.redimentionnerImgAide();
|
| 218 |
$( window ).on( 'resize', lthis.redimentionnerImgAide.bind( lthis ) );
|
218 |
$( window ).on( 'resize', lthis.redimentionnerImgAide.bind( lthis ) );
|
| 219 |
}
|
219 |
}
|
| 220 |
});
|
220 |
});
|
| 221 |
if ( this.valOk( buttons ) ) {
|
221 |
if ( valOk( buttons ) ) {
|
| 222 |
buttonsHtml = '';
|
222 |
buttonsHtml = '';
|
| 223 |
$.each( buttons, function( i, button ) {
|
223 |
$.each( buttons, function( i, button ) {
|
| 224 |
dismiss = button.dismiss ? 'data-dismiss="modal"' : '';
|
224 |
dismiss = button.dismiss ? 'data-dismiss="modal"' : '';
|
| 225 |
buttonsHtml += '<button type="button" class="btn ' + button.class + '" ' + dismiss + '>' + button.label + '</button>';
|
225 |
buttonsHtml += '<button type="button" class="btn ' + button.class + '" ' + dismiss + '>' + button.label + '</button>';
|
| 226 |
});
|
226 |
});
|
| Line 234... |
Line 234... |
| 234 |
});
|
234 |
});
|
| 235 |
};
|
235 |
};
|
| Line 236... |
Line 236... |
| 236 |
|
236 |
|
| 237 |
Utils.prototype.redimentionnerImgAide = function() {
|
237 |
Utils.prototype.redimentionnerImgAide = function() {
|
| 238 |
const espHorizDisp = $( '.modal-dialog' ).innerWidth() <= 1200 ? $( '.modal-dialog' ).innerWidth() - 30 : 1200,
|
238 |
const espHorizDisp = $( '.modal-dialog' ).innerWidth() <= 1200 ? $( '.modal-dialog' ).innerWidth() - 30 : 1200,
|
| 239 |
cssImg = {
|
239 |
cssImg = {
|
| 240 |
'width': espHorizDisp,
|
240 |
'width': espHorizDisp,
|
| 241 |
'height' : 'auto'
|
241 |
'height' : 'auto'
|
| Line 242... |
Line 242... |
| 242 |
};
|
242 |
};
|
| 243 |
|
243 |
|
| Line 244... |
Line 244... |
| 244 |
$( '#modale-aide-img' ).css(cssImg).show(50);
|
244 |
$( '#modale-aide-img' ).css(cssImg).show(50);
|
| Line 288... |
Line 288... |
| 288 |
if( $( this ).hasClass( 'is-select' ) ) {
|
288 |
if( $( this ).hasClass( 'is-select' ) ) {
|
| 289 |
dataName = $( this ).data( 'name' );
|
289 |
dataName = $( this ).data( 'name' );
|
| 290 |
otherId = PREFIX + dataName;
|
290 |
otherId = PREFIX + dataName;
|
| 291 |
dataLabel = $( '.select' ).data( 'label' );
|
291 |
dataLabel = $( '.select' ).data( 'label' );
|
| 292 |
// Insertion du champ "Autre" après les boutons
|
292 |
// Insertion du champ "Autre" après les boutons
|
| 293 |
if ( !lthis.valOk( $( '#'+otherId ) ) ) {
|
293 |
if ( !valOk( $( '#'+otherId ) ) ) {
|
| 294 |
optionAdd( otherId, $( this ).parent( '.add-field-select' ), 'select', dataName, dataLabel );
|
294 |
optionAdd( otherId, $( this ).parent( '.add-field-select' ), 'select', dataName, dataLabel );
|
| 295 |
}
|
295 |
}
|
| 296 |
} else if ( $( this ).is( ':checked' ) ) {
|
296 |
} else if ( $( this ).is( ':checked' ) ) {
|
| 297 |
dataName = $( this ).data( 'name' );
|
297 |
dataName = $( this ).data( 'name' );
|
| 298 |
otherId = PREFIX + dataName;
|
298 |
otherId = PREFIX + dataName;
|
| 299 |
dataLabel = $( this ).data( 'label' );
|
299 |
dataLabel = $( this ).data( 'label' );
|
| 300 |
element = $( this ).data( 'element' );
|
300 |
element = $( this ).data( 'element' );
|
| 301 |
// Insertion du champ "Autre" après les boutons
|
301 |
// Insertion du champ "Autre" après les boutons
|
| 302 |
if ( !lthis.valOk( $( '#'+ otherId ) ) ) {
|
302 |
if ( !valOk( $( '#'+ otherId ) ) ) {
|
| 303 |
optionAdd( otherId, $( this ).parent( 'label' ), element, dataName, dataLabel );
|
303 |
optionAdd( otherId, $( this ).parent( 'label' ), element, dataName, dataLabel );
|
| 304 |
}
|
304 |
}
|
| 305 |
}
|
305 |
}
|
| 306 |
});
|
306 |
});
|
| Line 309... |
Line 309... |
| 309 |
dataName = $( this ).data( 'name' );
|
309 |
dataName = $( this ).data( 'name' );
|
| 310 |
otherId = PREFIX + dataName;
|
310 |
otherId = PREFIX + dataName;
|
| 311 |
dataLabel = $( this ).data( 'label' );
|
311 |
dataLabel = $( this ).data( 'label' );
|
| 312 |
if( 'other' === $( this ).val() ) {
|
312 |
if( 'other' === $( this ).val() ) {
|
| 313 |
// Insertion du champ "Autre" après les boutons
|
313 |
// Insertion du champ "Autre" après les boutons
|
| 314 |
if ( !lthis.valOk( $( '#'+otherId ) ) ) {
|
314 |
if ( !valOk( $( '#'+otherId ) ) ) {
|
| 315 |
optionAdd( otherId, $( this ).parent( '.add-field-select' ), 'select', dataName, dataLabel );
|
315 |
optionAdd( otherId, $( this ).parent( '.add-field-select' ), 'select', dataName, dataLabel );
|
| 316 |
}
|
316 |
}
|
| 317 |
} else {
|
317 |
} else {
|
| 318 |
// Suppression du champ autre
|
318 |
// Suppression du champ autre
|
| 319 |
optionRemove( otherId );
|
319 |
optionRemove( otherId );
|
| Line 325... |
Line 325... |
| 325 |
dataName = $( this ).data( 'name' );
|
325 |
dataName = $( this ).data( 'name' );
|
| 326 |
otherId = PREFIX + dataName;
|
326 |
otherId = PREFIX + dataName;
|
| 327 |
dataLabel = $( this ).data( 'label' );
|
327 |
dataLabel = $( this ).data( 'label' );
|
| 328 |
if( 'other' === $( this ).val() ) {
|
328 |
if( 'other' === $( this ).val() ) {
|
| 329 |
// Insertion du champ "Autre" après les boutons
|
329 |
// Insertion du champ "Autre" après les boutons
|
| 330 |
if ( !lthis.valOk( $( '#'+otherId ) ) ) {
|
330 |
if ( !valOk( $( '#'+otherId ) ) ) {
|
| 331 |
optionAdd( otherId, $( this ).parent( 'label' ), 'radio', dataName, dataLabel );
|
331 |
optionAdd( otherId, $( this ).parent( 'label' ), 'radio', dataName, dataLabel );
|
| 332 |
}
|
332 |
}
|
| 333 |
} else {
|
333 |
} else {
|
| 334 |
// Suppression du champ autre
|
334 |
// Suppression du champ autre
|
| 335 |
optionRemove( otherId );
|
335 |
optionRemove( otherId );
|
| Line 342... |
Line 342... |
| 342 |
otherId = PREFIX + dataName;
|
342 |
otherId = PREFIX + dataName;
|
| 343 |
dataLabel = $( this ).data( 'label' );
|
343 |
dataLabel = $( this ).data( 'label' );
|
| 344 |
element = $( this ).data( 'element' );
|
344 |
element = $( this ).data( 'element' );
|
| 345 |
if( $( this ).is( ':checked' ) ) {
|
345 |
if( $( this ).is( ':checked' ) ) {
|
| 346 |
// Insertion du champ "Autre" après les boutons
|
346 |
// Insertion du champ "Autre" après les boutons
|
| 347 |
if ( !lthis.valOk( $( '#'+otherId ) ) ) {
|
347 |
if ( !valOk( $( '#'+otherId ) ) ) {
|
| 348 |
optionAdd( otherId, $( this ).parent( 'label' ), element, dataName, dataLabel );
|
348 |
optionAdd( otherId, $( this ).parent( 'label' ), element, dataName, dataLabel );
|
| 349 |
}
|
349 |
}
|
| 350 |
} else {
|
350 |
} else {
|
| 351 |
// Suppression du champ autre
|
351 |
// Suppression du champ autre
|
| 352 |
optionRemove( otherId );
|
352 |
optionRemove( otherId );
|