diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-03-17 19:07:49 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-03-17 19:07:49 +0300 |
| commit | 96786c94189f3d2f3f04c1915529c786228bdf42 (patch) | |
| tree | 879085e09a3cd485f3246f46be907fe77eb84a1a /web/html/common | |
| parent | bc56e637376142c370c31b17558fc3778a863bd2 (diff) | |
alireza
Diffstat (limited to 'web/html/common')
| -rw-r--r-- | web/html/common/prompt_modal.html | 2 | ||||
| -rw-r--r-- | web/html/common/qrcode_modal.html | 21 | ||||
| -rw-r--r-- | web/html/common/text_modal.html | 5 |
3 files changed, 21 insertions, 7 deletions
diff --git a/web/html/common/prompt_modal.html b/web/html/common/prompt_modal.html index 3ef764c5..4b8a13d0 100644 --- a/web/html/common/prompt_modal.html +++ b/web/html/common/prompt_modal.html @@ -1,7 +1,7 @@ {{define "promptModal"}} <a-modal id="prompt-modal" v-model="promptModal.visible" :title="promptModal.title" :closable="true" @ok="promptModal.ok" :mask-closable="false" - :class="siderDrawer.isDarkTheme ? darkClass : ''" + :class="siderDrawer.isDarkTheme ? darkClass : ''" :ok-text="promptModal.okText" cancel-text='{{ i18n "cancel" }}'> <a-input id="prompt-modal-input" :type="promptModal.type" v-model="promptModal.value" diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index e6a6d476..6c9afbb3 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -1,9 +1,10 @@ {{define "qrcodeModal"}} <a-modal id="qrcode-modal" v-model="qrModal.visible" :title="qrModal.title" :closable="true" width="300px" :ok-text="qrModal.okText" - :class="siderDrawer.isDarkTheme ? darkClass : ''" + :class="siderDrawer.isDarkTheme ? darkClass : ''" cancel-text='{{ i18n "close" }}' :ok-button-props="{attrs:{id:'qr-modal-ok-btn'}}"> - <canvas id="qrCode" style="width: 100%; height: 100%;"></canvas> + <a-tag color="green" style="margin-bottom: 10px;display: block;text-align: center;" >{{ i18n "pages.inbounds.clickOnQRcode" }}</a-tag> + <canvas @click="copyToClipboard()" id="qrCode" style="width: 100%; height: 100%;"></canvas> </a-modal> <script> @@ -35,7 +36,10 @@ this.clipboard = new ClipboardJS('#qr-modal-ok-btn', { text: () => this.copyText, }); - this.clipboard.on('success', () => app.$message.success('{{ i18n "copied" }}')); + this.clipboard.on('success', () => { + app.$message.success('{{ i18n "copied" }}') + this.clipboard.destroy(); + }); } if (this.qrcode === null) { this.qrcode = new QRious({ @@ -58,6 +62,17 @@ data: { qrModal: qrModal, }, + methods: { + copyToClipboard() { + this.qrModal.clipboard = new ClipboardJS('#qrCode', { + text: () => this.qrModal.copyText, + }); + this.qrModal.clipboard.on('success', () => { + app.$message.success('{{ i18n "copied" }}') + this.qrModal.clipboard.destroy(); + }); + } + }, }); </script> diff --git a/web/html/common/text_modal.html b/web/html/common/text_modal.html index a0352c88..b2da6160 100644 --- a/web/html/common/text_modal.html +++ b/web/html/common/text_modal.html @@ -1,7 +1,7 @@ {{define "textModal"}} <a-modal id="text-modal" v-model="txtModal.visible" :title="txtModal.title" :closable="true" ok-text='{{ i18n "copy" }}' cancel-text='{{ i18n "close" }}' - :class="siderDrawer.isDarkTheme ? darkClass : ''" + :class="siderDrawer.isDarkTheme ? darkClass : ''" :ok-button-props="{attrs:{id:'txt-modal-ok-btn'}}"> <a-button v-if="!ObjectUtil.isEmpty(txtModal.fileName)" type="primary" style="margin-bottom: 10px;" :href="'data:application/text;charset=utf-8,' + encodeURIComponent(txtModal.content)" :download="txtModal.fileName"> @@ -32,7 +32,6 @@ }); this.clipboard.on('success', () => app.$message.success('{{ i18n "copied" }}')); } - }); }, close: function () { @@ -41,7 +40,7 @@ }; const textModalApp = new Vue({ - delimiters: ['[[', ']]'], + delimiters: ['[[', ']]'], el: '#text-modal', data: { txtModal: txtModal, |
