classic_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 "classic_js".
... in topic.naml
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
<macro name="classic_js">
    <script type="text/javascript">
        var _hash = Nabble.hash();
        if (_hash) {
            (function(){
                var post = _hash.substr(2);
                var allPosts = [<n.compress.all_posts_js_array/>];
                var allURLs = [<n.compress.all_urls_js_array/>];
                var iPost = allPosts.indexOf(parseInt(post));
                var lower = <n.default. to="0"><n.classic_index_record/></n.default.>;
                var upper = lower + <n.classic_rows_per_page/>;
<![CDATA[
                if (iPost != -1 && (iPost < lower || iPost >= upper))
]]>
                    location.replace(allURLs[Math.floor(iPost/<n.classic_rows_per_page/>)]+_hash);
            })();
        }
 
        $(document).ready(function() {
            var rootId = '<n.page_node.id/>';
<![CDATA[
            var currentPostId = rootId;
            var isChangingViews = _hash == '#none';
            if (_hash && !isChangingViews)
                currentPostId = _hash.substr(2);
 
            Nabble.hideQuotes();
 
            function scrollToSelectedPost() {
                var $arrow = $('#red-arrow'+currentPostId).show();
                if ($arrow.size() > 0) {
                    var isRootPost = currentPostId == rootId;
                    if (Nabble.isEmbedded) {
                        if (Nabble.canScroll()) scrollTo(0, 0);
                        var y = isChangingViews? null : isRootPost? 1 : $arrow.parents('div.classic-row').offset().top;
                        Nabble.resizeFrames('', y);
                    } else if (Nabble.canScroll() && !isRootPost) {
                        var yPos = $arrow.offset().top;
                        scrollTo(0,yPos-20);
                    }
                } else {
                    if (Nabble.isEmbedded && Nabble.canScroll()) {
                        Nabble.resizeFrames('', 1);
                    } else {
                        var tb = $('div.top-bar').get(0);
                        if (tb)
                            tb.scrollIntoView();
                    }
                }
            };
            $(window).load(scrollToSelectedPost);
 
            if (Nabble.isEmbedded) {
                $('div.message-text img').load(Nabble.resizeFrames);
            }
]]>
        });
    </script>
</macro>