share on android
This commit is contained in:
parent
ef9804da72
commit
72d238b05d
6
app.py
6
app.py
@ -159,6 +159,12 @@ def user_accounts() -> Union[Response, str]:
|
||||
auth=session["auth_credentials"],
|
||||
)
|
||||
|
||||
@app.route("/share", methods=["GET"])
|
||||
def share() -> Response:
|
||||
"""Handles shared text from PWA."""
|
||||
shared_text = request.args.get("text")
|
||||
return redirect(url_for("add_account", shared_text=shared_text))
|
||||
|
||||
@app.route("/accounts/add", methods=["GET", "POST"])
|
||||
def add_account() -> Union[Response, str]:
|
||||
"""Handles adding a new user account."""
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"short_name": "kTv",
|
||||
"name": "kTvManager",
|
||||
"description": "KTVManager PWA",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/web-app-manifest-192x192.png",
|
||||
@ -16,5 +17,14 @@
|
||||
"start_url": "/",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone",
|
||||
"theme_color": "#ffffff"
|
||||
"theme_color": "#ffffff",
|
||||
"share_target": {
|
||||
"action": "/share",
|
||||
"method": "GET",
|
||||
"params": {
|
||||
"title": "title",
|
||||
"text": "text",
|
||||
"url": "url"
|
||||
}
|
||||
}
|
||||
}
|
@ -131,8 +131,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
const sharedTextJson = '{{ shared_text|tojson|safe }}';
|
||||
const sharedText = JSON.parse(sharedTextJson);
|
||||
const sharedText = '{{ shared_text|safe }}';
|
||||
|
||||
if (sharedText) {
|
||||
const accountDetailsTextarea = document.getElementById('accountDetails');
|
||||
|
Loading…
x
Reference in New Issue
Block a user