Changeset 31683 in spip-zone
- Timestamp:
- Sep 21, 2009, 5:57:07 AM (11 years ago)
- Location:
- _plugins_/selecteur_generique
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/selecteur_generique/inserer_javascript.php
r26735 r31683 75 75 var appliquer_selecteur_cherche_mot = function() { 76 76 // chercher l'input de saisie 77 var me = jQuery('input[name=cherche_mot][autocomplete!=off]'); 78 me.each(function(){ 77 var groupes = new Array; 78 var groupes_titre = new Array; 79 var hide=false; 80 $('input[name=cherche_mot][autocomplete!=off]') 81 .each(function(){ 82 var id_groupe = $(this).parents('form').find('input[name=select_groupe]').val(); 83 groupes.push(id_groupe); 84 groupes_titre.push($(this).val()); 85 if (hide) { 86 $(this).parent().hide(); 87 /* 88 $(this).parent().parent().append( 89 $('<a>'+$(this).val()+'<\/a>') 90 .click(function(){ 91 $(this).hide().parent().find('input[name=select_groupe]').parent().show(); 92 }) 93 ); 94 */ 95 } 96 hide=true; 97 }); 98 hide=false; 99 $('input[name=cherche_mot][autocomplete!=off]:first') 100 .each(function(){ 79 101 var inp = this; 80 var id_groupe = jQuery(this).parents('form').find('input[name=select_groupe]').val(); 81 jQuery(inp).autocomplete('$ac',{ 82 extraParams:{quoi:'mot',$type:'$id',id_groupe:''+id_groupe+''}, 102 $(this) 103 .val(groupes_titre.join(', ')) 104 .attr('title',groupes_titre.join(', ')); 105 $(inp).autocomplete('$ac',{ 106 extraParams:{quoi:'mot',$type:'$id',groupes: groupes.join(',')}, 83 107 delay: 300, 84 108 autofill: false, … … 88 112 }, 89 113 }); 90 jQuery(inp).result(function(event, data, formatted) {114 $(inp).result(function(event, data, formatted) { 91 115 if (data[2] > 0) { 92 jQuery(inp)116 $(inp) 93 117 .attr('name', 'old_value') 94 118 .parents('form') 95 119 .append( 96 jQuery("<input type='hidden' name='nouv_mot' value='"+data[2]+"' />")120 $("<input type='hidden' name='nouv_mot' value='"+data[2]+"' />") 97 121 ).find('input[type=submit]') 98 122 .click() -
_plugins_/selecteur_generique/selecteurs/mot.html
r25948 r31683 12 12 13 13 [(#REM) Chercher les mots correspondant a la requete ] 14 <BOUCLE_s(MOTS){titre LIKE (#ENV{q})%}{id_groupe?}{0,20}{par titre}{doublons}{tous}> 15 #TITRE[ - (#DESCRIPTIF|textebrut|couper{20})]|[(#TITRE|textebrut)]|#ID_MOT 14 <BOUCLE_s(MOTS){titre LIKE (#ENV{q})%} 15 {id_groupe IN #ENV{groupes}|explode{','}} 16 {0,20}{par titre}{doublons}{tous}> 17 #TITRE[ - (#DESCRIPTIF|textebrut|couper{20})][ ((#TYPE|textebrut))]|[(#TITRE|textebrut)]|#ID_MOT 16 18 </BOUCLE_s> 17 <BOUCLE_s1(MOTS){titre LIKE %(#ENV{q})%}{id_groupe?}{0,20}{par titre}{doublons}{tous}> 18 #TITRE[ - (#DESCRIPTIF|textebrut|couper{20})]|[(#TITRE|textebrut)]|#ID_MOT 19 <BOUCLE_s1(MOTS){titre LIKE %(#ENV{q})%} 20 {id_groupe IN #ENV{groupes}|explode{','}} 21 {0,20}{par titre}{doublons}{tous}> 22 #TITRE[ - (#DESCRIPTIF|textebrut|couper{20})][ ((#TYPE|textebrut))]|[(#TITRE|textebrut)]|#ID_MOT 19 23 </BOUCLE_s1> 20 24 [(#REM) Vraiment on n'a rien trouve ]
Note: See TracChangeset
for help on using the changeset viewer.