search_highlight_js

NAML documentation   Watch a video
Error Found
An error was found in the NAML code of this application – View Details | Go to NAML Editor
tag 'mailing_list_etiquette' is not an allowed here, only these are allowed: [bottom, page_name, focus]
  in new_post(custom_tweak:reply:2) - <n.new_post>
  in (custom_tweak:reply:1) - <override_macro name="reply" requires="servlet">
   Usages of this macro
... 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>