Skip to content
Extraits de code Groupes Projets
Valider 6ac88fa2 rédigé par g0uZ's avatar g0uZ Validation de cerdic
Parcourir les fichiers

suppression des attributs HTML onmouseover et onclick en dur dans le HTML,...

suppression des attributs HTML onmouseover et onclick en dur dans le HTML, ajout d'attributs data-puce- correspondant et utilisation dans ajaxCallback.js
parent 6f8d7b64
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -403,12 +403,9 @@ function puce_statut_changement_rapide(
$nom = "puce_statut_";
$action = generer_url_ecrire('puce_statut', "", true);
$action = "if (!this.puce_loaded) { this.puce_loaded = true; prepare_selec_statut(this, '$nom', '$type', '$id', '$action'); }";
$over = " onmouseover=\"$action\"";
$lang_dir = lang_dir(lang_typo());
return "<span class='puce_objet $type' id='$nom$type$id' dir='$lang_dir'$over>"
return "<span class='puce_objet $type' id='$nom$type$id' dir='$lang_dir' data-puce-nom='$nom' data-puce-type='$type' data-puce-id='$id' data-puce-action='$action'>"
. $inser_puce
. '</span>';
}
......@@ -417,10 +414,9 @@ function puce_statut_changement_rapide(
function afficher_script_statut($id, $type, $n, $img, $statut, $titre, $act = '') {
$h = generer_action_auteur("instituer_objet", "$type-$id-$statut");
$h = "selec_statut('$id', '$type', $n, jQuery('img',this).attr('src'), '$h');return false;";
$t = supprimer_tags($titre);
return "<a href=\"#\" onclick=\"$h\" title=\"$t\"$act>" . http_img_pack($img, $t) . "</a>";
return "<a href=\"#\" data-puce-id=\"$id\" data-puce-type=\"$type\" data-puce-decal=\"$n\" data-puce-action=\"$h\" title=\"$t\"$act>" . http_img_pack($img, $t) . "</a>";
}
// compat
......
......@@ -1052,6 +1052,7 @@ jQuery(function() {
jQuery('div.ajaxbloc').ajaxbloc();
jQuery("input[placeholder]:text").placeholderLabel();
jQuery('.spip_logo_survol').hover(spip_logo_survol_hover, spip_logo_survol_out);
jQuery('span.puce_objet',this).mouseover(function(){if (!this.puce_loaded) { this.puce_loaded = true; prepare_selec_statut(this, jQuery(this).attr('data-puce-nom'), jQuery(this).attr('data-puce-type'), jQuery(this).attr('data-puce-id'), jQuery(this).attr('data-puce-action')); }});
});
// ... et a chaque fois que le DOM change
......@@ -1067,5 +1068,7 @@ onAjaxLoad(function() {
jQuery('div.ajaxbloc', this).ajaxbloc();
jQuery("input[placeholder]:text",this).placeholderLabel();
jQuery('.spip_logo_survol',this).hover(spip_logo_survol_hover, spip_logo_survol_out);
jQuery('span.puce_objet_popup a',this).click(function(){selec_statut(jQuery(this).attr('data-puce-id'), jQuery(this).attr('data-puce-type'), jQuery(this).attr('data-puce-decal'), jQuery('img',this).attr('src'), jQuery(this).attr('data-puce-action'));return false;});
jQuery('span.puce_objet',this).mouseover(function(){if (!this.puce_loaded) { this.puce_loaded = true; prepare_selec_statut(this, jQuery(this).attr('data-puce-nom'), jQuery(this).attr('data-puce-type'), jQuery(this).attr('data-puce-id'), jQuery(this).attr('data-puce-action')); }});
}
});
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter