PageSourceSearch

https://pressthink.org/wp-content/themes/wp-pressthink/assets/javascript/main.js?ver=2.9c

js pressthink.org collected 2026-10-02 04:25:47 UTC 4,288 bytes, 122 lines download raw bytes

1(function($) {
2
3    $(function() {
4        $('#navToggle').click(function(e) {
5            e.preventDefault();
6            $('#nav').scrollTop(0);
7            $('body').toggleClass('openNav');
8        });
9
10        $(document).keyup(function(e) {
11            if ($('body').hasClass('openNav') && e.keyCode == 27) {
12                $('#nav').scrollTop(0);
13                $('body').removeClass('openNav');
14            }
15        });
16
17        if ($('body').hasClass('page-template-page-board') || $('body').hasClass('single-tile')) {
18            var $window = $(window);
19            var $tiles = $('.tiles');
20            var $navBoard = $('.navBoard');
21            var $navBoardPrevious = $('.navBoard.previous');
22            var $navBoardNext = $('.navBoard.next');
23            var lock = false;
24
25            $tiles.bind('scroll', function() {
26                var scrollLeft = $tiles.scrollLeft();
27                $navBoard.show();
28                if (scrollLeft <= 0) {
29                    $navBoardPrevious.hide();
30                } else if (scrollLeft >= $tiles[0].scrollWidth - $window.outerWidth()) {
31                    $navBoardNext.hide();
32                }
33            });
34
35            $navBoard.click(function(e){
36                e.preventDefault();
37                if (!lock) {
38                    lock = true;
39                    var $navBoardElement = $(this);
40                    var direction = "+=";
41                    if ($navBoardElement.hasClass('previous')) {
42                        direction = "-=";
43                    }
44                    var windowWidth = $window.outerWidth();
45                    var speed = 500;
46                    var width = $('.tile:last').outerWidth();
47
48                    if (windowWidth >= 1120) {
49                         speed = 1500;
50                         width = width * 4;
51                    }
52                    else if (windowWidth >= 960) {
53                         speed = 1000;
54                         width = width * 3;
55                    }
56                    else if (windowWidth >= 480) {
57                         speed = 800;
58                         width = width * 2;
59                    }
60                    $tiles.animate({
61                       scrollLeft: direction+width
62                    }, speed, 'easeInOutQuart', function() {
63                        lock = false;
64                    });
65                }
66            });
67
68            $tiles.scrollLeft(0).trigger('scroll');
69        }
70        else if ($('body').hasClass('single-post')) {
71            var anchorLink = $('.anchorLinkTemplate').html();
72
73            $('.postContent > p').each(function(i) {
74                var $p = $(this);
75                var id = 'p' + i;
76                $p.attr('id', id);
77
78                var $a = $('<a />').attr('href', '#' + id).attr('class', 'anchorLink').attr('name', id);
79                $a.attr('title', 'Link to this paragraph.');
80                $a.html(anchorLink);
81
82                $p.append(' ');
83                $p.append($a);
84            });
85
86            $('.postContent > h5').each(function(i) {
87                var $h5 = $(this);
88                var id = 'aftermatter';
89                if (i > 0) {
90                    id += i;
91                }
92                $h5.attr('id', id);
93
94                var $a = $('<a />').attr('href', '#' + id).attr('class', 'anchorLink').attr('name', id);
95                $a.attr('title', 'Link to After Matter for this post.');
96                $a.html(anchorLink);
97
98                $h5.append(' ');
99                $h5.append($a);
100            });
101
102            $(window.location.hash).addClass('permalinked').addClass('on');
103
104            var offset = $('.permalinked').first().offset();
105            if (offset.top > 0) {
106                window.scroll({
107                    top: offset.top,
108                    behavior: 'smooth'
109                });
110
111                setTimeout(function() {
112                    $('.permalinked').removeClass('on');
113                }, 200);
114            }
115        }
116
117        $('.boardEmbedMask').click(function(e) {
118            e.preventDefault();
119            $(this).fadeOut(600);
120        });
121    });
122})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.