]> source.dussan.org Git - jquery-ui.git/commitdiff
Tests: Fix AMD loading in IE8
authorScott González <scott.gonzalez@gmail.com>
Fri, 17 Apr 2015 16:13:38 +0000 (12:13 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 17 Apr 2015 16:13:38 +0000 (12:13 -0400)
It appears that we must load require.js via a standard script tag in order
for it to work properly in IE8.

27 files changed:
Gruntfile.js
tests/.jshintrc
tests/lib/bootstrap.js
tests/unit/accordion/accordion.html
tests/unit/autocomplete/autocomplete.html
tests/unit/button/button.html
tests/unit/core/core.html
tests/unit/datepicker/datepicker.html
tests/unit/dialog/deprecated.html
tests/unit/dialog/dialog.html
tests/unit/draggable/draggable.html
tests/unit/droppable/deprecated.html
tests/unit/droppable/droppable.html
tests/unit/effects/effects.html
tests/unit/menu/menu.html
tests/unit/position/position.html
tests/unit/progressbar/progressbar.html
tests/unit/resizable/resizable.html
tests/unit/selectable/selectable.html
tests/unit/selectmenu/selectmenu.html
tests/unit/slider/slider.html
tests/unit/sortable/sortable.html
tests/unit/spinner/spinner.html
tests/unit/tabs/tabs.html
tests/unit/tooltip/deprecated.html
tests/unit/tooltip/tooltip.html
tests/unit/widget/widget.html

index f1fb6c5d7da75aede6c406e9a3c95abae1302bdd..1040ebe27084f13608fafcf9016f1e9e3cd1e84e 100644 (file)
@@ -239,7 +239,8 @@ grunt.initConfig({
                        "ui/*.js",
                        "Gruntfile.js",
                        "build/**/*.js",
-                       "tests/unit/**/*.js"
+                       "tests/unit/**/*.js",
+                       "tests/lib/**/*.js"
                ]
        },
        csslint: {
index 25c688b792f134e4c24f62420c25d66098ad4df1..04d5371fc7ebfca8eb5b74d23f57c361798765c1 100644 (file)
@@ -6,7 +6,6 @@
        "expr": true,
        "immed": true,
        "noarg": true,
-       "onevar": true,
        "quotmark": "double",
        "smarttabs": true,
        "trailing": true,
@@ -31,6 +30,8 @@
                "notStrictEqual": false,
                "ok": false,
                "QUnit": true,
+               "require": true,
+               "requirejs": true,
                "start": false,
                "strictEqual": false,
                "stop": false,
index 7ca1bbda74929da6ae6e68d0c24a58a33d7da810..a381394a89fd9bd3ab9c4e4c06d1f8b88bbd0326 100644 (file)
@@ -1,6 +1,6 @@
 ( function() {
 
-window.requirejs = {
+requirejs.config({
        paths: {
                "globalize": "../../../external/globalize/globalize",
                "globalize/ja-JP": "../../../external/globalize/globalize.culture.ja-JP",
@@ -20,7 +20,19 @@ window.requirejs = {
                "qunit-assert-classes": [ "qunit" ],
                "qunit-assert-close": [ "qunit" ]
        }
-};
+});
+
+// Create a module that disables back compat for UI modules
+define( "jquery-no-back-compat", [ "jquery" ], function( $ ) {
+       $.uiBackCompat = false;
+
+       return $;
+} );
+
+// Create a dummy bridge if we're not actually testing in PhantomJS
+if ( !/PhantomJS/.test( navigator.userAgent ) ) {
+       define( "phantom-bridge", function() {} );
+}
 
 // Load all modules in series
 function requireModules( dependencies, callback, modules ) {
@@ -83,7 +95,7 @@ function jqueryUrl() {
        }
 
        return url;
-};
+}
 
 function swarmInject() {
        var url = parseUrl().swarmURL;
@@ -134,26 +146,7 @@ function swarmInject() {
                }
        }
 
-       // Load requirejs, then load the tests
-       script = document.createElement( "script" );
-       script.src = "../../../external/requirejs/require.js";
-       script.onload = function() {
-
-               // Create a module that disables back compat for UI modules
-               define( "jquery-no-back-compat", [ "jquery" ], function( $ ) {
-                       $.uiBackCompat = false;
-
-                       return $;
-               } );
-
-               // Create a dummy bridge if we're not actually testing in PhantomJS
-               if ( !/PhantomJS/.test( navigator.userAgent ) ) {
-                       define( "phantom-bridge", function() {} );
-               }
-
-               requireTests( modules, noBackCompat );
-       };
-       document.documentElement.appendChild( script );
+       requireTests( modules, noBackCompat );
 } )();
 
 } )();
