PageSourceSearch

https://www.lien-social.com/plugins/cpub/javascript/jquery.isonscreen.js

js lien-social.com collected 2026-09-24 09:56:12 UTC 1,347 bytes, 45 lines download raw bytes

1(function ($) {
2
3    $.fn.isOnScreen = function(x, y){
4
5        if(x == null || typeof x == 'undefined') x = 1;
6        if(y == null || typeof y == 'undefined') y = 1;
7
8        var win = $(window);
9
10        var viewport = {
11            top : win.scrollTop(),
12            left : win.scrollLeft()
13        };
14        viewport.right = viewport.left + win.width();
15        viewport.bottom = viewport.top + win.height();
16
17        var height = this.outerHeight();
18        var width = this.outerWidth();
19
20        if(!width || !height){
21            return false;
22        }
23
24        var bounds = this.offset();
25        bounds.right = bounds.left + width;
26        bounds.bottom = bounds.top + height;
27
28        var visible = (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
29
30        if(!visible){
31            return false;
32        }
33
34        var deltas = {
35            top : Math.min( 1, ( bounds.bottom - viewport.top ) / height),
36            bottom : Math.min(1, ( viewport.bottom - bounds.top ) / height),
37            left : Math.min(1, ( bounds.right - viewport.left ) / width),
38            right : Math.min(1, ( viewport.right - bounds.left ) / width)
39        };
40
41        return (deltas.left * deltas.right) >= x && (deltas.top * deltas.bottom) >= y;
42
43    };
44
45})(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.