diff options
Diffstat (limited to 'web/assets/js/subscription.js')
| -rw-r--r-- | web/assets/js/subscription.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web/assets/js/subscription.js b/web/assets/js/subscription.js index 228dcfa0..d08bfd28 100644 --- a/web/assets/js/subscription.js +++ b/web/assets/js/subscription.js @@ -9,6 +9,7 @@ sId: el.getAttribute('data-sid') || '', subUrl: el.getAttribute('data-sub-url') || '', subJsonUrl: el.getAttribute('data-subjson-url') || '', + subClashUrl: el.getAttribute('data-subclash-url') || '', download: el.getAttribute('data-download') || '', upload: el.getAttribute('data-upload') || '', used: el.getAttribute('data-used') || '', @@ -98,13 +99,19 @@ this.lang = LanguageManager.getLanguage(); const tpl = document.getElementById('subscription-data'); const sj = tpl ? tpl.getAttribute('data-subjson-url') : ''; + const sc = tpl ? tpl.getAttribute('data-subclash-url') : ''; if (sj) this.app.subJsonUrl = sj; + if (sc) this.app.subClashUrl = sc; drawQR(this.app.subUrl); try { const elJson = document.getElementById('qrcode-subjson'); if (elJson && this.app.subJsonUrl) { new QRious({ element: elJson, value: this.app.subJsonUrl, size: 220 }); } + const elClash = document.getElementById('qrcode-subclash'); + if (elClash && this.app.subClashUrl) { + new QRious({ element: elClash, value: this.app.subClashUrl, size: 220 }); + } } catch (e) { /* ignore */ } this._onResize = () => { this.viewportWidth = window.innerWidth; }; window.addEventListener('resize', this._onResize); |
