\n\t
\n<\/p>)*$/g,"")),A.a.post(a,{content:e},{withCredentials:!0}).then(function(r){if(r.data.memo){var a=r.data.memo,c=n._findById(t,i),l=i[c];if(l.children||(l.children=[]),l.children.push({can_delete:!0,content:e,image_url:s.image_url,username:s.username,user_login:s.login,id:a.id,time:"1\u5206\u949f\u524d",praise_count:0,user_id:a.author_id}),i[c]=l,o.html&&o.html(""),o.setValue){o.setValue("");(0,window.$)(".commentItemMDEditorView_"+t).hide()}n.setState({comments:i},function(){o.html&&window.prettyPrint()});var m=Object.assign({},n.props.memo);m.replies_count=m.replies_count+1,n.props.initForumState({memo:m})}console.log(r)}).catch(function(e){console.log(e)})},n.deleteComment=function(e,t){var o=e.id;t&&(o=t);var r="/api/v1/memos/"+o,a=n.state.comments;A.a.delete(r,{withCredentials:!0}).then(function(o){if(o.data&&0===o.data.status){var r=n._findById(e.id,a);if(t){var i=n._findById(t,a[r].children);a[r].children=g()(a[r].children,{$splice:[[i,1]]}),n.setState({comments:a})}else n.setState(function(e){return{comments:g()(e.comments,{$splice:[[r,1]]})}});var s=Object.assign({},n.props.memo);s.replies_count=s.replies_count-1,n.props.initForumState({memo:s})}console.log(o)}).catch(function(e){console.log(e)})},n.commentPraise=function(e){var t=n.state.comments,o=n._findById(e,t),r="/api/v1/discusses/"+e+"/plus";A.a.post(r,{container_type:"Memo",type:!0===t[o].user_praise?0:1},{withCredentials:!0}).then(function(e){(0===e.data.praise_count||e.data.praise_count)&&(t[o].user_praise=!t[o].user_praise,t[o].praise_count=e.data.praise_count,n.setState({comments:t})),console.log(e)}).catch(function(e){console.log(e)})},n.rewardCode=function(e,t,o){var r=n.props.showSnackbar,a=n.state.comments,i=e;t&&(i=t);var s=i.id,c="/api/v1/discusses/"+s+"/reward_code";A.a.post(c,{id:s,container_type:"Memo",score:o,user_id:i.user_id},{withCredentials:!0}).then(function(o){if(o.data&&o.data.code){var r=n._findById(e.id,a);if(t){var s=n._findById(i.id,e.children),c=Object.assign({},t);c.reward=o.data.code,e.children[s]=c,a[r]=e,n.setState({comments:a})}else a[r].reward=o.data.code,n.setState({comments:a})}}).catch(function(e){console.log(e),r("\u5956\u52b1\u5931\u8d25\uff0c\u8bf7\u8054\u7cfb\u7cfb\u7edf\u7ba1\u7406\u5458\uff01")})},n.hiddenComment=function(e,t){var o=e.id,r=n.props.showSnackbar,a=(n._getUser(),"/api/v1/memos/"+o+"/hidden"),i=n.state.comments,s=n._findById(o,i),c=i[s];A.a.post(a,{hidden:c.hidden?"0":"1"},{withCredentials:!0}).then(function(e){if(-1===e.data.status)return void r(e.data.message);if(1===e.data.status)if(t){var o=n._findById(t,i[s].children),a=i[s].children[o];a.hidden=!a.hidden,n.setState({comments:i})}else c.hidden=!c.hidden,n.setState({comments:i});console.log(e)}).catch(function(e){console.log(e)})},n.createNewComment=function(e,t,o){var r=e,a=n.props.memo;if(void 0!=r){r=r.replace(/(\n\n\t
\n<\/p>)*$/g,"");var i=r.split("");if(""==i[0]&&""==s[1])return void window.notice_box("\u4e0d\u652f\u6301\u7eaf\u56fe\u7247\u8bc4\u8bba
\u8bf7\u5728\u8bc4\u8bba\u4e2d\u589e\u52a0\u6587\u5b57\u4fe1\u606f")}var c="/api/v1/memos/"+a.id+"/reply",l=n.state.comments,m=n._getUser();A.a.post(c,{content:r},{withCredentials:!0}).then(function(e){if(-1===e.data.status)return void console.error("\u670d\u52a1\u7aef\u5f02\u5e38");if(e.data){var t=e.data.memo;o.html&&o.html(""),o.afterBlur&&o.afterBlur(),o.setValue&&o.setValue(""),l||(l=[]),l.unshift({can_delete:!0,admin:m.admin,content:r,image_url:m.image_url,username:m.username,user_login:m.login,id:t.id,reward:null,hidden:t.hidden,user_praise:!1,time:"1\u5206\u949f\u524d",praise_count:0,user_id:m.user_id}),n.setState({comments:l});var a=Object.assign({},n.props.memo);a.replies_count=a.replies_count+1,n.props.initForumState({memo:a}),console.log(e)}}).catch(function(e){console.log(e)})},n.moreMemos=function(){var e=n.state,t=e.comments,o=e.pageCount,r=n.props.memo,a=(n._getUser(),"/api/v1/memos/"+r.id+"/more_reply?page="+o);A.a.get(a,{},{withCredentials:!0}).then(function(e){if(-1===e.data.status)return void console.error("\u670d\u52a1\u7aef\u5f02\u5e38");var r=e.data.memo_replies;if(!r||0===r.length)return void n.setState({hasMoreComments:!1});if(e.data.memos_count){var a=t.concat(r),i=10===r.length;n.setState({comments:a,hasMoreComments:i,pageCount:o+1})}}).catch(function(e){console.log(e)})},n.rewardCodeMemo=function(e){console.log(e);var t=n.props,o=t.memo,r=t.author_info,a=Object.assign({},o),i=parseInt(e),s=(o.id,"/api/v1/discusses/"+o.id+"/reward_code");A.a.post(s,{id:o.id,container_type:"Memo",score:i,user_id:r.user_id},{withCredentials:!0}).then(function(e){var t=e.data.code;t>0?(a.reward=t,n.props.initForumState({memo:a}),n.props.showSnackbar("\u5956\u52b1\u6210\u529f")):n.props.showSnackbar("\u5956\u52b1\u5931\u8d25\uff0c\u8bf7\u8054\u7cfb\u7cfb\u7edf\u7ba1\u7406\u5458\uff01")}).catch(function(e){console.log(e)})},n.setRewardDialogVisible=function(e){n.setState({goldRewardDialogOpen:e})},n.showRewardDialog=function(){n.setState({goldRewardDialogOpen:!0})},n.showCommentInput=function(){window.__useKindEditor,n.refs.editor.showEditor()},n.state={memoLoading:!0,hasMoreComments:!1,pageCount:1,goldRewardDialogOpen:!1},n}return a(t,e),k(t,[{key:"componentDidMount",value:function(){var e=this;window.$("html,body").animate({scrollTop:0});var t=this.props.match,n="/api/v1/memos/"+t.params.memoId;this.setState({memoLoading:!0}),A.a.get(n,{withCredentials:!0}).then(function(t){var n=t.data.memo;if(-1===t.data.status)return setTimeout(function(){e.props.showSnackbar("\u5e16\u5b50\u4e0d\u5b58\u5728\uff01")},300),void e.props.history.push("/forums");if(n){var o=t.data,r=o.memo_replies,a=o.memo,i=!1;if(r&&10===r.length&&a.replies_count>10){var s=10;r.forEach(function(e){s+=e.children.length}),s#root").on("onMemoDelete",function(t){var n=window.onMemoDelete;e.onMemoDelete(JSON.parse(decodeURIComponent(n)))}),setTimeout(function(){E(".commentsDelegateParent").delegate(".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click",function(t){var n=t.target.src;-1===n.indexOf("/images/avatars/User")&&-1===n.indexOf("kindeditor/plugins/emoticons")&&e.setState({showImage:!0,imageSrc:n})})},4e3)}},{key:"componentWillUnmount",value:function(){E("body>#root").off("onMemoDelete")}},{key:"onMemoDelete",value:function(e){var t=this,n="/api/v1/memos/"+e.id;A.a.delete(n,{withCredentials:!0}).then(function(e){var n=e.data.status;0===n?(t.props.showSnackbar("\u5220\u9664\u6210\u529f"),t.props.history.push("/forums")):-1===n&&(t.props.showSnackbar("\u5e16\u5b50\u5df2\u88ab\u5220\u9664"),t.props.history.push("/forums"))}).catch(function(e){console.log(e)})}},{key:"componentDidUpdate",value:function(e,t,n){this.props.memo&&this.props.memo.content&&!0===t.memoLoading&&!1===this.state.memoLoading&&this.props.memo.is_md&&setTimeout(function(){window.editormd.markdownToHTML("memo_content_editorMd",{htmlDecode:"style,script,iframe",taskList:!0,tex:!0,flowChart:!0,sequenceDiagram:!0})},200)}},{key:"clickPraise",value:function(){var e=this,t=this.props.memo,n="/api/v1/discusses/"+t.id+"/plus";console.log(n),A.a.post(n,{container_type:"Memo",type:1},{withCredentials:!0}).then(function(t){console.log(t);var n=Object.assign({},e.props.memo);n.praise_count=t.data.praise_count,n.user_praise=!n.user_praise,e.props.initForumState({memo:n})}).catch(function(e){console.log(e)})}},{key:"renderAttachment",value:function(){var e=this.props.memo,t=[];return e.attachment_url.forEach(function(e,n){var o=e.url.split("/"),r=e.filename||o[o.length-1],a=0;e.filesize&&(a=Object(x.c)(e.filesize)),t.push(c.a.createElement("p",{className:"clearfix",key:n},c.a.createElement("a",{href:e.url,className:"color-green clearfix notefileDownload"},c.a.createElement("i",{className:"iconfont icon-xiazai color-green ml5 fl"}),c.a.createElement("span",{className:"fl"},r,a?" "+a:""))))}),t}},{key:"_getUser",value:function(){var e=this.props.current_user;return e.user_url="/users/"+e.login,e}},{key:"_findById",value:function(e,t){for(var n=t,o=0;o',testIcon1:''},saveHTMLToTextarea:!0,dialogMaskOpacity:.6,placeholder:o,imageUpload:!0,imageFormats:["jpg","jpeg","gif","png","bmp","webp","JPG","JPEG","GIF","PNG","BMP","WEBP"],imageUploadURL:r,onload:function(){g("#"+e+' [type="latex"]').bind("click",function(){i.cm.replaceSelection("```latex"),i.cm.replaceSelection("\n"),i.cm.replaceSelection("\n"),i.cm.replaceSelection("```");var e=i.cm.getDoc().getCursor();i.cm.setCursor(e.line-1,0)}),g("#"+e+' [type="inline"]').bind("click",function(){i.cm.replaceSelection("$$$$");var e=i.cm.getDoc().getCursor();i.cm.setCursor(e.line,e.ch-2),i.cm.focus()}),g('[type="inline"]').attr("title","\u884c\u5185\u516c\u5f0f"),g('[type="latex"]').attr("title","\u591a\u884c\u516c\u5f0f"),window.md_elocalStorage(i,"memoNew_"+e,"memoNew"),a&&a()}});return i}var s=n(0),c=n.n(s),l=(n(69),n(81),n(1)),m=(n.n(l),n(2)),p=(n.n(m),n(82)),u=(n(1821),n(36)),A=n.n(u),d=n(607),f=(n.n(d),n(42)),h=function(){function e(e,t){for(var n=0;n')),r("head").append(r(''))}}).catch(function(e){console.log(e)});var t=this.props.match;if(t.params.memoId){var n="/api/v1/memos/"+t.params.memoId+"/edit";A.a.get(n,{withCredentials:!0}).then(function(t){if(t.data.tag_list){var n=t.data,o=n.content,r=n.forum_id,a=n.id,i=n.tag,s=n.repertoire_name,c=n.subject,l=n.current_user,m=n.tag_list,p=n.attachments_url;e.initMD(o);var u=[];i&&(u=i.map(function(e,t){return e.id+""})),e.setState({currentMemoId:a,memoSubject:c,memoType:r,memoRepertoire:s,memoLanguage:u,attachments_url:p,content:o},function(){g(".upload_filename").each(function(e,t){var n=window._textWidth(g(t),"14px");console.log(n),g(t).css("width",n+20)})}),window.$("html,body").animate({scrollTop:0}),e.props.initForumState({current_user:l,tag_list:m})}}).catch(function(e){console.log(e)})}else this.initMD()}},{key:"initMD",value:function(e){var t=this;this.contentChanged=!1;var n=i("memoMD","100%",400,"","/upload_with_markdown?container_id=&container_type=Memo",function(){setTimeout(function(){n.resize(),n.cm&&n.cm.refresh()},500),e&&n.setValue(e),n.cm.on("change",function(e,n){console.log("....contentChanged"),t.contentChanged=!0})});this.taskpass_editormd=n,window.taskpass_editormd=n}},{key:"renderOptions",value:function(e){var t=[];return e.forEach(function(e,n){t.push(c.a.createElement(C,{key:n,value:e},e))}),t}},{key:"onRepertoiresChange",value:function(e){var t=this.state.repertoires.indexOf(e);this.setState({currentSelectRepertoiresIndex:t,memoRepertoire:e,memoLanguage:""})}},{key:"renderTag",value:function(){var e=this.state.tag_list;if(!e||0===e.length)return"";var t=[];return e.forEach(function(e,n){t.push(c.a.createElement(C,{value:e.id+"",key:n},e.name))}),t}},{key:"onTagChange",value:function(e){if(e&&e.length>3)return void this.props.showSnackbar("\u6700\u591a\u9009\u62e93\u4e2a\u6280\u672f\u6807\u7b7e");this.setState({memoLanguage:e})}},{key:"onTypeChange",value:function(e){this.setState({memoType:B[e]})}},{key:"onMemoNameChange",value:function(e){this.setState({memoSubject:e.target.value})}},{key:"renderAttachment",value:function(){var e=this.state.attachments_url,t=[];return e.forEach(function(e,n){var o=e.url.split("/");o[o.length-1];t.push(c.a.createElement(c.a.Fragment,null,c.a.createElement("span",{id:"attachments_10"+n,className:"attachment"},c.a.createElement("i",{className:"iconfont icon-fujian ml20mr20Color","aria-hidden":"true"}),c.a.createElement("input",{type:"text",className:"upload_filename readonly hidden",name:"attachments[2][filename]",readonly:"readonly",style:{border:"none",whiteSpace:"nowrap",textOverflow:"ellipsis",fontFamily:"Consolas",color:"#676767",marginLeft:"20px",verticalAlign:"middle"},size:"8",value:e.filename}),c.a.createElement("font",{className:"mr20 ml20mr20Color",style:{marginLeft:"10px",verticalAlign:"middle"}},window.conver_size(e.id)),c.a.createElement("a",{href:"/attachments/"+e.id+".js?attachment_id=10"+n,className:"remove-upload",style:{verticalAlign:"top",display:"inlineBlock"},"data-remote":"true","data-method":"delete"},c.a.createElement("i",{className:"iconfont ml20mr20Color"},"\ue61c")),c.a.createElement("div",{className:"div_attachments",name:"div_attachments_xx"}),c.a.createElement("input",{type:"hidden",name:"attachments[xx][token]",value:"185811.24305bb2c4912f715629aa3615cdbabc"}),c.a.createElement("input",{type:"hidden",name:"attachments[xx][attachment_id]",value:e.id})),c.a.createElement("div",{className:"cl"})))}),t}},{key:"render",value:function(){var e=this,t=this.props,n=t.match,o=(t.history,this.state),r=(o.tag_list,o.memoSubject),a=o.memoType,i=o.memoLanguage,s=o.attachments_url,l=n.params.memoId;return c.a.createElement("div",null,c.a.createElement("div",{className:"pt20 pl20 pr20 pb20 bor-bottom-greyE clearfix",style:{background:"#fff"}},c.a.createElement("span",{className:"fl font-16"},l?"\u7f16\u8f91\u8bdd\u9898":"\u53d1\u5e03\u8bdd\u9898")),c.a.createElement("div",{className:"edu-back-white mb10 clearfix",id:"memoSubject"},c.a.createElement("div",{className:"padding30-20"},c.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"\u8bdd\u9898\u540d\u79f0"),c.a.createElement("div",{className:"df"},c.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),c.a.createElement("div",{className:"flex1 mr20"},c.a.createElement("input",{type:"text",className:"input-100-45 greyInput",maxlength:"50",value:r,onChange:function(t){return e.onMemoNameChange(t)},placeholder:""})),c.a.createElement("div",{style:{width:"57px"}},c.a.createElement("span",{className:"color-orange mt8 fl none"},c.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"\u5fc5\u586b\u9879"))))),c.a.createElement("div",{className:"edu-back-white mb10 clearfix"},c.a.createElement("div",{className:"padding30-20"},c.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"\u5185\u5bb9"),c.a.createElement("div",{className:"df"},c.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),c.a.createElement("div",{className:"flex1 mr20"},c.a.createElement("div",{className:"flex1 break_word show_content_grey new_li",id:"memoMD"},c.a.createElement("textarea",{style:{display:"none"}})),c.a.createElement("p",{id:"e_tip_memoNew",className:"edu-txt-right color-grey-cd font-12"}),c.a.createElement("p",{id:"e_tips_memoNew",className:"edu-txt-right color-grey-cd font-12"})),c.a.createElement("div",{style:{width:"57px"}},c.a.createElement("span",{className:"color-orange mt8 fl none"},c.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"\u5fc5\u586b\u9879"))),c.a.createElement("form",{className:"newForm"},c.a.createElement("span",{id:"attachments_fields",className:"attachments_fields",xmlns:"http://www.w3.org/1999/html"},s&&!!s.length&&this.renderAttachment()),c.a.createElement("span",{className:"add_attachment"},c.a.createElement("input",{className:"file_selector","data-are-you-sure":"\u60a8\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f","data-delete-all-files":"\u60a8\u786e\u5b9a\u8981\u5220\u9664\u6240\u6709\u6587\u4ef6\u5417","data-description-placeholder":"\u53ef\u9009\u7684\u63cf\u8ff0","data-field-is-public":"\u516c\u5f00","data-file-count":"\u4e2a\u6587\u4ef6\u5df2\u4e0a\u4f20","data-lebel-file-uploding":"\u4e2a\u6587\u4ef6\u6b63\u5728\u4e0a\u4f20","data-max-concurrent-uploads":"2","data-max-file-size-message":"\u8be5\u6587\u4ef6\u65e0\u6cd5\u4e0a\u4f20\u3002\u8d85\u8fc7\u6587\u4ef6\u5927\u5c0f\u9650\u5236 (50 MB)\uff0c\u5efa\u8bae\u4e0a\u4f20\u5230\u767e\u5ea6\u4e91\u7b49\u5176\u4ed6\u5171\u4eab\u5de5\u5177\u91cc\uff0c\u7136\u540e\u5728txt\u6587\u6863\u91cc\u7ed9\u51fa\u94fe\u63a5\u4ee5\u53ca\u5171\u4eab\u5bc6\u7801\u5e76\u4e0a\u4f20","data-max-file-size":"52428800","data-upload-path":"/uploads.js",id:"_file",multiple:"multiple",name:"attachments[dummy][file]",onChange:function(){window.addInputFiles(window.$(".file_selector")[0])},style:{display:"none"},type:"file"}))),c.a.createElement("div",{className:"df uploadBtn"},c.a.createElement("a",{href:"javascript:void(0);",className:"fl",onClick:function(){return window.$("#_file").click()},"data-tip-down":"\u8bf7\u9009\u62e9\u6587\u4ef6\u4e0a\u4f20"},c.a.createElement("i",{className:"fa fa-upload mr5 color-blue"}),c.a.createElement("span",{class:"color-blue"},"\u4e0a\u4f20\u9644\u4ef6"),c.a.createElement("span",{style:{color:"#CDCDCD",fontSize:"14px"}},"(\u5355\u4e2a\u6587\u4ef650M\u4ee5\u5185)"))))),c.a.createElement("div",{className:"edu-back-white mb10 clearfix"},c.a.createElement("div",{className:"padding30-20"},c.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"\u8bdd\u9898\u7c7b\u578b"),c.a.createElement("div",{className:"df"},c.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),c.a.createElement("div",{className:"flex1 mr20"},c.a.createElement(p.r,{className:"ecSelect",value:y[a],onChange:function(t){return e.onTypeChange(t)}},c.a.createElement(C,{value:"\u6280\u672f\u5206\u4eab"},"\u6280\u672f\u5206\u4eab"),c.a.createElement(C,{value:"\u64cd\u4f5c\u6307\u5357"},"\u64cd\u4f5c\u6307\u5357"))),c.a.createElement("div",{style:{width:"57px"}},c.a.createElement("span",{className:"color-orange mt8 fl none"},c.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"\u5fc5\u586b\u9879"))))),a===B["\u6280\u672f\u5206\u4eab"]&&c.a.createElement("div",{className:"edu-back-white mb10 clearfix"},c.a.createElement("div",{className:"padding30-20"},c.a.createElement("p",{className:"color-grey-6 font-16 mb30"},"\u6280\u672f\u6807\u7b7e"),c.a.createElement("div",{className:"df"},c.a.createElement("span",{className:"mr30 color-orange pt10"},"*"),c.a.createElement("div",{className:"flex1 mr20"},c.a.createElement(p.r,{className:"ecSelect",value:i,placeholder:"\u8bf7\u9009\u62e9\u6280\u672f\u6807\u7b7e",onChange:function(t){return e.onTagChange(t)},dropdownStyle:{maxHeight:"300px",overflow:"auto"},mode:"multiple",filterOption:function(e,t){return-1!=t.props.children.toLocaleLowerCase().indexOf(e.toLocaleLowerCase())},tokenSeparators:[";"]},this.renderTag())),c.a.createElement("div",{style:{width:"57px"}},c.a.createElement("span",{className:"color-orange mt8 fl none"},c.a.createElement("i",{className:"fa fa-exclamation-circle mr3"}),"\u5fc5\u586b\u9879"))))),c.a.createElement("div",{className:"clearfix mt30"},c.a.createElement("a",{href:"javascript:void(0)",className:"defalutSubmitbtn fl mr20",onClick:function(){e.onCommit()}},"\u63d0\u4ea4"),c.a.createElement("a",{onClick:function(){e.onCancel()},className:"defalutCancelbtn fl"},"\u53d6\u6d88")))}}]),t}(s.Component);t.a=_},1821:function(e,t,n){"use strict";var o=n(1822);o.a},1822:function(e,t,n){"use strict";function o(){}var r=n(9),a=n.n(r),i=n(4),s=n.n(i),c=n(15),l=n.n(c),m=n(5),p=n.n(m),u=n(6),A=n.n(u),d=n(0),f=n.n(d),h=n(1),C=n.n(h),g=n(1823),b=n(1827),w=function(e){function t(){var e,n,o,r;s()(this,t);for(var a=arguments.length,i=Array(a),c=0;c0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var n=new FormData;e.data&&Object.keys(e.data).map(function(t){n.append(t,e.data[t])}),n.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){if(t.status<200||t.status>=300)return e.onError(o(e,t),r(t));e.onSuccess(r(t),t)},t.open("post",e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var a=e.headers||{};null!==a["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest");for(var i in a)a.hasOwnProperty(i)&&null!==a[i]&&t.setRequestHeader(i,a[i]);return t.send(n),{abort:function(){t.abort()}}}t.a=a},1825:function(e,t,n){"use strict";function o(e,t){return-1!==e.indexOf(t,e.length-t.length)}t.a=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",a=e.type||"",i=a.replace(/\/.*$/,"");return n.some(function(e){var t=e.trim();return"."===t.charAt(0)?o(r.toLowerCase(),t.toLowerCase()):/\/\*$/.test(t)?i===t.replace(/\/.*$/,""):a===t})}return!0}},1826:function(e,t,n){"use strict";function o(e,t){function n(){o.readEntries(function(e){var o=Array.prototype.slice.apply(e);r=r.concat(o),o.length?n():t(r)})}var o=e.createReader(),r=[];n()}var r=function(e,t,n){var r=!0,a=!1,i=void 0;try{for(var s,c=e[Symbol.iterator]();!(r=(s=c.next()).done);r=!0){var l=s.value;!function e(r,a){a=a||"",r.isFile?r.file(function(e){n(e)&&t([e])}):r.isDirectory&&o(r,function(t){t.forEach(function(t){e(t,""+a+r.name+"/")})})}(l.webkitGetAsEntry())}}catch(e){a=!0,i=e}finally{try{!r&&c.return&&c.return()}finally{if(a)throw i}}};t.a=r},1827:function(e,t,n){"use strict";var o=n(26),r=n.n(o),a=n(9),i=n.n(a),s=n(4),c=n.n(s),l=n(15),m=n.n(l),p=n(5),u=n.n(p),A=n(6),d=n.n(A),f=n(0),h=n.n(f),C=n(1),g=n.n(C),b=n(8),w=n.n(b),B=n(2),y=n.n(B),v=n(1772),_=n(34),x=n.n(_),k={position:"absolute",top:0,opacity:0,filter:"alpha(opacity=0)",left:0,zIndex:9999},E=function(e){function t(){var e,n,o,r;c()(this,t);for(var a=arguments.length,i=Array(a),s=0;sdocument.domain="'+e+'";<\/script>',n=''}return'\n \n \n \n \n \n '+t+'\n \n \n \n \n \n '}},{key:"initIframeSrc",value:function(){this.domain&&(this.getIframeNode().src="javascript:void((function(){\n var d = document;\n d.open();\n d.domain='"+this.domain+"';\n d.write('');\n d.close();\n })())")}},{key:"initIframe",value:function(){var e=this.getIframeNode(),t=e.contentWindow,n=void 0;this.domain=this.domain||"",this.initIframeSrc();try{n=t.document}catch(o){this.domain=document.domain,this.initIframeSrc(),t=e.contentWindow,n=t.document}n.open("text/html","replace"),n.write(this.getIframeHTML(this.domain)),n.close(),this.getFormInputNode().onchange=this.onChange}},{key:"endUpload",value:function(){this.state.uploading&&(this.file={},this.state.uploading=!1,this.setState({uploading:!1}),this.initIframe())}},{key:"startUpload",value:function(){this.state.uploading||(this.state.uploading=!0,this.setState({uploading:!0}))}},{key:"updateIframeWH",value:function(){var e=w.a.findDOMNode(this),t=this.getIframeNode();t.style.height=e.offsetHeight+"px",t.style.width=e.offsetWidth+"px"}},{key:"abort",value:function(e){if(e){var t=e;e&&e.uid&&(t=e.uid),t===this.file.uid&&this.endUpload()}else this.endUpload()}},{key:"post",value:function(e){var t=this,n=this.getFormNode(),o=this.getFormDataNode(),r=this.props.data,a=this.props.onStart;"function"===typeof r&&(r=r(e));var i=document.createDocumentFragment();for(var s in r)if(r.hasOwnProperty(s)){var c=document.createElement("input");c.setAttribute("name",s),c.value=r[s],i.appendChild(c)}o.appendChild(i),new Promise(function(n){var o=t.props.action;if("function"===typeof o)return n(o(e));n(o)}).then(function(t){n.setAttribute("action",t),n.submit(),o.innerHTML="",a(e)})}},{key:"render",value:function(){var e,t=this.props,n=t.component,o=t.disabled,a=t.className,s=t.prefixCls,c=t.children,l=t.style,m=i()({},k,{display:this.state.uploading||o?"none":""}),p=y()((e={},r()(e,s,!0),r()(e,s+"-disabled",o),r()(e,a,a),e));return h.a.createElement(n,{className:p,style:i()({position:"relative",zIndex:0},l)},h.a.createElement("iframe",{ref:this.saveIframe,onLoad:this.onLoad,style:m}),c)}}]),t}(f.Component);E.propTypes={component:g.a.string,style:g.a.object,disabled:g.a.bool,prefixCls:g.a.string,className:g.a.string,accept:g.a.string,onStart:g.a.func,multiple:g.a.bool,children:g.a.any,data:g.a.oneOfType([g.a.object,g.a.func]),action:g.a.oneOfType([g.a.string,g.a.func]),name:g.a.string},t.a=E},1828:function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),c=(n(69),n(81)),l=n(1),m=(n.n(l),n(2)),p=(n.n(m),n(322),n(1752)),u=(n(1745),n(1740),n(42),n(1753)),A=function(){function e(e,t){for(var n=0;n').attr('href',_url_origin+'/stylesheets/css/edu-admin.css?1525440977'));$('head').append($('').attr('href',_url_origin+'/stylesheets/css/edu-forum.css?1525440977'));$('head').append($('').attr('href',_url_origin+'/stylesheets/educoder/magic-check.css?1525440977'));setTimeout(function(){// 附件上传滚动条 \\public\\stylesheets\\jquery\\jquery-ui-1.9.2.css\n$('head').append($('').attr('href',_url_origin+'/stylesheets/jquery/jquery-ui-1.9.2.css'));},1000);var ForumsIndex=function(_Component){_inherits(ForumsIndex,_Component);function ForumsIndex(props){_classCallCheck(this,ForumsIndex);var _this=_possibleConstructorReturn(this,(ForumsIndex.__proto__||Object.getPrototypeOf(ForumsIndex)).call(this,props));_this.setSearchValue=function(searchValue,enterKeyFlag){if(enterKeyFlag===true){_this.setState({selectedHotLabelIndex:-1});}_this.setState({searchValue:searchValue,showSearchValue:enterKeyFlag&&searchValue?true:false,enterKeyFlag:enterKeyFlag===true?!_this.state.enterKeyFlag:_this.state.enterKeyFlag});};_this.setHotLabelIndex=function(index,callback){var newState={selectedHotLabelIndex:index};if(index!=-1){newState.searchValue='';newState.showSearchValue=false;}_this.setState(Object.assign({},newState),callback);};_this.state={searchValue:'',enterKeyFlag:false,showSearchValue:false,selectedHotLabelIndex:-1};return _this;}_createClass(ForumsIndex,[{key:'initForumState',value:function initForumState(data){this.setState(Object.assign({},data));}},{key:'componentDidMount',value:function componentDidMount(){window.document.title='交流问答';}},{key:'componentWillReceiveProps',value:function componentWillReceiveProps(newProps,newContext){}},{key:'render',value:function render(){var _this2=this;var _props=this.props,match=_props.match,history=_props.history,resLoading=_props.resLoading;var memo=this.state.memo;var techSharePath=match.path+'/categories/:memoType';var guidePath=match.path+'/categories/:memoType';var hottestPath=match.path+'/categories/:memoType';// ?order=hottest\nvar newestPath=match.path+'/categories/:memoType';// ?order=newest\nvar shixunDiscussPath='/forums/categories/shixun_discuss';var locationPath=history.location.pathname;var isWidth100=locationPath.indexOf('forums/new')!==-1||locationPath.indexOf('/edit')!==-1?true:false;var pathArray=locationPath.split('/');var isMemoDetail=!isWidth100&&pathArray.length===3&&!isNaN(parseInt(pathArray[2]))?true:false;var isGuide=locationPath.indexOf('/forums/categories/3')!==-1;return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div',{className:'newMain clearfix'},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div',{className:'educontent mt30 clearfix'},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div',{className:__WEBPACK_IMPORTED_MODULE_6_classnames___default()('fl',{with75:!isWidth100},{width100:isWidth100})},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"d\" /* Switch */],null,__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"c\" /* Route */],{path:'/forums/categories/my_published',render:function render(props){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10__MemoMyPublish__[\"a\" /* default */],Object.assign({},_this2.props,_this2.state,props,{initForumState:function initForumState(data){return _this2.initForumState(data);},setSearchValue:_this2.setSearchValue,setHotLabelIndex:_this2.setHotLabelIndex}));}}),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"c\" /* Route */],{path:''+shixunDiscussPath,render:function render(props){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_11__shixun_MemoShixun__[\"a\" /* default */],Object.assign({},_this2.props,_this2.state,props,{initForumState:function initForumState(data){return _this2.initForumState(data);},setSearchValue:_this2.setSearchValue,setHotLabelIndex:_this2.setHotLabelIndex}));}}),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"c\" /* Route */],{path:''+techSharePath,render:function render(props){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__MemoTechShare__[\"a\" /* default */],Object.assign({},_this2.props,_this2.state,props,{initForumState:function initForumState(data){return _this2.initForumState(data);},setSearchValue:_this2.setSearchValue,setHotLabelIndex:_this2.setHotLabelIndex}));}}),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"c\" /* Route */],{path:'/forums/new',render:function render(props){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__MemoNew__[\"a\" /* default */],Object.assign({},_this2.props,_this2.state,props,{initForumState:function initForumState(data){return _this2.initForumState(data);}}));}}),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"c\" /* Route */],{path:'/forums/:memoId/edit',render:function render(props){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__MemoNew__[\"a\" /* default */],Object.assign({},_this2.props,_this2.state,props,{initForumState:function initForumState(data){return _this2.initForumState(data);}}));}}),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"c\" /* Route */],{path:match.path+'/:memoId',render:function render(props){return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__MemoDetail__[\"a\" /* default */],Object.assign({},_this2.props,_this2.state,props,{initForumState:function initForumState(data){return _this2.initForumState(data);}}));}}),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_react_router__[\"Redirect\"],{from:''+match.url,to:'/forums/categories/all?order=newest'}))),!isWidth100&&__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div',{className:'with25 fl'},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div',{className:'ml20'},isMemoDetail?__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Fragment,null,__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_14__UserSection__[\"a\" /* default */],Object.assign({},this.props,this.state,{initForumState:function initForumState(data){return _this2.initForumState(data);}})),memo&&memo.tag&&__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_17__RightMemoLabel__[\"a\" /* default */],Object.assign({},this.props,this.state)),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_18__RecommendShixun__[\"a\" /* default */],Object.assign({},this.props,this.state))):__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Fragment,null,__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_13__RightMyPublish__[\"a\" /* default */],Object.assign({},this.props,this.state,{setSearchValue:this.setSearchValue})),!isGuide&&__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_15__RightHotLabel__[\"a\" /* default */],Object.assign({},this.props,this.state)),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_16__RightHotQuestion__[\"a\" /* default */],Object.assign({},this.props,this.state)),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_18__RecommendShixun__[\"a\" /* default */],Object.assign({},this.props,this.state)))))));}}]);return ForumsIndex;}(__WEBPACK_IMPORTED_MODULE_0_react__[\"Component\"]);/* harmony default export */ __webpack_exports__[\"default\"] = (Object(__WEBPACK_IMPORTED_MODULE_24_educoder__[\"b\" /* SnackbarHOC */])()(Object(__WEBPACK_IMPORTED_MODULE_12__tpm_TPMIndexHOC__[\"a\" /* TPMIndexHOC */])(ForumsIndex)));/*\n:\n列表所有:\nhttp://localhost:3000/forums/categories/all\n:\n详情:\n:\nhttp://localhost:3000/forums/5\n:\nhttp://localhost:3000/forums/new\n:\nhttp://localhost:3000/forums/categories/my_published\n*/\n\n/***/ }),\n\n/***/ 1740:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react_router__ = __webpack_require__(69);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_router_dom__ = __webpack_require__(81);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_classnames__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_classnames__);\nvar _createClass=function(){function defineProperties(target,props){for(var i=0;i\n \n techShare\n \n \n guide\n \n \n \t\t*/return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div',{className:'discuss-tab pl20 bor-bottom-greyE clearfix pr edu-back-white'},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('p',{className:'_forum_tab clearfix'},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"b\" /* Link */],{to:''+newestPath,className:__WEBPACK_IMPORTED_MODULE_4_classnames___default()(\"fl font-16 padding5-20 block mr30 navItem\",{'active':locationPath.indexOf('order=newest')!==-1}),onClick:function onClick(){return _this2.onNavClick(locationPath.indexOf('order=newest')!==-1);}},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('span',{className:'fl'},'\\u6700\\u65B0\\u56DE\\u590D')),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"b\" /* Link */],{to:''+hottestPath,className:__WEBPACK_IMPORTED_MODULE_4_classnames___default()(\"fl font-16 padding5-20 block mr30 navItem\",{'active':locationPath.indexOf('order=hottest')!==-1}),onClick:function onClick(){return _this2.onNavClick(locationPath.indexOf('order=hottest')!==-1);}},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('span',{className:'fl'},'\\u70ED\\u95E8\\u8BDD\\u9898')),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"b\" /* Link */],{to:''+shixunDiscussPath,className:__WEBPACK_IMPORTED_MODULE_4_classnames___default()(\"fl font-16 padding5-20 block mr30 navItem\",{'active':locationPath.indexOf('shixun_discuss')!==-1}),onClick:function onClick(){return _this2.onNavClick(locationPath.indexOf('shixun_discuss')!==-1);}},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('span',{className:'fl'},'\\u5B9E\\u8BAD\\u56DE\\u590D')),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"b\" /* Link */],{to:''+techSharePath,className:__WEBPACK_IMPORTED_MODULE_4_classnames___default()(\"fl font-16 padding5-20 block mr30 navItem\",{'active':locationPath.indexOf(techSharePath)===0}),onClick:function onClick(){return _this2.onNavClick(locationPath.indexOf(techSharePath)===0);}},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('span',{className:'fl'},'\\u6280\\u672F\\u5206\\u4EAB')),__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router_dom__[\"b\" /* Link */],{to:''+guidePath,className:__WEBPACK_IMPORTED_MODULE_4_classnames___default()(\"fl font-16 padding5-20 block mr30 navItem\",{'active':locationPath.indexOf(guidePath)===0}),onClick:function onClick(){return _this2.onNavClick(locationPath.indexOf(guidePath)===0);}},__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('span',{className:'fl'},'\\u64CD\\u4F5C\\u6307\\u5357'))));}}]);return ForumsNavTab;}(__WEBPACK_IMPORTED_MODULE_0_react__[\"Component\"]);/* harmony default export */ __webpack_exports__[\"a\"] = (ForumsNavTab);\n\n/***/ }),\n\n/***/ 1741:\n/***/ (function(module, exports, __webpack_require__) {\n\n// style-loader: Adds some css to the DOM by adding a \\n ' + domainScript + '\\n \\n \\n \\n \\n