diff --git a/core/includes/common.inc b/core/includes/common.inc index 4229d52..ea3f21c 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -3995,6 +3995,7 @@ function drupal_add_js($data = NULL, $options = NULL) { // Register all required libraries. drupal_add_library('system', 'jquery', TRUE); drupal_add_library('system', 'jquery.once', TRUE); + drupal_add_library('system', 'html5shim', TRUE); } switch ($options['type']) { diff --git a/core/modules/simpletest/tests/common.test b/core/modules/simpletest/tests/common.test index c9640ba..6411592 100644 --- a/core/modules/simpletest/tests/common.test +++ b/core/modules/simpletest/tests/common.test @@ -1191,6 +1191,7 @@ class JavaScriptTestCase extends DrupalWebTestCase { $javascript = drupal_add_js('core/misc/collapse.js'); $this->assertTrue(array_key_exists('core/misc/jquery.js', $javascript), t('jQuery is added when a file is added.')); $this->assertTrue(array_key_exists('core/misc/drupal.js', $javascript), t('Drupal.js is added when file is added.')); + $this->assertTrue(array_key_exists('core/misc/html5.js', $javascript), t('html5.js is added when file is added.')); $this->assertTrue(array_key_exists('core/misc/collapse.js', $javascript), t('JavaScript files are correctly added.')); $this->assertEqual(base_path(), $javascript['settings']['data'][0]['basePath'], t('Base path JavaScript setting is correctly set.')); url('', array('prefix' => &$prefix)); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 27e20b5..83de781 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1240,6 +1240,20 @@ function system_library_info() { ), ); + // html5shim. + $libraries['html5shim'] = array( + 'title' => 'html5shim', + 'website' => 'http://html5shim.googlecode.com/svn/trunk/html5.js', + 'version' => '1.0', + 'js' => array( + 'core/misc/html5.js' => array( + 'group' => JS_LIBRARY, + 'weight' => -21, + 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE,), + ), + ), + ); + // Cookie. $libraries['jquery.cookie'] = array( 'title' => 'Cookie',