evandrocoan
476b881987
Replaced flask.Response by flask.make_response to simplify the
...
implementation and because make_response is preferred over Response
as it respects the server defined Response type.
2020-07-02 20:39:03 -03:00
evandrocoan
a99e455414
Removed duplicated mediasrv.py security check and fixed invalid
...
command/path error message.
2020-07-02 20:39:03 -03:00
evandrocoan
1218d109e8
Fix jest unit tests after merge
...
# Conflicts:
# qt/aqt/mediasrv.py
# qt/ts/src/ankimedia.ts
# qt/ts/src/reviewer-exceptions.test.ts
# qt/ts/src/reviewer.test.ts
# ts/package.json
2020-07-02 14:30:43 -03:00
evandrocoan
0142ac3ca2
Replaced send_from_directory by send_file to simplify the code
2020-07-02 13:52:07 -03:00
evandrocoan
1e6fa5f8eb
Ensure protection against directory transversal
...
https://security.openstack.org/guidelines/dg_using-file-paths.html
2020-07-02 13:52:03 -03:00
evandrocoan
be10da58d9
Fixed aqt/mediasrv.py:14: error: unused 'type: ignore' comment
...
from waitress.server import create_server # type: ignore
https://github.com/evandroforks/anki/runs/743801391#step:25:1129
2020-07-02 13:51:59 -03:00
evandrocoan
020415efb9
Replaced the mediasrv.py SimpleHttp server by flask and waitress,
...
fixing HTML5 media support.
https://stackoverflow.com/questions/37044064/html-audio-cant-set-currenttime
https://stackoverflow.com/questions/21956683/enable-access-control-on-simple-http-server
https://stackoverflow.com/questions/5052635/what-is-relation-between-content-length-and-byte-ranges-in-http-1-1
https://stackoverflow.com/questions/16725907/google-app-engine-serving-mp3-for-audio-element-needs-content-range-header
I was trying to use HTML5 audio tag to display audios like:
```html
<audio id="elem_audio" src="myfile.mp3" controls></audio>
```
![image](https://user-images.githubusercontent.com/5332158/79063321-565b5500-7c77-11ea-9f8d-6e1df6f07892.png )
But the progress bar seek was not working. After researching, I found the problem was the HTML server not properly responding to the HTML5 header requests. The HTML server should respond to quite complicated things as 206 partial, properly handle keep-alive, provide media ranges and other HTTP headers: https://stackoverflow.com/questions/37044064/html-audio-cant-set-currenttime
To implement all these on the Simple HTTP server would be quite complicated. Then, instead, I imported the `flask` web server, which is quite simple and straight forward to use. Now, the back-end is using a secure complaint HTTP back-end:
1. https://palletsprojects.com/p/flask/
> Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. It began as a simple wrapper around Werkzeug and Jinja and has become one of the most popular Python web application frameworks.
>
> Flask offers suggestions, but doesn't enforce any dependencies or project layout. It is up to the developer to choose the tools and libraries they want to use. There are many extensions provided by the community that make adding new functionality easy.
1. https://docs.pylonsproject.org/projects/waitress/en/latest/
> Waitress is meant to be a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones which live in the Python standard library. It runs on CPython on Unix and Windows under Python 2.7+ and Python 3.5+. It is also known to run on PyPy 1.6.0 on UNIX. It supports HTTP/1.0 and HTTP/1.1.
Right now, anki does not support fields passing file names directly to HTML audio tags, but this can be easily done with (https://github.com/ankitects/anki/pull 540 - Added arguments to the sound tag) plus the commit 826a97df61
, the HTML5 audio tag can be used like this:
```html
// Audio = [sound:myfile.mp3|onlyfilename]
<audio id="elem_audio" src="{{Audio}}" controls controlsList="nodownload"></audio>
```
![image](https://user-images.githubusercontent.com/5332158/79063736-c539ad80-7c79-11ea-8420-40b72185f4e7.png )
# Conflicts:
# qt/aqt/mediasrv.py
2020-07-02 13:51:49 -03:00
Damien Elmes
04b1ca7559
defer top toolbar drawing until after add-ons loaded
...
https://forums.ankiweb.net/t/anki-2-1-28-beta/629/13
2020-07-02 10:23:14 +10:00
Damien Elmes
dfda5750a1
add new strings to .po files as part of template update
...
Pontoon appears to only update existing gettext translations; it
won't add new ones on its own. Fixes
https://forums.ankiweb.net/t/anki-2-1-28-beta/629/6
2020-07-02 10:03:39 +10:00
Damien Elmes
97869d0f57
fix scrollbars on fields on Windows/Linux
2020-07-02 09:51:50 +10:00
Damien Elmes
395b6a6c18
drop alpha warning
2020-07-01 15:01:51 +10:00
Damien Elmes
4d23a69e9a
formatting
2020-07-01 14:01:24 +10:00
Damien Elmes
38838a6d0b
fix invalid cumulative path when no data available
2020-07-01 13:59:31 +10:00
Damien Elmes
572e2d10dc
hack around future unburied date
...
We want to avoid unburied != self.today, because the unburied time
is synchronized as part of the collection at the moment, and we don't
want a client with an older unburied time that was modified more
recently to cause cards to be unburied twice - so we only unbury
if today is more than 7 days earlier than the last unbury time.
Unsure what caused these users to end up in that state in the first
place:
https://anki.tenderapp.com/discussions/ankidesktop/41335-cards-remain-buried-forever-unless-manually-unburied
2020-07-01 13:12:45 +10:00
Damien Elmes
6db954fbbe
don't allow table inside field to extend outside of field
...
https://anki.tenderapp.com/discussions/private/4498-adjust-textbox-geometry-in-add-note-window
2020-07-01 12:13:04 +10:00
Damien Elmes
bedd9dadb1
add option to disable media syncing
...
https://forums.ankiweb.net/t/error-when-adding-audio-file/495/2
2020-07-01 11:35:24 +10:00
Damien Elmes
05fb67d409
show clearer error when media db locked
...
should not happen frequently during a sync, but may happen during
the initial change checking stage
https://forums.ankiweb.net/t/error-when-adding-audio-file/495/2
2020-07-01 11:19:06 +10:00
Damien Elmes
f8ca1d122d
fix media db conflict aborting immediately instead of after 5s
...
https://forums.ankiweb.net/t/error-when-adding-audio-file/495/2
2020-07-01 11:17:33 +10:00
Damien Elmes
7cd02eea8f
supported edited:n
...
https://forums.ankiweb.net/t/feature-request-advanced-broswer-search-by-edited/268
2020-07-01 10:17:57 +10:00
Damien Elmes
40f270c386
shift+click on the graphs button to access old graphs for now
2020-06-30 20:07:46 +10:00
Damien Elmes
79d04c9db7
cards->reviews
2020-06-30 16:50:23 +10:00
Damien Elmes
5aad1d0d81
fade calendar in
2020-06-30 16:39:30 +10:00
Damien Elmes
101deb002b
graphs now work in night mode
2020-06-30 16:23:46 +10:00
Damien Elmes
1b37398503
add basic calendar graph
2020-06-30 15:13:44 +10:00
Damien Elmes
41f75c00a7
Merge pull request #676 from evandroforks/fix_pbjs_on_windows
...
Fixed pbjs not working on Windows because package.json runs by
2020-06-30 09:50:02 +10:00
evandrocoan
40831ef86e
Fixed pbjs not working on Windows because package.json runs by
...
cmd.exe which does not support pipe | and ; semicolons
6fd444b958 (r40232987)
2020-06-29 15:22:36 -03:00
Damien Elmes
f3febea4b0
update edited/changed column labels
...
https://github.com/ankitects/anki/pull/674/files
2020-06-29 18:34:03 +10:00
Damien Elmes
ee204aa3e2
Revert "bump CI node version"
...
This reverts commit 93c8e48cd4
.
Was hoping this would fix the protobuf build issues on win32; it did not.
2020-06-29 17:42:19 +10:00
Damien Elmes
93c8e48cd4
bump CI node version
2020-06-29 17:19:08 +10:00
Damien Elmes
c3f0ee5c97
fix initial build: don't depend on package-lock.json
2020-06-29 16:45:43 +10:00
Damien Elmes
52cd9fc4b8
plug new graphs code into GUI
...
Still some work to do. Feedback welcome!
2020-06-29 15:53:56 +10:00
Damien Elmes
d4cd4535e6
lint fixes
2020-06-29 15:53:56 +10:00
Damien Elmes
bf0ebfac96
switch added/future range based on revlog selection
...
Neither depends on the revlog, but that may not be obvious to the user.
2020-06-29 15:48:01 +10:00
Damien Elmes
330ddeb313
force a refresh when enter pressed
2020-06-29 15:48:01 +10:00
Damien Elmes
4a04ccd96c
move tooltip away from edges
2020-06-29 15:48:01 +10:00
Damien Elmes
72609bee18
add option to webview to skip external browser open
2020-06-29 15:48:01 +10:00
Damien Elmes
1f4f5b8c45
include generated js in aqt_data
2020-06-29 15:48:01 +10:00
Damien Elmes
4cc9e2a780
fixes for Chromium 56 (Qt 5.9)
2020-06-29 15:48:01 +10:00
Damien Elmes
f30e52c4ed
group strings by graph
2020-06-29 15:48:01 +10:00
Damien Elmes
68978e7c4e
add remaining tooltip i18n
2020-06-29 15:48:01 +10:00
Damien Elmes
41b296e96c
i18n some tooltips
2020-06-29 15:48:01 +10:00
Damien Elmes
93b8cebf1e
drop axis labels + add subtitles
...
This leaves more room for the graphs and avoids issues with large values
overlapping the labels. We can improve the subtitle wording to make
things clearer in the future, and the hover tooltips should also
clarify what the axes represent.
2020-06-29 15:48:01 +10:00
Damien Elmes
7e0bdb990c
i18n some axis labels, and support vertical CJK text
2020-06-29 15:48:01 +10:00
Damien Elmes
595c509546
i18n graph titles
2020-06-29 15:48:01 +10:00
Damien Elmes
b78f578cd5
i18n ranges
2020-06-29 15:48:01 +10:00
Damien Elmes
8e118bbc76
add timeSpan()
2020-06-29 15:48:01 +10:00
Damien Elmes
93ab3b4164
tidy up top area
2020-06-29 15:48:01 +10:00
Damien Elmes
0691cbf0e2
avoid needless npm install invocation
2020-06-29 15:48:01 +10:00
Damien Elmes
28a6755c75
i18n card counts
2020-06-29 15:48:01 +10:00
Damien Elmes
01f3a71f0a
i18n today section
2020-06-29 15:48:01 +10:00