1/* 2 * "R di registrato" piccola (doc Federica, punto 5): il simbolo (r) nei testi 3 * e' un carattere normale e a corpo grande "spara"; qui viene avvolto in 4 * <sup class="wbg-reg"> (stile in restyle.css). Solo nodi di TESTO dentro 5 * l'area contenuti: niente attributi, script o markup toccati. 6 * DEVE girare PRIMA di scroll-reveal.js (che spezza i testi in span): 7 * l'ordine di enqueue in private.php lo garantisce. Solo front-end. 8 */ 9(function () { 10 'use strict'; 11 12 var scope = document.querySelector('.wbg-anim-scope') || document.body; 13 if (!scope) return; 14 15 var walker = document.createTreeWalker(scope, NodeFilter.SHOW_TEXT, { 16 acceptNode: function (node) { 17 if (node.nodeValue.indexOf('®') === -1) return NodeFilter.FILTER_REJECT; 18 var p = node.parentNode; 19 if (!p) return NodeFilter.FILTER_REJECT; 20 var tag = p.nodeName; 21 if (tag === 'SCRIPT' || tag === 'STYLE' || tag === 'SUP' || tag === 'TEXTAREA') return NodeFilter.FILTER_REJECT; 22 return NodeFilter.FILTER_ACCEPT; 23 } 24 }); 25 26 var nodes = []; 27 while (walker.nextNode()) nodes.push(walker.currentNode); 28 29 for (var i = 0; i < nodes.length; i++) { 30 var node = nodes[i]; 31 var parts = node.nodeValue.split('®'); 32 var frag = document.createDocumentFragment(); 33 for (var j = 0; j < parts.length; j++) { 34 if (j > 0) { 35 var sup = document.createElement('sup'); 36 sup.className = 'wbg-reg'; 37 sup.textContent = '®'; 38 frag.appendChild(sup); 39 } 40 if (parts[j]) frag.appendChild(document.createTextNode(parts[j])); 41 } 42 node.parentNode.replaceChild(frag, node); 43 } 44})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.