mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-03-02 09:11:12 +01:00
1 line
2.8 KiB
Plaintext
1 line
2.8 KiB
Plaintext
{"version":3,"file":"QrContentDisplay-C2fFtz-5.js","sources":["../../../resources/js/components/QrContentDisplay.vue"],"sourcesContent":["<script setup>\n const { copy } = useClipboard({ legacy: true })\n import { useNotifyStore } from '@/stores/notify'\n \n const notify = useNotifyStore()\n\n const props = defineProps({\n qrContent: String,\n })\n\n /**\n * Checks if a string is an url\n * \n * @param {string} str \n */\n function isUrl(str) {\n var strRegex = /^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$/\n var re = new RegExp(strRegex)\n\n return re.test(str)\n }\n\n /**\n * Opens an uri in a new browser window\n * \n * @param {string} uri \n */\n function openInBrowser(uri) {\n const a = document.createElement('a')\n a.setAttribute('href', uri)\n a.dispatchEvent(new MouseEvent(\"click\", { 'view': window, 'bubbles': true, 'cancelable': true }))\n }\n\n /**\n * Copies to clipboard and notify\n * \n * @param {*} data \n */\n function copyToClipboard(data) {\n copy(data)\n notify.success({ text: trans('commons.copied_to_clipboard') })\n }\n</script>\n\n<template>\n <div class=\"too-bad\"></div>\n <div class=\"block\">\n {{ $t('errors.data_of_qrcode_is_not_valid_URI') }}\n </div>\n <div class=\"block mb-6 light-or-darker\">{{ qrContent ? qrContent : '[' + trans('commons.nothing') + ']' }}</div>\n <!-- Copy to clipboard -->\n <div class=\"block has-text-link\" v-if=\"qrContent\">\n <button type=\"button\" class=\"button is-link is-outlined is-rounded\" @click.stop=\"copyToClipboard(qrContent)\">\n {{ $t('commons.copy_to_clipboard') }}\n </button>\n </div>\n <!-- Open in browser -->\n <div class=\"block has-text-link\" v-if=\"isUrl(qrContent)\" @click=\"openInBrowser(qrContent)\">\n <button type=\"button\" class=\"button is-link is-outlined is-rounded\">\n <span>{{ $t('commons.open_in_browser') }}</span>\n <span class=\"icon is-small\">\n <FontAwesomeIcon :icon=\"['fas', 'external-link-alt']\" />\n </span>\n </button>\n </div>\n</template>\n"],"names":["copy","useClipboard","notify","useNotifyStore","isUrl","str","strRegex","re","openInBrowser","uri","a","copyToClipboard","data","trans"],"mappings":"gdACI,KAAM,CAAE,KAAAA,CAAM,EAAGC,EAAa,CAAE,OAAQ,EAAM,CAAA,EAGxCC,EAASC,EAAc,EAW7B,SAASC,EAAMC,EAAK,CAChB,IAAIC,EAAW,iFACXC,EAAK,IAAI,OAAOD,CAAQ,EAE5B,OAAOC,EAAG,KAAKF,CAAG,CAC1B,CAOI,SAASG,EAAcC,EAAK,CACxB,MAAMC,EAAI,SAAS,cAAc,GAAG,EACpCA,EAAE,aAAa,OAAQD,CAAG,EAC1BC,EAAE,cAAc,IAAI,WAAW,QAAS,CAAE,KAAQ,OAAQ,QAAW,GAAM,WAAc,EAAI,CAAE,CAAC,CACxG,CAOI,SAASC,EAAgBC,EAAM,CAC3BZ,EAAKY,CAAI,EACTV,EAAO,QAAQ,CAAE,KAAMW,EAAM,6BAA6B,CAAG,CAAA,CACrE"} |