-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
WIP: Embedded Playground #4421
Open
f3l1x
wants to merge
4
commits into
phpstan:1.5.x
Choose a base branch
from
f3l1x:feature/embed
base: 1.5.x
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
WIP: Embedded Playground #4421
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
82fb141
Website: drop codemirror margin, setup margin manually
f3l1x 46ca48c
Website: refactor base layout to include header and analytics
f3l1x 0cc2c51
Website: introduce embed page with layout
f3l1x 92e2fe8
Website: playground support embed
f3l1x 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script> | ||
(function(f, a, t, h, o, m){ | ||
a[h]=a[h]||function(){ | ||
(a[h].q=a[h].q||[]).push(arguments) | ||
}; | ||
o=f.createElement('script'), | ||
m=f.getElementsByTagName('script')[0]; | ||
o.async=1; o.src=t; o.id='fathom-script'; | ||
m.parentNode.insertBefore(o,m) | ||
})(document, window, 'https://cdn.usefathom.com/tracker.js', 'fathom'); | ||
fathom('set', 'siteId', 'UDESFNRN'); | ||
fathom('trackPageview'); | ||
</script> |
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,22 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name='viewport' content='width=device-width, initial-scale=1'> | ||
<title>{{ title }} | PHPStan</title> | ||
<meta property="og:title" content="{{ title }}" /> | ||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css"> | ||
<link rel="stylesheet" href="/app.pcss"> | ||
|
||
{% if ogImage %} | ||
<meta property="og:image" content="{{ ogImage }}" /> | ||
<meta name="twitter:image" content="{{ ogImage }}" /> | ||
{% else %} | ||
<meta property="og:image" content="/images/logo-big.png" /> | ||
<meta name="twitter:image" content="/images/logo-big.png" /> | ||
{% endif %} | ||
<link rel="icon" type="image/png" href="/images/favicon.png"> | ||
|
||
<meta name="twitter:card" content="summary_large_image" /> | ||
<meta name="twitter:site" content="@phpstan" /> | ||
</head> |
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,11 @@ | ||
{% include './../_includes/header.njk' %} | ||
<body class="w-screen min-h-screen"> | ||
|
||
{% block content %}{% endblock %} | ||
|
||
{% block scripts %}{% endblock %} | ||
|
||
{% include './../_includes/analytics.njk' %} | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
title: Embedded Playground | ||
pageType: playground | ||
--- | ||
|
||
{% extends "./../_layouts/_embed.njk" %} | ||
|
||
{% block scripts %} | ||
<script src="../js/playground.ts"></script> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="p-4"> | ||
<div data-bind="visible: false" class="mx-auto w-12 h-12 my-12"> | ||
<div class="spinner"></div> | ||
</div> | ||
<div style="display: none" data-bind="visible: true"> | ||
<form action="#" method="post"> | ||
<textarea data-bind="codeMirror: code, codeMirrorLines: currentTab() !== null ? currentTab().errorLines : []"></textarea> | ||
</form> | ||
|
||
<!-- ko if: isLoading --> | ||
<div class="m-auto w-12 h-12 mt-4"> | ||
<div class="spinner"></div> | ||
</div> | ||
<!-- /ko --> | ||
|
||
<!-- ko if: hasServerError --> | ||
<span class="inline-flex text-red-500 mb-8">An error occured. Please try again later.</span> | ||
<!-- /ko --> | ||
|
||
<!-- ko ifnot: hasServerError --> | ||
|
||
<!-- ko if: tabs().length > 1 && !isLoading() && legacyResult() === null --> | ||
<nav class="flex mt-4 border-b border-gray-400"> | ||
<!-- ko foreach: tabs --> | ||
<a href="#" class="relative px-3 py-2 font-medium text-md mr-4 leading-5 rounded-md rounded-b-none text-gray-500 border-l border-t border-r" data-bind="click: $parent.switchTab.bind($parent, $index()), text: title, class: tabClass, style: { 'top': isActive() ? '1px' : '0' }"></a> | ||
<!-- /ko --> | ||
</nav> | ||
<!-- /ko --> | ||
|
||
<!-- ko if: currentTab() !== null && !isLoading() && legacyResult() === null --> | ||
<!-- ko with: currentTab() --> | ||
<div class="flex items-stretch mx-4 md:mx-0"> | ||
<!-- ko if: errors.length > 0 && $parent.tabs().length < 2 --> | ||
<span class="inline-flex flex-grow justify-center md:flex-grow-0 items-center px-4 py-3 h-12 rounded-lg text-lg font-medium leading-4 bg-red-100 text-red-900 mt-4" data-bind="text: errorsText"></span> | ||
<!-- /ko --> | ||
|
||
<!-- ko if: errors.length === 0 --> | ||
<span class="inline-flex flex-grow justify-center md:flex-grow-0 items-center px-4 py-3 h-12 rounded-lg text-lg font-medium leading-4 bg-green-100 text-green-900 mt-4"> | ||
No errors! | ||
</span> | ||
<!-- /ko --> | ||
</div> | ||
<!-- ko if: errors.length > 0 --> | ||
<table class="w-full mt-4"> | ||
<thead> | ||
<tr> | ||
<th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-base leading-4 font-medium text-gray-500 tracking-wider"> | ||
Line | ||
</th> | ||
<th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-base leading-4 font-medium text-gray-500 tracking-wider"> | ||
Error | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody class="bg-white"> | ||
<!-- ko foreach: errors --> | ||
<tr> | ||
<td class="px-6 py-4 whitespace-no-wrap border-b border-gray-200 text-base leading-5 font-medium text-gray-500" data-bind="text: line"></td> | ||
<td class="px-6 py-4 border-b border-gray-200 text-base leading-5 text-gray-900" data-bind="text: message"></td> | ||
</tr> | ||
<!-- /ko --> | ||
</tbody> | ||
</table> | ||
<!-- /ko --> | ||
<!-- /ko --> | ||
<!-- /ko --> | ||
|
||
<!-- ko if: legacyResult() !== null && !isLoading() --> | ||
<pre data-bind="html: legacyResult" class="bg-gray-800 w-auto p-4 mt-4 leading-none"></pre> | ||
<!-- /ko --> | ||
<!-- /ko --> | ||
</div> | ||
</div> | ||
{% endblock %} |
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
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.
What benefits does this tracker bring?