From cc3d89a95493640fd56d78776081bca17360efe3 Mon Sep 17 00:00:00 2001 From: pypy Date: Sat, 21 Mar 2020 14:54:55 +0900 Subject: [PATCH] add bio editing --- html/app.js | 42 ++++++++++++++++++++++++++++++++++++++++++ html/index.html | 26 ++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/html/app.js b/html/app.js index 59d845dc..e5fce1a7 100644 --- a/html/app.js +++ b/html/app.js @@ -6580,6 +6580,48 @@ CefSharp.BindObjectAsync( D.visible = true; }; + // App: Bio Dialog + + $app.data.bioDialog = { + visible: false, + loading: false, + bio: '', + bioLinks: [] + }; + + API.$on('LOGOUT', function () { + $app.bioDialog.visible = false; + }); + + $app.methods.saveBio = function () { + var D = this.bioDialog; + if (D.loading) { + return; + } + D.loading = true; + API.saveCurrentUser({ + bio: D.bio, + bioLinks: D.bioLinks + }).finally(() => { + D.loading = false; + }).then((args) => { + D.visible = false; + this.$message({ + message: 'Bio updated', + type: 'success' + }); + return args; + }); + }; + + $app.methods.showBioDialog = function () { + this.$nextTick(() => adjustDialogZ(this.$refs.bioDialog.$el)); + var D = this.bioDialog; + D.bio = API.currentUser.bio; + D.bioLinks = API.currentUser.bioLinks.slice(); + D.visible = true; + }; + // App: New Instance Dialog $app.data.newInstanceDialog = { diff --git a/html/index.html b/html/index.html index 79abb4a7..cf744e70 100644 --- a/html/index.html +++ b/html/index.html @@ -601,6 +601,19 @@ +
+
+ Bio +
{{ API.currentUser.bio || '-' }}
+ + + + +
+
+
Languages @@ -1429,6 +1442,19 @@ + + + + + + + + Add Link + + +