Subversion Repositories eFlore/Applications.cel

Rev

Rev 3285 | Rev 3290 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3285 Rev 3287
Line 1... Line 1...
1
/**
1
/**
2
 * Constructeur WidgetSaisie par défaut
2
 * Constructeur WidgetSaisie par défaut
3
 */
3
 */
4
function WidgetSaisie() {
4
function WidgetSaisie() {
-
 
5
	this.urlBaseAuth = window.location.origin + '/service:annuaire:auth';
-
 
6
	this.mode = 'prod';
5
	this.langue = 'fr';
7
	this.langue = 'fr';
6
	this.obsNbre = 0;
8
	this.obsNbre = 0;
7
	this.nbObsEnCours = 1;
9
	this.nbObsEnCours = 1;
8
	this.totalObsATransmettre = 0;
10
	this.totalObsATransmettre = 0;
9
	this.nbObsTransmises = 0;
11
	this.nbObsTransmises = 0;
Line 28... Line 30...
28
	this.obsMaxNbre = null;
30
	this.obsMaxNbre = null;
29
	this.dureeMessage = null;
31
	this.dureeMessage = null;
30
	this.serviceAnnuaireIdUrl = null;
32
	this.serviceAnnuaireIdUrl = null;
31
	this.serviceNomCommuneUrl = null;
33
	this.serviceNomCommuneUrl = null;
32
	this.serviceNomCommuneUrlAlt = null;
34
	this.serviceNomCommuneUrlAlt = null;
33
	this.chargementIconeUrl = null;
-
 
34
	this.chargementImageIconeUrl = null;
35
	this.chargementImageIconeUrl = null;
35
	this.calendrierIconeUrl = null;
-
 
36
	this.pasDePhotoIconeUrl = null;
36
	this.pasDePhotoIconeUrl = null;
37
	this.observer = null;
37
	this.observer = null;
Line 38... Line 38...
38
 
38
 
39
	// système de traduction minimaliste
39
	// système de traduction minimaliste
Line 87... Line 87...
87
 * Initialisation du widget
87
 * Initialisation du widget
88
 */
88
 */
89
WidgetSaisie.prototype.init = function() {
89
WidgetSaisie.prototype.init = function() {
90
	this.initForm();
90
	this.initForm();
91
	this.initEvts();
91
	this.initEvts();
92
	// Auth.js s'en occuppe
-
 
93
	if ( '' === $( '#nom-complet').text() && valeurOk ( $( '#courriel' ).val() ) ) {
-
 
94
		this.requeterIdentite();
-
 
95
	}
-
 
96
};
92
};
Line 97... Line 93...
97
 
93
 
98
/**
94
/**
99
 * Initialise le formulaire, les validateurs, les listes de complétion...
95
 * Initialise le formulaire, les validateurs, les listes de complétion...
100
 */
96
 */
Line 101... Line 97...
101
WidgetSaisie.prototype.initForm = function() {
97
WidgetSaisie.prototype.initForm = function() {
-
 
98
 
-
 
99
	var lthis = this;
-
 
100
 
102
 
101
	this.chargerStatutSSO();
103
	var lthis = this;
102
 
104
	if ( valeurOk( this.obsId ) ) {
103
	if ( valeurOk( this.obsId ) ) {
Line 105... Line 104...
105
		this.chargerInfoObs();
104
		this.chargerInfoObs();
Line 124... Line 123...
124
	});
123
	});
125
	this.configurerFormValidator();
124
	this.configurerFormValidator();
126
	this.definirReglesFormValidator();
125
	this.definirReglesFormValidator();
Line 127... Line 126...
127
 
126
 
128
	if( this.especeImposee ) {
127
	if( this.especeImposee ) {
129
	  $( '#taxon' ).attr( 'disabled', 'disabled' );
128
		$( '#taxon' ).attr( 'disabled', 'disabled' );
130
	  $( '#taxon-input-groupe' ).attr( 'title', '' );
129
		$( '#taxon-input-groupe' ).attr( 'title', '' );
131
	  // Bricolage cracra pour avoir le nom retenu avec auteur (nom_retenu.libelle ne le mentionne pas)
130
		// Bricolage cracra pour avoir le nom retenu avec auteur (nom_retenu.libelle ne le mentionne pas)
132
	  var infosEspeceImposee = $.parseJSON( this.infosEspeceImposee );
131
		var infosEspeceImposee = $.parseJSON( this.infosEspeceImposee );
133
	  var nomRetenuComplet = infosEspeceImposee.nom_retenu_complet,
132
			nomRetenuComplet   = infosEspeceImposee.nom_retenu_complet,
134
	    debutAnneRefBiblio = nomRetenuComplet.indexOf( ' [' );
133
			debutAnneRefBiblio = nomRetenuComplet.indexOf( ' [' );
135
	  if ( -1 !== debutAnneRefBiblio ) {
134
		if ( -1 !== debutAnneRefBiblio ) {
136
	    nomRetenuComplet = nomRetenuComplet.substr( 0, debutAnneRefBiblio );
135
			nomRetenuComplet = nomRetenuComplet.substr( 0, debutAnneRefBiblio );
137
	  }
136
		}
138
	  // fin bricolage cracra
137
		// fin bricolage cracra
139
	  var infosAssociee = {
138
		var infosAssociee = {
140
	    label : infosEspeceImposee.nom_sci_complet,
139
			label : infosEspeceImposee.nom_sci_complet,
141
	    value : infosEspeceImposee.nom_sci_complet,
140
			value : infosEspeceImposee.nom_sci_complet,
142
	    nt : infosEspeceImposee.num_taxonomique,
141
			nt : infosEspeceImposee.num_taxonomique,
143
	    nomSel : infosEspeceImposee.nom_sci,
142
			nomSel : infosEspeceImposee.nom_sci,
144
	    nomSelComplet : infosEspeceImposee.nom_sci_complet,
143
			nomSelComplet : infosEspeceImposee.nom_sci_complet,
145
	    numNomSel : infosEspeceImposee.id,
144
			numNomSel : infosEspeceImposee.id,
146
	    nomRet : nomRetenuComplet,
145
			nomRet : nomRetenuComplet,
147
	    numNomRet : infosEspeceImposee['nom_retenu.id'],
146
			numNomRet : infosEspeceImposee['nom_retenu.id'],
148
	    famille : infosEspeceImposee.famille,
147
			famille : infosEspeceImposee.famille,
149
	    retenu : ( 'false' === infosEspeceImposee.retenu ) ? false : true
148
			retenu : ( 'false' === infosEspeceImposee.retenu ) ? false : true
150
	  };
149
		};
151
	  $( '#taxon' ).data( infosAssociee );
150
		$( '#taxon' ).data( infosAssociee );
152
	}
151
	}
Line 153... Line 152...
153
};
152
};
154
 
