PageSourceSearch

https://fdapid-hopeip.org/wp-content/themes/wp-corporate/js/waypoint_ver-2.0.3.js

js fdapid-hopeip.org collected 2026-10-08 19:24:17 UTC 17,599 bytes, 530 lines download raw bytes

vendor: 17,599 bytes, lines 1-530
1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__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 opens = _____WB$wombat$assign$function_____("opens");
10// Generated by CoffeeScript 1.6.2
11/*
12jQuery Waypoints - v2.0.3
13Copyright (c) 2011-2013 Caleb Troughton
14Dual licensed under the MIT license and GPL license.
15https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
16*/
17
18
19(function() {
20  var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
21    __slice = [].slice;
22
23  (function(root, factory) {
24    if (typeof define === 'function' && define.amd) {
25      return define('waypoints', ['jquery'], function($) {
26        return factory($, root);
27      });
28    } else {
29      return factory(root.jQuery, root);
30    }
31  })(this, function($, window) {
32    var $w, Context, Waypoint, allWaypoints, contextCounter, contextKey, contexts, isTouch, jQMethods, methods, resizeEvent, scrollEvent, waypointCounter, waypointKey, wp, wps;
33
34    $w = $(window);
35    isTouch = __indexOf.call(window, 'ontouchstart') >= 0;
36    allWaypoints = {
37      horizontal: {},
38      vertical: {}
39    };
40    contextCounter = 1;
41    contexts = {};
42    contextKey = 'waypoints-context-id';
43    resizeEvent = 'resize.waypoints';
44    scrollEvent = 'scroll.waypoints';
45    waypointCounter = 1;
46    waypointKey = 'waypoints-waypoint-ids';
47    wp = 'waypoint';
48    wps = 'waypoints';
49    Context = (function() {
50      function Context($element) {
51        var _this = this;
52
53        this.$element = $element;
54        this.element = $element[0];
55        this.didResize = false;
56        this.didScroll = false;
57        this.id = 'context' + contextCounter++;
58        this.oldScroll = {
59          x: $element.scrollLeft(),
60          y: $element.scrollTop()
61        };
62        this.waypoints = {
63          horizontal: {},
64          vertical: {}
65        };
66        $element.data(contextKey, this.id);
67        contexts[this.id] = this;
68        $element.bind(scrollEvent, function() {
69          var scrollHandler;
70
71          if (!(_this.didScroll || isTouch)) {
72            _this.didScroll = true;
73            scrollHandler = function() {
74              _this.doScroll();
75              return _this.didScroll = false;
76            };
77            return window.setTimeout(scrollHandler, $[wps].settings.scrollThrottle);
78          }
79        });
80        $element.bind(resizeEvent, function() {
81          var resizeHandler;
82
83          if (!_this.didResize) {
84            _this.didResize = true;
85            resizeHandler = function() {
86              $[wps]('refresh');
87              return _this.didResize = false;
88            };
89            return window.setTimeout(resizeHandler, $[wps].settings.resizeThrottle);
90          }
91        });
92      }
93
94      Context.prototype.doScroll = function() {
95        var axes,
96          _this = this;
97
98        axes = {
99          horizontal: {
100            newScroll: this.$element.scrollLeft(),
101            oldScroll: this.oldScroll.x,
102            forward: 'right',
103            backward: 'left'
104          },
105          vertical: {
106            newScroll: this.$element.scrollTop(),
107            oldScroll: this.oldScroll.y,
108            forward: 'down',
109            backward: 'up'
110          }
111        };
112        if (isTouch && (!axes.vertical.oldScroll || !axes.vertical.newScroll)) {
113          $[wps]('refresh');
114        }
115        $.each(axes, function(aKey, axis) {
116          var direction, isForward, triggered;
117
118          triggered = [];
119          isForward = axis.newScroll > axis.oldScroll;
120          direction = isForward ? axis.forward : axis.backward;
121          $.each(_this.waypoints[aKey], function(wKey, waypoint) {
122            var _ref, _ref1;
123
124            if ((axis.oldScroll < (_ref = waypoint.offset) && _ref <= axis.newScroll)) {
125              return triggered.push(waypoint);
126            } else if ((axis.newScroll < (_ref1 = waypoint.offset) && _ref1 <= axis.oldScroll)) {
127              return triggered.push(waypoint);
128            }
129          });
130          triggered.sort(function(a, b) {
131            return a.offset - b.offset;
132          });
133          if (!isForward) {
134            triggered.reverse();
135          }
136          return $.each(triggered, function(i, waypoint) {
137            if (waypoint.options.continuous || i === triggered.length - 1) {
138              return waypoint.trigger([direction]);
139            }
140          });
141        });
142        return this.oldScroll = {
143          x: axes.horizontal.newScroll,
144          y: axes.vertical.newScroll
145        };
146      };
147
148      Context.prototype.refresh = function() {
149        var axes, cOffset, isWin,
150          _this = this;
151
152        isWin = $.isWindow(this.element);
153        cOffset = this.$element.offset();
154        this.doScroll();
155        axes = {
156          horizontal: {
157            contextOffset: isWin ? 0 : cOffset.left,
158            contextScroll: isWin ? 0 : this.oldScroll.x,
159            contextDimension: this.$element.width(),
160            oldScroll: this.oldScroll.x,
161            forward: 'right',
162            backward: 'left',
163            offsetProp: 'left'
164          },
165          vertical: {
166            contextOffset: isWin ? 0 : cOffset.top,
167            contextScroll: isWin ? 0 : this.oldScroll.y,
168            contextDimension: isWin ? $[wps]('viewportHeight') : this.$element.height(),
169            oldScroll: this.oldScroll.y,
170            forward: 'down',
171            backward: 'up',
172            offsetProp: 'top'
173          }
174        };
175        return $.each(axes, function(aKey, axis) {
176          return $.each(_this.waypoints[aKey], function(i, waypoint) {
177            var adjustment, elementOffset, oldOffset, _ref, _ref1;
178
179            adjustment = waypoint.options.offset;
180            oldOffset = waypoint.offset;
181            elementOffset = $.isWindow(waypoint.element) ? 0 : waypoint.$element.offset()[axis.offsetProp];
182            if ($.isFunction(adjustment)) {
183              adjustment = adjustment.apply(waypoint.element);
184            } else if (typeof adjustment === 'string') {
185              adjustment = parseFloat(adjustment);
186              if (waypoint.options.offset.indexOf('%') > -1) {
187                adjustment = Math.ceil(axis.contextDimension * adjustment / 100);
188              }
189            }
190            waypoint.offset = elementOffset - axis.contextOffset + axis.contextScroll - adjustment;
191            if ((waypoint.options.onlyOnScroll && (oldOffset != null)) || !waypoint.enabled) {
192              return;
193            }
194            if (oldOffset !== null && (oldOffset < (_ref = axis.oldScroll) && _ref <= waypoint.offset)) {
195              return waypoint.trigger([axis.backward]);
196            } else if (oldOffset !== null && (oldOffset > (_ref1 = axis.oldScroll) && _ref1 >= waypoint.offset)) {
197              return waypoint.trigger([axis.forward]);
198            } else if (oldOffset === null && axis.oldScroll >= waypoint.offset) {
199              return waypoint.trigger([axis.forward]);
200            }
201          });
202        });
203      };
204
205      Context.prototype.checkEmpty = function() {
206        if ($.isEmptyObject(this.waypoints.horizontal) && $.isEmptyObject(this.waypoints.vertical)) {
207          this.$element.unbind([resizeEvent, scrollEvent].join(' '));
208          return delete contexts[this.id];
209        }
210      };
211
212      return Context;
213
214    })();
215    Waypoint = (function() {
216      function Waypoint($element, context, options) {
217        var idList, _ref;
218
219        options = $.extend({}, $.fn[wp].defaults, options);
220        if (options.offset === 'bottom-in-view') {
221          options.offset = function() {
222            var contextHeight;
223
224            contextHeight = $[wps]('viewportHeight');
225            if (!$.isWindow(context.element)) {
226              contextHeight = context.$element.height();
227            }
228            return contextHeight - $(this).outerHeight();
229          };
230        }
231        this.$element = $element;
232        this.element = $element[0];
233        this.axis = options.horizontal ? 'horizontal' : 'vertical';
234        this.callback = options.handler;
235        this.context = context;
236        this.enabled = options.enabled;
237        this.id = 'waypoints' + waypointCounter++;
238        this.offset = null;
239        this.options = options;
240        context.waypoints[this.axis][this.id] = this;
241        allWaypoints[this.axis][this.id] = this;
242        idList = (_ref = $element.data(waypointKey)) != null ? _ref : [];
243        idList.push(this.id);
244        $element.data(waypointKey, idList);
245      }
246
247      Waypoint.prototype.trigger = function(args) {
248        if (!this.enabled) {
249          return;
250        }
251        if (this.callback != null) {
252          this.callback.apply(this.element, args);
253        }
254        if (this.options.triggerOnce) {
255          return this.destroy();
256        }
257      };
258
259      Waypoint.prototype.disable = function() {
260        return this.enabled = false;
261      };
262
263      Waypoint.prototype.enable = function() {
264        this.context.refresh();
265        return this.enabled = true;
266      };
267
268      Waypoint.prototype.destroy = function() {
269        delete allWaypoints[this.axis][this.id];
270        delete this.context.waypoints[this.axis][this.id];
271        return this.context.checkEmpty();
272      };
273
274      Waypoint.getWaypointsByElement = function(element) {
275        var all, ids;
276
277        ids = $(element).data(waypointKey);
278        if (!ids) {
279          return [];
280        }
281        all = $.extend({}, allWaypoints.horizontal, allWaypoints.vertical);
282        return $.map(ids, function(id) {
283          return all[id];
284        });
285      };
286
287      return Waypoint;
288
289    })();
290    methods = {
291      init: function(f, options) {
292        var _ref;
293
294        if (options == null) {
295          options = {};
296        }
297        if ((_ref = options.handler) == null) {
298          options.handler = f;
299        }
300        this.each(function() {
301          var $this, context, contextElement, _ref1;
302
303          $this = $(this);
304          contextElement = (_ref1 = options.context) != null ? _ref1 : $.fn[wp].defaults.context;
305          if (!$.isWindow(contextElement)) {
306            contextElement = $this.closest(contextElement);
307          }
308          contextElement = $(contextElement);
309          context = contexts[contextElement.data(contextKey)];
310          if (!context) {
311            context = new Context(contextElement);
312          }
313          return new Waypoint($this, context, options);
314        });
315        $[wps]('refresh');
316        return this;
317      },
318      disable: function() {
319        return methods._invoke(this, 'disable');
320      },
321      enable: function() {
322        return methods._invoke(this, 'enable');
323      },
324      destroy: function() {
325        return methods._invoke(this, 'destroy');
326      },
327      prev: function(axis, selector) {
328        return methods._traverse.call(this, axis, selector, function(stack, index, waypoints) {
329          if (index > 0) {
330            return stack.push(waypoints[index - 1]);
331          }
332        });
333      },
334      next: function(axis, selector) {
335        return methods._traverse.call(this, axis, selector, function(stack, index, waypoints) {
336          if (index < waypoints.length - 1) {
337            return stack.push(waypoints[index + 1]);
338          }
339        });
340      },
341      _traverse: function(axis, selector, push) {
342        var stack, waypoints;
343
344        if (axis == null) {
345          axis = 'vertical';
346        }
347        if (selector == null) {
348          selector = window;
349        }
350        waypoints = jQMethods.aggregate(selector);
351        stack = [];
352        this.each(function() {
353          var index;
354
355          index = $.inArray(this, waypoints[axis]);
356          return push(stack, index, waypoints[axis]);
357        });
358        return this.pushStack(stack);
359      },
360      _invoke: function($elements, method) {
361        $elements.each(function() {
362          var waypoints;
363
364          waypoints = Waypoint.getWaypointsByElement(this);
365          return $.each(waypoints, function(i, waypoint) {
366            waypoint[method]();
367            return true;
368          });
369        });
370        return this;
371      }
372    };
373    $.fn[wp] = function() {
374      var args, method;
375
376      method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
377      if (methods[method]) {
378        return methods[method].apply(this, args);
379      } else if ($.isFunction(method)) {
380        return methods.init.apply(this, arguments);
381      } else if ($.isPlainObject(method)) {
382        return methods.init.apply(this, [null, method]);
383      } else if (!method) {
384        return $.error("jQuery Waypoints needs a callback function or handler option.");
385      } else {
386        return $.error("The " + method + " method does not exist in jQuery Waypoints.");
387      }
388    };
389    $.fn[wp].defaults = {
390      context: window,
391      continuous: true,
392      enabled: true,
393      horizontal: false,
394      offset: 0,
395      triggerOnce: false
396    };
397    jQMethods = {
398      refresh: function() {
399        return $.each(contexts, function(i, context) {
400          return context.refresh();
401        });
402      },
403      viewportHeight: function() {
404        var _ref;
405
406        return (_ref = window.innerHeight) != null ? _ref : $w.height();
407      },
408      aggregate: function(contextSelector) {
409        var collection, waypoints, _ref;
410
411        collection = allWaypoints;
412        if (contextSelector) {
413          collection = (_ref = contexts[$(contextSelector).data(contextKey)]) != null ? _ref.waypoints : void 0;
414        }
415        if (!collection) {
416          return [];
417        }
418        waypoints = {
419          horizontal: [],
420          vertical: []
421        };
422        $.each(waypoints, function(axis, arr) {
423          $.each(collection[axis], function(key, waypoint) {
424            return arr.push(waypoint);
425          });
426          arr.sort(function(a, b) {
427            return a.offset - b.offset;
428          });
429          waypoints[axis] = $.map(arr, function(waypoint) {
430            return waypoint.element;
431          });
432          return waypoints[axis] = $.unique(waypoints[axis]);
433        });
434        return waypoints;
435      },
436      above: function(contextSelector) {
437        if (contextSelector == null) {
438          contextSelector = window;
439        }
440        return jQMethods._filter(contextSelector, 'vertical', function(context, waypoint) {
441          return waypoint.offset <= context.oldScroll.y;
442        });
443      },
444      below: function(contextSelector) {
445        if (contextSelector == null) {
446          contextSelector = window;
447        }
448        return jQMethods._filter(contextSelector, 'vertical', function(context, waypoint) {
449          return waypoint.offset > context.oldScroll.y;
450        });
451      },
452      left: function(contextSelector) {
453        if (contextSelector == null) {
454          contextSelector = window;
455        }
456        return jQMethods._filter(contextSelector, 'horizontal', function(context, waypoint) {
457          return waypoint.offset <= context.oldScroll.x;
458        });
459      },
460      right: function(contextSelector) {
461        if (contextSelector == null) {
462          contextSelector = window;
463        }
464        return jQMethods._filter(contextSelector, 'horizontal', function(context, waypoint) {
465          return waypoint.offset > context.oldScroll.x;
466        });
467      },
468      enable: function() {
469        return jQMethods._invoke('enable');
470      },
471      disable: function() {
472        return jQMethods._invoke('disable');
473      },
474      destroy: function() {
475        return jQMethods._invoke('destroy');
476      },
477      extendFn: function(methodName, f) {
478        return methods[methodName] = f;
479      },
480      _invoke: function(method) {
481        var waypoints;
482
483        waypoints = $.extend({}, allWaypoints.vertical, allWaypoints.horizontal);
484        return $.each(waypoints, function(key, waypoint) {
485          waypoint[method]();
486          return true;
487        });
488      },
489      _filter: function(selector, axis, test) {
490        var context, waypoints;
491
492        context = contexts[$(selector).data(contextKey)];
493        if (!context) {
494          return [];
495        }
496        waypoints = [];
497        $.each(context.waypoints[axis], function(i, waypoint) {
498          if (test(context, waypoint)) {
499            return waypoints.push(waypoint);
500          }
501        });
502        waypoints.sort(function(a, b) {
503          return a.offset - b.offset;
504        });
505        return $.map(waypoints, function(waypoint) {
506          return waypoint.element;
507        });
508      }
509    };
510    $[wps] = function() {
511      var args, method;
512
513      method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
514      if (jQMethods[method]) {
515        return jQMethods[method].apply(null, args);
516      } else {
517        return jQMethods.aggregate.call(null, method);
518      }
519    };
520    $[wps].settings = {
521      resizeThrottle: 100,
522      scrollThrottle: 30
523    };
524    return $w.load(function() {
525      return $[wps]('refresh');
526    });
527  });
528
529}).call(this);
530}

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.