index db206a2e597135eb1d564d8caa9e392e7371c2e6..683b87456cb4c0e21c4faad981281444ba391a80 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Accordion Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core accordion"></script>
        <script src="../../lib/bootstrap.js" data-widget="accordion"></script>
        <style>
index 90c8e8e97be54c405eb43fb38bc21db3208ff59b..484f2d95758de5045f5439018deaceeef4620d52 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Autocomplete Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core menu autocomplete"></script>
        <script src="../../lib/bootstrap.js" data-widget="autocomplete"></script>
 </head>
index df125867f330d48ba59f97eb02903d6dbb239ee0..7ba4006459299643e0809879133ac9298b96d366 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Button Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core button"></script>
        <script src="../../lib/bootstrap.js" data-widget="button"></script>
 </head>
index ae3a5037003f0e32e9ec65009a0ee065a4fb12b6..354fd8b8ea3914ba96e03fea555186359193081e 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Core Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js"></script>
        <script src="../../lib/bootstrap.js" data-modules="core selector"></script>
        <style>
index a0df70d74ff4cdd60ed6ac0a7beda00e1e31770d..26d8de3e0f8191d236e96e6b91ea8f6abe5b9eda 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Datepicker Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core datepicker"></script>
        <script src="../../lib/bootstrap.js" data-widget="datepicker"></script>
 </head>
index 2d20b62914c52f86bfd85c852667588e08653bfe..50bab180ddf9769c2cdbc2436d34f2a164fa9771 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Dialog Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core button dialog"></script>
        <script src="../../lib/bootstrap.js" data-widget="dialog" data-deprecated="true"></script>
 </head>
index aa0e3d3ec1cf6f18776aa1fabe57c518a4f78e74..bdba5e11cb62f06488fa917b18839e95601270e1 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Dialog Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core button dialog"></script>
        <script src="../../lib/bootstrap.js" data-widget="dialog" data-no-back-compat="true"></script>
 </head>
index 7ac6db38882c09a4e3593d83767f778f02f9adf3..0971b23250f84d7e398905580f155fc63e777d5a 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Draggable Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core"></script>
        <script src="../../lib/bootstrap.js" data-widget="draggable"></script>
        <style>
index e47b41c6bf698f492a81603150f5a21853e337d0..45bf1f460e67e14297acc4642904321db64cf9c4 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Droppable Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core"></script>
        <script src="../../lib/bootstrap.js" data-widget="droppable" data-deprecated="true"></script>
 </head>
index 9021f8c78065da5cdddcf6f52203d70bccaf037f..5c3ec3dd90a546e0a0f47177ac874ca4c7fa80fb 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Droppable Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core"></script>
        <script src="../../lib/bootstrap.js" data-widget="droppable"
                data-no-back-compat="true"></script>
index 91c31428c671a60b76743d55404f7d59a1cfc114..b9ea802d062eeea7adbb6f9cae370c76d1390eef 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Effects Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js"></script>
        <script src="../../lib/bootstrap.js" data-modules="core scale">
        </script>
