diff --git a/core/modules/simpletest/simpletest.css b/core/modules/simpletest/simpletest.css index b2addeb..793e357 100644 --- a/core/modules/simpletest/simpletest.css +++ b/core/modules/simpletest/simpletest.css @@ -118,8 +118,8 @@ a.simpletest-collapse:hover { } #previous-fail div, #next-fail div { - width: 0; - height: 0; + width: 0; + height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; margin: 3px; diff --git a/core/modules/simpletest/simpletest.js b/core/modules/simpletest/simpletest.js index 344b34e..7b9dea8 100644 --- a/core/modules/simpletest/simpletest.js +++ b/core/modules/simpletest/simpletest.js @@ -104,9 +104,9 @@ Drupal.behaviors.simpleTestSelectAll = { */ Drupal.behaviors.simpleTestScrollFails = { attach: function (context, settings) { - - if (Drupal.settings.simpletest) { - var fails = Drupal.settings.simpletest.fails + + if (settings.simpletest) { + var fails = settings.simpletest.fails; } else { return; @@ -115,7 +115,7 @@ Drupal.behaviors.simpleTestScrollFails = { $('body').append('
'); var currentFail = -1; - var disableScroll = function() { + var disableScroll = function() { $('.assertion-navigation .disabled').removeClass('disabled'); if (!fails[currentFail - 1]) { $('#previous-fail').addClass('disabled') @@ -123,9 +123,9 @@ Drupal.behaviors.simpleTestScrollFails = { if (!fails[currentFail + 1]) { $('#next-fail').addClass('disabled') } - } + }; - var scroll = function() { + var scroll = function() { // Use sticky table header position as offset. var offset = $('.sticky-header').css('top'); var message = $("#message-" + fails[currentFail]); @@ -133,7 +133,7 @@ Drupal.behaviors.simpleTestScrollFails = { $('html, body').animate({scrollTop: message.offset().top - offset - 25}, 500); message.effect("highlight", {color:'red'}, 1000); disableScroll(); - } + }; disableScroll(); @@ -143,7 +143,7 @@ Drupal.behaviors.simpleTestScrollFails = { scroll(); } }); - + $("#previous-fail").click(function() { if (fails[currentFail - 1]) { currentFail--; diff --git a/core/modules/simpletest/simpletest.pages.inc b/core/modules/simpletest/simpletest.pages.inc index e8695b3..ed6ac4b 100644 --- a/core/modules/simpletest/simpletest.pages.inc +++ b/core/modules/simpletest/simpletest.pages.inc @@ -216,8 +216,7 @@ function simpletest_result_form($form, &$form_state, $test_id) { } // Load all classes and include CSS. - drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css'); - drupal_add_js(drupal_get_path('module', 'simpletest') . '/simpletest.js'); + $form['#attached']['library'][] = array('simpletest', 'drupal.simpletest'); // Keep track of which test cases passed or failed. $filter = array( @@ -334,7 +333,7 @@ function simpletest_result_form($form, &$form_state, $test_id) { '#title' => t('Return to list'), '#href' => 'admin/config/development/testing', ); - + $form['#attached']['js'][] = array( 'data' => array('simpletest' => array('fails' => $fails)), 'type' => 'setting',