akkoma/priv/static/packs/share.js

2 lines
77 KiB
JavaScript
Raw Normal View History

2018-06-02 14:11:38 +00:00
webpackJsonp([35],{302:function(e,t,n){"use strict";n.d(t,"a",function(){return U});var o,a,i,r=n(2),s=n.n(r),c=n(1),l=n.n(c),u=n(3),d=n.n(u),p=n(4),h=n.n(p),m=n(0),f=n.n(m),g=n(303),v=n(100),y=n(14),b=n.n(y),k=n(5),_=n.n(k),w=n(304),C=n(306),x=n(311),j=n(7),O=n(313),S=n(314),M=n(316),D=n(318),N=n(319),P=n(321),T=n(327),F=n(43),z=n(12),I=n.n(z),R=n(99),E=(n.n(R),n(329)),A=n(13),q="><…    \u2028\u2029\t\n\v\f\r",L=Object(j.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}!"}}),U=Object(j.g)((i=a=function(e){function t(){var n,o,a;l()(this,t);for(var i=arguments.length,r=Array(i),s=0;s<i;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,a=e.anyMedia,i=[o.props.spoiler_text,Object(E.a)(o.props.text)].join("");t||n||Object(R.length)(i)>A.c||0!==i.length&&0===i.trim().length&&!a||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.handleEmojiPick=function(e){var t=o.props.text,n=o.autosuggestTextarea.textarea.selectionStart,a=e.custom&&n>0&&!q.includes(t[n-1]);o.props.onPickEmoji(n,e,a)},a=n,d()(o,a)}return h()(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()},t.prototype.render=function(){var e=this.props,t=e.intl,n=e.onPaste,o=e.showSearch,a=e.anyMedia,i=this.props.is_submitting,r=[this.props.spoiler_text,Object(E.a)(this.props.text)].join(""),c=i||this.props.is_uploading||Object(R.length)(r)>A.c||0!==r.length&&0===r.trim().length&&!a,l="";return l="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(L.publish)):"unlisted"!==this.props.privacy?t.formatMessage(L.publishLoud,{publish:t.formatMessage(L.publish)}):t.formatMessage(L.publish),s()("div",{className:"compose-form"},void 0,s()(T.a,{}),s()(O.a,{isVisible:this.props.spoiler,fullHeight:50},void 0,s()("div",{className:"spoiler-input"},void 0,s()("label",{},void 0,s()("span",{style:{display:"none"}},void 0,t.formatMessage(L.spoiler_placeholder)),s()("input",{placeholder:t.formatMessage(L.spoiler_placeholder),value:this.props.spoiler_text,onChange:this.handleChangeSpoilerText,onKeyDown:this.handleKeyDown,type:"text",className:"spoiler-input__input",id:"cw-spoiler-input"})))),s()(w.a,{}),s()("div",{className:"compose-form__autosuggest-wrapper"},void 0,f.a.createElement(C.a,{ref:this.setAutosuggestTextarea,placeholder:t.formatMessage(L.placeholder),disabled:i,value:this.props.text,onChange:this.handleChange,suggestions:this.props.suggestions,onKeyDown:this.handleKeyDown,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,onSugg
//# sourceMappingURL=share.js.map