1(function ($) { 2 3 /** 4 * Google CSE utility functions. 5 */ 6 Drupal.googleCSE = Drupal.googleCSE || {}; 7 8 Drupal.behaviors.googleCSE = { 9 attach: function (context, settings) { 10 // Show watermark, if not disabled in module settings. 11 if (Drupal.settings.googleCSE.showWaterMark) { 12 Drupal.googleCSE.googleCSEWatermark('#search-block-form.google-cse', context); 13 Drupal.googleCSE.googleCSEWatermark('#search-form.google-cse', context); 14 Drupal.googleCSE.googleCSEWatermark('#google-cse-results-searchbox-form', context); 15 } 16 } 17 }; 18 19 /** 20 * Show google CSE watermark. 21 */ 22 Drupal.googleCSE.googleCSEWatermark = function(id, context) { 23 var f = $(id, context)[0]; 24 if (f && (f.query || f['edit-search-block-form--2'] || f['edit-keys'])) { 25 var q = f.query ? f.query : (f['edit-search-block-form--2'] ? f['edit-search-block-form--2'] : f['edit-keys']); 26 var n = navigator; 27 var l = location; 28 if (n.platform == 'Win32') { 29 q.style.cssText = 'border: 1px solid #7e9db9; padding: 2px;'; 30 } 31 var b = function () { 32 if (q.value == '') { 33 q.style.background = '#FFFFFF url(https://www.google.com/cse/intl/' + Drupal.settings.googleCSE.language + '/images/google_custom_search_watermark.gif) left no-repeat'; 34 } 35 }; 36 var f = function () { 37 q.style.background = '#ffffff'; 38 }; 39 q.onfocus = f; 40 q.onblur = b; 41// if (!/[&?]query=[^&]/.test(l.search)) { 42 b(); 43// } 44 } 45 }; 46 47})(jQuery);
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.