framework/extensions/nicknames/js/dist/forum.js.map
flarum-bot f82ccbbf92 Bundled output for commit 05e936bbe4
Includes transpiled JS/TS.

[skip ci]
2022-02-22 15:30:11 +00:00

1 line
14 KiB
Plaintext
Generated

{"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,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,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,mC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,sB,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,4B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,uB,aCAzC,SAASC,EAAgBhB,EAAGiB,GAMzC,OALAD,EAAkBf,OA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AAuB,UAAU,SAAUZ,GACC,aAA7C1B,IAAAA,MAAAA,UAAoB,sBAEpBA,IAAAA,MAAAA,UAAoB,+BACtB0B,EAAMG,IACJ,WACA,SAAK5B,UAAU,cACb,WACEA,UAAU,cACVK,KAAK,WACLF,KAAK,OACL+B,YAAaC,GAAAA,CAAYpC,IAAAA,WAAAA,MAAqB,wDAC9CO,KAAMV,KAAKC,SACXU,SAAUX,KAAKY,SAAWZ,KAAK6C,WAAW,YAC1CC,SAAU3C,IAAAA,MAAAA,UAAoB,sCAGlC,IAGEA,IAAAA,MAAAA,UAAoB,oCACtB0B,EAAMkB,OAAO,iBAKnBpB,EAAAA,EAAAA,QAAOc,IAAAA,UAAuB,cAAc,SAAUD,GACpD,GAAiD,aAA7CrC,IAAAA,MAAAA,UAAoB,sBAEpBA,IAAAA,MAAAA,UAAoB,+BACtBqC,EAAKvC,SAAWD,KAAKC,WACjBE,IAAAA,MAAAA,UAAoB,oCAAoC,CAC1D,IAAM6C,EAAM,IAAIC,YAAY,GAC5BC,OAAOC,gBAAgBH,GACvBR,EAAKE,SAAWM,EAAII,KAAK,Y","sources":["webpack://@flarum/nicknames/webpack/bootstrap","webpack://@flarum/nicknames/webpack/runtime/compat get default export","webpack://@flarum/nicknames/webpack/runtime/define property getters","webpack://@flarum/nicknames/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/nicknames/webpack/runtime/make namespace object","webpack://@flarum/nicknames/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/nicknames/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/nicknames/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/nicknames/external root \"flarum.core.compat['common/components/EditUserModal']\"","webpack://@flarum/nicknames/external root \"flarum.core.compat['forum/components/SignUpModal']\"","webpack://@flarum/nicknames/external root \"flarum.core.compat['forum/components/SettingsPage']\"","webpack://@flarum/nicknames/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/nicknames/external root \"flarum.core.compat['common/models/User']\"","webpack://@flarum/nicknames/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@flarum/nicknames/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@flarum/nicknames/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/nicknames/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/nicknames/./src/forum/components/NicknameModal.js","webpack://@flarum/nicknames/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/nicknames/./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/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/EditUserModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SignUpModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","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/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","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';\n\nexport default class NicknameModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n this.nickname = Stream(app.session.user.displayName());\n }\n\n className() {\n return 'NickameModal Modal--small';\n }\n\n title() {\n return app.translator.trans('flarum-nicknames.forum.change_nickname.title');\n }\n\n content() {\n return (\n <div className=\"Modal-body\">\n <div className=\"Form Form--centered\">\n <div className=\"Form-group\">\n <input type=\"text\" autocomplete=\"off\" name=\"nickname\" className=\"FormControl\" bidi={this.nickname} disabled={this.loading} />\n </div>\n <div className=\"Form-group\">\n {Button.component(\n {\n className: 'Button Button--primary Button--block',\n type: 'submit',\n loading: this.loading,\n },\n app.translator.trans('flarum-nicknames.forum.change_nickname.submit_button')\n )}\n </div>\n </div>\n </div>\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n if (this.nickname() === app.session.user.displayName()) {\n this.hide();\n return;\n }\n\n this.loading = true;\n\n app.session.user\n .save(\n { nickname: this.nickname() },\n {\n errorHandler: this.onerror.bind(this),\n }\n )\n .then(this.hide.bind(this))\n .catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n}\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}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport EditUserModal from 'flarum/common/components/EditUserModal';\nimport SignUpModal from 'flarum/forum/components/SignUpModal';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport Model from 'flarum/common/Model';\nimport User from 'flarum/common/models/User';\nimport extractText from 'flarum/common/utils/extractText';\nimport Stream from 'flarum/common/utils/Stream';\nimport NickNameModal from './components/NicknameModal';\n\napp.initializers.add('flarum/nicknames', () => {\n User.prototype.canEditNickname = Model.attribute('canEditNickname');\n\n extend(SettingsPage.prototype, 'accountItems', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n\n if (this.user.canEditNickname()) {\n items.add(\n 'changeNickname',\n <Button className=\"Button\" onclick={() => app.modal.show(NickNameModal)}>\n {app.translator.trans('flarum-nicknames.forum.settings.change_nickname_button')}\n </Button>\n );\n }\n });\n\n extend(EditUserModal.prototype, 'oninit', function () {\n this.nickname = Stream(this.attrs.user.displayName());\n });\n\n extend(EditUserModal.prototype, 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n\n if (!this.attrs.user.canEditNickname()) return;\n\n items.add(\n 'nickname',\n <div className=\"Form-group\">\n <label>{app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_heading')}</label>\n <input\n className=\"FormControl\"\n placeholder={extractText(app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_text'))}\n bidi={this.nickname}\n />\n </div>,\n 100\n );\n });\n\n extend(EditUserModal.prototype, 'data', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n\n if (!this.attrs.user.canEditNickname()) return;\n\n if (this.nickname() !== this.attrs.user.displayName()) {\n data.nickname = this.nickname();\n }\n });\n\n extend(SignUpModal.prototype, 'oninit', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n\n this.nickname = Stream(this.attrs.username || '');\n });\n\n extend(SignUpModal.prototype, 'onready', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n\n if (app.forum.attribute('setNicknameOnRegistration') && app.forum.attribute('randomizeUsernameOnRegistration')) {\n this.$('[name=nickname]').select();\n }\n });\n\n extend(SignUpModal.prototype, 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n\n if (app.forum.attribute('setNicknameOnRegistration')) {\n items.add(\n 'nickname',\n <div className=\"Form-group\">\n <input\n className=\"FormControl\"\n name=\"nickname\"\n type=\"text\"\n placeholder={extractText(app.translator.trans('flarum-nicknames.forum.sign_up.nickname_placeholder'))}\n bidi={this.nickname}\n disabled={this.loading || this.isProvided('nickname')}\n required={app.forum.attribute('randomizeUsernameOnRegistration')}\n />\n </div>,\n 25\n );\n\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n items.remove('username');\n }\n }\n });\n\n extend(SignUpModal.prototype, 'submitData', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n\n if (app.forum.attribute('setNicknameOnRegistration')) {\n data.nickname = this.nickname();\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n const arr = new Uint32Array(2);\n crypto.getRandomValues(arr);\n data.username = arr.join('');\n }\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__","NicknameModal","subClass","superClass","create","constructor","oninit","vnode","this","nickname","Stream","app","className","title","content","type","autocomplete","name","bidi","disabled","loading","Button","onsubmit","e","preventDefault","errorHandler","onerror","bind","then","hide","m","redraw","Modal","User","Model","extend","SettingsPage","items","user","canEditNickname","add","onclick","NickNameModal","EditUserModal","attrs","displayName","placeholder","extractText","data","SignUpModal","username","$","select","isProvided","required","remove","arr","Uint32Array","crypto","getRandomValues","join"],"sourceRoot":""}