From d319a160879956dd00b4c06640ede6d9801bf2b2 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Wed, 15 Mar 2023 10:07:27 +0000 Subject: [PATCH] Bundled output for commit 315a4f57c9f349ad505419954c63d9bc0b14d282 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/admin.js.map | 2 +- js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 41879c2..4688159 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,oBAAoB,WACvCA,IAAAA,cAAAA,IACO,qBACJC,gBAAgB,CACfC,QAAS,4CACTC,KAAM,SACNC,MAAOJ,IAAAA,WAAAA,MAAqB,oEAE7BK,mBACC,CACEC,KAAM,eACNF,MAAOJ,IAAAA,WAAAA,MAAqB,4CAC5BO,WAAY,yBACZC,YAAY,GAEd,QAEDH,mBACC,CACEC,KAAM,eACNF,MAAOJ,IAAAA,WAAAA,MAAqB,+CAC5BO,WAAY,6BAEd,SAEDF,mBACC,CACEC,KAAM,eACNF,MAAOJ,IAAAA,WAAAA,MAAqB,+CAC5BO,WAAY,6BAEd,gB","sources":["webpack://@fof/socialprofile/webpack/bootstrap","webpack://@fof/socialprofile/webpack/runtime/compat get default export","webpack://@fof/socialprofile/webpack/runtime/define property getters","webpack://@fof/socialprofile/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/socialprofile/webpack/runtime/make namespace object","webpack://@fof/socialprofile/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/socialprofile/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('fof-socialprfile', () => {\n app.extensionData\n .for('fof-socialprofile')\n .registerSetting({\n setting: 'fof-socialprofile.allow_external_favicons',\n type: 'switch',\n label: app.translator.trans('fof-socialprofile.admin.settings.allow_external_favicons_label'),\n })\n .registerPermission(\n {\n icon: 'fas fa-globe',\n label: app.translator.trans('fof-socialprofile.admin.permissions.view'),\n permission: 'fof-socialprofile.view',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-globe',\n label: app.translator.trans('fof-socialprofile.admin.permissions.editOwn'),\n permission: 'fof-socialprofile.editOwn',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-globe',\n label: app.translator.trans('fof-socialprofile.admin.permissions.editAny'),\n permission: 'fof-socialprofile.editAny',\n },\n 'moderate'\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","registerPermission","icon","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,oBAAoB,WACvCA,IAAAA,cAAAA,IACO,qBACJC,gBAAgB,CACfC,QAAS,4CACTC,KAAM,SACNC,MAAOJ,IAAAA,WAAAA,MAAqB,oEAE7BK,mBACC,CACEC,KAAM,eACNF,MAAOJ,IAAAA,WAAAA,MAAqB,4CAC5BO,WAAY,yBACZC,YAAY,GAEd,QAEDH,mBACC,CACEC,KAAM,eACNF,MAAOJ,IAAAA,WAAAA,MAAqB,+CAC5BO,WAAY,6BAEd,SAEDF,mBACC,CACEC,KAAM,eACNF,MAAOJ,IAAAA,WAAAA,MAAqB,+CAC5BO,WAAY,6BAEd,WAEL,G","sources":["webpack://@fof/socialprofile/webpack/bootstrap","webpack://@fof/socialprofile/webpack/runtime/compat get default export","webpack://@fof/socialprofile/webpack/runtime/define property getters","webpack://@fof/socialprofile/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/socialprofile/webpack/runtime/make namespace object","webpack://@fof/socialprofile/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/socialprofile/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('fof-socialprfile', () => {\n app.extensionData\n .for('fof-socialprofile')\n .registerSetting({\n setting: 'fof-socialprofile.allow_external_favicons',\n type: 'switch',\n label: app.translator.trans('fof-socialprofile.admin.settings.allow_external_favicons_label'),\n })\n .registerPermission(\n {\n icon: 'fas fa-globe',\n label: app.translator.trans('fof-socialprofile.admin.permissions.view'),\n permission: 'fof-socialprofile.view',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'fas fa-globe',\n label: app.translator.trans('fof-socialprofile.admin.permissions.editOwn'),\n permission: 'fof-socialprofile.editOwn',\n },\n 'start'\n )\n .registerPermission(\n {\n icon: 'fas fa-globe',\n label: app.translator.trans('fof-socialprofile.admin.permissions.editAny'),\n permission: 'fof-socialprofile.editAny',\n },\n 'moderate'\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","registerPermission","icon","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 25810ea..bd9cbd6 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAe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AW,Y","sources":["webpack://@fof/socialprofile/webpack/bootstrap","webpack://@fof/socialprofile/webpack/runtime/compat get default export","webpack://@fof/socialprofile/webpack/runtime/define property getters","webpack://@fof/socialprofile/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/socialprofile/webpack/runtime/make namespace object","webpack://@fof/socialprofile/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['forum/components/UserCard']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/socialprofile/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/socialprofile/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/utils/withAttr']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/socialprofile/./src/forum/components/IconSelectorComponent.js","webpack://@fof/socialprofile/./src/forum/components/WebsiteInputComponent.js","webpack://@fof/socialprofile/./src/forum/helpers/isValidUrl.js","webpack://@fof/socialprofile/./src/forum/helpers/extractUriHost.js","webpack://@fof/socialprofile/./src/forum/components/SocialButtonsModal.js","webpack://@fof/socialprofile/./src/forum/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserCard'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import Dropdown from 'flarum/common/components/Dropdown';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport icon from 'flarum/common/helpers/icon';\nimport classList from 'flarum/common/utils/classList';\n\nexport default class IconSelectorComponent extends Dropdown {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n attrs.className = 'icondropdown';\n attrs.buttonClassName = 'Button Button--icon';\n attrs.menuClassName = 'social-dropdown-menu';\n }\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.icons = {\n social: [\n 'fas fa-envelope',\n 'fas fa-globe',\n 'fab fa-amazon',\n 'fab fa-angellist',\n 'fab fa-apple',\n 'fab fa-behance',\n 'fab fa-bitbucket',\n 'fab fa-codepen',\n 'fab fa-connectdevelop',\n 'fab fa-dashcube',\n 'fab fa-delicious',\n 'fab fa-deviantart',\n 'fab fa-digg',\n 'fab fa-discord',\n 'fab fa-dribbble',\n 'fab fa-dropbox',\n 'fab fa-drupal',\n 'fab fa-facebook',\n 'fab fa-flickr',\n 'fab fa-foursquare',\n 'fab fa-get-pocket',\n 'fab fa-git',\n 'fab fa-github',\n 'fab fa-github-alt',\n 'fab fa-google',\n 'fab fa-google-plus',\n 'fab fa-google-wallet',\n 'fab fa-hacker-news',\n 'fab fa-instagram',\n 'fab fa-ioxhost',\n 'fab fa-joomla',\n 'fab fa-jsfiddle',\n 'fab fa-lastfm',\n 'fab fa-leanpub',\n 'fab fa-linkedin',\n 'fab fa-mastodon',\n 'fab fa-medium',\n 'fab fa-odnoklassniki',\n 'fab fa-opencart',\n 'fab fa-pagelines',\n 'fab fa-paypal',\n 'fab fa-pied-piper-alt',\n 'fab fa-pinterest-p',\n 'fab fa-playstation',\n 'fab fa-qq',\n 'fab fa-reddit',\n 'fab fa-renren',\n 'fab fa-sellsy',\n 'fas fa-share-alt',\n 'fab fa-shirtsinbulk',\n 'fab fa-simplybuilt',\n 'fab fa-skyatlas',\n 'fab fa-skype',\n 'fab fa-slack',\n 'fab fa-slideshare',\n 'fab fa-soundcloud',\n 'fab fa-spotify',\n 'fab fa-stack-exchange',\n 'fab fa-stack-overflow',\n 'fab fa-steam',\n 'fab fa-stumbleupon',\n 'fab fa-telegram',\n 'fab fa-tencent-weibo',\n 'fab fa-trello',\n 'fab fa-tripadvisor',\n 'fab fa-tumblr',\n 'fab fa-twitch',\n 'fab fa-twitter',\n 'fab fa-viacoin',\n 'fab fa-vimeo',\n 'fab fa-vine',\n 'fab fa-vk',\n 'fab fa-weibo',\n 'fab fa-weixin',\n 'fab fa-whatsapp',\n 'fab fa-wordpress',\n 'fab fa-xbox',\n 'fab fa-xing',\n 'fab fa-y-combinator',\n 'fab fa-yandex',\n 'fab fa-yandex-international',\n 'fab fa-yelp',\n 'fab fa-youtube',\n ],\n };\n }\n\n view(vnode) {\n vnode.children = this.items().toArray();\n\n return super.view(vnode);\n }\n\n getButtonContent() {\n const ic = (str) => icon(str, { className: 'icondropdown-activeIcon fa-fw' });\n\n return [\n /^favicon(-\\w+)?$/.test(this.attrs.selection())\n ? this.attrs.allowsExternal\n ? [\n {\n this.attrs.favicon('none');\n this.select(this.icons.social[0]);\n }}\n />,\n ]\n : ic('fas fa-globe')\n : ic(this.attrs.selection()),\n this.attrs.caretIcon ? icon(this.attrs.caretIcon, { className: 'Button-caret' }) : '',\n ];\n }\n\n items() {\n const items = new ItemList();\n\n if (this.attrs.favicon() !== 'none' && this.attrs.allowsExternal) {\n items.add(\n 'favicon',\n this.select('favicon')}\n role=\"button\"\n className={classList({\n 'iconpicker-item': true,\n 'iconpicker-item--highlighted': this.attrs.selection() === 'favicon',\n })}\n title=\"Favicon\"\n >\n \n ,\n 102\n );\n\n items.add(\n 'favicon-grey',\n this.select('favicon-grey')}\n role=\"button\"\n className={classList({\n 'iconpicker-item iconpicker-item--invertColors': true,\n 'iconpicker-item--highlighted': this.attrs.selection() === 'favicon-grey',\n })}\n title=\"Grey Favicon\"\n >\n \n ,\n 101\n );\n }\n\n this.icons.social.forEach((curIcon) => {\n items.add(\n curIcon.replace(/ /, '-'),\n this.select(curIcon)}\n className={classList({ 'iconpicker-item': true, 'iconpicker-item--highlighted': this.attrs.selection() === curIcon })}\n role=\"button\"\n title={`.${curIcon}`}\n >\n {icon(curIcon, { className: 'social-icon fa-fw' })}\n ,\n 100\n );\n });\n\n return items;\n }\n\n select(icon) {\n this.attrs.selection(icon);\n }\n}\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport extractUriHost from '../helpers/extractUriHost';\nimport isValidUrl from '../helpers/isValidUrl';\nimport IconSelectorComponent from './IconSelectorComponent';\n\nexport default class WebsiteInputComponent extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.button = this.attrs.button;\n\n this.allowsExternal = app.forum.attribute('fof-socialprofile.allow_external_favicons');\n }\n\n view(vnode) {\n return (\n
\n \n\n {IconSelectorComponent.component({\n selection: this.button.icon,\n favicon: this.button.favicon,\n index: this.button.index,\n allowsExternal: this.allowsExternal,\n })}\n\n \n\n \n\n \n
\n );\n }\n\n onUrlChange(value) {\n this.button.url(value);\n\n if (!this.allowsExternal) {\n return;\n }\n\n clearTimeout(this.waitUntilFinished);\n\n if (this.button.icon() !== 'fas fa-circle-notch fa-spin') {\n this.button.icon('fas fa-circle-notch fa-spin');\n this.button.favicon('none');\n }\n\n this.waitUntilFinished = setTimeout(() => {\n if (isValidUrl(this.button.url())) {\n const iconurl = `https://icons.duckduckgo.com/ip3/${extractUriHost(this.button.url())}.ico`;\n\n this.button.favicon(iconurl);\n this.button.icon('favicon');\n\n m.redraw();\n } else {\n this.button.icon('fas fa-globe');\n this.button.favicon('none');\n m.redraw();\n }\n }, 1000);\n }\n}\n","/**\n * Verifies if a string is a valid URL (http/https only).\n *\n * @param {string} url URL to test\n */\nexport default function isValidUrl(url) {\n let urlInstance;\n\n try {\n urlInstance = new URL(url);\n } catch (_) {\n return false;\n }\n\n return ['http:', 'https:'].includes(urlInstance.protocol);\n}\n","/**\n * Extracts the host of a specified URI. Returns `null` if the URL is invalid.\n *\n * @example\n * // www.google.com\n * extractBaseUrl(\"https://www.google.com/search?q=flarum\")\n *\n * @example\n * // discuss.flarum.org\n * extractBaseUrl(\"https://discuss.flarum.org/u/admin\")\n *\n * @example\n * // null\n * extractBaseUrl(\"javascript:alert('hello!')\")\n *\n * @param {string|null} url URL to extract base from\n */\nexport default function extractUriHost(url) {\n let urlInstance;\n\n try {\n urlInstance = new URL(url);\n } catch (_) {\n return null;\n }\n\n if (['http:', 'https:'].includes(urlInstance.protocol)) {\n return urlInstance.host;\n }\n\n return null;\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport WebsiteInputComponent from './WebsiteInputComponent';\n\nexport default class SocialButtonsModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.buttons = [];\n const buttons = this.attrs.user.socialButtons();\n\n if (buttons.length) {\n buttons.forEach((button, index) => {\n if (button && button.title) {\n this.createButtonObject(index, button);\n }\n });\n } else {\n this.createButtonObject(0);\n }\n }\n\n className() {\n return 'SocialButtonsModal Modal--small';\n }\n\n title() {\n return app.translator.trans('fof-socialprofile.forum.edit.headtitle');\n }\n\n content() {\n const areAnyIconsBeingFetched = this.buttons.some((button) => button.icon() === 'fas fa-circle-notch fa-spin');\n\n return (\n
\n
\n {this.buttons.map((button) => WebsiteInputComponent.component({ button }))}\n\n
\n
\n \n
\n\n
\n \n
\n\n {Button.component(\n {\n type: 'submit',\n style: 'float: right;',\n className: 'Button Button--primary EditSocialButtons-save',\n loading: this.loading,\n // Disable save button if favicons are being fetched\n disabled: areAnyIconsBeingFetched,\n title: areAnyIconsBeingFetched ? app.translator.trans('fof-socialprofile.forum.edit.save_disabled_fetching_favicons') : null,\n },\n app.translator.trans('fof-socialprofile.forum.edit.submit')\n )}\n
\n
\n
\n );\n }\n\n data() {\n const buttons = [];\n\n this.buttons.forEach((button) => {\n if (button && button.title() && button.url()) {\n buttons.push({\n title: button.title(),\n url: button.url(),\n icon: button.icon(),\n favicon: button.favicon(),\n });\n }\n });\n\n return {\n socialButtons: JSON.stringify(buttons),\n };\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n this.attrs.user\n .save(this.data(), { errorHandler: this.onerror.bind(this) })\n .then(this.hide.bind(this))\n .then($('#app').trigger('refreshSocialButtons', [this.data().socialButtons]))\n .catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n\n addSocialButton() {\n this.createButtonObject(this.buttons.length);\n\n m.redraw();\n\n $('document').ready(() => {\n $(`#socialgroup-${this.buttons.length - 1}`).slideDown();\n });\n }\n\n delSocialButton() {\n const curdel = this.buttons.length - 1;\n\n $(`#socialgroup-${curdel}`).slideUp('normal', () => {\n this.buttons.splice(curdel, 1);\n m.redraw();\n });\n }\n\n createButtonObject(key, button = null) {\n if (button == null) {\n this.buttons[key] = {};\n this.buttons[key].index = Stream(key);\n this.buttons[key].favicon = Stream('none');\n this.buttons[key].title = Stream('');\n this.buttons[key].url = Stream('');\n this.buttons[key].icon = Stream('fas fa-globe');\n } else {\n this.buttons[key] = {};\n this.buttons[key].index = Stream(key);\n this.buttons[key].favicon = Stream(button.favicon);\n this.buttons[key].title = Stream(button.title);\n this.buttons[key].url = Stream(button.url);\n this.buttons[key].icon = Stream(button.icon);\n }\n }\n}\n","import app from 'flarum/forum/app';\nimport Model from 'flarum/common/Model';\nimport User from 'flarum/common/models/User';\nimport { extend } from 'flarum/common/extend';\nimport UserCard from 'flarum/forum/components/UserCard';\nimport Badge from 'flarum/common/components/Badge';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport classList from 'flarum/common/utils/classList';\n\nimport SocialButtonsModal from './components/SocialButtonsModal';\n\napp.initializers.add('fof/socialprofile', () => {\n User.prototype.socialButtons = Model.attribute('socialButtons', (str) => JSON.parse(str || '[]'));\n User.prototype.canViewSocialProfile = Model.attribute('canViewSocialProfile');\n User.prototype.canEditSocialProfile = Model.attribute('canEditSocialProfile');\n\n extend(UserCard.prototype, 'infoItems', function (items) {\n const user = this.attrs.user;\n\n if (!user.canViewSocialProfile()) {\n return;\n }\n\n this.canEdit = user.canEditSocialProfile();\n this.buttons = this.attrs.user.socialButtons();\n\n const buttonList = new ItemList();\n\n if (this.buttons.length) {\n this.buttons.forEach((button, index) => {\n if (button && button.title && button.icon && button.url) {\n let buttonStyle = {};\n let buttonClassName = classList({\n [`social-button ${button.icon}-${index} social-icon-${index}`]: true,\n 'social-greyscale-button': button.icon === 'favicon-grey',\n });\n\n if (button.icon === 'favicon' || button.icon === 'favicon-grey') {\n if (app.forum.attribute('fof-socialprofile.allow_external_favicons')) {\n buttonStyle = {\n backgroundImage: `url(\"${button.favicon}\")`,\n backgroundSize: '60%',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat',\n };\n } else {\n buttonClassName += ' fas fa-globe';\n }\n }\n\n buttonList.add(\n `social-icon-${index}`,\n \n {Badge.component({\n className: classList({ [buttonClassName]: true, 'social-icon--deleting': this.deleting }),\n type: `social`,\n icon: button.icon,\n label: button.title,\n style: buttonStyle,\n })}\n \n );\n }\n });\n\n if (this.canEdit) {\n buttonList.add(\n 'settings social-button',\n Badge.component({\n type: 'social social-settings',\n icon: 'fas fa-cog',\n label: app.translator.trans('fof-socialprofile.forum.edit.edit'),\n onclick: () => {\n app.modal.show(SocialButtonsModal, { user: this.attrs.user });\n },\n }),\n -1\n );\n }\n } else if (this.canEdit) {\n buttonList.add(\n 'settings social-button',\n Badge.component({\n type: 'social null-social-settings',\n icon: 'fas fa-plus',\n label: app.translator.trans('fof-socialprofile.forum.edit.add'),\n onclick: () => {\n app.modal.show(SocialButtonsModal, { user: this.attrs.user });\n },\n }),\n -1\n );\n }\n\n if (buttonList.toArray().length > 0) {\n items.add('fofsocialprofile', buttonList.toArray(), 20);\n }\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","IconSelectorComponent","initAttrs","attrs","className","buttonClassName","menuClassName","oninit","vnode","this","icons","social","view","children","items","toArray","getButtonContent","ic","str","icon","test","selection","allowsExternal","classList","alt","src","favicon","onerror","select","caretIcon","ItemList","add","onclick","role","title","index","style","width","height","margin","forEach","curIcon","replace","Dropdown","WebsiteInputComponent","button","app","id","type","placeholder","tabIndex","bidi","component","url","onchange","withAttr","onUrlChange","bind","clearTimeout","waitUntilFinished","setTimeout","urlInstance","URL","_","includes","protocol","isValidUrl","iconurl","host","extractUriHost","m","redraw","Component","SocialButtonsModal","buttons","user","socialButtons","length","createButtonObject","content","areAnyIconsBeingFetched","some","map","addSocialButton","delSocialButton","Button","loading","disabled","data","push","JSON","stringify","onsubmit","e","preventDefault","save","errorHandler","then","hide","$","trigger","ready","slideDown","curdel","slideUp","splice","Stream","Modal","User","Model","parse","extend","UserCard","canViewSocialProfile","canEdit","canEditSocialProfile","buttonList","buttonStyle","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","href","target","rel","Badge","deleting","label"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAi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M,yBACN7B,KAAM,aACN4G,MAAOjF,IAAAA,WAAAA,MAAqB,qCAC5Bd,QAAS,WACPc,IAAAA,MAAAA,KAAe2B,EAAoB,CAAEE,KAAM,EAAKxE,MAAMwE,MACvD,KAEF,IAGIlE,KAAKyG,SACdE,EAAWrF,IACT,yBACA8F,IAAAA,UAAgB,CACd7E,KAAM,8BACN7B,KAAM,cACN4G,MAAOjF,IAAAA,WAAAA,MAAqB,oCAC5Bd,QAAS,WACPc,IAAAA,MAAAA,KAAe2B,EAAoB,CAAEE,KAAM,EAAKxE,MAAMwE,MACvD,KAEF,GAIDyC,EAAWrG,UAAU8D,OAAS,GAChC/D,EAAMiB,IAAI,mBAAoBqF,EAAWrG,UAAW,GA1ErD,CA4EF,GACF,G","sources":["webpack://@fof/socialprofile/webpack/bootstrap","webpack://@fof/socialprofile/webpack/runtime/compat get default export","webpack://@fof/socialprofile/webpack/runtime/define property getters","webpack://@fof/socialprofile/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/socialprofile/webpack/runtime/make namespace object","webpack://@fof/socialprofile/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['forum/components/UserCard']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/socialprofile/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/socialprofile/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/utils/withAttr']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/socialprofile/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/socialprofile/./src/forum/components/IconSelectorComponent.js","webpack://@fof/socialprofile/./src/forum/components/WebsiteInputComponent.js","webpack://@fof/socialprofile/./src/forum/helpers/isValidUrl.js","webpack://@fof/socialprofile/./src/forum/helpers/extractUriHost.js","webpack://@fof/socialprofile/./src/forum/components/SocialButtonsModal.js","webpack://@fof/socialprofile/./src/forum/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserCard'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import Dropdown from 'flarum/common/components/Dropdown';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport icon from 'flarum/common/helpers/icon';\nimport classList from 'flarum/common/utils/classList';\n\nexport default class IconSelectorComponent extends Dropdown {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n attrs.className = 'icondropdown';\n attrs.buttonClassName = 'Button Button--icon';\n attrs.menuClassName = 'social-dropdown-menu';\n }\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.icons = {\n social: [\n 'fas fa-envelope',\n 'fas fa-globe',\n 'fab fa-amazon',\n 'fab fa-angellist',\n 'fab fa-apple',\n 'fab fa-behance',\n 'fab fa-bitbucket',\n 'fab fa-codepen',\n 'fab fa-connectdevelop',\n 'fab fa-dashcube',\n 'fab fa-delicious',\n 'fab fa-deviantart',\n 'fab fa-digg',\n 'fab fa-discord',\n 'fab fa-dribbble',\n 'fab fa-dropbox',\n 'fab fa-drupal',\n 'fab fa-facebook',\n 'fab fa-flickr',\n 'fab fa-foursquare',\n 'fab fa-get-pocket',\n 'fab fa-git',\n 'fab fa-github',\n 'fab fa-github-alt',\n 'fab fa-google',\n 'fab fa-google-plus',\n 'fab fa-google-wallet',\n 'fab fa-hacker-news',\n 'fab fa-instagram',\n 'fab fa-ioxhost',\n 'fab fa-joomla',\n 'fab fa-jsfiddle',\n 'fab fa-lastfm',\n 'fab fa-leanpub',\n 'fab fa-linkedin',\n 'fab fa-mastodon',\n 'fab fa-medium',\n 'fab fa-odnoklassniki',\n 'fab fa-opencart',\n 'fab fa-pagelines',\n 'fab fa-paypal',\n 'fab fa-pied-piper-alt',\n 'fab fa-pinterest-p',\n 'fab fa-playstation',\n 'fab fa-qq',\n 'fab fa-reddit',\n 'fab fa-renren',\n 'fab fa-sellsy',\n 'fas fa-share-alt',\n 'fab fa-shirtsinbulk',\n 'fab fa-simplybuilt',\n 'fab fa-skyatlas',\n 'fab fa-skype',\n 'fab fa-slack',\n 'fab fa-slideshare',\n 'fab fa-soundcloud',\n 'fab fa-spotify',\n 'fab fa-stack-exchange',\n 'fab fa-stack-overflow',\n 'fab fa-steam',\n 'fab fa-stumbleupon',\n 'fab fa-telegram',\n 'fab fa-tencent-weibo',\n 'fab fa-trello',\n 'fab fa-tripadvisor',\n 'fab fa-tumblr',\n 'fab fa-twitch',\n 'fab fa-twitter',\n 'fab fa-viacoin',\n 'fab fa-vimeo',\n 'fab fa-vine',\n 'fab fa-vk',\n 'fab fa-weibo',\n 'fab fa-weixin',\n 'fab fa-whatsapp',\n 'fab fa-wordpress',\n 'fab fa-xbox',\n 'fab fa-xing',\n 'fab fa-y-combinator',\n 'fab fa-yandex',\n 'fab fa-yandex-international',\n 'fab fa-yelp',\n 'fab fa-youtube',\n ],\n };\n }\n\n view(vnode) {\n vnode.children = this.items().toArray();\n\n return super.view(vnode);\n }\n\n getButtonContent() {\n const ic = (str) => icon(str, { className: 'icondropdown-activeIcon fa-fw' });\n\n return [\n /^favicon(-\\w+)?$/.test(this.attrs.selection())\n ? this.attrs.allowsExternal\n ? [\n {\n this.attrs.favicon('none');\n this.select(this.icons.social[0]);\n }}\n />,\n ]\n : ic('fas fa-globe')\n : ic(this.attrs.selection()),\n this.attrs.caretIcon ? icon(this.attrs.caretIcon, { className: 'Button-caret' }) : '',\n ];\n }\n\n items() {\n const items = new ItemList();\n\n if (this.attrs.favicon() !== 'none' && this.attrs.allowsExternal) {\n items.add(\n 'favicon',\n this.select('favicon')}\n role=\"button\"\n className={classList({\n 'iconpicker-item': true,\n 'iconpicker-item--highlighted': this.attrs.selection() === 'favicon',\n })}\n title=\"Favicon\"\n >\n \n ,\n 102\n );\n\n items.add(\n 'favicon-grey',\n this.select('favicon-grey')}\n role=\"button\"\n className={classList({\n 'iconpicker-item iconpicker-item--invertColors': true,\n 'iconpicker-item--highlighted': this.attrs.selection() === 'favicon-grey',\n })}\n title=\"Grey Favicon\"\n >\n \n ,\n 101\n );\n }\n\n this.icons.social.forEach((curIcon) => {\n items.add(\n curIcon.replace(/ /, '-'),\n this.select(curIcon)}\n className={classList({ 'iconpicker-item': true, 'iconpicker-item--highlighted': this.attrs.selection() === curIcon })}\n role=\"button\"\n title={`.${curIcon}`}\n >\n {icon(curIcon, { className: 'social-icon fa-fw' })}\n ,\n 100\n );\n });\n\n return items;\n }\n\n select(icon) {\n this.attrs.selection(icon);\n }\n}\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport extractUriHost from '../helpers/extractUriHost';\nimport isValidUrl from '../helpers/isValidUrl';\nimport IconSelectorComponent from './IconSelectorComponent';\n\nexport default class WebsiteInputComponent extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.button = this.attrs.button;\n\n this.allowsExternal = app.forum.attribute('fof-socialprofile.allow_external_favicons');\n }\n\n view(vnode) {\n return (\n
\n \n\n {IconSelectorComponent.component({\n selection: this.button.icon,\n favicon: this.button.favicon,\n index: this.button.index,\n allowsExternal: this.allowsExternal,\n })}\n\n \n\n \n\n \n
\n );\n }\n\n onUrlChange(value) {\n this.button.url(value);\n\n if (!this.allowsExternal) {\n return;\n }\n\n clearTimeout(this.waitUntilFinished);\n\n if (this.button.icon() !== 'fas fa-circle-notch fa-spin') {\n this.button.icon('fas fa-circle-notch fa-spin');\n this.button.favicon('none');\n }\n\n this.waitUntilFinished = setTimeout(() => {\n if (isValidUrl(this.button.url())) {\n const iconurl = `https://icons.duckduckgo.com/ip3/${extractUriHost(this.button.url())}.ico`;\n\n this.button.favicon(iconurl);\n this.button.icon('favicon');\n\n m.redraw();\n } else {\n this.button.icon('fas fa-globe');\n this.button.favicon('none');\n m.redraw();\n }\n }, 1000);\n }\n}\n","/**\n * Verifies if a string is a valid URL (http/https only).\n *\n * @param {string} url URL to test\n */\nexport default function isValidUrl(url) {\n let urlInstance;\n\n try {\n urlInstance = new URL(url);\n } catch (_) {\n return false;\n }\n\n return ['http:', 'https:'].includes(urlInstance.protocol);\n}\n","/**\n * Extracts the host of a specified URI. Returns `null` if the URL is invalid.\n *\n * @example\n * // www.google.com\n * extractBaseUrl(\"https://www.google.com/search?q=flarum\")\n *\n * @example\n * // discuss.flarum.org\n * extractBaseUrl(\"https://discuss.flarum.org/u/admin\")\n *\n * @example\n * // null\n * extractBaseUrl(\"javascript:alert('hello!')\")\n *\n * @param {string|null} url URL to extract base from\n */\nexport default function extractUriHost(url) {\n let urlInstance;\n\n try {\n urlInstance = new URL(url);\n } catch (_) {\n return null;\n }\n\n if (['http:', 'https:'].includes(urlInstance.protocol)) {\n return urlInstance.host;\n }\n\n return null;\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport WebsiteInputComponent from './WebsiteInputComponent';\n\nexport default class SocialButtonsModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.buttons = [];\n const buttons = this.attrs.user.socialButtons();\n\n if (buttons.length) {\n buttons.forEach((button, index) => {\n if (button && button.title) {\n this.createButtonObject(index, button);\n }\n });\n } else {\n this.createButtonObject(0);\n }\n }\n\n className() {\n return 'SocialButtonsModal Modal--small';\n }\n\n title() {\n return app.translator.trans('fof-socialprofile.forum.edit.headtitle');\n }\n\n content() {\n const areAnyIconsBeingFetched = this.buttons.some((button) => button.icon() === 'fas fa-circle-notch fa-spin');\n\n return (\n
\n
\n {this.buttons.map((button) => WebsiteInputComponent.component({ button }))}\n\n
\n
\n \n
\n\n
\n \n
\n\n {Button.component(\n {\n type: 'submit',\n style: 'float: right;',\n className: 'Button Button--primary EditSocialButtons-save',\n loading: this.loading,\n // Disable save button if favicons are being fetched\n disabled: areAnyIconsBeingFetched,\n title: areAnyIconsBeingFetched ? app.translator.trans('fof-socialprofile.forum.edit.save_disabled_fetching_favicons') : null,\n },\n app.translator.trans('fof-socialprofile.forum.edit.submit')\n )}\n
\n
\n
\n );\n }\n\n data() {\n const buttons = [];\n\n this.buttons.forEach((button) => {\n if (button && button.title() && button.url()) {\n buttons.push({\n title: button.title(),\n url: button.url(),\n icon: button.icon(),\n favicon: button.favicon(),\n });\n }\n });\n\n return {\n socialButtons: JSON.stringify(buttons),\n };\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n this.attrs.user\n .save(this.data(), { errorHandler: this.onerror.bind(this) })\n .then(this.hide.bind(this))\n .then($('#app').trigger('refreshSocialButtons', [this.data().socialButtons]))\n .catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n\n addSocialButton() {\n this.createButtonObject(this.buttons.length);\n\n m.redraw();\n\n $('document').ready(() => {\n $(`#socialgroup-${this.buttons.length - 1}`).slideDown();\n });\n }\n\n delSocialButton() {\n const curdel = this.buttons.length - 1;\n\n $(`#socialgroup-${curdel}`).slideUp('normal', () => {\n this.buttons.splice(curdel, 1);\n m.redraw();\n });\n }\n\n createButtonObject(key, button = null) {\n if (button == null) {\n this.buttons[key] = {};\n this.buttons[key].index = Stream(key);\n this.buttons[key].favicon = Stream('none');\n this.buttons[key].title = Stream('');\n this.buttons[key].url = Stream('');\n this.buttons[key].icon = Stream('fas fa-globe');\n } else {\n this.buttons[key] = {};\n this.buttons[key].index = Stream(key);\n this.buttons[key].favicon = Stream(button.favicon);\n this.buttons[key].title = Stream(button.title);\n this.buttons[key].url = Stream(button.url);\n this.buttons[key].icon = Stream(button.icon);\n }\n }\n}\n","import app from 'flarum/forum/app';\nimport Model from 'flarum/common/Model';\nimport User from 'flarum/common/models/User';\nimport { extend } from 'flarum/common/extend';\nimport UserCard from 'flarum/forum/components/UserCard';\nimport Badge from 'flarum/common/components/Badge';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport classList from 'flarum/common/utils/classList';\n\nimport SocialButtonsModal from './components/SocialButtonsModal';\n\napp.initializers.add('fof/socialprofile', () => {\n User.prototype.socialButtons = Model.attribute('socialButtons', (str) => JSON.parse(str || '[]'));\n User.prototype.canViewSocialProfile = Model.attribute('canViewSocialProfile');\n User.prototype.canEditSocialProfile = Model.attribute('canEditSocialProfile');\n\n extend(UserCard.prototype, 'infoItems', function (items) {\n const user = this.attrs.user;\n\n if (!user.canViewSocialProfile()) {\n return;\n }\n\n this.canEdit = user.canEditSocialProfile();\n this.buttons = this.attrs.user.socialButtons();\n\n const buttonList = new ItemList();\n\n if (this.buttons.length) {\n this.buttons.forEach((button, index) => {\n if (button && button.title && button.icon && button.url) {\n let buttonStyle = {};\n let buttonClassName = classList({\n [`social-button ${button.icon}-${index} social-icon-${index}`]: true,\n 'social-greyscale-button': button.icon === 'favicon-grey',\n });\n\n if (button.icon === 'favicon' || button.icon === 'favicon-grey') {\n if (app.forum.attribute('fof-socialprofile.allow_external_favicons')) {\n buttonStyle = {\n backgroundImage: `url(\"${button.favicon}\")`,\n backgroundSize: '60%',\n backgroundPosition: 'center',\n backgroundRepeat: 'no-repeat',\n };\n } else {\n buttonClassName += ' fas fa-globe';\n }\n }\n\n buttonList.add(\n `social-icon-${index}`,\n \n {Badge.component({\n className: classList({ [buttonClassName]: true, 'social-icon--deleting': this.deleting }),\n type: `social`,\n icon: button.icon,\n label: button.title,\n style: buttonStyle,\n })}\n \n );\n }\n });\n\n if (this.canEdit) {\n buttonList.add(\n 'settings social-button',\n Badge.component({\n type: 'social social-settings',\n icon: 'fas fa-cog',\n label: app.translator.trans('fof-socialprofile.forum.edit.edit'),\n onclick: () => {\n app.modal.show(SocialButtonsModal, { user: this.attrs.user });\n },\n }),\n -1\n );\n }\n } else if (this.canEdit) {\n buttonList.add(\n 'settings social-button',\n Badge.component({\n type: 'social null-social-settings',\n icon: 'fas fa-plus',\n label: app.translator.trans('fof-socialprofile.forum.edit.add'),\n onclick: () => {\n app.modal.show(SocialButtonsModal, { user: this.attrs.user });\n },\n }),\n -1\n );\n }\n\n if (buttonList.toArray().length > 0) {\n items.add('fofsocialprofile', buttonList.toArray(), 20);\n }\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","IconSelectorComponent","initAttrs","attrs","className","buttonClassName","menuClassName","oninit","vnode","this","icons","social","view","children","items","toArray","getButtonContent","ic","str","icon","test","selection","allowsExternal","classList","alt","src","favicon","onerror","select","caretIcon","ItemList","add","onclick","role","title","index","style","width","height","margin","forEach","curIcon","replace","Dropdown","WebsiteInputComponent","button","app","id","type","placeholder","tabIndex","bidi","component","url","onchange","withAttr","onUrlChange","bind","clearTimeout","waitUntilFinished","setTimeout","urlInstance","URL","_","includes","protocol","isValidUrl","iconurl","host","extractUriHost","m","redraw","Component","SocialButtonsModal","buttons","user","socialButtons","length","createButtonObject","content","areAnyIconsBeingFetched","some","map","addSocialButton","delSocialButton","Button","loading","disabled","data","push","JSON","stringify","onsubmit","e","preventDefault","save","errorHandler","then","hide","$","trigger","ready","slideDown","curdel","slideUp","splice","Stream","Modal","User","Model","parse","extend","UserCard","canViewSocialProfile","canEdit","canEditSocialProfile","buttonList","buttonStyle","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","href","target","rel","Badge","deleting","label"],"sourceRoot":""} \ No newline at end of file