153
 
155
/**
154
/**
156
 * Initialise les écouteurs d'événements
155
 * Initialise les écouteurs d'événements
157
 */
156
 */
158
WidgetSaisie.prototype.initEvts = function() {
-
 
-
 
157
WidgetSaisie.prototype.initEvts = function() {
159
	var lthis = this;
158
	var lthis = this;
160
 
159
	// Empêcher que le module carto ne bind ses events partout
161
	$( '#tb-geolocation' ).on( 'submit blur click focus mousedown mouseleave mouseup touchend touchstart change', '.mat-icon-button', function( event ) {
160
	$( '#tb-geolocation' ).on( 'submit blur click focus mousedown mouseleave mouseup touchend touchstart change', '.mat-icon-button', function( event ) {
162
		event.preventDefault();
161
		event.preventDefault();
-
 
162
		return false;
-
 
163
	});
163
		return false;
164
 
-
 
165
 
-
 
166
	// identité
-
 
167
	$( '#deconnexion a' ).click( function( event ) {
-
 
168
		event.preventDefault();
164
	});
169
		lthis.deconnecterUtilisateur();
165
	// identité
170
	});
166
	$( '#bouton-anonyme' ).on( 'click', function( event ) {
171
	$( '#bouton-anonyme' ).on( 'click', function( event ) {
167
		arreter( event );
172
		arreter( event );
168
		$( this ).css({
173
		$( this ).css({
169
			'background-color': 'rgba(0, 159, 184, 0.7)',
174
			'background-color': 'rgba(0, 159, 184, 0.7)',
170
			'color': '#fff'
175
			'color': '#fff'
171
		});
176
		});
172
		$( '#anonyme' ).removeClass( 'hidden' );
177
		$( '#anonyme' ).removeClass( 'hidden' );
173
		$( '#courriel' ).focus();
178
		$( '#courriel' ).focus();
174
	});
179
	});
175
	if ( '' === $( '#nom-complet').text() ) {
180
	if ( '' === $( '#nom-complet').text() ) {
176
		$( '#courriel' ).on( 'blur', this.requeterIdentite.bind( this ) );
181
		$( '#courriel' ).on( 'blur', this.requeterIdentiteCourriel.bind( this ) );
177
		$( '#courriel' ).on( 'keypress', this.testerLancementRequeteIdentite.bind( this ) );
182
		$( '#courriel' ).on( 'keypress', this.testerLancementRequeteIdentite.bind( this ) );
178
	}
183
	}
179
	$( '#prenom' ).on( 'change', this.formaterPrenom );
184
	$( '#prenom' ).on( 'change', this.formaterPrenom );
Line 230... Line 235...
230
	$( '#btn-aide' ).on( 'click', this.basculerAffichageAide );
235
	$( '#btn-aide' ).on( 'click', this.basculerAffichageAide );
231
	$( '.has-tooltip' ).tooltip( 'enable' );
236
	$( '.has-tooltip' ).tooltip( 'enable' );
232
};
237
};
Line 233... Line 238...
233
 
