You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/public/react/build/static/js/238.1e4acb1c.chunk.js

1 line
5.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

webpackJsonp([238],{4108:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(86),a=(r.n(n),r(73)),o=r.n(a),i=r(910),l=(r.n(i),r(911)),s=r.n(l),c=r(67),m=(r.n(c),r(68)),u=r.n(m),d=r(1265),p=(r.n(d),r(1266)),f=r.n(p),h=r(0),b=r.n(h),y=(r(5),r(45)),v=r(12),g=r.n(v),x=function(e,t,r){return t&&E(e.prototype,t),r&&E(e,r),e};function E(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var w={"Alt-/":"autocomplete"};function k(e){return{lineNumbers:!0,mode:function(e){var t="javascript";if(e&&e.length)for(var r=0;r<e.length;r++){var n=C[e[r]];if(n){t=n;break}}return t}(e),theme:"railscasts",indentUnit:4,matchBrackets:!0,autoRefresh:!0,smartIndent:!0,extraKeys:w,autofocus:!0,styleActiveLine:!0,lint:!0,gutters:["CodeMirror-linenumbers","breakpoints","CodeMirror-lint-markers"]}}var C={JFinal:"text/x-java",Java:"text/x-java",Kotlin:"text/x-kotlin","C/C++":"text/x-c++src",MachineLearning:{name:"python",version:3,singleLineStringErrors:!1},"Python2.7":{name:"python",version:3,singleLineStringErrors:!1},"Python3.6":{name:"python",version:3,singleLineStringErrors:!1}},N=(function(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)}(_,h.Component),x(_,[{key:"componentDidMount",value:function(){var e=k(this.props.mirror_name),t=window.CodeMirror.fromTextArea(window.$("#codemirror-file-edit")[0],e);t.setValue(""),t.refresh(),window.editor_tempCodeMirror=t,this.extend_editor=t}},{key:"render",value:function(){var e=this.props.form.getFieldDecorator,t=this.props.match.params.shixunId;return b.a.createElement("div",{className:"educontent"},b.a.createElement("style",null,"\n .formStyle .ant-form-item{\n margin-bottom:10px!important;\n }\n .formStyle .ant-col.ant-form-item-label{\n margin-left:-10px;\n line-height:30px;\n margin-bottom:10px;\n }\n .breadcrumb .ant-breadcrumb-separator{\n margin:0px 2px;\n }\n .backgroudwhite{\n display:none;\n }\n /*.filecode .CodeMirror.cm-s-railscasts{\n border:1px solid #E5E5E5;\n }\n .filecode .CodeMirror.cm-s-railscasts .CodeMirror-sizer,.filecode .CodeMirror-gutters,.filecode .CodeMirror-scroll{\n background:#fff;\n }\n .filecode .CodeMirror-linenumber{\n text-align:center\n }*/\n "),b.a.createElement("p",{className:"mt10 mb10"},b.a.createElement(f.a,{separator:">",className:"breadcrumb"},b.a.createElement(f.a.Item,{href:"/shixuns"},"实训项目"),b.a.createElement(f.a.Item,{href:"/shixuns/"+t+"/repository"},"版本库"),b.a.createElement(f.a.Item,null,"添加新文件"))),b.a.createElement(s.a,{onSubmit:this.handleSubmit,className:"formStyle"},b.a.createElement("div",{className:"edu-back-white padding20-30 mb10"},b.a.createElement(s.a.Item,{label:"文件名"},e("path",{rules:[{validator:this.checkPath}]})(b.a.createElement(u.a,{placeholder:"输入文件路径名src/HelloWorld.java",className:"winput-300-35 fl"})))),b.a.createElement("div",{className:"edu-back-white padding30"},b.a.createElement("p",{className:"ant-form-item-label"},b.a.createElement("label",null,"内容")),b.a.createElement("div",{className:"mt10 mb25 repoCMWrapper filecode"},b.a.createElement("textarea",{className:"",id:"codemirror-file-edit",style:{display:"none"},name:"content"})),b.a.createElement(s.a.Item,{label:"提交信息"},e("message",{rules:[{required:!0,message:"请输入提交信息"}]})(b.a.createElement("textarea",{className:"winput-100-130 fl"})))),b.a.createElement("div",{className:"clearfix mt30 edu-txt-right mb30"},b.a.createElement(o.a,{type:"primary",className:"defalutSubmitbtn fr ml20",onClick:this.handleSubmit},"提交"),b.a.createElement(y.b,{className:"defalutCancelbtn fr",to:"/shixuns/"+t+"/repository"},"取消"))))}}]),_);function _(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_);var n=function(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}(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,e));return n.checkPath=function(e,t,r){t?"/"==t||-1==t.indexOf(".")?r("请输入正确的文件路径src/HelloWorld.java"):r():r("文件名不能为空")},n.handleSubmit=function(){n.props.form.validateFieldsAndScroll(function(e,t){if(!e){var r="/shixuns/"+n.props.match.params.shixunId+"/add_file.json";g.a.post(r,{path:t.path,message:t.message,content:n.extend_editor.getValue()}).then(function(e){e&&n.props.history.push(""+e.data.url)}).catch(function(e){})}})},n}var M=s.a.create({name:"taskRepositoryAddFile"})(N);t.default=M}});