diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index d39ebb32a..c711143d2 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -1,4 +1,8 @@ import { bytesToSize } from 'educoder'; +export function isImageExtension(fileName) { + return fileName ? !!(fileName.match(/.(jpg|jpeg|png|gif)$/i)) : false +} + export function markdownToHTML(oldContent, selector) { window.$('#md_div').html('') // markdown to html diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js index 2088918da..5026eee28 100644 --- a/public/react/src/common/educoder.js +++ b/public/react/src/common/educoder.js @@ -14,7 +14,7 @@ export { updatePageParams as updatePageParams } from './RouterUti export { bytesToSize as bytesToSize } from './UnitUtil'; -export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from './TextUtil' +export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension } from './TextUtil' export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil' diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index 3dcdb1c18..dcdb550fd 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -6,6 +6,8 @@ import Loading from '../../Loading'; import axios from 'axios'; import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; import { CNotificationHOC } from './common/CNotificationHOC' +import {ImageLayerOfCommentHOC} from '../page/layers/ImageLayerOfCommentHOC' + import "./css/Courses.css" //引入对应跳转的组件 @@ -862,4 +864,4 @@ class CoursesIndex extends Component{ } } -export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) )); \ No newline at end of file +export default ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) ))); \ No newline at end of file diff --git a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js index 936807111..4e7d72a30 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkAppraise.js @@ -179,7 +179,7 @@ class CommonWorkAppraise extends Component{ {/*
*/} -
+