238
 
-
 
239
// Identité Observateur *******************************************************/
-
 
240
/**
-
 
241
 * Interroge le SSO pour connaître le statut de l'utilisateur, et change le menu
-
 
242
 * à droite de la barre en fonction
-
 
243
 */
-
 
244
WidgetSaisie.prototype.chargerStatutSSO = function() {
-
 
245
	$( '#form-observateur' )[0].reset();
-
 
246
	var lthis = this;
-
 
247
 
-
 
248
	var urlAuth = this.urlBaseAuth + '/identite';
-
 
249
 
-
 
250
	if( 'local' !== this.mode ) {
-
 
251
		this.connexion( urlAuth, true );
-
 
252
	} else {
-
 
253
		urlAuth = window.location.origin + '/widget:cel:modules/saisie2/test-token.json';
-
 
254
		$( '#connexion' ).click( function( event ) {
-
 
255
			event.preventDefault();
-
 
256
			lthis.connexion( urlAuth, true );
-
 
257
		});
-
 
258
	}
-
 
259
};
-
 
260
 
-
 
261
/**
-
 
262
 * Déconnecte l'utilisateur du SSO
-
 
263
 */
-
 
264
WidgetSaisie.prototype.deconnecterUtilisateur = function() {
-
 
265
  if( 'local' === this.mode ) {
-
 
266
	this.definirUtilisateur();
-
 
267
	window.location.reload();
-
 
268
	return;
-
 
269
  }
-
 
270
 
-
 
271
  var urlAuth = this.urlBaseAuth + '/deconnexion';
-
 
272
 
-
 
273
  this.connexion( urlAuth, false );
-
 
274
};
-
 
275
 
-
 
276
WidgetSaisie.prototype.connexion = function( urlAuth, connexionOnOff ) {
-
 
277
	var lthis = this;
-
 
278
	console.log(urlAuth);
-
 
279
  $.ajax({
-
 
280
	url: urlAuth,
-
 
281
	type: "GET",
-
 
282
	dataType: 'json',
-
 
283
	xhrFields: {
-
 
284
	  withCredentials: true
-
 
285
	}
-
 
286
  })
-
 
287
  .done( function( data ) {
-
 
288
	if( connexionOnOff ) {
-
 
289
	  // connecté
-
 
290
	  lthis.definirUtilisateur( data.token );
-
 
291
	} else {
-
 
292
	  lthis.definirUtilisateur();
-
 
293
	  window.location.reload();
-
 
294
	}
-
 
295
  })
-
 
296
  .fail( function( error ) {
-
 
297
	// @TODO gérer l'affichage de l'erreur, mais pas facile à placer
-
 
298
	// dans l'interface actuelle sans que ce soit moche
-
 
299
	//afficherErreurServeur();
-
 
300
  });
-
 
301
}
-
 
302
 
-
 
