PageSourceSearch

https://matol.kz/resources/js/overlay.js

js matol.kz collected 2026-10-08 11:29:20 UTC 3,089 bytes, 119 lines download raw bytes

1
2var overlay_init = false;
3var overlay_last_time;
4var overlay;
5
6
7(function overlay_init(){
8 /*
9 overlay = {
10  on: function() {
11     	var t = document.getElementById('overlay');
12     	$('#topmenu').hide()
13     	$('#overlay').show(200);
14     	overlay_last_time = new Date();
15  },
16  off: function(){
17     	$('#topmenu').show()
18     	$('#overlay').hide();
19  }
20 };
21 */
22
23 overlay = (function(){
24   var callbacks = [];
25
26   return {
27     registerCallback: function (callback) {
28        callbacks.push(callback);
29     },
30     on: function() {
31     	var t = document.getElementById('overlay');
32     	$('#topmenu').hide()
33     	$('#overlay').show(200);
34     	overlay_last_time = new Date();
35     },
36     off: function(){
37     	$('#topmenu').show()
38     	$('#overlay').hide();
39     	for(var i = 0; i<callbacks.length;i++)
40     	  callbacks[i]();
41     }
42   };
43
44 })();
45
46
47
48 var click_close = function (){
49     	  document.body.addEventListener('click',function(e){
50     	  //console.log(e);
51     	   var time2 = new Date();
52
53     	   var close = function() {
54     	     if(time2 - overlay_last_time > 4) {
55     	    	  $('#topmenu').show()
56     			  $('#overlay').hide();
57     			  overlay.off();
58
59     			  /*
60     			  var all = document.getElementsByTagName("div");
61     	    	  for(var i=0;i<all.length;i++) {
62     	          if(all[i].style.position == 'absolute' && all[i].style.zIndex > 1000 && all[i].style.display != 'none')
63     	             all[i].style.display = 'none';
64     	             console.log(all[i]);
65     	          }
66
67     			  var spans = document.getElementsByTagName("span");
68     	    	  for(var i=0;i<spans.length;i++) {
69     	          if(spans[i].style.position == 'absolute' && spans[i].style.zIndex > 1000 && spans[i].style.display != 'none')
70     	             spans[i].style.display = 'none';
71     	          }
72     	          */
73
74
75     	     }
76     	   }
77
78     	  if(e.path) {
79     	   if(e.path[0].id == 'overlay')
80     	     close();  //chrome
81     	  } else if(e.target && e.target.id == 'overlay')
82     	     close(); //mozilla
83     	  });
84 }
85
86
87 if(window.attachEvent) {
88    window.attachEvent('onload', click_close());
89 } else {
90    if(window.onload) {
91        var curronload = window.onload;
92        var newonload = function() {
93            curronload();
94            click_close();
95        };
96        window.onload = newonload;
97    } else {
98        window.onload = click_close;
99    }
100 }
101
102 //console.log(window.onload);
103
104
105}());
106
107jQuery.fn.center = function (topOffset,leftOffset) {
108    //this.css("position","absolute");
109    if(!topOffset)
110     topOffset = 0;
111    if(!leftOffset)
112     leftOffset = 0;
113    //console.log($(window).height());
114    this.css("top", ((screen.height - $(this).outerHeight() - 100) / 2) + $(window).scrollTop() + topOffset);
115    //this.css("top", "50%");
116    //this.css("top", Math.max(0, ( $(window).height() - ($(this).outerHeight()) / 2)  +$(window).scrollTop()) + topOffset + "px");
117    this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) +  $(window).scrollLeft()) + leftOffset + "px");
118    return this;
119}

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.