[SPIP Zone] r4716 - in /_plugins_/_ze_laboratoire_/spiip: dist_back/inc-gadget-rubriques.html inc/gadgets.php

Author: renatoformato@virgilio.it
Date: Sat Aug 19 10:57:02 2006
New Revision: 4716

Log:
Put js init script for ahah html directly inside the html code

Modified:
    _plugins_/_ze_laboratoire_/spiip/dist_back/inc-gadget-rubriques.html
    _plugins_/_ze_laboratoire_/spiip/inc/gadgets.php

Modified: _plugins_/_ze_laboratoire_/spiip/dist_back/inc-gadget-rubriques.html

--- _plugins_/_ze_laboratoire_/spiip/dist_back/inc-gadget-rubriques.html (original)
+++ _plugins_/_ze_laboratoire_/spiip/dist_back/inc-gadget-rubriques.html Sat Aug 19 10:57:02 2006
@@ -4,3 +4,9 @@
<BOUCLE_rubriques(RUBRIQUES) {racine} {par num titre, titre}{!doublons}{tout}><li>[(#HTTP_IMG_PACK{secteur-12.gif}|inserer_attribut{class,'nav_logo_rub'})]<a href="#URL_ECRIRE{naviguer,id_rubrique=#ID_RUBRIQUE}" class="intitule<BOUCLE_test_soussect(RUBRIQUES){id_parent}{0,1}> daddy</BOUCLE_test_soussect>">[(#TITRE|supprimer_numero|couper{80})]</a>
<B_sous_rubriques><ul><BOUCLE_sous_rubriques(RUBRIQUES) {id_parent} {par num titre, titre}{!doublons}{tout}><li>[(#HTTP_IMG_PACK{rubrique-12.gif}|inserer_attribut{class,'nav_logo_rub'})]<a href="#URL_ECRIRE{naviguer,id_rubrique=#ID_RUBRIQUE}"<BOUCLE_test_sousrub(RUBRIQUES){id_parent}{0,1}>class='daddy'</BOUCLE_test_sousrub>>[(#TITRE|supprimer_numero|couper{80})]</a><BOUCLE_re(BOUCLE_sous_rubriques)></BOUCLE_re></li></BOUCLE_sous_rubriques></ul></B_sous_rubriques>
</li></BOUCLE_rubriques></B_rubriques></ul>
\ No newline at end of file
+<script type='text/javascript'>
+$('#bandeautoutsite li').hover(
+ function(){$(this).addClass('sfhover')},
+ function(){$(this).removeClass('sfhover')}
+ );
+</script>

Modified: _plugins_/_ze_laboratoire_/spiip/inc/gadgets.php

--- _plugins_/_ze_laboratoire_/spiip/inc/gadgets.php (original)
+++ _plugins_/_ze_laboratoire_/spiip/inc/gadgets.php Sat Aug 19 10:57:02 2006
@@ -206,12 +206,7 @@
   if ($_COOKIE['spip_accepte_ajax'] != -1) {
     return "\n<!-- javascript gadgets -->\n" .
     http_script(
- "$('#bandeautoutsite').load('".generer_url_prive('inc-gadget-rubriques','lang='.$GLOBALS['spip_lang'],'&')."',function(){
- $(this).find('li').hover(
- function(){\$(this).addClass('sfhover')},
- function(){\$(this).removeClass('sfhover')}
- );
- });\n".
+ "$('#bandeautoutsite').load('".generer_url_prive('inc-gadget-rubriques','lang='.$GLOBALS['spip_lang'],'&')."');\n".
     "$('#bandeaunavrapide').load('".generer_url_prive('inc-gadget-navigation',"id_auteur=$connect_id_auteur&lang=".$GLOBALS['spip_lang'].
   ($id_rubrique ? '&id_rubrique='.$id_rubrique : ''),'&')."');\n
     \n" .

renatoformato@virgilio.it a écrit :

Author: renatoformato@virgilio.it
Date: Sat Aug 19 10:57:02 2006
New Revision: 4716

Log:
Put js init script for ahah html directly inside the html code

don't be so impatient !
it's more easy to have all code at the same place during factoring of gadgets ...
moreover i think at end to include all gadgets in a only one sekeleton, to load it with ahah and then redispatch it in all gadget with jquery...
Cedric

cedric.morin@yterium.com ha scritto:

renatoformato@virgilio.it a écrit :

Author: renatoformato@virgilio.it
Date: Sat Aug 19 10:57:02 2006
New Revision: 4716

Log:
Put js init script for ahah html directly inside the html code

don't be so impatient !
it's more easy to have all code at the same place during factoring of gadgets ...
moreover i think at end to include all gadgets in a only one sekeleton, to load it with ahah and then redispatch it in all gadget with jquery...
Cedric

ok :slight_smile: It was more a proof of concept than other things.
More jquery we use and more this feature will be useful not to put a lot of jquery calls in the main page.

Renato