PageSourceSearch

https://www.geobacter.org/assets/www.geobacter.org/misc/jquery.once-b7a6ac25c2.js

js geobacter.org collected 2026-10-02 12:29:26 UTC 4,306 bytes, 111 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (globalThis._wb_wombat && globalThis._wb_wombat.local_init && globalThis._wb_wombat.local_init(name))||globalThis[name];};if(!globalThis.__WB_pmw){globalThis.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opener = _____WB$wombat$assign$function_____("opener");
10
11/**
12 * jQuery Once Plugin v1.2
13 * http://plugins.jquery.com/project/once
14 *
15 * Dual licensed under the MIT and GPL licenses:
16 *   http://www.opensource.org/licenses/mit-license.php
17 *   http://www.gnu.org/licenses/gpl.html
18 */
19
20(function ($) {
21  var cache = {}, uuid = 0;
22
23  /**
24   * Filters elements by whether they have not yet been processed.
25   *
26   * @param id
27   *   (Optional) If this is a string, then it will be used as the CSS class
28   *   name that is applied to the elements for determining whether it has
29   *   already been processed. The elements will get a class in the form of
30   *   "id-processed".
31   *
32   *   If the id parameter is a function, it will be passed off to the fn
33   *   parameter and the id will become a unique identifier, represented as a
34   *   number.
35   *
36   *   When the id is neither a string or a function, it becomes a unique
37   *   identifier, depicted as a number. The element's class will then be
38   *   represented in the form of "jquery-once-#-processed".
39   *
40   *   Take note that the id must be valid for usage as an element's class name.
41   * @param fn
42   *   (Optional) If given, this function will be called for each element that
43   *   has not yet been processed. The function's return value follows the same
44   *   logic as $.each(). Returning true will continue to the next matched
45   *   element in the set, while returning false will entirely break the
46   *   iteration.
47   */
48  $.fn.once = function (id, fn) {
49    if (typeof id != 'string') {
50      // Generate a numeric ID if the id passed can't be used as a CSS class.
51      if (!(id in cache)) {
52        cache[id] = ++uuid;
53      }
54      // When the fn parameter is not passed, we interpret it from the id.
55      if (!fn) {
56        fn = id;
57      }
58      id = 'jquery-once-' + cache[id];
59    }
60    // Remove elements from the set that have already been processed.
61    var name = id + '-processed';
62    var elements = this.not('.' + name).addClass(name);
63
64    return $.isFunction(fn) ? elements.each(fn) : elements;
65  };
66
67  /**
68   * Filters elements that have been processed once already.
69   *
70   * @param id
71   *   A required string representing the name of the class which should be used
72   *   when filtering the elements. This only filters elements that have already
73   *   been processed by the once function. The id should be the same id that
74   *   was originally passed to the once() function.
75   * @param fn
76   *   (Optional) If given, this function will be called for each element that
77   *   has not yet been processed. The function's return value follows the same
78   *   logic as $.each(). Returning true will continue to the next matched
79   *   element in the set, while returning false will entirely break the
80   *   iteration.
81   */
82  $.fn.removeOnce = function (id, fn) {
83    var name = id + '-processed';
84    var elements = this.filter('.' + name).removeClass(name);
85
86    return $.isFunction(fn) ? elements.each(fn) : elements;
87  };
88})(jQuery);
89
90}
91
92/*
93     FILE ARCHIVED ON 11:57:14 Jun 15, 2018 AND RETRIEVED FROM THE
94     INTERNET ARCHIVE ON 14:17:27 Aug 26, 2026.
95     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
96
97     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
98     SECTION 108(a)(3)).
99*/
100/*
101playback timings (ms):
102  captures_list: 0.546
103  exclusion.robots: 0.047
104  exclusion.robots.policy: 0.035
105  esindex: 0.01
106  cdx.remote: 10.188
107  LoadShardBlock: 61.592 (3)
108  PetaboxLoader3.datanode: 73.118 (5)
109  load_resource: 708.282 (2)
110  PetaboxLoader3.resolve: 624.106 (2)
111*/

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.