303
WidgetSaisie.prototype.definirUtilisateur = function( jeton ) {
-
 
304
  var idUtilisateur = '',
-
 
305
	  nomComplet    = '',
-
 
306
	  courriel      = '',
-
 
307
	  pseudo        = '',
-
 
308
	  prenom        = '',
-
 
309
	  nom           = '';
-
 
310
 
-
 
311
  // affichage
-
 
312
  if ( undefined !== jeton ) {
-
 
313
	// décodage jeton
-
 
314
	var jetonDecode = this.decoderJeton( jeton );
-
 
315
	// console.log(jetonDecode);
-
 
316
 
-
 
317
	idUtilisateur = jetonDecode.id;
-
 
318
	nomComplet    = jetonDecode.intitule;
-
 
319
	courriel      = jetonDecode.sub;
-
 
320
	pseudo        = jetonDecode.pseudo;
-
 
321
	prenom        = jetonDecode.prenom;
-
 
322
	nom           = jetonDecode.nom;
-
 
323
	$( '#courriel, #courriel_confirmation' ).attr( 'disabled', 'disabled' );
-
 
324
	$( '#prenom' ).attr( 'disabled', 'disabled' );
-
 
325
	$( '#nom' ).attr( 'disabled', 'disabled' );
-
 
326
	$( '#bouton-connexion, #creation-compte' ).addClass( 'hidden' );
-
 
327
	$( '#utilisateur-connecte, #anonyme, #zone-courriel-confirmation, #zone-prenom-nom' ).removeClass( 'hidden' );
-
 
328
	$( '#date-releve' ).focus();
-
 
329
  }
-
 
330
  $( '.warning' ).remove();
-
 
331
  $( '#nom-complet' ).html( nomComplet );
-
 
332
  $( '#courriel, #courriel_confirmation' ).val( courriel );
-
 
333
  $( '#profil-utilisateur a' ).attr( 'href', this.urlProfilUtilisateur( pseudo ) );
-
 
334
  $( '#id_utilisateur' ).val( idUtilisateur );
-
 
335
  $( '#prenom' ).val( prenom );
-
 
336
  $( '#nom' ).val( nom );
-
 
337
};
-
 
338
 
-
 
339
/**
-
 
340
 * Décodage à l'arrache d'un jeton JWT, ATTENTION CONSIDERE QUE LE
-
 
341
 * JETON EST VALIDE, ne pas décoder n'importe quoi - pas trouvé de lib simple
-
 
342
 */
-
 
343
WidgetSaisie.prototype.decoderJeton = function( jeton ) {
-
 
344
  parts = jeton.split( '.' );
-
 
345
  payload = parts[1];
-
 
346
  payload = this.b64d( payload );
-
 
347
  payload = JSON.parse( payload, true );
-
 
348
  return payload;
-
 
349
};
-
 
350
 
-
 
351
/**
-
 
352
 * Décodage "url-safe" des chaînes base64 retournées par le SSO (lib jwt)
-
 
353
 */
-
 
354
WidgetSaisie.prototype.b64d = function( input ) {
-
 
355
  var remainder = input.length % 4;
-
 
356
 
-
 
357
  if ( 0 !== remainder ) {
-
 
358
	var padlen = 4 - remainder;
-
 
359
 
-
 
360
	for ( var i = 0; i < padlen; i++ ) {
-
 
361
	  input += '=';
-
 
362
	}
-
 
363
  }
-
 
364
  input = input.replace( '-', '+' );
-
 
365
  input = input.replace( '_', '/' );
-
 
366
  return atob( input );
-
 
367
};
-
 
368
 
-
 
369
WidgetSaisie.prototype.urlProfilUtilisateur = function( pseudo ) {
-
 
370
  var urlPart = ( 'prod' === this.mode ) ? 'www.tela-botanica.org/' : 'beta.tela-botanica.org/test/';
-
 
371
 
-
 
372
  return 'https://' + urlPart + 'membres/' + pseudo.toLowerCase().replace( ' ', '-' );
-
 
373
};
-
 
374
 
