This repository has been archived by the owner on Jun 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 230
Embeddable repl #127
Open
joelmccracken
wants to merge
6
commits into
replit-archive:master
Choose a base branch
from
joelmccracken:embeddable-repl
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Embeddable repl #127
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ac572c9
provide embedded iframe info, preview functionality
701384e
add 'return' after url handling
d6d2c4f
implements header/footer hiding for embedding purposes
7e4a616
updates the styles for embedded REPL code
228a335
removes extra space
4f38c9f
Remove unless statement modifier and use if block
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 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 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<html> | ||
<head> | ||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> | ||
<style> | ||
div { background: blue; } | ||
</style> | ||
<script> | ||
$(function(){ | ||
var decodedEmbed = decodeURIComponent(window.location.search.split("=")[1]); | ||
$('#embed-preview').html(decodedEmbed); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<div id="embed-preview"> | ||
</div> | ||
</body> | ||
</html> |
This file contains 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 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 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 |
---|---|---|
|
@@ -38,6 +38,8 @@ $.fn.enableSelection = -> | |
'user-select': '' | ||
$this.each -> this.onselectstart = null | ||
|
||
isEmbed = -> | ||
window.location.search == "?embed=true" | ||
|
||
$.extend REPLIT, | ||
RESIZER_WIDTH: RESIZER_WIDTH | ||
|
@@ -52,6 +54,9 @@ $.extend REPLIT, | |
last_progress_ratio: 0 | ||
# Initialize the DOM (Runs before JSRPEL's load) | ||
InitDOM: -> | ||
if isEmbed() | ||
$("#header").hide() | ||
$("#footer").hide() | ||
@$doc_elem = $ 'html' | ||
# The main container holding the pages. | ||
@$container = $ '#main' | ||
|
@@ -254,7 +259,8 @@ $.extend REPLIT, | |
# Calculate container height and width. | ||
documentWidth = document.documentElement.clientWidth | ||
documentHeight = document.documentElement.clientHeight | ||
height = documentHeight - HEADER_HEIGHT - FOOTER_HEIGHT | ||
height = documentHeight | ||
height -= (HEADER_HEIGHT + FOOTER_HEIGHT) unless isEmbed() | ||
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. can we use |
||
width = documentWidth - @content_padding | ||
innerWidth = width - 2 * RESIZER_WIDTH | ||
|
||
|
This file contains 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
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.
extra space here
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.
oh yeah, I meant to suggest using a feature flag. Will add one soon.
On Thu, Dec 18, 2014 at 3:09 PM, Amjad Masad [email protected]
wrote: