-
Notifications
You must be signed in to change notification settings - Fork 52
Feature/keyboard shortcuts #160
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
Open
YairEn
wants to merge
18
commits into
PythonFreeCourse:develop
Choose a base branch
from
YairEn:feature/keyboard-shortcuts
base: develop
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
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
07fe63f
add mousetrap lib to keys js files, and load js file in html
YairEn f9cc030
Merge branch 'develop' into feature/keyboard-shortcuts
YairEn 9813dfb
Merge branch 'develop' into feature/keyboard-shortcuts
YairEn 9aa7e78
Change shortcuts from home page to general
YairEn ab47c1e
remove home test
YairEn d70c329
Merge branch 'develop' into feature/keyboard-shortcuts
YairEn da42ebb
Change navigate to navigation
YairEn 9c29e96
delete profile_shortcuts.js file
YairEn 1cdbfd1
Fix - Pylint check - line too long
YairEn b257545
Add test to test_keyboard_shortcuts_route.py
YairEn 3615ddc
Add Cypress Test
YairEn 5dba38f
Merge branch 'develop' into feature/keyboard-shortcuts
YairEn f5e397d
Fix alphabetic order
YairEn c1c2743
Change indent to 2 spaces
YairEn b0a5938
Change keyboard_shortcuts to modal
YairEn 2973ec8
Remove keyboard_shortcuts.py
YairEn 0c83116
Merge branch 'develop' into feature/keyboard-shortcuts
YairEn 91e50ce
CHange U letter to u lowercase to check upload
YairEn 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from app.dependencies import templates | ||
from fastapi import APIRouter, Request | ||
from starlette.templating import _TemplateResponse | ||
|
||
router = APIRouter() | ||
|
||
|
||
@router.get("/keyboard_shortcuts") | ||
def keyboard_shortcuts(request: Request) -> _TemplateResponse: | ||
return templates.TemplateResponse("keyboard_shortcuts.html", { | ||
"request": request}) |
Empty file.
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,13 @@ | ||
import './mousetrap.js' | ||
import './mousetrap_bind_dict.js' | ||
|
||
let key_shortcuts = { | ||
'alt+c+h': function() { window.open('/', '_self'); }, | ||
'alt+c+i': function() { window.open('/invitations/', '_self'); }, | ||
'alt+c+p': function() { window.open('/profile/', '_self'); }, | ||
'alt+c+s': function() { window.open('/search/', '_self'); }, | ||
'alt+c+a': function() { window.open('/agenda/', '_self'); }, | ||
'ctrl+.': function() { window.open('/keyboard_shortcuts/', '_self'); } | ||
}; | ||
|
||
Mousetrap.bind(key_shortcuts); |
Oops, something went wrong.
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.
Can you open this using modal instead? It's actually not too hard :)
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.
I do not understand, I need to open the page itself , not?
modal open a modal not the page, I need to navigate the user to the page he wanted
Thanks :)
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.
I think it's better not to move the user to a whole new page, but to show him the keyboard shortcuts in the same page. Just like Jupyter Notebook does.
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.
Ahh, do you mean just the /keyboard_shortcuts to open like modal instead?
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.
Hey, I created Modal instead of page by using the button in profile page and It's definitely more beautiful, but I was not able to run it nicely by keyboard shortcut. so I removed that shortcut it for now.
All the ways that I found to do so, was by change the visibility (CSS) or using jQuery or JS but by change the button of the modal to use JS function instead.
If you know how to do so I'll be glad to hear
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 have you tried?
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.
$(#keyboard-shortcuts).modal('show') - It did not work
or just change the display of the element to block
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.
It does not work because it assumes jQuery is imported (and also syntactically wrong - there are no quote signs wrapping
#keyboard-shortcuts
). Look at the relevant documentation of bootstrap 5, not 4