PageSourceSearch

https://darwinproject.ac.uk/sites/default/files/cpn/block-56.js?sh7yfi

js darwinproject.ac.uk collected 2026-09-24 09:16:02 UTC 2,985 bytes, 91 lines download raw bytes

1$_ = jQuery
2var timer
3$_(function () {
4  $_('.region-sidebar').append(
5    $_('.field-name-field-side-text').wrap(
6      "<div class='campl-content-container' />",
7    ),
8  )
9  var totalItems = $_(
10    '.field-name-field-quotes > .field-items > .field-item',
11  ).length
12  //
13  $_('.field-name-field-quotation-credit').each(function () {
14    var citationText = $_(this).text()
15    if (citationText != undefined) {
16      citationText = citationText.replace(/\s\*(.)/g, ' <em>$1')
17      citationText = citationText.replace(/(.)\*\s/g, '$1</em> ')
18      $(this).html(citationText)
19    }
20  })
21
22  var index = 0
23  if (totalItems > 1) {
24    $_('.field-name-field-quotes').append("<div id='quote_controls' />")
25
26    for (var n = 0; n < totalItems; n++) {
27      $_('#quote_controls').append('<span>' + (n + 1) + '</span>')
28      $_('#quote_controls span').on('click', function () {
29        $_('#quote_controls span').removeClass('selected')
30        $_(this).addClass('selected')
31        clearTimeout(timer)
32        window.location.hash = 'quote' + $_(this).text()
33        $_('.field-name-field-quotes > .field-items > .field-item').hide()
34        $_('.field-name-field-quotes  > .field-items > .field-item')
35          .eq($_(this).text() - 1)
36          .show()
37        if (ga != undefined) {
38          ga('send', 'event', 'Quotes', 'change', $_(this).text() - 1)
39        }
40      })
41    }
42    $_('#quote_controls span:first').addClass('selected')
43    $_('.field-name-field-quotes  > .field-items > .field-item').hide()
44    $_('.field-name-field-quotes  > .field-items > .field-item:first').show()
45    if (window.location.hash != '') {
46      var hash = window.location.hash.split('#quote').join('')
47      hash = Number(hash)
48      $_('#quote_controls  span')
49        .eq(hash - 1)
50        .click()
51    }
52    timer = setInterval(function () {
53      $_('.field-name-field-quotes  > .field-items > .field-item').hide()
54      $_('.field-name-field-quotes  > .field-items > .field-item')
55        .eq(index)
56        .show()
57      $_('#quote_controls span').removeClass('selected')
58      $_('#quote_controls span').eq(index).addClass('selected')
59      index++
60      if (index >= totalItems) {
61        index = 0
62      }
63    }, 7000)
64  }
65  $_('.field-name-field-quotation-credit').on('click', function () {
66    var link = $_(this).parent().find('.field-name-field-quotation-link').text()
67    if ($_.trim(link) != '') {
68      window.location.href = link
69    }
70  })
71
72  $_('.field-collection-item-field-related-pages').on('click', function () {
73    var link = $_(this).find('.field-name-field-related-url').text()
74    if ($_.trim(link) != '') {
75      window.location.href = link
76    }
77  })
78})
79$_(window).on('load', function () {
80  var quoteHeight = 150
81
82  $_('.field-name-field-quotes  > .field-items > .field-item').each(
83    function () {
84      quoteHeight = Math.max($_(this).height(), quoteHeight)
85    },
86  )
87
88  $_('.field-name-field-quotes  > .field-items > .field-item').height(
89    quoteHeight,
90  )
91})

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.