Posts that norz is monitoring
|
Jul 19, 2008
|
Topic: Highlight specific words on any page... How could I use this script to replace text smilies with images (data: uris)? I cant figure it out This is what I need to incorporate it in:
Someone told me that using innerHTML replace was much slower, but I dont know how to use your way. |
|
Jul 16, 2008
|
Topic: Highlight specific words on any page... is there another way to do the var? i added the words i want to highlight and its a pretty large list and it causes the script to stall |
|
Jul 7, 2008
|
Topic: Highlight specific words on any page... var RE = /(e)/;
for (var tx = document.evaluate('//text()[normalize-space(.)!=""]', document, null, 6, null), t, i = 0; t = tx.snapshotItem(i); i++) {
var before = t.textContent, st, matched = false;
if (t.parentNode.tagName == 'STYLE' || t.parentNode.tagName == 'SCRIPT') continue;
while ((st = before.search(RE)) != -1) {
t.parentNode.insertBefore(document.createTextNode(before.substr(0, st)), t);
with (t.parentNode.insertBefore(document.createElement('span'), t))
textContent = RegExp.$1,
style.cssText = 'color: #f00; font-size: 14pt;';
matched = true;
before = before.substr(st + RegExp.$1.length);
}
if (matched) t.textContent = before;
}
|
|
Jul 6, 2008
|
Topic: Highlight specific words on any page... not working for me.
|
|
Jul 6, 2008
|
Topic: Highlight specific words on any page... Working for me. |
|
Jul 5, 2008
|
Topic: Highlight specific words on any page... nope, still not working. |
|
Jul 5, 2008
|
Topic: Highlight specific words on any page... k. |
|
Jul 5, 2008
|
Topic: Highlight specific words on any page... I've mismatched quotes in that line, try again. |
|
Jul 4, 2008
|
Topic: Highlight specific words on any page... please. |
|
Jul 4, 2008
|
Topic: Highlight specific words on any page... multi word/case insensivity worked.
but when I replace, the script doesnt work at all. |
|
Jul 4, 2008
|
Topic: Highlight specific words on any page...
Replace
with (t.parentNode.insertBefore(document.createElement('span'), t))
textContent = RegExp.$1,
style.cssText = 'color: #f00; size: 14pt;';
Add any styles you like to the cssText string. |
|
Jul 4, 2008
|
Topic: Highlight specific words on any page... please. |
|
Jul 4, 2008
|
Topic: Highlight specific words on any page... thanks mikado, worked...but is there a way I can add more words? and also color them instead just bold? also when I add a word like (My Home) it only highlights exactly as it's typed, like it doesn't highlight (my home) just (My Home)
thanks. |
|
Jul 3, 2008
|
Topic: Highlight specific words on any page... That's why I'm still learning :) |
|
Jul 3, 2008
|
Topic: Highlight specific words on any page... Crappy way, dob.
var RE = /(script)/;
for (var tx = document.evaluate('//text()[normalize-space(.)!=""]', document, null, 6, null), t, i = 0; t = tx.snapshotItem(i); i++) {
var before = t.textContent, st, matched = false;
if (t.parentNode.tagName == 'STYLE' || t.parentNode.tagName == 'SCRIPT') continue;
while ((st = before.search(RE)) != -1) {
t.parentNode.insertBefore(document.createTextNode(before.substr(0, st)), t);
t.parentNode.insertBefore(document.createElement('b'), t).textContent = RegExp.$1;
matched = true;
before = before.substr(st + RegExp.$1.length);
}
if (matched) t.textContent = before;
}
|
|
Jul 3, 2008
|
Topic: Highlight specific words on any page...
|
|
Jul 3, 2008
|
Topic: Highlight specific words on any page... please. |
|
Jul 3, 2008
|
Topic: Highlight specific words on any page... please. |
|
Jul 2, 2008
|
Topic: Highlight specific words on any page... is there a script that highlights specific words that I want on any site/page? |
