1Drupal.locale = { 'strings': {"":{"Search":"Suchen"}} };; 2 3// Run the function as soon as it's called, but prevent further calls during `delay` ms 4// Example: function.throttle(200) will only run function() once every 200 ms. 5// Useful, for example, to avoid constant processing while typing in a live search box. 6Function.prototype.throttle = function(delay) { 7 var fn = this 8 return function() { 9 var now = (new Date).getTime() 10 if (!fn.lastExecuted || fn.lastExecuted + delay < now) { 11 fn.lastExecuted = now 12 fn.apply(fn, arguments) 13 } 14 } 15} 16 17 18// Instead of calling the function immediately, wait at least `delay` ms before calling it. 19// Example: function.debounce(200) will only call the function after a 200ms pause. 20// Useful, for example, to check an available username (wait to pause typing and check). 21Function.prototype.debounce = function(delay) { 22 var fn = this 23 return function() { 24 fn.args = arguments 25 fn.timeout_id && clearTimeout(fn.timeout_id) 26 fn.timeout_id = setTimeout(function() { return fn.apply(fn, fn.args) }, delay) 27 } 28}; 29(function ($) { 30 31 Drupal.behaviors.captcha = { 32 attach: function (context) { 33 34 // Turn off autocompletion for the CAPTCHA response field. 35 // We do it here with JavaScript (instead of directly in the markup) 36 // because this autocomplete attribute is not standard and 37 // it would break (X)HTML compliance. 38 $("#edit-captcha-response").attr("autocomplete", "off"); 39 40 } 41 }; 42 43 Drupal.behaviors.captchaAdmin = { 44 attach: function (context) { 45 // Add onclick handler to checkbox for adding a CAPTCHA description 46 // so that the textfields for the CAPTCHA description are hidden 47 // when no description should be added. 48 // @todo: div.form-item-captcha-description depends on theming, maybe 49 // it's better to add our own wrapper with id (instead of a class). 50 $("#edit-captcha-add-captcha-description").click(function() { 51 if ($("#edit-captcha-add-captcha-description").is(":checked")) { 52 // Show the CAPTCHA description textfield(s). 53 $("div.form-item-captcha-description").show('slow'); 54 } 55 else { 56 // Hide the CAPTCHA description textfield(s). 57 $("div.form-item-captcha-description").hide('slow'); 58 } 59 }); 60 // Hide the CAPTCHA description textfields if option is disabled on page load. 61 if (!$("#edit-captcha-add-captcha-description").is(":checked")) { 62 $("div.form-item-captcha-description").hide(); 63 } 64 } 65 66 }; 67 68})(jQuery); 69;
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.