diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-09-30 09:49:13 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-09-30 17:55:20 +0200 |
commit | b698f809de908535acd93c690d90d867622ddd7e (patch) | |
tree | 0929237517ef5edde429a1ab615bcc22222f773b /demos | |
parent | c02f59981f4c8aa2c606e22e0325dd34457c8b45 (diff) | |
download | jquery-ui-b698f809de908535acd93c690d90d867622ddd7e.tar.gz jquery-ui-b698f809de908535acd93c690d90d867622ddd7e.zip |
Tests: Use demo bootstrap for visual tests
Adds a data-composite option and fixes paths for effects. Otherwise
just applies the same conversion as already applied to demos, sometimes
moving a <style> element to the right place.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/bootstrap.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/demos/bootstrap.js b/demos/bootstrap.js index b96620d6a..7a942374d 100644 --- a/demos/bootstrap.js +++ b/demos/bootstrap.js @@ -7,6 +7,7 @@ var script = scripts[ scripts.length - 1 ]; // Read the modules var modules = script.getAttribute( "data-modules" ); +var composite = script.getAttribute( "data-composite" ) || false; var pathParts = window.location.pathname.split( "/" ); var effectsAll = [ "effects/effect-blind", @@ -22,7 +23,8 @@ var effectsAll = [ "effects/effect-scale", "effects/effect-shake", "effects/effect-size", - "effects/effect-slide" + "effects/effect-slide", + "effects/effect-transfer" ]; var widgets = [ "accordion", @@ -52,8 +54,13 @@ function getPath( module ) { } } for ( var j = 0; j < effectsAll.length; j++ ) { - if ( module !== "effect" && effectsAll[ j ].indexOf( module ) !== -1 ) { - return "effects/" + module; + if ( module !== "effect" ) { + if ( effectsAll[ j ] === module ) { + return module; + } + if ( effectsAll[ j ].indexOf( module ) !== -1 ) { + return "effects/" + module; + } } } return module; @@ -69,7 +76,7 @@ function fixPaths( modules ) { document.documentElement.className = "demo-loading"; require.config( { - baseUrl: "../../ui", + baseUrl: window.location.pathname.indexOf( "demos/" ) !== -1 ? "../../ui" : "../../../ui", paths: { jquery: "../external/jquery/jquery", external: "../external/" @@ -86,7 +93,9 @@ if ( modules && modules.indexOf( "effects-all" ) !== -1 ) { } modules = modules ? modules.replace( /^\s+|\s+$/g, "" ).split( /\s+/ ) : []; -modules.push( pathParts[ pathParts.length - 2 ] ); +if ( !composite ) { + modules.push( pathParts[ pathParts.length - 2 ] ); +} modules = fixPaths( modules ); require( modules, function() { |