This repository was archived by the owner on Sep 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 340
14652 frontpage style #35
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
30c5035
Fix println! spacing, clean up comments
jasonkliu f5d1755
Add Playground button
jasonkliu 28ec203
Add Font-awesome output button to result div
jasonkliu ee08e9d
Take Editor contents and run them in the Rust playground
jasonkliu 88aa1ef
Modify comments to add/subtract/multiply/divide, remove playground bu…
jasonkliu 8e00331
Remove the replacement of line breaks by putting output button first
jasonkliu 6b6f667
Replace font-awesome css with fontello svg font
jasonkliu 2c3a69e
Modify HTML link from editor.js, add playground link on error
jasonkliu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,10 +121,14 @@ function handleResult(statusCode, message) { | |
} | ||
} | ||
|
||
// Called on successful program run | ||
// Called on successful program run: take edit contents and run in playground | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "take edit contents and run in playground" isn't what's going on here. This piece of code is run after the user's code has run in the playground. |
||
function handleSuccess(message) { | ||
resultDiv.style.backgroundColor = successColor; | ||
resultDiv.innerHTML = escapeHTML(message); | ||
var program = encodeURIComponent(editor.getValue()); | ||
var output = "<a href=\"http://play.rust-lang.org/?code=" + program + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mixing in HTML with JS isn't good style. Instead, place the HTML with the rest of the markup and simply change the HREF when the result is changed. Note: What do you do when there is an error, or when the result pane is open but the code in the editor has changed and hasn't been rerun? |
||
"&run=1\"><i class=\"fa fa-external-link\"></i></a>" | ||
// console.log(output); | ||
resultDiv.innerHTML = output + escapeHTML(message); | ||
} | ||
|
||
// Called when program run results in warning(s) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the entire font-awesome CSS file? Can't we simply use an image or the relevant icon line? Also, can we have the image be closer in scale and color to the mockup I posted earlier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need a single icon, just use an online bundler to only get that single font from font awesome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fontello.com