search_highlight_js

NAML documentation   Watch a video
   Usages of this macro
The source code below doesn't have navigation links because no usage has been compiled yet. Navigation links depend on how and where the macro is used, so first you may try finding all usages of "search_highlight_js".
... in topic.naml
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<macro name="search_highlight_js">
    <script type="text/javascript">
        var terms = Nabble.getSearchTerms();
        var hasTurnOff = false;
        Nabble.searchHighlight = function($elem) {
            if (terms != null && terms.length > 0) {
                $elem.each(function() {
                    Nabble.highlightSearchTerms(terms, this);
                });
                if (Nabble.hasHighlightedTerms && !hasTurnOff) {
                    var turnOffLink = '<span id="turn-off-highlight-control"><span class="highlight">&nbsp;X&nbsp;</span> ';
                    turnOffLink += '<a href="javascript:void(0)" onclick="Nabble.turnOffHighlight()"><t>Turn off highlighting</t></a></span>';
                    $('#topics-controls-right').prepend(turnOffLink);
                    hasTurnOff = true;
                }
            }
        };
        Nabble.turnOffHighlight = function() {
            Nabble.deleteCookie("query");
            Nabble.deleteCookie("searchuser");
            Nabble.deleteCookie("searchterms");
            $('span.search-highlight').removeClass('bold highlight');
            $('#turn-off-highlight-control').hide();
        };
    </script>
</macro>