Skip to content
Extraits de code Groupes Projets
Valider 0f97dc63 rédigé par cerdic's avatar cerdic
Parcourir les fichiers

Petite amelioration pour ne rechercher que sur la partie du document rechargee apres un ajaxLoad

parent 71321e46
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -73,11 +73,9 @@ function surligner_mots($page, $surcharge_surligne = '') { ...@@ -73,11 +73,9 @@ function surligner_mots($page, $surcharge_surligne = '') {
include_spip('inc/filtres'); include_spip('inc/filtres');
$script = " $script = "
<script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js')) . "'></script> <script type='text/javascript' src='" . url_absolue(find_in_path('javascript/SearchHighlight.js')) . "'></script>
<script type='text/javascript'>/*<![CDATA[*/ <script type='text/javascript'>
if (window.jQuery) {
var highlighter = function() { var highlighter = function() {
jQuery(function($){ jQuery(this).SearchHighlight({
\$(document).SearchHighlight({
tag_name:'" . (html5_permis() ? 'mark' : 'span') . "', tag_name:'" . (html5_permis() ? 'mark' : 'span') . "',
style_name:'spip_surligne', style_name:'spip_surligne',
exact:'whole', exact:'whole',
...@@ -87,14 +85,14 @@ function surligner_mots($page, $surcharge_surligne = '') { ...@@ -87,14 +85,14 @@ function surligner_mots($page, $surcharge_surligne = '') {
nohighlight:'.pas_surlignable'" . nohighlight:'.pas_surlignable'" .
($surcharge_surligne ? ", ($surcharge_surligne ? ",
keys:'$surcharge_surligne'" : '') . ', keys:'$surcharge_surligne'" : '') . ',
min_length: 3 min_length: 3
}); });
});
} }
highlighter(); if (window.jQuery) {
onAjaxLoad(highlighter); jQuery(function(){highlighter.apply(document, [])});
}(jQuery); onAjaxLoad(function(){highlighter.apply(this, [])});
/*]]>*/</script> };
</script>
'; ';
// on l'insere juste avant </head>, sinon tout en bas // on l'insere juste avant </head>, sinon tout en bas
if (is_null($l = strpos($page, '</head>'))) { if (is_null($l = strpos($page, '</head>'))) {
......
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