anki/qt
evandrocoan 121725390d Fix _addons/ URL prefix not being removed on Windows systems
Anki 2.1.28 Beta
https://forums.ankiweb.net/t/anki-2-1-28-beta/629/26

> Did the requirements on how to expose resources on the internal server change? Because scripts, css files and the like, registered with setWebExports, do not work anymore with beta2.
> A look at the console shows the following for all resources:
> Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)

**\Anki2\addons21\someaddon\__init__.py**
```py
from aqt import mw
import aqt

# assuming add-on folder is named "test"
# and assuming a 'test.js' is in the same folder
addon_id = "someaddon"
port = mw.mediaServer.getPort()
mw.addonManager.setWebExports(addon_id, ".*\\.js$")

print("Hello")

aqt.editor._html += f"""
<script>
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'http://127.0.0.1:{port}/_addons/{addon_id}/test.js';
    document.body.appendChild(script);
</script>"""
```
2020-07-06 13:51:37 -03:00
..
aqt Fix _addons/ URL prefix not being removed on Windows systems 2020-07-06 13:51:37 -03:00
aqt_data/web include generated js in aqt_data 2020-06-29 15:48:01 +10:00
designer add option to disable media syncing 2020-07-01 11:35:24 +10:00
ftl fix push-i18n-ftl 2020-04-01 18:20:31 +10:00
po add new strings to .po files as part of template update 2020-07-02 10:03:39 +10:00
tests FString -> TR 2020-02-27 12:25:19 +10:00
tools hook: history_line 2020-06-08 20:47:01 +02:00
ts fix scrollbars on fields on Windows/Linux 2020-07-02 09:51:50 +10:00
.gitignore include generated js in aqt_data 2020-06-29 15:48:01 +10:00
.isort.cfg make sure isort preserves ordering if anki installed into python env 2020-01-03 13:34:51 +10:00
.pylintrc tweaking the folder names again 2020-01-03 07:48:38 +10:00
anki.1 tweaking the folder names again 2020-01-03 07:48:38 +10:00
anki.desktop Add .ankiaddon mime-type on Linux and register Anki as its handler 2020-01-03 17:58:11 +01:00
anki.png tweaking the folder names again 2020-01-03 07:48:38 +10:00
anki.xml Add .ankiaddon mime-type on Linux and register Anki as its handler 2020-01-03 17:58:11 +01:00
anki.xpm tweaking the folder names again 2020-01-03 07:48:38 +10:00
Makefile include generated js in aqt_data 2020-06-29 15:48:01 +10:00
mypy.ini add typehint to deckchooser.py 2020-06-11 14:19:36 +09:00
pkgkey.asc tweaking the folder names again 2020-01-03 07:48:38 +10:00
pyproject.toml Set to build a source distribution instead of build distribution 2020-04-02 22:56:37 -03:00
requirements.dev tweaking the folder names again 2020-01-03 07:48:38 +10:00
requirements.qt update qt version pin 2020-06-03 09:55:04 +10:00
runanki tweaking the folder names again 2020-01-03 07:48:38 +10:00
setup.py Replaced the mediasrv.py SimpleHttp server by flask and waitress, 2020-07-02 13:51:49 -03:00