234
// Identité Observateur *******************************************************/
375
// Identité Observateur par courriel
235
WidgetSaisie.prototype.requeterIdentite = function() {
376
WidgetSaisie.prototype.requeterIdentiteCourriel = function() {
236
	var lthis = this;
377
	var lthis = this;
237
	var courriel = $( '#courriel' ).val();
378
	var courriel = $( '#courriel' ).val();
238
	var urlAnnuaire = this.serviceAnnuaireIdUrl + courriel;
379
	var urlAnnuaire = this.serviceAnnuaireIdUrl + courriel;
239
	if ( valeurOk( courriel ) ) {
380
	if ( valeurOk( courriel ) ) {
Line 288... Line 429...
288
	$( '#prenom, #nom, #courriel_confirmation' ).removeAttr( 'disabled' );
429
	$( '#prenom, #nom, #courriel_confirmation' ).removeAttr( 'disabled' );
289
};
430
};
Line 290... Line 431...
290
 
431
 
291
WidgetSaisie.prototype.testerLancementRequeteIdentite = function( event ) {
432
WidgetSaisie.prototype.testerLancementRequeteIdentite = function( event ) {
292
	if ( valeurOk( event.which, true, 13 ) ) {
433
	if ( valeurOk( event.which, true, 13 ) ) {
293
		this.requeterIdentite();
434
		this.requeterIdentiteCourriel();
294
		event.preventDefault();
435
		event.preventDefault();
295
		event.stopPropagation();
436
		event.stopPropagation();
296
	}
437
	}
Line 459... Line 600...
459
				$.getJSON( url, requete, function( data ) {
600
				$.getJSON( url, requete, function( data ) {
460
					var suggestions = lthis.traiterRetourNomsSci( data );
601
					var suggestions = lthis.traiterRetourNomsSci( data );
461
					add( suggestions );
602
					add( suggestions );
462
				})
603
				})
463
				.fail( function() {
604
				.fail( function() {
464
				    $( '#certitude' ).find( 'option' ).each( function() {
605
					$( '#certitude' ).find( 'option' ).each( function() {
465
						if ( $( this ).hasClass( 'aDeterminer' ) ) {
606
						if ( $( this ).hasClass( 'aDeterminer' ) ) {
466
							$( this ).attr( 'selected', true );
607
							$( this ).attr( 'selected', true );
467
						} else {
608
						} else {
468
							$( this ).attr( 'selected', false );
609
							$( this ).attr( 'selected', false );
469
						}
610
						}
Line 866... Line 1007...
866
	// voir : https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/disconnect
1007
	// voir : https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/disconnect
867
	// Selectionne le noeud dont les mutations seront observées
1008
	// Selectionne le noeud dont les mutations seront observées
868
	var targetNode = document.getElementById( 'miniatures' );
1009
	var targetNode = document.getElementById( 'miniatures' );
869
	// Fonction callback à éxécuter quand une mutation est observée
1010
	// Fonction callback à éxécuter quand une mutation est observée
870
	var callback = function( mutationsList ) {
1011
	var callback = function( mutationsList ) {
871
	    for( var mutation of mutationsList ) {
1012
		for( var mutation of mutationsList ) {
872
	    	var taxon = valeurOk( $( '#taxon' ).val() );
1013
			var taxon = valeurOk( $( '#taxon' ).val() );
873
	        images = ( 0 < mutation.target.childElementCount );
1014
			images = ( 0 < mutation.target.childElementCount );
874
		 	lthis.validerTaxonImage( taxon, images );
1015
			lthis.validerTaxonImage( taxon, images );
875
	    }
1016
		}
876
	};
1017
	};
877
	// Créé une instance de l'observateur lié à la fonction de callback
1018
	// Créé une instance de l'observateur lié à la fonction de callback
878
	this.observer = new MutationObserver( callback );
1019
	this.observer = new MutationObserver( callback );
879
	// Commence à observer le noeud cible pour les mutations précédemment configurées
1020
	// Commence à observer le noeud cible pour les mutations précédemment configurées
880
	this.observer.observe( targetNode, { childList: true } );
1021
	this.observer.observe( targetNode, { childList: true } );
Line 885... Line 1026...
885
	var obs          = $( '#form-observation' ).valid();
1026
	var obs          = $( '#form-observation' ).valid();
886
	var geoloc       = ( valeurOk( $( '#latitude' ).val() ) && valeurOk( $( '#longitude' ).val() ) ) ;
1027
	var geoloc       = ( valeurOk( $( '#latitude' ).val() ) && valeurOk( $( '#longitude' ).val() ) ) ;
887
	var images       = valeurOk( $( '#miniatures .miniature' ) );
1028
	var images       = valeurOk( $( '#miniatures .miniature' ) );
888
	var taxon        = valeurOk( $( '#taxon' ).val() );
1029
	var taxon        = valeurOk( $( '#taxon' ).val() );
889
	// validation et panneau taxon/images
1030
	// validation et panneau taxon/images
890
 	var taxonOuImage = this.validerTaxonImage( taxon, images );
1031
	var taxonOuImage = this.validerTaxonImage( taxon, images );
891
 	// console.log(taxonOuImage);
1032
	// console.log(taxonOuImage);
892
	var chpsSupp     = new Boolean();
1033
	var chpsSupp     = new Boolean();
893
	if ( valeurOk( $( '#form-supp' ) ) ) {
1034
	if ( valeurOk( $( '#form-supp' ) ) ) {
894
		chpsSupp = ( function () {
1035
		chpsSupp = ( function () {
895
			var otherFlag = $( '#form-supp' ).valid();
1036
			var otherFlag = $( '#form-supp' ).valid();
896
			if( valeurOk( $( '.other', $( '#form-supp' ) ) ) ) {
1037
			if( valeurOk( $( '.other', $( '#form-supp' ) ) ) ) {
Line 1656... Line 1797...
1656
 *
1797
 *
1657
 * http://github.com/scottgonzalez/jquery-ui-extensions
1798
 * http://github.com/scottgonzalez/jquery-ui-extensions
1658
 *
1799
 *
1659
 * Adaptation par Aurélien Peronnet pour la mise en gras des noms de taxons valides
1800
 * Adaptation par Aurélien Peronnet pour la mise en gras des noms de taxons valides
1660
 */
1801
 */
1661
	( function( $ ) {
1802
( function( $ ) {
1662
		var proto = $.ui.autocomplete.prototype,
1803
	var proto = $.ui.autocomplete.prototype,
1663
			initSource = proto._initSource;
1804
		initSource = proto._initSource;
1664
 
1805
 
1665
		WidgetSaisie.prototype.filter = function( array, term ) {
1806
	WidgetSaisie.prototype.filter = function( array, term ) {
1666
			var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), 'i' );
1807
		var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), 'i' );
1667
			return $.grep( array, function( value ) {
1808
		return $.grep( array, function( value ) {
1668
				return matcher.test( $( '<div>' ).html( value.label || value.value || value ).text() );
1809
			return matcher.test( $( '<div>' ).html( value.label || value.value || value ).text() );
1669
			});
-
 
1670
		}
-
 
1671
		$.extend( proto, {
-
 
1672
			_initSource: function() {
-
 
1673
				if ( this.options.html && $.isArray( this.options.source ) ) {
-
 
1674
					this.source = function( request, response ) {
-
 
1675
						response( filter( this.options.source, request.term ) );
-
 
1676
					};
-
 
1677
				} else {
-
 
1678
					initSource.call( this );
-
 
1679
				}
-
 
1680
			},
-
 
1681
			_renderItem: function( ul, item) {
-
 
1682
				if ( item.retenu ) {
-
 
1683
					item.label = '<strong>' + item.label + '</strong>';
-
 
1684
				}
-
 
1685
 
-
 
1686
				return $( '<li></li>' )
-
 
1687
					.data( 'item.autocomplete', item )
-
 
1688
					.append( $( '<a></a>' )[ ( this.options.html ) ? 'html' : 'text' ]( item.label ) )
-
 
1689
					.appendTo( ul );
-
 
1690
			}
-
 
1691
		});
1810
		});
-
 
1811
	}
-
 
1812
	$.extend( proto, {
-
 
1813
		_initSource: function() {
-
 
1814
			if ( this.options.html && $.isArray( this.options.source ) ) {
-
 
1815
				this.source = function( request, response ) {
-
 
1816
					response( filter( this.options.source, request.term ) );
-
 
1817
				};
-
 
1818
			} else {
-
 
1819
				initSource.call( this );
-
 
1820
			}
-
 
1821
		},
-
 
1822
		_renderItem: function( ul, item) {
-
 
1823
			if ( item.retenu ) {
-
 
1824
				item.label = '<strong>' + item.label + '</strong>';
-
 
1825
			}
-
 
1826
 
-
 
1827
			return $( '<li></li>' )
-
 
1828
				.data( 'item.autocomplete', item )
-
 
1829
				.append( $( '<a></a>' )[ ( this.options.html ) ? 'html' : 'text' ]( item.label ) )
-
 
1830
				.appendTo( ul );
-
 
1831
		}
-
 
1832
	});
1692
	})( jQuery );
1833
})( jQuery );