index 5f11f441414ebdede03efaec414406c0cacef3e8..2d871a4b32795431b5ff8fac3f65b5e50db148ae 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Menu Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core menu"></script>
        <script src="../../lib/bootstrap.js" data-widget="menu"></script>
        <style>
index e36ab5480cbbe0542a21969fa2bf40fc38df0955..5f2a215326ee1141f370d67a94b3fb79e8a5d106 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Position Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js"></script>
        <script src="../../lib/bootstrap.js" data-modules="core"></script>
 </head>
index 351ed4e2180ab596d8e62db8da098c3a9b195e57..18a5195bc17be7306eea49a8235f1a2c9325c6cb 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Progressbar Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core progressbar"></script>
        <script src="../../lib/bootstrap.js" data-widget="progressbar"></script>
 </head>
index 5190e5f5c3ef8ce50e5c3cb49b3fdbc06a7ac480..e3550f31fe65c06534e2e88cb33b03ed919e7192 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Resizable Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core resizable"></script>
        <script src="../../lib/bootstrap.js" data-widget="resizable"></script>
        <style>
index 4486084e4bab93b3f8982f1f66f9f52f679c179f..9cee000c0c9b51661eecf3f5b6da9f8d5c1cfca9 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Selectable Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core selectable"></script>
        <script src="../../lib/bootstrap.js" data-widget="selectable"></script>
 </head>
index 0583733a0d0c051d628b75c1d76a1e95de371620..16e0f15a7ce9426c4c3101ee8cb1dd435f0d3552 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Selectmenu Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core menu selectmenu"></script>
        <script src="../../lib/bootstrap.js" data-widget="selectmenu"></script>
 </head>
index f19085fd46ecc022e4ba6a1580b9b58e8b80131e..a9ec5324f41def30dece7f78d208d4524d0a1175 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Slider Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core slider"></script>
        <script src="../../lib/bootstrap.js" data-widget="slider"></script>
 </head>
index a4c94ba0da44c437927bfbbb905aae42e2ba3cbc..8bfbd337088b25d037e4977db2c3059a054fbc25 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Sortable Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core"></script>
        <script src="../../lib/bootstrap.js" data-widget="sortable"></script>
        <style>
index 43ded34a722c68964deb3e4a53ca95b31fb75e3a..ff38f16a8b01f8b69987ed7bb2784d9c132d2ed0 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Spinner Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core button spinner"></script>
        <script src="../../lib/bootstrap.js" data-widget="spinner"></script>
 </head>
index 6d52a2490bce8e55a22e64847985c0b1751f1f73..cb4e5389f625eb7c38e69198d058c530ff9e884f 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Tabs Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core tabs"></script>
        <script src="../../lib/bootstrap.js" data-widget="tabs"></script>
        <style>
index d21fea57b338dcf9cd5a481bc1269a1f71ef43e5..f2d04f3d13ea0798e0deb617fb129b5b725e1503 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Tooltip Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core tooltip"></script>
        <script src="../../lib/bootstrap.js" data-widget="tooltip" data-deprecated="true"></script>
 </head>
index 1f0adc9f4626ae756d0a4a6f88adf1e731c8a775..b5561d926105c906c42e176f361265d9563863d1 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Tooltip Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core tooltip"></script>
        <script src="../../lib/bootstrap.js" data-widget="tooltip" data-no-back-compat="true"></script>
 </head>
index 0e9d500510cb3206c3f84162f3ac013a07ad87d3..3dea2ed6920ad9b8a8434d63332f4714d730e042 100644 (file)
@@ -4,6 +4,7 @@
        <meta charset="utf-8">
        <title>jQuery UI Widget Test Suite</title>
 
+       <script src="../../../external/requirejs/require.js"></script>
        <script src="../../lib/css.js" data-modules="core"></script>
        <script src="../../lib/bootstrap.js" data-modules="core extend animation classes">
        </script>