PageSourceSearch

https://florianmetzler.com/sites/default/files/js/js_XN06qaJ9WWv-KnNkALv9Bf4VrJHetsbe7B56Wy542BM.js

js florianmetzler.com collected 2026-10-05 02:00:54 UTC 11,310 bytes, 371 lines download raw bytes

1/**
2 * @file
3 * Javascript behaviors for MathJax.
4 */
5
6/* global MathJax, Drupal, jQuery, document */
7
8(function ($, Drupal, document, MathJax) {
9
10  'use strict';
11
12  /**
13   * Attaches behaviors for MathJax.
14   */
15  Drupal.behaviors.mathjax = {
16    attach: function (context, settings) {
17      $(document).ajaxComplete(function () {
18        MathJax.Hub.Queue(['Typeset', MathJax.Hub]);
19      });
20      if (settings.mathjax.config_type === 0) {
21        $('body').addClass('tex2jax_ignore');
22      }
23    }
24  };
25
26}(jQuery, Drupal, document, MathJax));
27;
28/**
29* DO NOT EDIT THIS FILE.
30* See the following change record for more information,
31* https://www.drupal.org/node/2815083
32* @preserve
33**/
34
35Drupal.debounce = function (func, wait, immediate) {
36  var timeout;
37  var result;
38  return function () {
39    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
40      args[_key] = arguments[_key];
41    }
42
43    var context = this;
44
45    var later = function later() {
46      timeout = null;
47
48      if (!immediate) {
49        result = func.apply(context, args);
50      }
51    };
52
53    var callNow = immediate && !timeout;
54    clearTimeout(timeout);
55    timeout = setTimeout(later, wait);
56
57    if (callNow) {
58      result = func.apply(context, args);
59    }
60
61    return result;
62  };
63};;
64/**
65* DO NOT EDIT THIS FILE.
66* See the following change record for more information,
67* https://www.drupal.org/node/2815083
68* @preserve
69**/
70
71(function ($, Drupal, debounce) {
72  $.fn.drupalGetSummary = function () {
73    var callback = this.data('summaryCallback');
74    return this[0] && callback ? $.trim(callback(this[0])) : '';
75  };
76
77  $.fn.drupalSetSummary = function (callback) {
78    var self = this;
79
80    if (typeof callback !== 'function') {
81      var val = callback;
82
83      callback = function callback() {
84        return val;
85      };
86    }
87
88    return this.data('summaryCallback', callback).off('formUpdated.summary').on('formUpdated.summary', function () {
89      self.trigger('summaryUpdated');
90    }).trigger('summaryUpdated');
91  };
92
93  Drupal.behaviors.formSingleSubmit = {
94    attach: function attach() {
95      function onFormSubmit(e) {
96        var $form = $(e.currentTarget);
97        var formValues = $form.serialize();
98        var previousValues = $form.attr('data-drupal-form-submit-last');
99
100        if (previousValues === formValues) {
101          e.preventDefault();
102        } else {
103          $form.attr('data-drupal-form-submit-last', formValues);
104        }
105      }
106
107      $('body').once('form-single-submit').on('submit.singleSubmit', 'form:not([method~="GET"])', onFormSubmit);
108    }
109  };
110
111  function triggerFormUpdated(element) {
112    $(element).trigger('formUpdated');
113  }
114
115  function fieldsList(form) {
116    var $fieldList = $(form).find('[name]').map(function (index, element) {
117      return element.getAttribute('id');
118    });
119    return $.makeArray($fieldList);
120  }
121
122  Drupal.behaviors.formUpdated = {
123    attach: function attach(context) {
124      var $context = $(context);
125      var contextIsForm = $context.is('form');
126      var $forms = (contextIsForm ? $context : $context.find('form')).once('form-updated');
127      var formFields;
128
129      if ($forms.length) {
130        $.makeArray($forms).forEach(function (form) {
131          var events = 'change.formUpdated input.formUpdated ';
132          var eventHandler = debounce(function (event) {
133            triggerFormUpdated(event.target);
134          }, 300);
135          formFields = fieldsList(form).join(',');
136          form.setAttribute('data-drupal-form-fields', formFields);
137          $(form).on(events, eventHandler);
138        });
139      }
140
141      if (contextIsForm) {
142        formFields = fieldsList(context).join(',');
143        var currentFields = $(context).attr('data-drupal-form-fields');
144
145        if (formFields !== currentFields) {
146          triggerFormUpdated(context);
147        }
148      }
149    },
150    detach: function detach(context, settings, trigger) {
151      var $context = $(context);
152      var contextIsForm = $context.is('form');
153
154      if (trigger === 'unload') {
155        var $forms = (contextIsForm ? $context : $context.find('form')).removeOnce('form-updated');
156
157        if ($forms.length) {
158          $.makeArray($forms).forEach(function (form) {
159            form.removeAttribute('data-drupal-form-fields');
160            $(form).off('.formUpdated');
161          });
162        }
163      }
164    }
165  };
166  Drupal.behaviors.fillUserInfoFromBrowser = {
167    attach: function attach(context, settings) {
168      var userInfo = ['name', 'mail', 'homepage'];
169      var $forms = $('[data-user-info-from-browser]').once('user-info-from-browser');
170
171      if ($forms.length) {
172        userInfo.forEach(function (info) {
173          var $element = $forms.find("[name=".concat(info, "]"));
174          var browserData = localStorage.getItem("Drupal.visitor.".concat(info));
175          var emptyOrDefault = $element.val() === '' || $element.attr('data-drupal-default-value') === $element.val();
176
177          if ($element.length && emptyOrDefault && browserData) {
178            $element.val(browserData);
179          }
180        });
181      }
182
183      $forms.on('submit', function () {
184        userInfo.forEach(function (info) {
185          var $element = $forms.find("[name=".concat(info, "]"));
186
187          if ($element.length) {
188            localStorage.setItem("Drupal.visitor.".concat(info), $element.val());
189          }
190        });
191      });
192    }
193  };
194
195  var handleFragmentLinkClickOrHashChange = function handleFragmentLinkClickOrHashChange(e) {
196    var url;
197
198    if (e.type === 'click') {
199      url = e.currentTarget.location ? e.currentTarget.location : e.currentTarget;
200    } else {
201      url = window.location;
202    }
203
204    var hash = url.hash.substr(1);
205
206    if (hash) {
207      var $target = $("#".concat(hash));
208      $('body').trigger('formFragmentLinkClickOrHashChange', [$target]);
209      setTimeout(function () {
210        return $target.trigger('focus');
211      }, 300);
212    }
213  };
214
215  var debouncedHandleFragmentLinkClickOrHashChange = debounce(handleFragmentLinkClickOrHashChange, 300, true);
216  $(window).on('hashchange.form-fragment', debouncedHandleFragmentLinkClickOrHashChange);
217  $(document).on('click.form-fragment', 'a[href*="#"]', debouncedHandleFragmentLinkClickOrHashChange);
218})(jQuery, Drupal, Drupal.debounce);;
219/**
220* DO NOT EDIT THIS FILE.
221* See the following change record for more information,
222* https://www.drupal.org/node/2815083
223* @preserve
224**/
225
226(function ($, Drupal) {
227  function DetailsSummarizedContent(node) {
228    this.$node = $(node);
229    this.setupSummary();
230  }
231
232  $.extend(DetailsSummarizedContent, {
233    instances: []
234  });
235  $.extend(DetailsSummarizedContent.prototype, {
236    setupSummary: function setupSummary() {
237      this.$detailsSummarizedContentWrapper = $(Drupal.theme('detailsSummarizedContentWrapper'));
238      this.$node.on('summaryUpdated', $.proxy(this.onSummaryUpdated, this)).trigger('summaryUpdated').find('> summary').append(this.$detailsSummarizedContentWrapper);
239    },
240    onSummaryUpdated: function onSummaryUpdated() {
241      var text = $.trim(this.$node.drupalGetSummary());
242      this.$detailsSummarizedContentWrapper.html(Drupal.theme('detailsSummarizedContentText', text));
243    }
244  });
245  Drupal.behaviors.detailsSummary = {
246    attach: function attach(context) {
247      var $detailsElements = $(context).find('details').once('details');
248      DetailsSummarizedContent.instances = DetailsSummarizedContent.instances.concat($detailsElements.map(function (index, details) {
249        return new DetailsSummarizedContent(details);
250      }).get());
251    }
252  };
253  Drupal.DetailsSummarizedContent = DetailsSummarizedContent;
254
255  Drupal.theme.detailsSummarizedContentWrapper = function () {
256    return "<span class=\"summary\"></span>";
257  };
258
259  Drupal.theme.detailsSummarizedContentText = function (text) {
260    return text ? " (".concat(text, ")") : '';
261  };
262})(jQuery, Drupal);;
263/**
264* DO NOT EDIT THIS FILE.
265* See the following change record for more information,
266* https://www.drupal.org/node/2815083
267* @preserve
268**/
269
270(function ($, Drupal) {
271  Drupal.behaviors.detailsAria = {
272    attach: function attach() {
273      $('body').once('detailsAria').on('click.detailsAria', 'summary', function (event) {
274        var $summary = $(event.currentTarget);
275        var open = $(event.currentTarget.parentNode).attr('open') === 'open' ? 'false' : 'true';
276        $summary.attr({
277          'aria-expanded': open,
278          'aria-pressed': open
279        });
280      });
281    }
282  };
283})(jQuery, Drupal);;
284/**
285* DO NOT EDIT THIS FILE.
286* See the following change record for more information,
287* https://www.drupal.org/node/2815083
288* @preserve
289**/
290
291(function ($, Modernizr, Drupal) {
292  function CollapsibleDetails(node) {
293    this.$node = $(node);
294    this.$node.data('details', this);
295    var anchor = window.location.hash && window.location.hash !== '#' ? ", ".concat(window.location.hash) : '';
296
297    if (this.$node.find(".error".concat(anchor)).length) {
298      this.$node.attr('open', true);
299    }
300
301    this.setupSummaryPolyfill();
302  }
303
304  $.extend(CollapsibleDetails, {
305    instances: []
306  });
307  $.extend(CollapsibleDetails.prototype, {
308    setupSummaryPolyfill: function setupSummaryPolyfill() {
309      var $summary = this.$node.find('> summary');
310      $('<span class="details-summary-prefix visually-hidden"></span>').append(this.$node.attr('open') ? Drupal.t('Hide') : Drupal.t('Show')).prependTo($summary).after(document.createTextNode(' '));
311      $('<a class="details-title"></a>').attr('href', "#".concat(this.$node.attr('id'))).prepend($summary.contents()).appendTo($summary);
312      $summary.append(this.$summary).on('click', $.proxy(this.onSummaryClick, this));
313    },
314    onSummaryClick: function onSummaryClick(e) {
315      this.toggle();
316      e.preventDefault();
317    },
318    toggle: function toggle() {
319      var _this = this;
320
321      var isOpen = !!this.$node.attr('open');
322      var $summaryPrefix = this.$node.find('> summary span.details-summary-prefix');
323
324      if (isOpen) {
325        $summaryPrefix.html(Drupal.t('Show'));
326      } else {
327        $summaryPrefix.html(Drupal.t('Hide'));
328      }
329
330      setTimeout(function () {
331        _this.$node.attr('open', !isOpen);
332      }, 0);
333    }
334  });
335  Drupal.behaviors.collapse = {
336    attach: function attach(context) {
337      if (Modernizr.details) {
338        return;
339      }
340
341      var $collapsibleDetails = $(context).find('details').once('collapse').addClass('collapse-processed');
342
343      if ($collapsibleDetails.length) {
344        for (var i = 0; i < $collapsibleDetails.length; i++) {
345          CollapsibleDetails.instances.push(new CollapsibleDetails($collapsibleDetails[i]));
346        }
347      }
348    }
349  };
350
351  var handleFragmentLinkClickOrHashChange = function handleFragmentLinkClickOrHashChange(e, $target) {
352    $target.parents('details').not('[open]').find('> summary').trigger('click');
353  };
354
355  $('body').on('formFragmentLinkClickOrHashChange.details', handleFragmentLinkClickOrHashChange);
356  Drupal.CollapsibleDetails = CollapsibleDetails;
357})(jQuery, Modernizr, Drupal);;
358jQuery(document).ready(function($) {
359  $(window).scroll(function() {
360    if($(this).scrollTop() != 0) {
361      $(".to-top").addClass("show");
362    } else {
363      $(".to-top").removeClass("show");
364    }
365  });
366
367  $(".to-top").click(function() {
368    $("body,html").animate({scrollTop:0},800);
369  });
370});
371;

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.