forked from jasder/forgeplus
42 lines
11 KiB
JavaScript
42 lines
11 KiB
JavaScript
webpackJsonp([271],{
|
||
|
||
/***/ 4514:
|
||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_button_style_css__ = __webpack_require__(89);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_antd_lib_button_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_antd_lib_button_style_css__);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_button__ = __webpack_require__(75);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_antd_lib_button___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_antd_lib_button__);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_form_style_css__ = __webpack_require__(959);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_antd_lib_form_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_antd_lib_form_style_css__);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_form__ = __webpack_require__(960);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_antd_lib_form___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_antd_lib_form__);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_input_style_css__ = __webpack_require__(57);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_antd_lib_input_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_antd_lib_input_style_css__);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_input__ = __webpack_require__(58);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_antd_lib_input___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_antd_lib_input__);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_breadcrumb_style_css__ = __webpack_require__(1339);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_antd_lib_breadcrumb_style_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_antd_lib_breadcrumb_style_css__);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_breadcrumb__ = __webpack_require__(1340);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_antd_lib_breadcrumb___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_antd_lib_breadcrumb__);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react__ = __webpack_require__(0);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_react__);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_educoder__ = __webpack_require__(5);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_react_router_dom__ = __webpack_require__(48);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_axios__ = __webpack_require__(8);
|
||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_axios__);
|
||
var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}/**
|
||
---------------------------- START
|
||
*/function getModeByMirrorName(mirror_name){var mode='javascript';if(mirror_name&&mirror_name.length){for(var i=0;i<mirror_name.length;i++){var modeVal=mirrorNameModeMap[mirror_name[i]];if(modeVal){mode=modeVal;break;}}}return mode;}var _extraKeys={"Alt-/":"autocomplete"};function createCMOptions(mirror_name){var mode=getModeByMirrorName(mirror_name);var cmOptions={lineNumbers:true,mode:mode,theme:"railscasts",indentUnit:4,matchBrackets:true,autoRefresh:true,smartIndent:true,//智能换行
|
||
extraKeys:_extraKeys,autofocus:true,styleActiveLine:true,lint:true,gutters:["CodeMirror-linenumbers","breakpoints","CodeMirror-lint-markers"]};return cmOptions;}var mirrorNameModeMap={'JFinal':'text/x-java','Java':'text/x-java','Kotlin':'text/x-kotlin','C/C++':'text/x-c++src','MachineLearning':{name:"python",version:3,singleLineStringErrors:false},'Python2.7':{name:"python",version:3,singleLineStringErrors:false},'Python3.6':{name:"python",version:3,singleLineStringErrors:false}/**
|
||
---------------------------- END
|
||
*/};var RepositoryAddFile=function(_Component){_inherits(RepositoryAddFile,_Component);function RepositoryAddFile(props){_classCallCheck(this,RepositoryAddFile);var _this=_possibleConstructorReturn(this,(RepositoryAddFile.__proto__||Object.getPrototypeOf(RepositoryAddFile)).call(this,props));_this.checkPath=function(rule,value,callback){if(!value){callback('文件名不能为空');}else if(value=="/"||value.indexOf('.')==-1){callback('请输入正确的文件路径,如:src/HelloWorld.java');}else{callback();}};_this.handleSubmit=function(){_this.props.form.validateFieldsAndScroll(function(err,values){if(!err){var shixunId=_this.props.match.params.shixunId;var url='/shixuns/'+shixunId+'/add_file.json';__WEBPACK_IMPORTED_MODULE_11_axios___default.a.post(url,{path:values.path,message:values.message,content:_this.extend_editor.getValue()}).then(function(result){if(result){_this.props.history.push(''+result.data.url);}}).catch(function(error){console.log(error);});}});};return _this;}_createClass(RepositoryAddFile,[{key:'componentDidMount',value:function componentDidMount(){var cmOptions=createCMOptions(this.props.mirror_name);var extend_editor=window.CodeMirror.fromTextArea(window.$('#codemirror-file-edit')[0],cmOptions);// tpi没setValue也可以
|
||
extend_editor.setValue('');extend_editor.refresh();// 拖拽也需要用 : window.editor_CodeMirror.refresh()
|
||
window.editor_tempCodeMirror=extend_editor;this.extend_editor=extend_editor;}},{key:'render',value:function render(){var getFieldDecorator=this.props.form.getFieldDecorator;var shixunId=this.props.match.params.shixunId;return __WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{className:'educontent'},__WEBPACK_IMPORTED_MODULE_8_react___default.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 '),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('p',{className:'mt10 mb10'},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_breadcrumb___default.a,{separator:'>',className:'breadcrumb'},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_breadcrumb___default.a.Item,{href:'/shixuns'},'\u5B9E\u8BAD\u9879\u76EE'),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_breadcrumb___default.a.Item,{href:'/shixuns/'+shixunId+'/repository'},'\u7248\u672C\u5E93'),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7_antd_lib_breadcrumb___default.a.Item,null,'\u6DFB\u52A0\u65B0\u6587\u4EF6'))),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_form___default.a,{onSubmit:this.handleSubmit,className:'formStyle'},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{className:'edu-back-white padding20-30 mb10'},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_form___default.a.Item,{label:'\u6587\u4EF6\u540D'},getFieldDecorator('path',{rules:[{validator:this.checkPath}]})(__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5_antd_lib_input___default.a,{placeholder:'\u8F93\u5165\u6587\u4EF6\u8DEF\u5F84\u540D\uFF0C\u5982\uFF1Asrc/HelloWorld.java',className:'winput-300-35 fl'})))),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{className:'edu-back-white padding30'},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('p',{className:'ant-form-item-label'},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('label',null,'\u5185\u5BB9')),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{className:'mt10 mb25 repoCMWrapper filecode'},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('textarea',{className:'',id:'codemirror-file-edit',style:{display:'none'},name:'content'})),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_form___default.a.Item,{label:'\u63D0\u4EA4\u4FE1\u606F'},getFieldDecorator('message',{rules:[{required:true,message:"请输入提交信息"}]})(__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('textarea',{className:'winput-100-130 fl'})))),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement('div',{className:'clearfix mt30 edu-txt-right mb30'},__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_button___default.a,{type:'primary',className:'defalutSubmitbtn fr ml20',onClick:this.handleSubmit},'\u63D0\u4EA4'),__WEBPACK_IMPORTED_MODULE_8_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10_react_router_dom__["b" /* Link */],{className:'defalutCancelbtn fr',to:'/shixuns/'+shixunId+'/repository'},'\u53D6\u6D88'))));}}]);return RepositoryAddFile;}(__WEBPACK_IMPORTED_MODULE_8_react__["Component"]);var WrappedRepositoryAddFile=__WEBPACK_IMPORTED_MODULE_3_antd_lib_form___default.a.create({name:'taskRepositoryAddFile'})(RepositoryAddFile);// RouteHOC()
|
||
/* harmony default export */ __webpack_exports__["default"] = (WrappedRepositoryAddFile);
|
||
|
||
/***/ })
|
||
|
||
}); |