-
Notifications
You must be signed in to change notification settings - Fork 20
Webpage to display a set of benchmarks from RustPython #43
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1c503a5
Adds a benchmark page to the website
theangryhobbit 6be1576
Create tabs on benchmakrs page with benchmakrs for each tab
theangryhobbit 038aad6
Add zero folders found check, thus no benchmarks to be displayed
theangryhobbit c47d73b
Update indentation
theangryhobbit f9c5006
Update assets/js/tabs.js based on suggested change
theangryhobbit ef898d2
Update assets/js/tabs.js based on suggested change
theangryhobbit 745041f
Update assets/js/tabs.js based on suggested change
theangryhobbit 372f442
Update assets/js/tabs.js based on suggested change
theangryhobbit 2be423e
Fix indentation based on PR suggestion
theangryhobbit b7003e7
Merge remote-tracking branch 'origin/master'
theangryhobbit d67dbc5
Use more efficient code block and remove the other (based on suggestion)
theangryhobbit aaffc4c
Adds benchmark intro to _config file and updates the UI a bit
theangryhobbit 903a873
Removes the benchmarks from the navbar
theangryhobbit 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
Create tabs on benchmakrs page with benchmakrs for each tab
- Loading branch information
commit 6be15765c402be7ebe429171e98f9ef06b934397
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 |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
|
|
||
| {%- include footer.html -%} | ||
|
|
||
| <script src="{{ "/assets/js/tabs.js" | relative_url }}"></script> | ||
| </body> | ||
|
|
||
| </html> | ||
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 |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| const removeActiveClasses = function (ulElement) { | ||
theangryhobbit marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| const lis = ulElement.querySelectorAll('li'); | ||
| Array.prototype.forEach.call(lis, function(li) { | ||
| li.classList.remove('active'); | ||
| }); | ||
| } | ||
|
|
||
| const getChildPosition = function (element) { | ||
theangryhobbit marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| var parent = element.parentNode; | ||
| var i = 0; | ||
| for (var i = 0; i < parent.children.length; i++) { | ||
| if (parent.children[i] === element) { | ||
| return i; | ||
| } | ||
| } | ||
|
|
||
| throw new Error('No parent found'); | ||
| } | ||
theangryhobbit marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| window.addEventListener('load', function () { | ||
| const tabLinks = document.querySelectorAll('ul.tab li a'); | ||
|
|
||
| Array.prototype.forEach.call(tabLinks, function(link) { | ||
| link.addEventListener('click', function (event) { | ||
| event.preventDefault(); | ||
|
|
||
| liTab = link.parentNode; | ||
| ulTab = liTab.parentNode; | ||
| position = getChildPosition(liTab); | ||
theangryhobbit marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (liTab.className.includes('active')) { | ||
| return; | ||
| } | ||
|
|
||
| removeActiveClasses(ulTab); | ||
| tabContentId = ulTab.getAttribute('data-tab'); | ||
| tabContentElement = document.getElementById(tabContentId); | ||
theangryhobbit marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| removeActiveClasses(tabContentElement); | ||
|
|
||
| tabContentElement.querySelectorAll('li')[position].classList.add('active'); | ||
| liTab.classList.add('active'); | ||
| }, false); | ||
| }); | ||
| }); | ||
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 |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| .tab { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| margin-left: -20px; | ||
| padding: 0; | ||
| list-style: none; | ||
| position: relative; | ||
| } | ||
|
|
||
| .tab > * { | ||
| flex: none; | ||
| padding-left: 20px; | ||
| position: relative; | ||
| } | ||
|
|
||
| .tab > * > a { | ||
| display: block; | ||
| text-align: center; | ||
| padding: 9px 20px; | ||
| color: #999; | ||
| border-bottom: 2px solid transparent; | ||
| border-bottom-color: transparent; | ||
| font-size: 12px; | ||
| text-transform: uppercase; | ||
| transition: color .1s ease-in-out; | ||
| line-height: 20px; | ||
| } | ||
|
|
||
| .tab > .active > a { | ||
| color:#222; | ||
| border-color: #1e87f0; | ||
| } | ||
|
|
||
| .tab li a { | ||
| text-decoration: none; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .tab-content{ | ||
| padding: 0; | ||
| } | ||
|
|
||
| .tab-content li { | ||
| display: none; | ||
| } | ||
| .tab-content li.active { | ||
| display: initial; | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.