PageSourceSearch

https://www.thepampanews.com/js/rvb.js

js thepampanews.com collected 2026-10-01 14:54:25 UTC 4,185 bytes, 207 lines download raw bytes

1var rvb = rvb || {
2
3  ck: '_rvbck',
4
5  conditionalLoad: function(targetObj, minimumLength, callback)
6  {
7    if( !minimumLength ){
8      minimumLength = 2;
9    }
10    window.setTimeout(function(){
11      var img = targetObj.querySelectorAll('img');
12      if( img.length >= minimumLength ){
13        
14        for(i=0; i<=(img.length-1); i++){
15          img[i].removeAttribute('width');
16          img[i].removeAttribute('height');
17        }
18
19        if( typeof(callback) == 'function' ){
20          callback();
21        }
22
23      }
24    }, 1000);
25  },
26
27  getCk: function() {
28      var v = document.cookie.match('(^|;) ?' + rvb.ck + '=([^;]*)(;|$)');
29      return v ? v[2] : null;
30  },
31
32  setCk: function() {
33      document.cookie = rvb.ck + "=1;path=/;";
34  },
35
36  pop: {
37
38    close: function(obj)
39    {
40      document.querySelector('.rvb-unit-pop').style.display = 'none';
41    },
42
43    load: function()
44    {
45
46      var targetObj = document.querySelector('.rvb-unit-pop');
47
48      window.setTimeout(function(){
49        var closeBtn = targetObj.querySelector('.rvb-pop-close');
50        if( closeBtn ){
51          closeBtn.style.display = 'block';
52        }
53      }, 5000);
54
55      targetObj.style.display = 'block';
56      rvb.setCk();
57
58    }
59
60  },
61
62  push: {
63
64    timeout: null,
65    contractOk: false,
66    delayCollapseSeconds: 7,
67
68    load: function()
69    {
70
71      // Show it
72      var obj = rvb.push.obj();
73      if( obj.data('load-hidden') ){
74        obj.height("40px");
75        rvb.push.contractOk = true;
76      }
77      obj.show();
78
79      // Init collapse
80      if(
81        rvb.push.delayCollapseSeconds
82        && typeof rvb.push.delayCollapseSeconds == 'number'
83      ){
84        rvb.push.obj().mouseenter(function(){
85          rvb.push.expand();
86        }).mouseleave(function(){
87          rvb.push.contract();
88        });
89        rvb.push.timeout = window.setTimeout(rvb.push.initContract, (rvb.push.delayCollapseSeconds * 1000));
90      }
91
92    },
93
94    expand: function()
95    {
96      var obj = rvb.push.obj();
97      if( obj.hasClass('height-440') ){
98        objHeight = "440px";
99      }else{
100        objHeight = "340px";
101      }
102      obj.animate({
103        height: objHeight
104      });
105    },
106
107    contract: function()
108    {
109      if( rvb.push.contractOk ){
110        rvb.push.obj().animate({
111          height: "40px"
112        });
113      }
114    },
115
116    initContract: function()
117    {
118      window.clearTimeout(rvb.push.timeout);
119      rvb.push.contractOk = true;
120      rvb.push.contract();
121    },
122
123    obj: function()
124    {
125      return $('.rvb-unit-push');
126    }
127
128  },
129
130  peel: {
131
132    load: function()
133    {
134      rvb.peel.obj().show();
135    },
136
137    obj: function()
138    {
139      return $('.rvb-unit-peel');
140    }
141
142  },
143
144  mobstick: {
145
146    load: function()
147    {
148      var targetObj = document.querySelector('.rvb-unit-mobstick');
149      targetObj.style.display = 'block';
150      targetObj.querySelectorAll('img').forEach(imgObj => {
151        imgObj.removeAttribute('width');
152        imgObj.removeAttribute('height');
153      });
154    },
155
156    cancel: function(btnObj)
157    {
158      rvb.setCk();
159      btnObj.closest('.rvb-unit-mobstick').style.display = 'none';
160    }
161
162  },
163
164  margin: {
165
166    initialized: false,
167
168    init: function()
169    {
170      if( !rvb.margin.initialized ){
171        window.addEventListener('resize', function(event) {
172          var val = ( rvb.margin.ok() ? 'block' : 'none' );
173          elements = document.querySelectorAll('.rvb-unit-margin');
174          elements.forEach((element, key) => {
175            element.style.display = val;
176          })
177        }, true);
178        rvb.margin.initialized = true;
179      }
180    },
181
182    ok: function(cb)
183    {
184
185      var cerativewidth = 160;
186      var cerativemargin = 40;
187
188      var containerwidth = 0;
189      var containers = document.getElementsByClassName("container");
190      for (var i = 0; i < containers.length; i++) {
191        if( containers[i].offsetWidth > containerwidth ){
192          containerwidth = containers[i].offsetWidth;
193        }
194      }
195
196      if( (window.innerWidth-containerwidth) > ((cerativewidth*2) + (cerativemargin*2)) ){
197        rvb.margin.init();
198        return true;
199      }else{
200        return false;
201      }
202
203    }
204
205  }
206
207};

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.