PageSourceSearch

https://www.cos-33.com/data/web/cos-33.ch/templates/js/debounce.js

js cos-33.com collected 2026-09-29 10:43:10 UTC 792 bytes, 27 lines download raw bytes

1(function($,sr){
2 
3  // debouncing function from John Hann
4  // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
5  var debounce = function (func, threshold, execAsap) {
6      var timeout;
7 
8      return function debounced () {
9          var obj = this, args = arguments;
10          function delayed () {
11              if (!execAsap)
12                  func.apply(obj, args);
13              timeout = null; 
14          };
15 
16          if (timeout)
17              clearTimeout(timeout);
18          else if (execAsap)
19              func.apply(obj, args);
20 
21          timeout = setTimeout(delayed, threshold || 500); 
22      };
23  }
24	// smartresize 
25	jQuery.fn[sr] = function(fn){  return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
26 
27})(jQuery,'smartresize');

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.