PageSourceSearch

https://www.afrfund.org/views/alerts/alerts.js

js afrfund.org collected 2026-10-09 21:31:28 UTC 1,557 bytes, 60 lines download raw bytes

1var alertsCount;
2jQuery(document).ready(function ($) {
3  var rootURL = window.location.protocol + "//" + window.location.host;
4  function countAlerts() {
5    alertsCount = $('.alerts .alert').length;
6  }
7  if (jQuery().cycle) {
8    countAlerts();
9    if (alertsCount >= 2) {
10      initCycle();
11    }
12  } else {
13    $.ajaxSetup({
14      cache: true
15    });
16    $.when(
17      $.getScript(rootURL + '/views/alerts/js/jquery.cycle2.js'),
18      $.getScript(rootURL + '/views/alerts/js/jquery.cycle2.center.js'),
19      $.Deferred(function (deferred) {
20        $(deferred.resolve);
21      })
22    ).done(function () {
23      countAlerts();
24      if (alertsCount >= 2) {
25        initCycle();
26      }
27    });
28  }
29  function initCycle() {
30    $('.alerts').addClass('multiple');
31    $('.alerts').cycle({
32      slides: '.alert',
33      autoHeight: 'container',
34      timeout: 0,
35      speed: 500,
36      manualSpeed: 500,
37      manualfx: 'fade',
38      fx: 'fade',
39      next: '.alert-prev',
40      prev: '.alert-next'
41    });
42  }
43
44  //Hide alert and set cookie
45  $('.alerts .close').click(function () {
46    $('.alerts').addClass('alerts--hidden');
47      sessionStorage.setItem('btnClicked', true);
48  });
49
50  //Check to see if alert has been closed. If so, keep hidden. If not, show.
51  $(document).ready(function () {
52    var clicked = sessionStorage.getItem("btnClicked");
53    if (clicked) {
54      $('.alerts').addClass('alerts--hidden');
55    } else {
56      $('.alerts').removeClass('alerts--hidden');
57    }
58  });
59
60});

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.