I needed to disable to Google Watermark that appears in the search box and replace it with some custom text. If you want to disable the watermark, just go into the module's .info file and comment out (put a semicolon at the beginning of) the line that says:
scripts[] = google_cse.js
Attaching a patch too in case anyone else wants it.

CommentFileSizeAuthor
#2 google_cse-7.x-dev-no-watermark.patch351 bytesattheshow

Comments

attheshow’s picture

Status: Active » Closed (works as designed)

Closing issue.

attheshow’s picture

StatusFileSize
new351 bytes

Forgot to attach patch.

sirviejo’s picture

Status: Closed (works as designed) » Needs work

I understand that this could be consider that is working as designed. But the fact that does not allow any way for modules to disable this functionality breaks the standard Drupal extensibility.

Let me put my two cents about this:

Templates using html 5, can make use of the placeholder attrubute in wich case this script seems useless. In other hand the script should be using de Drupal Namespace and not in the global scope.

What if... you remove the script from the info file, add a new variable to the settings page to toggle this funcionality, and register this script in the hook_init only if the variable is set to true?.

theshanergy’s picture

This is an old thread and I'm surprised nothing has come of it. The javascript included in this module isn't pretty imo, and should be removed. It adds a colored border around the search input box, and messes with css background positioning. It doesn't seem to have any functional use, aside from presentation level css changes which should probably happen in the theme instead.

In Drupal 7 to disable this javascript, you may implement the following in your theme's template.php:

/**
 * Implements hook_js_alter().
 */
function themename_js_alter(&$javascript) {
  unset($javascript['sites/all/modules/google_cse/google_cse.js']);
}
osopolar’s picture

alexmoreno’s picture

Status: Needs work » Closed (duplicate)

this patch does not seem ready to merge (as it simply comments the google.js). So closing it, please refer to https://www.drupal.org/node/2498613