From 924617b894765990cdc488a9e87e0d2e8e033f50 Mon Sep 17 00:00:00 2001
From: barrett <barrett@52745.no-reply.drupal.org>
Date: Sun, 20 May 2012 13:22:24 -0600
Subject: [PATCH 1/2] #1513994: re-roll to include latest changes in dev
 branch

---
 usasearch.info   |    7 ++++---
 usasearch.module |    9 +++++----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/usasearch.info b/usasearch.info
index 2f6a639..d6d72d8 100644
--- a/usasearch.info
+++ b/usasearch.info
@@ -1,7 +1,8 @@
 name = USASearch
 description = "Provides customized search using the General Services Administration's USASearch program"
-core = 6.x
-dependencies[] = search
-dependencies[] = jquery_update
+core = 7.x
 configure = admin/settings/usasearch
 package = USASearch
+
+dependencies[] = search
+dependencies[] = jquery_update
diff --git a/usasearch.module b/usasearch.module
index 44d2252..302abe0 100644
--- a/usasearch.module
+++ b/usasearch.module
@@ -80,10 +80,11 @@ function usasearch_preprocess_page(&$variables) {
     // Add external scripts into $variables['head'], instead of $variables['scripts'], due to jquery_update module, any 6-2x version as of 12/29/2011, clobbering $variables['scripts'].
     // This also means we need to defer the script loading so that they see the jquery javascript since these lines will print before the jquery script include.
     // See jquery_update module issue http://drupal.org/node/965680 for more information and to check the status of this problem.
-    $variables['head'] .= '<script type="text/javascript" defer="defer" src="http://search.usa.gov/javascripts/jquery/jquery.autocomplete.min.js"></script>' . "\n";
-    $variables['head'] .= '<script type="text/javascript" defer="defer" src="http://search.usa.gov/javascripts/sayt.js"></script>' . "\n";
+    drupal_add_js('http://search.usa.gov/javascripts/jquery/jquery.autocomplete.min.js', array('type' => 'external', 'defer' => TRUE));
+    drupal_add_js('http://search.usa.gov/javascripts/sayt.js', array('type' => 'external', 'defer' => TRUE));
+
     // Add external css.
-    $variables['styles'] .= '<link type="text/css" rel="stylesheet" media="all" href="http://search.usa.gov/stylesheets/compiled/sayt.css" />' . "\n";
+    drupal_add_css('http://search.usa.gov/stylesheets/compiled/sayt.css', array('type' => 'external', 'media' => 'all'));
 
     // Check for usasearch_affiliate_id variable, if set output javascript inline WITH affilite id to limit suggestions.
     if ($affiliate_id = check_plain(variable_get('usasearch_affiliate_id', ''))) {
@@ -98,7 +99,7 @@ function usasearch_preprocess_page(&$variables) {
   if (variable_get('usasearch_discovery_tag', 1)) {
     if ($affiliate_name = check_plain(variable_get('usasearch_affiliate_name', ''))) {
       $inline_js .= "var aid = '$affiliate_name';";
-      $variables['head'] .= '<script type="text/javascript" defer="defer" src="http://search.usa.gov/javascripts/stats.js"></script>' . "\n";
+      drupal_add_js('http://search.usa.gov/javascripts/stats.js', array('type' => 'external', 'media' => 'all'));
     }
   }
   // Output contents of $inline_js into one combined inline javascript tag using drupal_add_js function.
-- 
1.7.6


From b4a8a90c07c00c0da349771feabf6baf80ae39df Mon Sep 17 00:00:00 2001
From: barrett <barrett@52745.no-reply.drupal.org>
Date: Sun, 20 May 2012 13:37:58 -0600
Subject: [PATCH 2/2] #1513994: #attribute class property for FAPI must be an
 array

---
 usasearch.module |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/usasearch.module b/usasearch.module
index 302abe0..a84421c 100644
--- a/usasearch.module
+++ b/usasearch.module
@@ -189,7 +189,7 @@ function usasearch_form_alter(&$form, &$form_state, $form_id) {
       unset($form['advanced']);
       // Add autocomplete classes and set autocomplete HTML attribute to off on text field for type-ahead feature.
       if (variable_get('usasearch_typeahead', 1)) {
-        $form['basic']['inline']['keys']['#attributes'] = array('class' => 'usagov-search-autocomplete ui-autocomplete-input ui-corner-all', 'autocomplete' => 'off');
+        $form['basic']['inline']['keys']['#attributes'] = array('class' => array('usagov-search-autocomplete', 'ui-autocomplete-input', 'ui-corner-all'), 'autocomplete' => 'off');
       }
     }
     else {
@@ -198,7 +198,7 @@ function usasearch_form_alter(&$form, &$form_state, $form_id) {
       $form[$form_id]['#title'] = t('Search using USASearch');
       // Add autocomplete classes and set autocomplete HTML attribute to off on text field for type-ahead feature.
       if (variable_get('usasearch_typeahead', 1)) {
-        $form[$form_id]['#attributes'] = array('class' => 'usagov-search-autocomplete ui-autocomplete-input ui-corner-all', 'autocomplete' => 'off');
+        $form[$form_id]['#attributes'] = array('class' => array('usagov-search-autocomplete', 'ui-autocomplete-input', 'ui-corner-all'), 'autocomplete' => 'off');
       }
     }
   }
-- 
1.7.6

