PageSourceSearch

https://smithgroup.com/core/misc/progress.js?v=9.4.6

js smithgroup.com collected 2026-10-02 03:56:19 UTC 2,922 bytes, 92 lines download raw bytes

1/**
2* DO NOT EDIT THIS FILE.
3* See the following change record for more information,
4* https://www.drupal.org/node/2815083
5* @preserve
6**/
7
8(function ($, Drupal) {
9  Drupal.theme.progressBar = function (id) {
10    return "<div id=\"".concat(id, "\" class=\"progress\" aria-live=\"polite\">") + '<div class="progress__label">&nbsp;</div>' + '<div class="progress__track"><div class="progress__bar"></div></div>' + '<div class="progress__percentage"></div>' + '<div class="progress__description">&nbsp;</div>' + '</div>';
11  };
12
13  Drupal.ProgressBar = function (id, updateCallback, method, errorCallback) {
14    this.id = id;
15    this.method = method || 'GET';
16    this.updateCallback = updateCallback;
17    this.errorCallback = errorCallback;
18    this.element = $(Drupal.theme('progressBar', id));
19  };
20
21  $.extend(Drupal.ProgressBar.prototype, {
22    setProgress: function setProgress(percentage, message, label) {
23      if (percentage >= 0 && percentage <= 100) {
24        $(this.element).find('div.progress__bar').css('width', "".concat(percentage, "%"));
25        $(this.element).find('div.progress__percentage').html("".concat(percentage, "%"));
26      }
27
28      $('div.progress__description', this.element).html(message);
29      $('div.progress__label', this.element).html(label);
30
31      if (this.updateCallback) {
32        this.updateCallback(percentage, message, this);
33      }
34    },
35    startMonitoring: function startMonitoring(uri, delay) {
36      this.delay = delay;
37      this.uri = uri;
38      this.sendPing();
39    },
40    stopMonitoring: function stopMonitoring() {
41      clearTimeout(this.timer);
42      this.uri = null;
43    },
44    sendPing: function sendPing() {
45      if (this.timer) {
46        clearTimeout(this.timer);
47      }
48
49      if (this.uri) {
50        var pb = this;
51        var uri = this.uri;
52
53        if (uri.indexOf('?') === -1) {
54          uri += '?';
55        } else {
56          uri += '&';
57        }
58
59        uri += '_format=json';
60        $.ajax({
61          type: this.method,
62          url: uri,
63          data: '',
64          dataType: 'json',
65          success: function success(progress) {
66            if (progress.status === 0) {
67              pb.displayError(progress.data);
68              return;
69            }
70
71            pb.setProgress(progress.percentage, progress.message, progress.label);
72            pb.timer = setTimeout(function () {
73              pb.sendPing();
74            }, pb.delay);
75          },
76          error: function error(xmlhttp) {
77            var e = new Drupal.AjaxError(xmlhttp, pb.uri);
78            pb.displayError("<pre>".concat(e.message, "</pre>"));
79          }
80        });
81      }
82    },
83    displayError: function displayError(string) {
84      var error = $('<div class="messages messages--error"></div>').html(string);
85      $(this.element).before(error).hide();
86
87      if (this.errorCallback) {
88        this.errorCallback(this);
89      }
90    }
91  });
92})(jQuery, Drupal);

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.