Skip to content
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

Add copy code button #141

Closed
wants to merge 13 commits into from
Closed

Add copy code button #141

wants to merge 13 commits into from

Conversation

@orronai
Copy link
Collaborator

orronai commented Sep 7, 2020

No description provided.

orronai added 2 commits Aug 25, 2020
- Create list of patterns that the extractor will ignore
- Fix extractors test and add some test for ignore list
- Fix minor celery issues on local minimized setup
- Remove moment.js request
- Fix extractors tests
- Fix how to get the ignoring files patterns
@yammesicka

This comment has been minimized.

Copy link
Member

yammesicka commented on lms/extractors/base.py in 80d72eb Aug 25, 2020

Return as a List, or even better, consume it in ziparchive.py.
Currently, if multiple lines try to use UNWANTED_FILE_TYPES, only one of them will be able to use the yielded values.

@yammesicka

This comment has been minimized.

Copy link
Member

yammesicka commented on lms/extractors/ziparchive.py in 80d72eb Aug 25, 2020

Maybe UNWATED_FILENAMES?

@yammesicka

This comment has been minimized.

Copy link
Member

yammesicka commented on lms/tests/samples/upload-1-2.ipynb in 80d72eb Aug 25, 2020

This was intentionally there. Please add it as a rule under the .flake8 file

@yammesicka

This comment has been minimized.

Copy link
Member

yammesicka commented on lms/tests/test_extractor.py in 80d72eb Aug 25, 2020

hmph, this is rather breakable. Let's use try/except instead

@yammesicka

This comment has been minimized.

Copy link
Member

yammesicka commented on lms/tests/test_extractor.py in 80d72eb Aug 25, 2020

It can be great to assert that there is file named __pycache__/something.py, and to assert it is not exists after we've used the Extractor on it.

orronai added 11 commits Aug 26, 2020
- Fix some extractors tests
- Fix some issues in .flake8
- Fix all the loggers to be one unified
- Fix the loggers to write to a log file
- Fix the loggers to be one unified
- Fix the loggers to write to a log file
add rotation every month
- Fix the logger to be a global unified one
- Fix the logger to be one unified
- Added the role of a banned user in the backend
- Updated the frontend of a banned user
- Add a template for banned user
- Add redirects from pages the banned user can't reach
- Added in the backend the request of the banned template
- Added a copy button in order to copy the code in the next code block
<span id="python-code-copy" style="display:none;">{{- current_file.code}}</span>
<div id="copy-code">
<button class="fa fa-copy" id="copy-button" title="Copy code" style="background-color:white;font-size:20px;"></button>
<script>

This comment has been minimized.

@yammesicka

yammesicka Sep 7, 2020

Member

Should be in the JS file :)

<div id="copy-code">
<button class="fa fa-copy" id="copy-button" title="Copy code" style="background-color:white;font-size:20px;"></button>
<script>
document.getElementById("copy-button").addEventListener("click", copy_code);

This comment has been minimized.

@yammesicka

yammesicka Sep 7, 2020

Member

Another option: document.getElementsByClassName('.language-python')[0].innerText instead of creating a new element with the whole code in it

<button class="fa fa-copy" id="copy-button" title="Copy code" style="background-color:white;font-size:20px;"></button>
<script>
document.getElementById("copy-button").addEventListener("click", copy_code);
function copy_code() {

This comment has been minimized.

@yammesicka

yammesicka Sep 7, 2020

Member

Looks like the Clipboard API for write has some support in modern browsers, maybe we should try it.

@yammesicka yammesicka closed this Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.