PageSourceSearch

https://www.jenkins.io/js/feedback-form-functionality.js

js jenkins.io collected 2026-10-01 06:04:51 UTC 1,417 bytes, 42 lines download raw bytes

1// On loading up the window's content, this JavaScript code stores the value
2// of the current page's URL in the variable "feedbackPageUrl" in the
3// browser's local storage.
4
5if (typeof feedbackForm === 'undefined') {
6  var feedbackForm = { start : function() {} };
7}
8else {
9  feedbackForm.start = function(currentUrl) {
10    var ref = document.getElementById('current-url');
11    ref.value = currentUrl;
12    localStorage.setItem("feedbackPageUrl",ref.value);
13  };
14}
15
16// This JavaScript code requires the user to add 2 integers (i.e. first <= 10
17// and the next <= 10) together in order to successfully submit the form. This
18// is a type of client-side CAPTCHA.
19
20var formID = 'ss-form';
21var labelName = 'ssTestLabel';
22var testField = 'ssTestValue';
23var submitted = false;
24
25$(document).ready(function() {
26 var ssForm = $('#'+formID);
27
28 var randomInt1 = Math.floor((Math.random()*10)+1);
29 var randomInt2 = Math.floor((Math.random()*10)+1);
30 var answer = randomInt1+randomInt2;
31 $('#'+labelName).text('Type the answer to ' + randomInt1 + ' plus ' + randomInt2 + ' before clicking "Submit" below.');
32
33 ssForm.submit(function(evt){
34  if($('#'+testField).val() == answer){
35   ssForm.attr({'action' : 'https://docs.google.com/forms/d/' + feedbackForm.formKey + '/formResponse'});
36   return true;
37  }else{
38   alert('You need to enter the answer to ' + randomInt1 + ' plus ' + randomInt2 + '.');
39    return false;
40  }
41 });
42});

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.