Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upConvert playpen.js to plain JS #26037
Conversation
rust-highfive
assigned
steveklabnik
Jun 5, 2015
This comment has been minimized.
This comment has been minimized.
|
Wow, nice! Obviously jquery gives us some pretty nice browser compat guarantees. What have you tested this on, and what do you expect this to not work on? |
This comment has been minimized.
This comment has been minimized.
|
Thanks, Gankro! I took some tips from http://youmightnotneedjquery.com/. I have personally tested it on Firefox 38, Chrome 43, and IE 11 (also tested it in IE 10 and IE 9 mode via the developer tools) on Win 7. I expect IE 8 and lower to not work (which would be the same as it is today). Also, the "mouseenter" and "mouseleave" events may have less support than jQuery, see: If it's a problem, I think I could re-write it to use the less-friendly, |
This comment has been minimized.
This comment has been minimized.
|
Compatibility looks adequate. I'm inclined to r+, but I'm hesitant to do so without checking out a live build. Would you be able to build of the docs with this change and host it somewhere we can poke at to verify nothing's broken? If this isn't easy for you, I don't think it's necessary since this is pretty self-contained. |
This comment has been minimized.
This comment has been minimized.
|
Cool, alright. It's not terribly easy for me, but I think I have my machine at home set up to compile rust and build docs now, so I can give it a whirl this evening. I can host it someplace, no problem. |
This comment has been minimized.
This comment has been minimized.
|
Nice! You don't need to build the entirety of rustc for this. Just copy the rendered docs folder from your install and replace the JS files :) |
This comment has been minimized.
This comment has been minimized.
|
@killercup Oh, that's actually how I worked on this and tested it locally. I assumed @granko wants the full build since this PR does touch the build.rs and javascript.rs files as well, though. But if copying the rendered docs and replacing the JS files is sufficient, it'll save me some time. |
This comment has been minimized.
This comment has been minimized.
|
Well, you are just deleting lines there… But let the mighty @Gankro decide whether another innocent person should become part of the Elite-That-Can-Build-Rustc™ ;) |
This comment has been minimized.
This comment has been minimized.
|
Yeah feel free to just copy the files. On Fri, Jun 5, 2015 at 12:36 PM, Nick Howell notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
It looks like this PR needs to be rebased and squashed, there's a lot of extra commits in here. Everyone else has asked the same things I would ask, so r=me after the git situation is fixed up. |
nhowell
force-pushed the
nhowell:plain_js_playpen
branch
from
fc73303
to
8c12dc0
Jun 12, 2015
This comment has been minimized.
This comment has been minimized.
|
Sorry for the mess. I've finally got this cleaned up and I've put the docs online with the plain JS version of playpen.js as mentioned before. Examples for your testing: |
This comment has been minimized.
This comment has been minimized.
|
Well, rats. I've noticed that it doesn't work in iOS Safari now. I'll figure out what's wrong and update the PR. |
nhowell
force-pushed the
nhowell:plain_js_playpen
branch
from
8c12dc0
to
95dc32d
Jun 12, 2015
This comment has been minimized.
This comment has been minimized.
|
Ok, I've fixed it up to work in iOS Safari. Give it a test (same links as above) and see what you guys think. I had to use mouseover/mouseout instead of mouseenter/mouseleave due to Safari's lack of support. |
This comment has been minimized.
This comment has been minimized.
|
@steveklabnik Just wanted to ping you to see if this PR can be approved. Thanks. |
This comment has been minimized.
This comment has been minimized.
|
@bors: r+ rollup |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Thanks nick! |
nhowell commentedJun 5, 2015
Since the "Book" already avoids jQuery in its inline script tags and playpen.js is tiny, I figured I would convert it to plain old JS as well.
Side note: This is a separate issue, but another thing I noticed in my testing is that the "⇱" character doesn't display correctly in Chrome on Windows 7. (Firefox and IE work fine; other browsers not tested)
r? @steveklabnik
Edit: Github didn't like the "script" tag above
Edit 2: Actually, now IE seems to render "⇱" fine for me. Odd.