Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use AMD bootstrap in demos #1557

Closed
wants to merge 31 commits into from
Closed

Conversation

arschmitz
Copy link
Member

This adds an AMD bootstrap based off the one we use in tests for loading demos. For now this just switches the accordion and datepicker demos to cover the different use cases we have. PR for jqueryui.com to properly handle new demo layout coming shortly.

It also removes the accordion hover intent demo and a ie 6 /7 specific work around in the accordion demos

<link rel="stylesheet" href="../demos.css">
<script src="../require-config.js"></script>
<script src="../../external/requirejs/require.js"></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's clean up the mixing of <script> and <style> as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 i thought about doing this but wanted to leave as is until i asked

@jzaefferer
Copy link
Member

Overall looking good. Merging the two bootstrap files will make it even better.

@arschmitz
Copy link
Member Author

@jzaefferer addressed your comments

@jzaefferer
Copy link
Member

Nice, looks good to me.

@jzaefferer
Copy link
Member

I've pushed this branch to origin (this repo) for testing with jqueryui.com.

@scottgonzalez
Copy link
Member

What's the status of this?

@arschmitz
Copy link
Member Author

@scottgonzalez Waiting for your review


require( modules, function() {
$( "body" ).css( "visibility", "visible" );
eval( $( script ).html() );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to use $.globalEval() here.

@arschmitz
Copy link
Member Author

This is now update to cover all the demos

@arschmitz arschmitz changed the title Use AMD bootstrap in demos (WIP) Use AMD bootstrap in demos Jul 1, 2015
"effect-shake",
"effect-size",
"effect-slide"
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about this getting out of date (though honestly, I don't anticipate more effects). I suppose it will be obvious if this gets out of date though. Either the new effect just won't work in the demos or the demos will throw an error if we delete an effect.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we added a new effect it would also throw an error when you tried to run it if it was missing from this list.

@jzaefferer
Copy link
Member

None of the demos work for me. I load them, for example, as http://localhost/jquery-ui/demos/accordion/default.html

It fails to load http://localhost/external/jquery/jquery.js - note the missing "jquery-ui" part in the path.

I wanted to test demos/effect/easing.html since I don't understand how that loads the right modules.

@jzaefferer
Copy link
Member

Opening the globalize-dependent spinner demos causes errors when loading the locale files, e.g. demos/spinner/decimal.html throws "Uncaught TypeError: Cannot read property 'addCultureInfo' of undefined" in both globalize.culture.de-DE.js:28 and globalize.culture.ja-JP.js:28

The error doesn't always happen, so I guess sometimes they load in the "right" order, but mostly, I guess, this is failing due to missing dependencies from the culture files to the main globalize file.

@arschmitz
Copy link
Member Author

@jzaefferer thats odd works fine for me i originally had this problem but it should be fixed by
https://github.com/jquery/jquery-ui/pull/1557/files#diff-7f4d985c65eaba301a9f9aadcba63f0cR34

@jzaefferer
Copy link
Member

That link points at a datepicker demo diff, probably not what you intended.

I guess you're pointing at the shim in bootstrap.js - that makes sense, though I've never seen it uses with a wildcard.

If I simulate a "slower" network ("Good 3G" is bad enough), I always get the error.

@jzaefferer
Copy link
Member

Oh, just saw your new commit, that should fix it.

@jzaefferer
Copy link
Member

Still need to add demos/bootstrap.js to lint tasks, and fix a bunch of issues in there. Maybe add demos/**/*.js?

@arschmitz
Copy link
Member Author

@jzaefferer will do

@arschmitz
Copy link
Member Author

@jzaefferer updated

@@ -0,0 +1,60 @@
/* globals window:true, document:true, $:true */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ isn't used anymore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's also why the Travis build failed.

@arschmitz
Copy link
Member Author

@jzaefferer updated to remove $

@jzaefferer
Copy link
Member

Tested this properly, with the 1.12 DB changes and jquery/jqueryui.com#113. Still need to adjust the demo iframe and font-size, but that's a separate issue I'll deal with. For now, let's land this (and update core-brekaup on top) and land jquery/jqueryui.com#113 in a 1-12 branch. I'll then update the 1-12 branch with the font-size fix, along with jquery-wp-content (probably also a ui-1-12 branch).

@jzaefferer
Copy link
Member

ping @arschmitz - let's finish this, as outlined above, will also massively simplify the demos-half of the core-breakup.

arschmitz added a commit to arschmitz/jquery-ui that referenced this pull request Jul 21, 2015
arschmitz added a commit to arschmitz/jquery-ui that referenced this pull request Jul 21, 2015
arschmitz added a commit to arschmitz/jquery-ui that referenced this pull request Jul 21, 2015
@arschmitz arschmitz closed this in 7336a58 Jul 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants