PageSourceSearch

https://wendychangblog.com/wp-content/plugins/mr-follow/assets/js/mr-follow.js?ver=2.3.0

js wendychangblog.com collected 2026-10-08 23:16:34 UTC 1,579 bytes, 59 lines download raw bytes

1(function () {
2    'use strict';
3
4    var MAX = 12, MIN = 10, STEP = 0.5;
5
6    function fit(el) {
7        if (el.offsetParent === null) {
8            return;
9        }
10        el.style.fontSize = MAX + 'px';
11        var size = MAX;
12        while (size > MIN && el.scrollWidth > el.clientWidth) {
13            size -= STEP;
14            el.style.fontSize = size + 'px';
15        }
16    }
17
18    function run() {
19        var els = document.querySelectorAll('.mr-follow-txt');
20        for (var i = 0; i < els.length; i++) {
21            fit(els[i]);
22        }
23    }
24
25    function ready(fn) {
26        if (document.readyState !== 'loading') {
27            fn();
28        } else {
29            document.addEventListener('DOMContentLoaded', fn);
30        }
31    }
32
33    function bindGoogle() {
34        var btns = document.querySelectorAll('[data-mrf-google]');
35        if (!btns.length || !window.mrFollowGoogle) {
36            return;
37        }
38        (self.PREFERRED_SOURCE = self.PREFERRED_SOURCE || []).push(function (preferredSource) {
39            preferredSource.init({ lang: window.mrFollowGoogle.lang });
40            for (var i = 0; i < btns.length; i++) {
41                btns[i].addEventListener('click', function (e) {
42                    e.preventDefault();
43                    preferredSource.addPreferredSource();
44                });
45            }
46        });
47    }
48
49    ready(function () {
50        run();
51        bindGoogle();
52    });
53
54    var timer;
55    window.addEventListener('resize', function () {
56        clearTimeout(timer);
57        timer = setTimeout(run, 150);
58    });
59})();

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.