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

Fixes run button appearing when it shouldn't #36637

Merged
merged 1 commit into from
Oct 9, 2016

Conversation

GuillaumeGomez
Copy link
Member

Fixes #36621.

r? @steveklabnik

@bluss
Copy link
Member

bluss commented Sep 22, 2016

Thanks!

@@ -15,6 +15,11 @@ document.addEventListener('DOMContentLoaded', function() {
'use strict';

if (!window.playgroundUrl) {
var run_buttons = document.querySelectorAll(".test-arrow");
Copy link
Member

Choose a reason for hiding this comment

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

Very very minor, but it looks like naming conventions in the rest of this file use camel case, not snake case.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's javascript, who cares. :trollface:

Copy link
Member

Choose a reason for hiding this comment

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

I think there is some value in caring about keeping consistent with naming conventions. It's not clear to me why we shouldn't care about JavaScript.

Copy link
Member Author

Choose a reason for hiding this comment

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

I used trollface to make sure people understand it was a troll. I failed :-/

I'll update later on.

@GuillaumeGomez
Copy link
Member Author

Updated.

@bluss
Copy link
Member

bluss commented Sep 29, 2016

I tried this locally and this does not fix the issue. playpen.js is not used at all for a crate without playgroundUrl configured.

See first and last lines in this range:

{play_js}
<script defer src="{root_path}search-index.js"></script>
</body>
</html>"##,
css_extension = if css_file_extension {
format!("<link rel=\"stylesheet\" type=\"text/css\" href=\"{root_path}theme.css\">",
root_path = page.root_path)
} else {
"".to_owned()
},
content = *t,
root_path = page.root_path,
css_class = page.css_class,
logo = if layout.logo.is_empty() {
"".to_string()
} else {
format!("<a href='{}{}/index.html'>\
<img src='{}' alt='logo' width='100'></a>",
page.root_path, layout.krate,
layout.logo)
},
title = page.title,
description = page.description,
keywords = page.keywords,
favicon = if layout.favicon.is_empty() {
"".to_string()
} else {
format!(r#"<link rel="shortcut icon" href="{}">"#, layout.favicon)
},
in_header = layout.external_html.in_header,
before_content = layout.external_html.before_content,
after_content = layout.external_html.after_content,
sidebar = *sidebar,
krate = layout.krate,
play_url = layout.playground_url,
play_js = if layout.playground_url.is_empty() {
"".to_string()
} else {
format!(r#"<script src="{}playpen.js"></script>"#, page.root_path)

@GuillaumeGomez
Copy link
Member Author

Strange. I'll retest once again. Thanks for your feedback @bluss!

@GuillaumeGomez
Copy link
Member Author

@bluss: Thanks for pointing me to this! Can you test it again please?

@bluss
Copy link
Member

bluss commented Oct 4, 2016

@GuillaumeGomez The fix looks like it will work to me. I would probably just put it in main.js, that simplifies things. Unfortunately I'd have to rebuild llvm to test the rustdoc build, and I don't have the time to do it.

@GuillaumeGomez
Copy link
Member Author

I don't want it all the time, I just want it in case playpen.js isn't present.

@GuillaumeGomez
Copy link
Member Author

Hum... I'll create another js file instead.

@GuillaumeGomez
Copy link
Member Author

Ok, seems like it's all good now.

@steveklabnik
Copy link
Member

@bluss what do you think of this PR now?

@bluss
Copy link
Member

bluss commented Oct 7, 2016

It looks like it will work fine. But since both extra.js, and playpen.js have the same snippet to remove the run buttons, that part, it might as well be in main.js instead?

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Oct 7, 2016

@bluss: No, the point is to avoid putting too much watchers. One by button is already enough. If you put this part in main.js, it means we'll have it duplicated since playpen.js (in case it'll be there) will still put the watcher on it.

I hope I wrote was clear enough. :-/

@bluss
Copy link
Member

bluss commented Oct 8, 2016

Oh I see, that makes sense.

@bluss
Copy link
Member

bluss commented Oct 8, 2016

@bors r+

Let's go.

@bors
Copy link
Contributor

bors commented Oct 8, 2016

📌 Commit 8983d1e has been approved by bluss

@GuillaumeGomez
Copy link
Member Author

@bors: rollup

@bors
Copy link
Contributor

bors commented Oct 8, 2016

⌛ Testing commit 8983d1e with merge fcc354f...

bors added a commit that referenced this pull request Oct 8, 2016
Fixes run button appearing when it shouldn't

Fixes #36621.

r? @steveklabnik
@bors
Copy link
Contributor

bors commented Oct 8, 2016

💔 Test failed - auto-mac-32-opt

@alexcrichton
Copy link
Member

@bors: retry

On Sat, Oct 8, 2016 at 12:36 PM, bors notifications@github.com wrote:

💔 Test failed - auto-mac-32-opt
https://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/10751


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#36637 (comment), or mute
the thread
/~https://github.com/notifications/unsubscribe-auth/AAD95JwRea2S2iHajCDiqOzIdDl_gSxQks5qx_CtgaJpZM4KDWCb
.

@bors
Copy link
Contributor

bors commented Oct 9, 2016

⌛ Testing commit 8983d1e with merge b98cc35...

bors added a commit that referenced this pull request Oct 9, 2016
Fixes run button appearing when it shouldn't

Fixes #36621.

r? @steveklabnik
@bors bors merged commit 8983d1e into rust-lang:master Oct 9, 2016
@GuillaumeGomez GuillaumeGomez deleted the fix_run_button branch October 9, 2016 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants