Revision history for SearchHighlighter


Revision [23280]

Last edited on 2016-05-20 07:38:47 by RolandStens [Replaces old-style internal links with new pipe-split links.]
Additions:
The following code implements a feature that will highlight the search word in the pages that where found by TextSearch or by Google, Yahoo and many other search engines. The core of this feature is a JavaScript library by the name of [[http://www.kryogenix.org/code/browser/searchhi/ | searchhi]].
It is installed on [[http://stens.ca/kb | my Wikka]] so you can see for yourself how it works.
Deletions:
The following code implements a feature that will highlight the search word in the pages that where found by TextSearch or by Google, Yahoo and many other search engines. The core of this feature is a JavaScript library by the name of [[http://www.kryogenix.org/code/browser/searchhi/ searchhi]].
It is installed on [[http://stens.ca/kb my Wikka]] so you can see for yourself how it works.


Revision [19317]

Edited on 2008-01-28 00:15:07 by RolandStens [Modified links pointing to docs server]

No Differences

Revision [17305]

Edited on 2007-08-01 13:12:47 by RolandStens [Typo]
Additions:
In the **actions/header.php** file add the following code just before the **</HEAD>** tag:
Deletions:
In the **actions/header.php** file add the following code just before of the **</HEAD>** tag:


Revision [17304]

Edited on 2007-08-01 13:10:48 by RolandStens [Small update]
Additions:
The following code implements a feature that will highlight the search word in the pages that where found by TextSearch or by Google, Yahoo and many other search engines. The core of this feature is a JavaScript library by the name of [[http://www.kryogenix.org/code/browser/searchhi/ searchhi]].
Deletions:
The following code implements a feature that will highlight the search word in the pages that where found by TextSearch or by Google and Yahoo. The core of this feature is a JavaScript library by the name of [[http://www.kryogenix.org/code/browser/searchhi/ searchhi]].


Revision [17001]

Edited on 2007-05-31 23:27:40 by RolandStens [Reverted]
Additions:
for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn++) {
after = document.createTextNode(nv.substr(ni+word.length));
qs = ref.substr(ref.indexOf('?')+1);
qsa = qs.split('&');
for (i=0;i<qsa.length;i++) {
qsip = qsa[i].split('=');
if (qsip.length == 1) continue;
if (qsip[0] == 'q' || qsip[0] == 'p' || qsip[0] == 'phrase') { // q= for Google, p= for Yahoo, phrase for wikka
words = unescape(qsip[1].replace(/\+/g,' ')).split(/\s+/);
for (w=0;w<words.length;w++) {
highlightWord(document.getElementsByTagName("body")[0],words[w]);
}
window.onload = SearchHighlight;
Now all that rest us is two small changes to the **wikka.css** file and to the **header.php** action.
In **css/wikka.css** add the following lines:
%%(css)
/* ##### searchhi plugin ##### */
.searchword {
background-color: yellow;
In the **actions/header.php** file add the following code just before of the **</HEAD>** tag:
%%(html4strict)
<script src="3rdparty/plugins/searchhi/searchhi.js" type="text/javascript"></script>
It is installed on [[http://stens.ca/kb my Wikka]] so you can see for yourself how it works.
----
CategoryUserContributions
Deletions:
for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn ) {
after = document.createTextNode(nv.substr(ni word.length));
qs = ref.substr(ref.indexOf('?') 1);
qsa = qs.split('


Revision [16800]

Edited on 2007-05-31 10:49:21 by QckJ2l [Reverted]
Additions:
for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn ) {
after = document.createTextNode(nv.substr(ni word.length));
qs = ref.substr(ref.indexOf('?') 1);
qsa = qs.split('
Deletions:
for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn++) {
after = document.createTextNode(nv.substr(ni+word.length));
qs = ref.substr(ref.indexOf('?')+1);
qsa = qs.split('&');
for (i=0;i<qsa.length;i++) {
qsip = qsa[i].split('=');
if (qsip.length == 1) continue;
if (qsip[0] == 'q' || qsip[0] == 'p' || qsip[0] == 'phrase') { // q= for Google, p= for Yahoo, phrase for wikka
words = unescape(qsip[1].replace(/\+/g,' ')).split(/\s+/);
for (w=0;w<words.length;w++) {
highlightWord(document.getElementsByTagName("body")[0],words[w]);
}
window.onload = SearchHighlight;
Now all that rest us is two small changes to the **wikka.css** file and to the **header.php** action.
In **css/wikka.css** add the following lines:
%%(css)
/* ##### searchhi plugin ##### */
.searchword {
background-color: yellow;
In the **actions/header.php** file add the following code just before of the **</HEAD>** tag:
%%(html4strict)
<script src="3rdparty/plugins/searchhi/searchhi.js" type="text/javascript"></script>
It is installed on [[http://stens.ca/kb my Wikka]] so you can see for yourself how it works.
----
CategoryUserContributions


Revision [15650]

Edited on 2006-11-16 19:46:31 by RolandStens [Reverted]
Deletions:
{{backlinks}}


Revision [15649]

Edited on 2006-11-16 19:46:09 by RolandStens [Reverted]
Additions:
{{backlinks}}


Revision [14775]

Edited on 2006-07-06 18:02:31 by RolandStens [Reverted]
Deletions:
This did not seem to work on older versions of Firefox, see comments.
But version 1.5 works.


Revision [13104]

Edited on 2006-02-07 15:19:32 by RolandStens [Typo]
Additions:
First I had to make a few minor changes to this JavaScript libary. This to make it aware of the TextSearch activity.
Deletions:
First I had to made a few minor changes to this JavaScript libary. This to make it aware of the TextSearch activity.


Revision [13059]

Edited on 2006-02-05 01:31:22 by RolandStens [Typo]
Additions:
This did not seem to work on older versions of Firefox, see comments.
But version 1.5 works.
Deletions:
But, it only seems to work in IE, so I am open for any suggestions for making this work for FireFox/Mozilla as well.


Revision [13047]

Edited on 2006-02-02 12:45:42 by RolandStens [Typo]
Additions:
%%(css)
%%(html4strict)
Deletions:
%%(html)


Revision [13044]

Edited on 2006-02-02 01:42:47 by RolandStens [Typo]
Additions:
=====Highlight Searched-for Text=====
Deletions:
=====Highlight searched for words=====


Revision [13042]

Edited on 2006-02-02 01:36:57 by RolandStens [Now working in my Wikka.]
Additions:
It is installed on [[http://stens.ca/kb my Wikka]] so you can see for yourself how it works.
But, it only seems to work in IE, so I am open for any suggestions for making this work for FireFox/Mozilla as well.
Deletions:
I am about to put this on [[http://stens.ca/kb my Wikka]] so that you can see how it works.


Revision [13041]

Edited on 2006-02-02 01:16:51 by RolandStens [Now working in my Wikka.]
Additions:
I am about to put this on [[http://stens.ca/kb my Wikka]] so that you can see how it works.
Deletions:
I am about to put this on [http://stens.ca/kb my Wikka]] so that you can see how it works.


Revision [13040]

The oldest known version of this page was created on 2006-02-02 01:16:08 by RolandStens [Now working in my Wikka.]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki