diff --git a/js/dist/forum.js b/js/dist/forum.js index 22596b9..1f1e1e7 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var o={};function a(i){if(o[i])return o[i].exports;var n=o[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,a),n.l=!0,n.exports}return a.m=t,a.c=o,a.d=function(t,o,i){a.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:i})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,o){if(1&o&&(t=a(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(a.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var n in t)a.d(i,n,function(o){return t[o]}.bind(null,n));return i},a.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(o,"a",o),o},a.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},a.p="",a(a.s=13)}([function(t,o){t.exports=flarum.core.compat["utils/Stream"]},function(t,o){t.exports=flarum.core.compat["components/Badge"]},function(t,o){t.exports=flarum.core.compat["utils/ItemList"]},function(t,o){t.exports=flarum.core.compat["components/Modal"]},function(t,o){t.exports=flarum.core.compat["components/Button"]},function(t,o){t.exports=flarum.core.compat["helpers/icon"]},function(t,o){t.exports=flarum.core.compat.Model},function(t,o){t.exports=flarum.core.compat["models/User"]},function(t,o){t.exports=flarum.core.compat.extend},function(t,o){t.exports=flarum.core.compat["components/UserCard"]},function(t,o){t.exports=flarum.core.compat.Component},function(t,o){t.exports=flarum.core.compat["utils/withAttr"]},function(t,o){t.exports=flarum.core.compat["components/Dropdown"]},function(t,o,a){"use strict";a.r(o);var i=a(6),n=a.n(i),e=a(7),s=a.n(e),r=a(8),c=a(9),l=a.n(c),f=a(1),u=a.n(f),p=a(2),b=a.n(p);function d(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,t.__proto__=o}var h=a(3),v=a.n(h),g=a(4),y=a.n(g),x=a(0),w=a.n(x),B=a(10),k=a.n(B),S=a(11),N=a.n(S);var j=a(12),O=a.n(j),_=a(5),E=a.n(_),F=function(t){function o(){return t.apply(this,arguments)||this}d(o,t),o.initAttrs=function(o){t.initAttrs.call(this,o),o.className="icondropdown",o.buttonClassName="Button Button--icon",o.menuClassName="social-dropdown-menu"};var a=o.prototype;return a.oninit=function(o){t.prototype.oninit.call(this,o),this.icons={social:["fas fa-envelope","fas fa-globe","fab fa-amazon","fab fa-angellist","fab fa-apple","fab fa-behance","fab fa-bitbucket","fab fa-codepen","fab fa-connectdevelop","fab fa-dashcube","fab fa-delicious","fab fa-deviantart","fab fa-digg","fab fa-discord","fab fa-dribbble","fab fa-dropbox","fab fa-drupal","fab fa-facebook","fab fa-flickr","fab fa-foursquare","fab fa-get-pocket","fab fa-git","fab fa-github","fab fa-github-alt","fab fa-google","fab fa-google-plus","fab fa-google-wallet","fab fa-hacker-news","fab fa-instagram","fab fa-ioxhost","fab fa-joomla","fab fa-jsfiddle","fab fa-lastfm","fab fa-leanpub","fab fa-linkedin","fab fa-mastodon","fab fa-medium","fab fa-odnoklassniki","fab fa-opencart","fab fa-pagelines","fab fa-paypal","fab fa-pied-piper-alt","fab fa-pinterest-p","fab fa-playstation","fab fa-qq","fab fa-reddit","fab fa-renren","fab fa-sellsy","fas fa-share-alt","fab fa-shirtsinbulk","fab fa-simplybuilt","fab fa-skyatlas","fab fa-skype","fab fa-slack","fab fa-slideshare","fab fa-soundcloud","fab fa-spotify","fab fa-stack-exchange","fab fa-stack-overflow","fab fa-steam","fab fa-stumbleupon","fab fa-telegram","fab fa-tencent-weibo","fab fa-trello","fab fa-tripadvisor","fab fa-tumblr","fab fa-twitch","fab fa-twitter","fab fa-viacoin","fab fa-vimeo","fab fa-vine","fab fa-vk","fab fa-weibo","fab fa-weixin","fab fa-whatsapp","fab fa-wordpress","fab fa-xbox","fab fa-xing","fab fa-y-combinator","fab fa-yandex","fab fa-yandex-international","fab fa-yelp","fab fa-youtube"]}},a.view=function(o){return o.children=this.items().toArray(),t.prototype.view.call(this,o)},a.getButtonContent=function(){var t=this;return[/^favicon(-\w+)?$/.test(this.attrs.selection())?[m("img",{className:"favicon-grey"===this.attrs.selection()?"social-greyscale-button":"social-button",style:{width:"14px",height:"14px"},alt:"favicon",src:this.attrs.favicon(),onerror:function(){t.attrs.favicon("none"),t.select(t.icons.social[0])}})]:E()(this.attrs.selection(),{}),this.attrs.caretIcon?E()(this.attrs.caretIcon,{className:"Button-caret"}):""]},a.items=function(){var t=this,o=new b.a;return"none"!==this.attrs.favicon()&&(o.add("favicon",m("div",{onclick:function(){return t.select("favicon")},role:"button",className:"iconpicker-item "+("favicon"===this.attrs.selection()?"iconpicker--highlighted":""),title:"Favicon"},m("img",{className:"iconpicker-image-"+this.attrs.index(),alt:"favicon",style:{width:"14px",height:"14px",margin:"0 2px 0 2px"},src:this.attrs.favicon()})),102),o.add("favicon-grey",m("div",{onclick:function(){return t.select("favicon-grey")},role:"button",className:"iconpicker-item-invt "+("favicon-grey"===this.attrs.selection()?"iconpicker--highlighted":""),title:"Grey Favicon"},m("img",{className:"social-greyscale-button iconpicker-image-"+this.attrs.index(),alt:"favicon",style:{width:"14px",height:"14px",margin:"0 2px 0 2px"},src:this.attrs.favicon()})),101)),this.icons.social.forEach((function(a){var i=w()();t.attrs.selection()===a&&i("iconpicker--highlighted"),o.add(a.replace(/ /,"-"),m("div",{onclick:function(){return t.select(a)},className:"iconpicker-item "+i(),role:"button",title:"."+a},E()(a,{className:"social-icon"})),100)})),o},a.select=function(t){this.attrs.selection(t)},o}(O.a),M=function(t){function o(){return t.apply(this,arguments)||this}d(o,t);var a=o.prototype;return a.oninit=function(o){t.prototype.oninit.call(this,o),this.button=this.attrs.button},a.view=function(){return m("div",{className:"Form-group form-group-social",id:"socialgroup-"+this.button.index()},m("input",{type:"text",className:"SocialFormControl SocialTitle",placeholder:app.translator.trans("fof-socialprofile.forum.edit.title"),tabIndex:2*(this.button.index()+1)-1,bidi:this.button.title}),F.component({selection:this.button.icon,favicon:this.button.favicon,index:this.button.index}),m("input",{type:"text",className:"SocialFormControl Socialurl",placeholder:app.translator.trans("fof-socialprofile.forum.edit.url"),tabIndex:2*(this.button.index()+1),value:this.button.url(),onchange:N()("value",this.onUrlChange.bind(this))}),m("input",{type:"hidden",className:"SocialFormControl SocialIcon",id:"icon"+this.button.index()+"-icon",bidi:this.button.icon}),m("input",{type:"hidden",className:"SocialFormControl Socialfavicon",id:"icon"+this.button.index()+"-favicon",bidi:this.button.favicon}))},a.onUrlChange=function(t){var o=this;this.button.url(t),clearTimeout(this.waitUntilFinished),"fas fa-circle-notch fa-spin"!==this.button.icon()&&(this.button.icon("fas fa-circle-notch fa-spin"),this.button.favicon("none")),this.waitUntilFinished=setTimeout((function(){if(function(t){var o;try{o=new URL(t)}catch(t){return!1}return["http:","https:"].includes(o.protocol)}(o.button.url())){var t=function(t){var o;try{o=new URL(t)}catch(t){return null}return["http:","https:"].includes(o.protocol)?o.origin:null}(o.button.url())+"/favicon.ico";o.button.favicon(t),o.button.icon("favicon"),m.redraw()}else o.button.icon("fas fa-globe"),o.button.favicon("none"),m.redraw()}),1e3)},o}(k.a),C=function(t){function o(){return t.apply(this,arguments)||this}d(o,t);var a=o.prototype;return a.oninit=function(o){var a=this;t.prototype.oninit.call(this,o),this.buttons=[];var i=this.attrs.user.socialButtons();i.length?i.forEach((function(t,o){""!==t.title&&a.createButtonObject(o,t)})):this.createButtonObject(0)},a.className=function(){return"SocialButtonsModal Modal--small"},a.title=function(){return app.translator.trans("fof-socialprofile.forum.edit.headtitle")},a.content=function(){var t=this.buttons.some((function(t){return"fas fa-circle-notch fa-spin"===t.icon()}));return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.buttons.map((function(t){return M.component({button:t})})),m("div",{className:"Form-group",id:"submit-button-group"},m("div",{className:"Button Button--primary EditSocialButtons-add",style:"margin-left: 1%;",onclick:this.addSocialButton.bind(this)},m("i",{className:"fas fa-fw fa-plus"})),m("div",{className:"Button Button--primary EditSocialButtons-del",style:"margin-left: 1%;",onclick:this.delSocialButton.bind(this)},m("i",{className:"fas fa-fw fa-minus"})),y.a.component({type:"submit",style:"float: right;",className:"Button Button--primary EditSocialButtons-save",loading:this.loading,disabled:t,title:t?app.translator.trans("fof-socialprofile.forum.edit.save_disabled_fetching_favicons"):null},app.translator.trans("fof-socialprofile.forum.edit.submit")))))},a.data=function(){var t=[];return this.buttons.forEach((function(o,a){""!==o.title()&&(t[a]={},t[a].title=o.title(),t[a].url=o.url(),t[a].icon=o.icon(),t[a].favicon=o.favicon())})),{socialButtons:JSON.stringify(t)}},a.onsubmit=function(t){var o=this;t.preventDefault(),this.loading=!0,this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).then($("#app").trigger("refreshSocialButtons",[this.data().socialButtons])).catch((function(){o.loading=!1,m.redraw()}))},a.addSocialButton=function(){var t=this;this.createButtonObject(this.buttons.length),m.redraw(),$("document").ready((function(){$("#socialgroup-"+(t.buttons.length-1)).slideDown()}))},a.delSocialButton=function(){var t=this,o=this.buttons.length-1;$("#socialgroup-"+o).slideUp("normal",(function(){t.buttons.splice(o,1),m.redraw()}))},a.createButtonObject=function(t,o){void 0===o&&(o=null),null==o?(this.buttons[t]={},this.buttons[t].index=w()(t),this.buttons[t].favicon=w()("none"),this.buttons[t].title=w()(""),this.buttons[t].url=w()(""),this.buttons[t].icon=w()("fas fa-globe")):(this.buttons[t]={},this.buttons[t].index=w()(t),this.buttons[t].favicon=w()(o.favicon),this.buttons[t].title=w()(o.title),this.buttons[t].url=w()(o.url),this.buttons[t].icon=w()(o.icon))},o}(v.a),U=function(t){function o(){return t.apply(this,arguments)||this}d(o,t);var a=o.prototype;return a.oninit=function(o){var a=this;t.prototype.oninit.call(this,o),this.buttons=[],this.index=this.attrs.index;var i=this.attrs.user.socialButtons();this.button=i[this.index],i.forEach((function(t,o){a.createButtonObject(o,t)}))},a.className=function(){return"SocialButtonsModal Modal--small"},a.title=function(){return app.translator.trans("fof-socialprofile.forum.edit.deletetitle")},a.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},m("h3",{className:"SocialProfile-title"},this.button.title),m("p",{className:"SocialProfile-url"},this.button.url),m("div",{className:"Form-group",id:"submit-button-group"},y.a.component({type:"submit",className:"Button Button--primary EditSocialButtons-delete",loading:this.loading},app.translator.trans("fof-socialprofile.forum.edit.delete")))))},a.data=function(){var t=[];return this.buttons.forEach((function(o,a){""!==o.title()&&(t[a]={},t[a].title=o.title(),t[a].url=o.url(),t[a].icon=o.icon(),t[a].favicon=o.favicon())})),{socialButtons:JSON.stringify(t)}},a.onsubmit=function(t){var o=this;t.preventDefault(),this.loading=!0,this.buttons.splice(this.index,1),this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).then($("#app").trigger("refreshSocialButtons",[this.data().socialButtons])).catch((function(){o.loading=!1,m.redraw()}))},a.createButtonObject=function(t,o){void 0===o&&(o=null),null==o?(this.buttons[t]={},this.buttons[t].index=w()(t),this.buttons[t].favicon=w()("none"),this.buttons[t].title=w()(""),this.buttons[t].url=w()(""),this.buttons[t].icon=w()("fas fa-globe")):(this.buttons[t]={},this.buttons[t].index=w()(t),this.buttons[t].favicon=w()(o.favicon),this.buttons[t].title=w()(o.title),this.buttons[t].url=w()(o.url),this.buttons[t].icon=w()(o.icon))},o}(v.a);app.initializers.add("fof/socialprofile",(function(){s.a.prototype.socialButtons=n.a.attribute("socialButtons",(function(t){return JSON.parse(t||"[]")})),Object(r.extend)(l.a.prototype,"infoItems",(function(t){var o=this;this.isSelf=app.session.user===this.attrs.user,this.canEdit=!!app.session.user&&app.session.user.data.attributes.canEdit,this.buttons=this.attrs.user.socialButtons();var a=new b.a;this.buttons.length?(this.buttons.forEach((function(t,i){if(""!==t.title&&""!==t.icon&&""!==t.url){var n="",e="";"favicon"===t.icon||"favicon-grey"===t.icon?(n='background-image: url("'+t.favicon+'");background-size: 60%;background-position: 50% 50%;background-repeat: no-repeat;',e="favicon-grey"===t.icon?t.icon+"-"+i+" social-button social-greyscale-button":t.icon+"-"+i+" social-button"):(n="",e=t.icon+"-"+i+" social-button"),a.add(e+(o.deleting?" social-button--highlightable":""),u.a.component({type:"social social-icon-"+i,icon:t.icon,label:t.title,style:n,onclick:function(){o.deleting?app.modal.show(U,{user:o.attrs.user,index:i}):window.open(t.url,"_blank")}}))}})),this.isSelf?a.add("settings social-button",u.a.component({type:"social social-settings",icon:"fas fa-cog",label:app.translator.trans("fof-socialprofile.forum.edit.edit"),onclick:function(){app.modal.show(C,{user:o.attrs.user})}}),-1):this.canEdit&&a.add("settings social-button",u.a.component({type:"social social-moderate "+(this.deleting?"social-moderate--highlighted":""),icon:"fas fa-exclamation-triangle",label:app.translator.trans("fof-socialprofile.forum.edit.delete"),onclick:function(){o.deleting=!o.deleting}}),-1)):this.isSelf&&a.add("settings social-button",u.a.component({type:"social null-social-settings",icon:"fas fa-plus",label:app.translator.trans("fof-socialprofile.forum.edit.add"),onclick:function(){app.modal.show(C,{user:o.attrs.user})}}),-1),a.toArray().length>0&&(t.has("lastSeen")&&t.replace("lastSeen",t.lastSeen,50),t.has("joined")&&t.replace("joined",t.joined,40),t.add("fofsocialprofile",a.toArray(),20))}))}))}]); +module.exports=function(t){var o={};function n(a){if(o[a])return o[a].exports;var i=o[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=o,n.d=function(t,o,a){n.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:a})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,o){if(1&o&&(t=n(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var i in t)n.d(a,i,function(o){return t[o]}.bind(null,i));return a},n.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(o,"a",o),o},n.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},n.p="",n(n.s=14)}([function(t,o){t.exports=flarum.core.compat["utils/Stream"]},function(t,o){t.exports=flarum.core.compat["utils/classList"]},function(t,o){t.exports=flarum.core.compat["components/Badge"]},function(t,o){t.exports=flarum.core.compat["utils/ItemList"]},function(t,o){t.exports=flarum.core.compat["components/Modal"]},function(t,o){t.exports=flarum.core.compat["components/Button"]},function(t,o){t.exports=flarum.core.compat["helpers/icon"]},function(t,o){t.exports=flarum.core.compat.Model},function(t,o){t.exports=flarum.core.compat["models/User"]},function(t,o){t.exports=flarum.core.compat.extend},function(t,o){t.exports=flarum.core.compat["components/UserCard"]},function(t,o){t.exports=flarum.core.compat.Component},function(t,o){t.exports=flarum.core.compat["utils/withAttr"]},function(t,o){t.exports=flarum.core.compat["components/Dropdown"]},function(t,o,n){"use strict";n.r(o);var a=n(7),i=n.n(a),e=n(8),s=n.n(e),r=n(9),c=n(10),l=n.n(c),f=n(2),u=n.n(f),p=n(3),b=n.n(p),d=n(1),h=n.n(d);function v(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,t.__proto__=o}var g=n(4),y=n.n(g),x=n(5),w=n.n(x),B=n(0),k=n.n(B),N=n(11),S=n.n(N),j=n(12),O=n.n(j);var F=n(13),C=n.n(F),_=n(6),E=n.n(_),M=function(t){function o(){return t.apply(this,arguments)||this}v(o,t),o.initAttrs=function(o){t.initAttrs.call(this,o),o.className="icondropdown",o.buttonClassName="Button Button--icon",o.menuClassName="social-dropdown-menu"};var n=o.prototype;return n.oninit=function(o){t.prototype.oninit.call(this,o),this.icons={social:["fas fa-envelope","fas fa-globe","fab fa-amazon","fab fa-angellist","fab fa-apple","fab fa-behance","fab fa-bitbucket","fab fa-codepen","fab fa-connectdevelop","fab fa-dashcube","fab fa-delicious","fab fa-deviantart","fab fa-digg","fab fa-discord","fab fa-dribbble","fab fa-dropbox","fab fa-drupal","fab fa-facebook","fab fa-flickr","fab fa-foursquare","fab fa-get-pocket","fab fa-git","fab fa-github","fab fa-github-alt","fab fa-google","fab fa-google-plus","fab fa-google-wallet","fab fa-hacker-news","fab fa-instagram","fab fa-ioxhost","fab fa-joomla","fab fa-jsfiddle","fab fa-lastfm","fab fa-leanpub","fab fa-linkedin","fab fa-mastodon","fab fa-medium","fab fa-odnoklassniki","fab fa-opencart","fab fa-pagelines","fab fa-paypal","fab fa-pied-piper-alt","fab fa-pinterest-p","fab fa-playstation","fab fa-qq","fab fa-reddit","fab fa-renren","fab fa-sellsy","fas fa-share-alt","fab fa-shirtsinbulk","fab fa-simplybuilt","fab fa-skyatlas","fab fa-skype","fab fa-slack","fab fa-slideshare","fab fa-soundcloud","fab fa-spotify","fab fa-stack-exchange","fab fa-stack-overflow","fab fa-steam","fab fa-stumbleupon","fab fa-telegram","fab fa-tencent-weibo","fab fa-trello","fab fa-tripadvisor","fab fa-tumblr","fab fa-twitch","fab fa-twitter","fab fa-viacoin","fab fa-vimeo","fab fa-vine","fab fa-vk","fab fa-weibo","fab fa-weixin","fab fa-whatsapp","fab fa-wordpress","fab fa-xbox","fab fa-xing","fab fa-y-combinator","fab fa-yandex","fab fa-yandex-international","fab fa-yelp","fab fa-youtube"]}},n.view=function(o){return o.children=this.items().toArray(),t.prototype.view.call(this,o)},n.getButtonContent=function(){var t=this;return[/^favicon(-\w+)?$/.test(this.attrs.selection())?[m("img",{className:h()({"icondropdown-activeIcon":!0,"social-greyscale-button":"favicon-grey"===this.attrs.selection(),"social-button":"favicon-grey"===!this.attrs.selection()}),alt:"",src:this.attrs.favicon(),onerror:function(){t.attrs.favicon("none"),t.select(t.icons.social[0])}})]:E()(this.attrs.selection(),{className:"icondropdown-activeIcon fa-fw"}),this.attrs.caretIcon?E()(this.attrs.caretIcon,{className:"Button-caret"}):""]},n.items=function(){var t=this,o=new b.a;return"none"!==this.attrs.favicon()&&(o.add("favicon",m("div",{onclick:function(){return t.select("favicon")},role:"button",className:h()({"iconpicker-item":!0,"iconpicker-item--highlighted":"favicon"===this.attrs.selection()}),title:"Favicon"},m("img",{className:"iconpicker-image-"+this.attrs.index(),alt:"favicon",style:{width:"14px",height:"14px",margin:"0 2px 0 2px"},src:this.attrs.favicon()})),102),o.add("favicon-grey",m("div",{onclick:function(){return t.select("favicon-grey")},role:"button",className:h()({"iconpicker-item iconpicker-item--invertColors":!0,"iconpicker-item--highlighted":"favicon-grey"===this.attrs.selection()}),title:"Grey Favicon"},m("img",{className:"social-greyscale-button iconpicker-image-"+this.attrs.index(),alt:"favicon",style:{width:"14px",height:"14px",margin:"0 2px 0 2px"},src:this.attrs.favicon()})),101)),this.icons.social.forEach((function(n){o.add(n.replace(/ /,"-"),m("div",{onclick:function(){return t.select(n)},className:h()({"iconpicker-item":!0,"iconpicker-item--highlighted":t.attrs.selection()===n}),role:"button",title:"."+n},E()(n,{className:"social-icon fa-fw"})),100)})),o},n.select=function(t){this.attrs.selection(t)},o}(C.a),U=function(t){function o(){return t.apply(this,arguments)||this}v(o,t);var n=o.prototype;return n.oninit=function(o){t.prototype.oninit.call(this,o),this.button=this.attrs.button},n.view=function(){return m("div",{className:"Form-group form-group-social",id:"socialgroup-"+this.button.index()},m("input",{type:"text",className:"SocialFormControl SocialFormControl-title",placeholder:app.translator.trans("fof-socialprofile.forum.edit.title"),tabIndex:2*(this.button.index()+1)-1,bidi:this.button.title}),M.component({selection:this.button.icon,favicon:this.button.favicon,index:this.button.index}),m("input",{type:"text",className:"SocialFormControl SocialFormControl-url",placeholder:app.translator.trans("fof-socialprofile.forum.edit.url"),tabIndex:2*(this.button.index()+1),value:this.button.url(),onchange:O()("value",this.onUrlChange.bind(this))}),m("input",{type:"hidden",className:"SocialFormControl SocialFormControl-icon",id:"icon"+this.button.index()+"-icon",bidi:this.button.icon}),m("input",{type:"hidden",className:"SocialFormControl SocialFormControl-favicon",id:"icon"+this.button.index()+"-favicon",bidi:this.button.favicon}))},n.onUrlChange=function(t){var o=this;this.button.url(t),clearTimeout(this.waitUntilFinished),"fas fa-circle-notch fa-spin"!==this.button.icon()&&(this.button.icon("fas fa-circle-notch fa-spin"),this.button.favicon("none")),this.waitUntilFinished=setTimeout((function(){if(function(t){var o;try{o=new URL(t)}catch(t){return!1}return["http:","https:"].includes(o.protocol)}(o.button.url())){var t=function(t){var o;try{o=new URL(t)}catch(t){return null}return["http:","https:"].includes(o.protocol)?o.origin:null}(o.button.url())+"/favicon.ico";o.button.favicon(t),o.button.icon("favicon"),m.redraw()}else o.button.icon("fas fa-globe"),o.button.favicon("none"),m.redraw()}),1e3)},o}(S.a),I=function(t){function o(){return t.apply(this,arguments)||this}v(o,t);var n=o.prototype;return n.oninit=function(o){var n=this;t.prototype.oninit.call(this,o),this.buttons=[];var a=this.attrs.user.socialButtons();a.length?a.forEach((function(t,o){""!==t.title&&n.createButtonObject(o,t)})):this.createButtonObject(0)},n.className=function(){return"SocialButtonsModal Modal--small"},n.title=function(){return app.translator.trans("fof-socialprofile.forum.edit.headtitle")},n.content=function(){var t=this.buttons.some((function(t){return"fas fa-circle-notch fa-spin"===t.icon()}));return m("div",{className:"Modal-body"},m("div",{className:"Form"},this.buttons.map((function(t){return U.component({button:t})})),m("div",{className:"Form-group",id:"submit-button-group"},m("div",{className:"Button Button--primary EditSocialButtons-add",style:"margin-left: 1%;",onclick:this.addSocialButton.bind(this)},m("i",{className:"fas fa-fw fa-plus"})),m("div",{className:"Button Button--primary EditSocialButtons-del",style:"margin-left: 1%;",onclick:this.delSocialButton.bind(this)},m("i",{className:"fas fa-fw fa-minus"})),w.a.component({type:"submit",style:"float: right;",className:"Button Button--primary EditSocialButtons-save",loading:this.loading,disabled:t,title:t?app.translator.trans("fof-socialprofile.forum.edit.save_disabled_fetching_favicons"):null},app.translator.trans("fof-socialprofile.forum.edit.submit")))))},n.data=function(){var t=[];return this.buttons.forEach((function(o,n){""!==o.title()&&(t[n]={},t[n].title=o.title(),t[n].url=o.url(),t[n].icon=o.icon(),t[n].favicon=o.favicon())})),{socialButtons:JSON.stringify(t)}},n.onsubmit=function(t){var o=this;t.preventDefault(),this.loading=!0,this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).then($("#app").trigger("refreshSocialButtons",[this.data().socialButtons])).catch((function(){o.loading=!1,m.redraw()}))},n.addSocialButton=function(){var t=this;this.createButtonObject(this.buttons.length),m.redraw(),$("document").ready((function(){$("#socialgroup-"+(t.buttons.length-1)).slideDown()}))},n.delSocialButton=function(){var t=this,o=this.buttons.length-1;$("#socialgroup-"+o).slideUp("normal",(function(){t.buttons.splice(o,1),m.redraw()}))},n.createButtonObject=function(t,o){void 0===o&&(o=null),null==o?(this.buttons[t]={},this.buttons[t].index=k()(t),this.buttons[t].favicon=k()("none"),this.buttons[t].title=k()(""),this.buttons[t].url=k()(""),this.buttons[t].icon=k()("fas fa-globe")):(this.buttons[t]={},this.buttons[t].index=k()(t),this.buttons[t].favicon=k()(o.favicon),this.buttons[t].title=k()(o.title),this.buttons[t].url=k()(o.url),this.buttons[t].icon=k()(o.icon))},o}(y.a),P=function(t){function o(){return t.apply(this,arguments)||this}v(o,t);var n=o.prototype;return n.oninit=function(o){var n=this;t.prototype.oninit.call(this,o),this.buttons=[],this.index=this.attrs.index;var a=this.attrs.user.socialButtons();this.button=a[this.index],a.forEach((function(t,o){n.createButtonObject(o,t)}))},n.className=function(){return"SocialButtonsModal Modal--small"},n.title=function(){return app.translator.trans("fof-socialprofile.forum.edit.deletetitle")},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form"},m("h3",{className:"SocialProfile-title"},this.button.title),m("p",{className:"SocialProfile-url"},this.button.url),m("div",{className:"Form-group",id:"submit-button-group"},w.a.component({type:"submit",className:"Button Button--primary EditSocialButtons-delete",loading:this.loading},app.translator.trans("fof-socialprofile.forum.edit.delete")))))},n.data=function(){var t=[];return this.buttons.forEach((function(o,n){""!==o.title()&&(t[n]={},t[n].title=o.title(),t[n].url=o.url(),t[n].icon=o.icon(),t[n].favicon=o.favicon())})),{socialButtons:JSON.stringify(t)}},n.onsubmit=function(t){var o=this;t.preventDefault(),this.loading=!0,this.buttons.splice(this.index,1),this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).then($("#app").trigger("refreshSocialButtons",[this.data().socialButtons])).catch((function(){o.loading=!1,m.redraw()}))},n.createButtonObject=function(t,o){void 0===o&&(o=null),null==o?(this.buttons[t]={},this.buttons[t].index=k()(t),this.buttons[t].favicon=k()("none"),this.buttons[t].title=k()(""),this.buttons[t].url=k()(""),this.buttons[t].icon=k()("fas fa-globe")):(this.buttons[t]={},this.buttons[t].index=k()(t),this.buttons[t].favicon=k()(o.favicon),this.buttons[t].title=k()(o.title),this.buttons[t].url=k()(o.url),this.buttons[t].icon=k()(o.icon))},o}(y.a);app.initializers.add("fof/socialprofile",(function(){s.a.prototype.socialButtons=i.a.attribute("socialButtons",(function(t){return JSON.parse(t||"[]")})),Object(r.extend)(l.a.prototype,"infoItems",(function(t){var o=this;this.isSelf=app.session.user===this.attrs.user,this.canEdit=!!app.session.user&&app.session.user.data.attributes.canEdit,this.buttons=this.attrs.user.socialButtons();var n=new b.a;this.buttons.length?(this.buttons.forEach((function(t,a){if(""!==t.title&&""!==t.icon&&""!==t.url){var i,e,s="",r=h()(((i={})["social-button "+t.icon+"-"+a+" social-icon-"+a]=!0,i["social-greyscale-button"]="favicon-grey"===t.icon,i));"favicon"!==t.icon&&"favicon-grey"!==t.icon||(s='\n background-image: url("'+t.favicon+'");\n background-size: 60%;\n background-position: center;\n background-repeat: no-repeat;\n '),n.add("social-icon-"+a,u.a.component({className:h()((e={},e[r]=!0,e["social-icon--deleting"]=o.deleting,e)),type:"social",icon:t.icon,label:t.title,style:s,onclick:function(){o.deleting?app.modal.show(P,{user:o.attrs.user,index:a}):window.open(t.url,"_blank")}}))}})),this.isSelf?n.add("settings social-button",u.a.component({type:"social social-settings",icon:"fas fa-cog",label:app.translator.trans("fof-socialprofile.forum.edit.edit"),onclick:function(){app.modal.show(I,{user:o.attrs.user})}}),-1):this.canEdit&&n.add("settings social-button",u.a.component({type:"social social-moderate "+(this.deleting?"social-moderate--highlighted":""),icon:"fas fa-exclamation-triangle",label:app.translator.trans("fof-socialprofile.forum.edit.delete"),onclick:function(){o.deleting=!o.deleting}}),-1)):this.isSelf&&n.add("settings social-button",u.a.component({type:"social null-social-settings",icon:"fas fa-plus",label:app.translator.trans("fof-socialprofile.forum.edit.add"),onclick:function(){app.modal.show(I,{user:o.attrs.user})}}),-1),n.toArray().length>0&&(t.has("lastSeen")&&t.replace("lastSeen",t.lastSeen,50),t.has("joined")&&t.replace("joined",t.joined,40),t.add("fofsocialprofile",n.toArray(),20))}))}))}]); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index ba5dc1b..532eed3 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@fof/socialprofile/webpack/bootstrap","webpack://@fof/socialprofile/external \"flarum.core.compat['utils/Stream']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['components/Badge']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['utils/ItemList']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['components/Modal']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['components/Button']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['helpers/icon']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['Model']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['models/User']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['extend']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['components/UserCard']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['Component']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['utils/withAttr']\"","webpack://@fof/socialprofile/external \"flarum.core.compat['components/Dropdown']\"","webpack://@fof/socialprofile/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","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/extractBaseUrl.js","webpack://@fof/socialprofile/./src/forum/components/SocialButtonsModal.js","webpack://@fof/socialprofile/./src/forum/components/DeleteButtonModal.js","webpack://@fof/socialprofile/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","IconSelectorComponent","initAttrs","attrs","className","buttonClassName","menuClassName","oninit","vnode","this","icons","social","view","children","items","toArray","getButtonContent","test","selection","style","width","height","alt","src","favicon","onerror","select","icon","caretIcon","ItemList","add","onclick","role","title","index","margin","forEach","curIcon","highlighted","Stream","replace","Dropdown","WebsiteInputComponent","button","id","type","placeholder","app","translator","trans","tabIndex","bidi","component","url","onchange","withAttr","onUrlChange","clearTimeout","waitUntilFinished","setTimeout","urlInstance","URL","_","includes","protocol","isValidUrl","iconurl","origin","extractBaseUrl","redraw","Component","SocialButtonsModal","buttons","user","socialButtons","length","createButtonObject","content","areAnyIconsBeingFetched","some","map","addSocialButton","delSocialButton","Button","loading","disabled","data","JSON","stringify","onsubmit","e","preventDefault","save","errorHandler","then","hide","$","trigger","ready","slideDown","curdel","slideUp","splice","Modal","DeleteButtonModal","initializers","User","Model","attribute","str","parse","extend","UserCard","isSelf","session","canEdit","attributes","buttonList","buttonStyle","deleting","Badge","label","modal","show","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AKA,aAG7B,IAGF9G,KAAKwG,QACZI,EAAWvF,IACP,yBACA0F,IAAMpE,UAAU,CACZP,KAAM,8BACNlB,KAAM,cACN8F,MAAO1E,IAAIC,WAAWC,MAAM,oCAC5BlB,QAAS,WACLgB,IAAI2E,MAAMC,KAAKpD,EAAoB,CAAEE,KAAM,EAAKtE,MAAMsE,WAG7D,GAIL4C,EAAWtG,UAAU4D,OAAS,IAC1B7D,EAAMgH,IAAI,aACVhH,EAAM0B,QAAQ,WAAY1B,EAAK,SAAc,IAE7CA,EAAMgH,IAAI,WACVhH,EAAM0B,QAAQ,SAAU1B,EAAK,OAAY,IAG7CA,EAAMgB,IAAI,mBAAoBuF,EAAWtG,UAAW","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","module.exports = flarum.core.compat['utils/Stream'];","module.exports = flarum.core.compat['components/Badge'];","module.exports = flarum.core.compat['utils/ItemList'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['helpers/icon'];","module.exports = flarum.core.compat['Model'];","module.exports = flarum.core.compat['models/User'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/UserCard'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['utils/withAttr'];","module.exports = flarum.core.compat['components/Dropdown'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import Dropdown from 'flarum/components/Dropdown';\nimport ItemList from 'flarum/utils/ItemList';\nimport icon from 'flarum/helpers/icon';\nimport Stream from 'flarum/utils/Stream';\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 return [\n /^favicon(-\\w+)?$/.test(this.attrs.selection())\n ? [\n {\n this.attrs.favicon('none');\n this.select(this.icons.social[0]);\n }}\n />,\n ]\n : icon(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') {\n items.add(\n 'favicon',\n
{this.button.url}
\n\n \n{this.button.url}
\n\n \n