Pleroma/priv/static/packs/share.js

2 lines
65 KiB
JavaScript
Raw Normal View History

2018-08-12 15:29:30 +02:00
webpackJsonp([35],{293:function(e,t,n){"use strict";n.d(t,"a",function(){return L});var o,i,a,r=n(2),s=n.n(r),c=n(1),u=n.n(c),l=n(3),d=n.n(l),p=n(4),f=n.n(p),h=n(0),m=n.n(h),g=n(294),v=n(100),y=n(14),b=n.n(y),_=n(5),k=n.n(_),C=n(295),j=n(297),w=n(302),x=n(7),O=n(304),S=n(306),M=n(308),D=n(309),T=n(311),N=n(317),F=n(43),P=n(12),I=n.n(P),R=n(99),E=(n.n(R),n(13)),A="><…    \u2028\u2029\t\n\v\f\r",z=Object(x.f)({placeholder:{id:"compose_form.placeholder",defaultMessage:"What is on your mind?"},spoiler_placeholder:{id:"compose_form.spoiler_placeholder",defaultMessage:"Write your warning here"},publish:{id:"compose_form.publish",defaultMessage:"Toot"},publishLoud:{id:"compose_form.publish_loud",defaultMessage:"{publish}!"}}),L=Object(x.g)((a=i=function(e){function t(){var n,o,i;u()(this,t);for(var a=arguments.length,r=Array(a),s=0;s<a;s++)r[s]=arguments[s];return n=o=d()(this,e.call.apply(e,[this].concat(r))),o.handleChange=function(e){o.props.onChange(e.target.value)},o.handleKeyDown=function(e){13===e.keyCode&&(e.ctrlKey||e.metaKey)&&o.handleSubmit()},o.handleSubmit=function(){o.props.text!==o.autosuggestTextarea.textarea.value&&o.props.onChange(o.autosuggestTextarea.textarea.value);var e=o.props,t=e.is_submitting,n=e.is_uploading,i=e.anyMedia,a=[o.props.spoiler_text,o.props.text].join("");t||n||Object(R.length)(a)>E.h||0!==a.length&&0===a.trim().length&&!i||o.props.onSubmit()},o.onSuggestionsClearRequested=function(){o.props.onClearSuggestions()},o.onSuggestionsFetchRequested=function(e){o.props.onFetchSuggestions(e)},o.onSuggestionSelected=function(e,t,n){o.props.onSuggestionSelected(e,t,n)},o.handleChangeSpoilerText=function(e){o.props.onChangeSpoilerText(e.target.value)},o.setAutosuggestTextarea=function(e){o.autosuggestTextarea=e},o.setSpoilerText=function(e){o.spoilerText=e},o.handleEmojiPick=function(e){var t=o.props.text,n=o.autosuggestTextarea.textarea.selectionStart,i=e.custom&&n>0&&!A.includes(t[n-1]);o.props.onPickEmoji(n,e,i)},i=n,d()(o,i)}return f()(t,e),t.prototype.componentDidUpdate=function(e){if(this.props.focusDate!==e.focusDate){var t=void 0,n=void 0;this.props.preselectDate!==e.preselectDate?(t=this.props.text.length,n=this.props.text.search(/\s/)+1):"number"==typeof this.props.caretPosition?(n=this.props.caretPosition,t=this.props.caretPosition):(t=this.props.text.length,n=t),this.autosuggestTextarea.textarea.setSelectionRange(n,t),this.autosuggestTextarea.textarea.focus()}else e.is_submitting&&!this.props.is_submitting?this.autosuggestTextarea.textarea.focus():this.props.spoiler!==e.spoiler&&(this.props.spoiler?this.spoilerText.focus():this.autosuggestTextarea.textarea.focus())},t.prototype.render=function(){var e=this.props,t=e.intl,n=e.onPaste,o=e.showSearch,i=e.anyMedia,a=this.props.is_submitting,r=[this.props.spoiler_text,this.props.text].join(""),c=a||this.props.is_uploading||Object(R.length)(r)>E.h||0!==r.length&&0===r.trim().length&&!i,u="";return u="private"===this.props.privacy||"direct"===this.props.privacy?s()("span",{className:"compose-form__publish-private"},void 0,s()("i",{className:"fa fa-lock"})," ",t.formatMessage(z.publish)):"unlisted"!==this.props.privacy?t.formatMessage(z.publishLoud,{publish:t.formatMessage(z.publish)}):t.formatMessage(z.publish),s()("div",{className:"compose-form"},void 0,s()(N.a,{}),s()(C.a,{}),s()("div",{className:"spoiler-input "+(this.props.spoiler?"spoiler-input--visible":"")},void 0,s()("label",{},void 0,s()("span",{style:{display:"none"}},void 0,t.formatMessage(z.spoiler_placeholder)),m.a.createElement("input",{placeholder:t.formatMessage(z.spoiler_placeholder),value:this.props.spoiler_text,onChange:this.handleChangeSpoilerText,onKeyDown:this.handleKeyDown,type:"text",className:"spoiler-input__input",id:"cw-spoiler-input",ref:this.setSpoilerText}))),s()("div",{className:"compose-form__autosuggest-wrapper"},void 0,m.a.createElement(j.a,{ref:this.setAutosuggestTextarea,placeholder:t.formatMessage(z.placeholder),disabled:a,value:this.props.text,onChange:this.handleChange,suggestions:this.props.suggestions,onKeyDown
//# sourceMappingURL=share.js.map