From b1687b20c01b75aa6273799012337fa0ff8e7f7f Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Fri, 5 Jun 2020 11:29:58 +0800 Subject: [PATCH 1/5] Delete react code --- public/quill/quill.bubble.css | 952 - public/quill/quill.js | 11489 ---------- public/quill/quill.min.js | 8 - public/quill/quill.snow.css | 945 - public/react/LICENSE | 21 - public/react/add.txt | 34 - public/react/build | 1 + public/react/config/env.js | 93 - public/react/config/jest/cssTransform.js | 14 - public/react/config/jest/fileTransform.js | 12 - public/react/config/paths.js | 55 - public/react/config/polyfills.js | 22 - public/react/config/webpack.config.dev.js | 287 - public/react/config/webpack.config.prod.js | 391 - .../react/config/webpackDevServer.config.js | 95 - public/react/index.js | 46 - public/react/package-lock.json | 18390 ---------------- public/react/package.json | 190 - public/react/readme.txt | 172 - public/react/scripts/build.js | 251 - public/react/scripts/concat.js | 98 - public/react/scripts/fileContentReplace.js | 23 - public/react/scripts/readme-cdn.txt | 16 - public/react/scripts/start.js | 114 - public/react/scripts/test.js | 27 - public/react/src/App.css | 107 - public/react/src/App.js | 909 - public/react/src/App.test.js | 9 - public/react/src/AppConfig.js | 420 - public/react/src/CustomLoadable.js | 12 - public/react/src/Loading.js | 34 - public/react/src/NotFoundPage.js | 41 - public/react/src/college/College.js | 1261 -- .../college/colleagechart/Colleagechart.js | 84 - .../college/colleagechart/Colleagechartzu.js | 149 - .../src/college/colleagecss/colleage.css | 213 - public/react/src/common/Component.js | 5 - public/react/src/common/Const.js | 19 - public/react/src/common/DateUtil.js | 69 - public/react/src/common/Env.js | 8 - public/react/src/common/EventUtil.js | 70 - public/react/src/common/IEVersion.js | 28 - public/react/src/common/LoadingSpin.js | 29 - public/react/src/common/LogUtil.js | 61 - public/react/src/common/RouterUtil.js | 15 - public/react/src/common/ShowSpin.js | 33 - public/react/src/common/SnackbarHOC.js | 91 - public/react/src/common/Store.js | 14 - public/react/src/common/TextUtil.js | 79 - public/react/src/common/UnitUtil.js | 6 - public/react/src/common/UrlTool.js | 187 - public/react/src/common/UrlTool2.js | 51 - .../src/common/components/ConditionToolTip.js | 28 - public/react/src/common/components/Cropper.js | 288 - .../src/common/components/DragValidator.js | 116 - .../src/common/components/LinkAfterLogin.js | 31 - .../src/common/components/ModalConfirm.js | 30 - .../react/src/common/components/ModalHOC.js | 106 - public/react/src/common/components/MyIcon.js | 15 - .../src/common/components/Notcompleted.js | 48 - .../src/common/components/SetAppModel.js | 51 - .../components/attachment/AttachmentList.js | 31 - .../common/components/comment/CommentForm.js | 139 - .../common/components/comment/CommentIcon.js | 42 - .../common/components/comment/CommentItem.js | 257 - .../common/components/comment/CommentList.js | 56 - .../src/common/components/comment/index.js | 46 - .../src/common/components/comment/index.scss | 230 - .../src/common/components/comment/util.js | 80 - .../react/src/common/components/form/City.js | 1775 -- .../components/instruction/PopInstruction.js | 68 - .../common/components/markdown/DMDEditor.css | 12 - .../common/components/markdown/DMDEditor.js | 83 - .../components/markdown/MarkdownToHtml.css | 6 - .../components/markdown/MarkdownToHtml.js | 40 - .../common/components/media/AliyunUploader.js | 237 - .../components/media/AliyunUploaderDemo.js | 188 - .../src/common/components/media/Clappr.js | 110 - .../react/src/common/context/ThemeContext.js | 20 - public/react/src/common/course/ActionBtn.js | 29 - public/react/src/common/course/WordsBtn.js | 31 - public/react/src/common/educoder.js | 77 - public/react/src/common/hooks/ImageLayer2.js | 48 - .../src/common/quillForEditor/FillBlot.js | 35 - .../src/common/quillForEditor/ImageBlot.js | 70 - .../react/src/common/quillForEditor/README.md | 95 - .../src/common/quillForEditor/deepEqual.js | 47 - .../react/src/common/quillForEditor/index.js | 280 - .../src/common/quillForEditor/index.scss | 132 - .../react/src/common/reactQuill/ImageBlot.js | 54 - .../react/src/common/reactQuill/ReactQuill.js | 45 - .../react/src/common/reactQuill/deepEqual.js | 47 - public/react/src/common/reactQuill/flatten.js | 26 - public/react/src/common/reactQuill/index.js | 108 - public/react/src/common/reactQuill/index.scss | 32 - public/react/src/common/reactQuill/lib.js | 13 - .../src/common/reactQuill/useDeepEqualMemo.js | 27 - .../src/common/reactQuill/useMountQuill.js | 148 - .../react/src/common/reactQuill/useQuill.js | 60 - .../src/common/reactQuill/useQuillOnChange.js | 33 - .../common/reactQuill/useQuillPlaceholder.js | 22 - .../common/reactQuill/useQuillValueSync.js | 31 - public/react/src/common/util/ShareUtil.js | 135 - public/react/src/constants/index.js | 136 - .../react/src/context/EffectDisplayContent.js | 50 - .../context/EvaluateSuccessEffectDisplay.js | 251 - public/react/src/context/TPIContext.js | 4 - .../react/src/context/TPIContextProvider.js | 969 - public/react/src/forge/Activity/Activity.js | 182 - .../react/src/forge/Activity/ActivityItem.js | 44 - public/react/src/forge/Activity/activity.css | 108 - public/react/src/forge/Branch/CloneAddress.js | 36 - public/react/src/forge/Branch/SelectBranch.js | 33 - public/react/src/forge/Branch/branch.css | 9 - public/react/src/forge/Images/1.png | Bin 609 -> 0 bytes public/react/src/forge/Images/2.png | Bin 214 -> 0 bytes public/react/src/forge/Images/3.png | Bin 382 -> 0 bytes public/react/src/forge/Images/4.png | Bin 585 -> 0 bytes public/react/src/forge/Images/5.png | Bin 451 -> 0 bytes public/react/src/forge/Images/6.png | Bin 621 -> 0 bytes public/react/src/forge/Images/7.png | Bin 674 -> 0 bytes public/react/src/forge/Images/array.png | Bin 266 -> 0 bytes public/react/src/forge/Images/banner_list.png | Bin 263449 -> 0 bytes public/react/src/forge/Images/banner_sub.png | Bin 83897 -> 0 bytes public/react/src/forge/Images/banner_team.png | Bin 5094 -> 0 bytes public/react/src/forge/Images/dir.png | Bin 4587 -> 0 bytes public/react/src/forge/Images/focus.png | Bin 580 -> 0 bytes public/react/src/forge/Images/focused.png | Bin 454 -> 0 bytes public/react/src/forge/Images/fork.png | Bin 369 -> 0 bytes public/react/src/forge/Images/item.png | Bin 2097 -> 0 bytes public/react/src/forge/Images/new.png | Bin 433 -> 0 bytes public/react/src/forge/Images/parise.png | Bin 492 -> 0 bytes public/react/src/forge/Images/parised.png | Bin 374 -> 0 bytes public/react/src/forge/Images/type.png | Bin 4610 -> 0 bytes public/react/src/forge/Index.js | 86 - .../react/src/forge/Main/CoderRootBranch.js | 78 - .../react/src/forge/Main/CoderRootCommit.js | 157 - .../src/forge/Main/CoderRootDirectory.js | 335 - .../src/forge/Main/CoderRootFileDetail.js | 147 - public/react/src/forge/Main/CoderRootIndex.js | 56 - public/react/src/forge/Main/Detail.js | 507 - public/react/src/forge/Main/DetailTop.js | 23 - public/react/src/forge/Main/Index.js | 251 - public/react/src/forge/Main/IndexItem.js | 57 - public/react/src/forge/Main/NullData.js | 64 - public/react/src/forge/Main/RootTable.js | 19 - public/react/src/forge/Main/list.css | 562 - public/react/src/forge/Merge/MergeDetail.js | 331 - public/react/src/forge/Merge/MergeItem.js | 65 - public/react/src/forge/Merge/MergeSubmit.js | 212 - public/react/src/forge/Merge/MessageCount.js | 550 - public/react/src/forge/Merge/NewMerge.js | 405 - public/react/src/forge/Merge/UpdateMerge.js | 282 - public/react/src/forge/Merge/merge.css | 34 - public/react/src/forge/Merge/merge.js | 313 - public/react/src/forge/New/Index.js | 315 - public/react/src/forge/New/new.css | 72 - public/react/src/forge/Newfile/Index.js | 67 - .../src/forge/Newfile/UserSubmitComponent.js | 106 - public/react/src/forge/Newfile/index.css | 38 - public/react/src/forge/Order/CopyDetail.js | 372 - public/react/src/forge/Order/Detail.js | 525 - public/react/src/forge/Order/Milepost.js | 300 - .../react/src/forge/Order/MilepostDetail.js | 376 - public/react/src/forge/Order/Nav.js | 23 - public/react/src/forge/Order/New.js | 288 - public/react/src/forge/Order/OrderItem.js | 68 - public/react/src/forge/Order/Tags.js | 426 - public/react/src/forge/Order/UpdateDetail.js | 354 - .../react/src/forge/Order/UpdateMilepost.js | 246 - public/react/src/forge/Order/newMilepost.js | 213 - public/react/src/forge/Order/order.css | 494 - public/react/src/forge/Order/order.js | 427 - public/react/src/forge/Redux/Reducer/index.js | 7 - public/react/src/forge/Redux/Store/index.js | 18 - public/react/src/forge/Settings/Branch.js | 43 - .../react/src/forge/Settings/Collaborator.js | 248 - public/react/src/forge/Settings/Index.js | 62 - public/react/src/forge/Settings/Setting.js | 213 - public/react/src/forge/Settings/setting.css | 104 - public/react/src/forge/Upload/Index.js | 100 - public/react/src/forge/Upload/attachment.js | 82 - public/react/src/forge/Version/NewVersion.js | 197 - .../react/src/forge/Version/UpdateVersion.js | 191 - public/react/src/forge/Version/version.css | 94 - public/react/src/forge/Version/version.js | 161 - public/react/src/forge/css/index.css | 89 - public/react/src/forge/js/index.js | 3186 --- public/react/src/history.js | 6 - public/react/src/images/account/auth.png | Bin 32571 -> 0 bytes .../react/src/images/account/infobanner.png | Bin 7689 -> 0 bytes public/react/src/images/account/job.png | Bin 29894 -> 0 bytes public/react/src/images/ad/match_ad.jpg | Bin 18048 -> 0 bytes .../react/src/images/cert/shimingrenzheng.png | Bin 2196 -> 0 bytes .../react/src/images/cert/zhiyerenzheng.png | Bin 1779 -> 0 bytes public/react/src/images/component/rc-tree.png | Bin 11628 -> 0 bytes .../react/src/images/component/selectFile.png | Bin 1074 -> 0 bytes public/react/src/images/delay.png | Bin 801 -> 0 bytes public/react/src/images/ecs/bg.jpg | Bin 81209 -> 0 bytes public/react/src/images/forge/project.jpg | Bin 24960 -> 0 bytes public/react/src/images/guideimg/guihome1.png | Bin 71879 -> 0 bytes public/react/src/images/guideimg/guihome2.jpg | Bin 38346 -> 0 bytes public/react/src/images/guideimg/guihome3.jpg | Bin 32030 -> 0 bytes public/react/src/images/guideimg/guihome4.jpg | Bin 29333 -> 0 bytes public/react/src/images/guideimg/guihome5.jpg | Bin 18145 -> 0 bytes public/react/src/images/guideimg/guihome6.jpg | Bin 30297 -> 0 bytes public/react/src/images/guideimg/guihome6.png | Bin 12638 -> 0 bytes public/react/src/images/guideimg/guihome7.png | Bin 12289 -> 0 bytes public/react/src/images/invalid.png | Bin 776 -> 0 bytes .../react/src/images/login/beijintulogon.png | Bin 33592 -> 0 bytes .../src/images/login/beijintulogontwo.png | Bin 24595 -> 0 bytes public/react/src/images/login/educodernet.png | Bin 3839 -> 0 bytes public/react/src/images/login/passoff.png | Bin 1195 -> 0 bytes public/react/src/images/login/passopen.png | Bin 1090 -> 0 bytes .../react/src/images/moop_cases/success.png | Bin 3351 -> 0 bytes .../react/src/images/moop_cases/teach_ex.jpg | Bin 244343 -> 0 bytes public/react/src/images/oj/oj_banner.jpg | Bin 114822 -> 0 bytes public/react/src/images/path/path.png | Bin 184598 -> 0 bytes public/react/src/images/shixuns/search.svg | 1 - public/react/src/images/tpi/empiricgreen.png | Bin 1223 -> 0 bytes public/react/src/images/tpi/message.svg | 23 - public/react/src/images/tpi/messagegrey.svg | 23 - .../react/src/images/tpi/notEditablePath.png | Bin 7806 -> 0 bytes public/react/src/images/tpi/passall.png | Bin 87368 -> 0 bytes public/react/src/images/tpi/passpart.png | Bin 89804 -> 0 bytes public/react/src/images/tpi/sendimg.svg | 12 - public/react/src/images/tpi/upload-image.png | Bin 628 -> 0 bytes public/react/src/images/wx-head.png | Bin 53384 -> 0 bytes public/react/src/index.css | 40 - public/react/src/index.js | 46 - public/react/src/indexEduplus2RequestProxy.js | 84 - public/react/src/indexPlus.css | 4 - public/react/src/logo.svg | 7 - public/react/src/modal/GotoQQgroup.js | 62 - public/react/src/modal/gotoqqgroup.css | 61 - .../react/src/modules/403/Shixunauthority.js | 37 - public/react/src/modules/404/Shixunnopage.js | 37 - public/react/src/modules/500/http500.js | 37 - public/react/src/modules/comment/Comment.css | 261 - .../src/modules/comment/CommentContainer.js | 28 - .../react/src/modules/comment/CommentInput.js | 131 - .../modules/comment/CommentItemKEEditor.js | 72 - .../modules/comment/CommentItemMDEditor.css | 58 - .../modules/comment/CommentItemMDEditor.js | 138 - public/react/src/modules/comment/Comments.js | 616 - .../react/src/modules/comment/CommentsHOC.js | 625 - .../src/modules/common/CompatibilityPage.js | 202 - .../react/src/modules/common/RewardDialog.js | 105 - .../src/modules/common/imgs/firefox_icon.png | Bin 20929 -> 0 bytes .../modules/common/imgs/google-chrome@2x.png | Bin 9754 -> 0 bytes .../react/src/modules/common/imgs/icon@2x.png | Bin 2983 -> 0 bytes .../common/imgs/internet-explorer@2x.png | Bin 22920 -> 0 bytes .../modules/competition/CompetitionMaxImg.js | 163 - .../src/modules/competition/RegisListview.js | 50 - .../modules/competition/RegisListviewdata.js | 170 - .../src/modules/competition/RegisNodata.js | 34 - .../src/modules/competition/Registration.js | 1144 - .../modules/competition/RegistrationSearch.js | 75 - .../modules/competition/Registrationitem.js | 84 - .../competition/comcss/competition.css | 900 - .../competmodal/ExittheteamModel.js | 59 - .../competmodal/MessagePersonModal.js | 63 - .../competition/competmodal/PersonModal.js | 1554 -- .../competmodal/PersonModaltion.js | 50 - .../competmodal/PersonalModalteam.js | 146 - .../competition/personal/PersonalCompetit.js | 97 - .../personal/PersonalCompetititem.js | 445 - .../Competitimain/CompetitionsIndex.js | 225 - .../Competitimain/Competitionsindex.css | 163 - .../Competition_teams/Competitionteams.css | 53 - .../Competition_teams/Competitionteams.js | 267 - .../Competitioncommon/CompetitionCommon.css | 438 - .../Competitioncommon/CompetitionCommon.js | 548 - .../CompetitionContents.js | 45 - .../CompetitionContentsChart.js | 423 - .../CompetitionContentsMd.js | 232 - .../CompetitionContentspdf.js | 64 - .../Bankcardnumberverification.js | 292 - .../CompetitionContentspdfdownload.css | 24 - .../CompetitionContentspdfdownload.js | 215 - .../CompetitionContentspdfpeopledata.js | 597 - .../Mailboxvalidation.js | 278 - .../Phonenumberverification.js | 269 - .../mycompetotionchild.css | 314 - .../src/modules/competitions/Competitions.js | 92 - .../react/src/modules/courses/BoardIndex.js | 100 - public/react/src/modules/courses/Index.js | 963 - .../src/modules/courses/ListPageIndex.js | 371 - .../modules/courses/Resource/Fileslistitem.js | 368 - .../src/modules/courses/Resource/index.js | 1064 - .../src/modules/courses/Resource/style.css | 0 .../react/src/modules/courses/Video/Live.js | 82 - .../src/modules/courses/Video/LiveItem.js | 177 - .../src/modules/courses/Video/LiveNew.js | 292 - .../react/src/modules/courses/Video/Video.js | 254 - .../src/modules/courses/Video/VideoIndex.js | 297 - .../src/modules/courses/Video/VideoNew.js | 11 - .../courses/Video/images/WeiBaiTong.png | Bin 5612 -> 0 bytes .../modules/courses/Video/images/bilibili.png | Bin 7954 -> 0 bytes .../modules/courses/Video/images/douyu.jpg | Bin 358711 -> 0 bytes .../modules/courses/Video/images/tencent.png | Bin 2226 -> 0 bytes .../react/src/modules/courses/Video/video.css | 179 - .../src/modules/courses/boards/AddDirModal.js | 89 - .../modules/courses/boards/BoardsListItem.js | 146 - .../src/modules/courses/boards/BoardsNew.js | 497 - .../modules/courses/boards/BoardsNewTemp.js | 202 - .../modules/courses/boards/TopicDetail.css | 15 - .../src/modules/courses/boards/TopicDetail.js | 748 - .../src/modules/courses/boards/board.css | 46 - .../modules/courses/boards/boardsListItem.css | 9 - .../src/modules/courses/boards/common.js | 66 - .../react/src/modules/courses/boards/index.js | 466 - .../courses/busyWork/CommonWorkAnswer.js | 113 - .../courses/busyWork/CommonWorkAppraise.js | 284 - .../CommonWorkAppraiseReviseAttachments.js | 52 - .../courses/busyWork/CommonWorkDetail.js | 0 .../courses/busyWork/CommonWorkDetailIndex.js | 482 - .../courses/busyWork/CommonWorkItem.js | 299 - .../courses/busyWork/CommonWorkList.js | 913 - .../busyWork/CommonWorkListTemplate.js | 135 - .../courses/busyWork/CommonWorkPost.js | 851 - .../courses/busyWork/CommonWorkQuestion.js | 130 - .../courses/busyWork/CommonWorkSetting.js | 1550 -- .../courses/busyWork/ConnectProject.js | 186 - .../src/modules/courses/busyWork/Index.js | 142 - .../modules/courses/busyWork/IndexGroup.js | 140 - .../src/modules/courses/busyWork/NewWork.js | 207 - .../modules/courses/busyWork/NewWorkForm.js | 555 - .../courses/busyWork/PublishRightnow.js | 269 - .../src/modules/courses/busyWork/TestHooks.js | 26 - .../src/modules/courses/busyWork/UseBank.js | 392 - .../src/modules/courses/busyWork/common.js | 196 - .../courses/busyWork/common/LeaderIcon.js | 22 - .../busyWork/common/TabRightComponents.js | 197 - .../busyWork/common/WorkDetailPageHeader.js | 172 - .../modules/courses/busyWork/commonWork.js | 494 - .../reply/CommonWorkAppraiseReply.css | 0 .../busyWork/reply/CommonWorkAppraiseReply.js | 324 - .../src/modules/courses/common/CBreadcrumb.js | 34 - .../src/modules/courses/common/CDropdown.js | 28 - .../courses/common/CNotificationHOC.js | 193 - .../modules/courses/common/CommentsHelper.js | 255 - .../courses/common/CourseLayoutComponent.js | 78 - .../modules/courses/common/ModalWrapper.js | 68 - .../courses/common/button/CheckAllGroup.js | 62 - .../courses/common/comments/CCommentItem.js | 430 - .../courses/common/comments/CommonReply.js | 297 - .../modules/courses/common/courseMessage.css | 67 - .../src/modules/courses/common/formCommon.css | 58 - .../common/titleSearch/ColorCountText.js | 18 - .../common/titleSearch/TitleSearchSection.js | 101 - .../Competitimain/CompetitionsIndex.js | 225 - .../Competitimain/Competitionsindex.css | 163 - .../Competition_teams/Competitionteams.css | 53 - .../Competition_teams/Competitionteams.js | 267 - .../Competitioncommon/CompetitionCommon.css | 438 - .../Competitioncommon/CompetitionCommon.js | 548 - .../CompetitionContents.js | 45 - .../CompetitionContentsChart.js | 423 - .../CompetitionContentsMd.js | 232 - .../CompetitionContentspdf.js | 64 - .../Bankcardnumberverification.js | 292 - .../CompetitionContentspdfdownload.css | 24 - .../CompetitionContentspdfdownload.js | 215 - .../CompetitionContentspdfpeopledata.js | 598 - .../Mailboxvalidation.js | 278 - .../Phonenumberverification.js | 270 - .../mycompetotionchild.css | 314 - .../courses/competitions/Competitions.js | 92 - .../Completetaskdetails.js | 92 - .../completetaskdetails/Completetaskpage.js | 149 - .../completetaskdetails.css | 69 - .../comtopicdetails/CompletetopicdePage.js | 150 - .../comtopicdetails/Completetopicdetails.js | 146 - .../comtopicdetails/completetopicde.css | 65 - .../courses/coursesDetail/CoursesBanner.js | 997 - .../courses/coursesDetail/CoursesDetail.js | 105 - .../courses/coursesDetail/CoursesGuide.js | 44 - .../courses/coursesDetail/CoursesLeftNav.js | 1247 -- .../courses/coursesDetail/MainLeftNav.css | 37 - .../coursesDetail/MyEduChapterupdate.js | 211 - .../courses/coursesDetail/chapterupdate.css | 34 - .../courses/coursesHome/CoursesHome.js | 200 - .../courses/coursesHome/CoursesHomeCard.js | 145 - .../courses/coursesHome/css/CoursesHome.css | 39 - .../courses/coursesHome/css/courses.jpg | Bin 172848 -> 0 bytes .../courses/coursesPublic/AccessoryModal.js | 375 - .../courses/coursesPublic/AccessoryModal2.js | 270 - .../courses/coursesPublic/Addcourses.js | 411 - .../courses/coursesPublic/AddcoursesNav.js | 74 - .../courses/coursesPublic/AllocationModal.js | 87 - .../courses/coursesPublic/AppraiseModal.js | 192 - .../courses/coursesPublic/ApprausePublic.js | 167 - .../courses/coursesPublic/Associationmodel.js | 258 - .../courses/coursesPublic/CourseTag.css | 24 - .../courses/coursesPublic/CourseTag.js | 29 - .../courses/coursesPublic/CoursesListType.js | 93 - .../courses/coursesPublic/CoursesMarkdown.js | 223 - .../courses/coursesPublic/HomeworkModal.js | 285 - .../courses/coursesPublic/ModalsRename.js | 63 - .../courses/coursesPublic/ModulationModal.js | 289 - .../coursesPublic/ModulationModal_exercise.js | 627 - .../courses/coursesPublic/NewShixunModel.js | 756 - .../courses/coursesPublic/Newshixunmodel.css | 515 - .../modules/courses/coursesPublic/NoneData.js | 31 - .../coursesPublic/OneSelfOrderModal.js | 475 - .../courses/coursesPublic/PathModal.js | 331 - .../courses/coursesPublic/PublishModals.js | 53 - .../courses/coursesPublic/SelectResource.js | 464 - .../courses/coursesPublic/SelectSetting.js | 582 - .../courses/coursesPublic/SendToFilesModal.js | 232 - .../coursesPublic/ShixunChooseModal.js | 123 - .../courses/coursesPublic/ShixunModal.js | 408 - .../courses/coursesPublic/Showoldfiles.js | 227 - .../courses/coursesPublic/Startshixuntask.js | 193 - .../coursesPublic/form/SchoolSelect.js | 73 - .../courses/coursesPublic/makedown.css | 342 - .../coursesPublic/modal/CheckCodeModal.js | 235 - .../coursesPublic/modal/SendToCourseModal.js | 209 - .../coursesPublic/modal/ShixunModal2.js | 325 - .../courses/coursesPublic/sendResource.js | 451 - .../modules/courses/coursmodel/AuthenModel.js | 49 - .../courses/coursmodel/authenmodels.css | 1068 - .../react/src/modules/courses/css/Courses.css | 1766 -- .../src/modules/courses/css/busyWork.css | 81 - .../react/src/modules/courses/css/members.css | 91 - .../modules/courses/elearning/Elearning.js | 418 - .../courses/elearning/YslDetailCards.js | 572 - .../modules/courses/elearning/myelearning.css | 0 .../courses/exercise/Ecerciseallbackagain.js | 275 - .../modules/courses/exercise/Ecercisemount.js | 247 - .../src/modules/courses/exercise/Exercise.js | 610 - .../courses/exercise/ExerciseDisplay.js | 198 - .../courses/exercise/ExerciseListItem.js | 239 - .../modules/courses/exercise/ExerciseNew.js | 94 - .../courses/exercise/ExerciseNewCommon.js | 625 - .../exercise/ExerciseReviewAndAnswer.js | 1019 - .../courses/exercise/Exercisesetting.js | 889 - .../exercise/Exercisestatisticalresult.js | 367 - .../Exercisestatisticalresulttabel.js | 193 - .../courses/exercise/Exercisetablesmubu.js | 143 - .../exercise/Studentshavecompletedthelist.js | 3299 --- .../exercise/Testpapersettinghomepage.js | 487 - .../courses/exercise/new/JudgeDisplay.js | 106 - .../courses/exercise/new/JudgeEditor.js | 238 - .../courses/exercise/new/MainDisplay.js | 87 - .../courses/exercise/new/MainEditor.js | 187 - .../courses/exercise/new/NullChildEditor.js | 90 - .../courses/exercise/new/NullDisplay.js | 132 - .../courses/exercise/new/NullEditor.js | 364 - .../courses/exercise/new/NullMDEditor.js | 132 - .../exercise/new/QestionDisplayHeader.js | 95 - .../courses/exercise/new/ShixunDisplay.js | 142 - .../courses/exercise/new/ShixunEditor.js | 295 - .../courses/exercise/new/SingleDisplay.js | 135 - .../courses/exercise/new/SingleEditor.js | 392 - .../modules/courses/exercise/new/common.css | 40 - .../modules/courses/exercise/new/common.js | 15 - .../courses/exercise/new/editorCommon.css | 0 .../courses/exercise/question/fillEmpty.js | 162 - .../courses/exercise/question/multiple.js | 81 - .../courses/exercise/question/shixunAnswer.js | 386 - .../exercise/question/shixunAnswerDetail.js | 72 - .../courses/exercise/question/simpleAnswer.js | 101 - .../courses/exercise/question/single.js | 76 - .../courses/exercise/yslexercisetable.css | 62 - .../courses/fonts/KaTeX_AMS-Regular.ttf | Bin 70972 -> 0 bytes .../courses/fonts/KaTeX_AMS-Regular.woff | Bin 38868 -> 0 bytes .../courses/fonts/KaTeX_AMS-Regular.woff2 | Bin 32944 -> 0 bytes .../courses/fonts/KaTeX_Caligraphic-Bold.ttf | Bin 19316 -> 0 bytes .../courses/fonts/KaTeX_Caligraphic-Bold.woff | Bin 11696 -> 0 bytes .../fonts/KaTeX_Caligraphic-Bold.woff2 | Bin 10448 -> 0 bytes .../fonts/KaTeX_Caligraphic-Regular.ttf | Bin 18684 -> 0 bytes .../fonts/KaTeX_Caligraphic-Regular.woff | Bin 11460 -> 0 bytes .../fonts/KaTeX_Caligraphic-Regular.woff2 | Bin 10240 -> 0 bytes .../courses/fonts/KaTeX_Fraktur-Bold.ttf | Bin 35660 -> 0 bytes .../courses/fonts/KaTeX_Fraktur-Bold.woff | Bin 22632 -> 0 bytes .../courses/fonts/KaTeX_Fraktur-Bold.woff2 | Bin 20360 -> 0 bytes .../courses/fonts/KaTeX_Fraktur-Regular.ttf | Bin 34352 -> 0 bytes .../courses/fonts/KaTeX_Fraktur-Regular.woff | Bin 22088 -> 0 bytes .../courses/fonts/KaTeX_Fraktur-Regular.woff2 | Bin 19784 -> 0 bytes .../modules/courses/fonts/KaTeX_Main-Bold.ttf | Bin 60784 -> 0 bytes .../courses/fonts/KaTeX_Main-Bold.woff | Bin 35464 -> 0 bytes .../courses/fonts/KaTeX_Main-Bold.woff2 | Bin 30244 -> 0 bytes .../courses/fonts/KaTeX_Main-BoldItalic.ttf | Bin 44496 -> 0 bytes .../courses/fonts/KaTeX_Main-BoldItalic.woff | Bin 25352 -> 0 bytes .../courses/fonts/KaTeX_Main-BoldItalic.woff2 | Bin 21944 -> 0 bytes .../courses/fonts/KaTeX_Main-Italic.ttf | Bin 47640 -> 0 bytes .../courses/fonts/KaTeX_Main-Italic.woff | Bin 26228 -> 0 bytes .../courses/fonts/KaTeX_Main-Italic.woff2 | Bin 22748 -> 0 bytes .../courses/fonts/KaTeX_Main-Regular.ttf | Bin 69520 -> 0 bytes .../courses/fonts/KaTeX_Main-Regular.woff | Bin 38112 -> 0 bytes .../courses/fonts/KaTeX_Main-Regular.woff2 | Bin 32464 -> 0 bytes .../courses/fonts/KaTeX_Math-BoldItalic.ttf | Bin 39308 -> 0 bytes .../courses/fonts/KaTeX_Math-BoldItalic.woff | Bin 22324 -> 0 bytes .../courses/fonts/KaTeX_Math-BoldItalic.woff2 | Bin 19720 -> 0 bytes .../courses/fonts/KaTeX_Math-Italic.ttf | Bin 40992 -> 0 bytes .../courses/fonts/KaTeX_Math-Italic.woff | Bin 22844 -> 0 bytes .../courses/fonts/KaTeX_Math-Italic.woff2 | Bin 20096 -> 0 bytes .../courses/fonts/KaTeX_SansSerif-Bold.ttf | Bin 33688 -> 0 bytes .../courses/fonts/KaTeX_SansSerif-Bold.woff | Bin 18516 -> 0 bytes .../courses/fonts/KaTeX_SansSerif-Bold.woff2 | Bin 15732 -> 0 bytes .../courses/fonts/KaTeX_SansSerif-Italic.ttf | Bin 30960 -> 0 bytes .../courses/fonts/KaTeX_SansSerif-Italic.woff | Bin 17572 -> 0 bytes .../fonts/KaTeX_SansSerif-Italic.woff2 | Bin 15024 -> 0 bytes .../courses/fonts/KaTeX_SansSerif-Regular.ttf | Bin 29812 -> 0 bytes .../fonts/KaTeX_SansSerif-Regular.woff | Bin 16228 -> 0 bytes .../fonts/KaTeX_SansSerif-Regular.woff2 | Bin 13708 -> 0 bytes .../courses/fonts/KaTeX_Script-Regular.ttf | Bin 24620 -> 0 bytes .../courses/fonts/KaTeX_Script-Regular.woff | Bin 13428 -> 0 bytes .../courses/fonts/KaTeX_Script-Regular.woff2 | Bin 12064 -> 0 bytes .../courses/fonts/KaTeX_Size1-Regular.ttf | Bin 12916 -> 0 bytes .../courses/fonts/KaTeX_Size1-Regular.woff | Bin 6696 -> 0 bytes .../courses/fonts/KaTeX_Size1-Regular.woff2 | Bin 5592 -> 0 bytes .../courses/fonts/KaTeX_Size2-Regular.ttf | Bin 12172 -> 0 bytes .../courses/fonts/KaTeX_Size2-Regular.woff | Bin 6436 -> 0 bytes .../courses/fonts/KaTeX_Size2-Regular.woff2 | Bin 5392 -> 0 bytes .../courses/fonts/KaTeX_Size3-Regular.ttf | Bin 8120 -> 0 bytes .../courses/fonts/KaTeX_Size3-Regular.woff | Bin 4568 -> 0 bytes .../courses/fonts/KaTeX_Size3-Regular.woff2 | Bin 3728 -> 0 bytes .../courses/fonts/KaTeX_Size4-Regular.ttf | Bin 11016 -> 0 bytes .../courses/fonts/KaTeX_Size4-Regular.woff | Bin 6184 -> 0 bytes .../courses/fonts/KaTeX_Size4-Regular.woff2 | Bin 5028 -> 0 bytes .../fonts/KaTeX_Typewriter-Regular.ttf | Bin 35924 -> 0 bytes .../fonts/KaTeX_Typewriter-Regular.woff | Bin 20260 -> 0 bytes .../fonts/KaTeX_Typewriter-Regular.woff2 | Bin 17272 -> 0 bytes .../courses/gradinforms/Bullsubdirectory.js | 549 - .../modules/courses/gradinforms/Eduinforms.js | 531 - .../courses/gradinforms/myysleduinforms.css | 93 - .../src/modules/courses/graduation/style.css | 56 - .../graduation/tasks/GraduateTaskItem.js | 407 - .../graduation/tasks/GraduationAcross.js | 556 - .../graduation/tasks/GraduationTaskDetail.js | 582 - .../tasks/GraduationTasksSubmitedit.js | 871 - .../tasks/GraduationTasksSubmitnew.js | 859 - .../tasks/GraduationTasksappraise.js | 349 - .../GraduationTasksappraiseMainEditor.js | 263 - .../tasks/GraduationTasksappraiseReply.css | 36 - .../tasks/GraduationTasksappraiseReply.js | 196 - .../GraduationTasksappraiseReplyChild.js | 104 - .../graduation/tasks/GraduationTasksedit.js | 579 - .../graduation/tasks/GraduationTasksnew.js | 533 - .../tasks/GraduationTaskssetting.js | 1312 -- .../tasks/GraduationTaskssettingReply.js | 279 - .../tasks/GraduationTaskssettinglist.js | 1553 -- .../tasks/GraduationTaskssettingquestions.js | 400 - .../graduation/tasks/Graduationclass.css | 7 - .../graduation/tasks/Graduationtaskitem.js | 83 - .../graduation/tasks/TaskPublishModal.js | 140 - .../modules/courses/graduation/tasks/index.js | 818 - .../topics/ChooseGraduateTopicModal.js | 89 - .../graduation/topics/GraduateTopicDetail.js | 164 - .../topics/GraduateTopicDetailInfo.js | 130 - .../topics/GraduateTopicDetailTable.js | 306 - .../graduation/topics/GraduateTopicItem.js | 157 - .../graduation/topics/GraduateTopicNew.js | 635 - .../graduation/topics/GraduateTopicNewFrom.js | 520 - .../topics/GraduateTopicPostWorksNew.js | 432 - .../graduation/topics/GraduateTopicReply.css | 13 - .../graduation/topics/GraduateTopicReply.js | 271 - .../courses/graduation/topics/index.js | 517 - .../courses/groupjobbank/GroupPackage.js | 90 - .../courses/groupjobbank/GroupPackage2.js | 114 - .../groupjobbank/Groupjobbandetails.js | 130 - .../courses/groupjobbank/GroupjobbankPage.js | 173 - .../groupjobbank/Groupjobquesanswer.js | 116 - .../courses/groupjobbank/questionbanks.css | 50 - public/react/src/modules/courses/katex.css | 1 - .../modules/courses/members/ChangeRolePop.js | 82 - .../courses/members/CourseGroupChooser.js | 97 - .../courses/members/CourseGroupList.js | 243 - .../courses/members/CourseGroupListTable.js | 280 - .../src/modules/courses/members/common.js | 2 - .../courses/members/modal/AddAdminModal.js | 234 - .../members/modal/AddGraduationGroupModal.js | 75 - .../courses/members/modal/AddStudentModal.js | 285 - .../courses/members/modal/AddTeacherModal.js | 351 - .../members/modal/CourseGroupChooserModal.js | 130 - .../members/modal/CreateGroupByImportModal.js | 153 - .../modules/courses/members/studentsList.css | 51 - .../modules/courses/members/studentsList.js | 929 - .../modules/courses/members/teacherList.js | 839 - .../src/modules/courses/new/CoursesNew.js | 1054 - .../src/modules/courses/new/Goldsubject.js | 1114 - .../src/modules/courses/ordering/Ordering.css | 109 - .../src/modules/courses/ordering/Ordering.js | 297 - public/react/src/modules/courses/poll/Poll.js | 621 - .../modules/courses/poll/PollDetailIndex.js | 288 - .../courses/poll/PollDetailTabFirst.js | 414 - .../courses/poll/PollDetailTabForth.js | 681 - .../courses/poll/PollDetailTabForthRules.js | 534 - .../courses/poll/PollDetailTabSecond.js | 197 - .../courses/poll/PollDetailTabThird.js | 58 - .../courses/poll/PollDetailTabThirdInfo.js | 138 - .../src/modules/courses/poll/PollInfo.js | 519 - .../src/modules/courses/poll/PollListItem.js | 133 - .../react/src/modules/courses/poll/PollNew.js | 3960 ---- .../modules/courses/poll/PollNewQuestbank.js | 4312 ---- .../poll/pollPublicBtn/CancelPublish.js | 205 - .../poll/pollPublicBtn/ImmediatelyEnd.js | 269 - .../poll/pollPublicBtn/ImmediatelyPublish.js | 406 - .../src/modules/courses/poll/pollStyle.css | 382 - .../src/modules/courses/polldepoly/Index.js | 43 - .../modules/courses/polldepoly/pollmount.js | 157 - .../src/modules/courses/publicNav/listNav.js | 111 - .../src/modules/courses/publicNav/nav.css | 53 - .../courses/questionbank/Generaljobanswer.js | 140 - .../questionbank/Generaljobbankdetails.js | 170 - .../courses/questionbank/Generaljobdetails.js | 117 - .../courses/questionbank/questionbank.css | 33 - .../courses/shixunHomework/Challenges.css | 29 - .../courses/shixunHomework/CommitSummary.js | 225 - .../modules/courses/shixunHomework/Guide.js | 139 - .../shixunHomework/Homeworddescription.js | 156 - .../shixunHomework/Listofworksstudentone.js | 4319 ---- .../shixunHomework/ShixunHomeworkPage.js | 421 - .../shixunHomework/ShixunStudentWork.js | 1060 - .../shixunHomework/ShixunWorkDetails.js | 305 - .../shixunHomework/ShixunWorkReport.js | 665 - .../shixunHomework/ShixunhomeWorkItem.js | 531 - .../Shixunworkdetails/ShixunCustomsPass.js | 343 - .../Shixunworkdetails/ShixunWorkModal.js | 353 - .../shixunHomework/ShowAppraiseList.js | 176 - .../TraineetraininginformationModal.js | 397 - .../shixunHomework/Trainingjobsetting.js | 2994 --- .../shixunHomework/Workquestionandanswer.js | 682 - .../modules/courses/shixunHomework/guide.css | 518 - .../courses/shixunHomework/shixunHomework.js | 1386 -- .../shixunreport/ConclusionEvaluation.js | 169 - .../shixunreport/Coursesshixundetails.js | 74 - .../OfficialAcademicTranscript.js | 349 - .../shixunreport/Shixunechart.js | 434 - .../modules/courses/shixunHomework/style.css | 137 - .../modules/courses/statistics/Dropdownbox.js | 128 - .../modules/courses/statistics/Dynamiclist.js | 90 - .../modules/courses/statistics/Statistics.css | 148 - .../modules/courses/statistics/Statistics.js | 662 - .../courses/studentWork/CommitSummaryIndex.js | 53 - .../courses/studentWork/StudentHomework.js | 246 - .../src/modules/courses/user’s_manual.txt | 14 - .../src/modules/developer/DeveloperHome.js | 589 - .../components/controlSetting/index.js | 191 - .../components/controlSetting/index.scss | 146 - .../developer/components/errorResult/index.js | 88 - .../components/errorResult/index.scss | 11 - .../developer/components/execResult/index.js | 156 - .../components/execResult/index.scss | 47 - .../developer/components/initTabCtx/index.js | 100 - .../components/initTabCtx/index.scss | 58 - .../developer/components/initTabCtx/index1.js | 127 - .../developer/components/knowledge/index.js | 194 - .../developer/components/knowledge/index.scss | 56 - .../components/monacoSetting/index.js | 108 - .../developer/components/multiptags/index.js | 36 - .../components/multiptags/index.scss | 79 - .../components/myMonacoEditor/index.js | 223 - .../components/myMonacoEditor/index.scss | 96 - .../components/myMonacoEditor/index2.js | 48 - .../developer/components/textNumber/index.js | 81 - .../components/textNumber/index.scss | 43 - .../developer/components/userInfo/index.js | 28 - .../developer/components/userInfo/index.scss | 26 - public/react/src/modules/developer/index.js | 19 - public/react/src/modules/developer/index.scss | 88 - .../modules/developer/newOrEditTask/index.js | 287 - .../developer/newOrEditTask/index.scss | 32 - .../newOrEditTask/leftpane/commitTab/index.js | 14 - .../leftpane/editorTab/AddTestDemo.js | 203 - .../newOrEditTask/leftpane/editorTab/index.js | 544 - .../leftpane/editorTab/index.scss | 109 - .../leftpane/editorTab/index2.js | 334 - .../developer/newOrEditTask/leftpane/index.js | 68 - .../newOrEditTask/leftpane/index.scss | 1 - .../newOrEditTask/leftpane/prevTab/index.js | 61 - .../newOrEditTask/leftpane/prevTab/index.scss | 17 - .../newOrEditTask/rightpane/index.js | 80 - .../newOrEditTask/rightpane/index.scss | 140 - .../rightpane/initTabCtx/index.js | 127 - .../rightpane/initTabCtx/index.scss | 50 - .../newOrEditTask/rightpane/settingDrawer.js | 72 - .../modules/developer/quillEditor/README.md | 183 - .../modules/developer/quillEditor/index.js | 134 - .../modules/developer/quillEditor/index.scss | 0 .../modules/developer/recordDetail/index.js | 164 - .../modules/developer/recordDetail/index.scss | 55 - .../modules/developer/split_pane_resizer.scss | 258 - .../modules/developer/studentStudy/index.js | 193 - .../modules/developer/studentStudy/index.scss | 56 - .../studentStudy/leftpane/comment/index.js | 149 - .../studentStudy/leftpane/comment/index.scss | 16 - .../leftpane/commitRecord/index.js | 288 - .../leftpane/commitRecord/index.scss | 70 - .../developer/studentStudy/leftpane/index.js | 164 - .../studentStudy/leftpane/index.scss | 118 - .../leftpane/taskDescription/index.js | 64 - .../developer/studentStudy/rightpane/index.js | 220 - .../CourseSupports/ecCourseSupports.css | 364 - .../ecs/EcSetting/CourseSupports/index.js | 802 - .../EcSetting/GraduationRequirement/index.js | 385 - .../GraduationRequirement/index.scss | 94 - .../RequirementVsObjective/SelectTable.js | 124 - .../EcSetting/RequirementVsObjective/index.js | 163 - .../EcSetting/RequirementVsStandard/index.js | 134 - .../ecs/EcSetting/TrainingObjective/index.js | 265 - .../EcSetting/TrainingObjective/index.scss | 99 - .../react/src/modules/ecs/EcSetting/index.js | 178 - .../src/modules/ecs/EcSetting/index.scss | 62 - .../EcSetting/reachCalculationInfo/index.js | 724 - .../EcSetting/reachCalculationInfo/index.scss | 77 - .../src/modules/ecs/EcYear/AddYearModal.js | 108 - .../src/modules/ecs/EcYear/AddYearModal.scss | 34 - public/react/src/modules/ecs/EcYear/index.js | 218 - .../react/src/modules/ecs/EcYear/index.scss | 62 - public/react/src/modules/ecs/Ecs.js | 82 - .../src/modules/ecs/Home/AddMajorModal.js | 179 - .../src/modules/ecs/Home/AddMajorModal.scss | 29 - .../src/modules/ecs/Home/AddManagerModal.js | 226 - .../src/modules/ecs/Home/AddManagerModal.scss | 35 - .../src/modules/ecs/Home/MajorManager.js | 60 - public/react/src/modules/ecs/Home/index.js | 265 - public/react/src/modules/ecs/Home/index.scss | 127 - .../src/modules/ecs/common/ECModalHOC.js | 91 - public/react/src/modules/ecs/css/ec.css | 27 - .../modules/ecs/css/ecCourseEvaluations.css | 603 - .../src/modules/ecs/css/ecCourseSupports.css | 372 - public/react/src/modules/ecs/css/search.svg | 1 - .../src/modules/ecs/curriculum/Curriculum.js | 260 - .../ecs/curriculum/CurriculumSubpage.js | 35 - .../modules/ecs/curriculum/Curriculumtwo.js | 293 - .../react/src/modules/ecs/ecTitle/ecTitle.css | 104 - .../react/src/modules/ecs/ecTitle/ecTitle.js | 100 - .../react/src/modules/ecs/ecTitle/img/1.png | Bin 1618 -> 0 bytes .../react/src/modules/ecs/ecTitle/img/2.png | Bin 2093 -> 0 bytes .../react/src/modules/ecs/ecTitle/img/3.png | Bin 2030 -> 0 bytes .../react/src/modules/ecs/ecTitle/img/4.png | Bin 1589 -> 0 bytes .../EcCompletionCalculation.js | 930 - .../EcCourseEvaluationsbottom.js | 1049 - .../ecCourseEvaluations/eccourseevalut.css | 8 - .../EditableCourseSupportSetting.js | 476 - .../ShowTableCourseSupportSetting.js | 150 - .../subroute/ecCourseSupportSetting/index.js | 294 - .../ecCourseSupportSetting/style.scss | 44 - .../subroute/ecStudentList/EcStudentList.js | 489 - .../subroute/ecStudentList/ecStudentList.css | 43 - .../ecs/subroute/ecStudentList/nodata.png | Bin 14616 -> 0 bytes .../react/src/modules/forums/ForumsIndex.css | 69 - .../react/src/modules/forums/ForumsIndex.js | 266 - .../react/src/modules/forums/ForumsNavTab.js | 106 - public/react/src/modules/forums/MemoDetail.js | 861 - .../src/modules/forums/MemoDetailEditor.css | 25 - .../src/modules/forums/MemoDetailKEEditor.js | 66 - .../src/modules/forums/MemoDetailMDEditor.js | 219 - .../modules/forums/MemoDetailMDEditortwo.js | 173 - public/react/src/modules/forums/MemoList.js | 60 - .../react/src/modules/forums/MemoMyPublish.js | 73 - public/react/src/modules/forums/MemoNew.js | 856 - .../react/src/modules/forums/MemoOldGuide.js | 65 - .../src/modules/forums/MemoOldHottest.js | 84 - .../react/src/modules/forums/MemoOldNewest.js | 63 - .../react/src/modules/forums/MemoTechShare.js | 116 - public/react/src/modules/forums/Post.css | 224 - public/react/src/modules/forums/PostItem.js | 110 - .../src/modules/forums/PostPaginationHOC.js | 352 - .../src/modules/forums/RecommendShixun.js | 62 - .../react/src/modules/forums/RightHotLabel.js | 56 - .../src/modules/forums/RightHotQuestion.js | 53 - .../src/modules/forums/RightMemoLabel.js | 47 - .../src/modules/forums/RightMyPublish.js | 75 - .../react/src/modules/forums/RightSection.css | 61 - .../react/src/modules/forums/UserSection.js | 87 - .../src/modules/forums/shixun/MemoShixun.css | 21 - .../src/modules/forums/shixun/MemoShixun.js | 226 - .../modules/forums/shixun/ShiXunPostItem.js | 69 - public/react/src/modules/help/AboutUs.js | 54 - public/react/src/modules/help/Agreement.js | 54 - public/react/src/modules/help/ContactUs.css | 24 - public/react/src/modules/help/ContactUs.js | 89 - .../react/src/modules/help/Cooperatives.css | 17 - public/react/src/modules/help/Cooperatives.js | 82 - public/react/src/modules/help/Feedback.css | 7 - public/react/src/modules/help/Feedback.js | 51 - public/react/src/modules/help/FeedbackForm.js | 87 - public/react/src/modules/help/Help.css | 9 - public/react/src/modules/help/Help.js | 76 - public/react/src/modules/help/HelpCenter.js | 54 - public/react/src/modules/home/home.css | 79 - public/react/src/modules/home/shixunsHome.js | 610 - public/react/src/modules/home/tag2.png | Bin 1170 -> 0 bytes .../src/modules/login/EducoderInteresse.js | 92 - .../react/src/modules/login/EducoderLogin.js | 221 - public/react/src/modules/login/EducoderReg.js | 51 - .../react/src/modules/login/LoginDialog.css | 161 - public/react/src/modules/login/LoginDialog.js | 785 - public/react/src/modules/login/Loginqq.js | 292 - public/react/src/modules/login/Otherlogin.css | 54 - public/react/src/modules/login/Otherlogin.js | 273 - .../react/src/modules/login/Otherloginqq.js | 59 - .../src/modules/login/Otherloginstart.js | 68 - .../src/modules/login/Trialapplication.js | 727 - .../src/modules/login/Trialapplicationysl.js | 745 - public/react/src/modules/login/WeChat.png | Bin 2844 -> 0 bytes public/react/src/modules/login/WeChat@2x.png | Bin 8077 -> 0 bytes public/react/src/modules/login/qq.png | Bin 2702 -> 0 bytes public/react/src/modules/login/qq@2x.png | Bin 7663 -> 0 bytes .../src/modules/message/css/messagemy.css | 113 - .../src/modules/message/js/Leftdialogue.js | 67 - .../src/modules/message/js/MessagChat.js | 720 - .../react/src/modules/message/js/MessagSub.js | 676 - .../src/modules/message/js/MessagePrivate.js | 220 - .../src/modules/message/js/Messagerouting.js | 260 - .../src/modules/message/js/Rightdialogue.js | 67 - .../messagemodal/WriteaprivateletterModal.js | 357 - .../react/src/modules/modals/Bottomsubmit.js | 59 - .../modules/modals/Certifiedprofessional.js | 101 - .../src/modules/modals/DownloadMessage.js | 100 - .../src/modules/modals/DownloadMessageysl.js | 50 - .../react/src/modules/modals/Jointheclass.js | 69 - public/react/src/modules/modals/Modals.js | 64 - public/react/src/modules/modals/SendTopics.js | 236 - .../react/src/modules/modals/UpgradeModals.js | 82 - .../src/modules/modals/WordNumberTextarea.css | 38 - .../src/modules/modals/WordNumberTextarea.js | 23 - public/react/src/modules/modals/certfed.css | 44 - .../src/modules/moop_cases/CaseDetail.js | 172 - .../react/src/modules/moop_cases/CaseItem.js | 59 - .../react/src/modules/moop_cases/CaseList.js | 171 - .../react/src/modules/moop_cases/CaseNew.js | 475 - .../react/src/modules/moop_cases/CaseTags.js | 37 - .../react/src/modules/moop_cases/Success.js | 28 - .../src/modules/moop_cases/css/moopCases.css | 178 - public/react/src/modules/moop_cases/index.js | 134 - .../src/modules/osshackathon/Osshackathon.css | 156 - .../src/modules/osshackathon/Osshackathon.js | 451 - .../modules/osshackathon/Osshackathonmd.js | 112 - .../modules/osshackathon/Osshackathonmodel.js | 217 - public/react/src/modules/page/Header.js | 138 - public/react/src/modules/page/Index.js | 292 - public/react/src/modules/page/IndexWrapper.js | 21 - public/react/src/modules/page/LeftNav.js | 73 - public/react/src/modules/page/MainContent.js | 220 - .../src/modules/page/MainContentContainer.js | 1004 - public/react/src/modules/page/VNC.css | 132 - public/react/src/modules/page/VNCContainer.js | 456 - public/react/src/modules/page/VNCDisplay.js | 181 - .../modules/page/component/CheckBoxGroup.js | 71 - .../page/component/ChooseAnswerView.js | 43 - .../src/modules/page/component/FloatButton.js | 24 - .../page/component/MUIDialogStyleUtil.js | 38 - .../modules/page/component/SecondDrawer.js | 101 - .../modules/page/component/TPICodeMirror.css | 80 - .../modules/page/component/TPICodeMirror.js | 533 - .../modules/page/component/TPICodeSetting.js | 215 - .../modules/page/component/UpdateDrawer.css | 9 - .../modules/page/component/UpdateDrawer.js | 227 - .../modules/page/component/WebSSHTimer.css | 9 - .../src/modules/page/component/WebSSHTimer.js | 353 - .../page/component/monaco/TPIMonaco.css | 160 - .../page/component/monaco/TPIMonaco.js | 558 - .../page/component/monaco/TPIMonacoConfig.js | 132 - .../modules/page/component/repo/RepoTree.js | 66 - public/react/src/modules/page/header.scss | 6 - .../src/modules/page/images/float_switch.jpg | Bin 1003 -> 0 bytes .../modules/page/images/test/float_switch.jpg | Bin 1303 -> 0 bytes .../src/modules/page/layers/ImageLayer.js | 34 - .../page/layers/ImageLayerOfCommentHOC.js | 90 - .../modules/page/layers/TaskResultLayer.css | 140 - .../modules/page/layers/TaskResultLayer.js | 247 - .../src/modules/page/main/ActionView.css | 42 - .../react/src/modules/page/main/ActionView.js | 206 - .../modules/page/main/ChooseEvaluateView.js | 162 - .../page/main/ChooseEvaluateViewnew.css | 3 - .../page/main/ChooseRepositoryView.css | 21 - .../modules/page/main/ChooseRepositoryView.js | 251 - .../src/modules/page/main/ChooseView.css | 43 - .../CodeEvaluateMultiLevelAnswerUnlock.js | 101 - .../modules/page/main/CodeEvaluateView.css | 141 - .../src/modules/page/main/CodeEvaluateView.js | 438 - .../modules/page/main/CodeRepositoryView.css | 154 - .../modules/page/main/CodeRepositoryView.js | 566 - .../page/main/CodeRepositoryViewContainer.js | 355 - .../react/src/modules/page/main/LeftView.js | 368 - .../modules/page/main/LeftViewContainer.js | 592 - public/react/src/modules/page/main/Webssh.js | 76 - .../modules/page/main/answer/AnswerList.js | 70 - .../page/main/answer/AnswerListContainer.js | 14 - .../react/src/modules/page/main/leftView.css | 123 - public/react/src/modules/page/readme.txt | 228 - .../src/modules/page/taskList/TaskList.css | 123 - .../src/modules/page/taskList/TaskList.js | 140 - .../page/taskList/TaskListContainer.js | 23 - public/react/src/modules/page/tpiPage.css | 407 - .../src/modules/page/tpiPageForMobile.css | 30 - public/react/src/modules/paths/Index.js | 64 - .../paths/NewStatistics/NewStatistics.js | 36 - .../modules/paths/PathDetail/Addshixuns.js | 122 - .../modules/paths/PathDetail/DetailCards.js | 686 - .../paths/PathDetail/DetailCardsEditAndAdd.js | 770 - .../PathDetail/DetailCardsEditAndEdit.js | 813 - .../paths/PathDetail/DetailCardsTemp.js | 174 - .../modules/paths/PathDetail/DetailTop.css | 88 - .../src/modules/paths/PathDetail/DetailTop.js | 881 - .../modules/paths/PathDetail/Modifytext.js | 185 - .../modules/paths/PathDetail/OpenCourse.js | 100 - .../paths/PathDetail/PathDetailIndex.js | 801 - .../paths/PathDetail/addCollaborators.js | 233 - .../src/modules/paths/PathDetail/sendPanel.js | 274 - public/react/src/modules/paths/PathNew.js | 246 - .../paths/SchoolStatistics/FirstTab.js | 212 - .../paths/SchoolStatistics/SecondTab.js | 291 - .../paths/SchoolStatistics/Statistics.js | 82 - .../paths/SchoolStatistics/ThirdTab.js | 247 - .../react/src/modules/paths/ShixunPathCard.js | 89 - .../src/modules/paths/ShixunPathSearch.js | 231 - .../react/src/modules/paths/ShixunPaths.css | 274 - public/react/src/modules/paths/ShixunPaths.js | 29 - .../modules/paths/statics/DisplayTableData.js | 80 - .../paths/statics/StaticNumberAndTxt.js | 43 - .../react/src/modules/paths/statics/index.js | 351 - .../src/modules/paths/statics/index.scss | 156 - .../src/modules/paths/statics/mockData.js | 99 - .../src/modules/projectPackages/MDEditors.js | 337 - .../PackageIndex/PackageBanner.js | 25 - .../PackageIndex/PackageConcent.js | 374 - .../PackageIndex/PackageIndex.js | 30 - .../NEITaskDetailsModel.js | 41 - .../PackageIndexNEITaskDetails.js | 492 - .../img/gouxuan.png | Bin 305 -> 0 bytes .../img/weigouxuan.png | Bin 281 -> 0 bytes .../PackageIndexNEITaskDetails/newsone.png | Bin 341 -> 0 bytes .../PackageIndexNEITaskDetails/newstwo.png | Bin 288 -> 0 bytes .../PackageIndexNEITaskDetails/pds.css | 57 - .../PackageIndexNEIBanner.js | 41 - .../PackageIndexNEIBannerConcent.js | 954 - .../PackageIndexNEISubmit.js | 49 - .../PackageIndexNewandEditIndex.js | 69 - .../PackageIndexNewandEdit/PhoneModel.js | 140 - .../projectPackages/ProjectPackageIndex.js | 76 - .../projectPackages/packageconcnet.css | 369 - .../src/modules/question/NewMyShixunModel.js | 970 - .../react/src/modules/question/Paperreview.js | 463 - .../src/modules/question/Paperreview_item.js | 850 - .../src/modules/question/Paperreview_items.js | 98 - .../modules/question/Paperreview_judgment.js | 112 - .../modules/question/Paperreview_multlple.js | 112 - .../modules/question/Paperreview_program.js | 112 - .../modules/question/Paperreview_single.js | 264 - public/react/src/modules/question/Question.js | 1088 - .../modules/question/Questionitem_banks.js | 590 - .../modules/question/animation/parabola.js | 51 - .../question/component/Choicequestion.js | 51 - .../question/component/ChoquesEditor.js | 468 - .../modules/question/component/Contentpart.js | 354 - .../question/component/Contentquestionbank.js | 77 - .../question/component/Headplugselection.js | 277 - .../question/component/Headplugselections.js | 339 - .../question/component/IntelligentModel.js | 221 - .../question/component/Itembankstop.js | 874 - .../question/component/JudquestionEditor.js | 450 - .../modules/question/component/Listjihe.js | 468 - .../question/component/Newknledpots.js | 75 - .../modules/question/component/NoneData.js | 37 - .../modules/question/component/NoneDatas.js | 36 - .../question/component/PaperDeletModel.js | 44 - .../question/component/PaperDeletModels.js | 43 - .../component/Paperreview_itemModel.js | 67 - .../component/Paperreview_itemModels.js | 68 - .../question/component/QuestionModal.js | 43 - .../question/component/QuestionModals.js | 66 - .../modules/question/component/SiderBars.js | 185 - .../question/component/SingleEditor.js | 500 - .../comthetestpaper/Comthetestpaperst.js | 889 - .../comthetestpaper/Intelligentcomponents.js | 831 - .../comthetestpaper/lntlligentpone.js | 169 - .../question/questioncss/questioncom.css | 1068 - public/react/src/modules/test/ShareTest.js | 35 - public/react/src/modules/test/TestCrop.js | 25 - public/react/src/modules/test/TestRC.js | 144 - .../modules/test/codemirror/TestCodeMirror.js | 63 - .../src/modules/test/dnd/TestDragBeautiful.js | 110 - public/react/src/modules/test/index.js | 30 - .../src/modules/test/md/TestMaterialDesign.js | 195 - public/react/src/modules/test/md/ii_debug.js | 68 - public/react/src/modules/test/monaco/index.js | 17 - .../src/modules/test/urlquery/TestUrlQuery.js | 85 - .../src/modules/testpaper/Intecomponents.js | 418 - .../modules/testpaper/Paperlibraryeditid.js | 319 - .../modules/testpaper/Paperlibraryseeid.js | 185 - .../src/modules/testpaper/Testpaperlibrary.js | 484 - .../testpaper/component/Contentpart.js | 247 - .../component/Contentquestionbank.js | 68 - .../modules/testpaper/component/Listjihe.js | 159 - .../modules/testpaper/component/NoneData.js | 37 - .../modules/testpaper/component/NoneDatas.js | 36 - .../component/Paperlibraryseeid_item.js | 640 - .../component/Paperlibraryseeid_items.js | 256 - .../component/Paperlibraryseeid_itemss.js | 790 - .../component/Paperlibraryseeid_itemsss.js | 88 - .../testpaper/component/QuestionModal.js | 43 - .../testpaper/component/QuestionModals.js | 66 - .../testpaper/component/Seeoagertit.js | 56 - .../testpaper/component/Seeoagertits.js | 70 - .../testpaper/testioncss/testioncss.css | 929 - .../src/modules/topic_bank/Topic_bank.js | 51 - public/react/src/modules/tpm/1.js | 83 - .../modules/tpm/Audit_situationComponent.js | 261 - public/react/src/modules/tpm/NewFooter.js | 53 - public/react/src/modules/tpm/NewHeader.js | 1418 -- public/react/src/modules/tpm/SiderBar.js | 162 - public/react/src/modules/tpm/TPMBanner.js | 1415 -- public/react/src/modules/tpm/TPMChallenge.js | 63 - .../src/modules/tpm/TPMChallengeContainer.js | 37 - .../react/src/modules/tpm/TPMCollaborators.js | 54 - .../modules/tpm/TPMCollaboratorsContainer.js | 47 - public/react/src/modules/tpm/TPMDataset.js | 733 - .../src/modules/tpm/TPMFork/TPMForklist.js | 213 - .../modules/tpm/TPMFork/shixunCss/fork.css | 3 - .../modules/tpm/TPMFork/shixunCss/tag2.png | Bin 1170 -> 0 bytes .../src/modules/tpm/TPMFork_listContainer.js | 50 - public/react/src/modules/tpm/TPMForklist.js | 64 - public/react/src/modules/tpm/TPMIndex.css | 299 - public/react/src/modules/tpm/TPMIndex.js | 632 - public/react/src/modules/tpm/TPMIndexHOC.js | 852 - .../react/src/modules/tpm/TPMPropaedeutics.js | 75 - .../modules/tpm/TPMPropaedeuticsComponent.js | 40 - .../react/src/modules/tpm/TPMRanking_list.js | 60 - .../modules/tpm/TPMRanking_listContainer.js | 40 - public/react/src/modules/tpm/TPMRepository.js | 59 - .../src/modules/tpm/TPMRepositoryComponent.js | 230 - .../src/modules/tpm/TPMShixunDiscuss.css | 47 - .../react/src/modules/tpm/TPMShixunDiscuss.js | 73 - .../modules/tpm/TPMShixunDiscussContainer.js | 45 - .../TPMUpdatepropaede/TPMUpdatepropaede.js | 104 - .../modules/tpm/TPMsettings/Configuration.js | 450 - .../tpm/TPMsettings/LearningSettings.js | 349 - .../tpm/TPMsettings/Shixuninformation.js | 1330 -- .../modules/tpm/TPMsettings/TPMsettings.js | 233 - .../tpm/TPMsettings/css/TPMsettings.css | 153 - .../modules/tpm/TPMsettings/oldTPMsettings.js | 2437 -- public/react/src/modules/tpm/beian.png | Bin 19256 -> 0 bytes .../modules/tpm/challengesnew/TPMMDEditor.js | 355 - .../modules/tpm/challengesnew/TPManswer2.js | 353 - .../tpm/challengesnew/TPMchallengesnew.js | 774 - .../tpm/challengesnew/TPMevaluation.js | 1091 - .../modules/tpm/challengesnew/TPMquestion.js | 1052 - .../tpm/challengesnew/TpmQuestionEdit.js | 233 - .../tpm/challengesnew/TpmQuestionMain.js | 84 - .../tpm/challengesnew/TpmQuestionNew.js | 229 - .../tpm/challengesnew/TpmTask/TpmTaskIndex.js | 55 - .../challengesnew/css/TPMchallengesnew.css | 331 - .../tpm/challengesnew/css/newquestion.css | 7 - .../src/modules/tpm/challengesnew/editorMD.js | 122 - .../tpm/challengesnew/old/TPManswer.js | 367 - .../tpm/challengesnew/old/TPMchallengesnew.js | 617 - .../react/src/modules/tpm/component/TPMNav.js | 90 - .../modules/tpm/component/TPMRightSection.js | 279 - .../src/modules/tpm/component/TPMright.css | 135 - .../component/modal/RepositoryChooseModal.js | 153 - public/react/src/modules/tpm/jupyter/index.js | 520 - .../react/src/modules/tpm/jupyter/index.scss | 261 - .../src/modules/tpm/jupyter/leftPane/index.js | 88 - .../modules/tpm/jupyter/leftPane/index.scss | 73 - .../modules/tpm/jupyter/rightPane/index.js | 92 - .../modules/tpm/jupyter/rightPane/index.scss | 74 - .../src/modules/tpm/newshixuns/Newshixuns.js | 751 - .../src/modules/tpm/newshixuns/Shixunmd.js | 111 - .../newshixuns/TPMNewshixuns/TPMNewshixuns.js | 19 - .../modules/tpm/newshixuns/css/Newshixuns.css | 833 - .../modules/tpm/newshixuns/oldNewshixuns.js | 1356 -- .../src/modules/tpm/roundedRectangle.png | Bin 720 -> 0 bytes .../tpm/shixunchild/Challenges/Challenges.js | 829 - .../Challenges/Challengesjupyter.js | 862 - .../Collaborators/Collaborators.css | 200 - .../Collaborators/Collaborators.js | 769 - .../Propaedeutics/Propaedeu_tics.js | 126 - .../shixunchild/Ranking_list/Ranking_list.js | 145 - .../tpm/shixunchild/Repository/Repository.js | 266 - .../Repository/RepositoryAddFile.js | 201 - .../Repository/RepositoryCodeEditor.js | 185 - .../Repository/RepositoryCombinePath.js | 82 - .../Repository/RepositoryDirectories.js | 66 - .../Repository/TPMRepositoryCommits.js | 146 - .../ShixunDiscuss/ShixunDiscuss.js | 170 - .../tpm/shixunchild/Shixunfork_list.js | 69 - .../shixunchild/shixunchildCss/Challenges.css | 265 - .../shixunchildCss/Shixunfork_list.css | 6 - .../src/modules/tpm/shixuns/ShixunCard.js | 244 - .../src/modules/tpm/shixuns/ShixunCardList.js | 316 - .../modules/tpm/shixuns/ShixunSearchBar.js | 290 - .../src/modules/tpm/shixuns/ShixunsIndex.js | 430 - .../src/modules/tpm/shixuns/css/TPMBanner.css | 168 - .../tpm/shixuns/shixunCss/ShixunCardList.css | 13 - .../tpm/shixuns/shixunCss/ShixunSearchBar.css | 20 - .../tpm/shixuns/shixunCss/shixunCard.css | 42 - .../modules/tpm/shixuns/shixunCss/tag2.png | Bin 1170 -> 0 bytes .../shixuns/shixusFunction/ShixunSearchBar.js | 142 - .../modules/tpm/tpmmodel/Tpmdatasetmodel.js | 56 - .../react/src/modules/tpm/tpmmodel/common.css | 318 - .../src/modules/tpm/tpmmodel/tpmmodel.css | 140 - public/react/src/modules/user/AccountPage.js | 152 - .../src/modules/user/AccountPhoneemail.js | 79 - .../react/src/modules/user/AccountProfile.js | 85 - .../src/modules/user/Accountnewprofile.js | 71 - .../react/src/modules/user/CheckInputysl.js | 104 - .../src/modules/user/FindPasswordComponent.js | 824 - public/react/src/modules/user/Interestpage.js | 313 - .../react/src/modules/user/InterestpageMax.js | 311 - .../src/modules/user/LCCountDownButton.js | 205 - .../modules/user/LoginRegisterComponent.css | 0 .../modules/user/LoginRegisterComponent.js | 1308 -- .../src/modules/user/LoginRegisterPage.js | 30 - .../react/src/modules/user/MyEduCoderModal.js | 53 - public/react/src/modules/user/MyeducoderI.css | 3 - .../react/src/modules/user/Notcompletedysl.js | 79 - public/react/src/modules/user/ReadPassword.js | 43 - .../modules/user/Trialapplicationreview.js | 65 - .../src/modules/user/account/AccountBasic.js | 120 - .../modules/user/account/AccountBasicEdit.js | 696 - .../user/account/AccountBasicEditItem.js | 210 - .../modules/user/account/AccountBinding.js | 313 - .../user/account/AccountCertification.js | 171 - .../src/modules/user/account/AccountImg.js | 59 - .../src/modules/user/account/AccountNav.js | 124 - .../src/modules/user/account/AccountSecure.js | 508 - .../user/account/ChangeHeaderPicModal.js | 231 - .../react/src/modules/user/account/common.css | 119 - public/react/src/modules/user/common.css | 278 - public/react/src/modules/user/commontwo.css | 288 - public/react/src/modules/user/img/WeChat.png | Bin 2844 -> 0 bytes .../react/src/modules/user/img/WeChat@2x.png | Bin 8077 -> 0 bytes public/react/src/modules/user/img/gouxuan.png | Bin 462 -> 0 bytes public/react/src/modules/user/img/hdkf.png | Bin 2940 -> 0 bytes .../react/src/modules/user/img/meigouxuan.png | Bin 417 -> 0 bytes public/react/src/modules/user/img/mytc.png | Bin 11814 -> 0 bytes public/react/src/modules/user/img/qdkf.png | Bin 2840 -> 0 bytes public/react/src/modules/user/img/qita.png | Bin 2097 -> 0 bytes public/react/src/modules/user/img/qq.png | Bin 2702 -> 0 bytes public/react/src/modules/user/img/qq@2x.png | Bin 7663 -> 0 bytes public/react/src/modules/user/img/rgzn.png | Bin 2275 -> 0 bytes public/react/src/modules/user/img/sjk.png | Bin 3693 -> 0 bytes public/react/src/modules/user/img/skzbdx.png | Bin 11933 -> 0 bytes public/react/src/modules/user/img/ydkf.png | Bin 2523 -> 0 bytes public/react/src/modules/user/img/ysj.png | Bin 4031 -> 0 bytes public/react/src/modules/user/img/yunwei.png | Bin 3512 -> 0 bytes public/react/src/modules/user/img/zyrs1.png | Bin 9957 -> 0 bytes .../user/modal/ApplyForAddChildOrgModal.js | 137 - .../modules/user/modal/ApplyForAddOrgModal.js | 177 - .../user/modal/RealNameCertificationModal.js | 816 - public/react/src/modules/user/secureCode.css | 42 - .../react/src/modules/user/usersInfo/Infos.js | 332 - .../src/modules/user/usersInfo/InfosBank.js | 249 - .../src/modules/user/usersInfo/InfosBanner.js | 166 - .../src/modules/user/usersInfo/InfosCourse.js | 398 - .../src/modules/user/usersInfo/InfosIndex.js | 90 - .../modules/user/usersInfo/InfosPackage.js | 351 - .../src/modules/user/usersInfo/InfosPath.js | 387 - .../modules/user/usersInfo/InfosProject.js | 390 - .../src/modules/user/usersInfo/InfosShixun.js | 440 - .../src/modules/user/usersInfo/InfosTopics.js | 594 - .../user/usersInfo/Withoutpermission.png | Bin 8051 -> 0 bytes .../user/usersInfo/banks/BanksIndex.js | 258 - .../user/usersInfo/banks/BanksTabIndex.js | 90 - .../usersInfo/banks/ExerciseBanksDetail.js | 56 - .../user/usersInfo/banks/ExerciseBanksEdit.js | 71 - .../user/usersInfo/banks/GtaskBanksEdit.js | 99 - .../user/usersInfo/banks/GtopicBanks.js | 37 - .../user/usersInfo/banks/GtopicBanksEdit.js | 88 - .../user/usersInfo/banks/HomeworkBanksEdit.js | 103 - .../user/usersInfo/banks/NewGtaskForm.js | 358 - .../user/usersInfo/banks/PollBanksContent.js | 78 - .../modules/user/usersInfo/banks/banksMenu.js | 201 - .../src/modules/user/usersInfo/banner_out.js | 190 - .../user/usersInfo/common/CRoundSelect.js | 96 - .../user/usersInfo/common/HeadlessModal.js | 57 - .../modules/user/usersInfo/common/InfoTab.js | 44 - .../modules/user/usersInfo/publicCreatNew.js | 86 - .../src/modules/user/usersInfo/usersInfo.css | 459 - .../usersInfo/video/AliyunUploaderManager.js | 188 - .../user/usersInfo/video/EditVideoModal.js | 101 - .../user/usersInfo/video/InfosVideo.css | 145 - .../user/usersInfo/video/InfosVideo.js | 455 - .../user/usersInfo/video/VideoInReviewItem.js | 103 - .../modules/user/usersInfo/video/VideoItem.js | 0 .../user/usersInfo/video/VideoProtocol.js | 185 - .../usersInfo/video/VideoPublishSuccess.js | 73 - .../user/usersInfo/video/VideoReducer.js | 68 - .../user/usersInfo/video/VideoUpload.js | 62 - .../user/usersInfo/video/VideoUploadList.js | 497 - .../modules/user/usersInfo/video/VideoUtil.js | 13 - .../user/usersInfo/video/images/ok_border.png | Bin 491 -> 0 bytes .../user/usersInfo/video/images/play.png | Bin 413 -> 0 bytes .../user/usersInfo/video/images/upload.png | Bin 337 -> 0 bytes .../usersInfo/video/images/upload_hover.png | Bin 486 -> 0 bytes public/react/src/modules/wxcode/index.js | 381 - public/react/src/modules/wxcode/index.scss | 367 - public/react/src/public-path.js | 6 - public/react/src/redux/README.md | 128 - public/react/src/redux/actions/actionTypes.js | 107 - public/react/src/redux/actions/comment.js | 140 - public/react/src/redux/actions/common.js | 49 - public/react/src/redux/actions/index.js | 217 - public/react/src/redux/actions/jupyter.js | 284 - public/react/src/redux/actions/ojForUser.js | 541 - public/react/src/redux/actions/ojForm.js | 765 - public/react/src/redux/actions/ojList.js | 49 - public/react/src/redux/actions/static.js | 41 - public/react/src/redux/actions/testAction.js | 7 - public/react/src/redux/actions/tpi.js | 23 - public/react/src/redux/actions/user.js | 27 - public/react/src/redux/actions/wxCode.js | 247 - .../src/redux/reducers/commentReducer.js | 51 - .../react/src/redux/reducers/commonReducer.js | 78 - public/react/src/redux/reducers/index.js | 34 - .../src/redux/reducers/jupyterReducer.js | 75 - .../src/redux/reducers/ojForUserReducer.js | 243 - .../react/src/redux/reducers/ojFormReducer.js | 363 - .../react/src/redux/reducers/ojListReducer.js | 40 - .../react/src/redux/reducers/staticReducer.js | 69 - .../react/src/redux/reducers/testReducer.js | 30 - public/react/src/redux/reducers/tpiReducer.js | 36 - .../react/src/redux/reducers/userReducer.js | 31 - .../react/src/redux/reducers/wxcodeReducer.js | 85 - .../react/src/redux/stores/configureStore.js | 18 - public/react/src/registerServiceWorker.js | 117 - public/react/src/search/SearchPage.js | 407 - public/react/src/search/searchc.css | 190 - public/react/src/services/commentService.js | 45 - public/react/src/services/jupyterServer.js | 54 - public/react/src/services/ojService.js | 157 - public/react/src/services/staticService.js | 14 - public/react/src/services/wxcodeService.js | 75 - 1230 files changed, 1 insertion(+), 296074 deletions(-) delete mode 100644 public/quill/quill.bubble.css delete mode 100644 public/quill/quill.js delete mode 100644 public/quill/quill.min.js delete mode 100644 public/quill/quill.snow.css delete mode 100644 public/react/LICENSE delete mode 100644 public/react/add.txt create mode 160000 public/react/build delete mode 100644 public/react/config/env.js delete mode 100644 public/react/config/jest/cssTransform.js delete mode 100644 public/react/config/jest/fileTransform.js delete mode 100644 public/react/config/paths.js delete mode 100644 public/react/config/polyfills.js delete mode 100644 public/react/config/webpack.config.dev.js delete mode 100644 public/react/config/webpack.config.prod.js delete mode 100644 public/react/config/webpackDevServer.config.js delete mode 100644 public/react/index.js delete mode 100644 public/react/package-lock.json delete mode 100644 public/react/package.json delete mode 100644 public/react/readme.txt delete mode 100644 public/react/scripts/build.js delete mode 100644 public/react/scripts/concat.js delete mode 100644 public/react/scripts/fileContentReplace.js delete mode 100644 public/react/scripts/readme-cdn.txt delete mode 100644 public/react/scripts/start.js delete mode 100644 public/react/scripts/test.js delete mode 100644 public/react/src/App.css delete mode 100644 public/react/src/App.js delete mode 100644 public/react/src/App.test.js delete mode 100644 public/react/src/AppConfig.js delete mode 100644 public/react/src/CustomLoadable.js delete mode 100644 public/react/src/Loading.js delete mode 100644 public/react/src/NotFoundPage.js delete mode 100644 public/react/src/college/College.js delete mode 100644 public/react/src/college/colleagechart/Colleagechart.js delete mode 100644 public/react/src/college/colleagechart/Colleagechartzu.js delete mode 100644 public/react/src/college/colleagecss/colleage.css delete mode 100644 public/react/src/common/Component.js delete mode 100644 public/react/src/common/Const.js delete mode 100644 public/react/src/common/DateUtil.js delete mode 100644 public/react/src/common/Env.js delete mode 100644 public/react/src/common/EventUtil.js delete mode 100644 public/react/src/common/IEVersion.js delete mode 100644 public/react/src/common/LoadingSpin.js delete mode 100644 public/react/src/common/LogUtil.js delete mode 100644 public/react/src/common/RouterUtil.js delete mode 100644 public/react/src/common/ShowSpin.js delete mode 100644 public/react/src/common/SnackbarHOC.js delete mode 100644 public/react/src/common/Store.js delete mode 100644 public/react/src/common/TextUtil.js delete mode 100644 public/react/src/common/UnitUtil.js delete mode 100644 public/react/src/common/UrlTool.js delete mode 100644 public/react/src/common/UrlTool2.js delete mode 100644 public/react/src/common/components/ConditionToolTip.js delete mode 100644 public/react/src/common/components/Cropper.js delete mode 100644 public/react/src/common/components/DragValidator.js delete mode 100644 public/react/src/common/components/LinkAfterLogin.js delete mode 100644 public/react/src/common/components/ModalConfirm.js delete mode 100644 public/react/src/common/components/ModalHOC.js delete mode 100644 public/react/src/common/components/MyIcon.js delete mode 100644 public/react/src/common/components/Notcompleted.js delete mode 100644 public/react/src/common/components/SetAppModel.js delete mode 100644 public/react/src/common/components/attachment/AttachmentList.js delete mode 100644 public/react/src/common/components/comment/CommentForm.js delete mode 100644 public/react/src/common/components/comment/CommentIcon.js delete mode 100644 public/react/src/common/components/comment/CommentItem.js delete mode 100644 public/react/src/common/components/comment/CommentList.js delete mode 100644 public/react/src/common/components/comment/index.js delete mode 100644 public/react/src/common/components/comment/index.scss delete mode 100644 public/react/src/common/components/comment/util.js delete mode 100644 public/react/src/common/components/form/City.js delete mode 100644 public/react/src/common/components/instruction/PopInstruction.js delete mode 100644 public/react/src/common/components/markdown/DMDEditor.css delete mode 100644 public/react/src/common/components/markdown/DMDEditor.js delete mode 100644 public/react/src/common/components/markdown/MarkdownToHtml.css delete mode 100644 public/react/src/common/components/markdown/MarkdownToHtml.js delete mode 100644 public/react/src/common/components/media/AliyunUploader.js delete mode 100644 public/react/src/common/components/media/AliyunUploaderDemo.js delete mode 100644 public/react/src/common/components/media/Clappr.js delete mode 100644 public/react/src/common/context/ThemeContext.js delete mode 100644 public/react/src/common/course/ActionBtn.js delete mode 100644 public/react/src/common/course/WordsBtn.js delete mode 100644 public/react/src/common/educoder.js delete mode 100644 public/react/src/common/hooks/ImageLayer2.js delete mode 100644 public/react/src/common/quillForEditor/FillBlot.js delete mode 100644 public/react/src/common/quillForEditor/ImageBlot.js delete mode 100644 public/react/src/common/quillForEditor/README.md delete mode 100644 public/react/src/common/quillForEditor/deepEqual.js delete mode 100644 public/react/src/common/quillForEditor/index.js delete mode 100644 public/react/src/common/quillForEditor/index.scss delete mode 100644 public/react/src/common/reactQuill/ImageBlot.js delete mode 100644 public/react/src/common/reactQuill/ReactQuill.js delete mode 100644 public/react/src/common/reactQuill/deepEqual.js delete mode 100644 public/react/src/common/reactQuill/flatten.js delete mode 100644 public/react/src/common/reactQuill/index.js delete mode 100644 public/react/src/common/reactQuill/index.scss delete mode 100644 public/react/src/common/reactQuill/lib.js delete mode 100644 public/react/src/common/reactQuill/useDeepEqualMemo.js delete mode 100644 public/react/src/common/reactQuill/useMountQuill.js delete mode 100644 public/react/src/common/reactQuill/useQuill.js delete mode 100644 public/react/src/common/reactQuill/useQuillOnChange.js delete mode 100644 public/react/src/common/reactQuill/useQuillPlaceholder.js delete mode 100644 public/react/src/common/reactQuill/useQuillValueSync.js delete mode 100644 public/react/src/common/util/ShareUtil.js delete mode 100644 public/react/src/constants/index.js delete mode 100644 public/react/src/context/EffectDisplayContent.js delete mode 100644 public/react/src/context/EvaluateSuccessEffectDisplay.js delete mode 100644 public/react/src/context/TPIContext.js delete mode 100644 public/react/src/context/TPIContextProvider.js delete mode 100644 public/react/src/forge/Activity/Activity.js delete mode 100644 public/react/src/forge/Activity/ActivityItem.js delete mode 100644 public/react/src/forge/Activity/activity.css delete mode 100644 public/react/src/forge/Branch/CloneAddress.js delete mode 100644 public/react/src/forge/Branch/SelectBranch.js delete mode 100644 public/react/src/forge/Branch/branch.css delete mode 100644 public/react/src/forge/Images/1.png delete mode 100644 public/react/src/forge/Images/2.png delete mode 100644 public/react/src/forge/Images/3.png delete mode 100644 public/react/src/forge/Images/4.png delete mode 100644 public/react/src/forge/Images/5.png delete mode 100644 public/react/src/forge/Images/6.png delete mode 100644 public/react/src/forge/Images/7.png delete mode 100644 public/react/src/forge/Images/array.png delete mode 100644 public/react/src/forge/Images/banner_list.png delete mode 100644 public/react/src/forge/Images/banner_sub.png delete mode 100644 public/react/src/forge/Images/banner_team.png delete mode 100644 public/react/src/forge/Images/dir.png delete mode 100644 public/react/src/forge/Images/focus.png delete mode 100644 public/react/src/forge/Images/focused.png delete mode 100644 public/react/src/forge/Images/fork.png delete mode 100644 public/react/src/forge/Images/item.png delete mode 100644 public/react/src/forge/Images/new.png delete mode 100644 public/react/src/forge/Images/parise.png delete mode 100644 public/react/src/forge/Images/parised.png delete mode 100644 public/react/src/forge/Images/type.png delete mode 100644 public/react/src/forge/Index.js delete mode 100644 public/react/src/forge/Main/CoderRootBranch.js delete mode 100644 public/react/src/forge/Main/CoderRootCommit.js delete mode 100644 public/react/src/forge/Main/CoderRootDirectory.js delete mode 100644 public/react/src/forge/Main/CoderRootFileDetail.js delete mode 100644 public/react/src/forge/Main/CoderRootIndex.js delete mode 100644 public/react/src/forge/Main/Detail.js delete mode 100644 public/react/src/forge/Main/DetailTop.js delete mode 100644 public/react/src/forge/Main/Index.js delete mode 100644 public/react/src/forge/Main/IndexItem.js delete mode 100644 public/react/src/forge/Main/NullData.js delete mode 100644 public/react/src/forge/Main/RootTable.js delete mode 100644 public/react/src/forge/Main/list.css delete mode 100644 public/react/src/forge/Merge/MergeDetail.js delete mode 100644 public/react/src/forge/Merge/MergeItem.js delete mode 100644 public/react/src/forge/Merge/MergeSubmit.js delete mode 100644 public/react/src/forge/Merge/MessageCount.js delete mode 100644 public/react/src/forge/Merge/NewMerge.js delete mode 100644 public/react/src/forge/Merge/UpdateMerge.js delete mode 100644 public/react/src/forge/Merge/merge.css delete mode 100644 public/react/src/forge/Merge/merge.js delete mode 100644 public/react/src/forge/New/Index.js delete mode 100644 public/react/src/forge/New/new.css delete mode 100644 public/react/src/forge/Newfile/Index.js delete mode 100644 public/react/src/forge/Newfile/UserSubmitComponent.js delete mode 100644 public/react/src/forge/Newfile/index.css delete mode 100644 public/react/src/forge/Order/CopyDetail.js delete mode 100644 public/react/src/forge/Order/Detail.js delete mode 100644 public/react/src/forge/Order/Milepost.js delete mode 100644 public/react/src/forge/Order/MilepostDetail.js delete mode 100644 public/react/src/forge/Order/Nav.js delete mode 100644 public/react/src/forge/Order/New.js delete mode 100644 public/react/src/forge/Order/OrderItem.js delete mode 100644 public/react/src/forge/Order/Tags.js delete mode 100644 public/react/src/forge/Order/UpdateDetail.js delete mode 100644 public/react/src/forge/Order/UpdateMilepost.js delete mode 100644 public/react/src/forge/Order/newMilepost.js delete mode 100644 public/react/src/forge/Order/order.css delete mode 100644 public/react/src/forge/Order/order.js delete mode 100644 public/react/src/forge/Redux/Reducer/index.js delete mode 100644 public/react/src/forge/Redux/Store/index.js delete mode 100644 public/react/src/forge/Settings/Branch.js delete mode 100644 public/react/src/forge/Settings/Collaborator.js delete mode 100644 public/react/src/forge/Settings/Index.js delete mode 100644 public/react/src/forge/Settings/Setting.js delete mode 100644 public/react/src/forge/Settings/setting.css delete mode 100644 public/react/src/forge/Upload/Index.js delete mode 100644 public/react/src/forge/Upload/attachment.js delete mode 100644 public/react/src/forge/Version/NewVersion.js delete mode 100644 public/react/src/forge/Version/UpdateVersion.js delete mode 100644 public/react/src/forge/Version/version.css delete mode 100644 public/react/src/forge/Version/version.js delete mode 100644 public/react/src/forge/css/index.css delete mode 100644 public/react/src/forge/js/index.js delete mode 100644 public/react/src/history.js delete mode 100644 public/react/src/images/account/auth.png delete mode 100644 public/react/src/images/account/infobanner.png delete mode 100644 public/react/src/images/account/job.png delete mode 100644 public/react/src/images/ad/match_ad.jpg delete mode 100644 public/react/src/images/cert/shimingrenzheng.png delete mode 100644 public/react/src/images/cert/zhiyerenzheng.png delete mode 100644 public/react/src/images/component/rc-tree.png delete mode 100644 public/react/src/images/component/selectFile.png delete mode 100644 public/react/src/images/delay.png delete mode 100644 public/react/src/images/ecs/bg.jpg delete mode 100644 public/react/src/images/forge/project.jpg delete mode 100644 public/react/src/images/guideimg/guihome1.png delete mode 100644 public/react/src/images/guideimg/guihome2.jpg delete mode 100644 public/react/src/images/guideimg/guihome3.jpg delete mode 100644 public/react/src/images/guideimg/guihome4.jpg delete mode 100644 public/react/src/images/guideimg/guihome5.jpg delete mode 100644 public/react/src/images/guideimg/guihome6.jpg delete mode 100644 public/react/src/images/guideimg/guihome6.png delete mode 100644 public/react/src/images/guideimg/guihome7.png delete mode 100644 public/react/src/images/invalid.png delete mode 100644 public/react/src/images/login/beijintulogon.png delete mode 100644 public/react/src/images/login/beijintulogontwo.png delete mode 100644 public/react/src/images/login/educodernet.png delete mode 100644 public/react/src/images/login/passoff.png delete mode 100644 public/react/src/images/login/passopen.png delete mode 100644 public/react/src/images/moop_cases/success.png delete mode 100644 public/react/src/images/moop_cases/teach_ex.jpg delete mode 100644 public/react/src/images/oj/oj_banner.jpg delete mode 100644 public/react/src/images/path/path.png delete mode 100644 public/react/src/images/shixuns/search.svg delete mode 100644 public/react/src/images/tpi/empiricgreen.png delete mode 100644 public/react/src/images/tpi/message.svg delete mode 100644 public/react/src/images/tpi/messagegrey.svg delete mode 100644 public/react/src/images/tpi/notEditablePath.png delete mode 100644 public/react/src/images/tpi/passall.png delete mode 100644 public/react/src/images/tpi/passpart.png delete mode 100644 public/react/src/images/tpi/sendimg.svg delete mode 100644 public/react/src/images/tpi/upload-image.png delete mode 100644 public/react/src/images/wx-head.png delete mode 100644 public/react/src/index.css delete mode 100644 public/react/src/index.js delete mode 100644 public/react/src/indexEduplus2RequestProxy.js delete mode 100644 public/react/src/indexPlus.css delete mode 100644 public/react/src/logo.svg delete mode 100644 public/react/src/modal/GotoQQgroup.js delete mode 100644 public/react/src/modal/gotoqqgroup.css delete mode 100644 public/react/src/modules/403/Shixunauthority.js delete mode 100644 public/react/src/modules/404/Shixunnopage.js delete mode 100644 public/react/src/modules/500/http500.js delete mode 100644 public/react/src/modules/comment/Comment.css delete mode 100644 public/react/src/modules/comment/CommentContainer.js delete mode 100644 public/react/src/modules/comment/CommentInput.js delete mode 100644 public/react/src/modules/comment/CommentItemKEEditor.js delete mode 100644 public/react/src/modules/comment/CommentItemMDEditor.css delete mode 100644 public/react/src/modules/comment/CommentItemMDEditor.js delete mode 100644 public/react/src/modules/comment/Comments.js delete mode 100644 public/react/src/modules/comment/CommentsHOC.js delete mode 100644 public/react/src/modules/common/CompatibilityPage.js delete mode 100644 public/react/src/modules/common/RewardDialog.js delete mode 100644 public/react/src/modules/common/imgs/firefox_icon.png delete mode 100644 public/react/src/modules/common/imgs/google-chrome@2x.png delete mode 100644 public/react/src/modules/common/imgs/icon@2x.png delete mode 100644 public/react/src/modules/common/imgs/internet-explorer@2x.png delete mode 100644 public/react/src/modules/competition/CompetitionMaxImg.js delete mode 100644 public/react/src/modules/competition/RegisListview.js delete mode 100644 public/react/src/modules/competition/RegisListviewdata.js delete mode 100644 public/react/src/modules/competition/RegisNodata.js delete mode 100644 public/react/src/modules/competition/Registration.js delete mode 100644 public/react/src/modules/competition/RegistrationSearch.js delete mode 100644 public/react/src/modules/competition/Registrationitem.js delete mode 100644 public/react/src/modules/competition/comcss/competition.css delete mode 100644 public/react/src/modules/competition/competmodal/ExittheteamModel.js delete mode 100644 public/react/src/modules/competition/competmodal/MessagePersonModal.js delete mode 100644 public/react/src/modules/competition/competmodal/PersonModal.js delete mode 100644 public/react/src/modules/competition/competmodal/PersonModaltion.js delete mode 100644 public/react/src/modules/competition/competmodal/PersonalModalteam.js delete mode 100644 public/react/src/modules/competition/personal/PersonalCompetit.js delete mode 100644 public/react/src/modules/competition/personal/PersonalCompetititem.js delete mode 100644 public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js delete mode 100644 public/react/src/modules/competitions/Competitimain/Competitionsindex.css delete mode 100644 public/react/src/modules/competitions/Competition_teams/Competitionteams.css delete mode 100644 public/react/src/modules/competitions/Competition_teams/Competitionteams.js delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css delete mode 100755 public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContents.js delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsMd.js delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdf.js delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/Bankcardnumberverification.js delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/Mailboxvalidation.js delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/Phonenumberverification.js delete mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css delete mode 100644 public/react/src/modules/competitions/Competitions.js delete mode 100644 public/react/src/modules/courses/BoardIndex.js delete mode 100644 public/react/src/modules/courses/Index.js delete mode 100644 public/react/src/modules/courses/ListPageIndex.js delete mode 100644 public/react/src/modules/courses/Resource/Fileslistitem.js delete mode 100644 public/react/src/modules/courses/Resource/index.js delete mode 100644 public/react/src/modules/courses/Resource/style.css delete mode 100644 public/react/src/modules/courses/Video/Live.js delete mode 100644 public/react/src/modules/courses/Video/LiveItem.js delete mode 100644 public/react/src/modules/courses/Video/LiveNew.js delete mode 100644 public/react/src/modules/courses/Video/Video.js delete mode 100644 public/react/src/modules/courses/Video/VideoIndex.js delete mode 100644 public/react/src/modules/courses/Video/VideoNew.js delete mode 100644 public/react/src/modules/courses/Video/images/WeiBaiTong.png delete mode 100644 public/react/src/modules/courses/Video/images/bilibili.png delete mode 100644 public/react/src/modules/courses/Video/images/douyu.jpg delete mode 100644 public/react/src/modules/courses/Video/images/tencent.png delete mode 100644 public/react/src/modules/courses/Video/video.css delete mode 100644 public/react/src/modules/courses/boards/AddDirModal.js delete mode 100644 public/react/src/modules/courses/boards/BoardsListItem.js delete mode 100644 public/react/src/modules/courses/boards/BoardsNew.js delete mode 100644 public/react/src/modules/courses/boards/BoardsNewTemp.js delete mode 100644 public/react/src/modules/courses/boards/TopicDetail.css delete mode 100644 public/react/src/modules/courses/boards/TopicDetail.js delete mode 100644 public/react/src/modules/courses/boards/board.css delete mode 100644 public/react/src/modules/courses/boards/boardsListItem.css delete mode 100644 public/react/src/modules/courses/boards/common.js delete mode 100644 public/react/src/modules/courses/boards/index.js delete mode 100644 public/react/src/modules/courses/busyWork/CommonWorkAnswer.js delete mode 100644 public/react/src/modules/courses/busyWork/CommonWorkAppraise.js delete mode 100644 public/react/src/modules/courses/busyWork/CommonWorkAppraiseReviseAttachments.js delete mode 100644 public/react/src/modules/courses/busyWork/CommonWorkDetail.js delete mode 100644 public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js delete mode 100644 public/react/src/modules/courses/busyWork/CommonWorkItem.js delete mode 100644 public/react/src/modules/courses/busyWork/CommonWorkList.js delete mode 100644 public/react/src/modules/courses/busyWork/CommonWorkListTemplate.js delete mode 100644 public/react/src/modules/courses/busyWork/CommonWorkPost.js delete mode 100644 public/react/src/modules/courses/busyWork/CommonWorkQuestion.js delete mode 100644 public/react/src/modules/courses/busyWork/CommonWorkSetting.js delete mode 100644 public/react/src/modules/courses/busyWork/ConnectProject.js delete mode 100644 public/react/src/modules/courses/busyWork/Index.js delete mode 100644 public/react/src/modules/courses/busyWork/IndexGroup.js delete mode 100644 public/react/src/modules/courses/busyWork/NewWork.js delete mode 100644 public/react/src/modules/courses/busyWork/NewWorkForm.js delete mode 100644 public/react/src/modules/courses/busyWork/PublishRightnow.js delete mode 100644 public/react/src/modules/courses/busyWork/TestHooks.js delete mode 100644 public/react/src/modules/courses/busyWork/UseBank.js delete mode 100644 public/react/src/modules/courses/busyWork/common.js delete mode 100644 public/react/src/modules/courses/busyWork/common/LeaderIcon.js delete mode 100644 public/react/src/modules/courses/busyWork/common/TabRightComponents.js delete mode 100644 public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js delete mode 100644 public/react/src/modules/courses/busyWork/commonWork.js delete mode 100644 public/react/src/modules/courses/busyWork/reply/CommonWorkAppraiseReply.css delete mode 100644 public/react/src/modules/courses/busyWork/reply/CommonWorkAppraiseReply.js delete mode 100644 public/react/src/modules/courses/common/CBreadcrumb.js delete mode 100644 public/react/src/modules/courses/common/CDropdown.js delete mode 100644 public/react/src/modules/courses/common/CNotificationHOC.js delete mode 100644 public/react/src/modules/courses/common/CommentsHelper.js delete mode 100644 public/react/src/modules/courses/common/CourseLayoutComponent.js delete mode 100644 public/react/src/modules/courses/common/ModalWrapper.js delete mode 100644 public/react/src/modules/courses/common/button/CheckAllGroup.js delete mode 100644 public/react/src/modules/courses/common/comments/CCommentItem.js delete mode 100644 public/react/src/modules/courses/common/comments/CommonReply.js delete mode 100644 public/react/src/modules/courses/common/courseMessage.css delete mode 100644 public/react/src/modules/courses/common/formCommon.css delete mode 100644 public/react/src/modules/courses/common/titleSearch/ColorCountText.js delete mode 100644 public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js delete mode 100644 public/react/src/modules/courses/competitions/Competitimain/CompetitionsIndex.js delete mode 100644 public/react/src/modules/courses/competitions/Competitimain/Competitionsindex.css delete mode 100644 public/react/src/modules/courses/competitions/Competition_teams/Competitionteams.css delete mode 100644 public/react/src/modules/courses/competitions/Competition_teams/Competitionteams.js delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommon.css delete mode 100755 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommon.js delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContents.js delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsMd.js delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdf.js delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/Bankcardnumberverification.js delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/Mailboxvalidation.js delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/Phonenumberverification.js delete mode 100644 public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css delete mode 100644 public/react/src/modules/courses/competitions/Competitions.js delete mode 100644 public/react/src/modules/courses/completetaskdetails/Completetaskdetails.js delete mode 100644 public/react/src/modules/courses/completetaskdetails/Completetaskpage.js delete mode 100644 public/react/src/modules/courses/completetaskdetails/completetaskdetails.css delete mode 100644 public/react/src/modules/courses/comtopicdetails/CompletetopicdePage.js delete mode 100644 public/react/src/modules/courses/comtopicdetails/Completetopicdetails.js delete mode 100644 public/react/src/modules/courses/comtopicdetails/completetopicde.css delete mode 100644 public/react/src/modules/courses/coursesDetail/CoursesBanner.js delete mode 100644 public/react/src/modules/courses/coursesDetail/CoursesDetail.js delete mode 100644 public/react/src/modules/courses/coursesDetail/CoursesGuide.js delete mode 100644 public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js delete mode 100644 public/react/src/modules/courses/coursesDetail/MainLeftNav.css delete mode 100644 public/react/src/modules/courses/coursesDetail/MyEduChapterupdate.js delete mode 100644 public/react/src/modules/courses/coursesDetail/chapterupdate.css delete mode 100644 public/react/src/modules/courses/coursesHome/CoursesHome.js delete mode 100644 public/react/src/modules/courses/coursesHome/CoursesHomeCard.js delete mode 100644 public/react/src/modules/courses/coursesHome/css/CoursesHome.css delete mode 100644 public/react/src/modules/courses/coursesHome/css/courses.jpg delete mode 100644 public/react/src/modules/courses/coursesPublic/AccessoryModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/AccessoryModal2.js delete mode 100644 public/react/src/modules/courses/coursesPublic/Addcourses.js delete mode 100644 public/react/src/modules/courses/coursesPublic/AddcoursesNav.js delete mode 100644 public/react/src/modules/courses/coursesPublic/AllocationModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/AppraiseModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/ApprausePublic.js delete mode 100644 public/react/src/modules/courses/coursesPublic/Associationmodel.js delete mode 100644 public/react/src/modules/courses/coursesPublic/CourseTag.css delete mode 100644 public/react/src/modules/courses/coursesPublic/CourseTag.js delete mode 100644 public/react/src/modules/courses/coursesPublic/CoursesListType.js delete mode 100644 public/react/src/modules/courses/coursesPublic/CoursesMarkdown.js delete mode 100644 public/react/src/modules/courses/coursesPublic/HomeworkModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/ModalsRename.js delete mode 100644 public/react/src/modules/courses/coursesPublic/ModulationModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/ModulationModal_exercise.js delete mode 100644 public/react/src/modules/courses/coursesPublic/NewShixunModel.js delete mode 100644 public/react/src/modules/courses/coursesPublic/Newshixunmodel.css delete mode 100644 public/react/src/modules/courses/coursesPublic/NoneData.js delete mode 100644 public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/PathModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/PublishModals.js delete mode 100644 public/react/src/modules/courses/coursesPublic/SelectResource.js delete mode 100644 public/react/src/modules/courses/coursesPublic/SelectSetting.js delete mode 100644 public/react/src/modules/courses/coursesPublic/SendToFilesModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/ShixunChooseModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/ShixunModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/Showoldfiles.js delete mode 100644 public/react/src/modules/courses/coursesPublic/Startshixuntask.js delete mode 100644 public/react/src/modules/courses/coursesPublic/form/SchoolSelect.js delete mode 100644 public/react/src/modules/courses/coursesPublic/makedown.css delete mode 100644 public/react/src/modules/courses/coursesPublic/modal/CheckCodeModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/modal/SendToCourseModal.js delete mode 100644 public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js delete mode 100644 public/react/src/modules/courses/coursesPublic/sendResource.js delete mode 100644 public/react/src/modules/courses/coursmodel/AuthenModel.js delete mode 100644 public/react/src/modules/courses/coursmodel/authenmodels.css delete mode 100644 public/react/src/modules/courses/css/Courses.css delete mode 100644 public/react/src/modules/courses/css/busyWork.css delete mode 100644 public/react/src/modules/courses/css/members.css delete mode 100644 public/react/src/modules/courses/elearning/Elearning.js delete mode 100644 public/react/src/modules/courses/elearning/YslDetailCards.js delete mode 100644 public/react/src/modules/courses/elearning/myelearning.css delete mode 100644 public/react/src/modules/courses/exercise/Ecerciseallbackagain.js delete mode 100644 public/react/src/modules/courses/exercise/Ecercisemount.js delete mode 100644 public/react/src/modules/courses/exercise/Exercise.js delete mode 100644 public/react/src/modules/courses/exercise/ExerciseDisplay.js delete mode 100644 public/react/src/modules/courses/exercise/ExerciseListItem.js delete mode 100644 public/react/src/modules/courses/exercise/ExerciseNew.js delete mode 100644 public/react/src/modules/courses/exercise/ExerciseNewCommon.js delete mode 100644 public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js delete mode 100644 public/react/src/modules/courses/exercise/Exercisesetting.js delete mode 100644 public/react/src/modules/courses/exercise/Exercisestatisticalresult.js delete mode 100644 public/react/src/modules/courses/exercise/Exercisestatisticalresulttabel.js delete mode 100644 public/react/src/modules/courses/exercise/Exercisetablesmubu.js delete mode 100644 public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js delete mode 100644 public/react/src/modules/courses/exercise/Testpapersettinghomepage.js delete mode 100644 public/react/src/modules/courses/exercise/new/JudgeDisplay.js delete mode 100644 public/react/src/modules/courses/exercise/new/JudgeEditor.js delete mode 100644 public/react/src/modules/courses/exercise/new/MainDisplay.js delete mode 100644 public/react/src/modules/courses/exercise/new/MainEditor.js delete mode 100644 public/react/src/modules/courses/exercise/new/NullChildEditor.js delete mode 100644 public/react/src/modules/courses/exercise/new/NullDisplay.js delete mode 100644 public/react/src/modules/courses/exercise/new/NullEditor.js delete mode 100644 public/react/src/modules/courses/exercise/new/NullMDEditor.js delete mode 100644 public/react/src/modules/courses/exercise/new/QestionDisplayHeader.js delete mode 100644 public/react/src/modules/courses/exercise/new/ShixunDisplay.js delete mode 100644 public/react/src/modules/courses/exercise/new/ShixunEditor.js delete mode 100644 public/react/src/modules/courses/exercise/new/SingleDisplay.js delete mode 100644 public/react/src/modules/courses/exercise/new/SingleEditor.js delete mode 100644 public/react/src/modules/courses/exercise/new/common.css delete mode 100644 public/react/src/modules/courses/exercise/new/common.js delete mode 100644 public/react/src/modules/courses/exercise/new/editorCommon.css delete mode 100644 public/react/src/modules/courses/exercise/question/fillEmpty.js delete mode 100644 public/react/src/modules/courses/exercise/question/multiple.js delete mode 100644 public/react/src/modules/courses/exercise/question/shixunAnswer.js delete mode 100644 public/react/src/modules/courses/exercise/question/shixunAnswerDetail.js delete mode 100644 public/react/src/modules/courses/exercise/question/simpleAnswer.js delete mode 100644 public/react/src/modules/courses/exercise/question/single.js delete mode 100644 public/react/src/modules/courses/exercise/yslexercisetable.css delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_AMS-Regular.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_AMS-Regular.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_AMS-Regular.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Caligraphic-Bold.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Caligraphic-Bold.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Caligraphic-Bold.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Caligraphic-Regular.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Caligraphic-Regular.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Caligraphic-Regular.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Fraktur-Bold.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Fraktur-Bold.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Fraktur-Bold.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Fraktur-Regular.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Fraktur-Regular.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Fraktur-Regular.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-Bold.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-Bold.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-Bold.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-BoldItalic.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-BoldItalic.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-BoldItalic.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-Italic.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-Italic.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-Italic.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-Regular.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-Regular.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Main-Regular.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Math-BoldItalic.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Math-BoldItalic.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Math-BoldItalic.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Math-Italic.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Math-Italic.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Math-Italic.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_SansSerif-Bold.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_SansSerif-Bold.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_SansSerif-Bold.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_SansSerif-Italic.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_SansSerif-Italic.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_SansSerif-Italic.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_SansSerif-Regular.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_SansSerif-Regular.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_SansSerif-Regular.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Script-Regular.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Script-Regular.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Script-Regular.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size1-Regular.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size1-Regular.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size1-Regular.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size2-Regular.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size2-Regular.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size2-Regular.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size3-Regular.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size3-Regular.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size3-Regular.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size4-Regular.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size4-Regular.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Size4-Regular.woff2 delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Typewriter-Regular.ttf delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Typewriter-Regular.woff delete mode 100644 public/react/src/modules/courses/fonts/KaTeX_Typewriter-Regular.woff2 delete mode 100644 public/react/src/modules/courses/gradinforms/Bullsubdirectory.js delete mode 100644 public/react/src/modules/courses/gradinforms/Eduinforms.js delete mode 100644 public/react/src/modules/courses/gradinforms/myysleduinforms.css delete mode 100644 public/react/src/modules/courses/graduation/style.css delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationAcross.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.css delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTasksedit.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTasksnew.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingReply.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/Graduationclass.css delete mode 100644 public/react/src/modules/courses/graduation/tasks/Graduationtaskitem.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/TaskPublishModal.js delete mode 100644 public/react/src/modules/courses/graduation/tasks/index.js delete mode 100644 public/react/src/modules/courses/graduation/topics/ChooseGraduateTopicModal.js delete mode 100644 public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js delete mode 100644 public/react/src/modules/courses/graduation/topics/GraduateTopicDetailInfo.js delete mode 100644 public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js delete mode 100644 public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js delete mode 100644 public/react/src/modules/courses/graduation/topics/GraduateTopicNew.js delete mode 100644 public/react/src/modules/courses/graduation/topics/GraduateTopicNewFrom.js delete mode 100644 public/react/src/modules/courses/graduation/topics/GraduateTopicPostWorksNew.js delete mode 100644 public/react/src/modules/courses/graduation/topics/GraduateTopicReply.css delete mode 100644 public/react/src/modules/courses/graduation/topics/GraduateTopicReply.js delete mode 100644 public/react/src/modules/courses/graduation/topics/index.js delete mode 100644 public/react/src/modules/courses/groupjobbank/GroupPackage.js delete mode 100644 public/react/src/modules/courses/groupjobbank/GroupPackage2.js delete mode 100644 public/react/src/modules/courses/groupjobbank/Groupjobbandetails.js delete mode 100644 public/react/src/modules/courses/groupjobbank/GroupjobbankPage.js delete mode 100644 public/react/src/modules/courses/groupjobbank/Groupjobquesanswer.js delete mode 100644 public/react/src/modules/courses/groupjobbank/questionbanks.css delete mode 100644 public/react/src/modules/courses/katex.css delete mode 100644 public/react/src/modules/courses/members/ChangeRolePop.js delete mode 100644 public/react/src/modules/courses/members/CourseGroupChooser.js delete mode 100644 public/react/src/modules/courses/members/CourseGroupList.js delete mode 100644 public/react/src/modules/courses/members/CourseGroupListTable.js delete mode 100644 public/react/src/modules/courses/members/common.js delete mode 100644 public/react/src/modules/courses/members/modal/AddAdminModal.js delete mode 100644 public/react/src/modules/courses/members/modal/AddGraduationGroupModal.js delete mode 100644 public/react/src/modules/courses/members/modal/AddStudentModal.js delete mode 100644 public/react/src/modules/courses/members/modal/AddTeacherModal.js delete mode 100644 public/react/src/modules/courses/members/modal/CourseGroupChooserModal.js delete mode 100644 public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js delete mode 100644 public/react/src/modules/courses/members/studentsList.css delete mode 100644 public/react/src/modules/courses/members/studentsList.js delete mode 100644 public/react/src/modules/courses/members/teacherList.js delete mode 100644 public/react/src/modules/courses/new/CoursesNew.js delete mode 100644 public/react/src/modules/courses/new/Goldsubject.js delete mode 100644 public/react/src/modules/courses/ordering/Ordering.css delete mode 100644 public/react/src/modules/courses/ordering/Ordering.js delete mode 100644 public/react/src/modules/courses/poll/Poll.js delete mode 100644 public/react/src/modules/courses/poll/PollDetailIndex.js delete mode 100644 public/react/src/modules/courses/poll/PollDetailTabFirst.js delete mode 100644 public/react/src/modules/courses/poll/PollDetailTabForth.js delete mode 100644 public/react/src/modules/courses/poll/PollDetailTabForthRules.js delete mode 100644 public/react/src/modules/courses/poll/PollDetailTabSecond.js delete mode 100644 public/react/src/modules/courses/poll/PollDetailTabThird.js delete mode 100644 public/react/src/modules/courses/poll/PollDetailTabThirdInfo.js delete mode 100644 public/react/src/modules/courses/poll/PollInfo.js delete mode 100644 public/react/src/modules/courses/poll/PollListItem.js delete mode 100644 public/react/src/modules/courses/poll/PollNew.js delete mode 100644 public/react/src/modules/courses/poll/PollNewQuestbank.js delete mode 100644 public/react/src/modules/courses/poll/pollPublicBtn/CancelPublish.js delete mode 100644 public/react/src/modules/courses/poll/pollPublicBtn/ImmediatelyEnd.js delete mode 100644 public/react/src/modules/courses/poll/pollPublicBtn/ImmediatelyPublish.js delete mode 100644 public/react/src/modules/courses/poll/pollStyle.css delete mode 100644 public/react/src/modules/courses/polldepoly/Index.js delete mode 100644 public/react/src/modules/courses/polldepoly/pollmount.js delete mode 100644 public/react/src/modules/courses/publicNav/listNav.js delete mode 100644 public/react/src/modules/courses/publicNav/nav.css delete mode 100644 public/react/src/modules/courses/questionbank/Generaljobanswer.js delete mode 100644 public/react/src/modules/courses/questionbank/Generaljobbankdetails.js delete mode 100644 public/react/src/modules/courses/questionbank/Generaljobdetails.js delete mode 100644 public/react/src/modules/courses/questionbank/questionbank.css delete mode 100644 public/react/src/modules/courses/shixunHomework/Challenges.css delete mode 100644 public/react/src/modules/courses/shixunHomework/CommitSummary.js delete mode 100644 public/react/src/modules/courses/shixunHomework/Guide.js delete mode 100644 public/react/src/modules/courses/shixunHomework/Homeworddescription.js delete mode 100644 public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js delete mode 100644 public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js delete mode 100644 public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js delete mode 100644 public/react/src/modules/courses/shixunHomework/ShixunWorkDetails.js delete mode 100644 public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js delete mode 100644 public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js delete mode 100644 public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunCustomsPass.js delete mode 100644 public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js delete mode 100644 public/react/src/modules/courses/shixunHomework/ShowAppraiseList.js delete mode 100644 public/react/src/modules/courses/shixunHomework/TraineetraininginformationModal.js delete mode 100644 public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js delete mode 100644 public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js delete mode 100755 public/react/src/modules/courses/shixunHomework/guide.css delete mode 100644 public/react/src/modules/courses/shixunHomework/shixunHomework.js delete mode 100644 public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js delete mode 100644 public/react/src/modules/courses/shixunHomework/shixunreport/Coursesshixundetails.js delete mode 100644 public/react/src/modules/courses/shixunHomework/shixunreport/OfficialAcademicTranscript.js delete mode 100644 public/react/src/modules/courses/shixunHomework/shixunreport/Shixunechart.js delete mode 100644 public/react/src/modules/courses/shixunHomework/style.css delete mode 100644 public/react/src/modules/courses/statistics/Dropdownbox.js delete mode 100644 public/react/src/modules/courses/statistics/Dynamiclist.js delete mode 100644 public/react/src/modules/courses/statistics/Statistics.css delete mode 100644 public/react/src/modules/courses/statistics/Statistics.js delete mode 100644 public/react/src/modules/courses/studentWork/CommitSummaryIndex.js delete mode 100644 public/react/src/modules/courses/studentWork/StudentHomework.js delete mode 100644 public/react/src/modules/courses/user’s_manual.txt delete mode 100644 public/react/src/modules/developer/DeveloperHome.js delete mode 100644 public/react/src/modules/developer/components/controlSetting/index.js delete mode 100644 public/react/src/modules/developer/components/controlSetting/index.scss delete mode 100644 public/react/src/modules/developer/components/errorResult/index.js delete mode 100644 public/react/src/modules/developer/components/errorResult/index.scss delete mode 100644 public/react/src/modules/developer/components/execResult/index.js delete mode 100644 public/react/src/modules/developer/components/execResult/index.scss delete mode 100644 public/react/src/modules/developer/components/initTabCtx/index.js delete mode 100644 public/react/src/modules/developer/components/initTabCtx/index.scss delete mode 100644 public/react/src/modules/developer/components/initTabCtx/index1.js delete mode 100644 public/react/src/modules/developer/components/knowledge/index.js delete mode 100644 public/react/src/modules/developer/components/knowledge/index.scss delete mode 100644 public/react/src/modules/developer/components/monacoSetting/index.js delete mode 100644 public/react/src/modules/developer/components/multiptags/index.js delete mode 100644 public/react/src/modules/developer/components/multiptags/index.scss delete mode 100644 public/react/src/modules/developer/components/myMonacoEditor/index.js delete mode 100644 public/react/src/modules/developer/components/myMonacoEditor/index.scss delete mode 100644 public/react/src/modules/developer/components/myMonacoEditor/index2.js delete mode 100644 public/react/src/modules/developer/components/textNumber/index.js delete mode 100644 public/react/src/modules/developer/components/textNumber/index.scss delete mode 100644 public/react/src/modules/developer/components/userInfo/index.js delete mode 100644 public/react/src/modules/developer/components/userInfo/index.scss delete mode 100644 public/react/src/modules/developer/index.js delete mode 100644 public/react/src/modules/developer/index.scss delete mode 100644 public/react/src/modules/developer/newOrEditTask/index.js delete mode 100644 public/react/src/modules/developer/newOrEditTask/index.scss delete mode 100644 public/react/src/modules/developer/newOrEditTask/leftpane/commitTab/index.js delete mode 100644 public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js delete mode 100644 public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js delete mode 100644 public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.scss delete mode 100644 public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index2.js delete mode 100644 public/react/src/modules/developer/newOrEditTask/leftpane/index.js delete mode 100644 public/react/src/modules/developer/newOrEditTask/leftpane/index.scss delete mode 100644 public/react/src/modules/developer/newOrEditTask/leftpane/prevTab/index.js delete mode 100644 public/react/src/modules/developer/newOrEditTask/leftpane/prevTab/index.scss delete mode 100644 public/react/src/modules/developer/newOrEditTask/rightpane/index.js delete mode 100644 public/react/src/modules/developer/newOrEditTask/rightpane/index.scss delete mode 100644 public/react/src/modules/developer/newOrEditTask/rightpane/initTabCtx/index.js delete mode 100644 public/react/src/modules/developer/newOrEditTask/rightpane/initTabCtx/index.scss delete mode 100644 public/react/src/modules/developer/newOrEditTask/rightpane/settingDrawer.js delete mode 100644 public/react/src/modules/developer/quillEditor/README.md delete mode 100644 public/react/src/modules/developer/quillEditor/index.js delete mode 100644 public/react/src/modules/developer/quillEditor/index.scss delete mode 100644 public/react/src/modules/developer/recordDetail/index.js delete mode 100644 public/react/src/modules/developer/recordDetail/index.scss delete mode 100644 public/react/src/modules/developer/split_pane_resizer.scss delete mode 100644 public/react/src/modules/developer/studentStudy/index.js delete mode 100644 public/react/src/modules/developer/studentStudy/index.scss delete mode 100644 public/react/src/modules/developer/studentStudy/leftpane/comment/index.js delete mode 100644 public/react/src/modules/developer/studentStudy/leftpane/comment/index.scss delete mode 100644 public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js delete mode 100644 public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.scss delete mode 100644 public/react/src/modules/developer/studentStudy/leftpane/index.js delete mode 100644 public/react/src/modules/developer/studentStudy/leftpane/index.scss delete mode 100644 public/react/src/modules/developer/studentStudy/leftpane/taskDescription/index.js delete mode 100644 public/react/src/modules/developer/studentStudy/rightpane/index.js delete mode 100644 public/react/src/modules/ecs/EcSetting/CourseSupports/ecCourseSupports.css delete mode 100644 public/react/src/modules/ecs/EcSetting/CourseSupports/index.js delete mode 100644 public/react/src/modules/ecs/EcSetting/GraduationRequirement/index.js delete mode 100644 public/react/src/modules/ecs/EcSetting/GraduationRequirement/index.scss delete mode 100644 public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js delete mode 100644 public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js delete mode 100644 public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js delete mode 100644 public/react/src/modules/ecs/EcSetting/TrainingObjective/index.js delete mode 100644 public/react/src/modules/ecs/EcSetting/TrainingObjective/index.scss delete mode 100644 public/react/src/modules/ecs/EcSetting/index.js delete mode 100644 public/react/src/modules/ecs/EcSetting/index.scss delete mode 100644 public/react/src/modules/ecs/EcSetting/reachCalculationInfo/index.js delete mode 100644 public/react/src/modules/ecs/EcSetting/reachCalculationInfo/index.scss delete mode 100644 public/react/src/modules/ecs/EcYear/AddYearModal.js delete mode 100644 public/react/src/modules/ecs/EcYear/AddYearModal.scss delete mode 100644 public/react/src/modules/ecs/EcYear/index.js delete mode 100644 public/react/src/modules/ecs/EcYear/index.scss delete mode 100644 public/react/src/modules/ecs/Ecs.js delete mode 100644 public/react/src/modules/ecs/Home/AddMajorModal.js delete mode 100644 public/react/src/modules/ecs/Home/AddMajorModal.scss delete mode 100644 public/react/src/modules/ecs/Home/AddManagerModal.js delete mode 100644 public/react/src/modules/ecs/Home/AddManagerModal.scss delete mode 100644 public/react/src/modules/ecs/Home/MajorManager.js delete mode 100644 public/react/src/modules/ecs/Home/index.js delete mode 100644 public/react/src/modules/ecs/Home/index.scss delete mode 100644 public/react/src/modules/ecs/common/ECModalHOC.js delete mode 100644 public/react/src/modules/ecs/css/ec.css delete mode 100644 public/react/src/modules/ecs/css/ecCourseEvaluations.css delete mode 100644 public/react/src/modules/ecs/css/ecCourseSupports.css delete mode 100644 public/react/src/modules/ecs/css/search.svg delete mode 100644 public/react/src/modules/ecs/curriculum/Curriculum.js delete mode 100644 public/react/src/modules/ecs/curriculum/CurriculumSubpage.js delete mode 100644 public/react/src/modules/ecs/curriculum/Curriculumtwo.js delete mode 100644 public/react/src/modules/ecs/ecTitle/ecTitle.css delete mode 100644 public/react/src/modules/ecs/ecTitle/ecTitle.js delete mode 100644 public/react/src/modules/ecs/ecTitle/img/1.png delete mode 100644 public/react/src/modules/ecs/ecTitle/img/2.png delete mode 100644 public/react/src/modules/ecs/ecTitle/img/3.png delete mode 100644 public/react/src/modules/ecs/ecTitle/img/4.png delete mode 100644 public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js delete mode 100644 public/react/src/modules/ecs/subroute/ecCourseEvaluations/EcCourseEvaluationsbottom.js delete mode 100644 public/react/src/modules/ecs/subroute/ecCourseEvaluations/eccourseevalut.css delete mode 100644 public/react/src/modules/ecs/subroute/ecCourseSupportSetting/EditableCourseSupportSetting.js delete mode 100644 public/react/src/modules/ecs/subroute/ecCourseSupportSetting/ShowTableCourseSupportSetting.js delete mode 100644 public/react/src/modules/ecs/subroute/ecCourseSupportSetting/index.js delete mode 100644 public/react/src/modules/ecs/subroute/ecCourseSupportSetting/style.scss delete mode 100644 public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js delete mode 100644 public/react/src/modules/ecs/subroute/ecStudentList/ecStudentList.css delete mode 100644 public/react/src/modules/ecs/subroute/ecStudentList/nodata.png delete mode 100644 public/react/src/modules/forums/ForumsIndex.css delete mode 100644 public/react/src/modules/forums/ForumsIndex.js delete mode 100644 public/react/src/modules/forums/ForumsNavTab.js delete mode 100644 public/react/src/modules/forums/MemoDetail.js delete mode 100644 public/react/src/modules/forums/MemoDetailEditor.css delete mode 100644 public/react/src/modules/forums/MemoDetailKEEditor.js delete mode 100644 public/react/src/modules/forums/MemoDetailMDEditor.js delete mode 100644 public/react/src/modules/forums/MemoDetailMDEditortwo.js delete mode 100644 public/react/src/modules/forums/MemoList.js delete mode 100644 public/react/src/modules/forums/MemoMyPublish.js delete mode 100644 public/react/src/modules/forums/MemoNew.js delete mode 100644 public/react/src/modules/forums/MemoOldGuide.js delete mode 100644 public/react/src/modules/forums/MemoOldHottest.js delete mode 100644 public/react/src/modules/forums/MemoOldNewest.js delete mode 100644 public/react/src/modules/forums/MemoTechShare.js delete mode 100644 public/react/src/modules/forums/Post.css delete mode 100644 public/react/src/modules/forums/PostItem.js delete mode 100644 public/react/src/modules/forums/PostPaginationHOC.js delete mode 100644 public/react/src/modules/forums/RecommendShixun.js delete mode 100644 public/react/src/modules/forums/RightHotLabel.js delete mode 100644 public/react/src/modules/forums/RightHotQuestion.js delete mode 100644 public/react/src/modules/forums/RightMemoLabel.js delete mode 100644 public/react/src/modules/forums/RightMyPublish.js delete mode 100644 public/react/src/modules/forums/RightSection.css delete mode 100644 public/react/src/modules/forums/UserSection.js delete mode 100644 public/react/src/modules/forums/shixun/MemoShixun.css delete mode 100644 public/react/src/modules/forums/shixun/MemoShixun.js delete mode 100644 public/react/src/modules/forums/shixun/ShiXunPostItem.js delete mode 100644 public/react/src/modules/help/AboutUs.js delete mode 100644 public/react/src/modules/help/Agreement.js delete mode 100644 public/react/src/modules/help/ContactUs.css delete mode 100644 public/react/src/modules/help/ContactUs.js delete mode 100644 public/react/src/modules/help/Cooperatives.css delete mode 100644 public/react/src/modules/help/Cooperatives.js delete mode 100644 public/react/src/modules/help/Feedback.css delete mode 100644 public/react/src/modules/help/Feedback.js delete mode 100644 public/react/src/modules/help/FeedbackForm.js delete mode 100644 public/react/src/modules/help/Help.css delete mode 100644 public/react/src/modules/help/Help.js delete mode 100644 public/react/src/modules/help/HelpCenter.js delete mode 100644 public/react/src/modules/home/home.css delete mode 100644 public/react/src/modules/home/shixunsHome.js delete mode 100644 public/react/src/modules/home/tag2.png delete mode 100644 public/react/src/modules/login/EducoderInteresse.js delete mode 100644 public/react/src/modules/login/EducoderLogin.js delete mode 100644 public/react/src/modules/login/EducoderReg.js delete mode 100644 public/react/src/modules/login/LoginDialog.css delete mode 100644 public/react/src/modules/login/LoginDialog.js delete mode 100644 public/react/src/modules/login/Loginqq.js delete mode 100644 public/react/src/modules/login/Otherlogin.css delete mode 100644 public/react/src/modules/login/Otherlogin.js delete mode 100644 public/react/src/modules/login/Otherloginqq.js delete mode 100644 public/react/src/modules/login/Otherloginstart.js delete mode 100644 public/react/src/modules/login/Trialapplication.js delete mode 100644 public/react/src/modules/login/Trialapplicationysl.js delete mode 100644 public/react/src/modules/login/WeChat.png delete mode 100644 public/react/src/modules/login/WeChat@2x.png delete mode 100644 public/react/src/modules/login/qq.png delete mode 100644 public/react/src/modules/login/qq@2x.png delete mode 100644 public/react/src/modules/message/css/messagemy.css delete mode 100644 public/react/src/modules/message/js/Leftdialogue.js delete mode 100644 public/react/src/modules/message/js/MessagChat.js delete mode 100644 public/react/src/modules/message/js/MessagSub.js delete mode 100644 public/react/src/modules/message/js/MessagePrivate.js delete mode 100644 public/react/src/modules/message/js/Messagerouting.js delete mode 100644 public/react/src/modules/message/js/Rightdialogue.js delete mode 100644 public/react/src/modules/message/messagemodal/WriteaprivateletterModal.js delete mode 100644 public/react/src/modules/modals/Bottomsubmit.js delete mode 100644 public/react/src/modules/modals/Certifiedprofessional.js delete mode 100644 public/react/src/modules/modals/DownloadMessage.js delete mode 100644 public/react/src/modules/modals/DownloadMessageysl.js delete mode 100644 public/react/src/modules/modals/Jointheclass.js delete mode 100644 public/react/src/modules/modals/Modals.js delete mode 100644 public/react/src/modules/modals/SendTopics.js delete mode 100644 public/react/src/modules/modals/UpgradeModals.js delete mode 100644 public/react/src/modules/modals/WordNumberTextarea.css delete mode 100644 public/react/src/modules/modals/WordNumberTextarea.js delete mode 100644 public/react/src/modules/modals/certfed.css delete mode 100644 public/react/src/modules/moop_cases/CaseDetail.js delete mode 100644 public/react/src/modules/moop_cases/CaseItem.js delete mode 100644 public/react/src/modules/moop_cases/CaseList.js delete mode 100644 public/react/src/modules/moop_cases/CaseNew.js delete mode 100644 public/react/src/modules/moop_cases/CaseTags.js delete mode 100644 public/react/src/modules/moop_cases/Success.js delete mode 100644 public/react/src/modules/moop_cases/css/moopCases.css delete mode 100644 public/react/src/modules/moop_cases/index.js delete mode 100644 public/react/src/modules/osshackathon/Osshackathon.css delete mode 100644 public/react/src/modules/osshackathon/Osshackathon.js delete mode 100644 public/react/src/modules/osshackathon/Osshackathonmd.js delete mode 100644 public/react/src/modules/osshackathon/Osshackathonmodel.js delete mode 100644 public/react/src/modules/page/Header.js delete mode 100644 public/react/src/modules/page/Index.js delete mode 100644 public/react/src/modules/page/IndexWrapper.js delete mode 100644 public/react/src/modules/page/LeftNav.js delete mode 100644 public/react/src/modules/page/MainContent.js delete mode 100644 public/react/src/modules/page/MainContentContainer.js delete mode 100644 public/react/src/modules/page/VNC.css delete mode 100644 public/react/src/modules/page/VNCContainer.js delete mode 100644 public/react/src/modules/page/VNCDisplay.js delete mode 100644 public/react/src/modules/page/component/CheckBoxGroup.js delete mode 100644 public/react/src/modules/page/component/ChooseAnswerView.js delete mode 100644 public/react/src/modules/page/component/FloatButton.js delete mode 100644 public/react/src/modules/page/component/MUIDialogStyleUtil.js delete mode 100644 public/react/src/modules/page/component/SecondDrawer.js delete mode 100644 public/react/src/modules/page/component/TPICodeMirror.css delete mode 100644 public/react/src/modules/page/component/TPICodeMirror.js delete mode 100644 public/react/src/modules/page/component/TPICodeSetting.js delete mode 100644 public/react/src/modules/page/component/UpdateDrawer.css delete mode 100644 public/react/src/modules/page/component/UpdateDrawer.js delete mode 100644 public/react/src/modules/page/component/WebSSHTimer.css delete mode 100644 public/react/src/modules/page/component/WebSSHTimer.js delete mode 100644 public/react/src/modules/page/component/monaco/TPIMonaco.css delete mode 100644 public/react/src/modules/page/component/monaco/TPIMonaco.js delete mode 100644 public/react/src/modules/page/component/monaco/TPIMonacoConfig.js delete mode 100644 public/react/src/modules/page/component/repo/RepoTree.js delete mode 100644 public/react/src/modules/page/header.scss delete mode 100644 public/react/src/modules/page/images/float_switch.jpg delete mode 100644 public/react/src/modules/page/images/test/float_switch.jpg delete mode 100644 public/react/src/modules/page/layers/ImageLayer.js delete mode 100644 public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js delete mode 100644 public/react/src/modules/page/layers/TaskResultLayer.css delete mode 100644 public/react/src/modules/page/layers/TaskResultLayer.js delete mode 100644 public/react/src/modules/page/main/ActionView.css delete mode 100644 public/react/src/modules/page/main/ActionView.js delete mode 100644 public/react/src/modules/page/main/ChooseEvaluateView.js delete mode 100644 public/react/src/modules/page/main/ChooseEvaluateViewnew.css delete mode 100644 public/react/src/modules/page/main/ChooseRepositoryView.css delete mode 100644 public/react/src/modules/page/main/ChooseRepositoryView.js delete mode 100644 public/react/src/modules/page/main/ChooseView.css delete mode 100644 public/react/src/modules/page/main/CodeEvaluateMultiLevelAnswerUnlock.js delete mode 100644 public/react/src/modules/page/main/CodeEvaluateView.css delete mode 100644 public/react/src/modules/page/main/CodeEvaluateView.js delete mode 100644 public/react/src/modules/page/main/CodeRepositoryView.css delete mode 100644 public/react/src/modules/page/main/CodeRepositoryView.js delete mode 100644 public/react/src/modules/page/main/CodeRepositoryViewContainer.js delete mode 100644 public/react/src/modules/page/main/LeftView.js delete mode 100644 public/react/src/modules/page/main/LeftViewContainer.js delete mode 100644 public/react/src/modules/page/main/Webssh.js delete mode 100644 public/react/src/modules/page/main/answer/AnswerList.js delete mode 100644 public/react/src/modules/page/main/answer/AnswerListContainer.js delete mode 100644 public/react/src/modules/page/main/leftView.css delete mode 100644 public/react/src/modules/page/readme.txt delete mode 100644 public/react/src/modules/page/taskList/TaskList.css delete mode 100644 public/react/src/modules/page/taskList/TaskList.js delete mode 100644 public/react/src/modules/page/taskList/TaskListContainer.js delete mode 100644 public/react/src/modules/page/tpiPage.css delete mode 100644 public/react/src/modules/page/tpiPageForMobile.css delete mode 100644 public/react/src/modules/paths/Index.js delete mode 100644 public/react/src/modules/paths/NewStatistics/NewStatistics.js delete mode 100644 public/react/src/modules/paths/PathDetail/Addshixuns.js delete mode 100644 public/react/src/modules/paths/PathDetail/DetailCards.js delete mode 100644 public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js delete mode 100644 public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js delete mode 100644 public/react/src/modules/paths/PathDetail/DetailCardsTemp.js delete mode 100644 public/react/src/modules/paths/PathDetail/DetailTop.css delete mode 100644 public/react/src/modules/paths/PathDetail/DetailTop.js delete mode 100644 public/react/src/modules/paths/PathDetail/Modifytext.js delete mode 100644 public/react/src/modules/paths/PathDetail/OpenCourse.js delete mode 100644 public/react/src/modules/paths/PathDetail/PathDetailIndex.js delete mode 100644 public/react/src/modules/paths/PathDetail/addCollaborators.js delete mode 100644 public/react/src/modules/paths/PathDetail/sendPanel.js delete mode 100644 public/react/src/modules/paths/PathNew.js delete mode 100644 public/react/src/modules/paths/SchoolStatistics/FirstTab.js delete mode 100644 public/react/src/modules/paths/SchoolStatistics/SecondTab.js delete mode 100644 public/react/src/modules/paths/SchoolStatistics/Statistics.js delete mode 100644 public/react/src/modules/paths/SchoolStatistics/ThirdTab.js delete mode 100644 public/react/src/modules/paths/ShixunPathCard.js delete mode 100644 public/react/src/modules/paths/ShixunPathSearch.js delete mode 100644 public/react/src/modules/paths/ShixunPaths.css delete mode 100644 public/react/src/modules/paths/ShixunPaths.js delete mode 100644 public/react/src/modules/paths/statics/DisplayTableData.js delete mode 100644 public/react/src/modules/paths/statics/StaticNumberAndTxt.js delete mode 100644 public/react/src/modules/paths/statics/index.js delete mode 100644 public/react/src/modules/paths/statics/index.scss delete mode 100644 public/react/src/modules/paths/statics/mockData.js delete mode 100644 public/react/src/modules/projectPackages/MDEditors.js delete mode 100644 public/react/src/modules/projectPackages/PackageIndex/PackageBanner.js delete mode 100644 public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js delete mode 100644 public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js delete mode 100644 public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/NEITaskDetailsModel.js delete mode 100644 public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js delete mode 100644 public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/img/gouxuan.png delete mode 100644 public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/img/weigouxuan.png delete mode 100755 public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/newsone.png delete mode 100755 public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/newstwo.png delete mode 100644 public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/pds.css delete mode 100644 public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBanner.js delete mode 100644 public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js delete mode 100644 public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js delete mode 100644 public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js delete mode 100644 public/react/src/modules/projectPackages/PackageIndexNewandEdit/PhoneModel.js delete mode 100644 public/react/src/modules/projectPackages/ProjectPackageIndex.js delete mode 100644 public/react/src/modules/projectPackages/packageconcnet.css delete mode 100644 public/react/src/modules/question/NewMyShixunModel.js delete mode 100644 public/react/src/modules/question/Paperreview.js delete mode 100644 public/react/src/modules/question/Paperreview_item.js delete mode 100644 public/react/src/modules/question/Paperreview_items.js delete mode 100644 public/react/src/modules/question/Paperreview_judgment.js delete mode 100644 public/react/src/modules/question/Paperreview_multlple.js delete mode 100644 public/react/src/modules/question/Paperreview_program.js delete mode 100644 public/react/src/modules/question/Paperreview_single.js delete mode 100644 public/react/src/modules/question/Question.js delete mode 100644 public/react/src/modules/question/Questionitem_banks.js delete mode 100644 public/react/src/modules/question/animation/parabola.js delete mode 100644 public/react/src/modules/question/component/Choicequestion.js delete mode 100644 public/react/src/modules/question/component/ChoquesEditor.js delete mode 100644 public/react/src/modules/question/component/Contentpart.js delete mode 100644 public/react/src/modules/question/component/Contentquestionbank.js delete mode 100644 public/react/src/modules/question/component/Headplugselection.js delete mode 100644 public/react/src/modules/question/component/Headplugselections.js delete mode 100644 public/react/src/modules/question/component/IntelligentModel.js delete mode 100644 public/react/src/modules/question/component/Itembankstop.js delete mode 100644 public/react/src/modules/question/component/JudquestionEditor.js delete mode 100644 public/react/src/modules/question/component/Listjihe.js delete mode 100644 public/react/src/modules/question/component/Newknledpots.js delete mode 100644 public/react/src/modules/question/component/NoneData.js delete mode 100644 public/react/src/modules/question/component/NoneDatas.js delete mode 100644 public/react/src/modules/question/component/PaperDeletModel.js delete mode 100644 public/react/src/modules/question/component/PaperDeletModels.js delete mode 100644 public/react/src/modules/question/component/Paperreview_itemModel.js delete mode 100644 public/react/src/modules/question/component/Paperreview_itemModels.js delete mode 100644 public/react/src/modules/question/component/QuestionModal.js delete mode 100644 public/react/src/modules/question/component/QuestionModals.js delete mode 100644 public/react/src/modules/question/component/SiderBars.js delete mode 100644 public/react/src/modules/question/component/SingleEditor.js delete mode 100644 public/react/src/modules/question/comthetestpaper/Comthetestpaperst.js delete mode 100644 public/react/src/modules/question/comthetestpaper/Intelligentcomponents.js delete mode 100644 public/react/src/modules/question/comthetestpaper/lntlligentpone.js delete mode 100644 public/react/src/modules/question/questioncss/questioncom.css delete mode 100644 public/react/src/modules/test/ShareTest.js delete mode 100644 public/react/src/modules/test/TestCrop.js delete mode 100644 public/react/src/modules/test/TestRC.js delete mode 100644 public/react/src/modules/test/codemirror/TestCodeMirror.js delete mode 100644 public/react/src/modules/test/dnd/TestDragBeautiful.js delete mode 100644 public/react/src/modules/test/index.js delete mode 100644 public/react/src/modules/test/md/TestMaterialDesign.js delete mode 100644 public/react/src/modules/test/md/ii_debug.js delete mode 100644 public/react/src/modules/test/monaco/index.js delete mode 100644 public/react/src/modules/test/urlquery/TestUrlQuery.js delete mode 100644 public/react/src/modules/testpaper/Intecomponents.js delete mode 100644 public/react/src/modules/testpaper/Paperlibraryeditid.js delete mode 100644 public/react/src/modules/testpaper/Paperlibraryseeid.js delete mode 100644 public/react/src/modules/testpaper/Testpaperlibrary.js delete mode 100644 public/react/src/modules/testpaper/component/Contentpart.js delete mode 100644 public/react/src/modules/testpaper/component/Contentquestionbank.js delete mode 100644 public/react/src/modules/testpaper/component/Listjihe.js delete mode 100644 public/react/src/modules/testpaper/component/NoneData.js delete mode 100644 public/react/src/modules/testpaper/component/NoneDatas.js delete mode 100644 public/react/src/modules/testpaper/component/Paperlibraryseeid_item.js delete mode 100644 public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js delete mode 100644 public/react/src/modules/testpaper/component/Paperlibraryseeid_itemss.js delete mode 100644 public/react/src/modules/testpaper/component/Paperlibraryseeid_itemsss.js delete mode 100644 public/react/src/modules/testpaper/component/QuestionModal.js delete mode 100644 public/react/src/modules/testpaper/component/QuestionModals.js delete mode 100644 public/react/src/modules/testpaper/component/Seeoagertit.js delete mode 100644 public/react/src/modules/testpaper/component/Seeoagertits.js delete mode 100644 public/react/src/modules/testpaper/testioncss/testioncss.css delete mode 100644 public/react/src/modules/topic_bank/Topic_bank.js delete mode 100644 public/react/src/modules/tpm/1.js delete mode 100644 public/react/src/modules/tpm/Audit_situationComponent.js delete mode 100644 public/react/src/modules/tpm/NewFooter.js delete mode 100644 public/react/src/modules/tpm/NewHeader.js delete mode 100644 public/react/src/modules/tpm/SiderBar.js delete mode 100644 public/react/src/modules/tpm/TPMBanner.js delete mode 100644 public/react/src/modules/tpm/TPMChallenge.js delete mode 100644 public/react/src/modules/tpm/TPMChallengeContainer.js delete mode 100644 public/react/src/modules/tpm/TPMCollaborators.js delete mode 100644 public/react/src/modules/tpm/TPMCollaboratorsContainer.js delete mode 100644 public/react/src/modules/tpm/TPMDataset.js delete mode 100644 public/react/src/modules/tpm/TPMFork/TPMForklist.js delete mode 100644 public/react/src/modules/tpm/TPMFork/shixunCss/fork.css delete mode 100644 public/react/src/modules/tpm/TPMFork/shixunCss/tag2.png delete mode 100644 public/react/src/modules/tpm/TPMFork_listContainer.js delete mode 100644 public/react/src/modules/tpm/TPMForklist.js delete mode 100644 public/react/src/modules/tpm/TPMIndex.css delete mode 100644 public/react/src/modules/tpm/TPMIndex.js delete mode 100644 public/react/src/modules/tpm/TPMIndexHOC.js delete mode 100644 public/react/src/modules/tpm/TPMPropaedeutics.js delete mode 100644 public/react/src/modules/tpm/TPMPropaedeuticsComponent.js delete mode 100644 public/react/src/modules/tpm/TPMRanking_list.js delete mode 100644 public/react/src/modules/tpm/TPMRanking_listContainer.js delete mode 100644 public/react/src/modules/tpm/TPMRepository.js delete mode 100644 public/react/src/modules/tpm/TPMRepositoryComponent.js delete mode 100644 public/react/src/modules/tpm/TPMShixunDiscuss.css delete mode 100644 public/react/src/modules/tpm/TPMShixunDiscuss.js delete mode 100644 public/react/src/modules/tpm/TPMShixunDiscussContainer.js delete mode 100644 public/react/src/modules/tpm/TPMUpdatepropaede/TPMUpdatepropaede.js delete mode 100644 public/react/src/modules/tpm/TPMsettings/Configuration.js delete mode 100644 public/react/src/modules/tpm/TPMsettings/LearningSettings.js delete mode 100644 public/react/src/modules/tpm/TPMsettings/Shixuninformation.js delete mode 100644 public/react/src/modules/tpm/TPMsettings/TPMsettings.js delete mode 100644 public/react/src/modules/tpm/TPMsettings/css/TPMsettings.css delete mode 100644 public/react/src/modules/tpm/TPMsettings/oldTPMsettings.js delete mode 100755 public/react/src/modules/tpm/beian.png delete mode 100644 public/react/src/modules/tpm/challengesnew/TPMMDEditor.js delete mode 100644 public/react/src/modules/tpm/challengesnew/TPManswer2.js delete mode 100644 public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js delete mode 100644 public/react/src/modules/tpm/challengesnew/TPMevaluation.js delete mode 100644 public/react/src/modules/tpm/challengesnew/TPMquestion.js delete mode 100644 public/react/src/modules/tpm/challengesnew/TpmQuestionEdit.js delete mode 100644 public/react/src/modules/tpm/challengesnew/TpmQuestionMain.js delete mode 100644 public/react/src/modules/tpm/challengesnew/TpmQuestionNew.js delete mode 100644 public/react/src/modules/tpm/challengesnew/TpmTask/TpmTaskIndex.js delete mode 100644 public/react/src/modules/tpm/challengesnew/css/TPMchallengesnew.css delete mode 100644 public/react/src/modules/tpm/challengesnew/css/newquestion.css delete mode 100644 public/react/src/modules/tpm/challengesnew/editorMD.js delete mode 100644 public/react/src/modules/tpm/challengesnew/old/TPManswer.js delete mode 100644 public/react/src/modules/tpm/challengesnew/old/TPMchallengesnew.js delete mode 100644 public/react/src/modules/tpm/component/TPMNav.js delete mode 100644 public/react/src/modules/tpm/component/TPMRightSection.js delete mode 100644 public/react/src/modules/tpm/component/TPMright.css delete mode 100644 public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js delete mode 100644 public/react/src/modules/tpm/jupyter/index.js delete mode 100644 public/react/src/modules/tpm/jupyter/index.scss delete mode 100644 public/react/src/modules/tpm/jupyter/leftPane/index.js delete mode 100644 public/react/src/modules/tpm/jupyter/leftPane/index.scss delete mode 100644 public/react/src/modules/tpm/jupyter/rightPane/index.js delete mode 100644 public/react/src/modules/tpm/jupyter/rightPane/index.scss delete mode 100644 public/react/src/modules/tpm/newshixuns/Newshixuns.js delete mode 100644 public/react/src/modules/tpm/newshixuns/Shixunmd.js delete mode 100644 public/react/src/modules/tpm/newshixuns/TPMNewshixuns/TPMNewshixuns.js delete mode 100644 public/react/src/modules/tpm/newshixuns/css/Newshixuns.css delete mode 100644 public/react/src/modules/tpm/newshixuns/oldNewshixuns.js delete mode 100755 public/react/src/modules/tpm/roundedRectangle.png delete mode 100644 public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js delete mode 100644 public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js delete mode 100644 public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.css delete mode 100644 public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js delete mode 100644 public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js delete mode 100644 public/react/src/modules/tpm/shixunchild/Ranking_list/Ranking_list.js delete mode 100644 public/react/src/modules/tpm/shixunchild/Repository/Repository.js delete mode 100644 public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js delete mode 100644 public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js delete mode 100644 public/react/src/modules/tpm/shixunchild/Repository/RepositoryCombinePath.js delete mode 100644 public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js delete mode 100644 public/react/src/modules/tpm/shixunchild/Repository/TPMRepositoryCommits.js delete mode 100644 public/react/src/modules/tpm/shixunchild/ShixunDiscuss/ShixunDiscuss.js delete mode 100644 public/react/src/modules/tpm/shixunchild/Shixunfork_list.js delete mode 100644 public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css delete mode 100644 public/react/src/modules/tpm/shixunchild/shixunchildCss/Shixunfork_list.css delete mode 100644 public/react/src/modules/tpm/shixuns/ShixunCard.js delete mode 100644 public/react/src/modules/tpm/shixuns/ShixunCardList.js delete mode 100644 public/react/src/modules/tpm/shixuns/ShixunSearchBar.js delete mode 100644 public/react/src/modules/tpm/shixuns/ShixunsIndex.js delete mode 100644 public/react/src/modules/tpm/shixuns/css/TPMBanner.css delete mode 100644 public/react/src/modules/tpm/shixuns/shixunCss/ShixunCardList.css delete mode 100644 public/react/src/modules/tpm/shixuns/shixunCss/ShixunSearchBar.css delete mode 100644 public/react/src/modules/tpm/shixuns/shixunCss/shixunCard.css delete mode 100644 public/react/src/modules/tpm/shixuns/shixunCss/tag2.png delete mode 100644 public/react/src/modules/tpm/shixuns/shixusFunction/ShixunSearchBar.js delete mode 100644 public/react/src/modules/tpm/tpmmodel/Tpmdatasetmodel.js delete mode 100644 public/react/src/modules/tpm/tpmmodel/common.css delete mode 100644 public/react/src/modules/tpm/tpmmodel/tpmmodel.css delete mode 100644 public/react/src/modules/user/AccountPage.js delete mode 100644 public/react/src/modules/user/AccountPhoneemail.js delete mode 100644 public/react/src/modules/user/AccountProfile.js delete mode 100644 public/react/src/modules/user/Accountnewprofile.js delete mode 100644 public/react/src/modules/user/CheckInputysl.js delete mode 100644 public/react/src/modules/user/FindPasswordComponent.js delete mode 100644 public/react/src/modules/user/Interestpage.js delete mode 100644 public/react/src/modules/user/InterestpageMax.js delete mode 100644 public/react/src/modules/user/LCCountDownButton.js delete mode 100644 public/react/src/modules/user/LoginRegisterComponent.css delete mode 100644 public/react/src/modules/user/LoginRegisterComponent.js delete mode 100644 public/react/src/modules/user/LoginRegisterPage.js delete mode 100644 public/react/src/modules/user/MyEduCoderModal.js delete mode 100644 public/react/src/modules/user/MyeducoderI.css delete mode 100644 public/react/src/modules/user/Notcompletedysl.js delete mode 100644 public/react/src/modules/user/ReadPassword.js delete mode 100644 public/react/src/modules/user/Trialapplicationreview.js delete mode 100644 public/react/src/modules/user/account/AccountBasic.js delete mode 100644 public/react/src/modules/user/account/AccountBasicEdit.js delete mode 100644 public/react/src/modules/user/account/AccountBasicEditItem.js delete mode 100644 public/react/src/modules/user/account/AccountBinding.js delete mode 100644 public/react/src/modules/user/account/AccountCertification.js delete mode 100644 public/react/src/modules/user/account/AccountImg.js delete mode 100644 public/react/src/modules/user/account/AccountNav.js delete mode 100644 public/react/src/modules/user/account/AccountSecure.js delete mode 100644 public/react/src/modules/user/account/ChangeHeaderPicModal.js delete mode 100644 public/react/src/modules/user/account/common.css delete mode 100644 public/react/src/modules/user/common.css delete mode 100644 public/react/src/modules/user/commontwo.css delete mode 100644 public/react/src/modules/user/img/WeChat.png delete mode 100644 public/react/src/modules/user/img/WeChat@2x.png delete mode 100644 public/react/src/modules/user/img/gouxuan.png delete mode 100755 public/react/src/modules/user/img/hdkf.png delete mode 100644 public/react/src/modules/user/img/meigouxuan.png delete mode 100755 public/react/src/modules/user/img/mytc.png delete mode 100755 public/react/src/modules/user/img/qdkf.png delete mode 100755 public/react/src/modules/user/img/qita.png delete mode 100644 public/react/src/modules/user/img/qq.png delete mode 100644 public/react/src/modules/user/img/qq@2x.png delete mode 100755 public/react/src/modules/user/img/rgzn.png delete mode 100755 public/react/src/modules/user/img/sjk.png delete mode 100755 public/react/src/modules/user/img/skzbdx.png delete mode 100755 public/react/src/modules/user/img/ydkf.png delete mode 100755 public/react/src/modules/user/img/ysj.png delete mode 100755 public/react/src/modules/user/img/yunwei.png delete mode 100755 public/react/src/modules/user/img/zyrs1.png delete mode 100644 public/react/src/modules/user/modal/ApplyForAddChildOrgModal.js delete mode 100644 public/react/src/modules/user/modal/ApplyForAddOrgModal.js delete mode 100644 public/react/src/modules/user/modal/RealNameCertificationModal.js delete mode 100644 public/react/src/modules/user/secureCode.css delete mode 100644 public/react/src/modules/user/usersInfo/Infos.js delete mode 100644 public/react/src/modules/user/usersInfo/InfosBank.js delete mode 100644 public/react/src/modules/user/usersInfo/InfosBanner.js delete mode 100644 public/react/src/modules/user/usersInfo/InfosCourse.js delete mode 100644 public/react/src/modules/user/usersInfo/InfosIndex.js delete mode 100644 public/react/src/modules/user/usersInfo/InfosPackage.js delete mode 100644 public/react/src/modules/user/usersInfo/InfosPath.js delete mode 100644 public/react/src/modules/user/usersInfo/InfosProject.js delete mode 100644 public/react/src/modules/user/usersInfo/InfosShixun.js delete mode 100644 public/react/src/modules/user/usersInfo/InfosTopics.js delete mode 100755 public/react/src/modules/user/usersInfo/Withoutpermission.png delete mode 100644 public/react/src/modules/user/usersInfo/banks/BanksIndex.js delete mode 100644 public/react/src/modules/user/usersInfo/banks/BanksTabIndex.js delete mode 100644 public/react/src/modules/user/usersInfo/banks/ExerciseBanksDetail.js delete mode 100644 public/react/src/modules/user/usersInfo/banks/ExerciseBanksEdit.js delete mode 100644 public/react/src/modules/user/usersInfo/banks/GtaskBanksEdit.js delete mode 100644 public/react/src/modules/user/usersInfo/banks/GtopicBanks.js delete mode 100644 public/react/src/modules/user/usersInfo/banks/GtopicBanksEdit.js delete mode 100644 public/react/src/modules/user/usersInfo/banks/HomeworkBanksEdit.js delete mode 100644 public/react/src/modules/user/usersInfo/banks/NewGtaskForm.js delete mode 100644 public/react/src/modules/user/usersInfo/banks/PollBanksContent.js delete mode 100644 public/react/src/modules/user/usersInfo/banks/banksMenu.js delete mode 100644 public/react/src/modules/user/usersInfo/banner_out.js delete mode 100644 public/react/src/modules/user/usersInfo/common/CRoundSelect.js delete mode 100644 public/react/src/modules/user/usersInfo/common/HeadlessModal.js delete mode 100644 public/react/src/modules/user/usersInfo/common/InfoTab.js delete mode 100644 public/react/src/modules/user/usersInfo/publicCreatNew.js delete mode 100644 public/react/src/modules/user/usersInfo/usersInfo.css delete mode 100644 public/react/src/modules/user/usersInfo/video/AliyunUploaderManager.js delete mode 100644 public/react/src/modules/user/usersInfo/video/EditVideoModal.js delete mode 100644 public/react/src/modules/user/usersInfo/video/InfosVideo.css delete mode 100644 public/react/src/modules/user/usersInfo/video/InfosVideo.js delete mode 100644 public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js delete mode 100644 public/react/src/modules/user/usersInfo/video/VideoItem.js delete mode 100644 public/react/src/modules/user/usersInfo/video/VideoProtocol.js delete mode 100644 public/react/src/modules/user/usersInfo/video/VideoPublishSuccess.js delete mode 100644 public/react/src/modules/user/usersInfo/video/VideoReducer.js delete mode 100644 public/react/src/modules/user/usersInfo/video/VideoUpload.js delete mode 100644 public/react/src/modules/user/usersInfo/video/VideoUploadList.js delete mode 100644 public/react/src/modules/user/usersInfo/video/VideoUtil.js delete mode 100644 public/react/src/modules/user/usersInfo/video/images/ok_border.png delete mode 100644 public/react/src/modules/user/usersInfo/video/images/play.png delete mode 100644 public/react/src/modules/user/usersInfo/video/images/upload.png delete mode 100644 public/react/src/modules/user/usersInfo/video/images/upload_hover.png delete mode 100644 public/react/src/modules/wxcode/index.js delete mode 100644 public/react/src/modules/wxcode/index.scss delete mode 100644 public/react/src/public-path.js delete mode 100644 public/react/src/redux/README.md delete mode 100644 public/react/src/redux/actions/actionTypes.js delete mode 100644 public/react/src/redux/actions/comment.js delete mode 100644 public/react/src/redux/actions/common.js delete mode 100644 public/react/src/redux/actions/index.js delete mode 100644 public/react/src/redux/actions/jupyter.js delete mode 100644 public/react/src/redux/actions/ojForUser.js delete mode 100644 public/react/src/redux/actions/ojForm.js delete mode 100644 public/react/src/redux/actions/ojList.js delete mode 100644 public/react/src/redux/actions/static.js delete mode 100644 public/react/src/redux/actions/testAction.js delete mode 100644 public/react/src/redux/actions/tpi.js delete mode 100644 public/react/src/redux/actions/user.js delete mode 100644 public/react/src/redux/actions/wxCode.js delete mode 100644 public/react/src/redux/reducers/commentReducer.js delete mode 100644 public/react/src/redux/reducers/commonReducer.js delete mode 100644 public/react/src/redux/reducers/index.js delete mode 100644 public/react/src/redux/reducers/jupyterReducer.js delete mode 100644 public/react/src/redux/reducers/ojForUserReducer.js delete mode 100644 public/react/src/redux/reducers/ojFormReducer.js delete mode 100644 public/react/src/redux/reducers/ojListReducer.js delete mode 100644 public/react/src/redux/reducers/staticReducer.js delete mode 100644 public/react/src/redux/reducers/testReducer.js delete mode 100644 public/react/src/redux/reducers/tpiReducer.js delete mode 100644 public/react/src/redux/reducers/userReducer.js delete mode 100644 public/react/src/redux/reducers/wxcodeReducer.js delete mode 100644 public/react/src/redux/stores/configureStore.js delete mode 100644 public/react/src/registerServiceWorker.js delete mode 100644 public/react/src/search/SearchPage.js delete mode 100644 public/react/src/search/searchc.css delete mode 100644 public/react/src/services/commentService.js delete mode 100644 public/react/src/services/jupyterServer.js delete mode 100644 public/react/src/services/ojService.js delete mode 100644 public/react/src/services/staticService.js delete mode 100644 public/react/src/services/wxcodeService.js diff --git a/public/quill/quill.bubble.css b/public/quill/quill.bubble.css deleted file mode 100644 index aaa24cc83..000000000 --- a/public/quill/quill.bubble.css +++ /dev/null @@ -1,952 +0,0 @@ -/*! - * Quill Editor v1.3.6 - * https://quilljs.com/ - * Copyright (c) 2014, Jason Chen - * Copyright (c) 2013, salesforce.com - */ -.ql-container { - box-sizing: border-box; - font-family: Helvetica, Arial, sans-serif; - font-size: 13px; - height: 100%; - margin: 0px; - position: relative; -} -.ql-container.ql-disabled .ql-tooltip { - visibility: hidden; -} -.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { - pointer-events: none; -} -.ql-clipboard { - left: -100000px; - height: 1px; - overflow-y: hidden; - position: absolute; - top: 50%; -} -.ql-clipboard p { - margin: 0; - padding: 0; -} -.ql-editor { - box-sizing: border-box; - line-height: 1.42; - height: 100%; - outline: none; - overflow-y: auto; - padding: 12px 15px; - tab-size: 4; - -moz-tab-size: 4; - text-align: left; - white-space: pre-wrap; - word-wrap: break-word; -} -.ql-editor > * { - cursor: text; -} -.ql-editor p, -.ql-editor ol, -.ql-editor ul, -.ql-editor pre, -.ql-editor blockquote, -.ql-editor h1, -.ql-editor h2, -.ql-editor h3, -.ql-editor h4, -.ql-editor h5, -.ql-editor h6 { - margin: 0; - padding: 0; - counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; -} -.ql-editor ol, -.ql-editor ul { - padding-left: 1.5em; -} -.ql-editor ol > li, -.ql-editor ul > li { - list-style-type: none; -} -.ql-editor ul > li::before { - content: '\2022'; -} -.ql-editor ul[data-checked=true], -.ql-editor ul[data-checked=false] { - pointer-events: none; -} -.ql-editor ul[data-checked=true] > li *, -.ql-editor ul[data-checked=false] > li * { - pointer-events: all; -} -.ql-editor ul[data-checked=true] > li::before, -.ql-editor ul[data-checked=false] > li::before { - color: #777; - cursor: pointer; - pointer-events: all; -} -.ql-editor ul[data-checked=true] > li::before { - content: '\2611'; -} -.ql-editor ul[data-checked=false] > li::before { - content: '\2610'; -} -.ql-editor li::before { - display: inline-block; - white-space: nowrap; - width: 1.2em; -} -.ql-editor li:not(.ql-direction-rtl)::before { - margin-left: -1.5em; - margin-right: 0.3em; - text-align: right; -} -.ql-editor li.ql-direction-rtl::before { - margin-left: 0.3em; - margin-right: -1.5em; -} -.ql-editor ol li:not(.ql-direction-rtl), -.ql-editor ul li:not(.ql-direction-rtl) { - padding-left: 1.5em; -} -.ql-editor ol li.ql-direction-rtl, -.ql-editor ul li.ql-direction-rtl { - padding-right: 1.5em; -} -.ql-editor ol li { - counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; - counter-increment: list-0; -} -.ql-editor ol li:before { - content: counter(list-0, decimal) '. '; -} -.ql-editor ol li.ql-indent-1 { - counter-increment: list-1; -} -.ql-editor ol li.ql-indent-1:before { - content: counter(list-1, lower-alpha) '. '; -} -.ql-editor ol li.ql-indent-1 { - counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-2 { - counter-increment: list-2; -} -.ql-editor ol li.ql-indent-2:before { - content: counter(list-2, lower-roman) '. '; -} -.ql-editor ol li.ql-indent-2 { - counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-3 { - counter-increment: list-3; -} -.ql-editor ol li.ql-indent-3:before { - content: counter(list-3, decimal) '. '; -} -.ql-editor ol li.ql-indent-3 { - counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-4 { - counter-increment: list-4; -} -.ql-editor ol li.ql-indent-4:before { - content: counter(list-4, lower-alpha) '. '; -} -.ql-editor ol li.ql-indent-4 { - counter-reset: list-5 list-6 list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-5 { - counter-increment: list-5; -} -.ql-editor ol li.ql-indent-5:before { - content: counter(list-5, lower-roman) '. '; -} -.ql-editor ol li.ql-indent-5 { - counter-reset: list-6 list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-6 { - counter-increment: list-6; -} -.ql-editor ol li.ql-indent-6:before { - content: counter(list-6, decimal) '. '; -} -.ql-editor ol li.ql-indent-6 { - counter-reset: list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-7 { - counter-increment: list-7; -} -.ql-editor ol li.ql-indent-7:before { - content: counter(list-7, lower-alpha) '. '; -} -.ql-editor ol li.ql-indent-7 { - counter-reset: list-8 list-9; -} -.ql-editor ol li.ql-indent-8 { - counter-increment: list-8; -} -.ql-editor ol li.ql-indent-8:before { - content: counter(list-8, lower-roman) '. '; -} -.ql-editor ol li.ql-indent-8 { - counter-reset: list-9; -} -.ql-editor ol li.ql-indent-9 { - counter-increment: list-9; -} -.ql-editor ol li.ql-indent-9:before { - content: counter(list-9, decimal) '. '; -} -.ql-editor .ql-indent-1:not(.ql-direction-rtl) { - padding-left: 3em; -} -.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { - padding-left: 4.5em; -} -.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { - padding-right: 3em; -} -.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { - padding-right: 4.5em; -} -.ql-editor .ql-indent-2:not(.ql-direction-rtl) { - padding-left: 6em; -} -.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { - padding-left: 7.5em; -} -.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { - padding-right: 6em; -} -.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { - padding-right: 7.5em; -} -.ql-editor .ql-indent-3:not(.ql-direction-rtl) { - padding-left: 9em; -} -.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { - padding-left: 10.5em; -} -.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { - padding-right: 9em; -} -.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { - padding-right: 10.5em; -} -.ql-editor .ql-indent-4:not(.ql-direction-rtl) { - padding-left: 12em; -} -.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { - padding-left: 13.5em; -} -.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { - padding-right: 12em; -} -.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { - padding-right: 13.5em; -} -.ql-editor .ql-indent-5:not(.ql-direction-rtl) { - padding-left: 15em; -} -.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { - padding-left: 16.5em; -} -.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { - padding-right: 15em; -} -.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { - padding-right: 16.5em; -} -.ql-editor .ql-indent-6:not(.ql-direction-rtl) { - padding-left: 18em; -} -.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { - padding-left: 19.5em; -} -.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { - padding-right: 18em; -} -.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { - padding-right: 19.5em; -} -.ql-editor .ql-indent-7:not(.ql-direction-rtl) { - padding-left: 21em; -} -.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { - padding-left: 22.5em; -} -.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { - padding-right: 21em; -} -.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { - padding-right: 22.5em; -} -.ql-editor .ql-indent-8:not(.ql-direction-rtl) { - padding-left: 24em; -} -.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { - padding-left: 25.5em; -} -.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { - padding-right: 24em; -} -.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { - padding-right: 25.5em; -} -.ql-editor .ql-indent-9:not(.ql-direction-rtl) { - padding-left: 27em; -} -.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { - padding-left: 28.5em; -} -.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { - padding-right: 27em; -} -.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { - padding-right: 28.5em; -} -.ql-editor .ql-video { - display: block; - max-width: 100%; -} -.ql-editor .ql-video.ql-align-center { - margin: 0 auto; -} -.ql-editor .ql-video.ql-align-right { - margin: 0 0 0 auto; -} -.ql-editor .ql-bg-black { - background-color: #000; -} -.ql-editor .ql-bg-red { - background-color: #e60000; -} -.ql-editor .ql-bg-orange { - background-color: #f90; -} -.ql-editor .ql-bg-yellow { - background-color: #ff0; -} -.ql-editor .ql-bg-green { - background-color: #008a00; -} -.ql-editor .ql-bg-blue { - background-color: #06c; -} -.ql-editor .ql-bg-purple { - background-color: #93f; -} -.ql-editor .ql-color-white { - color: #fff; -} -.ql-editor .ql-color-red { - color: #e60000; -} -.ql-editor .ql-color-orange { - color: #f90; -} -.ql-editor .ql-color-yellow { - color: #ff0; -} -.ql-editor .ql-color-green { - color: #008a00; -} -.ql-editor .ql-color-blue { - color: #06c; -} -.ql-editor .ql-color-purple { - color: #93f; -} -.ql-editor .ql-font-serif { - font-family: Georgia, Times New Roman, serif; -} -.ql-editor .ql-font-monospace { - font-family: Monaco, Courier New, monospace; -} -.ql-editor .ql-size-small { - font-size: 0.75em; -} -.ql-editor .ql-size-large { - font-size: 1.5em; -} -.ql-editor .ql-size-huge { - font-size: 2.5em; -} -.ql-editor .ql-direction-rtl { - direction: rtl; - text-align: inherit; -} -.ql-editor .ql-align-center { - text-align: center; -} -.ql-editor .ql-align-justify { - text-align: justify; -} -.ql-editor .ql-align-right { - text-align: right; -} -.ql-editor.ql-blank::before { - color: rgba(0,0,0,0.6); - content: attr(data-placeholder); - font-style: italic; - left: 15px; - pointer-events: none; - position: absolute; - right: 15px; -} -.ql-bubble.ql-toolbar:after, -.ql-bubble .ql-toolbar:after { - clear: both; - content: ''; - display: table; -} -.ql-bubble.ql-toolbar button, -.ql-bubble .ql-toolbar button { - background: none; - border: none; - cursor: pointer; - display: inline-block; - float: left; - height: 24px; - padding: 3px 5px; - width: 28px; -} -.ql-bubble.ql-toolbar button svg, -.ql-bubble .ql-toolbar button svg { - float: left; - height: 100%; -} -.ql-bubble.ql-toolbar button:active:hover, -.ql-bubble .ql-toolbar button:active:hover { - outline: none; -} -.ql-bubble.ql-toolbar input.ql-image[type=file], -.ql-bubble .ql-toolbar input.ql-image[type=file] { - display: none; -} -.ql-bubble.ql-toolbar button:hover, -.ql-bubble .ql-toolbar button:hover, -.ql-bubble.ql-toolbar button:focus, -.ql-bubble .ql-toolbar button:focus, -.ql-bubble.ql-toolbar button.ql-active, -.ql-bubble .ql-toolbar button.ql-active, -.ql-bubble.ql-toolbar .ql-picker-label:hover, -.ql-bubble .ql-toolbar .ql-picker-label:hover, -.ql-bubble.ql-toolbar .ql-picker-label.ql-active, -.ql-bubble .ql-toolbar .ql-picker-label.ql-active, -.ql-bubble.ql-toolbar .ql-picker-item:hover, -.ql-bubble .ql-toolbar .ql-picker-item:hover, -.ql-bubble.ql-toolbar .ql-picker-item.ql-selected, -.ql-bubble .ql-toolbar .ql-picker-item.ql-selected { - color: #fff; -} -.ql-bubble.ql-toolbar button:hover .ql-fill, -.ql-bubble .ql-toolbar button:hover .ql-fill, -.ql-bubble.ql-toolbar button:focus .ql-fill, -.ql-bubble .ql-toolbar button:focus .ql-fill, -.ql-bubble.ql-toolbar button.ql-active .ql-fill, -.ql-bubble .ql-toolbar button.ql-active .ql-fill, -.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-fill, -.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-fill, -.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-fill, -.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-fill, -.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-fill, -.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-fill, -.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-fill, -.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-fill, -.ql-bubble.ql-toolbar button:hover .ql-stroke.ql-fill, -.ql-bubble .ql-toolbar button:hover .ql-stroke.ql-fill, -.ql-bubble.ql-toolbar button:focus .ql-stroke.ql-fill, -.ql-bubble .ql-toolbar button:focus .ql-stroke.ql-fill, -.ql-bubble.ql-toolbar button.ql-active .ql-stroke.ql-fill, -.ql-bubble .ql-toolbar button.ql-active .ql-stroke.ql-fill, -.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, -.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, -.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, -.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, -.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, -.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, -.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill, -.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill { - fill: #fff; -} -.ql-bubble.ql-toolbar button:hover .ql-stroke, -.ql-bubble .ql-toolbar button:hover .ql-stroke, -.ql-bubble.ql-toolbar button:focus .ql-stroke, -.ql-bubble .ql-toolbar button:focus .ql-stroke, -.ql-bubble.ql-toolbar button.ql-active .ql-stroke, -.ql-bubble .ql-toolbar button.ql-active .ql-stroke, -.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke, -.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke, -.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke, -.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke, -.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke, -.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke, -.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke, -.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke, -.ql-bubble.ql-toolbar button:hover .ql-stroke-miter, -.ql-bubble .ql-toolbar button:hover .ql-stroke-miter, -.ql-bubble.ql-toolbar button:focus .ql-stroke-miter, -.ql-bubble .ql-toolbar button:focus .ql-stroke-miter, -.ql-bubble.ql-toolbar button.ql-active .ql-stroke-miter, -.ql-bubble .ql-toolbar button.ql-active .ql-stroke-miter, -.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke-miter, -.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke-miter, -.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, -.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, -.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke-miter, -.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke-miter, -.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter, -.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter { - stroke: #fff; -} -@media (pointer: coarse) { - .ql-bubble.ql-toolbar button:hover:not(.ql-active), - .ql-bubble .ql-toolbar button:hover:not(.ql-active) { - color: #ccc; - } - .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-fill, - .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-fill, - .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill, - .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill { - fill: #ccc; - } - .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke, - .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke, - .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter, - .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter { - stroke: #ccc; - } -} -.ql-bubble { - box-sizing: border-box; -} -.ql-bubble * { - box-sizing: border-box; -} -.ql-bubble .ql-hidden { - display: none; -} -.ql-bubble .ql-out-bottom, -.ql-bubble .ql-out-top { - visibility: hidden; -} -.ql-bubble .ql-tooltip { - position: absolute; - transform: translateY(10px); -} -.ql-bubble .ql-tooltip a { - cursor: pointer; - text-decoration: none; -} -.ql-bubble .ql-tooltip.ql-flip { - transform: translateY(-10px); -} -.ql-bubble .ql-formats { - display: inline-block; - vertical-align: middle; -} -.ql-bubble .ql-formats:after { - clear: both; - content: ''; - display: table; -} -.ql-bubble .ql-stroke { - fill: none; - stroke: #ccc; - stroke-linecap: round; - stroke-linejoin: round; - stroke-width: 2; -} -.ql-bubble .ql-stroke-miter { - fill: none; - stroke: #ccc; - stroke-miterlimit: 10; - stroke-width: 2; -} -.ql-bubble .ql-fill, -.ql-bubble .ql-stroke.ql-fill { - fill: #ccc; -} -.ql-bubble .ql-empty { - fill: none; -} -.ql-bubble .ql-even { - fill-rule: evenodd; -} -.ql-bubble .ql-thin, -.ql-bubble .ql-stroke.ql-thin { - stroke-width: 1; -} -.ql-bubble .ql-transparent { - opacity: 0.4; -} -.ql-bubble .ql-direction svg:last-child { - display: none; -} -.ql-bubble .ql-direction.ql-active svg:last-child { - display: inline; -} -.ql-bubble .ql-direction.ql-active svg:first-child { - display: none; -} -.ql-bubble .ql-editor h1 { - font-size: 2em; -} -.ql-bubble .ql-editor h2 { - font-size: 1.5em; -} -.ql-bubble .ql-editor h3 { - font-size: 1.17em; -} -.ql-bubble .ql-editor h4 { - font-size: 1em; -} -.ql-bubble .ql-editor h5 { - font-size: 0.83em; -} -.ql-bubble .ql-editor h6 { - font-size: 0.67em; -} -.ql-bubble .ql-editor a { - text-decoration: underline; -} -.ql-bubble .ql-editor blockquote { - border-left: 4px solid #ccc; - margin-bottom: 5px; - margin-top: 5px; - padding-left: 16px; -} -.ql-bubble .ql-editor code, -.ql-bubble .ql-editor pre { - background-color: #f0f0f0; - border-radius: 3px; -} -.ql-bubble .ql-editor pre { - white-space: pre-wrap; - margin-bottom: 5px; - margin-top: 5px; - padding: 5px 10px; -} -.ql-bubble .ql-editor code { - font-size: 85%; - padding: 2px 4px; -} -.ql-bubble .ql-editor pre.ql-syntax { - background-color: #23241f; - color: #f8f8f2; - overflow: visible; -} -.ql-bubble .ql-editor img { - max-width: 100%; -} -.ql-bubble .ql-picker { - color: #ccc; - display: inline-block; - float: left; - font-size: 14px; - font-weight: 500; - height: 24px; - position: relative; - vertical-align: middle; -} -.ql-bubble .ql-picker-label { - cursor: pointer; - display: inline-block; - height: 100%; - padding-left: 8px; - padding-right: 2px; - position: relative; - width: 100%; -} -.ql-bubble .ql-picker-label::before { - display: inline-block; - line-height: 22px; -} -.ql-bubble .ql-picker-options { - background-color: #444; - display: none; - min-width: 100%; - padding: 4px 8px; - position: absolute; - white-space: nowrap; -} -.ql-bubble .ql-picker-options .ql-picker-item { - cursor: pointer; - display: block; - padding-bottom: 5px; - padding-top: 5px; -} -.ql-bubble .ql-picker.ql-expanded .ql-picker-label { - color: #777; - z-index: 2; -} -.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-fill { - fill: #777; -} -.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-stroke { - stroke: #777; -} -.ql-bubble .ql-picker.ql-expanded .ql-picker-options { - display: block; - margin-top: -1px; - top: 100%; - z-index: 1; -} -.ql-bubble .ql-color-picker, -.ql-bubble .ql-icon-picker { - width: 28px; -} -.ql-bubble .ql-color-picker .ql-picker-label, -.ql-bubble .ql-icon-picker .ql-picker-label { - padding: 2px 4px; -} -.ql-bubble .ql-color-picker .ql-picker-label svg, -.ql-bubble .ql-icon-picker .ql-picker-label svg { - right: 4px; -} -.ql-bubble .ql-icon-picker .ql-picker-options { - padding: 4px 0px; -} -.ql-bubble .ql-icon-picker .ql-picker-item { - height: 24px; - width: 24px; - padding: 2px 4px; -} -.ql-bubble .ql-color-picker .ql-picker-options { - padding: 3px 5px; - width: 152px; -} -.ql-bubble .ql-color-picker .ql-picker-item { - border: 1px solid transparent; - float: left; - height: 16px; - margin: 2px; - padding: 0px; - width: 16px; -} -.ql-bubble .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg { - position: absolute; - margin-top: -9px; - right: 0; - top: 50%; - width: 18px; -} -.ql-bubble .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before, -.ql-bubble .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before, -.ql-bubble .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before, -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before, -.ql-bubble .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before, -.ql-bubble .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before { - content: attr(data-label); -} -.ql-bubble .ql-picker.ql-header { - width: 98px; -} -.ql-bubble .ql-picker.ql-header .ql-picker-label::before, -.ql-bubble .ql-picker.ql-header .ql-picker-item::before { - content: 'Normal'; -} -.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { - content: 'Heading 1'; -} -.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { - content: 'Heading 2'; -} -.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { - content: 'Heading 3'; -} -.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { - content: 'Heading 4'; -} -.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="5"]::before, -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { - content: 'Heading 5'; -} -.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="6"]::before, -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { - content: 'Heading 6'; -} -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { - font-size: 2em; -} -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { - font-size: 1.5em; -} -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { - font-size: 1.17em; -} -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { - font-size: 1em; -} -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { - font-size: 0.83em; -} -.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { - font-size: 0.67em; -} -.ql-bubble .ql-picker.ql-font { - width: 108px; -} -.ql-bubble .ql-picker.ql-font .ql-picker-label::before, -.ql-bubble .ql-picker.ql-font .ql-picker-item::before { - content: 'Sans Serif'; -} -.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=serif]::before, -.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { - content: 'Serif'; -} -.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before, -.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { - content: 'Monospace'; -} -.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { - font-family: Georgia, Times New Roman, serif; -} -.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { - font-family: Monaco, Courier New, monospace; -} -.ql-bubble .ql-picker.ql-size { - width: 98px; -} -.ql-bubble .ql-picker.ql-size .ql-picker-label::before, -.ql-bubble .ql-picker.ql-size .ql-picker-item::before { - content: 'Normal'; -} -.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=small]::before, -.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before { - content: 'Small'; -} -.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=large]::before, -.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before { - content: 'Large'; -} -.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=huge]::before, -.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { - content: 'Huge'; -} -.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before { - font-size: 10px; -} -.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before { - font-size: 18px; -} -.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { - font-size: 32px; -} -.ql-bubble .ql-color-picker.ql-background .ql-picker-item { - background-color: #fff; -} -.ql-bubble .ql-color-picker.ql-color .ql-picker-item { - background-color: #000; -} -.ql-bubble .ql-toolbar .ql-formats { - margin: 8px 12px 8px 0px; -} -.ql-bubble .ql-toolbar .ql-formats:first-child { - margin-left: 12px; -} -.ql-bubble .ql-color-picker svg { - margin: 1px; -} -.ql-bubble .ql-color-picker .ql-picker-item.ql-selected, -.ql-bubble .ql-color-picker .ql-picker-item:hover { - border-color: #fff; -} -.ql-bubble .ql-tooltip { - background-color: #444; - border-radius: 25px; - color: #fff; -} -.ql-bubble .ql-tooltip-arrow { - border-left: 6px solid transparent; - border-right: 6px solid transparent; - content: " "; - display: block; - left: 50%; - margin-left: -6px; - position: absolute; -} -.ql-bubble .ql-tooltip:not(.ql-flip) .ql-tooltip-arrow { - border-bottom: 6px solid #444; - top: -6px; -} -.ql-bubble .ql-tooltip.ql-flip .ql-tooltip-arrow { - border-top: 6px solid #444; - bottom: -6px; -} -.ql-bubble .ql-tooltip.ql-editing .ql-tooltip-editor { - display: block; -} -.ql-bubble .ql-tooltip.ql-editing .ql-formats { - visibility: hidden; -} -.ql-bubble .ql-tooltip-editor { - display: none; -} -.ql-bubble .ql-tooltip-editor input[type=text] { - background: transparent; - border: none; - color: #fff; - font-size: 13px; - height: 100%; - outline: none; - padding: 10px 20px; - position: absolute; - width: 100%; -} -.ql-bubble .ql-tooltip-editor a { - top: 10px; - position: absolute; - right: 20px; -} -.ql-bubble .ql-tooltip-editor a:before { - color: #ccc; - content: "\D7"; - font-size: 16px; - font-weight: bold; -} -.ql-container.ql-bubble:not(.ql-disabled) a { - position: relative; - white-space: nowrap; -} -.ql-container.ql-bubble:not(.ql-disabled) a::before { - background-color: #444; - border-radius: 15px; - top: -5px; - font-size: 12px; - color: #fff; - content: attr(href); - font-weight: normal; - overflow: hidden; - padding: 5px 15px; - text-decoration: none; - z-index: 1; -} -.ql-container.ql-bubble:not(.ql-disabled) a::after { - border-top: 6px solid #444; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - top: 0; - content: " "; - height: 0; - width: 0; -} -.ql-container.ql-bubble:not(.ql-disabled) a::before, -.ql-container.ql-bubble:not(.ql-disabled) a::after { - left: 0; - margin-left: 50%; - position: absolute; - transform: translate(-50%, -100%); - transition: visibility 0s ease 200ms; - visibility: hidden; -} -.ql-container.ql-bubble:not(.ql-disabled) a:hover::before, -.ql-container.ql-bubble:not(.ql-disabled) a:hover::after { - visibility: visible; -} diff --git a/public/quill/quill.js b/public/quill/quill.js deleted file mode 100644 index 5dc8fbe3c..000000000 --- a/public/quill/quill.js +++ /dev/null @@ -1,11489 +0,0 @@ -/*! - * Quill Editor v1.3.6 - * https://quilljs.com/ - * Copyright (c) 2014, Jason Chen - * Copyright (c) 2013, salesforce.com - */ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["Quill"] = factory(); - else - root["Quill"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 109); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var container_1 = __webpack_require__(17); -var format_1 = __webpack_require__(18); -var leaf_1 = __webpack_require__(19); -var scroll_1 = __webpack_require__(45); -var inline_1 = __webpack_require__(46); -var block_1 = __webpack_require__(47); -var embed_1 = __webpack_require__(48); -var text_1 = __webpack_require__(49); -var attributor_1 = __webpack_require__(12); -var class_1 = __webpack_require__(32); -var style_1 = __webpack_require__(33); -var store_1 = __webpack_require__(31); -var Registry = __webpack_require__(1); -var Parchment = { - Scope: Registry.Scope, - create: Registry.create, - find: Registry.find, - query: Registry.query, - register: Registry.register, - Container: container_1.default, - Format: format_1.default, - Leaf: leaf_1.default, - Embed: embed_1.default, - Scroll: scroll_1.default, - Block: block_1.default, - Inline: inline_1.default, - Text: text_1.default, - Attributor: { - Attribute: attributor_1.default, - Class: class_1.default, - Style: style_1.default, - Store: store_1.default, - }, -}; -exports.default = Parchment; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var ParchmentError = /** @class */ (function (_super) { - __extends(ParchmentError, _super); - function ParchmentError(message) { - var _this = this; - message = '[Parchment] ' + message; - _this = _super.call(this, message) || this; - _this.message = message; - _this.name = _this.constructor.name; - return _this; - } - return ParchmentError; -}(Error)); -exports.ParchmentError = ParchmentError; -var attributes = {}; -var classes = {}; -var tags = {}; -var types = {}; -exports.DATA_KEY = '__blot'; -var Scope; -(function (Scope) { - Scope[Scope["TYPE"] = 3] = "TYPE"; - Scope[Scope["LEVEL"] = 12] = "LEVEL"; - Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; - Scope[Scope["BLOT"] = 14] = "BLOT"; - Scope[Scope["INLINE"] = 7] = "INLINE"; - Scope[Scope["BLOCK"] = 11] = "BLOCK"; - Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; - Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; - Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; - Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; - Scope[Scope["ANY"] = 15] = "ANY"; -})(Scope = exports.Scope || (exports.Scope = {})); -function create(input, value) { - var match = query(input); - if (match == null) { - throw new ParchmentError("Unable to create " + input + " blot"); - } - var BlotClass = match; - var node = - // @ts-ignore - input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value); - return new BlotClass(node, value); -} -exports.create = create; -function find(node, bubble) { - if (bubble === void 0) { bubble = false; } - if (node == null) - return null; - // @ts-ignore - if (node[exports.DATA_KEY] != null) - return node[exports.DATA_KEY].blot; - if (bubble) - return find(node.parentNode, bubble); - return null; -} -exports.find = find; -function query(query, scope) { - if (scope === void 0) { scope = Scope.ANY; } - var match; - if (typeof query === 'string') { - match = types[query] || attributes[query]; - // @ts-ignore - } - else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) { - match = types['text']; - } - else if (typeof query === 'number') { - if (query & Scope.LEVEL & Scope.BLOCK) { - match = types['block']; - } - else if (query & Scope.LEVEL & Scope.INLINE) { - match = types['inline']; - } - } - else if (query instanceof HTMLElement) { - var names = (query.getAttribute('class') || '').split(/\s+/); - for (var i in names) { - match = classes[names[i]]; - if (match) - break; - } - match = match || tags[query.tagName]; - } - if (match == null) - return null; - // @ts-ignore - if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) - return match; - return null; -} -exports.query = query; -function register() { - var Definitions = []; - for (var _i = 0; _i < arguments.length; _i++) { - Definitions[_i] = arguments[_i]; - } - if (Definitions.length > 1) { - return Definitions.map(function (d) { - return register(d); - }); - } - var Definition = Definitions[0]; - if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { - throw new ParchmentError('Invalid definition'); - } - else if (Definition.blotName === 'abstract') { - throw new ParchmentError('Cannot register abstract class'); - } - types[Definition.blotName || Definition.attrName] = Definition; - if (typeof Definition.keyName === 'string') { - attributes[Definition.keyName] = Definition; - } - else { - if (Definition.className != null) { - classes[Definition.className] = Definition; - } - if (Definition.tagName != null) { - if (Array.isArray(Definition.tagName)) { - Definition.tagName = Definition.tagName.map(function (tagName) { - return tagName.toUpperCase(); - }); - } - else { - Definition.tagName = Definition.tagName.toUpperCase(); - } - var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; - tagNames.forEach(function (tag) { - if (tags[tag] == null || Definition.className == null) { - tags[tag] = Definition; - } - }); - } - } - return Definition; -} -exports.register = register; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -var diff = __webpack_require__(51); -var equal = __webpack_require__(11); -var extend = __webpack_require__(3); -var op = __webpack_require__(20); - - -var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() - - -var Delta = function (ops) { - // Assume we are given a well formed ops - if (Array.isArray(ops)) { - this.ops = ops; - } else if (ops != null && Array.isArray(ops.ops)) { - this.ops = ops.ops; - } else { - this.ops = []; - } -}; - - -Delta.prototype.insert = function (text, attributes) { - var newOp = {}; - if (text.length === 0) return this; - newOp.insert = text; - if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { - newOp.attributes = attributes; - } - return this.push(newOp); -}; - -Delta.prototype['delete'] = function (length) { - if (length <= 0) return this; - return this.push({ 'delete': length }); -}; - -Delta.prototype.retain = function (length, attributes) { - if (length <= 0) return this; - var newOp = { retain: length }; - if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { - newOp.attributes = attributes; - } - return this.push(newOp); -}; - -Delta.prototype.push = function (newOp) { - var index = this.ops.length; - var lastOp = this.ops[index - 1]; - newOp = extend(true, {}, newOp); - if (typeof lastOp === 'object') { - if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { - this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; - return this; - } - // Since it does not matter if we insert before or after deleting at the same index, - // always prefer to insert first - if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { - index -= 1; - lastOp = this.ops[index - 1]; - if (typeof lastOp !== 'object') { - this.ops.unshift(newOp); - return this; - } - } - if (equal(newOp.attributes, lastOp.attributes)) { - if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { - this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; - if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes - return this; - } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { - this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; - if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes - return this; - } - } - } - if (index === this.ops.length) { - this.ops.push(newOp); - } else { - this.ops.splice(index, 0, newOp); - } - return this; -}; - -Delta.prototype.chop = function () { - var lastOp = this.ops[this.ops.length - 1]; - if (lastOp && lastOp.retain && !lastOp.attributes) { - this.ops.pop(); - } - return this; -}; - -Delta.prototype.filter = function (predicate) { - return this.ops.filter(predicate); -}; - -Delta.prototype.forEach = function (predicate) { - this.ops.forEach(predicate); -}; - -Delta.prototype.map = function (predicate) { - return this.ops.map(predicate); -}; - -Delta.prototype.partition = function (predicate) { - var passed = [], failed = []; - this.forEach(function(op) { - var target = predicate(op) ? passed : failed; - target.push(op); - }); - return [passed, failed]; -}; - -Delta.prototype.reduce = function (predicate, initial) { - return this.ops.reduce(predicate, initial); -}; - -Delta.prototype.changeLength = function () { - return this.reduce(function (length, elem) { - if (elem.insert) { - return length + op.length(elem); - } else if (elem.delete) { - return length - elem.delete; - } - return length; - }, 0); -}; - -Delta.prototype.length = function () { - return this.reduce(function (length, elem) { - return length + op.length(elem); - }, 0); -}; - -Delta.prototype.slice = function (start, end) { - start = start || 0; - if (typeof end !== 'number') end = Infinity; - var ops = []; - var iter = op.iterator(this.ops); - var index = 0; - while (index < end && iter.hasNext()) { - var nextOp; - if (index < start) { - nextOp = iter.next(start - index); - } else { - nextOp = iter.next(end - index); - ops.push(nextOp); - } - index += op.length(nextOp); - } - return new Delta(ops); -}; - - -Delta.prototype.compose = function (other) { - var thisIter = op.iterator(this.ops); - var otherIter = op.iterator(other.ops); - var delta = new Delta(); - while (thisIter.hasNext() || otherIter.hasNext()) { - if (otherIter.peekType() === 'insert') { - delta.push(otherIter.next()); - } else if (thisIter.peekType() === 'delete') { - delta.push(thisIter.next()); - } else { - var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); - var thisOp = thisIter.next(length); - var otherOp = otherIter.next(length); - if (typeof otherOp.retain === 'number') { - var newOp = {}; - if (typeof thisOp.retain === 'number') { - newOp.retain = length; - } else { - newOp.insert = thisOp.insert; - } - // Preserve null when composing with a retain, otherwise remove it for inserts - var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); - if (attributes) newOp.attributes = attributes; - delta.push(newOp); - // Other op should be delete, we could be an insert or retain - // Insert + delete cancels out - } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { - delta.push(otherOp); - } - } - } - return delta.chop(); -}; - -Delta.prototype.concat = function (other) { - var delta = new Delta(this.ops.slice()); - if (other.ops.length > 0) { - delta.push(other.ops[0]); - delta.ops = delta.ops.concat(other.ops.slice(1)); - } - return delta; -}; - -Delta.prototype.diff = function (other, index) { - if (this.ops === other.ops) { - return new Delta(); - } - var strings = [this, other].map(function (delta) { - return delta.map(function (op) { - if (op.insert != null) { - return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; - } - var prep = (delta === other) ? 'on' : 'with'; - throw new Error('diff() called ' + prep + ' non-document'); - }).join(''); - }); - var delta = new Delta(); - var diffResult = diff(strings[0], strings[1], index); - var thisIter = op.iterator(this.ops); - var otherIter = op.iterator(other.ops); - diffResult.forEach(function (component) { - var length = component[1].length; - while (length > 0) { - var opLength = 0; - switch (component[0]) { - case diff.INSERT: - opLength = Math.min(otherIter.peekLength(), length); - delta.push(otherIter.next(opLength)); - break; - case diff.DELETE: - opLength = Math.min(length, thisIter.peekLength()); - thisIter.next(opLength); - delta['delete'](opLength); - break; - case diff.EQUAL: - opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); - var thisOp = thisIter.next(opLength); - var otherOp = otherIter.next(opLength); - if (equal(thisOp.insert, otherOp.insert)) { - delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); - } else { - delta.push(otherOp)['delete'](opLength); - } - break; - } - length -= opLength; - } - }); - return delta.chop(); -}; - -Delta.prototype.eachLine = function (predicate, newline) { - newline = newline || '\n'; - var iter = op.iterator(this.ops); - var line = new Delta(); - var i = 0; - while (iter.hasNext()) { - if (iter.peekType() !== 'insert') return; - var thisOp = iter.peek(); - var start = op.length(thisOp) - iter.peekLength(); - var index = typeof thisOp.insert === 'string' ? - thisOp.insert.indexOf(newline, start) - start : -1; - if (index < 0) { - line.push(iter.next()); - } else if (index > 0) { - line.push(iter.next(index)); - } else { - if (predicate(line, iter.next(1).attributes || {}, i) === false) { - return; - } - i += 1; - line = new Delta(); - } - } - if (line.length() > 0) { - predicate(line, {}, i); - } -}; - -Delta.prototype.transform = function (other, priority) { - priority = !!priority; - if (typeof other === 'number') { - return this.transformPosition(other, priority); - } - var thisIter = op.iterator(this.ops); - var otherIter = op.iterator(other.ops); - var delta = new Delta(); - while (thisIter.hasNext() || otherIter.hasNext()) { - if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { - delta.retain(op.length(thisIter.next())); - } else if (otherIter.peekType() === 'insert') { - delta.push(otherIter.next()); - } else { - var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); - var thisOp = thisIter.next(length); - var otherOp = otherIter.next(length); - if (thisOp['delete']) { - // Our delete either makes their delete redundant or removes their retain - continue; - } else if (otherOp['delete']) { - delta.push(otherOp); - } else { - // We retain either their retain or insert - delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); - } - } - } - return delta.chop(); -}; - -Delta.prototype.transformPosition = function (index, priority) { - priority = !!priority; - var thisIter = op.iterator(this.ops); - var offset = 0; - while (thisIter.hasNext() && offset <= index) { - var length = thisIter.peekLength(); - var nextType = thisIter.peekType(); - thisIter.next(); - if (nextType === 'delete') { - index -= Math.min(length, index - offset); - continue; - } else if (nextType === 'insert' && (offset < index || !priority)) { - index += length; - } - offset += length; - } - return index; -}; - - -module.exports = Delta; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -'use strict'; - -var hasOwn = Object.prototype.hasOwnProperty; -var toStr = Object.prototype.toString; - -var isArray = function isArray(arr) { - if (typeof Array.isArray === 'function') { - return Array.isArray(arr); - } - - return toStr.call(arr) === '[object Array]'; -}; - -var isPlainObject = function isPlainObject(obj) { - if (!obj || toStr.call(obj) !== '[object Object]') { - return false; - } - - var hasOwnConstructor = hasOwn.call(obj, 'constructor'); - var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); - // Not own constructor property must be Object - if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - var key; - for (key in obj) { /**/ } - - return typeof key === 'undefined' || hasOwn.call(obj, key); -}; - -module.exports = function extend() { - var options, name, src, copy, copyIsArray, clone; - var target = arguments[0]; - var i = 1; - var length = arguments.length; - var deep = false; - - // Handle a deep copy situation - if (typeof target === 'boolean') { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { - target = {}; - } - - for (; i < length; ++i) { - options = arguments[i]; - // Only deal with non-null/undefined values - if (options != null) { - // Extend the base object - for (name in options) { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target !== copy) { - // Recurse if we're merging plain objects or arrays - if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { - if (copyIsArray) { - copyIsArray = false; - clone = src && isArray(src) ? src : []; - } else { - clone = src && isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = extend(deep, clone, copy); - - // Don't bring in undefined values - } else if (typeof copy !== 'undefined') { - target[name] = copy; - } - } - } - } - } - - // Return the modified object - return target; -}; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _extend = __webpack_require__(3); - -var _extend2 = _interopRequireDefault(_extend); - -var _quillDelta = __webpack_require__(2); - -var _quillDelta2 = _interopRequireDefault(_quillDelta); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _break = __webpack_require__(16); - -var _break2 = _interopRequireDefault(_break); - -var _inline = __webpack_require__(6); - -var _inline2 = _interopRequireDefault(_inline); - -var _text = __webpack_require__(7); - -var _text2 = _interopRequireDefault(_text); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var NEWLINE_LENGTH = 1; - -var BlockEmbed = function (_Parchment$Embed) { - _inherits(BlockEmbed, _Parchment$Embed); - - function BlockEmbed() { - _classCallCheck(this, BlockEmbed); - - return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); - } - - _createClass(BlockEmbed, [{ - key: 'attach', - value: function attach() { - _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); - this.attributes = new _parchment2.default.Attributor.Store(this.domNode); - } - }, { - key: 'delta', - value: function delta() { - return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); - } - }, { - key: 'format', - value: function format(name, value) { - var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); - if (attribute != null) { - this.attributes.attribute(attribute, value); - } - } - }, { - key: 'formatAt', - value: function formatAt(index, length, name, value) { - this.format(name, value); - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (typeof value === 'string' && value.endsWith('\n')) { - var block = _parchment2.default.create(Block.blotName); - this.parent.insertBefore(block, index === 0 ? this : this.next); - block.insertAt(0, value.slice(0, -1)); - } else { - _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); - } - } - }]); - - return BlockEmbed; -}(_parchment2.default.Embed); - -BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; -// It is important for cursor behavior BlockEmbeds use tags that are block level elements - - -var Block = function (_Parchment$Block) { - _inherits(Block, _Parchment$Block); - - function Block(domNode) { - _classCallCheck(this, Block); - - var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); - - _this2.cache = {}; - return _this2; - } - - _createClass(Block, [{ - key: 'delta', - value: function delta() { - if (this.cache.delta == null) { - this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { - if (leaf.length() === 0) { - return delta; - } else { - return delta.insert(leaf.value(), bubbleFormats(leaf)); - } - }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); - } - return this.cache.delta; - } - }, { - key: 'deleteAt', - value: function deleteAt(index, length) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); - this.cache = {}; - } - }, { - key: 'formatAt', - value: function formatAt(index, length, name, value) { - if (length <= 0) return; - if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { - if (index + length === this.length()) { - this.format(name, value); - } - } else { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); - } - this.cache = {}; - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); - if (value.length === 0) return; - var lines = value.split('\n'); - var text = lines.shift(); - if (text.length > 0) { - if (index < this.length() - 1 || this.children.tail == null) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); - } else { - this.children.tail.insertAt(this.children.tail.length(), text); - } - this.cache = {}; - } - var block = this; - lines.reduce(function (index, line) { - block = block.split(index, true); - block.insertAt(0, line); - return line.length; - }, index + text.length); - } - }, { - key: 'insertBefore', - value: function insertBefore(blot, ref) { - var head = this.children.head; - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); - if (head instanceof _break2.default) { - head.remove(); - } - this.cache = {}; - } - }, { - key: 'length', - value: function length() { - if (this.cache.length == null) { - this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; - } - return this.cache.length; - } - }, { - key: 'moveChildren', - value: function moveChildren(target, ref) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); - this.cache = {}; - } - }, { - key: 'optimize', - value: function optimize(context) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context); - this.cache = {}; - } - }, { - key: 'path', - value: function path(index) { - return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); - } - }, { - key: 'removeChild', - value: function removeChild(child) { - _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); - this.cache = {}; - } - }, { - key: 'split', - value: function split(index) { - var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { - var clone = this.clone(); - if (index === 0) { - this.parent.insertBefore(clone, this); - return this; - } else { - this.parent.insertBefore(clone, this.next); - return clone; - } - } else { - var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); - this.cache = {}; - return next; - } - } - }]); - - return Block; -}(_parchment2.default.Block); - -Block.blotName = 'block'; -Block.tagName = 'P'; -Block.defaultChild = 'break'; -Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default]; - -function bubbleFormats(blot) { - var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (blot == null) return formats; - if (typeof blot.formats === 'function') { - formats = (0, _extend2.default)(formats, blot.formats()); - } - if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { - return formats; - } - return bubbleFormats(blot.parent, formats); -} - -exports.bubbleFormats = bubbleFormats; -exports.BlockEmbed = BlockEmbed; -exports.default = Block; - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.overload = exports.expandConfig = undefined; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -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; }; }(); - -__webpack_require__(50); - -var _quillDelta = __webpack_require__(2); - -var _quillDelta2 = _interopRequireDefault(_quillDelta); - -var _editor = __webpack_require__(14); - -var _editor2 = _interopRequireDefault(_editor); - -var _emitter3 = __webpack_require__(8); - -var _emitter4 = _interopRequireDefault(_emitter3); - -var _module = __webpack_require__(9); - -var _module2 = _interopRequireDefault(_module); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _selection = __webpack_require__(15); - -var _selection2 = _interopRequireDefault(_selection); - -var _extend = __webpack_require__(3); - -var _extend2 = _interopRequireDefault(_extend); - -var _logger = __webpack_require__(10); - -var _logger2 = _interopRequireDefault(_logger); - -var _theme = __webpack_require__(34); - -var _theme2 = _interopRequireDefault(_theme); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var debug = (0, _logger2.default)('quill'); - -var Quill = function () { - _createClass(Quill, null, [{ - key: 'debug', - value: function debug(limit) { - if (limit === true) { - limit = 'log'; - } - _logger2.default.level(limit); - } - }, { - key: 'find', - value: function find(node) { - return node.__quill || _parchment2.default.find(node); - } - }, { - key: 'import', - value: function _import(name) { - if (this.imports[name] == null) { - debug.error('Cannot import ' + name + '. Are you sure it was registered?'); - } - return this.imports[name]; - } - }, { - key: 'register', - value: function register(path, target) { - var _this = this; - - var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (typeof path !== 'string') { - var name = path.attrName || path.blotName; - if (typeof name === 'string') { - // register(Blot | Attributor, overwrite) - this.register('formats/' + name, path, target); - } else { - Object.keys(path).forEach(function (key) { - _this.register(key, path[key], target); - }); - } - } else { - if (this.imports[path] != null && !overwrite) { - debug.warn('Overwriting ' + path + ' with', target); - } - this.imports[path] = target; - if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { - _parchment2.default.register(target); - } else if (path.startsWith('modules') && typeof target.register === 'function') { - target.register(); - } - } - } - }]); - - function Quill(container) { - var _this2 = this; - - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, Quill); - - this.options = expandConfig(container, options); - this.container = this.options.container; - if (this.container == null) { - return debug.error('Invalid Quill container', container); - } - if (this.options.debug) { - Quill.debug(this.options.debug); - } - var html = this.container.innerHTML.trim(); - this.container.classList.add('ql-container'); - this.container.innerHTML = ''; - this.container.__quill = this; - this.root = this.addContainer('ql-editor'); - this.root.classList.add('ql-blank'); - this.root.setAttribute('data-gramm', false); - this.scrollingContainer = this.options.scrollingContainer || this.root; - this.emitter = new _emitter4.default(); - this.scroll = _parchment2.default.create(this.root, { - emitter: this.emitter, - whitelist: this.options.formats - }); - this.editor = new _editor2.default(this.scroll); - this.selection = new _selection2.default(this.scroll, this.emitter); - this.theme = new this.options.theme(this, this.options); - this.keyboard = this.theme.addModule('keyboard'); - this.clipboard = this.theme.addModule('clipboard'); - this.history = this.theme.addModule('history'); - this.theme.init(); - this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { - if (type === _emitter4.default.events.TEXT_CHANGE) { - _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); - } - }); - this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { - var range = _this2.selection.lastRange; - var index = range && range.length === 0 ? range.index : undefined; - modify.call(_this2, function () { - return _this2.editor.update(null, mutations, index); - }, source); - }); - var contents = this.clipboard.convert('
' + html + '


'); - this.setContents(contents); - this.history.clear(); - if (this.options.placeholder) { - this.root.setAttribute('data-placeholder', this.options.placeholder); - } - if (this.options.readOnly) { - this.disable(); - } - } - - _createClass(Quill, [{ - key: 'addContainer', - value: function addContainer(container) { - var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - if (typeof container === 'string') { - var className = container; - container = document.createElement('div'); - container.classList.add(className); - } - this.container.insertBefore(container, refNode); - return container; - } - }, { - key: 'blur', - value: function blur() { - this.selection.setRange(null); - } - }, { - key: 'deleteText', - value: function deleteText(index, length, source) { - var _this3 = this; - - var _overload = overload(index, length, source); - - var _overload2 = _slicedToArray(_overload, 4); - - index = _overload2[0]; - length = _overload2[1]; - source = _overload2[3]; - - return modify.call(this, function () { - return _this3.editor.deleteText(index, length); - }, source, index, -1 * length); - } - }, { - key: 'disable', - value: function disable() { - this.enable(false); - } - }, { - key: 'enable', - value: function enable() { - var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - - this.scroll.enable(enabled); - this.container.classList.toggle('ql-disabled', !enabled); - } - }, { - key: 'focus', - value: function focus() { - var scrollTop = this.scrollingContainer.scrollTop; - this.selection.focus(); - this.scrollingContainer.scrollTop = scrollTop; - this.scrollIntoView(); - } - }, { - key: 'format', - value: function format(name, value) { - var _this4 = this; - - var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; - - return modify.call(this, function () { - var range = _this4.getSelection(true); - var change = new _quillDelta2.default(); - if (range == null) { - return change; - } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { - change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); - } else if (range.length === 0) { - _this4.selection.format(name, value); - return change; - } else { - change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); - } - _this4.setSelection(range, _emitter4.default.sources.SILENT); - return change; - }, source); - } - }, { - key: 'formatLine', - value: function formatLine(index, length, name, value, source) { - var _this5 = this; - - var formats = void 0; - - var _overload3 = overload(index, length, name, value, source); - - var _overload4 = _slicedToArray(_overload3, 4); - - index = _overload4[0]; - length = _overload4[1]; - formats = _overload4[2]; - source = _overload4[3]; - - return modify.call(this, function () { - return _this5.editor.formatLine(index, length, formats); - }, source, index, 0); - } - }, { - key: 'formatText', - value: function formatText(index, length, name, value, source) { - var _this6 = this; - - var formats = void 0; - - var _overload5 = overload(index, length, name, value, source); - - var _overload6 = _slicedToArray(_overload5, 4); - - index = _overload6[0]; - length = _overload6[1]; - formats = _overload6[2]; - source = _overload6[3]; - - return modify.call(this, function () { - return _this6.editor.formatText(index, length, formats); - }, source, index, 0); - } - }, { - key: 'getBounds', - value: function getBounds(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var bounds = void 0; - if (typeof index === 'number') { - bounds = this.selection.getBounds(index, length); - } else { - bounds = this.selection.getBounds(index.index, index.length); - } - var containerBounds = this.container.getBoundingClientRect(); - return { - bottom: bounds.bottom - containerBounds.top, - height: bounds.height, - left: bounds.left - containerBounds.left, - right: bounds.right - containerBounds.left, - top: bounds.top - containerBounds.top, - width: bounds.width - }; - } - }, { - key: 'getContents', - value: function getContents() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; - - var _overload7 = overload(index, length); - - var _overload8 = _slicedToArray(_overload7, 2); - - index = _overload8[0]; - length = _overload8[1]; - - return this.editor.getContents(index, length); - } - }, { - key: 'getFormat', - value: function getFormat() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true); - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - if (typeof index === 'number') { - return this.editor.getFormat(index, length); - } else { - return this.editor.getFormat(index.index, index.length); - } - } - }, { - key: 'getIndex', - value: function getIndex(blot) { - return blot.offset(this.scroll); - } - }, { - key: 'getLength', - value: function getLength() { - return this.scroll.length(); - } - }, { - key: 'getLeaf', - value: function getLeaf(index) { - return this.scroll.leaf(index); - } - }, { - key: 'getLine', - value: function getLine(index) { - return this.scroll.line(index); - } - }, { - key: 'getLines', - value: function getLines() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; - - if (typeof index !== 'number') { - return this.scroll.lines(index.index, index.length); - } else { - return this.scroll.lines(index, length); - } - } - }, { - key: 'getModule', - value: function getModule(name) { - return this.theme.modules[name]; - } - }, { - key: 'getSelection', - value: function getSelection() { - var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - - if (focus) this.focus(); - this.update(); // Make sure we access getRange with editor in consistent state - return this.selection.getRange()[0]; - } - }, { - key: 'getText', - value: function getText() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; - - var _overload9 = overload(index, length); - - var _overload10 = _slicedToArray(_overload9, 2); - - index = _overload10[0]; - length = _overload10[1]; - - return this.editor.getText(index, length); - } - }, { - key: 'hasFocus', - value: function hasFocus() { - return this.selection.hasFocus(); - } - }, { - key: 'insertEmbed', - value: function insertEmbed(index, embed, value) { - var _this7 = this; - - var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; - - return modify.call(this, function () { - return _this7.editor.insertEmbed(index, embed, value); - }, source, index); - } - }, { - key: 'insertText', - value: function insertText(index, text, name, value, source) { - var _this8 = this; - - var formats = void 0; - - var _overload11 = overload(index, 0, name, value, source); - - var _overload12 = _slicedToArray(_overload11, 4); - - index = _overload12[0]; - formats = _overload12[2]; - source = _overload12[3]; - - return modify.call(this, function () { - return _this8.editor.insertText(index, text, formats); - }, source, index, text.length); - } - }, { - key: 'isEnabled', - value: function isEnabled() { - return !this.container.classList.contains('ql-disabled'); - } - }, { - key: 'off', - value: function off() { - return this.emitter.off.apply(this.emitter, arguments); - } - }, { - key: 'on', - value: function on() { - return this.emitter.on.apply(this.emitter, arguments); - } - }, { - key: 'once', - value: function once() { - return this.emitter.once.apply(this.emitter, arguments); - } - }, { - key: 'pasteHTML', - value: function pasteHTML(index, html, source) { - this.clipboard.dangerouslyPasteHTML(index, html, source); - } - }, { - key: 'removeFormat', - value: function removeFormat(index, length, source) { - var _this9 = this; - - var _overload13 = overload(index, length, source); - - var _overload14 = _slicedToArray(_overload13, 4); - - index = _overload14[0]; - length = _overload14[1]; - source = _overload14[3]; - - return modify.call(this, function () { - return _this9.editor.removeFormat(index, length); - }, source, index); - } - }, { - key: 'scrollIntoView', - value: function scrollIntoView() { - this.selection.scrollIntoView(this.scrollingContainer); - } - }, { - key: 'setContents', - value: function setContents(delta) { - var _this10 = this; - - var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; - - return modify.call(this, function () { - delta = new _quillDelta2.default(delta); - var length = _this10.getLength(); - var deleted = _this10.editor.deleteText(0, length); - var applied = _this10.editor.applyDelta(delta); - var lastOp = applied.ops[applied.ops.length - 1]; - if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { - _this10.editor.deleteText(_this10.getLength() - 1, 1); - applied.delete(1); - } - var ret = deleted.compose(applied); - return ret; - }, source); - } - }, { - key: 'setSelection', - value: function setSelection(index, length, source) { - if (index == null) { - this.selection.setRange(null, length || Quill.sources.API); - } else { - var _overload15 = overload(index, length, source); - - var _overload16 = _slicedToArray(_overload15, 4); - - index = _overload16[0]; - length = _overload16[1]; - source = _overload16[3]; - - this.selection.setRange(new _selection.Range(index, length), source); - if (source !== _emitter4.default.sources.SILENT) { - this.selection.scrollIntoView(this.scrollingContainer); - } - } - } - }, { - key: 'setText', - value: function setText(text) { - var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; - - var delta = new _quillDelta2.default().insert(text); - return this.setContents(delta, source); - } - }, { - key: 'update', - value: function update() { - var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; - - var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes - this.selection.update(source); - return change; - } - }, { - key: 'updateContents', - value: function updateContents(delta) { - var _this11 = this; - - var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; - - return modify.call(this, function () { - delta = new _quillDelta2.default(delta); - return _this11.editor.applyDelta(delta, source); - }, source, true); - } - }]); - - return Quill; -}(); - -Quill.DEFAULTS = { - bounds: null, - formats: null, - modules: {}, - placeholder: '', - readOnly: false, - scrollingContainer: null, - strict: true, - theme: 'default' -}; -Quill.events = _emitter4.default.events; -Quill.sources = _emitter4.default.sources; -// eslint-disable-next-line no-undef -Quill.version = false ? 'dev' : "1.3.6"; - -Quill.imports = { - 'delta': _quillDelta2.default, - 'parchment': _parchment2.default, - 'core/module': _module2.default, - 'core/theme': _theme2.default -}; - -function expandConfig(container, userConfig) { - userConfig = (0, _extend2.default)(true, { - container: container, - modules: { - clipboard: true, - keyboard: true, - history: true - } - }, userConfig); - if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { - userConfig.theme = _theme2.default; - } else { - userConfig.theme = Quill.import('themes/' + userConfig.theme); - if (userConfig.theme == null) { - throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); - } - } - var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); - [themeConfig, userConfig].forEach(function (config) { - config.modules = config.modules || {}; - Object.keys(config.modules).forEach(function (module) { - if (config.modules[module] === true) { - config.modules[module] = {}; - } - }); - }); - var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); - var moduleConfig = moduleNames.reduce(function (config, name) { - var moduleClass = Quill.import('modules/' + name); - if (moduleClass == null) { - debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); - } else { - config[name] = moduleClass.DEFAULTS || {}; - } - return config; - }, {}); - // Special case toolbar shorthand - if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { - userConfig.modules.toolbar = { - container: userConfig.modules.toolbar - }; - } - userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); - ['bounds', 'container', 'scrollingContainer'].forEach(function (key) { - if (typeof userConfig[key] === 'string') { - userConfig[key] = document.querySelector(userConfig[key]); - } - }); - userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { - if (userConfig.modules[name]) { - config[name] = userConfig.modules[name]; - } - return config; - }, {}); - return userConfig; -} - -// Handle selection preservation and TEXT_CHANGE emission -// common to modification APIs -function modify(modifier, source, index, shift) { - if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { - return new _quillDelta2.default(); - } - var range = index == null ? null : this.getSelection(); - var oldDelta = this.editor.delta; - var change = modifier(); - if (range != null) { - if (index === true) index = range.index; - if (shift == null) { - range = shiftRange(range, change, source); - } else if (shift !== 0) { - range = shiftRange(range, index, shift, source); - } - this.setSelection(range, _emitter4.default.sources.SILENT); - } - if (change.length() > 0) { - var _emitter; - - var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; - (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); - if (source !== _emitter4.default.sources.SILENT) { - var _emitter2; - - (_emitter2 = this.emitter).emit.apply(_emitter2, args); - } - } - return change; -} - -function overload(index, length, name, value, source) { - var formats = {}; - if (typeof index.index === 'number' && typeof index.length === 'number') { - // Allow for throwaway end (used by insertText/insertEmbed) - if (typeof length !== 'number') { - source = value, value = name, name = length, length = index.length, index = index.index; - } else { - length = index.length, index = index.index; - } - } else if (typeof length !== 'number') { - source = value, value = name, name = length, length = 0; - } - // Handle format being object, two format name/value strings or excluded - if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { - formats = name; - source = value; - } else if (typeof name === 'string') { - if (value != null) { - formats[name] = value; - } else { - source = name; - } - } - // Handle optional source - source = source || _emitter4.default.sources.API; - return [index, length, formats, source]; -} - -function shiftRange(range, index, length, source) { - if (range == null) return null; - var start = void 0, - end = void 0; - if (index instanceof _quillDelta2.default) { - var _map = [range.index, range.index + range.length].map(function (pos) { - return index.transformPosition(pos, source !== _emitter4.default.sources.USER); - }); - - var _map2 = _slicedToArray(_map, 2); - - start = _map2[0]; - end = _map2[1]; - } else { - var _map3 = [range.index, range.index + range.length].map(function (pos) { - if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos; - if (length >= 0) { - return pos + length; - } else { - return Math.max(index, pos + length); - } - }); - - var _map4 = _slicedToArray(_map3, 2); - - start = _map4[0]; - end = _map4[1]; - } - return new _selection.Range(start, end - start); -} - -exports.expandConfig = expandConfig; -exports.overload = overload; -exports.default = Quill; - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _text = __webpack_require__(7); - -var _text2 = _interopRequireDefault(_text); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Inline = function (_Parchment$Inline) { - _inherits(Inline, _Parchment$Inline); - - function Inline() { - _classCallCheck(this, Inline); - - return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); - } - - _createClass(Inline, [{ - key: 'formatAt', - value: function formatAt(index, length, name, value) { - if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { - var blot = this.isolate(index, length); - if (value) { - blot.wrap(name, value); - } - } else { - _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); - } - } - }, { - key: 'optimize', - value: function optimize(context) { - _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context); - if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { - var parent = this.parent.isolate(this.offset(), this.length()); - this.moveChildren(parent); - parent.wrap(this); - } - } - }], [{ - key: 'compare', - value: function compare(self, other) { - var selfIndex = Inline.order.indexOf(self); - var otherIndex = Inline.order.indexOf(other); - if (selfIndex >= 0 || otherIndex >= 0) { - return selfIndex - otherIndex; - } else if (self === other) { - return 0; - } else if (self < other) { - return -1; - } else { - return 1; - } - } - }]); - - return Inline; -}(_parchment2.default.Inline); - -Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default]; -// Lower index means deeper in the DOM tree, since not found (-1) is for embeds -Inline.order = ['cursor', 'inline', // Must be lower -'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher -]; - -exports.default = Inline; - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var TextBlot = function (_Parchment$Text) { - _inherits(TextBlot, _Parchment$Text); - - function TextBlot() { - _classCallCheck(this, TextBlot); - - return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); - } - - return TextBlot; -}(_parchment2.default.Text); - -exports.default = TextBlot; - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _eventemitter = __webpack_require__(54); - -var _eventemitter2 = _interopRequireDefault(_eventemitter); - -var _logger = __webpack_require__(10); - -var _logger2 = _interopRequireDefault(_logger); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var debug = (0, _logger2.default)('quill:events'); - -var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; - -EVENTS.forEach(function (eventName) { - document.addEventListener(eventName, function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) { - // TODO use WeakMap - if (node.__quill && node.__quill.emitter) { - var _node$__quill$emitter; - - (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args); - } - }); - }); -}); - -var Emitter = function (_EventEmitter) { - _inherits(Emitter, _EventEmitter); - - function Emitter() { - _classCallCheck(this, Emitter); - - var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); - - _this.listeners = {}; - _this.on('error', debug.error); - return _this; - } - - _createClass(Emitter, [{ - key: 'emit', - value: function emit() { - debug.log.apply(debug, arguments); - _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); - } - }, { - key: 'handleDOM', - value: function handleDOM(event) { - for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - (this.listeners[event.type] || []).forEach(function (_ref) { - var node = _ref.node, - handler = _ref.handler; - - if (event.target === node || node.contains(event.target)) { - handler.apply(undefined, [event].concat(args)); - } - }); - } - }, { - key: 'listenDOM', - value: function listenDOM(eventName, node, handler) { - if (!this.listeners[eventName]) { - this.listeners[eventName] = []; - } - this.listeners[eventName].push({ node: node, handler: handler }); - } - }]); - - return Emitter; -}(_eventemitter2.default); - -Emitter.events = { - EDITOR_CHANGE: 'editor-change', - SCROLL_BEFORE_UPDATE: 'scroll-before-update', - SCROLL_OPTIMIZE: 'scroll-optimize', - SCROLL_UPDATE: 'scroll-update', - SELECTION_CHANGE: 'selection-change', - TEXT_CHANGE: 'text-change' -}; -Emitter.sources = { - API: 'api', - SILENT: 'silent', - USER: 'user' -}; - -exports.default = Emitter; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Module = function Module(quill) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, Module); - - this.quill = quill; - this.options = options; -}; - -Module.DEFAULTS = {}; - -exports.default = Module; - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var levels = ['error', 'warn', 'log', 'info']; -var level = 'warn'; - -function debug(method) { - if (levels.indexOf(method) <= levels.indexOf(level)) { - var _console; - - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - (_console = console)[method].apply(_console, args); // eslint-disable-line no-console - } -} - -function namespace(ns) { - return levels.reduce(function (logger, method) { - logger[method] = debug.bind(console, method, ns); - return logger; - }, {}); -} - -debug.level = namespace.level = function (newLevel) { - level = newLevel; -}; - -exports.default = namespace; - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -var pSlice = Array.prototype.slice; -var objectKeys = __webpack_require__(52); -var isArguments = __webpack_require__(53); - -var deepEqual = module.exports = function (actual, expected, opts) { - if (!opts) opts = {}; - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { - return opts.strict ? actual === expected : actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected, opts); - } -} - -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -function isBuffer (x) { - if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; - if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { - return false; - } - if (x.length > 0 && typeof x[0] !== 'number') return false; - return true; -} - -function objEquiv(a, b, opts) { - var i, key; - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return deepEqual(a, b, opts); - } - if (isBuffer(a)) { - if (!isBuffer(b)) { - return false; - } - if (a.length !== b.length) return false; - for (i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; - } - return true; - } - try { - var ka = objectKeys(a), - kb = objectKeys(b); - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!deepEqual(a[key], b[key], opts)) return false; - } - return typeof a === typeof b; -} - - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var Registry = __webpack_require__(1); -var Attributor = /** @class */ (function () { - function Attributor(attrName, keyName, options) { - if (options === void 0) { options = {}; } - this.attrName = attrName; - this.keyName = keyName; - var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; - if (options.scope != null) { - // Ignore type bits, force attribute bit - this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; - } - else { - this.scope = Registry.Scope.ATTRIBUTE; - } - if (options.whitelist != null) - this.whitelist = options.whitelist; - } - Attributor.keys = function (node) { - return [].map.call(node.attributes, function (item) { - return item.name; - }); - }; - Attributor.prototype.add = function (node, value) { - if (!this.canAdd(node, value)) - return false; - node.setAttribute(this.keyName, value); - return true; - }; - Attributor.prototype.canAdd = function (node, value) { - var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); - if (match == null) - return false; - if (this.whitelist == null) - return true; - if (typeof value === 'string') { - return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1; - } - else { - return this.whitelist.indexOf(value) > -1; - } - }; - Attributor.prototype.remove = function (node) { - node.removeAttribute(this.keyName); - }; - Attributor.prototype.value = function (node) { - var value = node.getAttribute(this.keyName); - if (this.canAdd(node, value) && value) { - return value; - } - return ''; - }; - return Attributor; -}()); -exports.default = Attributor; - - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.Code = undefined; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _quillDelta = __webpack_require__(2); - -var _quillDelta2 = _interopRequireDefault(_quillDelta); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _block = __webpack_require__(4); - -var _block2 = _interopRequireDefault(_block); - -var _inline = __webpack_require__(6); - -var _inline2 = _interopRequireDefault(_inline); - -var _text = __webpack_require__(7); - -var _text2 = _interopRequireDefault(_text); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Code = function (_Inline) { - _inherits(Code, _Inline); - - function Code() { - _classCallCheck(this, Code); - - return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); - } - - return Code; -}(_inline2.default); - -Code.blotName = 'code'; -Code.tagName = 'CODE'; - -var CodeBlock = function (_Block) { - _inherits(CodeBlock, _Block); - - function CodeBlock() { - _classCallCheck(this, CodeBlock); - - return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); - } - - _createClass(CodeBlock, [{ - key: 'delta', - value: function delta() { - var _this3 = this; - - var text = this.domNode.textContent; - if (text.endsWith('\n')) { - // Should always be true - text = text.slice(0, -1); - } - return text.split('\n').reduce(function (delta, frag) { - return delta.insert(frag).insert('\n', _this3.formats()); - }, new _quillDelta2.default()); - } - }, { - key: 'format', - value: function format(name, value) { - if (name === this.statics.blotName && value) return; - - var _descendant = this.descendant(_text2.default, this.length() - 1), - _descendant2 = _slicedToArray(_descendant, 1), - text = _descendant2[0]; - - if (text != null) { - text.deleteAt(text.length() - 1, 1); - } - _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); - } - }, { - key: 'formatAt', - value: function formatAt(index, length, name, value) { - if (length === 0) return; - if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { - return; - } - var nextNewline = this.newlineIndex(index); - if (nextNewline < 0 || nextNewline >= index + length) return; - var prevNewline = this.newlineIndex(index, true) + 1; - var isolateLength = nextNewline - prevNewline + 1; - var blot = this.isolate(prevNewline, isolateLength); - var next = blot.next; - blot.format(name, value); - if (next instanceof CodeBlock) { - next.formatAt(0, index - prevNewline + length - isolateLength, name, value); - } - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (def != null) return; - - var _descendant3 = this.descendant(_text2.default, index), - _descendant4 = _slicedToArray(_descendant3, 2), - text = _descendant4[0], - offset = _descendant4[1]; - - text.insertAt(offset, value); - } - }, { - key: 'length', - value: function length() { - var length = this.domNode.textContent.length; - if (!this.domNode.textContent.endsWith('\n')) { - return length + 1; - } - return length; - } - }, { - key: 'newlineIndex', - value: function newlineIndex(searchIndex) { - var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (!reverse) { - var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); - return offset > -1 ? searchIndex + offset : -1; - } else { - return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); - } - } - }, { - key: 'optimize', - value: function optimize(context) { - if (!this.domNode.textContent.endsWith('\n')) { - this.appendChild(_parchment2.default.create('text', '\n')); - } - _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context); - var next = this.next; - if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { - next.optimize(context); - next.moveChildren(this); - next.remove(); - } - } - }, { - key: 'replace', - value: function replace(target) { - _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); - [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { - var blot = _parchment2.default.find(node); - if (blot == null) { - node.parentNode.removeChild(node); - } else if (blot instanceof _parchment2.default.Embed) { - blot.remove(); - } else { - blot.unwrap(); - } - }); - } - }], [{ - key: 'create', - value: function create(value) { - var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); - domNode.setAttribute('spellcheck', false); - return domNode; - } - }, { - key: 'formats', - value: function formats() { - return true; - } - }]); - - return CodeBlock; -}(_block2.default); - -CodeBlock.blotName = 'code-block'; -CodeBlock.tagName = 'PRE'; -CodeBlock.TAB = ' '; - -exports.Code = Code; -exports.default = CodeBlock; - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -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; }; }(); - -var _quillDelta = __webpack_require__(2); - -var _quillDelta2 = _interopRequireDefault(_quillDelta); - -var _op = __webpack_require__(20); - -var _op2 = _interopRequireDefault(_op); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _code = __webpack_require__(13); - -var _code2 = _interopRequireDefault(_code); - -var _cursor = __webpack_require__(24); - -var _cursor2 = _interopRequireDefault(_cursor); - -var _block = __webpack_require__(4); - -var _block2 = _interopRequireDefault(_block); - -var _break = __webpack_require__(16); - -var _break2 = _interopRequireDefault(_break); - -var _clone = __webpack_require__(21); - -var _clone2 = _interopRequireDefault(_clone); - -var _deepEqual = __webpack_require__(11); - -var _deepEqual2 = _interopRequireDefault(_deepEqual); - -var _extend = __webpack_require__(3); - -var _extend2 = _interopRequireDefault(_extend); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var ASCII = /^[ -~]*$/; - -var Editor = function () { - function Editor(scroll) { - _classCallCheck(this, Editor); - - this.scroll = scroll; - this.delta = this.getDelta(); - } - - _createClass(Editor, [{ - key: 'applyDelta', - value: function applyDelta(delta) { - var _this = this; - - var consumeNextNewline = false; - this.scroll.update(); - var scrollLength = this.scroll.length(); - this.scroll.batchStart(); - delta = normalizeDelta(delta); - delta.reduce(function (index, op) { - var length = op.retain || op.delete || op.insert.length || 1; - var attributes = op.attributes || {}; - if (op.insert != null) { - if (typeof op.insert === 'string') { - var text = op.insert; - if (text.endsWith('\n') && consumeNextNewline) { - consumeNextNewline = false; - text = text.slice(0, -1); - } - if (index >= scrollLength && !text.endsWith('\n')) { - consumeNextNewline = true; - } - _this.scroll.insertAt(index, text); - - var _scroll$line = _this.scroll.line(index), - _scroll$line2 = _slicedToArray(_scroll$line, 2), - line = _scroll$line2[0], - offset = _scroll$line2[1]; - - var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); - if (line instanceof _block2.default) { - var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), - _line$descendant2 = _slicedToArray(_line$descendant, 1), - leaf = _line$descendant2[0]; - - formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); - } - attributes = _op2.default.attributes.diff(formats, attributes) || {}; - } else if (_typeof(op.insert) === 'object') { - var key = Object.keys(op.insert)[0]; // There should only be one key - if (key == null) return index; - _this.scroll.insertAt(index, key, op.insert[key]); - } - scrollLength += length; - } - Object.keys(attributes).forEach(function (name) { - _this.scroll.formatAt(index, length, name, attributes[name]); - }); - return index + length; - }, 0); - delta.reduce(function (index, op) { - if (typeof op.delete === 'number') { - _this.scroll.deleteAt(index, op.delete); - return index; - } - return index + (op.retain || op.insert.length || 1); - }, 0); - this.scroll.batchEnd(); - return this.update(delta); - } - }, { - key: 'deleteText', - value: function deleteText(index, length) { - this.scroll.deleteAt(index, length); - return this.update(new _quillDelta2.default().retain(index).delete(length)); - } - }, { - key: 'formatLine', - value: function formatLine(index, length) { - var _this2 = this; - - var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - this.scroll.update(); - Object.keys(formats).forEach(function (format) { - if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return; - var lines = _this2.scroll.lines(index, Math.max(length, 1)); - var lengthRemaining = length; - lines.forEach(function (line) { - var lineLength = line.length(); - if (!(line instanceof _code2.default)) { - line.format(format, formats[format]); - } else { - var codeIndex = index - line.offset(_this2.scroll); - var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; - line.formatAt(codeIndex, codeLength, format, formats[format]); - } - lengthRemaining -= lineLength; - }); - }); - this.scroll.optimize(); - return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); - } - }, { - key: 'formatText', - value: function formatText(index, length) { - var _this3 = this; - - var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - Object.keys(formats).forEach(function (format) { - _this3.scroll.formatAt(index, length, format, formats[format]); - }); - return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); - } - }, { - key: 'getContents', - value: function getContents(index, length) { - return this.delta.slice(index, index + length); - } - }, { - key: 'getDelta', - value: function getDelta() { - return this.scroll.lines().reduce(function (delta, line) { - return delta.concat(line.delta()); - }, new _quillDelta2.default()); - } - }, { - key: 'getFormat', - value: function getFormat(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var lines = [], - leaves = []; - if (length === 0) { - this.scroll.path(index).forEach(function (path) { - var _path = _slicedToArray(path, 1), - blot = _path[0]; - - if (blot instanceof _block2.default) { - lines.push(blot); - } else if (blot instanceof _parchment2.default.Leaf) { - leaves.push(blot); - } - }); - } else { - lines = this.scroll.lines(index, length); - leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); - } - var formatsArr = [lines, leaves].map(function (blots) { - if (blots.length === 0) return {}; - var formats = (0, _block.bubbleFormats)(blots.shift()); - while (Object.keys(formats).length > 0) { - var blot = blots.shift(); - if (blot == null) return formats; - formats = combineFormats((0, _block.bubbleFormats)(blot), formats); - } - return formats; - }); - return _extend2.default.apply(_extend2.default, formatsArr); - } - }, { - key: 'getText', - value: function getText(index, length) { - return this.getContents(index, length).filter(function (op) { - return typeof op.insert === 'string'; - }).map(function (op) { - return op.insert; - }).join(''); - } - }, { - key: 'insertEmbed', - value: function insertEmbed(index, embed, value) { - this.scroll.insertAt(index, embed, value); - return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); - } - }, { - key: 'insertText', - value: function insertText(index, text) { - var _this4 = this; - - var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); - this.scroll.insertAt(index, text); - Object.keys(formats).forEach(function (format) { - _this4.scroll.formatAt(index, text.length, format, formats[format]); - }); - return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); - } - }, { - key: 'isBlank', - value: function isBlank() { - if (this.scroll.children.length == 0) return true; - if (this.scroll.children.length > 1) return false; - var block = this.scroll.children.head; - if (block.statics.blotName !== _block2.default.blotName) return false; - if (block.children.length > 1) return false; - return block.children.head instanceof _break2.default; - } - }, { - key: 'removeFormat', - value: function removeFormat(index, length) { - var text = this.getText(index, length); - - var _scroll$line3 = this.scroll.line(index + length), - _scroll$line4 = _slicedToArray(_scroll$line3, 2), - line = _scroll$line4[0], - offset = _scroll$line4[1]; - - var suffixLength = 0, - suffix = new _quillDelta2.default(); - if (line != null) { - if (!(line instanceof _code2.default)) { - suffixLength = line.length() - offset; - } else { - suffixLength = line.newlineIndex(offset) - offset + 1; - } - suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); - } - var contents = this.getContents(index, length + suffixLength); - var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); - var delta = new _quillDelta2.default().retain(index).concat(diff); - return this.applyDelta(delta); - } - }, { - key: 'update', - value: function update(change) { - var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; - - var oldDelta = this.delta; - if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) { - // Optimization for character changes - var textBlot = _parchment2.default.find(mutations[0].target); - var formats = (0, _block.bubbleFormats)(textBlot); - var index = textBlot.offset(this.scroll); - var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); - var oldText = new _quillDelta2.default().insert(oldValue); - var newText = new _quillDelta2.default().insert(textBlot.value()); - var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); - change = diffDelta.reduce(function (delta, op) { - if (op.insert) { - return delta.insert(op.insert, formats); - } else { - return delta.push(op); - } - }, new _quillDelta2.default()); - this.delta = oldDelta.compose(change); - } else { - this.delta = this.getDelta(); - if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { - change = oldDelta.diff(this.delta, cursorIndex); - } - } - return change; - } - }]); - - return Editor; -}(); - -function combineFormats(formats, combined) { - return Object.keys(combined).reduce(function (merged, name) { - if (formats[name] == null) return merged; - if (combined[name] === formats[name]) { - merged[name] = combined[name]; - } else if (Array.isArray(combined[name])) { - if (combined[name].indexOf(formats[name]) < 0) { - merged[name] = combined[name].concat([formats[name]]); - } - } else { - merged[name] = [combined[name], formats[name]]; - } - return merged; - }, {}); -} - -function normalizeDelta(delta) { - return delta.reduce(function (delta, op) { - if (op.insert === 1) { - var attributes = (0, _clone2.default)(op.attributes); - delete attributes['image']; - return delta.insert({ image: op.attributes.image }, attributes); - } - if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { - op = (0, _clone2.default)(op); - if (op.attributes.list) { - op.attributes.list = 'ordered'; - } else { - op.attributes.list = 'bullet'; - delete op.attributes.bullet; - } - } - if (typeof op.insert === 'string') { - var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); - return delta.insert(text, op.attributes); - } - return delta.push(op); - }, new _quillDelta2.default()); -} - -exports.default = Editor; - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.Range = undefined; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -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; }; }(); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _clone = __webpack_require__(21); - -var _clone2 = _interopRequireDefault(_clone); - -var _deepEqual = __webpack_require__(11); - -var _deepEqual2 = _interopRequireDefault(_deepEqual); - -var _emitter3 = __webpack_require__(8); - -var _emitter4 = _interopRequireDefault(_emitter3); - -var _logger = __webpack_require__(10); - -var _logger2 = _interopRequireDefault(_logger); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var debug = (0, _logger2.default)('quill:selection'); - -var Range = function Range(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - _classCallCheck(this, Range); - - this.index = index; - this.length = length; -}; - -var Selection = function () { - function Selection(scroll, emitter) { - var _this = this; - - _classCallCheck(this, Selection); - - this.emitter = emitter; - this.scroll = scroll; - this.composing = false; - this.mouseDown = false; - this.root = this.scroll.domNode; - this.cursor = _parchment2.default.create('cursor', this); - // savedRange is last non-null range - this.lastRange = this.savedRange = new Range(0, 0); - this.handleComposition(); - this.handleDragging(); - this.emitter.listenDOM('selectionchange', document, function () { - if (!_this.mouseDown) { - setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1); - } - }); - this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { - if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { - _this.update(_emitter4.default.sources.SILENT); - } - }); - this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { - if (!_this.hasFocus()) return; - var native = _this.getNativeRange(); - if (native == null) return; - if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle - // TODO unclear if this has negative side effects - _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { - try { - _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); - } catch (ignored) {} - }); - }); - this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) { - if (context.range) { - var _context$range = context.range, - startNode = _context$range.startNode, - startOffset = _context$range.startOffset, - endNode = _context$range.endNode, - endOffset = _context$range.endOffset; - - _this.setNativeRange(startNode, startOffset, endNode, endOffset); - } - }); - this.update(_emitter4.default.sources.SILENT); - } - - _createClass(Selection, [{ - key: 'handleComposition', - value: function handleComposition() { - var _this2 = this; - - this.root.addEventListener('compositionstart', function () { - _this2.composing = true; - }); - this.root.addEventListener('compositionend', function () { - _this2.composing = false; - if (_this2.cursor.parent) { - var range = _this2.cursor.restore(); - if (!range) return; - setTimeout(function () { - _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); - }, 1); - } - }); - } - }, { - key: 'handleDragging', - value: function handleDragging() { - var _this3 = this; - - this.emitter.listenDOM('mousedown', document.body, function () { - _this3.mouseDown = true; - }); - this.emitter.listenDOM('mouseup', document.body, function () { - _this3.mouseDown = false; - _this3.update(_emitter4.default.sources.USER); - }); - } - }, { - key: 'focus', - value: function focus() { - if (this.hasFocus()) return; - this.root.focus(); - this.setRange(this.savedRange); - } - }, { - key: 'format', - value: function format(_format, value) { - if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return; - this.scroll.update(); - var nativeRange = this.getNativeRange(); - if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; - if (nativeRange.start.node !== this.cursor.textNode) { - var blot = _parchment2.default.find(nativeRange.start.node, false); - if (blot == null) return; - // TODO Give blot ability to not split - if (blot instanceof _parchment2.default.Leaf) { - var after = blot.split(nativeRange.start.offset); - blot.parent.insertBefore(this.cursor, after); - } else { - blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen - } - this.cursor.attach(); - } - this.cursor.format(_format, value); - this.scroll.optimize(); - this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); - this.update(); - } - }, { - key: 'getBounds', - value: function getBounds(index) { - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - var scrollLength = this.scroll.length(); - index = Math.min(index, scrollLength - 1); - length = Math.min(index + length, scrollLength - 1) - index; - var node = void 0, - _scroll$leaf = this.scroll.leaf(index), - _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), - leaf = _scroll$leaf2[0], - offset = _scroll$leaf2[1]; - if (leaf == null) return null; - - var _leaf$position = leaf.position(offset, true); - - var _leaf$position2 = _slicedToArray(_leaf$position, 2); - - node = _leaf$position2[0]; - offset = _leaf$position2[1]; - - var range = document.createRange(); - if (length > 0) { - range.setStart(node, offset); - - var _scroll$leaf3 = this.scroll.leaf(index + length); - - var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); - - leaf = _scroll$leaf4[0]; - offset = _scroll$leaf4[1]; - - if (leaf == null) return null; - - var _leaf$position3 = leaf.position(offset, true); - - var _leaf$position4 = _slicedToArray(_leaf$position3, 2); - - node = _leaf$position4[0]; - offset = _leaf$position4[1]; - - range.setEnd(node, offset); - return range.getBoundingClientRect(); - } else { - var side = 'left'; - var rect = void 0; - if (node instanceof Text) { - if (offset < node.data.length) { - range.setStart(node, offset); - range.setEnd(node, offset + 1); - } else { - range.setStart(node, offset - 1); - range.setEnd(node, offset); - side = 'right'; - } - rect = range.getBoundingClientRect(); - } else { - rect = leaf.domNode.getBoundingClientRect(); - if (offset > 0) side = 'right'; - } - return { - bottom: rect.top + rect.height, - height: rect.height, - left: rect[side], - right: rect[side], - top: rect.top, - width: 0 - }; - } - } - }, { - key: 'getNativeRange', - value: function getNativeRange() { - var selection = document.getSelection(); - if (selection == null || selection.rangeCount <= 0) return null; - var nativeRange = selection.getRangeAt(0); - if (nativeRange == null) return null; - var range = this.normalizeNative(nativeRange); - debug.info('getNativeRange', range); - return range; - } - }, { - key: 'getRange', - value: function getRange() { - var normalized = this.getNativeRange(); - if (normalized == null) return [null, null]; - var range = this.normalizedToRange(normalized); - return [range, normalized]; - } - }, { - key: 'hasFocus', - value: function hasFocus() { - return document.activeElement === this.root; - } - }, { - key: 'normalizedToRange', - value: function normalizedToRange(range) { - var _this4 = this; - - var positions = [[range.start.node, range.start.offset]]; - if (!range.native.collapsed) { - positions.push([range.end.node, range.end.offset]); - } - var indexes = positions.map(function (position) { - var _position = _slicedToArray(position, 2), - node = _position[0], - offset = _position[1]; - - var blot = _parchment2.default.find(node, true); - var index = blot.offset(_this4.scroll); - if (offset === 0) { - return index; - } else if (blot instanceof _parchment2.default.Container) { - return index + blot.length(); - } else { - return index + blot.index(node, offset); - } - }); - var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1); - var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes))); - return new Range(start, end - start); - } - }, { - key: 'normalizeNative', - value: function normalizeNative(nativeRange) { - if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { - return null; - } - var range = { - start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, - end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, - native: nativeRange - }; - [range.start, range.end].forEach(function (position) { - var node = position.node, - offset = position.offset; - while (!(node instanceof Text) && node.childNodes.length > 0) { - if (node.childNodes.length > offset) { - node = node.childNodes[offset]; - offset = 0; - } else if (node.childNodes.length === offset) { - node = node.lastChild; - offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; - } else { - break; - } - } - position.node = node, position.offset = offset; - }); - return range; - } - }, { - key: 'rangeToNative', - value: function rangeToNative(range) { - var _this5 = this; - - var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; - var args = []; - var scrollLength = this.scroll.length(); - indexes.forEach(function (index, i) { - index = Math.min(scrollLength - 1, index); - var node = void 0, - _scroll$leaf5 = _this5.scroll.leaf(index), - _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), - leaf = _scroll$leaf6[0], - offset = _scroll$leaf6[1]; - var _leaf$position5 = leaf.position(offset, i !== 0); - - var _leaf$position6 = _slicedToArray(_leaf$position5, 2); - - node = _leaf$position6[0]; - offset = _leaf$position6[1]; - - args.push(node, offset); - }); - if (args.length < 2) { - args = args.concat(args); - } - return args; - } - }, { - key: 'scrollIntoView', - value: function scrollIntoView(scrollingContainer) { - var range = this.lastRange; - if (range == null) return; - var bounds = this.getBounds(range.index, range.length); - if (bounds == null) return; - var limit = this.scroll.length() - 1; - - var _scroll$line = this.scroll.line(Math.min(range.index, limit)), - _scroll$line2 = _slicedToArray(_scroll$line, 1), - first = _scroll$line2[0]; - - var last = first; - if (range.length > 0) { - var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit)); - - var _scroll$line4 = _slicedToArray(_scroll$line3, 1); - - last = _scroll$line4[0]; - } - if (first == null || last == null) return; - var scrollBounds = scrollingContainer.getBoundingClientRect(); - if (bounds.top < scrollBounds.top) { - scrollingContainer.scrollTop -= scrollBounds.top - bounds.top; - } else if (bounds.bottom > scrollBounds.bottom) { - scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom; - } - } - }, { - key: 'setNativeRange', - value: function setNativeRange(startNode, startOffset) { - var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; - var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; - var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; - - debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); - if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { - return; - } - var selection = document.getSelection(); - if (selection == null) return; - if (startNode != null) { - if (!this.hasFocus()) this.root.focus(); - var native = (this.getNativeRange() || {}).native; - if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) { - - if (startNode.tagName == "BR") { - startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode); - startNode = startNode.parentNode; - } - if (endNode.tagName == "BR") { - endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode); - endNode = endNode.parentNode; - } - var range = document.createRange(); - range.setStart(startNode, startOffset); - range.setEnd(endNode, endOffset); - selection.removeAllRanges(); - selection.addRange(range); - } - } else { - selection.removeAllRanges(); - this.root.blur(); - document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) - } - } - }, { - key: 'setRange', - value: function setRange(range) { - var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; - - if (typeof force === 'string') { - source = force; - force = false; - } - debug.info('setRange', range); - if (range != null) { - var args = this.rangeToNative(range); - this.setNativeRange.apply(this, _toConsumableArray(args).concat([force])); - } else { - this.setNativeRange(null); - } - this.update(source); - } - }, { - key: 'update', - value: function update() { - var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; - - var oldRange = this.lastRange; - - var _getRange = this.getRange(), - _getRange2 = _slicedToArray(_getRange, 2), - lastRange = _getRange2[0], - nativeRange = _getRange2[1]; - - this.lastRange = lastRange; - if (this.lastRange != null) { - this.savedRange = this.lastRange; - } - if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { - var _emitter; - - if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { - this.cursor.restore(); - } - var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; - (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); - if (source !== _emitter4.default.sources.SILENT) { - var _emitter2; - - (_emitter2 = this.emitter).emit.apply(_emitter2, args); - } - } - } - }]); - - return Selection; -}(); - -function contains(parent, descendant) { - try { - // Firefox inserts inaccessible nodes around video elements - descendant.parentNode; - } catch (e) { - return false; - } - // IE11 has bug with Text nodes - // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect - if (descendant instanceof Text) { - descendant = descendant.parentNode; - } - return parent.contains(descendant); -} - -exports.Range = Range; -exports.default = Selection; - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Break = function (_Parchment$Embed) { - _inherits(Break, _Parchment$Embed); - - function Break() { - _classCallCheck(this, Break); - - return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); - } - - _createClass(Break, [{ - key: 'insertInto', - value: function insertInto(parent, ref) { - if (parent.children.length === 0) { - _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); - } else { - this.remove(); - } - } - }, { - key: 'length', - value: function length() { - return 0; - } - }, { - key: 'value', - value: function value() { - return ''; - } - }], [{ - key: 'value', - value: function value() { - return undefined; - } - }]); - - return Break; -}(_parchment2.default.Embed); - -Break.blotName = 'break'; -Break.tagName = 'BR'; - -exports.default = Break; - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var linked_list_1 = __webpack_require__(44); -var shadow_1 = __webpack_require__(30); -var Registry = __webpack_require__(1); -var ContainerBlot = /** @class */ (function (_super) { - __extends(ContainerBlot, _super); - function ContainerBlot(domNode) { - var _this = _super.call(this, domNode) || this; - _this.build(); - return _this; - } - ContainerBlot.prototype.appendChild = function (other) { - this.insertBefore(other); - }; - ContainerBlot.prototype.attach = function () { - _super.prototype.attach.call(this); - this.children.forEach(function (child) { - child.attach(); - }); - }; - ContainerBlot.prototype.build = function () { - var _this = this; - this.children = new linked_list_1.default(); - // Need to be reversed for if DOM nodes already in order - [].slice - .call(this.domNode.childNodes) - .reverse() - .forEach(function (node) { - try { - var child = makeBlot(node); - _this.insertBefore(child, _this.children.head || undefined); - } - catch (err) { - if (err instanceof Registry.ParchmentError) - return; - else - throw err; - } - }); - }; - ContainerBlot.prototype.deleteAt = function (index, length) { - if (index === 0 && length === this.length()) { - return this.remove(); - } - this.children.forEachAt(index, length, function (child, offset, length) { - child.deleteAt(offset, length); - }); - }; - ContainerBlot.prototype.descendant = function (criteria, index) { - var _a = this.children.find(index), child = _a[0], offset = _a[1]; - if ((criteria.blotName == null && criteria(child)) || - (criteria.blotName != null && child instanceof criteria)) { - return [child, offset]; - } - else if (child instanceof ContainerBlot) { - return child.descendant(criteria, offset); - } - else { - return [null, -1]; - } - }; - ContainerBlot.prototype.descendants = function (criteria, index, length) { - if (index === void 0) { index = 0; } - if (length === void 0) { length = Number.MAX_VALUE; } - var descendants = []; - var lengthLeft = length; - this.children.forEachAt(index, length, function (child, index, length) { - if ((criteria.blotName == null && criteria(child)) || - (criteria.blotName != null && child instanceof criteria)) { - descendants.push(child); - } - if (child instanceof ContainerBlot) { - descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); - } - lengthLeft -= length; - }); - return descendants; - }; - ContainerBlot.prototype.detach = function () { - this.children.forEach(function (child) { - child.detach(); - }); - _super.prototype.detach.call(this); - }; - ContainerBlot.prototype.formatAt = function (index, length, name, value) { - this.children.forEachAt(index, length, function (child, offset, length) { - child.formatAt(offset, length, name, value); - }); - }; - ContainerBlot.prototype.insertAt = function (index, value, def) { - var _a = this.children.find(index), child = _a[0], offset = _a[1]; - if (child) { - child.insertAt(offset, value, def); - } - else { - var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); - this.appendChild(blot); - } - }; - ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { - if (this.statics.allowedChildren != null && - !this.statics.allowedChildren.some(function (child) { - return childBlot instanceof child; - })) { - throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); - } - childBlot.insertInto(this, refBlot); - }; - ContainerBlot.prototype.length = function () { - return this.children.reduce(function (memo, child) { - return memo + child.length(); - }, 0); - }; - ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { - this.children.forEach(function (child) { - targetParent.insertBefore(child, refNode); - }); - }; - ContainerBlot.prototype.optimize = function (context) { - _super.prototype.optimize.call(this, context); - if (this.children.length === 0) { - if (this.statics.defaultChild != null) { - var child = Registry.create(this.statics.defaultChild); - this.appendChild(child); - child.optimize(context); - } - else { - this.remove(); - } - } - }; - ContainerBlot.prototype.path = function (index, inclusive) { - if (inclusive === void 0) { inclusive = false; } - var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; - var position = [[this, index]]; - if (child instanceof ContainerBlot) { - return position.concat(child.path(offset, inclusive)); - } - else if (child != null) { - position.push([child, offset]); - } - return position; - }; - ContainerBlot.prototype.removeChild = function (child) { - this.children.remove(child); - }; - ContainerBlot.prototype.replace = function (target) { - if (target instanceof ContainerBlot) { - target.moveChildren(this); - } - _super.prototype.replace.call(this, target); - }; - ContainerBlot.prototype.split = function (index, force) { - if (force === void 0) { force = false; } - if (!force) { - if (index === 0) - return this; - if (index === this.length()) - return this.next; - } - var after = this.clone(); - this.parent.insertBefore(after, this.next); - this.children.forEachAt(index, this.length(), function (child, offset, length) { - child = child.split(offset, force); - after.appendChild(child); - }); - return after; - }; - ContainerBlot.prototype.unwrap = function () { - this.moveChildren(this.parent, this.next); - this.remove(); - }; - ContainerBlot.prototype.update = function (mutations, context) { - var _this = this; - var addedNodes = []; - var removedNodes = []; - mutations.forEach(function (mutation) { - if (mutation.target === _this.domNode && mutation.type === 'childList') { - addedNodes.push.apply(addedNodes, mutation.addedNodes); - removedNodes.push.apply(removedNodes, mutation.removedNodes); - } - }); - removedNodes.forEach(function (node) { - // Check node has actually been removed - // One exception is Chrome does not immediately remove IFRAMEs - // from DOM but MutationRecord is correct in its reported removal - if (node.parentNode != null && - // @ts-ignore - node.tagName !== 'IFRAME' && - document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { - return; - } - var blot = Registry.find(node); - if (blot == null) - return; - if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { - blot.detach(); - } - }); - addedNodes - .filter(function (node) { - return node.parentNode == _this.domNode; - }) - .sort(function (a, b) { - if (a === b) - return 0; - if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { - return 1; - } - return -1; - }) - .forEach(function (node) { - var refBlot = null; - if (node.nextSibling != null) { - refBlot = Registry.find(node.nextSibling); - } - var blot = makeBlot(node); - if (blot.next != refBlot || blot.next == null) { - if (blot.parent != null) { - blot.parent.removeChild(_this); - } - _this.insertBefore(blot, refBlot || undefined); - } - }); - }; - return ContainerBlot; -}(shadow_1.default)); -function makeBlot(node) { - var blot = Registry.find(node); - if (blot == null) { - try { - blot = Registry.create(node); - } - catch (e) { - blot = Registry.create(Registry.Scope.INLINE); - [].slice.call(node.childNodes).forEach(function (child) { - // @ts-ignore - blot.domNode.appendChild(child); - }); - if (node.parentNode) { - node.parentNode.replaceChild(blot.domNode, node); - } - blot.attach(); - } - } - return blot; -} -exports.default = ContainerBlot; - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var attributor_1 = __webpack_require__(12); -var store_1 = __webpack_require__(31); -var container_1 = __webpack_require__(17); -var Registry = __webpack_require__(1); -var FormatBlot = /** @class */ (function (_super) { - __extends(FormatBlot, _super); - function FormatBlot(domNode) { - var _this = _super.call(this, domNode) || this; - _this.attributes = new store_1.default(_this.domNode); - return _this; - } - FormatBlot.formats = function (domNode) { - if (typeof this.tagName === 'string') { - return true; - } - else if (Array.isArray(this.tagName)) { - return domNode.tagName.toLowerCase(); - } - return undefined; - }; - FormatBlot.prototype.format = function (name, value) { - var format = Registry.query(name); - if (format instanceof attributor_1.default) { - this.attributes.attribute(format, value); - } - else if (value) { - if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { - this.replaceWith(name, value); - } - } - }; - FormatBlot.prototype.formats = function () { - var formats = this.attributes.values(); - var format = this.statics.formats(this.domNode); - if (format != null) { - formats[this.statics.blotName] = format; - } - return formats; - }; - FormatBlot.prototype.replaceWith = function (name, value) { - var replacement = _super.prototype.replaceWith.call(this, name, value); - this.attributes.copy(replacement); - return replacement; - }; - FormatBlot.prototype.update = function (mutations, context) { - var _this = this; - _super.prototype.update.call(this, mutations, context); - if (mutations.some(function (mutation) { - return mutation.target === _this.domNode && mutation.type === 'attributes'; - })) { - this.attributes.build(); - } - }; - FormatBlot.prototype.wrap = function (name, value) { - var wrapper = _super.prototype.wrap.call(this, name, value); - if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { - this.attributes.move(wrapper); - } - return wrapper; - }; - return FormatBlot; -}(container_1.default)); -exports.default = FormatBlot; - - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var shadow_1 = __webpack_require__(30); -var Registry = __webpack_require__(1); -var LeafBlot = /** @class */ (function (_super) { - __extends(LeafBlot, _super); - function LeafBlot() { - return _super !== null && _super.apply(this, arguments) || this; - } - LeafBlot.value = function (domNode) { - return true; - }; - LeafBlot.prototype.index = function (node, offset) { - if (this.domNode === node || - this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { - return Math.min(offset, 1); - } - return -1; - }; - LeafBlot.prototype.position = function (index, inclusive) { - var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); - if (index > 0) - offset += 1; - return [this.parent.domNode, offset]; - }; - LeafBlot.prototype.value = function () { - return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a; - var _a; - }; - LeafBlot.scope = Registry.Scope.INLINE_BLOT; - return LeafBlot; -}(shadow_1.default)); -exports.default = LeafBlot; - - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -var equal = __webpack_require__(11); -var extend = __webpack_require__(3); - - -var lib = { - attributes: { - compose: function (a, b, keepNull) { - if (typeof a !== 'object') a = {}; - if (typeof b !== 'object') b = {}; - var attributes = extend(true, {}, b); - if (!keepNull) { - attributes = Object.keys(attributes).reduce(function (copy, key) { - if (attributes[key] != null) { - copy[key] = attributes[key]; - } - return copy; - }, {}); - } - for (var key in a) { - if (a[key] !== undefined && b[key] === undefined) { - attributes[key] = a[key]; - } - } - return Object.keys(attributes).length > 0 ? attributes : undefined; - }, - - diff: function(a, b) { - if (typeof a !== 'object') a = {}; - if (typeof b !== 'object') b = {}; - var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { - if (!equal(a[key], b[key])) { - attributes[key] = b[key] === undefined ? null : b[key]; - } - return attributes; - }, {}); - return Object.keys(attributes).length > 0 ? attributes : undefined; - }, - - transform: function (a, b, priority) { - if (typeof a !== 'object') return b; - if (typeof b !== 'object') return undefined; - if (!priority) return b; // b simply overwrites us without priority - var attributes = Object.keys(b).reduce(function (attributes, key) { - if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value - return attributes; - }, {}); - return Object.keys(attributes).length > 0 ? attributes : undefined; - } - }, - - iterator: function (ops) { - return new Iterator(ops); - }, - - length: function (op) { - if (typeof op['delete'] === 'number') { - return op['delete']; - } else if (typeof op.retain === 'number') { - return op.retain; - } else { - return typeof op.insert === 'string' ? op.insert.length : 1; - } - } -}; - - -function Iterator(ops) { - this.ops = ops; - this.index = 0; - this.offset = 0; -}; - -Iterator.prototype.hasNext = function () { - return this.peekLength() < Infinity; -}; - -Iterator.prototype.next = function (length) { - if (!length) length = Infinity; - var nextOp = this.ops[this.index]; - if (nextOp) { - var offset = this.offset; - var opLength = lib.length(nextOp) - if (length >= opLength - offset) { - length = opLength - offset; - this.index += 1; - this.offset = 0; - } else { - this.offset += length; - } - if (typeof nextOp['delete'] === 'number') { - return { 'delete': length }; - } else { - var retOp = {}; - if (nextOp.attributes) { - retOp.attributes = nextOp.attributes; - } - if (typeof nextOp.retain === 'number') { - retOp.retain = length; - } else if (typeof nextOp.insert === 'string') { - retOp.insert = nextOp.insert.substr(offset, length); - } else { - // offset should === 0, length should === 1 - retOp.insert = nextOp.insert; - } - return retOp; - } - } else { - return { retain: Infinity }; - } -}; - -Iterator.prototype.peek = function () { - return this.ops[this.index]; -}; - -Iterator.prototype.peekLength = function () { - if (this.ops[this.index]) { - // Should never return 0 if our index is being managed correctly - return lib.length(this.ops[this.index]) - this.offset; - } else { - return Infinity; - } -}; - -Iterator.prototype.peekType = function () { - if (this.ops[this.index]) { - if (typeof this.ops[this.index]['delete'] === 'number') { - return 'delete'; - } else if (typeof this.ops[this.index].retain === 'number') { - return 'retain'; - } else { - return 'insert'; - } - } - return 'retain'; -}; - - -module.exports = lib; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports) { - -var clone = (function() { -'use strict'; - -function _instanceof(obj, type) { - return type != null && obj instanceof type; -} - -var nativeMap; -try { - nativeMap = Map; -} catch(_) { - // maybe a reference error because no `Map`. Give it a dummy value that no - // value will ever be an instanceof. - nativeMap = function() {}; -} - -var nativeSet; -try { - nativeSet = Set; -} catch(_) { - nativeSet = function() {}; -} - -var nativePromise; -try { - nativePromise = Promise; -} catch(_) { - nativePromise = function() {}; -} - -/** - * Clones (copies) an Object using deep copying. - * - * This function supports circular references by default, but if you are certain - * there are no circular references in your object, you can save some CPU time - * by calling clone(obj, false). - * - * Caution: if `circular` is false and `parent` contains circular references, - * your program may enter an infinite loop and crash. - * - * @param `parent` - the object to be cloned - * @param `circular` - set to true if the object to be cloned may contain - * circular references. (optional - true by default) - * @param `depth` - set to a number if the object is only to be cloned to - * a particular depth. (optional - defaults to Infinity) - * @param `prototype` - sets the prototype to be used when cloning an object. - * (optional - defaults to parent prototype). - * @param `includeNonEnumerable` - set to true if the non-enumerable properties - * should be cloned as well. Non-enumerable properties on the prototype - * chain will be ignored. (optional - false by default) -*/ -function clone(parent, circular, depth, prototype, includeNonEnumerable) { - if (typeof circular === 'object') { - depth = circular.depth; - prototype = circular.prototype; - includeNonEnumerable = circular.includeNonEnumerable; - circular = circular.circular; - } - // maintain two arrays for circular references, where corresponding parents - // and children have the same index - var allParents = []; - var allChildren = []; - - var useBuffer = typeof Buffer != 'undefined'; - - if (typeof circular == 'undefined') - circular = true; - - if (typeof depth == 'undefined') - depth = Infinity; - - // recurse this function so we don't reset allParents and allChildren - function _clone(parent, depth) { - // cloning null always returns null - if (parent === null) - return null; - - if (depth === 0) - return parent; - - var child; - var proto; - if (typeof parent != 'object') { - return parent; - } - - if (_instanceof(parent, nativeMap)) { - child = new nativeMap(); - } else if (_instanceof(parent, nativeSet)) { - child = new nativeSet(); - } else if (_instanceof(parent, nativePromise)) { - child = new nativePromise(function (resolve, reject) { - parent.then(function(value) { - resolve(_clone(value, depth - 1)); - }, function(err) { - reject(_clone(err, depth - 1)); - }); - }); - } else if (clone.__isArray(parent)) { - child = []; - } else if (clone.__isRegExp(parent)) { - child = new RegExp(parent.source, __getRegExpFlags(parent)); - if (parent.lastIndex) child.lastIndex = parent.lastIndex; - } else if (clone.__isDate(parent)) { - child = new Date(parent.getTime()); - } else if (useBuffer && Buffer.isBuffer(parent)) { - child = new Buffer(parent.length); - parent.copy(child); - return child; - } else if (_instanceof(parent, Error)) { - child = Object.create(parent); - } else { - if (typeof prototype == 'undefined') { - proto = Object.getPrototypeOf(parent); - child = Object.create(proto); - } - else { - child = Object.create(prototype); - proto = prototype; - } - } - - if (circular) { - var index = allParents.indexOf(parent); - - if (index != -1) { - return allChildren[index]; - } - allParents.push(parent); - allChildren.push(child); - } - - if (_instanceof(parent, nativeMap)) { - parent.forEach(function(value, key) { - var keyChild = _clone(key, depth - 1); - var valueChild = _clone(value, depth - 1); - child.set(keyChild, valueChild); - }); - } - if (_instanceof(parent, nativeSet)) { - parent.forEach(function(value) { - var entryChild = _clone(value, depth - 1); - child.add(entryChild); - }); - } - - for (var i in parent) { - var attrs; - if (proto) { - attrs = Object.getOwnPropertyDescriptor(proto, i); - } - - if (attrs && attrs.set == null) { - continue; - } - child[i] = _clone(parent[i], depth - 1); - } - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(parent); - for (var i = 0; i < symbols.length; i++) { - // Don't need to worry about cloning a symbol because it is a primitive, - // like a number or string. - var symbol = symbols[i]; - var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); - if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { - continue; - } - child[symbol] = _clone(parent[symbol], depth - 1); - if (!descriptor.enumerable) { - Object.defineProperty(child, symbol, { - enumerable: false - }); - } - } - } - - if (includeNonEnumerable) { - var allPropertyNames = Object.getOwnPropertyNames(parent); - for (var i = 0; i < allPropertyNames.length; i++) { - var propertyName = allPropertyNames[i]; - var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); - if (descriptor && descriptor.enumerable) { - continue; - } - child[propertyName] = _clone(parent[propertyName], depth - 1); - Object.defineProperty(child, propertyName, { - enumerable: false - }); - } - } - - return child; - } - - return _clone(parent, depth); -} - -/** - * Simple flat clone using prototype, accepts only objects, usefull for property - * override on FLAT configuration object (no nested props). - * - * USE WITH CAUTION! This may not behave as you wish if you do not know how this - * works. - */ -clone.clonePrototype = function clonePrototype(parent) { - if (parent === null) - return null; - - var c = function () {}; - c.prototype = parent; - return new c(); -}; - -// private utility functions - -function __objToStr(o) { - return Object.prototype.toString.call(o); -} -clone.__objToStr = __objToStr; - -function __isDate(o) { - return typeof o === 'object' && __objToStr(o) === '[object Date]'; -} -clone.__isDate = __isDate; - -function __isArray(o) { - return typeof o === 'object' && __objToStr(o) === '[object Array]'; -} -clone.__isArray = __isArray; - -function __isRegExp(o) { - return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; -} -clone.__isRegExp = __isRegExp; - -function __getRegExpFlags(re) { - var flags = ''; - if (re.global) flags += 'g'; - if (re.ignoreCase) flags += 'i'; - if (re.multiline) flags += 'm'; - return flags; -} -clone.__getRegExpFlags = __getRegExpFlags; - -return clone; -})(); - -if (typeof module === 'object' && module.exports) { - module.exports = clone; -} - - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _emitter = __webpack_require__(8); - -var _emitter2 = _interopRequireDefault(_emitter); - -var _block = __webpack_require__(4); - -var _block2 = _interopRequireDefault(_block); - -var _break = __webpack_require__(16); - -var _break2 = _interopRequireDefault(_break); - -var _code = __webpack_require__(13); - -var _code2 = _interopRequireDefault(_code); - -var _container = __webpack_require__(25); - -var _container2 = _interopRequireDefault(_container); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -function isLine(blot) { - return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; -} - -var Scroll = function (_Parchment$Scroll) { - _inherits(Scroll, _Parchment$Scroll); - - function Scroll(domNode, config) { - _classCallCheck(this, Scroll); - - var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); - - _this.emitter = config.emitter; - if (Array.isArray(config.whitelist)) { - _this.whitelist = config.whitelist.reduce(function (whitelist, format) { - whitelist[format] = true; - return whitelist; - }, {}); - } - // Some reason fixes composition issues with character languages in Windows/Chrome, Safari - _this.domNode.addEventListener('DOMNodeInserted', function () {}); - _this.optimize(); - _this.enable(); - return _this; - } - - _createClass(Scroll, [{ - key: 'batchStart', - value: function batchStart() { - this.batch = true; - } - }, { - key: 'batchEnd', - value: function batchEnd() { - this.batch = false; - this.optimize(); - } - }, { - key: 'deleteAt', - value: function deleteAt(index, length) { - var _line = this.line(index), - _line2 = _slicedToArray(_line, 2), - first = _line2[0], - offset = _line2[1]; - - var _line3 = this.line(index + length), - _line4 = _slicedToArray(_line3, 1), - last = _line4[0]; - - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); - if (last != null && first !== last && offset > 0) { - if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) { - this.optimize(); - return; - } - if (first instanceof _code2.default) { - var newlineIndex = first.newlineIndex(first.length(), true); - if (newlineIndex > -1) { - first = first.split(newlineIndex + 1); - if (first === last) { - this.optimize(); - return; - } - } - } else if (last instanceof _code2.default) { - var _newlineIndex = last.newlineIndex(0); - if (_newlineIndex > -1) { - last.split(_newlineIndex + 1); - } - } - var ref = last.children.head instanceof _break2.default ? null : last.children.head; - first.moveChildren(last, ref); - first.remove(); - } - this.optimize(); - } - }, { - key: 'enable', - value: function enable() { - var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - - this.domNode.setAttribute('contenteditable', enabled); - } - }, { - key: 'formatAt', - value: function formatAt(index, length, format, value) { - if (this.whitelist != null && !this.whitelist[format]) return; - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); - this.optimize(); - } - }, { - key: 'insertAt', - value: function insertAt(index, value, def) { - if (def != null && this.whitelist != null && !this.whitelist[value]) return; - if (index >= this.length()) { - if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { - var blot = _parchment2.default.create(this.statics.defaultChild); - this.appendChild(blot); - if (def == null && value.endsWith('\n')) { - value = value.slice(0, -1); - } - blot.insertAt(0, value, def); - } else { - var embed = _parchment2.default.create(value, def); - this.appendChild(embed); - } - } else { - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); - } - this.optimize(); - } - }, { - key: 'insertBefore', - value: function insertBefore(blot, ref) { - if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { - var wrapper = _parchment2.default.create(this.statics.defaultChild); - wrapper.appendChild(blot); - blot = wrapper; - } - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); - } - }, { - key: 'leaf', - value: function leaf(index) { - return this.path(index).pop() || [null, -1]; - } - }, { - key: 'line', - value: function line(index) { - if (index === this.length()) { - return this.line(index - 1); - } - return this.descendant(isLine, index); - } - }, { - key: 'lines', - value: function lines() { - var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; - - var getLines = function getLines(blot, index, length) { - var lines = [], - lengthLeft = length; - blot.children.forEachAt(index, length, function (child, index, length) { - if (isLine(child)) { - lines.push(child); - } else if (child instanceof _parchment2.default.Container) { - lines = lines.concat(getLines(child, index, lengthLeft)); - } - lengthLeft -= length; - }); - return lines; - }; - return getLines(this, index, length); - } - }, { - key: 'optimize', - value: function optimize() { - var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (this.batch === true) return; - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context); - if (mutations.length > 0) { - this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context); - } - } - }, { - key: 'path', - value: function path(index) { - return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self - } - }, { - key: 'update', - value: function update(mutations) { - if (this.batch === true) return; - var source = _emitter2.default.sources.USER; - if (typeof mutations === 'string') { - source = mutations; - } - if (!Array.isArray(mutations)) { - mutations = this.observer.takeRecords(); - } - if (mutations.length > 0) { - this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); - } - _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy - if (mutations.length > 0) { - this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); - } - } - }]); - - return Scroll; -}(_parchment2.default.Scroll); - -Scroll.blotName = 'scroll'; -Scroll.className = 'ql-editor'; -Scroll.tagName = 'DIV'; -Scroll.defaultChild = 'block'; -Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; - -exports.default = Scroll; - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SHORTKEY = exports.default = undefined; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -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; }; }(); - -var _clone = __webpack_require__(21); - -var _clone2 = _interopRequireDefault(_clone); - -var _deepEqual = __webpack_require__(11); - -var _deepEqual2 = _interopRequireDefault(_deepEqual); - -var _extend = __webpack_require__(3); - -var _extend2 = _interopRequireDefault(_extend); - -var _quillDelta = __webpack_require__(2); - -var _quillDelta2 = _interopRequireDefault(_quillDelta); - -var _op = __webpack_require__(20); - -var _op2 = _interopRequireDefault(_op); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _quill = __webpack_require__(5); - -var _quill2 = _interopRequireDefault(_quill); - -var _logger = __webpack_require__(10); - -var _logger2 = _interopRequireDefault(_logger); - -var _module = __webpack_require__(9); - -var _module2 = _interopRequireDefault(_module); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -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; } - -var debug = (0, _logger2.default)('quill:keyboard'); - -var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; - -var Keyboard = function (_Module) { - _inherits(Keyboard, _Module); - - _createClass(Keyboard, null, [{ - key: 'match', - value: function match(evt, binding) { - binding = normalize(binding); - if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { - return !!binding[key] !== evt[key] && binding[key] !== null; - })) { - return false; - } - return binding.key === (evt.which || evt.keyCode); - } - }]); - - function Keyboard(quill, options) { - _classCallCheck(this, Keyboard); - - var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); - - _this.bindings = {}; - Object.keys(_this.options.bindings).forEach(function (name) { - if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) { - return; - } - if (_this.options.bindings[name]) { - _this.addBinding(_this.options.bindings[name]); - } - }); - _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); - _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); - if (/Firefox/i.test(navigator.userAgent)) { - // Need to handle delete and backspace for Firefox in the general case #1171 - _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace); - _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete); - } else { - _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); - _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete); - } - _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); - _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); - _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace); - _this.listen(); - return _this; - } - - _createClass(Keyboard, [{ - key: 'addBinding', - value: function addBinding(key) { - var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - var binding = normalize(key); - if (binding == null || binding.key == null) { - return debug.warn('Attempted to add invalid keyboard binding', binding); - } - if (typeof context === 'function') { - context = { handler: context }; - } - if (typeof handler === 'function') { - handler = { handler: handler }; - } - binding = (0, _extend2.default)(binding, context, handler); - this.bindings[binding.key] = this.bindings[binding.key] || []; - this.bindings[binding.key].push(binding); - } - }, { - key: 'listen', - value: function listen() { - var _this2 = this; - - this.quill.root.addEventListener('keydown', function (evt) { - if (evt.defaultPrevented) return; - var which = evt.which || evt.keyCode; - var bindings = (_this2.bindings[which] || []).filter(function (binding) { - return Keyboard.match(evt, binding); - }); - if (bindings.length === 0) return; - var range = _this2.quill.getSelection(); - if (range == null || !_this2.quill.hasFocus()) return; - - var _quill$getLine = _this2.quill.getLine(range.index), - _quill$getLine2 = _slicedToArray(_quill$getLine, 2), - line = _quill$getLine2[0], - offset = _quill$getLine2[1]; - - var _quill$getLeaf = _this2.quill.getLeaf(range.index), - _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), - leafStart = _quill$getLeaf2[0], - offsetStart = _quill$getLeaf2[1]; - - var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), - _ref2 = _slicedToArray(_ref, 2), - leafEnd = _ref2[0], - offsetEnd = _ref2[1]; - - var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; - var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; - var curContext = { - collapsed: range.length === 0, - empty: range.length === 0 && line.length() <= 1, - format: _this2.quill.getFormat(range), - offset: offset, - prefix: prefixText, - suffix: suffixText - }; - var prevented = bindings.some(function (binding) { - if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; - if (binding.empty != null && binding.empty !== curContext.empty) return false; - if (binding.offset != null && binding.offset !== curContext.offset) return false; - if (Array.isArray(binding.format)) { - // any format is present - if (binding.format.every(function (name) { - return curContext.format[name] == null; - })) { - return false; - } - } else if (_typeof(binding.format) === 'object') { - // all formats must match - if (!Object.keys(binding.format).every(function (name) { - if (binding.format[name] === true) return curContext.format[name] != null; - if (binding.format[name] === false) return curContext.format[name] == null; - return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); - })) { - return false; - } - } - if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; - if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; - return binding.handler.call(_this2, range, curContext) !== true; - }); - if (prevented) { - evt.preventDefault(); - } - }); - } - }]); - - return Keyboard; -}(_module2.default); - -Keyboard.keys = { - BACKSPACE: 8, - TAB: 9, - ENTER: 13, - ESCAPE: 27, - LEFT: 37, - UP: 38, - RIGHT: 39, - DOWN: 40, - DELETE: 46 -}; - -Keyboard.DEFAULTS = { - bindings: { - 'bold': makeFormatHandler('bold'), - 'italic': makeFormatHandler('italic'), - 'underline': makeFormatHandler('underline'), - 'indent': { - // highlight tab or tab at beginning of list, indent or blockquote - key: Keyboard.keys.TAB, - format: ['blockquote', 'indent', 'list'], - handler: function handler(range, context) { - if (context.collapsed && context.offset !== 0) return true; - this.quill.format('indent', '+1', _quill2.default.sources.USER); - } - }, - 'outdent': { - key: Keyboard.keys.TAB, - shiftKey: true, - format: ['blockquote', 'indent', 'list'], - // highlight tab or tab at beginning of list, indent or blockquote - handler: function handler(range, context) { - if (context.collapsed && context.offset !== 0) return true; - this.quill.format('indent', '-1', _quill2.default.sources.USER); - } - }, - 'outdent backspace': { - key: Keyboard.keys.BACKSPACE, - collapsed: true, - shiftKey: null, - metaKey: null, - ctrlKey: null, - altKey: null, - format: ['indent', 'list'], - offset: 0, - handler: function handler(range, context) { - if (context.format.indent != null) { - this.quill.format('indent', '-1', _quill2.default.sources.USER); - } else if (context.format.list != null) { - this.quill.format('list', false, _quill2.default.sources.USER); - } - } - }, - 'indent code-block': makeCodeBlockHandler(true), - 'outdent code-block': makeCodeBlockHandler(false), - 'remove tab': { - key: Keyboard.keys.TAB, - shiftKey: true, - collapsed: true, - prefix: /\t$/, - handler: function handler(range) { - this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); - } - }, - 'tab': { - key: Keyboard.keys.TAB, - handler: function handler(range) { - this.quill.history.cutoff(); - var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t'); - this.quill.updateContents(delta, _quill2.default.sources.USER); - this.quill.history.cutoff(); - this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); - } - }, - 'list empty enter': { - key: Keyboard.keys.ENTER, - collapsed: true, - format: ['list'], - empty: true, - handler: function handler(range, context) { - this.quill.format('list', false, _quill2.default.sources.USER); - if (context.format.indent) { - this.quill.format('indent', false, _quill2.default.sources.USER); - } - } - }, - 'checklist enter': { - key: Keyboard.keys.ENTER, - collapsed: true, - format: { list: 'checked' }, - handler: function handler(range) { - var _quill$getLine3 = this.quill.getLine(range.index), - _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), - line = _quill$getLine4[0], - offset = _quill$getLine4[1]; - - var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' }); - var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' }); - this.quill.updateContents(delta, _quill2.default.sources.USER); - this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); - this.quill.scrollIntoView(); - } - }, - 'header enter': { - key: Keyboard.keys.ENTER, - collapsed: true, - format: ['header'], - suffix: /^$/, - handler: function handler(range, context) { - var _quill$getLine5 = this.quill.getLine(range.index), - _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), - line = _quill$getLine6[0], - offset = _quill$getLine6[1]; - - var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null }); - this.quill.updateContents(delta, _quill2.default.sources.USER); - this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); - this.quill.scrollIntoView(); - } - }, - 'list autofill': { - key: ' ', - collapsed: true, - format: { list: false }, - prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/, - handler: function handler(range, context) { - var length = context.prefix.length; - - var _quill$getLine7 = this.quill.getLine(range.index), - _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), - line = _quill$getLine8[0], - offset = _quill$getLine8[1]; - - if (offset > length) return true; - var value = void 0; - switch (context.prefix.trim()) { - case '[]':case '[ ]': - value = 'unchecked'; - break; - case '[x]': - value = 'checked'; - break; - case '-':case '*': - value = 'bullet'; - break; - default: - value = 'ordered'; - } - this.quill.insertText(range.index, ' ', _quill2.default.sources.USER); - this.quill.history.cutoff(); - var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value }); - this.quill.updateContents(delta, _quill2.default.sources.USER); - this.quill.history.cutoff(); - this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); - } - }, - 'code exit': { - key: Keyboard.keys.ENTER, - collapsed: true, - format: ['code-block'], - prefix: /\n\n$/, - suffix: /^\s+$/, - handler: function handler(range) { - var _quill$getLine9 = this.quill.getLine(range.index), - _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), - line = _quill$getLine10[0], - offset = _quill$getLine10[1]; - - var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1); - this.quill.updateContents(delta, _quill2.default.sources.USER); - } - }, - 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false), - 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true), - 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false), - 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true) - } -}; - -function makeEmbedArrowHandler(key, shiftKey) { - var _ref3; - - var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix'; - return _ref3 = { - key: key, - shiftKey: shiftKey, - altKey: null - }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) { - var index = range.index; - if (key === Keyboard.keys.RIGHT) { - index += range.length + 1; - } - - var _quill$getLeaf3 = this.quill.getLeaf(index), - _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), - leaf = _quill$getLeaf4[0]; - - if (!(leaf instanceof _parchment2.default.Embed)) return true; - if (key === Keyboard.keys.LEFT) { - if (shiftKey) { - this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER); - } else { - this.quill.setSelection(range.index - 1, _quill2.default.sources.USER); - } - } else { - if (shiftKey) { - this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER); - } else { - this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER); - } - } - return false; - }), _ref3; -} - -function handleBackspace(range, context) { - if (range.index === 0 || this.quill.getLength() <= 1) return; - - var _quill$getLine11 = this.quill.getLine(range.index), - _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), - line = _quill$getLine12[0]; - - var formats = {}; - if (context.offset === 0) { - var _quill$getLine13 = this.quill.getLine(range.index - 1), - _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), - prev = _quill$getLine14[0]; - - if (prev != null && prev.length() > 1) { - var curFormats = line.formats(); - var prevFormats = this.quill.getFormat(range.index - 1, 1); - formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; - } - } - // Check for astral symbols - var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1; - this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER); - if (Object.keys(formats).length > 0) { - this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER); - } - this.quill.focus(); -} - -function handleDelete(range, context) { - // Check for astral symbols - var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1; - if (range.index >= this.quill.getLength() - length) return; - var formats = {}, - nextLength = 0; - - var _quill$getLine15 = this.quill.getLine(range.index), - _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), - line = _quill$getLine16[0]; - - if (context.offset >= line.length() - 1) { - var _quill$getLine17 = this.quill.getLine(range.index + 1), - _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), - next = _quill$getLine18[0]; - - if (next) { - var curFormats = line.formats(); - var nextFormats = this.quill.getFormat(range.index, 1); - formats = _op2.default.attributes.diff(curFormats, nextFormats) || {}; - nextLength = next.length(); - } - } - this.quill.deleteText(range.index, length, _quill2.default.sources.USER); - if (Object.keys(formats).length > 0) { - this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER); - } -} - -function handleDeleteRange(range) { - var lines = this.quill.getLines(range); - var formats = {}; - if (lines.length > 1) { - var firstFormats = lines[0].formats(); - var lastFormats = lines[lines.length - 1].formats(); - formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {}; - } - this.quill.deleteText(range, _quill2.default.sources.USER); - if (Object.keys(formats).length > 0) { - this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER); - } - this.quill.setSelection(range.index, _quill2.default.sources.SILENT); - this.quill.focus(); -} - -function handleEnter(range, context) { - var _this3 = this; - - if (range.length > 0) { - this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change - } - var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { - if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { - lineFormats[format] = context.format[format]; - } - return lineFormats; - }, {}); - this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); - // Earlier scroll.deleteAt might have messed up our selection, - // so insertText's built in selection preservation is not reliable - this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); - this.quill.focus(); - Object.keys(context.format).forEach(function (name) { - if (lineFormats[name] != null) return; - if (Array.isArray(context.format[name])) return; - if (name === 'link') return; - _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); - }); -} - -function makeCodeBlockHandler(indent) { - return { - key: Keyboard.keys.TAB, - shiftKey: !indent, - format: { 'code-block': true }, - handler: function handler(range) { - var CodeBlock = _parchment2.default.query('code-block'); - var index = range.index, - length = range.length; - - var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), - _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), - block = _quill$scroll$descend2[0], - offset = _quill$scroll$descend2[1]; - - if (block == null) return; - var scrollIndex = this.quill.getIndex(block); - var start = block.newlineIndex(offset, true) + 1; - var end = block.newlineIndex(scrollIndex + offset + length); - var lines = block.domNode.textContent.slice(start, end).split('\n'); - offset = 0; - lines.forEach(function (line, i) { - if (indent) { - block.insertAt(start + offset, CodeBlock.TAB); - offset += CodeBlock.TAB.length; - if (i === 0) { - index += CodeBlock.TAB.length; - } else { - length += CodeBlock.TAB.length; - } - } else if (line.startsWith(CodeBlock.TAB)) { - block.deleteAt(start + offset, CodeBlock.TAB.length); - offset -= CodeBlock.TAB.length; - if (i === 0) { - index -= CodeBlock.TAB.length; - } else { - length -= CodeBlock.TAB.length; - } - } - offset += line.length + 1; - }); - this.quill.update(_quill2.default.sources.USER); - this.quill.setSelection(index, length, _quill2.default.sources.SILENT); - } - }; -} - -function makeFormatHandler(format) { - return { - key: format[0].toUpperCase(), - shortKey: true, - handler: function handler(range, context) { - this.quill.format(format, !context.format[format], _quill2.default.sources.USER); - } - }; -} - -function normalize(binding) { - if (typeof binding === 'string' || typeof binding === 'number') { - return normalize({ key: binding }); - } - if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { - binding = (0, _clone2.default)(binding, false); - } - if (typeof binding.key === 'string') { - if (Keyboard.keys[binding.key.toUpperCase()] != null) { - binding.key = Keyboard.keys[binding.key.toUpperCase()]; - } else if (binding.key.length === 1) { - binding.key = binding.key.toUpperCase().charCodeAt(0); - } else { - return null; - } - } - if (binding.shortKey) { - binding[SHORTKEY] = binding.shortKey; - delete binding.shortKey; - } - return binding; -} - -exports.default = Keyboard; -exports.SHORTKEY = SHORTKEY; - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -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; }; }(); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _text = __webpack_require__(7); - -var _text2 = _interopRequireDefault(_text); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Cursor = function (_Parchment$Embed) { - _inherits(Cursor, _Parchment$Embed); - - _createClass(Cursor, null, [{ - key: 'value', - value: function value() { - return undefined; - } - }]); - - function Cursor(domNode, selection) { - _classCallCheck(this, Cursor); - - var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); - - _this.selection = selection; - _this.textNode = document.createTextNode(Cursor.CONTENTS); - _this.domNode.appendChild(_this.textNode); - _this._length = 0; - return _this; - } - - _createClass(Cursor, [{ - key: 'detach', - value: function detach() { - // super.detach() will also clear domNode.__blot - if (this.parent != null) this.parent.removeChild(this); - } - }, { - key: 'format', - value: function format(name, value) { - if (this._length !== 0) { - return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); - } - var target = this, - index = 0; - while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { - index += target.offset(target.parent); - target = target.parent; - } - if (target != null) { - this._length = Cursor.CONTENTS.length; - target.optimize(); - target.formatAt(index, Cursor.CONTENTS.length, name, value); - this._length = 0; - } - } - }, { - key: 'index', - value: function index(node, offset) { - if (node === this.textNode) return 0; - return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); - } - }, { - key: 'length', - value: function length() { - return this._length; - } - }, { - key: 'position', - value: function position() { - return [this.textNode, this.textNode.data.length]; - } - }, { - key: 'remove', - value: function remove() { - _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); - this.parent = null; - } - }, { - key: 'restore', - value: function restore() { - if (this.selection.composing || this.parent == null) return; - var textNode = this.textNode; - var range = this.selection.getNativeRange(); - var restoreText = void 0, - start = void 0, - end = void 0; - if (range != null && range.start.node === textNode && range.end.node === textNode) { - var _ref = [textNode, range.start.offset, range.end.offset]; - restoreText = _ref[0]; - start = _ref[1]; - end = _ref[2]; - } - // Link format will insert text outside of anchor tag - while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { - this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); - } - if (this.textNode.data !== Cursor.CONTENTS) { - var text = this.textNode.data.split(Cursor.CONTENTS).join(''); - if (this.next instanceof _text2.default) { - restoreText = this.next.domNode; - this.next.insertAt(0, text); - this.textNode.data = Cursor.CONTENTS; - } else { - this.textNode.data = text; - this.parent.insertBefore(_parchment2.default.create(this.textNode), this); - this.textNode = document.createTextNode(Cursor.CONTENTS); - this.domNode.appendChild(this.textNode); - } - } - this.remove(); - if (start != null) { - var _map = [start, end].map(function (offset) { - return Math.max(0, Math.min(restoreText.data.length, offset - 1)); - }); - - var _map2 = _slicedToArray(_map, 2); - - start = _map2[0]; - end = _map2[1]; - - return { - startNode: restoreText, - startOffset: start, - endNode: restoreText, - endOffset: end - }; - } - } - }, { - key: 'update', - value: function update(mutations, context) { - var _this2 = this; - - if (mutations.some(function (mutation) { - return mutation.type === 'characterData' && mutation.target === _this2.textNode; - })) { - var range = this.restore(); - if (range) context.range = range; - } - } - }, { - key: 'value', - value: function value() { - return ''; - } - }]); - - return Cursor; -}(_parchment2.default.Embed); - -Cursor.blotName = 'cursor'; -Cursor.className = 'ql-cursor'; -Cursor.tagName = 'span'; -Cursor.CONTENTS = '\uFEFF'; // Zero width no break space - - -exports.default = Cursor; - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _block = __webpack_require__(4); - -var _block2 = _interopRequireDefault(_block); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Container = function (_Parchment$Container) { - _inherits(Container, _Parchment$Container); - - function Container() { - _classCallCheck(this, Container); - - return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); - } - - return Container; -}(_parchment2.default.Container); - -Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; - -exports.default = Container; - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var ColorAttributor = function (_Parchment$Attributor) { - _inherits(ColorAttributor, _Parchment$Attributor); - - function ColorAttributor() { - _classCallCheck(this, ColorAttributor); - - return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); - } - - _createClass(ColorAttributor, [{ - key: 'value', - value: function value(domNode) { - var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); - if (!value.startsWith('rgb(')) return value; - value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); - return '#' + value.split(',').map(function (component) { - return ('00' + parseInt(component).toString(16)).slice(-2); - }).join(''); - } - }]); - - return ColorAttributor; -}(_parchment2.default.Attributor.Style); - -var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { - scope: _parchment2.default.Scope.INLINE -}); -var ColorStyle = new ColorAttributor('color', 'color', { - scope: _parchment2.default.Scope.INLINE -}); - -exports.ColorAttributor = ColorAttributor; -exports.ColorClass = ColorClass; -exports.ColorStyle = ColorStyle; - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.sanitize = exports.default = undefined; - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _inline = __webpack_require__(6); - -var _inline2 = _interopRequireDefault(_inline); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Link = function (_Inline) { - _inherits(Link, _Inline); - - function Link() { - _classCallCheck(this, Link); - - return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments)); - } - - _createClass(Link, [{ - key: 'format', - value: function format(name, value) { - if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value); - value = this.constructor.sanitize(value); - this.domNode.setAttribute('href', value); - } - }], [{ - key: 'create', - value: function create(value) { - var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value); - value = this.sanitize(value); - node.setAttribute('href', value); - node.setAttribute('target', '_blank'); - return node; - } - }, { - key: 'formats', - value: function formats(domNode) { - return domNode.getAttribute('href'); - } - }, { - key: 'sanitize', - value: function sanitize(url) { - return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL; - } - }]); - - return Link; -}(_inline2.default); - -Link.blotName = 'link'; -Link.tagName = 'A'; -Link.SANITIZED_URL = 'about:blank'; -Link.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel']; - -function _sanitize(url, protocols) { - var anchor = document.createElement('a'); - anchor.href = url; - var protocol = anchor.href.slice(0, anchor.href.indexOf(':')); - return protocols.indexOf(protocol) > -1; -} - -exports.default = Link; -exports.sanitize = _sanitize; - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -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; }; }(); - -var _keyboard = __webpack_require__(23); - -var _keyboard2 = _interopRequireDefault(_keyboard); - -var _dropdown = __webpack_require__(107); - -var _dropdown2 = _interopRequireDefault(_dropdown); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var optionsCounter = 0; - -function toggleAriaAttribute(element, attribute) { - element.setAttribute(attribute, !(element.getAttribute(attribute) === 'true')); -} - -var Picker = function () { - function Picker(select) { - var _this = this; - - _classCallCheck(this, Picker); - - this.select = select; - this.container = document.createElement('span'); - this.buildPicker(); - this.select.style.display = 'none'; - this.select.parentNode.insertBefore(this.container, this.select); - - this.label.addEventListener('mousedown', function () { - _this.togglePicker(); - }); - this.label.addEventListener('keydown', function (event) { - switch (event.keyCode) { - // Allows the "Enter" key to open the picker - case _keyboard2.default.keys.ENTER: - _this.togglePicker(); - break; - - // Allows the "Escape" key to close the picker - case _keyboard2.default.keys.ESCAPE: - _this.escape(); - event.preventDefault(); - break; - default: - } - }); - this.select.addEventListener('change', this.update.bind(this)); - } - - _createClass(Picker, [{ - key: 'togglePicker', - value: function togglePicker() { - this.container.classList.toggle('ql-expanded'); - // Toggle aria-expanded and aria-hidden to make the picker accessible - toggleAriaAttribute(this.label, 'aria-expanded'); - toggleAriaAttribute(this.options, 'aria-hidden'); - } - }, { - key: 'buildItem', - value: function buildItem(option) { - var _this2 = this; - - var item = document.createElement('span'); - item.tabIndex = '0'; - item.setAttribute('role', 'button'); - - item.classList.add('ql-picker-item'); - if (option.hasAttribute('value')) { - item.setAttribute('data-value', option.getAttribute('value')); - } - if (option.textContent) { - item.setAttribute('data-label', option.textContent); - } - item.addEventListener('click', function () { - _this2.selectItem(item, true); - }); - item.addEventListener('keydown', function (event) { - switch (event.keyCode) { - // Allows the "Enter" key to select an item - case _keyboard2.default.keys.ENTER: - _this2.selectItem(item, true); - event.preventDefault(); - break; - - // Allows the "Escape" key to close the picker - case _keyboard2.default.keys.ESCAPE: - _this2.escape(); - event.preventDefault(); - break; - default: - } - }); - - return item; - } - }, { - key: 'buildLabel', - value: function buildLabel() { - var label = document.createElement('span'); - label.classList.add('ql-picker-label'); - label.innerHTML = _dropdown2.default; - label.tabIndex = '0'; - label.setAttribute('role', 'button'); - label.setAttribute('aria-expanded', 'false'); - this.container.appendChild(label); - return label; - } - }, { - key: 'buildOptions', - value: function buildOptions() { - var _this3 = this; - - var options = document.createElement('span'); - options.classList.add('ql-picker-options'); - - // Don't want screen readers to read this until options are visible - options.setAttribute('aria-hidden', 'true'); - options.tabIndex = '-1'; - - // Need a unique id for aria-controls - options.id = 'ql-picker-options-' + optionsCounter; - optionsCounter += 1; - this.label.setAttribute('aria-controls', options.id); - - this.options = options; - - [].slice.call(this.select.options).forEach(function (option) { - var item = _this3.buildItem(option); - options.appendChild(item); - if (option.selected === true) { - _this3.selectItem(item); - } - }); - this.container.appendChild(options); - } - }, { - key: 'buildPicker', - value: function buildPicker() { - var _this4 = this; - - [].slice.call(this.select.attributes).forEach(function (item) { - _this4.container.setAttribute(item.name, item.value); - }); - this.container.classList.add('ql-picker'); - this.label = this.buildLabel(); - this.buildOptions(); - } - }, { - key: 'escape', - value: function escape() { - var _this5 = this; - - // Close menu and return focus to trigger label - this.close(); - // Need setTimeout for accessibility to ensure that the browser executes - // focus on the next process thread and after any DOM content changes - setTimeout(function () { - return _this5.label.focus(); - }, 1); - } - }, { - key: 'close', - value: function close() { - this.container.classList.remove('ql-expanded'); - this.label.setAttribute('aria-expanded', 'false'); - this.options.setAttribute('aria-hidden', 'true'); - } - }, { - key: 'selectItem', - value: function selectItem(item) { - var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - var selected = this.container.querySelector('.ql-selected'); - if (item === selected) return; - if (selected != null) { - selected.classList.remove('ql-selected'); - } - if (item == null) return; - item.classList.add('ql-selected'); - this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item); - if (item.hasAttribute('data-value')) { - this.label.setAttribute('data-value', item.getAttribute('data-value')); - } else { - this.label.removeAttribute('data-value'); - } - if (item.hasAttribute('data-label')) { - this.label.setAttribute('data-label', item.getAttribute('data-label')); - } else { - this.label.removeAttribute('data-label'); - } - if (trigger) { - if (typeof Event === 'function') { - this.select.dispatchEvent(new Event('change')); - } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') { - // IE11 - var event = document.createEvent('Event'); - event.initEvent('change', true, true); - this.select.dispatchEvent(event); - } - this.close(); - } - } - }, { - key: 'update', - value: function update() { - var option = void 0; - if (this.select.selectedIndex > -1) { - var item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex]; - option = this.select.options[this.select.selectedIndex]; - this.selectItem(item); - } else { - this.selectItem(null); - } - var isActive = option != null && option !== this.select.querySelector('option[selected]'); - this.label.classList.toggle('ql-active', isActive); - } - }]); - - return Picker; -}(); - -exports.default = Picker; - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _quill = __webpack_require__(5); - -var _quill2 = _interopRequireDefault(_quill); - -var _block = __webpack_require__(4); - -var _block2 = _interopRequireDefault(_block); - -var _break = __webpack_require__(16); - -var _break2 = _interopRequireDefault(_break); - -var _container = __webpack_require__(25); - -var _container2 = _interopRequireDefault(_container); - -var _cursor = __webpack_require__(24); - -var _cursor2 = _interopRequireDefault(_cursor); - -var _embed = __webpack_require__(35); - -var _embed2 = _interopRequireDefault(_embed); - -var _inline = __webpack_require__(6); - -var _inline2 = _interopRequireDefault(_inline); - -var _scroll = __webpack_require__(22); - -var _scroll2 = _interopRequireDefault(_scroll); - -var _text = __webpack_require__(7); - -var _text2 = _interopRequireDefault(_text); - -var _clipboard = __webpack_require__(55); - -var _clipboard2 = _interopRequireDefault(_clipboard); - -var _history = __webpack_require__(42); - -var _history2 = _interopRequireDefault(_history); - -var _keyboard = __webpack_require__(23); - -var _keyboard2 = _interopRequireDefault(_keyboard); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -_quill2.default.register({ - 'blots/block': _block2.default, - 'blots/block/embed': _block.BlockEmbed, - 'blots/break': _break2.default, - 'blots/container': _container2.default, - 'blots/cursor': _cursor2.default, - 'blots/embed': _embed2.default, - 'blots/inline': _inline2.default, - 'blots/scroll': _scroll2.default, - 'blots/text': _text2.default, - - 'modules/clipboard': _clipboard2.default, - 'modules/history': _history2.default, - 'modules/keyboard': _keyboard2.default -}); - -_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); - -exports.default = _quill2.default; - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var Registry = __webpack_require__(1); -var ShadowBlot = /** @class */ (function () { - function ShadowBlot(domNode) { - this.domNode = domNode; - // @ts-ignore - this.domNode[Registry.DATA_KEY] = { blot: this }; - } - Object.defineProperty(ShadowBlot.prototype, "statics", { - // Hack for accessing inherited static methods - get: function () { - return this.constructor; - }, - enumerable: true, - configurable: true - }); - ShadowBlot.create = function (value) { - if (this.tagName == null) { - throw new Registry.ParchmentError('Blot definition missing tagName'); - } - var node; - if (Array.isArray(this.tagName)) { - if (typeof value === 'string') { - value = value.toUpperCase(); - if (parseInt(value).toString() === value) { - value = parseInt(value); - } - } - if (typeof value === 'number') { - node = document.createElement(this.tagName[value - 1]); - } - else if (this.tagName.indexOf(value) > -1) { - node = document.createElement(value); - } - else { - node = document.createElement(this.tagName[0]); - } - } - else { - node = document.createElement(this.tagName); - } - if (this.className) { - node.classList.add(this.className); - } - return node; - }; - ShadowBlot.prototype.attach = function () { - if (this.parent != null) { - this.scroll = this.parent.scroll; - } - }; - ShadowBlot.prototype.clone = function () { - var domNode = this.domNode.cloneNode(false); - return Registry.create(domNode); - }; - ShadowBlot.prototype.detach = function () { - if (this.parent != null) - this.parent.removeChild(this); - // @ts-ignore - delete this.domNode[Registry.DATA_KEY]; - }; - ShadowBlot.prototype.deleteAt = function (index, length) { - var blot = this.isolate(index, length); - blot.remove(); - }; - ShadowBlot.prototype.formatAt = function (index, length, name, value) { - var blot = this.isolate(index, length); - if (Registry.query(name, Registry.Scope.BLOT) != null && value) { - blot.wrap(name, value); - } - else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { - var parent = Registry.create(this.statics.scope); - blot.wrap(parent); - parent.format(name, value); - } - }; - ShadowBlot.prototype.insertAt = function (index, value, def) { - var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); - var ref = this.split(index); - this.parent.insertBefore(blot, ref); - }; - ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { - if (refBlot === void 0) { refBlot = null; } - if (this.parent != null) { - this.parent.children.remove(this); - } - var refDomNode = null; - parentBlot.children.insertBefore(this, refBlot); - if (refBlot != null) { - refDomNode = refBlot.domNode; - } - if (this.domNode.parentNode != parentBlot.domNode || - this.domNode.nextSibling != refDomNode) { - parentBlot.domNode.insertBefore(this.domNode, refDomNode); - } - this.parent = parentBlot; - this.attach(); - }; - ShadowBlot.prototype.isolate = function (index, length) { - var target = this.split(index); - target.split(length); - return target; - }; - ShadowBlot.prototype.length = function () { - return 1; - }; - ShadowBlot.prototype.offset = function (root) { - if (root === void 0) { root = this.parent; } - if (this.parent == null || this == root) - return 0; - return this.parent.children.offset(this) + this.parent.offset(root); - }; - ShadowBlot.prototype.optimize = function (context) { - // TODO clean up once we use WeakMap - // @ts-ignore - if (this.domNode[Registry.DATA_KEY] != null) { - // @ts-ignore - delete this.domNode[Registry.DATA_KEY].mutations; - } - }; - ShadowBlot.prototype.remove = function () { - if (this.domNode.parentNode != null) { - this.domNode.parentNode.removeChild(this.domNode); - } - this.detach(); - }; - ShadowBlot.prototype.replace = function (target) { - if (target.parent == null) - return; - target.parent.insertBefore(this, target.next); - target.remove(); - }; - ShadowBlot.prototype.replaceWith = function (name, value) { - var replacement = typeof name === 'string' ? Registry.create(name, value) : name; - replacement.replace(this); - return replacement; - }; - ShadowBlot.prototype.split = function (index, force) { - return index === 0 ? this : this.next; - }; - ShadowBlot.prototype.update = function (mutations, context) { - // Nothing to do by default - }; - ShadowBlot.prototype.wrap = function (name, value) { - var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; - if (this.parent != null) { - this.parent.insertBefore(wrapper, this.next); - } - wrapper.appendChild(this); - return wrapper; - }; - ShadowBlot.blotName = 'abstract'; - return ShadowBlot; -}()); -exports.default = ShadowBlot; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var attributor_1 = __webpack_require__(12); -var class_1 = __webpack_require__(32); -var style_1 = __webpack_require__(33); -var Registry = __webpack_require__(1); -var AttributorStore = /** @class */ (function () { - function AttributorStore(domNode) { - this.attributes = {}; - this.domNode = domNode; - this.build(); - } - AttributorStore.prototype.attribute = function (attribute, value) { - // verb - if (value) { - if (attribute.add(this.domNode, value)) { - if (attribute.value(this.domNode) != null) { - this.attributes[attribute.attrName] = attribute; - } - else { - delete this.attributes[attribute.attrName]; - } - } - } - else { - attribute.remove(this.domNode); - delete this.attributes[attribute.attrName]; - } - }; - AttributorStore.prototype.build = function () { - var _this = this; - this.attributes = {}; - var attributes = attributor_1.default.keys(this.domNode); - var classes = class_1.default.keys(this.domNode); - var styles = style_1.default.keys(this.domNode); - attributes - .concat(classes) - .concat(styles) - .forEach(function (name) { - var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); - if (attr instanceof attributor_1.default) { - _this.attributes[attr.attrName] = attr; - } - }); - }; - AttributorStore.prototype.copy = function (target) { - var _this = this; - Object.keys(this.attributes).forEach(function (key) { - var value = _this.attributes[key].value(_this.domNode); - target.format(key, value); - }); - }; - AttributorStore.prototype.move = function (target) { - var _this = this; - this.copy(target); - Object.keys(this.attributes).forEach(function (key) { - _this.attributes[key].remove(_this.domNode); - }); - this.attributes = {}; - }; - AttributorStore.prototype.values = function () { - var _this = this; - return Object.keys(this.attributes).reduce(function (attributes, name) { - attributes[name] = _this.attributes[name].value(_this.domNode); - return attributes; - }, {}); - }; - return AttributorStore; -}()); -exports.default = AttributorStore; - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var attributor_1 = __webpack_require__(12); -function match(node, prefix) { - var className = node.getAttribute('class') || ''; - return className.split(/\s+/).filter(function (name) { - return name.indexOf(prefix + "-") === 0; - }); -} -var ClassAttributor = /** @class */ (function (_super) { - __extends(ClassAttributor, _super); - function ClassAttributor() { - return _super !== null && _super.apply(this, arguments) || this; - } - ClassAttributor.keys = function (node) { - return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { - return name - .split('-') - .slice(0, -1) - .join('-'); - }); - }; - ClassAttributor.prototype.add = function (node, value) { - if (!this.canAdd(node, value)) - return false; - this.remove(node); - node.classList.add(this.keyName + "-" + value); - return true; - }; - ClassAttributor.prototype.remove = function (node) { - var matches = match(node, this.keyName); - matches.forEach(function (name) { - node.classList.remove(name); - }); - if (node.classList.length === 0) { - node.removeAttribute('class'); - } - }; - ClassAttributor.prototype.value = function (node) { - var result = match(node, this.keyName)[0] || ''; - var value = result.slice(this.keyName.length + 1); // +1 for hyphen - return this.canAdd(node, value) ? value : ''; - }; - return ClassAttributor; -}(attributor_1.default)); -exports.default = ClassAttributor; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var attributor_1 = __webpack_require__(12); -function camelize(name) { - var parts = name.split('-'); - var rest = parts - .slice(1) - .map(function (part) { - return part[0].toUpperCase() + part.slice(1); - }) - .join(''); - return parts[0] + rest; -} -var StyleAttributor = /** @class */ (function (_super) { - __extends(StyleAttributor, _super); - function StyleAttributor() { - return _super !== null && _super.apply(this, arguments) || this; - } - StyleAttributor.keys = function (node) { - return (node.getAttribute('style') || '').split(';').map(function (value) { - var arr = value.split(':'); - return arr[0].trim(); - }); - }; - StyleAttributor.prototype.add = function (node, value) { - if (!this.canAdd(node, value)) - return false; - // @ts-ignore - node.style[camelize(this.keyName)] = value; - return true; - }; - StyleAttributor.prototype.remove = function (node) { - // @ts-ignore - node.style[camelize(this.keyName)] = ''; - if (!node.getAttribute('style')) { - node.removeAttribute('style'); - } - }; - StyleAttributor.prototype.value = function (node) { - // @ts-ignore - var value = node.style[camelize(this.keyName)]; - return this.canAdd(node, value) ? value : ''; - }; - return StyleAttributor; -}(attributor_1.default)); -exports.default = StyleAttributor; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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"); } } - -var Theme = function () { - function Theme(quill, options) { - _classCallCheck(this, Theme); - - this.quill = quill; - this.options = options; - this.modules = {}; - } - - _createClass(Theme, [{ - key: 'init', - value: function init() { - var _this = this; - - Object.keys(this.options.modules).forEach(function (name) { - if (_this.modules[name] == null) { - _this.addModule(name); - } - }); - } - }, { - key: 'addModule', - value: function addModule(name) { - var moduleClass = this.quill.constructor.import('modules/' + name); - this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); - return this.modules[name]; - } - }]); - - return Theme; -}(); - -Theme.DEFAULTS = { - modules: {} -}; -Theme.themes = { - 'default': Theme -}; - -exports.default = Theme; - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _text = __webpack_require__(7); - -var _text2 = _interopRequireDefault(_text); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var GUARD_TEXT = '\uFEFF'; - -var Embed = function (_Parchment$Embed) { - _inherits(Embed, _Parchment$Embed); - - function Embed(node) { - _classCallCheck(this, Embed); - - var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node)); - - _this.contentNode = document.createElement('span'); - _this.contentNode.setAttribute('contenteditable', false); - [].slice.call(_this.domNode.childNodes).forEach(function (childNode) { - _this.contentNode.appendChild(childNode); - }); - _this.leftGuard = document.createTextNode(GUARD_TEXT); - _this.rightGuard = document.createTextNode(GUARD_TEXT); - _this.domNode.appendChild(_this.leftGuard); - _this.domNode.appendChild(_this.contentNode); - _this.domNode.appendChild(_this.rightGuard); - return _this; - } - - _createClass(Embed, [{ - key: 'index', - value: function index(node, offset) { - if (node === this.leftGuard) return 0; - if (node === this.rightGuard) return 1; - return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset); - } - }, { - key: 'restore', - value: function restore(node) { - var range = void 0, - textNode = void 0; - var text = node.data.split(GUARD_TEXT).join(''); - if (node === this.leftGuard) { - if (this.prev instanceof _text2.default) { - var prevLength = this.prev.length(); - this.prev.insertAt(prevLength, text); - range = { - startNode: this.prev.domNode, - startOffset: prevLength + text.length - }; - } else { - textNode = document.createTextNode(text); - this.parent.insertBefore(_parchment2.default.create(textNode), this); - range = { - startNode: textNode, - startOffset: text.length - }; - } - } else if (node === this.rightGuard) { - if (this.next instanceof _text2.default) { - this.next.insertAt(0, text); - range = { - startNode: this.next.domNode, - startOffset: text.length - }; - } else { - textNode = document.createTextNode(text); - this.parent.insertBefore(_parchment2.default.create(textNode), this.next); - range = { - startNode: textNode, - startOffset: text.length - }; - } - } - node.data = GUARD_TEXT; - return range; - } - }, { - key: 'update', - value: function update(mutations, context) { - var _this2 = this; - - mutations.forEach(function (mutation) { - if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) { - var range = _this2.restore(mutation.target); - if (range) context.range = range; - } - }); - } - }]); - - return Embed; -}(_parchment2.default.Embed); - -exports.default = Embed; - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var config = { - scope: _parchment2.default.Scope.BLOCK, - whitelist: ['right', 'center', 'justify'] -}; - -var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); -var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); -var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); - -exports.AlignAttribute = AlignAttribute; -exports.AlignClass = AlignClass; -exports.AlignStyle = AlignStyle; - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.BackgroundStyle = exports.BackgroundClass = undefined; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _color = __webpack_require__(26); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { - scope: _parchment2.default.Scope.INLINE -}); -var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { - scope: _parchment2.default.Scope.INLINE -}); - -exports.BackgroundClass = BackgroundClass; -exports.BackgroundStyle = BackgroundStyle; - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var config = { - scope: _parchment2.default.Scope.BLOCK, - whitelist: ['rtl'] -}; - -var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); -var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); -var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); - -exports.DirectionAttribute = DirectionAttribute; -exports.DirectionClass = DirectionClass; -exports.DirectionStyle = DirectionStyle; - -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.FontClass = exports.FontStyle = undefined; - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var config = { - scope: _parchment2.default.Scope.INLINE, - whitelist: ['serif', 'monospace'] -}; - -var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); - -var FontStyleAttributor = function (_Parchment$Attributor) { - _inherits(FontStyleAttributor, _Parchment$Attributor); - - function FontStyleAttributor() { - _classCallCheck(this, FontStyleAttributor); - - return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); - } - - _createClass(FontStyleAttributor, [{ - key: 'value', - value: function value(node) { - return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); - } - }]); - - return FontStyleAttributor; -}(_parchment2.default.Attributor.Style); - -var FontStyle = new FontStyleAttributor('font', 'font-family', config); - -exports.FontStyle = FontStyle; -exports.FontClass = FontClass; - -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SizeStyle = exports.SizeClass = undefined; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { - scope: _parchment2.default.Scope.INLINE, - whitelist: ['small', 'large', 'huge'] -}); -var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { - scope: _parchment2.default.Scope.INLINE, - whitelist: ['10px', '18px', '32px'] -}); - -exports.SizeClass = SizeClass; -exports.SizeStyle = SizeStyle; - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = { - 'align': { - '': __webpack_require__(76), - 'center': __webpack_require__(77), - 'right': __webpack_require__(78), - 'justify': __webpack_require__(79) - }, - 'background': __webpack_require__(80), - 'blockquote': __webpack_require__(81), - 'bold': __webpack_require__(82), - 'clean': __webpack_require__(83), - 'code': __webpack_require__(58), - 'code-block': __webpack_require__(58), - 'color': __webpack_require__(84), - 'direction': { - '': __webpack_require__(85), - 'rtl': __webpack_require__(86) - }, - 'float': { - 'center': __webpack_require__(87), - 'full': __webpack_require__(88), - 'left': __webpack_require__(89), - 'right': __webpack_require__(90) - }, - 'formula': __webpack_require__(91), - 'header': { - '1': __webpack_require__(92), - '2': __webpack_require__(93) - }, - 'italic': __webpack_require__(94), - 'image': __webpack_require__(95), - 'indent': { - '+1': __webpack_require__(96), - '-1': __webpack_require__(97) - }, - 'link': __webpack_require__(98), - 'list': { - 'ordered': __webpack_require__(99), - 'bullet': __webpack_require__(100), - 'check': __webpack_require__(101) - }, - 'script': { - 'sub': __webpack_require__(102), - 'super': __webpack_require__(103) - }, - 'strike': __webpack_require__(104), - 'underline': __webpack_require__(105), - 'video': __webpack_require__(106) -}; - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getLastChangeIndex = exports.default = undefined; - -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; }; }(); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _quill = __webpack_require__(5); - -var _quill2 = _interopRequireDefault(_quill); - -var _module = __webpack_require__(9); - -var _module2 = _interopRequireDefault(_module); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var History = function (_Module) { - _inherits(History, _Module); - - function History(quill, options) { - _classCallCheck(this, History); - - var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); - - _this.lastRecorded = 0; - _this.ignoreChange = false; - _this.clear(); - _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { - if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; - if (!_this.options.userOnly || source === _quill2.default.sources.USER) { - _this.record(delta, oldDelta); - } else { - _this.transform(delta); - } - }); - _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); - _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); - if (/Win/i.test(navigator.platform)) { - _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); - } - return _this; - } - - _createClass(History, [{ - key: 'change', - value: function change(source, dest) { - if (this.stack[source].length === 0) return; - var delta = this.stack[source].pop(); - this.stack[dest].push(delta); - this.lastRecorded = 0; - this.ignoreChange = true; - this.quill.updateContents(delta[source], _quill2.default.sources.USER); - this.ignoreChange = false; - var index = getLastChangeIndex(delta[source]); - this.quill.setSelection(index); - } - }, { - key: 'clear', - value: function clear() { - this.stack = { undo: [], redo: [] }; - } - }, { - key: 'cutoff', - value: function cutoff() { - this.lastRecorded = 0; - } - }, { - key: 'record', - value: function record(changeDelta, oldDelta) { - if (changeDelta.ops.length === 0) return; - this.stack.redo = []; - var undoDelta = this.quill.getContents().diff(oldDelta); - var timestamp = Date.now(); - if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { - var delta = this.stack.undo.pop(); - undoDelta = undoDelta.compose(delta.undo); - changeDelta = delta.redo.compose(changeDelta); - } else { - this.lastRecorded = timestamp; - } - this.stack.undo.push({ - redo: changeDelta, - undo: undoDelta - }); - if (this.stack.undo.length > this.options.maxStack) { - this.stack.undo.shift(); - } - } - }, { - key: 'redo', - value: function redo() { - this.change('redo', 'undo'); - } - }, { - key: 'transform', - value: function transform(delta) { - this.stack.undo.forEach(function (change) { - change.undo = delta.transform(change.undo, true); - change.redo = delta.transform(change.redo, true); - }); - this.stack.redo.forEach(function (change) { - change.undo = delta.transform(change.undo, true); - change.redo = delta.transform(change.redo, true); - }); - } - }, { - key: 'undo', - value: function undo() { - this.change('undo', 'redo'); - } - }]); - - return History; -}(_module2.default); - -History.DEFAULTS = { - delay: 1000, - maxStack: 100, - userOnly: false -}; - -function endsWithNewlineChange(delta) { - var lastOp = delta.ops[delta.ops.length - 1]; - if (lastOp == null) return false; - if (lastOp.insert != null) { - return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); - } - if (lastOp.attributes != null) { - return Object.keys(lastOp.attributes).some(function (attr) { - return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; - }); - } - return false; -} - -function getLastChangeIndex(delta) { - var deleteLength = delta.reduce(function (length, op) { - length += op.delete || 0; - return length; - }, 0); - var changeIndex = delta.length() - deleteLength; - if (endsWithNewlineChange(delta)) { - changeIndex -= 1; - } - return changeIndex; -} - -exports.default = History; -exports.getLastChangeIndex = getLastChangeIndex; - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.BaseTooltip = undefined; - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _extend = __webpack_require__(3); - -var _extend2 = _interopRequireDefault(_extend); - -var _quillDelta = __webpack_require__(2); - -var _quillDelta2 = _interopRequireDefault(_quillDelta); - -var _emitter = __webpack_require__(8); - -var _emitter2 = _interopRequireDefault(_emitter); - -var _keyboard = __webpack_require__(23); - -var _keyboard2 = _interopRequireDefault(_keyboard); - -var _theme = __webpack_require__(34); - -var _theme2 = _interopRequireDefault(_theme); - -var _colorPicker = __webpack_require__(59); - -var _colorPicker2 = _interopRequireDefault(_colorPicker); - -var _iconPicker = __webpack_require__(60); - -var _iconPicker2 = _interopRequireDefault(_iconPicker); - -var _picker = __webpack_require__(28); - -var _picker2 = _interopRequireDefault(_picker); - -var _tooltip = __webpack_require__(61); - -var _tooltip2 = _interopRequireDefault(_tooltip); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var ALIGNS = [false, 'center', 'right', 'justify']; - -var COLORS = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"]; - -var FONTS = [false, 'serif', 'monospace']; - -var HEADERS = ['1', '2', '3', false]; - -var SIZES = ['small', false, 'large', 'huge']; - -var BaseTheme = function (_Theme) { - _inherits(BaseTheme, _Theme); - - function BaseTheme(quill, options) { - _classCallCheck(this, BaseTheme); - - var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options)); - - var listener = function listener(e) { - if (!document.body.contains(quill.root)) { - return document.body.removeEventListener('click', listener); - } - if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) { - _this.tooltip.hide(); - } - if (_this.pickers != null) { - _this.pickers.forEach(function (picker) { - if (!picker.container.contains(e.target)) { - picker.close(); - } - }); - } - }; - quill.emitter.listenDOM('click', document.body, listener); - return _this; - } - - _createClass(BaseTheme, [{ - key: 'addModule', - value: function addModule(name) { - var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name); - if (name === 'toolbar') { - this.extendToolbar(module); - } - return module; - } - }, { - key: 'buildButtons', - value: function buildButtons(buttons, icons) { - buttons.forEach(function (button) { - var className = button.getAttribute('class') || ''; - className.split(/\s+/).forEach(function (name) { - if (!name.startsWith('ql-')) return; - name = name.slice('ql-'.length); - if (icons[name] == null) return; - if (name === 'direction') { - button.innerHTML = icons[name][''] + icons[name]['rtl']; - } else if (typeof icons[name] === 'string') { - button.innerHTML = icons[name]; - } else { - var value = button.value || ''; - if (value != null && icons[name][value]) { - button.innerHTML = icons[name][value]; - } - } - }); - }); - } - }, { - key: 'buildPickers', - value: function buildPickers(selects, icons) { - var _this2 = this; - - this.pickers = selects.map(function (select) { - if (select.classList.contains('ql-align')) { - if (select.querySelector('option') == null) { - fillSelect(select, ALIGNS); - } - return new _iconPicker2.default(select, icons.align); - } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) { - var format = select.classList.contains('ql-background') ? 'background' : 'color'; - if (select.querySelector('option') == null) { - fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000'); - } - return new _colorPicker2.default(select, icons[format]); - } else { - if (select.querySelector('option') == null) { - if (select.classList.contains('ql-font')) { - fillSelect(select, FONTS); - } else if (select.classList.contains('ql-header')) { - fillSelect(select, HEADERS); - } else if (select.classList.contains('ql-size')) { - fillSelect(select, SIZES); - } - } - return new _picker2.default(select); - } - }); - var update = function update() { - _this2.pickers.forEach(function (picker) { - picker.update(); - }); - }; - this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update); - } - }]); - - return BaseTheme; -}(_theme2.default); - -BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, { - modules: { - toolbar: { - handlers: { - formula: function formula() { - this.quill.theme.tooltip.edit('formula'); - }, - image: function image() { - var _this3 = this; - - var fileInput = this.container.querySelector('input.ql-image[type=file]'); - if (fileInput == null) { - fileInput = document.createElement('input'); - fileInput.setAttribute('type', 'file'); - fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'); - fileInput.classList.add('ql-image'); - fileInput.addEventListener('change', function () { - if (fileInput.files != null && fileInput.files[0] != null) { - var reader = new FileReader(); - reader.onload = function (e) { - var range = _this3.quill.getSelection(true); - _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER); - _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT); - fileInput.value = ""; - }; - reader.readAsDataURL(fileInput.files[0]); - } - }); - this.container.appendChild(fileInput); - } - fileInput.click(); - }, - video: function video() { - this.quill.theme.tooltip.edit('video'); - } - } - } - } -}); - -var BaseTooltip = function (_Tooltip) { - _inherits(BaseTooltip, _Tooltip); - - function BaseTooltip(quill, boundsContainer) { - _classCallCheck(this, BaseTooltip); - - var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer)); - - _this4.textbox = _this4.root.querySelector('input[type="text"]'); - _this4.listen(); - return _this4; - } - - _createClass(BaseTooltip, [{ - key: 'listen', - value: function listen() { - var _this5 = this; - - this.textbox.addEventListener('keydown', function (event) { - if (_keyboard2.default.match(event, 'enter')) { - _this5.save(); - event.preventDefault(); - } else if (_keyboard2.default.match(event, 'escape')) { - _this5.cancel(); - event.preventDefault(); - } - }); - } - }, { - key: 'cancel', - value: function cancel() { - this.hide(); - } - }, { - key: 'edit', - value: function edit() { - var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link'; - var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - this.root.classList.remove('ql-hidden'); - this.root.classList.add('ql-editing'); - if (preview != null) { - this.textbox.value = preview; - } else if (mode !== this.root.getAttribute('data-mode')) { - this.textbox.value = ''; - } - this.position(this.quill.getBounds(this.quill.selection.savedRange)); - this.textbox.select(); - this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || ''); - this.root.setAttribute('data-mode', mode); - } - }, { - key: 'restoreFocus', - value: function restoreFocus() { - var scrollTop = this.quill.scrollingContainer.scrollTop; - this.quill.focus(); - this.quill.scrollingContainer.scrollTop = scrollTop; - } - }, { - key: 'save', - value: function save() { - var value = this.textbox.value; - switch (this.root.getAttribute('data-mode')) { - case 'link': - { - var scrollTop = this.quill.root.scrollTop; - if (this.linkRange) { - this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER); - delete this.linkRange; - } else { - this.restoreFocus(); - this.quill.format('link', value, _emitter2.default.sources.USER); - } - this.quill.root.scrollTop = scrollTop; - break; - } - case 'video': - { - value = extractVideoUrl(value); - } // eslint-disable-next-line no-fallthrough - case 'formula': - { - if (!value) break; - var range = this.quill.getSelection(true); - if (range != null) { - var index = range.index + range.length; - this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER); - if (this.root.getAttribute('data-mode') === 'formula') { - this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER); - } - this.quill.setSelection(index + 2, _emitter2.default.sources.USER); - } - break; - } - default: - } - this.textbox.value = ''; - this.hide(); - } - }]); - - return BaseTooltip; -}(_tooltip2.default); - -function extractVideoUrl(url) { - var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/); - if (match) { - return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0'; - } - if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) { - // eslint-disable-line no-cond-assign - return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/'; - } - return url; -} - -function fillSelect(select, values) { - var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - values.forEach(function (value) { - var option = document.createElement('option'); - if (value === defaultValue) { - option.setAttribute('selected', 'selected'); - } else { - option.setAttribute('value', value); - } - select.appendChild(option); - }); -} - -exports.BaseTooltip = BaseTooltip; -exports.default = BaseTheme; - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var LinkedList = /** @class */ (function () { - function LinkedList() { - this.head = this.tail = null; - this.length = 0; - } - LinkedList.prototype.append = function () { - var nodes = []; - for (var _i = 0; _i < arguments.length; _i++) { - nodes[_i] = arguments[_i]; - } - this.insertBefore(nodes[0], null); - if (nodes.length > 1) { - this.append.apply(this, nodes.slice(1)); - } - }; - LinkedList.prototype.contains = function (node) { - var cur, next = this.iterator(); - while ((cur = next())) { - if (cur === node) - return true; - } - return false; - }; - LinkedList.prototype.insertBefore = function (node, refNode) { - if (!node) - return; - node.next = refNode; - if (refNode != null) { - node.prev = refNode.prev; - if (refNode.prev != null) { - refNode.prev.next = node; - } - refNode.prev = node; - if (refNode === this.head) { - this.head = node; - } - } - else if (this.tail != null) { - this.tail.next = node; - node.prev = this.tail; - this.tail = node; - } - else { - node.prev = null; - this.head = this.tail = node; - } - this.length += 1; - }; - LinkedList.prototype.offset = function (target) { - var index = 0, cur = this.head; - while (cur != null) { - if (cur === target) - return index; - index += cur.length(); - cur = cur.next; - } - return -1; - }; - LinkedList.prototype.remove = function (node) { - if (!this.contains(node)) - return; - if (node.prev != null) - node.prev.next = node.next; - if (node.next != null) - node.next.prev = node.prev; - if (node === this.head) - this.head = node.next; - if (node === this.tail) - this.tail = node.prev; - this.length -= 1; - }; - LinkedList.prototype.iterator = function (curNode) { - if (curNode === void 0) { curNode = this.head; } - // TODO use yield when we can - return function () { - var ret = curNode; - if (curNode != null) - curNode = curNode.next; - return ret; - }; - }; - LinkedList.prototype.find = function (index, inclusive) { - if (inclusive === void 0) { inclusive = false; } - var cur, next = this.iterator(); - while ((cur = next())) { - var length = cur.length(); - if (index < length || - (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) { - return [cur, index]; - } - index -= length; - } - return [null, 0]; - }; - LinkedList.prototype.forEach = function (callback) { - var cur, next = this.iterator(); - while ((cur = next())) { - callback(cur); - } - }; - LinkedList.prototype.forEachAt = function (index, length, callback) { - if (length <= 0) - return; - var _a = this.find(index), startNode = _a[0], offset = _a[1]; - var cur, curIndex = index - offset, next = this.iterator(startNode); - while ((cur = next()) && curIndex < index + length) { - var curLength = cur.length(); - if (index > curIndex) { - callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); - } - else { - callback(cur, 0, Math.min(curLength, index + length - curIndex)); - } - curIndex += curLength; - } - }; - LinkedList.prototype.map = function (callback) { - return this.reduce(function (memo, cur) { - memo.push(callback(cur)); - return memo; - }, []); - }; - LinkedList.prototype.reduce = function (callback, memo) { - var cur, next = this.iterator(); - while ((cur = next())) { - memo = callback(memo, cur); - } - return memo; - }; - return LinkedList; -}()); -exports.default = LinkedList; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var container_1 = __webpack_require__(17); -var Registry = __webpack_require__(1); -var OBSERVER_CONFIG = { - attributes: true, - characterData: true, - characterDataOldValue: true, - childList: true, - subtree: true, -}; -var MAX_OPTIMIZE_ITERATIONS = 100; -var ScrollBlot = /** @class */ (function (_super) { - __extends(ScrollBlot, _super); - function ScrollBlot(node) { - var _this = _super.call(this, node) || this; - _this.scroll = _this; - _this.observer = new MutationObserver(function (mutations) { - _this.update(mutations); - }); - _this.observer.observe(_this.domNode, OBSERVER_CONFIG); - _this.attach(); - return _this; - } - ScrollBlot.prototype.detach = function () { - _super.prototype.detach.call(this); - this.observer.disconnect(); - }; - ScrollBlot.prototype.deleteAt = function (index, length) { - this.update(); - if (index === 0 && length === this.length()) { - this.children.forEach(function (child) { - child.remove(); - }); - } - else { - _super.prototype.deleteAt.call(this, index, length); - } - }; - ScrollBlot.prototype.formatAt = function (index, length, name, value) { - this.update(); - _super.prototype.formatAt.call(this, index, length, name, value); - }; - ScrollBlot.prototype.insertAt = function (index, value, def) { - this.update(); - _super.prototype.insertAt.call(this, index, value, def); - }; - ScrollBlot.prototype.optimize = function (mutations, context) { - var _this = this; - if (mutations === void 0) { mutations = []; } - if (context === void 0) { context = {}; } - _super.prototype.optimize.call(this, context); - // We must modify mutations directly, cannot make copy and then modify - var records = [].slice.call(this.observer.takeRecords()); - // Array.push currently seems to be implemented by a non-tail recursive function - // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords()); - while (records.length > 0) - mutations.push(records.pop()); - // TODO use WeakMap - var mark = function (blot, markParent) { - if (markParent === void 0) { markParent = true; } - if (blot == null || blot === _this) - return; - if (blot.domNode.parentNode == null) - return; - // @ts-ignore - if (blot.domNode[Registry.DATA_KEY].mutations == null) { - // @ts-ignore - blot.domNode[Registry.DATA_KEY].mutations = []; - } - if (markParent) - mark(blot.parent); - }; - var optimize = function (blot) { - // Post-order traversal - if ( - // @ts-ignore - blot.domNode[Registry.DATA_KEY] == null || - // @ts-ignore - blot.domNode[Registry.DATA_KEY].mutations == null) { - return; - } - if (blot instanceof container_1.default) { - blot.children.forEach(optimize); - } - blot.optimize(context); - }; - var remaining = mutations; - for (var i = 0; remaining.length > 0; i += 1) { - if (i >= MAX_OPTIMIZE_ITERATIONS) { - throw new Error('[Parchment] Maximum optimize iterations reached'); - } - remaining.forEach(function (mutation) { - var blot = Registry.find(mutation.target, true); - if (blot == null) - return; - if (blot.domNode === mutation.target) { - if (mutation.type === 'childList') { - mark(Registry.find(mutation.previousSibling, false)); - [].forEach.call(mutation.addedNodes, function (node) { - var child = Registry.find(node, false); - mark(child, false); - if (child instanceof container_1.default) { - child.children.forEach(function (grandChild) { - mark(grandChild, false); - }); - } - }); - } - else if (mutation.type === 'attributes') { - mark(blot.prev); - } - } - mark(blot); - }); - this.children.forEach(optimize); - remaining = [].slice.call(this.observer.takeRecords()); - records = remaining.slice(); - while (records.length > 0) - mutations.push(records.pop()); - } - }; - ScrollBlot.prototype.update = function (mutations, context) { - var _this = this; - if (context === void 0) { context = {}; } - mutations = mutations || this.observer.takeRecords(); - // TODO use WeakMap - mutations - .map(function (mutation) { - var blot = Registry.find(mutation.target, true); - if (blot == null) - return null; - // @ts-ignore - if (blot.domNode[Registry.DATA_KEY].mutations == null) { - // @ts-ignore - blot.domNode[Registry.DATA_KEY].mutations = [mutation]; - return blot; - } - else { - // @ts-ignore - blot.domNode[Registry.DATA_KEY].mutations.push(mutation); - return null; - } - }) - .forEach(function (blot) { - if (blot == null || - blot === _this || - //@ts-ignore - blot.domNode[Registry.DATA_KEY] == null) - return; - // @ts-ignore - blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context); - }); - // @ts-ignore - if (this.domNode[Registry.DATA_KEY].mutations != null) { - // @ts-ignore - _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context); - } - this.optimize(mutations, context); - }; - ScrollBlot.blotName = 'scroll'; - ScrollBlot.defaultChild = 'block'; - ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; - ScrollBlot.tagName = 'DIV'; - return ScrollBlot; -}(container_1.default)); -exports.default = ScrollBlot; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var format_1 = __webpack_require__(18); -var Registry = __webpack_require__(1); -// Shallow object comparison -function isEqual(obj1, obj2) { - if (Object.keys(obj1).length !== Object.keys(obj2).length) - return false; - // @ts-ignore - for (var prop in obj1) { - // @ts-ignore - if (obj1[prop] !== obj2[prop]) - return false; - } - return true; -} -var InlineBlot = /** @class */ (function (_super) { - __extends(InlineBlot, _super); - function InlineBlot() { - return _super !== null && _super.apply(this, arguments) || this; - } - InlineBlot.formats = function (domNode) { - if (domNode.tagName === InlineBlot.tagName) - return undefined; - return _super.formats.call(this, domNode); - }; - InlineBlot.prototype.format = function (name, value) { - var _this = this; - if (name === this.statics.blotName && !value) { - this.children.forEach(function (child) { - if (!(child instanceof format_1.default)) { - child = child.wrap(InlineBlot.blotName, true); - } - _this.attributes.copy(child); - }); - this.unwrap(); - } - else { - _super.prototype.format.call(this, name, value); - } - }; - InlineBlot.prototype.formatAt = function (index, length, name, value) { - if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { - var blot = this.isolate(index, length); - blot.format(name, value); - } - else { - _super.prototype.formatAt.call(this, index, length, name, value); - } - }; - InlineBlot.prototype.optimize = function (context) { - _super.prototype.optimize.call(this, context); - var formats = this.formats(); - if (Object.keys(formats).length === 0) { - return this.unwrap(); // unformatted span - } - var next = this.next; - if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { - next.moveChildren(this); - next.remove(); - } - }; - InlineBlot.blotName = 'inline'; - InlineBlot.scope = Registry.Scope.INLINE_BLOT; - InlineBlot.tagName = 'SPAN'; - return InlineBlot; -}(format_1.default)); -exports.default = InlineBlot; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var format_1 = __webpack_require__(18); -var Registry = __webpack_require__(1); -var BlockBlot = /** @class */ (function (_super) { - __extends(BlockBlot, _super); - function BlockBlot() { - return _super !== null && _super.apply(this, arguments) || this; - } - BlockBlot.formats = function (domNode) { - var tagName = Registry.query(BlockBlot.blotName).tagName; - if (domNode.tagName === tagName) - return undefined; - return _super.formats.call(this, domNode); - }; - BlockBlot.prototype.format = function (name, value) { - if (Registry.query(name, Registry.Scope.BLOCK) == null) { - return; - } - else if (name === this.statics.blotName && !value) { - this.replaceWith(BlockBlot.blotName); - } - else { - _super.prototype.format.call(this, name, value); - } - }; - BlockBlot.prototype.formatAt = function (index, length, name, value) { - if (Registry.query(name, Registry.Scope.BLOCK) != null) { - this.format(name, value); - } - else { - _super.prototype.formatAt.call(this, index, length, name, value); - } - }; - BlockBlot.prototype.insertAt = function (index, value, def) { - if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { - // Insert text or inline - _super.prototype.insertAt.call(this, index, value, def); - } - else { - var after = this.split(index); - var blot = Registry.create(value, def); - after.parent.insertBefore(blot, after); - } - }; - BlockBlot.prototype.update = function (mutations, context) { - if (navigator.userAgent.match(/Trident/)) { - this.build(); - } - else { - _super.prototype.update.call(this, mutations, context); - } - }; - BlockBlot.blotName = 'block'; - BlockBlot.scope = Registry.Scope.BLOCK_BLOT; - BlockBlot.tagName = 'P'; - return BlockBlot; -}(format_1.default)); -exports.default = BlockBlot; - - -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var leaf_1 = __webpack_require__(19); -var EmbedBlot = /** @class */ (function (_super) { - __extends(EmbedBlot, _super); - function EmbedBlot() { - return _super !== null && _super.apply(this, arguments) || this; - } - EmbedBlot.formats = function (domNode) { - return undefined; - }; - EmbedBlot.prototype.format = function (name, value) { - // super.formatAt wraps, which is what we want in general, - // but this allows subclasses to overwrite for formats - // that just apply to particular embeds - _super.prototype.formatAt.call(this, 0, this.length(), name, value); - }; - EmbedBlot.prototype.formatAt = function (index, length, name, value) { - if (index === 0 && length === this.length()) { - this.format(name, value); - } - else { - _super.prototype.formatAt.call(this, index, length, name, value); - } - }; - EmbedBlot.prototype.formats = function () { - return this.statics.formats(this.domNode); - }; - return EmbedBlot; -}(leaf_1.default)); -exports.default = EmbedBlot; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var leaf_1 = __webpack_require__(19); -var Registry = __webpack_require__(1); -var TextBlot = /** @class */ (function (_super) { - __extends(TextBlot, _super); - function TextBlot(node) { - var _this = _super.call(this, node) || this; - _this.text = _this.statics.value(_this.domNode); - return _this; - } - TextBlot.create = function (value) { - return document.createTextNode(value); - }; - TextBlot.value = function (domNode) { - var text = domNode.data; - // @ts-ignore - if (text['normalize']) - text = text['normalize'](); - return text; - }; - TextBlot.prototype.deleteAt = function (index, length) { - this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); - }; - TextBlot.prototype.index = function (node, offset) { - if (this.domNode === node) { - return offset; - } - return -1; - }; - TextBlot.prototype.insertAt = function (index, value, def) { - if (def == null) { - this.text = this.text.slice(0, index) + value + this.text.slice(index); - this.domNode.data = this.text; - } - else { - _super.prototype.insertAt.call(this, index, value, def); - } - }; - TextBlot.prototype.length = function () { - return this.text.length; - }; - TextBlot.prototype.optimize = function (context) { - _super.prototype.optimize.call(this, context); - this.text = this.statics.value(this.domNode); - if (this.text.length === 0) { - this.remove(); - } - else if (this.next instanceof TextBlot && this.next.prev === this) { - this.insertAt(this.length(), this.next.value()); - this.next.remove(); - } - }; - TextBlot.prototype.position = function (index, inclusive) { - if (inclusive === void 0) { inclusive = false; } - return [this.domNode, index]; - }; - TextBlot.prototype.split = function (index, force) { - if (force === void 0) { force = false; } - if (!force) { - if (index === 0) - return this; - if (index === this.length()) - return this.next; - } - var after = Registry.create(this.domNode.splitText(index)); - this.parent.insertBefore(after, this.next); - this.text = this.statics.value(this.domNode); - return after; - }; - TextBlot.prototype.update = function (mutations, context) { - var _this = this; - if (mutations.some(function (mutation) { - return mutation.type === 'characterData' && mutation.target === _this.domNode; - })) { - this.text = this.statics.value(this.domNode); - } - }; - TextBlot.prototype.value = function () { - return this.text; - }; - TextBlot.blotName = 'text'; - TextBlot.scope = Registry.Scope.INLINE_BLOT; - return TextBlot; -}(leaf_1.default)); -exports.default = TextBlot; - - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var elem = document.createElement('div'); -elem.classList.toggle('test-class', false); -if (elem.classList.contains('test-class')) { - var _toggle = DOMTokenList.prototype.toggle; - DOMTokenList.prototype.toggle = function (token, force) { - if (arguments.length > 1 && !this.contains(token) === !force) { - return force; - } else { - return _toggle.call(this, token); - } - }; -} - -if (!String.prototype.startsWith) { - String.prototype.startsWith = function (searchString, position) { - position = position || 0; - return this.substr(position, searchString.length) === searchString; - }; -} - -if (!String.prototype.endsWith) { - String.prototype.endsWith = function (searchString, position) { - var subjectString = this.toString(); - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - var lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; -} - -if (!Array.prototype.find) { - Object.defineProperty(Array.prototype, "find", { - value: function value(predicate) { - if (this === null) { - throw new TypeError('Array.prototype.find called on null or undefined'); - } - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - var list = Object(this); - var length = list.length >>> 0; - var thisArg = arguments[1]; - var value; - - for (var i = 0; i < length; i++) { - value = list[i]; - if (predicate.call(thisArg, value, i, list)) { - return value; - } - } - return undefined; - } - }); -} - -document.addEventListener("DOMContentLoaded", function () { - // Disable resizing in Firefox - document.execCommand("enableObjectResizing", false, false); - // Disable automatic linkifying in IE11 - document.execCommand("autoUrlDetect", false, false); -}); - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -/** - * This library modifies the diff-patch-match library by Neil Fraser - * by removing the patch and match functionality and certain advanced - * options in the diff function. The original license is as follows: - * - * === - * - * Diff Match and Patch - * - * Copyright 2006 Google Inc. - * http://code.google.com/p/google-diff-match-patch/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -/** - * The data structure representing a diff is an array of tuples: - * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] - * which means: delete 'Hello', add 'Goodbye' and keep ' world.' - */ -var DIFF_DELETE = -1; -var DIFF_INSERT = 1; -var DIFF_EQUAL = 0; - - -/** - * Find the differences between two texts. Simplifies the problem by stripping - * any common prefix or suffix off the texts before diffing. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {Int} cursor_pos Expected edit position in text1 (optional) - * @return {Array} Array of diff tuples. - */ -function diff_main(text1, text2, cursor_pos) { - // Check for equality (speedup). - if (text1 == text2) { - if (text1) { - return [[DIFF_EQUAL, text1]]; - } - return []; - } - - // Check cursor_pos within bounds - if (cursor_pos < 0 || text1.length < cursor_pos) { - cursor_pos = null; - } - - // Trim off common prefix (speedup). - var commonlength = diff_commonPrefix(text1, text2); - var commonprefix = text1.substring(0, commonlength); - text1 = text1.substring(commonlength); - text2 = text2.substring(commonlength); - - // Trim off common suffix (speedup). - commonlength = diff_commonSuffix(text1, text2); - var commonsuffix = text1.substring(text1.length - commonlength); - text1 = text1.substring(0, text1.length - commonlength); - text2 = text2.substring(0, text2.length - commonlength); - - // Compute the diff on the middle block. - var diffs = diff_compute_(text1, text2); - - // Restore the prefix and suffix. - if (commonprefix) { - diffs.unshift([DIFF_EQUAL, commonprefix]); - } - if (commonsuffix) { - diffs.push([DIFF_EQUAL, commonsuffix]); - } - diff_cleanupMerge(diffs); - if (cursor_pos != null) { - diffs = fix_cursor(diffs, cursor_pos); - } - diffs = fix_emoji(diffs); - return diffs; -}; - - -/** - * Find the differences between two texts. Assumes that the texts do not - * have any common prefix or suffix. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @return {Array} Array of diff tuples. - */ -function diff_compute_(text1, text2) { - var diffs; - - if (!text1) { - // Just add some text (speedup). - return [[DIFF_INSERT, text2]]; - } - - if (!text2) { - // Just delete some text (speedup). - return [[DIFF_DELETE, text1]]; - } - - var longtext = text1.length > text2.length ? text1 : text2; - var shorttext = text1.length > text2.length ? text2 : text1; - var i = longtext.indexOf(shorttext); - if (i != -1) { - // Shorter text is inside the longer text (speedup). - diffs = [[DIFF_INSERT, longtext.substring(0, i)], - [DIFF_EQUAL, shorttext], - [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; - // Swap insertions for deletions if diff is reversed. - if (text1.length > text2.length) { - diffs[0][0] = diffs[2][0] = DIFF_DELETE; - } - return diffs; - } - - if (shorttext.length == 1) { - // Single character string. - // After the previous speedup, the character can't be an equality. - return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; - } - - // Check to see if the problem can be split in two. - var hm = diff_halfMatch_(text1, text2); - if (hm) { - // A half-match was found, sort out the return data. - var text1_a = hm[0]; - var text1_b = hm[1]; - var text2_a = hm[2]; - var text2_b = hm[3]; - var mid_common = hm[4]; - // Send both pairs off for separate processing. - var diffs_a = diff_main(text1_a, text2_a); - var diffs_b = diff_main(text1_b, text2_b); - // Merge the results. - return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); - } - - return diff_bisect_(text1, text2); -}; - - -/** - * Find the 'middle snake' of a diff, split the problem in two - * and return the recursively constructed diff. - * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @return {Array} Array of diff tuples. - * @private - */ -function diff_bisect_(text1, text2) { - // Cache the text lengths to prevent multiple calls. - var text1_length = text1.length; - var text2_length = text2.length; - var max_d = Math.ceil((text1_length + text2_length) / 2); - var v_offset = max_d; - var v_length = 2 * max_d; - var v1 = new Array(v_length); - var v2 = new Array(v_length); - // Setting all elements to -1 is faster in Chrome & Firefox than mixing - // integers and undefined. - for (var x = 0; x < v_length; x++) { - v1[x] = -1; - v2[x] = -1; - } - v1[v_offset + 1] = 0; - v2[v_offset + 1] = 0; - var delta = text1_length - text2_length; - // If the total number of characters is odd, then the front path will collide - // with the reverse path. - var front = (delta % 2 != 0); - // Offsets for start and end of k loop. - // Prevents mapping of space beyond the grid. - var k1start = 0; - var k1end = 0; - var k2start = 0; - var k2end = 0; - for (var d = 0; d < max_d; d++) { - // Walk the front path one step. - for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { - var k1_offset = v_offset + k1; - var x1; - if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { - x1 = v1[k1_offset + 1]; - } else { - x1 = v1[k1_offset - 1] + 1; - } - var y1 = x1 - k1; - while (x1 < text1_length && y1 < text2_length && - text1.charAt(x1) == text2.charAt(y1)) { - x1++; - y1++; - } - v1[k1_offset] = x1; - if (x1 > text1_length) { - // Ran off the right of the graph. - k1end += 2; - } else if (y1 > text2_length) { - // Ran off the bottom of the graph. - k1start += 2; - } else if (front) { - var k2_offset = v_offset + delta - k1; - if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { - // Mirror x2 onto top-left coordinate system. - var x2 = text1_length - v2[k2_offset]; - if (x1 >= x2) { - // Overlap detected. - return diff_bisectSplit_(text1, text2, x1, y1); - } - } - } - } - - // Walk the reverse path one step. - for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { - var k2_offset = v_offset + k2; - var x2; - if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { - x2 = v2[k2_offset + 1]; - } else { - x2 = v2[k2_offset - 1] + 1; - } - var y2 = x2 - k2; - while (x2 < text1_length && y2 < text2_length && - text1.charAt(text1_length - x2 - 1) == - text2.charAt(text2_length - y2 - 1)) { - x2++; - y2++; - } - v2[k2_offset] = x2; - if (x2 > text1_length) { - // Ran off the left of the graph. - k2end += 2; - } else if (y2 > text2_length) { - // Ran off the top of the graph. - k2start += 2; - } else if (!front) { - var k1_offset = v_offset + delta - k2; - if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) { - var x1 = v1[k1_offset]; - var y1 = v_offset + x1 - k1_offset; - // Mirror x2 onto top-left coordinate system. - x2 = text1_length - x2; - if (x1 >= x2) { - // Overlap detected. - return diff_bisectSplit_(text1, text2, x1, y1); - } - } - } - } - } - // Diff took too long and hit the deadline or - // number of diffs equals number of characters, no commonality at all. - return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; -}; - - -/** - * Given the location of the 'middle snake', split the diff in two parts - * and recurse. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {number} x Index of split point in text1. - * @param {number} y Index of split point in text2. - * @return {Array} Array of diff tuples. - */ -function diff_bisectSplit_(text1, text2, x, y) { - var text1a = text1.substring(0, x); - var text2a = text2.substring(0, y); - var text1b = text1.substring(x); - var text2b = text2.substring(y); - - // Compute both diffs serially. - var diffs = diff_main(text1a, text2a); - var diffsb = diff_main(text1b, text2b); - - return diffs.concat(diffsb); -}; - - -/** - * Determine the common prefix of two strings. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {number} The number of characters common to the start of each - * string. - */ -function diff_commonPrefix(text1, text2) { - // Quick check for common null cases. - if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { - return 0; - } - // Binary search. - // Performance analysis: http://neil.fraser.name/news/2007/10/09/ - var pointermin = 0; - var pointermax = Math.min(text1.length, text2.length); - var pointermid = pointermax; - var pointerstart = 0; - while (pointermin < pointermid) { - if (text1.substring(pointerstart, pointermid) == - text2.substring(pointerstart, pointermid)) { - pointermin = pointermid; - pointerstart = pointermin; - } else { - pointermax = pointermid; - } - pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); - } - return pointermid; -}; - - -/** - * Determine the common suffix of two strings. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {number} The number of characters common to the end of each string. - */ -function diff_commonSuffix(text1, text2) { - // Quick check for common null cases. - if (!text1 || !text2 || - text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { - return 0; - } - // Binary search. - // Performance analysis: http://neil.fraser.name/news/2007/10/09/ - var pointermin = 0; - var pointermax = Math.min(text1.length, text2.length); - var pointermid = pointermax; - var pointerend = 0; - while (pointermin < pointermid) { - if (text1.substring(text1.length - pointermid, text1.length - pointerend) == - text2.substring(text2.length - pointermid, text2.length - pointerend)) { - pointermin = pointermid; - pointerend = pointermin; - } else { - pointermax = pointermid; - } - pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); - } - return pointermid; -}; - - -/** - * Do the two texts share a substring which is at least half the length of the - * longer text? - * This speedup can produce non-minimal diffs. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {Array.} Five element Array, containing the prefix of - * text1, the suffix of text1, the prefix of text2, the suffix of - * text2 and the common middle. Or null if there was no match. - */ -function diff_halfMatch_(text1, text2) { - var longtext = text1.length > text2.length ? text1 : text2; - var shorttext = text1.length > text2.length ? text2 : text1; - if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { - return null; // Pointless. - } - - /** - * Does a substring of shorttext exist within longtext such that the substring - * is at least half the length of longtext? - * Closure, but does not reference any external variables. - * @param {string} longtext Longer string. - * @param {string} shorttext Shorter string. - * @param {number} i Start index of quarter length substring within longtext. - * @return {Array.} Five element Array, containing the prefix of - * longtext, the suffix of longtext, the prefix of shorttext, the suffix - * of shorttext and the common middle. Or null if there was no match. - * @private - */ - function diff_halfMatchI_(longtext, shorttext, i) { - // Start with a 1/4 length substring at position i as a seed. - var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); - var j = -1; - var best_common = ''; - var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; - while ((j = shorttext.indexOf(seed, j + 1)) != -1) { - var prefixLength = diff_commonPrefix(longtext.substring(i), - shorttext.substring(j)); - var suffixLength = diff_commonSuffix(longtext.substring(0, i), - shorttext.substring(0, j)); - if (best_common.length < suffixLength + prefixLength) { - best_common = shorttext.substring(j - suffixLength, j) + - shorttext.substring(j, j + prefixLength); - best_longtext_a = longtext.substring(0, i - suffixLength); - best_longtext_b = longtext.substring(i + prefixLength); - best_shorttext_a = shorttext.substring(0, j - suffixLength); - best_shorttext_b = shorttext.substring(j + prefixLength); - } - } - if (best_common.length * 2 >= longtext.length) { - return [best_longtext_a, best_longtext_b, - best_shorttext_a, best_shorttext_b, best_common]; - } else { - return null; - } - } - - // First check if the second quarter is the seed for a half-match. - var hm1 = diff_halfMatchI_(longtext, shorttext, - Math.ceil(longtext.length / 4)); - // Check again based on the third quarter. - var hm2 = diff_halfMatchI_(longtext, shorttext, - Math.ceil(longtext.length / 2)); - var hm; - if (!hm1 && !hm2) { - return null; - } else if (!hm2) { - hm = hm1; - } else if (!hm1) { - hm = hm2; - } else { - // Both matched. Select the longest. - hm = hm1[4].length > hm2[4].length ? hm1 : hm2; - } - - // A half-match was found, sort out the return data. - var text1_a, text1_b, text2_a, text2_b; - if (text1.length > text2.length) { - text1_a = hm[0]; - text1_b = hm[1]; - text2_a = hm[2]; - text2_b = hm[3]; - } else { - text2_a = hm[0]; - text2_b = hm[1]; - text1_a = hm[2]; - text1_b = hm[3]; - } - var mid_common = hm[4]; - return [text1_a, text1_b, text2_a, text2_b, mid_common]; -}; - - -/** - * Reorder and merge like edit sections. Merge equalities. - * Any edit section can move as long as it doesn't cross an equality. - * @param {Array} diffs Array of diff tuples. - */ -function diff_cleanupMerge(diffs) { - diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. - var pointer = 0; - var count_delete = 0; - var count_insert = 0; - var text_delete = ''; - var text_insert = ''; - var commonlength; - while (pointer < diffs.length) { - switch (diffs[pointer][0]) { - case DIFF_INSERT: - count_insert++; - text_insert += diffs[pointer][1]; - pointer++; - break; - case DIFF_DELETE: - count_delete++; - text_delete += diffs[pointer][1]; - pointer++; - break; - case DIFF_EQUAL: - // Upon reaching an equality, check for prior redundancies. - if (count_delete + count_insert > 1) { - if (count_delete !== 0 && count_insert !== 0) { - // Factor out any common prefixies. - commonlength = diff_commonPrefix(text_insert, text_delete); - if (commonlength !== 0) { - if ((pointer - count_delete - count_insert) > 0 && - diffs[pointer - count_delete - count_insert - 1][0] == - DIFF_EQUAL) { - diffs[pointer - count_delete - count_insert - 1][1] += - text_insert.substring(0, commonlength); - } else { - diffs.splice(0, 0, [DIFF_EQUAL, - text_insert.substring(0, commonlength)]); - pointer++; - } - text_insert = text_insert.substring(commonlength); - text_delete = text_delete.substring(commonlength); - } - // Factor out any common suffixies. - commonlength = diff_commonSuffix(text_insert, text_delete); - if (commonlength !== 0) { - diffs[pointer][1] = text_insert.substring(text_insert.length - - commonlength) + diffs[pointer][1]; - text_insert = text_insert.substring(0, text_insert.length - - commonlength); - text_delete = text_delete.substring(0, text_delete.length - - commonlength); - } - } - // Delete the offending records and add the merged ones. - if (count_delete === 0) { - diffs.splice(pointer - count_insert, - count_delete + count_insert, [DIFF_INSERT, text_insert]); - } else if (count_insert === 0) { - diffs.splice(pointer - count_delete, - count_delete + count_insert, [DIFF_DELETE, text_delete]); - } else { - diffs.splice(pointer - count_delete - count_insert, - count_delete + count_insert, [DIFF_DELETE, text_delete], - [DIFF_INSERT, text_insert]); - } - pointer = pointer - count_delete - count_insert + - (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; - } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { - // Merge this equality with the previous one. - diffs[pointer - 1][1] += diffs[pointer][1]; - diffs.splice(pointer, 1); - } else { - pointer++; - } - count_insert = 0; - count_delete = 0; - text_delete = ''; - text_insert = ''; - break; - } - } - if (diffs[diffs.length - 1][1] === '') { - diffs.pop(); // Remove the dummy entry at the end. - } - - // Second pass: look for single edits surrounded on both sides by equalities - // which can be shifted sideways to eliminate an equality. - // e.g: ABAC -> ABAC - var changes = false; - pointer = 1; - // Intentionally ignore the first and last element (don't need checking). - while (pointer < diffs.length - 1) { - if (diffs[pointer - 1][0] == DIFF_EQUAL && - diffs[pointer + 1][0] == DIFF_EQUAL) { - // This is a single edit surrounded by equalities. - if (diffs[pointer][1].substring(diffs[pointer][1].length - - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { - // Shift the edit over the previous equality. - diffs[pointer][1] = diffs[pointer - 1][1] + - diffs[pointer][1].substring(0, diffs[pointer][1].length - - diffs[pointer - 1][1].length); - diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; - diffs.splice(pointer - 1, 1); - changes = true; - } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == - diffs[pointer + 1][1]) { - // Shift the edit over the next equality. - diffs[pointer - 1][1] += diffs[pointer + 1][1]; - diffs[pointer][1] = - diffs[pointer][1].substring(diffs[pointer + 1][1].length) + - diffs[pointer + 1][1]; - diffs.splice(pointer + 1, 1); - changes = true; - } - } - pointer++; - } - // If shifts were made, the diff needs reordering and another shift sweep. - if (changes) { - diff_cleanupMerge(diffs); - } -}; - - -var diff = diff_main; -diff.INSERT = DIFF_INSERT; -diff.DELETE = DIFF_DELETE; -diff.EQUAL = DIFF_EQUAL; - -module.exports = diff; - -/* - * Modify a diff such that the cursor position points to the start of a change: - * E.g. - * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) - * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] - * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) - * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] - * - * @param {Array} diffs Array of diff tuples - * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! - * @return {Array} A tuple [cursor location in the modified diff, modified diff] - */ -function cursor_normalize_diff (diffs, cursor_pos) { - if (cursor_pos === 0) { - return [DIFF_EQUAL, diffs]; - } - for (var current_pos = 0, i = 0; i < diffs.length; i++) { - var d = diffs[i]; - if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { - var next_pos = current_pos + d[1].length; - if (cursor_pos === next_pos) { - return [i + 1, diffs]; - } else if (cursor_pos < next_pos) { - // copy to prevent side effects - diffs = diffs.slice(); - // split d into two diff changes - var split_pos = cursor_pos - current_pos; - var d_left = [d[0], d[1].slice(0, split_pos)]; - var d_right = [d[0], d[1].slice(split_pos)]; - diffs.splice(i, 1, d_left, d_right); - return [i + 1, diffs]; - } else { - current_pos = next_pos; - } - } - } - throw new Error('cursor_pos is out of bounds!') -} - -/* - * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). - * - * Case 1) - * Check if a naive shift is possible: - * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) - * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result - * Case 2) - * Check if the following shifts are possible: - * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] - * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] - * ^ ^ - * d d_next - * - * @param {Array} diffs Array of diff tuples - * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! - * @return {Array} Array of diff tuples - */ -function fix_cursor (diffs, cursor_pos) { - var norm = cursor_normalize_diff(diffs, cursor_pos); - var ndiffs = norm[1]; - var cursor_pointer = norm[0]; - var d = ndiffs[cursor_pointer]; - var d_next = ndiffs[cursor_pointer + 1]; - - if (d == null) { - // Text was deleted from end of original string, - // cursor is now out of bounds in new string - return diffs; - } else if (d[0] !== DIFF_EQUAL) { - // A modification happened at the cursor location. - // This is the expected outcome, so we can return the original diff. - return diffs; - } else { - if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { - // Case 1) - // It is possible to perform a naive shift - ndiffs.splice(cursor_pointer, 2, d_next, d) - return merge_tuples(ndiffs, cursor_pointer, 2) - } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { - // Case 2) - // d[1] is a prefix of d_next[1] - // We can assume that d_next[0] !== 0, since d[0] === 0 - // Shift edit locations.. - ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); - var suffix = d_next[1].slice(d[1].length); - if (suffix.length > 0) { - ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); - } - return merge_tuples(ndiffs, cursor_pointer, 3) - } else { - // Not possible to perform any modification - return diffs; - } - } -} - -/* - * Check diff did not split surrogate pairs. - * Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F'] - * '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯' - * - * @param {Array} diffs Array of diff tuples - * @return {Array} Array of diff tuples - */ -function fix_emoji (diffs) { - var compact = false; - var starts_with_pair_end = function(str) { - return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF; - } - var ends_with_pair_start = function(str) { - return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF; - } - for (var i = 2; i < diffs.length; i += 1) { - if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) && - diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) && - diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) { - compact = true; - - diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1]; - diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1]; - - diffs[i-2][1] = diffs[i-2][1].slice(0, -1); - } - } - if (!compact) { - return diffs; - } - var fixed_diffs = []; - for (var i = 0; i < diffs.length; i += 1) { - if (diffs[i][1].length > 0) { - fixed_diffs.push(diffs[i]); - } - } - return fixed_diffs; -} - -/* - * Try to merge tuples with their neigbors in a given range. - * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] - * - * @param {Array} diffs Array of diff tuples. - * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). - * @param {Int} length Number of consecutive elements to check. - * @return {Array} Array of merged diff tuples. - */ -function merge_tuples (diffs, start, length) { - // Check from (start-1) to (start+length). - for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { - if (i + 1 < diffs.length) { - var left_d = diffs[i]; - var right_d = diffs[i+1]; - if (left_d[0] === right_d[1]) { - diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); - } - } - } - return diffs; -} - - -/***/ }), -/* 52 */ -/***/ (function(module, exports) { - -exports = module.exports = typeof Object.keys === 'function' - ? Object.keys : shim; - -exports.shim = shim; -function shim (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -} - - -/***/ }), -/* 53 */ -/***/ (function(module, exports) { - -var supportsArgumentsClass = (function(){ - return Object.prototype.toString.call(arguments) -})() == '[object Arguments]'; - -exports = module.exports = supportsArgumentsClass ? supported : unsupported; - -exports.supported = supported; -function supported(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -}; - -exports.unsupported = unsupported; -function unsupported(object){ - return object && - typeof object == 'object' && - typeof object.length == 'number' && - Object.prototype.hasOwnProperty.call(object, 'callee') && - !Object.prototype.propertyIsEnumerable.call(object, 'callee') || - false; -}; - - -/***/ }), -/* 54 */ -/***/ (function(module, exports) { - -'use strict'; - -var has = Object.prototype.hasOwnProperty - , prefix = '~'; - -/** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @api private - */ -function Events() {} - -// -// We try to not inherit from `Object.prototype`. In some engines creating an -// instance in this way is faster than calling `Object.create(null)` directly. -// If `Object.create(null)` is not supported we prefix the event names with a -// character to make sure that the built-in object properties are not -// overridden or used as an attack vector. -// -if (Object.create) { - Events.prototype = Object.create(null); - - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; -} - -/** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {Mixed} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @api private - */ -function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; -} - -/** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @api public - */ -function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; -} - -/** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @api public - */ -EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; -}; - -/** - * Return the listeners registered for a given event. - * - * @param {String|Symbol} event The event name. - * @param {Boolean} exists Only check if there are listeners. - * @returns {Array|Boolean} - * @api public - */ -EventEmitter.prototype.listeners = function listeners(event, exists) { - var evt = prefix ? prefix + event : event - , available = this._events[evt]; - - if (exists) return !!available; - if (!available) return []; - if (available.fn) return [available.fn]; - - for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { - ee[i] = available[i].fn; - } - - return ee; -}; - -/** - * Calls each of the listeners registered for a given event. - * - * @param {String|Symbol} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @api public - */ -EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } - - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; - - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } - - listeners[i].fn.apply(listeners[i].context, args); - } - } - } - - return true; -}; - -/** - * Add a listener for a given event. - * - * @param {String|Symbol} event The event name. - * @param {Function} fn The listener function. - * @param {Mixed} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @api public - */ -EventEmitter.prototype.on = function on(event, fn, context) { - var listener = new EE(fn, context || this) - , evt = prefix ? prefix + event : event; - - if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; - else if (!this._events[evt].fn) this._events[evt].push(listener); - else this._events[evt] = [this._events[evt], listener]; - - return this; -}; - -/** - * Add a one-time listener for a given event. - * - * @param {String|Symbol} event The event name. - * @param {Function} fn The listener function. - * @param {Mixed} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @api public - */ -EventEmitter.prototype.once = function once(event, fn, context) { - var listener = new EE(fn, context || this, true) - , evt = prefix ? prefix + event : event; - - if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; - else if (!this._events[evt].fn) this._events[evt].push(listener); - else this._events[evt] = [this._events[evt], listener]; - - return this; -}; - -/** - * Remove the listeners of a given event. - * - * @param {String|Symbol} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {Mixed} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @api public - */ -EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn - && (!once || listeners.once) - && (!context || listeners.context === context) - ) { - if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn - || (once && !listeners[i].once) - || (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - } - - return this; -}; - -/** - * Remove all listeners, or those of the specified event. - * - * @param {String|Symbol} [event] The event name. - * @returns {EventEmitter} `this`. - * @api public - */ -EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) { - if (--this._eventsCount === 0) this._events = new Events(); - else delete this._events[evt]; - } - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; -}; - -// -// Alias methods names because people roll like that. -// -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -// -// This function doesn't apply anymore. -// -EventEmitter.prototype.setMaxListeners = function setMaxListeners() { - return this; -}; - -// -// Expose the prefix. -// -EventEmitter.prefixed = prefix; - -// -// Allow `EventEmitter` to be imported as module namespace. -// -EventEmitter.EventEmitter = EventEmitter; - -// -// Expose the module. -// -if ('undefined' !== typeof module) { - module.exports = EventEmitter; -} - - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -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; }; }(); - -var _extend2 = __webpack_require__(3); - -var _extend3 = _interopRequireDefault(_extend2); - -var _quillDelta = __webpack_require__(2); - -var _quillDelta2 = _interopRequireDefault(_quillDelta); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _quill = __webpack_require__(5); - -var _quill2 = _interopRequireDefault(_quill); - -var _logger = __webpack_require__(10); - -var _logger2 = _interopRequireDefault(_logger); - -var _module = __webpack_require__(9); - -var _module2 = _interopRequireDefault(_module); - -var _align = __webpack_require__(36); - -var _background = __webpack_require__(37); - -var _code = __webpack_require__(13); - -var _code2 = _interopRequireDefault(_code); - -var _color = __webpack_require__(26); - -var _direction = __webpack_require__(38); - -var _font = __webpack_require__(39); - -var _size = __webpack_require__(40); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -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; } - -var debug = (0, _logger2.default)('quill:clipboard'); - -var DOM_KEY = '__ql-matcher'; - -var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; - -var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { - memo[attr.keyName] = attr; - return memo; -}, {}); - -var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { - memo[attr.keyName] = attr; - return memo; -}, {}); - -var Clipboard = function (_Module) { - _inherits(Clipboard, _Module); - - function Clipboard(quill, options) { - _classCallCheck(this, Clipboard); - - var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); - - _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); - _this.container = _this.quill.addContainer('ql-clipboard'); - _this.container.setAttribute('contenteditable', true); - _this.container.setAttribute('tabindex', -1); - _this.matchers = []; - CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - selector = _ref2[0], - matcher = _ref2[1]; - - if (!options.matchVisual && matcher === matchSpacing) return; - _this.addMatcher(selector, matcher); - }); - return _this; - } - - _createClass(Clipboard, [{ - key: 'addMatcher', - value: function addMatcher(selector, matcher) { - this.matchers.push([selector, matcher]); - } - }, { - key: 'convert', - value: function convert(html) { - if (typeof html === 'string') { - this.container.innerHTML = html.replace(/\>\r?\n +\<'); // Remove spaces between tags - return this.convert(); - } - var formats = this.quill.getFormat(this.quill.selection.savedRange.index); - if (formats[_code2.default.blotName]) { - var text = this.container.innerText; - this.container.innerHTML = ''; - return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName])); - } - - var _prepareMatching = this.prepareMatching(), - _prepareMatching2 = _slicedToArray(_prepareMatching, 2), - elementMatchers = _prepareMatching2[0], - textMatchers = _prepareMatching2[1]; - - var delta = traverse(this.container, elementMatchers, textMatchers); - // Remove trailing newline - if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { - delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); - } - debug.log('convert', this.container.innerHTML, delta); - this.container.innerHTML = ''; - return delta; - } - }, { - key: 'dangerouslyPasteHTML', - value: function dangerouslyPasteHTML(index, html) { - var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; - - if (typeof index === 'string') { - this.quill.setContents(this.convert(index), html); - this.quill.setSelection(0, _quill2.default.sources.SILENT); - } else { - var paste = this.convert(html); - this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); - this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT); - } - } - }, { - key: 'onPaste', - value: function onPaste(e) { - var _this2 = this; - - if (e.defaultPrevented || !this.quill.isEnabled()) return; - var range = this.quill.getSelection(); - var delta = new _quillDelta2.default().retain(range.index); - var scrollTop = this.quill.scrollingContainer.scrollTop; - this.container.focus(); - this.quill.selection.update(_quill2.default.sources.SILENT); - setTimeout(function () { - delta = delta.concat(_this2.convert()).delete(range.length); - _this2.quill.updateContents(delta, _quill2.default.sources.USER); - // range.length contributes to delta.length() - _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); - _this2.quill.scrollingContainer.scrollTop = scrollTop; - _this2.quill.focus(); - }, 1); - } - }, { - key: 'prepareMatching', - value: function prepareMatching() { - var _this3 = this; - - var elementMatchers = [], - textMatchers = []; - this.matchers.forEach(function (pair) { - var _pair = _slicedToArray(pair, 2), - selector = _pair[0], - matcher = _pair[1]; - - switch (selector) { - case Node.TEXT_NODE: - textMatchers.push(matcher); - break; - case Node.ELEMENT_NODE: - elementMatchers.push(matcher); - break; - default: - [].forEach.call(_this3.container.querySelectorAll(selector), function (node) { - // TODO use weakmap - node[DOM_KEY] = node[DOM_KEY] || []; - node[DOM_KEY].push(matcher); - }); - break; - } - }); - return [elementMatchers, textMatchers]; - } - }]); - - return Clipboard; -}(_module2.default); - -Clipboard.DEFAULTS = { - matchers: [], - matchVisual: true -}; - -function applyFormat(delta, format, value) { - if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') { - return Object.keys(format).reduce(function (delta, key) { - return applyFormat(delta, key, format[key]); - }, delta); - } else { - return delta.reduce(function (delta, op) { - if (op.attributes && op.attributes[format]) { - return delta.push(op); - } else { - return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes)); - } - }, new _quillDelta2.default()); - } -} - -function computeStyle(node) { - if (node.nodeType !== Node.ELEMENT_NODE) return {}; - var DOM_KEY = '__ql-computed-style'; - return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); -} - -function deltaEndsWith(delta, text) { - var endText = ""; - for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { - var op = delta.ops[i]; - if (typeof op.insert !== 'string') break; - endText = op.insert + endText; - } - return endText.slice(-1 * text.length) === text; -} - -function isLine(node) { - if (node.childNodes.length === 0) return false; // Exclude embed blocks - var style = computeStyle(node); - return ['block', 'list-item'].indexOf(style.display) > -1; -} - -function traverse(node, elementMatchers, textMatchers) { - // Post-order - if (node.nodeType === node.TEXT_NODE) { - return textMatchers.reduce(function (delta, matcher) { - return matcher(node, delta); - }, new _quillDelta2.default()); - } else if (node.nodeType === node.ELEMENT_NODE) { - return [].reduce.call(node.childNodes || [], function (delta, childNode) { - var childrenDelta = traverse(childNode, elementMatchers, textMatchers); - if (childNode.nodeType === node.ELEMENT_NODE) { - childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { - return matcher(childNode, childrenDelta); - }, childrenDelta); - childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { - return matcher(childNode, childrenDelta); - }, childrenDelta); - } - return delta.concat(childrenDelta); - }, new _quillDelta2.default()); - } else { - return new _quillDelta2.default(); - } -} - -function matchAlias(format, node, delta) { - return applyFormat(delta, format, true); -} - -function matchAttributor(node, delta) { - var attributes = _parchment2.default.Attributor.Attribute.keys(node); - var classes = _parchment2.default.Attributor.Class.keys(node); - var styles = _parchment2.default.Attributor.Style.keys(node); - var formats = {}; - attributes.concat(classes).concat(styles).forEach(function (name) { - var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); - if (attr != null) { - formats[attr.attrName] = attr.value(node); - if (formats[attr.attrName]) return; - } - attr = ATTRIBUTE_ATTRIBUTORS[name]; - if (attr != null && (attr.attrName === name || attr.keyName === name)) { - formats[attr.attrName] = attr.value(node) || undefined; - } - attr = STYLE_ATTRIBUTORS[name]; - if (attr != null && (attr.attrName === name || attr.keyName === name)) { - attr = STYLE_ATTRIBUTORS[name]; - formats[attr.attrName] = attr.value(node) || undefined; - } - }); - if (Object.keys(formats).length > 0) { - delta = applyFormat(delta, formats); - } - return delta; -} - -function matchBlot(node, delta) { - var match = _parchment2.default.query(node); - if (match == null) return delta; - if (match.prototype instanceof _parchment2.default.Embed) { - var embed = {}; - var value = match.value(node); - if (value != null) { - embed[match.blotName] = value; - delta = new _quillDelta2.default().insert(embed, match.formats(node)); - } - } else if (typeof match.formats === 'function') { - delta = applyFormat(delta, match.blotName, match.formats(node)); - } - return delta; -} - -function matchBreak(node, delta) { - if (!deltaEndsWith(delta, '\n')) { - delta.insert('\n'); - } - return delta; -} - -function matchIgnore() { - return new _quillDelta2.default(); -} - -function matchIndent(node, delta) { - var match = _parchment2.default.query(node); - if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\n')) { - return delta; - } - var indent = -1, - parent = node.parentNode; - while (!parent.classList.contains('ql-clipboard')) { - if ((_parchment2.default.query(parent) || {}).blotName === 'list') { - indent += 1; - } - parent = parent.parentNode; - } - if (indent <= 0) return delta; - return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent })); -} - -function matchNewline(node, delta) { - if (!deltaEndsWith(delta, '\n')) { - if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) { - delta.insert('\n'); - } - } - return delta; -} - -function matchSpacing(node, delta) { - if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { - var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); - if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { - delta.insert('\n'); - } - } - return delta; -} - -function matchStyles(node, delta) { - var formats = {}; - var style = node.style || {}; - if (style.fontStyle && computeStyle(node).fontStyle === 'italic') { - formats.italic = true; - } - if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) { - formats.bold = true; - } - if (Object.keys(formats).length > 0) { - delta = applyFormat(delta, formats); - } - if (parseFloat(style.textIndent || 0) > 0) { - // Could be 0.5in - delta = new _quillDelta2.default().insert('\t').concat(delta); - } - return delta; -} - -function matchText(node, delta) { - var text = node.data; - // Word represents empty line with   - if (node.parentNode.tagName === 'O:P') { - return delta.insert(text.trim()); - } - if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) { - return delta; - } - if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { - // eslint-disable-next-line func-style - var replacer = function replacer(collapse, match) { - match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; - return match.length < 1 && collapse ? ' ' : match; - }; - text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); - text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace - if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { - text = text.replace(/^\s+/, replacer.bind(replacer, false)); - } - if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { - text = text.replace(/\s+$/, replacer.bind(replacer, false)); - } - } - return delta.insert(text); -} - -exports.default = Clipboard; -exports.matchAttributor = matchAttributor; -exports.matchBlot = matchBlot; -exports.matchNewline = matchNewline; -exports.matchSpacing = matchSpacing; -exports.matchText = matchText; - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _inline = __webpack_require__(6); - -var _inline2 = _interopRequireDefault(_inline); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Bold = function (_Inline) { - _inherits(Bold, _Inline); - - function Bold() { - _classCallCheck(this, Bold); - - return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments)); - } - - _createClass(Bold, [{ - key: 'optimize', - value: function optimize(context) { - _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context); - if (this.domNode.tagName !== this.statics.tagName[0]) { - this.replaceWith(this.statics.blotName); - } - } - }], [{ - key: 'create', - value: function create() { - return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this); - } - }, { - key: 'formats', - value: function formats() { - return true; - } - }]); - - return Bold; -}(_inline2.default); - -Bold.blotName = 'bold'; -Bold.tagName = ['STRONG', 'B']; - -exports.default = Bold; - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.addControls = exports.default = undefined; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -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; }; }(); - -var _quillDelta = __webpack_require__(2); - -var _quillDelta2 = _interopRequireDefault(_quillDelta); - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _quill = __webpack_require__(5); - -var _quill2 = _interopRequireDefault(_quill); - -var _logger = __webpack_require__(10); - -var _logger2 = _interopRequireDefault(_logger); - -var _module = __webpack_require__(9); - -var _module2 = _interopRequireDefault(_module); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -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; } - -var debug = (0, _logger2.default)('quill:toolbar'); - -var Toolbar = function (_Module) { - _inherits(Toolbar, _Module); - - function Toolbar(quill, options) { - _classCallCheck(this, Toolbar); - - var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options)); - - if (Array.isArray(_this.options.container)) { - var container = document.createElement('div'); - addControls(container, _this.options.container); - quill.container.parentNode.insertBefore(container, quill.container); - _this.container = container; - } else if (typeof _this.options.container === 'string') { - _this.container = document.querySelector(_this.options.container); - } else { - _this.container = _this.options.container; - } - if (!(_this.container instanceof HTMLElement)) { - var _ret; - - return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret); - } - _this.container.classList.add('ql-toolbar'); - _this.controls = []; - _this.handlers = {}; - Object.keys(_this.options.handlers).forEach(function (format) { - _this.addHandler(format, _this.options.handlers[format]); - }); - [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) { - _this.attach(input); - }); - _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) { - if (type === _quill2.default.events.SELECTION_CHANGE) { - _this.update(range); - } - }); - _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { - var _this$quill$selection = _this.quill.selection.getRange(), - _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), - range = _this$quill$selection2[0]; // quill.getSelection triggers update - - - _this.update(range); - }); - return _this; - } - - _createClass(Toolbar, [{ - key: 'addHandler', - value: function addHandler(format, handler) { - this.handlers[format] = handler; - } - }, { - key: 'attach', - value: function attach(input) { - var _this2 = this; - - var format = [].find.call(input.classList, function (className) { - return className.indexOf('ql-') === 0; - }); - if (!format) return; - format = format.slice('ql-'.length); - if (input.tagName === 'BUTTON') { - input.setAttribute('type', 'button'); - } - if (this.handlers[format] == null) { - if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) { - debug.warn('ignoring attaching to disabled format', format, input); - return; - } - if (_parchment2.default.query(format) == null) { - debug.warn('ignoring attaching to nonexistent format', format, input); - return; - } - } - var eventName = input.tagName === 'SELECT' ? 'change' : 'click'; - input.addEventListener(eventName, function (e) { - var value = void 0; - if (input.tagName === 'SELECT') { - if (input.selectedIndex < 0) return; - var selected = input.options[input.selectedIndex]; - if (selected.hasAttribute('selected')) { - value = false; - } else { - value = selected.value || false; - } - } else { - if (input.classList.contains('ql-active')) { - value = false; - } else { - value = input.value || !input.hasAttribute('value'); - } - e.preventDefault(); - } - _this2.quill.focus(); - - var _quill$selection$getR = _this2.quill.selection.getRange(), - _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), - range = _quill$selection$getR2[0]; - - if (_this2.handlers[format] != null) { - _this2.handlers[format].call(_this2, value); - } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) { - value = prompt('Enter ' + format); - if (!value) return; - _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER); - } else { - _this2.quill.format(format, value, _quill2.default.sources.USER); - } - _this2.update(range); - }); - // TODO use weakmap - this.controls.push([format, input]); - } - }, { - key: 'update', - value: function update(range) { - var formats = range == null ? {} : this.quill.getFormat(range); - this.controls.forEach(function (pair) { - var _pair = _slicedToArray(pair, 2), - format = _pair[0], - input = _pair[1]; - - if (input.tagName === 'SELECT') { - var option = void 0; - if (range == null) { - option = null; - } else if (formats[format] == null) { - option = input.querySelector('option[selected]'); - } else if (!Array.isArray(formats[format])) { - var value = formats[format]; - if (typeof value === 'string') { - value = value.replace(/\"/g, '\\"'); - } - option = input.querySelector('option[value="' + value + '"]'); - } - if (option == null) { - input.value = ''; // TODO make configurable? - input.selectedIndex = -1; - } else { - option.selected = true; - } - } else { - if (range == null) { - input.classList.remove('ql-active'); - } else if (input.hasAttribute('value')) { - // both being null should match (default values) - // '1' should match with 1 (headers) - var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value'); - input.classList.toggle('ql-active', isActive); - } else { - input.classList.toggle('ql-active', formats[format] != null); - } - } - }); - } - }]); - - return Toolbar; -}(_module2.default); - -Toolbar.DEFAULTS = {}; - -function addButton(container, format, value) { - var input = document.createElement('button'); - input.setAttribute('type', 'button'); - input.classList.add('ql-' + format); - if (value != null) { - input.value = value; - } - container.appendChild(input); -} - -function addControls(container, groups) { - if (!Array.isArray(groups[0])) { - groups = [groups]; - } - groups.forEach(function (controls) { - var group = document.createElement('span'); - group.classList.add('ql-formats'); - controls.forEach(function (control) { - if (typeof control === 'string') { - addButton(group, control); - } else { - var format = Object.keys(control)[0]; - var value = control[format]; - if (Array.isArray(value)) { - addSelect(group, format, value); - } else { - addButton(group, format, value); - } - } - }); - container.appendChild(group); - }); -} - -function addSelect(container, format, values) { - var input = document.createElement('select'); - input.classList.add('ql-' + format); - values.forEach(function (value) { - var option = document.createElement('option'); - if (value !== false) { - option.setAttribute('value', value); - } else { - option.setAttribute('selected', 'selected'); - } - input.appendChild(option); - }); - container.appendChild(input); -} - -Toolbar.DEFAULTS = { - container: null, - handlers: { - clean: function clean() { - var _this3 = this; - - var range = this.quill.getSelection(); - if (range == null) return; - if (range.length == 0) { - var formats = this.quill.getFormat(); - Object.keys(formats).forEach(function (name) { - // Clean functionality in existing apps only clean inline formats - if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) { - _this3.quill.format(name, false); - } - }); - } else { - this.quill.removeFormat(range, _quill2.default.sources.USER); - } - }, - direction: function direction(value) { - var align = this.quill.getFormat()['align']; - if (value === 'rtl' && align == null) { - this.quill.format('align', 'right', _quill2.default.sources.USER); - } else if (!value && align === 'right') { - this.quill.format('align', false, _quill2.default.sources.USER); - } - this.quill.format('direction', value, _quill2.default.sources.USER); - }, - indent: function indent(value) { - var range = this.quill.getSelection(); - var formats = this.quill.getFormat(range); - var indent = parseInt(formats.indent || 0); - if (value === '+1' || value === '-1') { - var modifier = value === '+1' ? 1 : -1; - if (formats.direction === 'rtl') modifier *= -1; - this.quill.format('indent', indent + modifier, _quill2.default.sources.USER); - } - }, - link: function link(value) { - if (value === true) { - value = prompt('Enter link URL:'); - } - this.quill.format('link', value, _quill2.default.sources.USER); - }, - list: function list(value) { - var range = this.quill.getSelection(); - var formats = this.quill.getFormat(range); - if (value === 'check') { - if (formats['list'] === 'checked' || formats['list'] === 'unchecked') { - this.quill.format('list', false, _quill2.default.sources.USER); - } else { - this.quill.format('list', 'unchecked', _quill2.default.sources.USER); - } - } else { - this.quill.format('list', value, _quill2.default.sources.USER); - } - } - } -}; - -exports.default = Toolbar; -exports.addControls = addControls; - -/***/ }), -/* 58 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _picker = __webpack_require__(28); - -var _picker2 = _interopRequireDefault(_picker); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var ColorPicker = function (_Picker) { - _inherits(ColorPicker, _Picker); - - function ColorPicker(select, label) { - _classCallCheck(this, ColorPicker); - - var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select)); - - _this.label.innerHTML = label; - _this.container.classList.add('ql-color-picker'); - [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) { - item.classList.add('ql-primary'); - }); - return _this; - } - - _createClass(ColorPicker, [{ - key: 'buildItem', - value: function buildItem(option) { - var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option); - item.style.backgroundColor = option.getAttribute('value') || ''; - return item; - } - }, { - key: 'selectItem', - value: function selectItem(item, trigger) { - _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger); - var colorLabel = this.label.querySelector('.ql-color-label'); - var value = item ? item.getAttribute('data-value') || '' : ''; - if (colorLabel) { - if (colorLabel.tagName === 'line') { - colorLabel.style.stroke = value; - } else { - colorLabel.style.fill = value; - } - } - } - }]); - - return ColorPicker; -}(_picker2.default); - -exports.default = ColorPicker; - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _picker = __webpack_require__(28); - -var _picker2 = _interopRequireDefault(_picker); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var IconPicker = function (_Picker) { - _inherits(IconPicker, _Picker); - - function IconPicker(select, icons) { - _classCallCheck(this, IconPicker); - - var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select)); - - _this.container.classList.add('ql-icon-picker'); - [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) { - item.innerHTML = icons[item.getAttribute('data-value') || '']; - }); - _this.defaultItem = _this.container.querySelector('.ql-selected'); - _this.selectItem(_this.defaultItem); - return _this; - } - - _createClass(IconPicker, [{ - key: 'selectItem', - value: function selectItem(item, trigger) { - _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger); - item = item || this.defaultItem; - this.label.innerHTML = item.innerHTML; - } - }]); - - return IconPicker; -}(_picker2.default); - -exports.default = IconPicker; - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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"); } } - -var Tooltip = function () { - function Tooltip(quill, boundsContainer) { - var _this = this; - - _classCallCheck(this, Tooltip); - - this.quill = quill; - this.boundsContainer = boundsContainer || document.body; - this.root = quill.addContainer('ql-tooltip'); - this.root.innerHTML = this.constructor.TEMPLATE; - if (this.quill.root === this.quill.scrollingContainer) { - this.quill.root.addEventListener('scroll', function () { - _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px'; - }); - } - this.hide(); - } - - _createClass(Tooltip, [{ - key: 'hide', - value: function hide() { - this.root.classList.add('ql-hidden'); - } - }, { - key: 'position', - value: function position(reference) { - var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2; - // root.scrollTop should be 0 if scrollContainer !== root - var top = reference.bottom + this.quill.root.scrollTop; - this.root.style.left = left + 'px'; - this.root.style.top = top + 'px'; - this.root.classList.remove('ql-flip'); - var containerBounds = this.boundsContainer.getBoundingClientRect(); - var rootBounds = this.root.getBoundingClientRect(); - var shift = 0; - if (rootBounds.right > containerBounds.right) { - shift = containerBounds.right - rootBounds.right; - this.root.style.left = left + shift + 'px'; - } - if (rootBounds.left < containerBounds.left) { - shift = containerBounds.left - rootBounds.left; - this.root.style.left = left + shift + 'px'; - } - if (rootBounds.bottom > containerBounds.bottom) { - var height = rootBounds.bottom - rootBounds.top; - var verticalShift = reference.bottom - reference.top + height; - this.root.style.top = top - verticalShift + 'px'; - this.root.classList.add('ql-flip'); - } - return shift; - } - }, { - key: 'show', - value: function show() { - this.root.classList.remove('ql-editing'); - this.root.classList.remove('ql-hidden'); - } - }]); - - return Tooltip; -}(); - -exports.default = Tooltip; - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -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; }; }(); - -var _extend = __webpack_require__(3); - -var _extend2 = _interopRequireDefault(_extend); - -var _emitter = __webpack_require__(8); - -var _emitter2 = _interopRequireDefault(_emitter); - -var _base = __webpack_require__(43); - -var _base2 = _interopRequireDefault(_base); - -var _link = __webpack_require__(27); - -var _link2 = _interopRequireDefault(_link); - -var _selection = __webpack_require__(15); - -var _icons = __webpack_require__(41); - -var _icons2 = _interopRequireDefault(_icons); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']]; - -var SnowTheme = function (_BaseTheme) { - _inherits(SnowTheme, _BaseTheme); - - function SnowTheme(quill, options) { - _classCallCheck(this, SnowTheme); - - if (options.modules.toolbar != null && options.modules.toolbar.container == null) { - options.modules.toolbar.container = TOOLBAR_CONFIG; - } - - var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options)); - - _this.quill.container.classList.add('ql-snow'); - return _this; - } - - _createClass(SnowTheme, [{ - key: 'extendToolbar', - value: function extendToolbar(toolbar) { - toolbar.container.classList.add('ql-snow'); - this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); - this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); - this.tooltip = new SnowTooltip(this.quill, this.options.bounds); - if (toolbar.container.querySelector('.ql-link')) { - this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) { - toolbar.handlers['link'].call(toolbar, !context.format.link); - }); - } - } - }]); - - return SnowTheme; -}(_base2.default); - -SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { - modules: { - toolbar: { - handlers: { - link: function link(value) { - if (value) { - var range = this.quill.getSelection(); - if (range == null || range.length == 0) return; - var preview = this.quill.getText(range); - if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) { - preview = 'mailto:' + preview; - } - var tooltip = this.quill.theme.tooltip; - tooltip.edit('link', preview); - } else { - this.quill.format('link', false); - } - } - } - } - } -}); - -var SnowTooltip = function (_BaseTooltip) { - _inherits(SnowTooltip, _BaseTooltip); - - function SnowTooltip(quill, bounds) { - _classCallCheck(this, SnowTooltip); - - var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds)); - - _this2.preview = _this2.root.querySelector('a.ql-preview'); - return _this2; - } - - _createClass(SnowTooltip, [{ - key: 'listen', - value: function listen() { - var _this3 = this; - - _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this); - this.root.querySelector('a.ql-action').addEventListener('click', function (event) { - if (_this3.root.classList.contains('ql-editing')) { - _this3.save(); - } else { - _this3.edit('link', _this3.preview.textContent); - } - event.preventDefault(); - }); - this.root.querySelector('a.ql-remove').addEventListener('click', function (event) { - if (_this3.linkRange != null) { - var range = _this3.linkRange; - _this3.restoreFocus(); - _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER); - delete _this3.linkRange; - } - event.preventDefault(); - _this3.hide(); - }); - this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) { - if (range == null) return; - if (range.length === 0 && source === _emitter2.default.sources.USER) { - var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), - _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), - link = _quill$scroll$descend2[0], - offset = _quill$scroll$descend2[1]; - - if (link != null) { - _this3.linkRange = new _selection.Range(range.index - offset, link.length()); - var preview = _link2.default.formats(link.domNode); - _this3.preview.textContent = preview; - _this3.preview.setAttribute('href', preview); - _this3.show(); - _this3.position(_this3.quill.getBounds(_this3.linkRange)); - return; - } - } else { - delete _this3.linkRange; - } - _this3.hide(); - }); - } - }, { - key: 'show', - value: function show() { - _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this); - this.root.removeAttribute('data-mode'); - } - }]); - - return SnowTooltip; -}(_base.BaseTooltip); - -SnowTooltip.TEMPLATE = ['', '', '', ''].join(''); - -exports.default = SnowTheme; - -/***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _core = __webpack_require__(29); - -var _core2 = _interopRequireDefault(_core); - -var _align = __webpack_require__(36); - -var _direction = __webpack_require__(38); - -var _indent = __webpack_require__(64); - -var _blockquote = __webpack_require__(65); - -var _blockquote2 = _interopRequireDefault(_blockquote); - -var _header = __webpack_require__(66); - -var _header2 = _interopRequireDefault(_header); - -var _list = __webpack_require__(67); - -var _list2 = _interopRequireDefault(_list); - -var _background = __webpack_require__(37); - -var _color = __webpack_require__(26); - -var _font = __webpack_require__(39); - -var _size = __webpack_require__(40); - -var _bold = __webpack_require__(56); - -var _bold2 = _interopRequireDefault(_bold); - -var _italic = __webpack_require__(68); - -var _italic2 = _interopRequireDefault(_italic); - -var _link = __webpack_require__(27); - -var _link2 = _interopRequireDefault(_link); - -var _script = __webpack_require__(69); - -var _script2 = _interopRequireDefault(_script); - -var _strike = __webpack_require__(70); - -var _strike2 = _interopRequireDefault(_strike); - -var _underline = __webpack_require__(71); - -var _underline2 = _interopRequireDefault(_underline); - -var _image = __webpack_require__(72); - -var _image2 = _interopRequireDefault(_image); - -var _video = __webpack_require__(73); - -var _video2 = _interopRequireDefault(_video); - -var _code = __webpack_require__(13); - -var _code2 = _interopRequireDefault(_code); - -var _formula = __webpack_require__(74); - -var _formula2 = _interopRequireDefault(_formula); - -var _syntax = __webpack_require__(75); - -var _syntax2 = _interopRequireDefault(_syntax); - -var _toolbar = __webpack_require__(57); - -var _toolbar2 = _interopRequireDefault(_toolbar); - -var _icons = __webpack_require__(41); - -var _icons2 = _interopRequireDefault(_icons); - -var _picker = __webpack_require__(28); - -var _picker2 = _interopRequireDefault(_picker); - -var _colorPicker = __webpack_require__(59); - -var _colorPicker2 = _interopRequireDefault(_colorPicker); - -var _iconPicker = __webpack_require__(60); - -var _iconPicker2 = _interopRequireDefault(_iconPicker); - -var _tooltip = __webpack_require__(61); - -var _tooltip2 = _interopRequireDefault(_tooltip); - -var _bubble = __webpack_require__(108); - -var _bubble2 = _interopRequireDefault(_bubble); - -var _snow = __webpack_require__(62); - -var _snow2 = _interopRequireDefault(_snow); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -_core2.default.register({ - 'attributors/attribute/direction': _direction.DirectionAttribute, - - 'attributors/class/align': _align.AlignClass, - 'attributors/class/background': _background.BackgroundClass, - 'attributors/class/color': _color.ColorClass, - 'attributors/class/direction': _direction.DirectionClass, - 'attributors/class/font': _font.FontClass, - 'attributors/class/size': _size.SizeClass, - - 'attributors/style/align': _align.AlignStyle, - 'attributors/style/background': _background.BackgroundStyle, - 'attributors/style/color': _color.ColorStyle, - 'attributors/style/direction': _direction.DirectionStyle, - 'attributors/style/font': _font.FontStyle, - 'attributors/style/size': _size.SizeStyle -}, true); - -_core2.default.register({ - 'formats/align': _align.AlignClass, - 'formats/direction': _direction.DirectionClass, - 'formats/indent': _indent.IndentClass, - - 'formats/background': _background.BackgroundStyle, - 'formats/color': _color.ColorStyle, - 'formats/font': _font.FontClass, - 'formats/size': _size.SizeClass, - - 'formats/blockquote': _blockquote2.default, - 'formats/code-block': _code2.default, - 'formats/header': _header2.default, - 'formats/list': _list2.default, - - 'formats/bold': _bold2.default, - 'formats/code': _code.Code, - 'formats/italic': _italic2.default, - 'formats/link': _link2.default, - 'formats/script': _script2.default, - 'formats/strike': _strike2.default, - 'formats/underline': _underline2.default, - - 'formats/image': _image2.default, - 'formats/video': _video2.default, - - 'formats/list/item': _list.ListItem, - - 'modules/formula': _formula2.default, - 'modules/syntax': _syntax2.default, - 'modules/toolbar': _toolbar2.default, - - 'themes/bubble': _bubble2.default, - 'themes/snow': _snow2.default, - - 'ui/icons': _icons2.default, - 'ui/picker': _picker2.default, - 'ui/icon-picker': _iconPicker2.default, - 'ui/color-picker': _colorPicker2.default, - 'ui/tooltip': _tooltip2.default -}, true); - -exports.default = _core2.default; - -/***/ }), -/* 64 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.IndentClass = undefined; - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var IdentAttributor = function (_Parchment$Attributor) { - _inherits(IdentAttributor, _Parchment$Attributor); - - function IdentAttributor() { - _classCallCheck(this, IdentAttributor); - - return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments)); - } - - _createClass(IdentAttributor, [{ - key: 'add', - value: function add(node, value) { - if (value === '+1' || value === '-1') { - var indent = this.value(node) || 0; - value = value === '+1' ? indent + 1 : indent - 1; - } - if (value === 0) { - this.remove(node); - return true; - } else { - return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value); - } - } - }, { - key: 'canAdd', - value: function canAdd(node, value) { - return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value)); - } - }, { - key: 'value', - value: function value(node) { - return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN - } - }]); - - return IdentAttributor; -}(_parchment2.default.Attributor.Class); - -var IndentClass = new IdentAttributor('indent', 'ql-indent', { - scope: _parchment2.default.Scope.BLOCK, - whitelist: [1, 2, 3, 4, 5, 6, 7, 8] -}); - -exports.IndentClass = IndentClass; - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _block = __webpack_require__(4); - -var _block2 = _interopRequireDefault(_block); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Blockquote = function (_Block) { - _inherits(Blockquote, _Block); - - function Blockquote() { - _classCallCheck(this, Blockquote); - - return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments)); - } - - return Blockquote; -}(_block2.default); - -Blockquote.blotName = 'blockquote'; -Blockquote.tagName = 'blockquote'; - -exports.default = Blockquote; - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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; }; }(); - -var _block = __webpack_require__(4); - -var _block2 = _interopRequireDefault(_block); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Header = function (_Block) { - _inherits(Header, _Block); - - function Header() { - _classCallCheck(this, Header); - - return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); - } - - _createClass(Header, null, [{ - key: 'formats', - value: function formats(domNode) { - return this.tagName.indexOf(domNode.tagName) + 1; - } - }]); - - return Header; -}(_block2.default); - -Header.blotName = 'header'; -Header.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6']; - -exports.default = Header; - -/***/ }), -/* 67 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.ListItem = undefined; - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _block = __webpack_require__(4); - -var _block2 = _interopRequireDefault(_block); - -var _container = __webpack_require__(25); - -var _container2 = _interopRequireDefault(_container); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -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; } - -var ListItem = function (_Block) { - _inherits(ListItem, _Block); - - function ListItem() { - _classCallCheck(this, ListItem); - - return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments)); - } - - _createClass(ListItem, [{ - key: 'format', - value: function format(name, value) { - if (name === List.blotName && !value) { - this.replaceWith(_parchment2.default.create(this.statics.scope)); - } else { - _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value); - } - } - }, { - key: 'remove', - value: function remove() { - if (this.prev == null && this.next == null) { - this.parent.remove(); - } else { - _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this); - } - } - }, { - key: 'replaceWith', - value: function replaceWith(name, value) { - this.parent.isolate(this.offset(this.parent), this.length()); - if (name === this.parent.statics.blotName) { - this.parent.replaceWith(name, value); - return this; - } else { - this.parent.unwrap(); - return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value); - } - } - }], [{ - key: 'formats', - value: function formats(domNode) { - return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode); - } - }]); - - return ListItem; -}(_block2.default); - -ListItem.blotName = 'list-item'; -ListItem.tagName = 'LI'; - -var List = function (_Container) { - _inherits(List, _Container); - - _createClass(List, null, [{ - key: 'create', - value: function create(value) { - var tagName = value === 'ordered' ? 'OL' : 'UL'; - var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName); - if (value === 'checked' || value === 'unchecked') { - node.setAttribute('data-checked', value === 'checked'); - } - return node; - } - }, { - key: 'formats', - value: function formats(domNode) { - if (domNode.tagName === 'OL') return 'ordered'; - if (domNode.tagName === 'UL') { - if (domNode.hasAttribute('data-checked')) { - return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked'; - } else { - return 'bullet'; - } - } - return undefined; - } - }]); - - function List(domNode) { - _classCallCheck(this, List); - - var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode)); - - var listEventHandler = function listEventHandler(e) { - if (e.target.parentNode !== domNode) return; - var format = _this2.statics.formats(domNode); - var blot = _parchment2.default.find(e.target); - if (format === 'checked') { - blot.format('list', 'unchecked'); - } else if (format === 'unchecked') { - blot.format('list', 'checked'); - } - }; - - domNode.addEventListener('touchstart', listEventHandler); - domNode.addEventListener('mousedown', listEventHandler); - return _this2; - } - - _createClass(List, [{ - key: 'format', - value: function format(name, value) { - if (this.children.length > 0) { - this.children.tail.format(name, value); - } - } - }, { - key: 'formats', - value: function formats() { - // We don't inherit from FormatBlot - return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode)); - } - }, { - key: 'insertBefore', - value: function insertBefore(blot, ref) { - if (blot instanceof ListItem) { - _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref); - } else { - var index = ref == null ? this.length() : ref.offset(this); - var after = this.split(index); - after.parent.insertBefore(blot, after); - } - } - }, { - key: 'optimize', - value: function optimize(context) { - _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context); - var next = this.next; - if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) { - next.moveChildren(this); - next.remove(); - } - } - }, { - key: 'replace', - value: function replace(target) { - if (target.statics.blotName !== this.statics.blotName) { - var item = _parchment2.default.create(this.statics.defaultChild); - target.moveChildren(item); - this.appendChild(item); - } - _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target); - } - }]); - - return List; -}(_container2.default); - -List.blotName = 'list'; -List.scope = _parchment2.default.Scope.BLOCK_BLOT; -List.tagName = ['OL', 'UL']; -List.defaultChild = 'list-item'; -List.allowedChildren = [ListItem]; - -exports.ListItem = ListItem; -exports.default = List; - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _bold = __webpack_require__(56); - -var _bold2 = _interopRequireDefault(_bold); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Italic = function (_Bold) { - _inherits(Italic, _Bold); - - function Italic() { - _classCallCheck(this, Italic); - - return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments)); - } - - return Italic; -}(_bold2.default); - -Italic.blotName = 'italic'; -Italic.tagName = ['EM', 'I']; - -exports.default = Italic; - -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _inline = __webpack_require__(6); - -var _inline2 = _interopRequireDefault(_inline); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Script = function (_Inline) { - _inherits(Script, _Inline); - - function Script() { - _classCallCheck(this, Script); - - return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments)); - } - - _createClass(Script, null, [{ - key: 'create', - value: function create(value) { - if (value === 'super') { - return document.createElement('sup'); - } else if (value === 'sub') { - return document.createElement('sub'); - } else { - return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value); - } - } - }, { - key: 'formats', - value: function formats(domNode) { - if (domNode.tagName === 'SUB') return 'sub'; - if (domNode.tagName === 'SUP') return 'super'; - return undefined; - } - }]); - - return Script; -}(_inline2.default); - -Script.blotName = 'script'; -Script.tagName = ['SUB', 'SUP']; - -exports.default = Script; - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _inline = __webpack_require__(6); - -var _inline2 = _interopRequireDefault(_inline); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Strike = function (_Inline) { - _inherits(Strike, _Inline); - - function Strike() { - _classCallCheck(this, Strike); - - return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments)); - } - - return Strike; -}(_inline2.default); - -Strike.blotName = 'strike'; -Strike.tagName = 'S'; - -exports.default = Strike; - -/***/ }), -/* 71 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _inline = __webpack_require__(6); - -var _inline2 = _interopRequireDefault(_inline); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var Underline = function (_Inline) { - _inherits(Underline, _Inline); - - function Underline() { - _classCallCheck(this, Underline); - - return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments)); - } - - return Underline; -}(_inline2.default); - -Underline.blotName = 'underline'; -Underline.tagName = 'U'; - -exports.default = Underline; - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _link = __webpack_require__(27); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var ATTRIBUTES = ['alt', 'height', 'width']; - -var Image = function (_Parchment$Embed) { - _inherits(Image, _Parchment$Embed); - - function Image() { - _classCallCheck(this, Image); - - return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments)); - } - - _createClass(Image, [{ - key: 'format', - value: function format(name, value) { - if (ATTRIBUTES.indexOf(name) > -1) { - if (value) { - this.domNode.setAttribute(name, value); - } else { - this.domNode.removeAttribute(name); - } - } else { - _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value); - } - } - }], [{ - key: 'create', - value: function create(value) { - var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value); - if (typeof value === 'string') { - node.setAttribute('src', this.sanitize(value)); - } - return node; - } - }, { - key: 'formats', - value: function formats(domNode) { - return ATTRIBUTES.reduce(function (formats, attribute) { - if (domNode.hasAttribute(attribute)) { - formats[attribute] = domNode.getAttribute(attribute); - } - return formats; - }, {}); - } - }, { - key: 'match', - value: function match(url) { - return (/\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url) - ); - } - }, { - key: 'sanitize', - value: function sanitize(url) { - return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0'; - } - }, { - key: 'value', - value: function value(domNode) { - return domNode.getAttribute('src'); - } - }]); - - return Image; -}(_parchment2.default.Embed); - -Image.blotName = 'image'; -Image.tagName = 'IMG'; - -exports.default = Image; - -/***/ }), -/* 73 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _block = __webpack_require__(4); - -var _link = __webpack_require__(27); - -var _link2 = _interopRequireDefault(_link); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var ATTRIBUTES = ['height', 'width']; - -var Video = function (_BlockEmbed) { - _inherits(Video, _BlockEmbed); - - function Video() { - _classCallCheck(this, Video); - - return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments)); - } - - _createClass(Video, [{ - key: 'format', - value: function format(name, value) { - if (ATTRIBUTES.indexOf(name) > -1) { - if (value) { - this.domNode.setAttribute(name, value); - } else { - this.domNode.removeAttribute(name); - } - } else { - _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value); - } - } - }], [{ - key: 'create', - value: function create(value) { - var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value); - node.setAttribute('frameborder', '0'); - node.setAttribute('allowfullscreen', true); - node.setAttribute('src', this.sanitize(value)); - return node; - } - }, { - key: 'formats', - value: function formats(domNode) { - return ATTRIBUTES.reduce(function (formats, attribute) { - if (domNode.hasAttribute(attribute)) { - formats[attribute] = domNode.getAttribute(attribute); - } - return formats; - }, {}); - } - }, { - key: 'sanitize', - value: function sanitize(url) { - return _link2.default.sanitize(url); - } - }, { - key: 'value', - value: function value(domNode) { - return domNode.getAttribute('src'); - } - }]); - - return Video; -}(_block.BlockEmbed); - -Video.blotName = 'video'; -Video.className = 'ql-video'; -Video.tagName = 'IFRAME'; - -exports.default = Video; - -/***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.FormulaBlot = undefined; - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _embed = __webpack_require__(35); - -var _embed2 = _interopRequireDefault(_embed); - -var _quill = __webpack_require__(5); - -var _quill2 = _interopRequireDefault(_quill); - -var _module = __webpack_require__(9); - -var _module2 = _interopRequireDefault(_module); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var FormulaBlot = function (_Embed) { - _inherits(FormulaBlot, _Embed); - - function FormulaBlot() { - _classCallCheck(this, FormulaBlot); - - return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments)); - } - - _createClass(FormulaBlot, null, [{ - key: 'create', - value: function create(value) { - var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value); - if (typeof value === 'string') { - window.katex.render(value, node, { - throwOnError: false, - errorColor: '#f00' - }); - node.setAttribute('data-value', value); - } - return node; - } - }, { - key: 'value', - value: function value(domNode) { - return domNode.getAttribute('data-value'); - } - }]); - - return FormulaBlot; -}(_embed2.default); - -FormulaBlot.blotName = 'formula'; -FormulaBlot.className = 'ql-formula'; -FormulaBlot.tagName = 'SPAN'; - -var Formula = function (_Module) { - _inherits(Formula, _Module); - - _createClass(Formula, null, [{ - key: 'register', - value: function register() { - _quill2.default.register(FormulaBlot, true); - } - }]); - - function Formula() { - _classCallCheck(this, Formula); - - var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this)); - - if (window.katex == null) { - throw new Error('Formula module requires KaTeX.'); - } - return _this2; - } - - return Formula; -}(_module2.default); - -exports.FormulaBlot = FormulaBlot; -exports.default = Formula; - -/***/ }), -/* 75 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.CodeToken = exports.CodeBlock = undefined; - -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; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -var _parchment = __webpack_require__(0); - -var _parchment2 = _interopRequireDefault(_parchment); - -var _quill = __webpack_require__(5); - -var _quill2 = _interopRequireDefault(_quill); - -var _module = __webpack_require__(9); - -var _module2 = _interopRequireDefault(_module); - -var _code = __webpack_require__(13); - -var _code2 = _interopRequireDefault(_code); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var SyntaxCodeBlock = function (_CodeBlock) { - _inherits(SyntaxCodeBlock, _CodeBlock); - - function SyntaxCodeBlock() { - _classCallCheck(this, SyntaxCodeBlock); - - return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments)); - } - - _createClass(SyntaxCodeBlock, [{ - key: 'replaceWith', - value: function replaceWith(block) { - this.domNode.textContent = this.domNode.textContent; - this.attach(); - _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block); - } - }, { - key: 'highlight', - value: function highlight(_highlight) { - var text = this.domNode.textContent; - if (this.cachedText !== text) { - if (text.trim().length > 0 || this.cachedText == null) { - this.domNode.innerHTML = _highlight(text); - this.domNode.normalize(); - this.attach(); - } - this.cachedText = text; - } - } - }]); - - return SyntaxCodeBlock; -}(_code2.default); - -SyntaxCodeBlock.className = 'ql-syntax'; - -var CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', { - scope: _parchment2.default.Scope.INLINE -}); - -var Syntax = function (_Module) { - _inherits(Syntax, _Module); - - _createClass(Syntax, null, [{ - key: 'register', - value: function register() { - _quill2.default.register(CodeToken, true); - _quill2.default.register(SyntaxCodeBlock, true); - } - }]); - - function Syntax(quill, options) { - _classCallCheck(this, Syntax); - - var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options)); - - if (typeof _this2.options.highlight !== 'function') { - throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.'); - } - var timer = null; - _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { - clearTimeout(timer); - timer = setTimeout(function () { - _this2.highlight(); - timer = null; - }, _this2.options.interval); - }); - _this2.highlight(); - return _this2; - } - - _createClass(Syntax, [{ - key: 'highlight', - value: function highlight() { - var _this3 = this; - - if (this.quill.selection.composing) return; - this.quill.update(_quill2.default.sources.USER); - var range = this.quill.getSelection(); - this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) { - code.highlight(_this3.options.highlight); - }); - this.quill.update(_quill2.default.sources.SILENT); - if (range != null) { - this.quill.setSelection(range, _quill2.default.sources.SILENT); - } - } - }]); - - return Syntax; -}(_module2.default); - -Syntax.DEFAULTS = { - highlight: function () { - if (window.hljs == null) return null; - return function (text) { - var result = window.hljs.highlightAuto(text); - return result.value; - }; - }(), - interval: 1000 -}; - -exports.CodeBlock = SyntaxCodeBlock; -exports.CodeToken = CodeToken; -exports.default = Syntax; - -/***/ }), -/* 76 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 77 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 78 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 79 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 80 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 81 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 82 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 83 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 84 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 85 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 86 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 87 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 88 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 89 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 90 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 91 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 92 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 93 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 94 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 95 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 96 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 97 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 98 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 99 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 100 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 101 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 102 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 103 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 104 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 105 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 106 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 107 */ -/***/ (function(module, exports) { - -module.exports = " "; - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = exports.BubbleTooltip = undefined; - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -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; }; }(); - -var _extend = __webpack_require__(3); - -var _extend2 = _interopRequireDefault(_extend); - -var _emitter = __webpack_require__(8); - -var _emitter2 = _interopRequireDefault(_emitter); - -var _base = __webpack_require__(43); - -var _base2 = _interopRequireDefault(_base); - -var _selection = __webpack_require__(15); - -var _icons = __webpack_require__(41); - -var _icons2 = _interopRequireDefault(_icons); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -var TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']]; - -var BubbleTheme = function (_BaseTheme) { - _inherits(BubbleTheme, _BaseTheme); - - function BubbleTheme(quill, options) { - _classCallCheck(this, BubbleTheme); - - if (options.modules.toolbar != null && options.modules.toolbar.container == null) { - options.modules.toolbar.container = TOOLBAR_CONFIG; - } - - var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options)); - - _this.quill.container.classList.add('ql-bubble'); - return _this; - } - - _createClass(BubbleTheme, [{ - key: 'extendToolbar', - value: function extendToolbar(toolbar) { - this.tooltip = new BubbleTooltip(this.quill, this.options.bounds); - this.tooltip.root.appendChild(toolbar.container); - this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); - this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); - } - }]); - - return BubbleTheme; -}(_base2.default); - -BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { - modules: { - toolbar: { - handlers: { - link: function link(value) { - if (!value) { - this.quill.format('link', false); - } else { - this.quill.theme.tooltip.edit(); - } - } - } - } - } -}); - -var BubbleTooltip = function (_BaseTooltip) { - _inherits(BubbleTooltip, _BaseTooltip); - - function BubbleTooltip(quill, bounds) { - _classCallCheck(this, BubbleTooltip); - - var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds)); - - _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) { - if (type !== _emitter2.default.events.SELECTION_CHANGE) return; - if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) { - _this2.show(); - // Lock our width so we will expand beyond our offsetParent boundaries - _this2.root.style.left = '0px'; - _this2.root.style.width = ''; - _this2.root.style.width = _this2.root.offsetWidth + 'px'; - var lines = _this2.quill.getLines(range.index, range.length); - if (lines.length === 1) { - _this2.position(_this2.quill.getBounds(range)); - } else { - var lastLine = lines[lines.length - 1]; - var index = _this2.quill.getIndex(lastLine); - var length = Math.min(lastLine.length() - 1, range.index + range.length - index); - var _bounds = _this2.quill.getBounds(new _selection.Range(index, length)); - _this2.position(_bounds); - } - } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) { - _this2.hide(); - } - }); - return _this2; - } - - _createClass(BubbleTooltip, [{ - key: 'listen', - value: function listen() { - var _this3 = this; - - _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this); - this.root.querySelector('.ql-close').addEventListener('click', function () { - _this3.root.classList.remove('ql-editing'); - }); - this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () { - // Let selection be restored by toolbar handlers before repositioning - setTimeout(function () { - if (_this3.root.classList.contains('ql-hidden')) return; - var range = _this3.quill.getSelection(); - if (range != null) { - _this3.position(_this3.quill.getBounds(range)); - } - }, 1); - }); - } - }, { - key: 'cancel', - value: function cancel() { - this.show(); - } - }, { - key: 'position', - value: function position(reference) { - var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference); - var arrow = this.root.querySelector('.ql-tooltip-arrow'); - arrow.style.marginLeft = ''; - if (shift === 0) return shift; - arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px'; - } - }]); - - return BubbleTooltip; -}(_base.BaseTooltip); - -BubbleTooltip.TEMPLATE = ['', '
', '', '', '
'].join(''); - -exports.BubbleTooltip = BubbleTooltip; -exports.default = BubbleTheme; - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(63); - - -/***/ }) -/******/ ])["default"]; -}); \ No newline at end of file diff --git a/public/quill/quill.min.js b/public/quill/quill.min.js deleted file mode 100644 index ff30fd90e..000000000 --- a/public/quill/quill.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * Quill Editor v1.3.6 - * https://quilljs.com/ - * Copyright (c) 2014, Jason Chen - * Copyright (c) 2013, salesforce.com - */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quill=e():t.Quill=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=45)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),o=n(18),i=n(19),l=n(48),a=n(49),s=n(50),u=n(51),c=n(52),f=n(11),h=n(29),p=n(30),d=n(28),y=n(1),v={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:r.default,Format:o.default,Leaf:i.default,Embed:u.default,Scroll:l.default,Block:s.default,Inline:a.default,Text:c.default,Attributor:{Attribute:f.default,Class:h.default,Style:p.default,Store:d.default}};e.default=v},function(t,e,n){"use strict";function r(t,e){var n=i(t);if(null==n)throw new s("Unable to create "+t+" blot");var r=n;return new r(t instanceof Node||t.nodeType===Node.TEXT_NODE?t:r.create(e),e)}function o(t,n){return void 0===n&&(n=!1),null==t?null:null!=t[e.DATA_KEY]?t[e.DATA_KEY].blot:n?o(t.parentNode,n):null}function i(t,e){void 0===e&&(e=p.ANY);var n;if("string"==typeof t)n=h[t]||u[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)n=h.text;else if("number"==typeof t)t&p.LEVEL&p.BLOCK?n=h.block:t&p.LEVEL&p.INLINE&&(n=h.inline);else if(t instanceof HTMLElement){var r=(t.getAttribute("class")||"").split(/\s+/);for(var o in r)if(n=c[r[o]])break;n=n||f[t.tagName]}return null==n?null:e&p.LEVEL&n.scope&&e&p.TYPE&n.scope?n:null}function l(){for(var t=[],e=0;e1)return t.map(function(t){return l(t)});var n=t[0];if("string"!=typeof n.blotName&&"string"!=typeof n.attrName)throw new s("Invalid definition");if("abstract"===n.blotName)throw new s("Cannot register abstract class");if(h[n.blotName||n.attrName]=n,"string"==typeof n.keyName)u[n.keyName]=n;else if(null!=n.className&&(c[n.className]=n),null!=n.tagName){Array.isArray(n.tagName)?n.tagName=n.tagName.map(function(t){return t.toUpperCase()}):n.tagName=n.tagName.toUpperCase();var r=Array.isArray(n.tagName)?n.tagName:[n.tagName];r.forEach(function(t){null!=f[t]&&null!=n.className||(f[t]=n)})}return n}var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(e){var n=this;return e="[Parchment] "+e,n=t.call(this,e)||this,n.message=e,n.name=n.constructor.name,n}return a(e,t),e}(Error);e.ParchmentError=s;var u={},c={},f={},h={};e.DATA_KEY="__blot";var p;!function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(p=e.Scope||(e.Scope={})),e.create=r,e.find=o,e.query=i,e.register=l},function(t,e){"use strict";var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===r.call(t)},i=function(t){if(!t||"[object Object]"!==r.call(t))return!1;var e=n.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!e&&!o)return!1;var i;for(i in t);return void 0===i||n.call(t,i)};t.exports=function t(){var e,n,r,l,a,s,u=arguments[0],c=1,f=arguments.length,h=!1;for("boolean"==typeof u&&(h=u,u=arguments[1]||{},c=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});c1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,f.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:a(t.parent,e))}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BlockEmbed=e.bubbleFormats=void 0;var s=function(){function t(t,e){for(var n=0;n0&&(t1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-1)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},o}}]),e}(y.default.Block);x.blotName="block",x.tagName="P",x.defaultChild="break",x.allowedChildren=[m.default,y.default.Embed,O.default],e.bubbleFormats=a,e.BlockEmbed=w,e.default=x},function(t,e,n){var r=n(54),o=n(12),i=n(2),l=n(20),a=String.fromCharCode(0),s=function(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]};s.prototype.insert=function(t,e){var n={};return 0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},s.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},s.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},s.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=i(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(o(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},s.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},s.prototype.filter=function(t){return this.ops.filter(t)},s.prototype.forEach=function(t){this.ops.forEach(t)},s.prototype.map=function(t){return this.ops.map(t)},s.prototype.partition=function(t){var e=[],n=[];return this.forEach(function(r){(t(r)?e:n).push(r)}),[e,n]},s.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},s.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+l.length(e):e.delete?t-e.delete:t},0)},s.prototype.length=function(){return this.reduce(function(t,e){return t+l.length(e)},0)},s.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],r=l.iterator(this.ops),o=0;o0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},s.prototype.diff=function(t,e){if(this.ops===t.ops)return new s;var n=[this,t].map(function(e){return e.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:a;var r=e===t?"on":"with";throw new Error("diff() called "+r+" non-document")}).join("")}),i=new s,u=r(n[0],n[1],e),c=l.iterator(this.ops),f=l.iterator(t.ops);return u.forEach(function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(f.peekLength(),e),i.push(f.next(n));break;case r.DELETE:n=Math.min(e,c.peekLength()),c.next(n),i.delete(n);break;case r.EQUAL:n=Math.min(c.peekLength(),f.peekLength(),e);var a=c.next(n),s=f.next(n);o(a.insert,s.insert)?i.retain(n,l.attributes.diff(a.attributes,s.attributes)):i.push(s).delete(n)}e-=n}}),i.chop()},s.prototype.eachLine=function(t,e){e=e||"\n";for(var n=l.iterator(this.ops),r=new s,o=0;n.hasNext();){if("insert"!==n.peekType())return;var i=n.peek(),a=l.length(i)-n.peekLength(),u="string"==typeof i.insert?i.insert.indexOf(e,a)-a:-1;if(u<0)r.push(n.next());else if(u>0)r.push(n.next(u));else{if(!1===t(r,n.next(1).attributes||{},o))return;o+=1,r=new s}}r.length()>0&&t(r,{},o)},s.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=l.iterator(this.ops),r=l.iterator(t.ops),o=new s;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())o.push(r.next());else{var i=Math.min(n.peekLength(),r.peekLength()),a=n.next(i),u=r.next(i);if(a.delete)continue;u.delete?o.push(u):o.retain(i,l.attributes.transform(a.attributes,u.attributes,e))}else o.retain(l.length(n.next()));return o.chop()},s.prototype.transformPosition=function(t,e){e=!!e;for(var n=l.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),o=e.order.indexOf(n);return r>=0||o>=0?r-o:t===n?0:t0){var a,s=[g.default.events.TEXT_CHANGE,l,i,e];if((a=this.emitter).emit.apply(a,[g.default.events.EDITOR_CHANGE].concat(s)),e!==g.default.sources.SILENT){var c;(c=this.emitter).emit.apply(c,s)}}return l}function s(t,e,n,r,o){var i={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(o=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(o=r,r=n,n=e,e=0),"object"===(void 0===n?"undefined":c(n))?(i=n,o=r):"string"==typeof n&&(null!=r?i[n]=r:o=n),o=o||g.default.sources.API,[t,e,i,o]}function u(t,e,n,r){if(null==t)return null;var o=void 0,i=void 0;if(e instanceof d.default){var l=[t.index,t.index+t.length].map(function(t){return e.transformPosition(t,r!==g.default.sources.USER)}),a=f(l,2);o=a[0],i=a[1]}else{var s=[t.index,t.index+t.length].map(function(t){return t=0?t+n:Math.max(e,t+n)}),u=f(s,2);o=u[0],i=u[1]}return new x.Range(o,i-o)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(i(this,t),this.options=l(e,r),this.container=this.options.container,null==this.container)return P.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var o=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new g.default,this.scroll=w.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new v.default(this.scroll),this.selection=new k.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(g.default.events.EDITOR_CHANGE,function(t){t===g.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(g.default.events.SCROLL_UPDATE,function(t,e){var r=n.selection.lastRange,o=r&&0===r.length?r.index:void 0;a.call(n,function(){return n.editor.update(null,e,o)},t)});var s=this.clipboard.convert("
"+o+"


");this.setContents(s),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return h(t,null,[{key:"debug",value:function(t){!0===t&&(t="log"),A.default.level(t)}},{key:"find",value:function(t){return t.__quill||w.default.find(t)}},{key:"import",value:function(t){return null==this.imports[t]&&P.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){var o=t.attrName||t.blotName;"string"==typeof o?this.register("formats/"+o,t,e):Object.keys(t).forEach(function(r){n.register(r,t[r],e)})}else null==this.imports[t]||r||P.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName?w.default.register(e):t.startsWith("modules")&&"function"==typeof e.register&&e.register()}}]),h(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){var n=t;t=document.createElement("div"),t.classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.deleteText(t,e)},n,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function(){var t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}},{key:"format",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g.default.sources.API;return a.call(this,function(){var r=n.getSelection(!0),i=new d.default;if(null==r)return i;if(w.default.query(t,w.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,o({},t,e));else{if(0===r.length)return n.selection.format(t,e),i;i=n.editor.formatText(r.index,r.length,o({},t,e))}return n.setSelection(r,g.default.sources.SILENT),i},r)}},{key:"formatLine",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatLine(t,e,l)},o,t,0)}},{key:"formatText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatText(t,e,l)},o,t,0)}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}},{key:"getIndex",value:function(t){return t.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(t){return this.scroll.leaf(t)}},{key:"getLine",value:function(t){return this.scroll.line(t)}},{key:"getLines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getText(t,e)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API;return a.call(this,function(){return o.editor.insertEmbed(e,n,r)},i,e)}},{key:"insertText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,0,n,r,o),c=f(u,4);return t=c[0],l=c[2],o=c[3],a.call(this,function(){return i.editor.insertText(t,e,l)},o,t,e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.removeFormat(t,e)},n,t)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){t=new d.default(t);var n=e.getLength(),r=e.editor.deleteText(0,n),o=e.editor.applyDelta(t),i=o.ops[o.ops.length-1];return null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),o.delete(1)),r.compose(o)},n)}},{key:"setSelection",value:function(e,n,r){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var o=s(e,n,r),i=f(o,4);e=i[0],n=i[1],r=i[3],this.selection.setRange(new x.Range(e,n),r),r!==g.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API,n=(new d.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){return t=new d.default(t),e.editor.applyDelta(t,n)},n,!0)}}]),t}();S.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},S.events=g.default.events,S.sources=g.default.sources,S.version="1.3.6",S.imports={delta:d.default,parchment:w.default,"core/module":_.default,"core/theme":T.default},e.expandConfig=l,e.overload=s,e.default=S},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),this.quill=e,this.options=n};o.DEFAULTS={},e.default=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=n(0),a=function(t){return t&&t.__esModule?t:{default:t}}(l),s=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),e}(a.default.Text);e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n1?e-1:0),r=1;r1?n-1:0),o=1;o-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=o},function(t,e,n){function r(t){return null===t||void 0===t}function o(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function i(t,e,n){var i,c;if(r(t)||r(e))return!1;if(t.prototype!==e.prototype)return!1;if(s(t))return!!s(e)&&(t=l.call(t),e=l.call(e),u(t,e,n));if(o(t)){if(!o(e))return!1;if(t.length!==e.length)return!1;for(i=0;i=0;i--)if(f[i]!=h[i])return!1;for(i=f.length-1;i>=0;i--)if(c=f[i],!u(t[c],e[c],n))return!1;return typeof t==typeof e}var l=Array.prototype.slice,a=n(55),s=n(56),u=t.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:i(t,e,n))}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function t(t,e){for(var n=0;n=t+n)){var l=this.newlineIndex(t,!0)+1,a=i-l+1,s=this.isolate(l,a),u=s.next;s.format(r,o),u instanceof e&&u.formatAt(0,t-l+n-a,r,o)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var r=this.descendant(m.default,t),o=a(r,2),i=o[0],l=o[1];i.insertAt(l,e)}}},{key:"length",value:function(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var e=this.domNode.textContent.slice(t).indexOf("\n");return e>-1?t+e:-1}},{key:"optimize",value:function(t){this.domNode.textContent.endsWith("\n")||this.appendChild(p.default.create("text","\n")),u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(t){var e=p.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof p.default.Embed?e.remove():e.unwrap()})}}],[{key:"create",value:function(t){var n=u(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}(y.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",e.Code=_,e.default=O},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1}Object.defineProperty(e,"__esModule",{value:!0}),e.sanitize=e.default=void 0;var a=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":l(Event))){var r=document.createEvent("Event");r.initEvent("change",!0,!0),this.select.dispatchEvent(r)}this.close()}}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=p},function(t,e,n){"use strict";function r(t){var e=a.find(t);if(null==e)try{e=a.create(t)}catch(n){e=a.create(a.Scope.INLINE),[].slice.call(t.childNodes).forEach(function(t){e.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(e.domNode,t),e.attach()}return e}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(47),l=n(27),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.build(),n}return o(e,t),e.prototype.appendChild=function(t){this.insertBefore(t)},e.prototype.attach=function(){t.prototype.attach.call(this),this.children.forEach(function(t){t.attach()})},e.prototype.build=function(){var t=this;this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(e){try{var n=r(e);t.insertBefore(n,t.children.head||void 0)}catch(t){if(t instanceof a.ParchmentError)return;throw t}})},e.prototype.deleteAt=function(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,function(t,e,n){t.deleteAt(e,n)})},e.prototype.descendant=function(t,n){var r=this.children.find(n),o=r[0],i=r[1];return null==t.blotName&&t(o)||null!=t.blotName&&o instanceof t?[o,i]:o instanceof e?o.descendant(t,i):[null,-1]},e.prototype.descendants=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var o=[],i=r;return this.children.forEachAt(n,r,function(n,r,l){(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&o.push(n),n instanceof e&&(o=o.concat(n.descendants(t,r,i))),i-=l}),o},e.prototype.detach=function(){this.children.forEach(function(t){t.detach()}),t.prototype.detach.call(this)},e.prototype.formatAt=function(t,e,n,r){this.children.forEachAt(t,e,function(t,e,o){t.formatAt(e,o,n,r)})},e.prototype.insertAt=function(t,e,n){var r=this.children.find(t),o=r[0],i=r[1];if(o)o.insertAt(i,e,n);else{var l=null==n?a.create("text",e):a.create(e,n);this.appendChild(l)}},e.prototype.insertBefore=function(t,e){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(e){return t instanceof e}))throw new a.ParchmentError("Cannot insert "+t.statics.blotName+" into "+this.statics.blotName);t.insertInto(this,e)},e.prototype.length=function(){return this.children.reduce(function(t,e){return t+e.length()},0)},e.prototype.moveChildren=function(t,e){this.children.forEach(function(n){t.insertBefore(n,e)})},e.prototype.optimize=function(e){if(t.prototype.optimize.call(this,e),0===this.children.length)if(null!=this.statics.defaultChild){var n=a.create(this.statics.defaultChild);this.appendChild(n),n.optimize(e)}else this.remove()},e.prototype.path=function(t,n){void 0===n&&(n=!1);var r=this.children.find(t,n),o=r[0],i=r[1],l=[[this,t]];return o instanceof e?l.concat(o.path(i,n)):(null!=o&&l.push([o,i]),l)},e.prototype.removeChild=function(t){this.children.remove(t)},e.prototype.replace=function(n){n instanceof e&&n.moveChildren(this),t.prototype.replace.call(this,n)},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(t,this.length(),function(t,r,o){t=t.split(r,e),n.appendChild(t)}),n},e.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},e.prototype.update=function(t,e){var n=this,o=[],i=[];t.forEach(function(t){t.target===n.domNode&&"childList"===t.type&&(o.push.apply(o,t.addedNodes),i.push.apply(i,t.removedNodes))}),i.forEach(function(t){if(!(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var e=a.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==n.domNode||e.detach())}}),o.filter(function(t){return t.parentNode==n.domNode}).sort(function(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(t){var e=null;null!=t.nextSibling&&(e=a.find(t.nextSibling));var o=r(t);o.next==e&&null!=o.next||(null!=o.parent&&o.parent.removeChild(n),n.insertBefore(o,e||void 0))})},e}(l.default);e.default=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(11),i=n(28),l=n(17),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.attributes=new i.default(n.domNode),n}return r(e,t),e.formats=function(t){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)},e.prototype.format=function(t,e){var n=a.query(t);n instanceof o.default?this.attributes.attribute(n,e):e&&(null==n||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e))},e.prototype.formats=function(){var t=this.attributes.values(),e=this.statics.formats(this.domNode);return null!=e&&(t[this.statics.blotName]=e),t},e.prototype.replaceWith=function(e,n){var r=t.prototype.replaceWith.call(this,e,n);return this.attributes.copy(r),r},e.prototype.update=function(e,n){var r=this;t.prototype.update.call(this,e,n),e.some(function(t){return t.target===r.domNode&&"attributes"===t.type})&&this.attributes.build()},e.prototype.wrap=function(n,r){var o=t.prototype.wrap.call(this,n,r);return o instanceof e&&o.statics.scope===this.statics.scope&&this.attributes.move(o),o},e}(l.default);e.default=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(27),i=n(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.value=function(t){return!0},e.prototype.index=function(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1},e.prototype.position=function(t,e){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){return t={},t[this.statics.blotName]=this.statics.value(this.domNode)||!0,t;var t},e.scope=i.Scope.INLINE_BLOT,e}(o.default);e.default=l},function(t,e,n){function r(t){this.ops=t,this.index=0,this.offset=0}var o=n(12),i=n(2),l={attributes:{compose:function(t,e,n){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=i(!0,{},e);n||(r=Object.keys(r).reduce(function(t,e){return null!=r[e]&&(t[e]=r[e]),t},{}));for(var o in t)void 0!==t[o]&&void 0===e[o]&&(r[o]=t[o]);return Object.keys(r).length>0?r:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce(function(n,r){return o(t[r],e[r])||(n[r]=void 0===e[r]?null:e[r]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce(function(n,r){return void 0===t[r]&&(n[r]=e[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new r(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};r.prototype.hasNext=function(){return this.peekLength()<1/0},r.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=l.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},r.prototype.peek=function(){return this.ops[this.index]},r.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},r.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.exports=l},function(t,e){var n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}function e(n,r,o,i,c){function f(n,o){if(null===n)return null;if(0===o)return n;var y,v;if("object"!=typeof n)return n;if(t(n,a))y=new a;else if(t(n,s))y=new s;else if(t(n,u))y=new u(function(t,e){n.then(function(e){t(f(e,o-1))},function(t){e(f(t,o-1))})});else if(e.__isArray(n))y=[];else if(e.__isRegExp(n))y=new RegExp(n.source,l(n)),n.lastIndex&&(y.lastIndex=n.lastIndex);else if(e.__isDate(n))y=new Date(n.getTime());else{if(d&&Buffer.isBuffer(n))return y=new Buffer(n.length),n.copy(y),y;t(n,Error)?y=Object.create(n):void 0===i?(v=Object.getPrototypeOf(n),y=Object.create(v)):(y=Object.create(i),v=i)}if(r){var b=h.indexOf(n);if(-1!=b)return p[b];h.push(n),p.push(y)}t(n,a)&&n.forEach(function(t,e){var n=f(e,o-1),r=f(t,o-1);y.set(n,r)}),t(n,s)&&n.forEach(function(t){var e=f(t,o-1);y.add(e)});for(var g in n){var m;v&&(m=Object.getOwnPropertyDescriptor(v,g)),m&&null==m.set||(y[g]=f(n[g],o-1))}if(Object.getOwnPropertySymbols)for(var _=Object.getOwnPropertySymbols(n),g=0;g<_.length;g++){var O=_[g],w=Object.getOwnPropertyDescriptor(n,O);(!w||w.enumerable||c)&&(y[O]=f(n[O],o-1),w.enumerable||Object.defineProperty(y,O,{enumerable:!1}))}if(c)for(var x=Object.getOwnPropertyNames(n),g=0;g1&&void 0!==arguments[1]?arguments[1]:0;i(this,t),this.index=e,this.length=n},O=function(){function t(e,n){var r=this;i(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=c.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){r.mouseDown||setTimeout(r.update.bind(r,v.default.sources.USER),1)}),this.emitter.on(v.default.events.EDITOR_CHANGE,function(t,e){t===v.default.events.TEXT_CHANGE&&e.length()>0&&r.update(v.default.sources.SILENT)}),this.emitter.on(v.default.events.SCROLL_BEFORE_UPDATE,function(){if(r.hasFocus()){var t=r.getNativeRange();null!=t&&t.start.node!==r.cursor.textNode&&r.emitter.once(v.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}})}}),this.emitter.on(v.default.events.SCROLL_OPTIMIZE,function(t,e){if(e.range){var n=e.range,o=n.startNode,i=n.startOffset,l=n.endNode,a=n.endOffset;r.setNativeRange(o,i,l,a)}}),this.update(v.default.sources.SILENT)}return s(t,[{key:"handleComposition",value:function(){var t=this;this.root.addEventListener("compositionstart",function(){t.composing=!0}),this.root.addEventListener("compositionend",function(){if(t.composing=!1,t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout(function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}},{key:"handleDragging",value:function(){var t=this;this.emitter.listenDOM("mousedown",document.body,function(){t.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){t.mouseDown=!1,t.update(v.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(t,e){if(null==this.scroll.whitelist||this.scroll.whitelist[t]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!c.default.query(t,c.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=c.default.find(n.start.node,!1);if(null==r)return;if(r instanceof c.default.Leaf){var o=r.split(n.start.offset);r.parent.insertBefore(this.cursor,o)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var r=void 0,o=this.scroll.leaf(t),i=a(o,2),l=i[0],s=i[1];if(null==l)return null;var u=l.position(s,!0),c=a(u,2);r=c[0],s=c[1];var f=document.createRange();if(e>0){f.setStart(r,s);var h=this.scroll.leaf(t+e),p=a(h,2);if(l=p[0],s=p[1],null==l)return null;var d=l.position(s,!0),y=a(d,2);return r=y[0],s=y[1],f.setEnd(r,s),f.getBoundingClientRect()}var v="left",b=void 0;return r instanceof Text?(s0&&(v="right")),{bottom:b.top+b.height,height:b.height,left:b[v],right:b[v],top:b.top,width:0}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;var n=this.normalizeNative(e);return m.info("getNativeRange",n),n}},{key:"getRange",value:function(){var t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(t){var e=this,n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);var r=n.map(function(t){var n=a(t,2),r=n[0],o=n[1],i=c.default.find(r,!0),l=i.offset(e.scroll);return 0===o?l:i instanceof c.default.Container?l+i.length():l+i.index(r,o)}),i=Math.min(Math.max.apply(Math,o(r)),this.scroll.length()-1),l=Math.min.apply(Math,[i].concat(o(r)));return new _(l,i-l)}},{key:"normalizeNative",value:function(t){if(!l(this.root,t.startContainer)||!t.collapsed&&!l(this.root,t.endContainer))return null;var e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(function(t){for(var e=t.node,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;e=e.lastChild,n=e instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n}),e}},{key:"rangeToNative",value:function(t){var e=this,n=t.collapsed?[t.index]:[t.index,t.index+t.length],r=[],o=this.scroll.length();return n.forEach(function(t,n){t=Math.min(o-1,t);var i=void 0,l=e.scroll.leaf(t),s=a(l,2),u=s[0],c=s[1],f=u.position(c,0!==n),h=a(f,2);i=h[0],c=h[1],r.push(i,c)}),r.length<2&&(r=r.concat(r)),r}},{key:"scrollIntoView",value:function(t){var e=this.lastRange;if(null!=e){var n=this.getBounds(e.index,e.length);if(null!=n){var r=this.scroll.length()-1,o=this.scroll.line(Math.min(e.index,r)),i=a(o,1),l=i[0],s=l;if(e.length>0){var u=this.scroll.line(Math.min(e.index+e.length,r));s=a(u,1)[0]}if(null!=l&&null!=s){var c=t.getBoundingClientRect();n.topc.bottom&&(t.scrollTop+=n.bottom-c.bottom)}}}}},{key:"setNativeRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(m.info("setNativeRange",t,e,n,r),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var i=document.getSelection();if(null!=i)if(null!=t){this.hasFocus()||this.root.focus();var l=(this.getNativeRange()||{}).native;if(null==l||o||t!==l.startContainer||e!==l.startOffset||n!==l.endContainer||r!==l.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var a=document.createRange();a.setStart(t,e),a.setEnd(n,r),i.removeAllRanges(),i.addRange(a)}}else i.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.default.sources.API;if("string"==typeof e&&(n=e,e=!1),m.info("setRange",t),null!=t){var r=this.rangeToNative(t);this.setNativeRange.apply(this,o(r).concat([e]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.default.sources.USER,e=this.lastRange,n=this.getRange(),r=a(n,2),o=r[0],i=r[1];if(this.lastRange=o,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,d.default)(e,this.lastRange)){var l;!this.composing&&null!=i&&i.native.collapsed&&i.start.node!==this.cursor.textNode&&this.cursor.restore();var s=[v.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(e),t];if((l=this.emitter).emit.apply(l,[v.default.events.EDITOR_CHANGE].concat(s)),t!==v.default.sources.SILENT){var u;(u=this.emitter).emit.apply(u,s)}}}}]),t}();e.Range=_,e.default=O},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=n(0),s=r(a),u=n(3),c=r(u),f=function(t){function e(){return o(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return l(e,t),e}(s.default.Container);f.allowedChildren=[c.default,u.BlockEmbed,f],e.default=f},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorStyle=e.ColorClass=e.ColorAttributor=void 0;var l=function(){function t(t,e){for(var n=0;n1){var u=o.formats(),c=this.quill.getFormat(t.index-1,1);i=A.default.attributes.diff(u,c)||{}}}var f=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-f,f,S.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index-f,f,i,S.default.sources.USER),this.quill.focus()}}function c(t,e){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(!(t.index>=this.quill.getLength()-n)){var r={},o=0,i=this.quill.getLine(t.index),l=b(i,1),a=l[0];if(e.offset>=a.length()-1){var s=this.quill.getLine(t.index+1),u=b(s,1),c=u[0];if(c){var f=a.formats(),h=this.quill.getFormat(t.index,1);r=A.default.attributes.diff(f,h)||{},o=c.length()}}this.quill.deleteText(t.index,n,S.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+o-1,n,r,S.default.sources.USER)}}function f(t){var e=this.quill.getLines(t),n={};if(e.length>1){var r=e[0].formats(),o=e[e.length-1].formats();n=A.default.attributes.diff(o,r)||{}}this.quill.deleteText(t,S.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,S.default.sources.USER),this.quill.setSelection(t.index,S.default.sources.SILENT),this.quill.focus()}function h(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var r=Object.keys(e.format).reduce(function(t,n){return T.default.query(n,T.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t},{});this.quill.insertText(t.index,"\n",r,S.default.sources.USER),this.quill.setSelection(t.index+1,S.default.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach(function(t){null==r[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],S.default.sources.USER))})}function p(t){return{key:D.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=T.default.query("code-block"),r=e.index,o=e.length,i=this.quill.scroll.descendant(n,r),l=b(i,2),a=l[0],s=l[1];if(null!=a){var u=this.quill.getIndex(a),c=a.newlineIndex(s,!0)+1,f=a.newlineIndex(u+s+o),h=a.domNode.textContent.slice(c,f).split("\n");s=0,h.forEach(function(e,i){t?(a.insertAt(c+s,n.TAB),s+=n.TAB.length,0===i?r+=n.TAB.length:o+=n.TAB.length):e.startsWith(n.TAB)&&(a.deleteAt(c+s,n.TAB.length),s-=n.TAB.length,0===i?r-=n.TAB.length:o-=n.TAB.length),s+=e.length+1}),this.quill.update(S.default.sources.USER),this.quill.setSelection(r,o,S.default.sources.SILENT)}}}}function d(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],S.default.sources.USER)}}}function y(t){if("string"==typeof t||"number"==typeof t)return y({key:t});if("object"===(void 0===t?"undefined":v(t))&&(t=(0,_.default)(t,!1)),"string"==typeof t.key)if(null!=D.keys[t.key.toUpperCase()])t.key=D.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[B]=t.shortKey,delete t.shortKey),t}Object.defineProperty(e,"__esModule",{value:!0}),e.SHORTKEY=e.default=void 0;var v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),g=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=y(t);if(null==r||null==r.key)return I.warn("Attempted to add invalid keyboard binding",r);"function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=(0,k.default)(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var r=n.which||n.keyCode,o=(t.bindings[r]||[]).filter(function(t){return e.match(n,t)});if(0!==o.length){var i=t.quill.getSelection();if(null!=i&&t.quill.hasFocus()){var l=t.quill.getLine(i.index),a=b(l,2),s=a[0],u=a[1],c=t.quill.getLeaf(i.index),f=b(c,2),h=f[0],p=f[1],d=0===i.length?[h,p]:t.quill.getLeaf(i.index+i.length),y=b(d,2),g=y[0],m=y[1],_=h instanceof T.default.Text?h.value().slice(0,p):"",O=g instanceof T.default.Text?g.value().slice(m):"",x={collapsed:0===i.length,empty:0===i.length&&s.length()<=1,format:t.quill.getFormat(i),offset:u,prefix:_,suffix:O};o.some(function(e){if(null!=e.collapsed&&e.collapsed!==x.collapsed)return!1;if(null!=e.empty&&e.empty!==x.empty)return!1;if(null!=e.offset&&e.offset!==x.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(function(t){return null==x.format[t]}))return!1}else if("object"===v(e.format)&&!Object.keys(e.format).every(function(t){return!0===e.format[t]?null!=x.format[t]:!1===e.format[t]?null==x.format[t]:(0,w.default)(e.format[t],x.format[t])}))return!1;return!(null!=e.prefix&&!e.prefix.test(x.prefix))&&(!(null!=e.suffix&&!e.suffix.test(x.suffix))&&!0!==e.handler.call(t,i,x))})&&n.preventDefault()}}}})}}]),e}(R.default);D.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},D.DEFAULTS={bindings:{bold:d("bold"),italic:d("italic"),underline:d("underline"),indent:{key:D.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",S.default.sources.USER)}},outdent:{key:D.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",S.default.sources.USER)}},"outdent backspace":{key:D.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",S.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,S.default.sources.USER)}},"indent code-block":p(!0),"outdent code-block":p(!1),"remove tab":{key:D.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,S.default.sources.USER)}},tab:{key:D.keys.TAB,handler:function(t){this.quill.history.cutoff();var e=(new N.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,S.default.sources.SILENT)}},"list empty enter":{key:D.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,S.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,S.default.sources.USER)}},"checklist enter":{key:D.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){var e=this.quill.getLine(t.index),n=b(e,2),r=n[0],o=n[1],i=(0,k.default)({},r.formats(),{list:"checked"}),l=(new N.default).retain(t.index).insert("\n",i).retain(r.length()-o-1).retain(1,{list:"unchecked"});this.quill.updateContents(l,S.default.sources.USER),this.quill.setSelection(t.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:D.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){var n=this.quill.getLine(t.index),r=b(n,2),o=r[0],i=r[1],l=(new N.default).retain(t.index).insert("\n",e.format).retain(o.length()-i-1).retain(1,{header:null});this.quill.updateContents(l,S.default.sources.USER),this.quill.setSelection(t.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){var n=e.prefix.length,r=this.quill.getLine(t.index),o=b(r,2),i=o[0],l=o[1];if(l>n)return!0;var a=void 0;switch(e.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(t.index," ",S.default.sources.USER),this.quill.history.cutoff();var s=(new N.default).retain(t.index-l).delete(n+1).retain(i.length()-2-l).retain(1,{list:a});this.quill.updateContents(s,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,S.default.sources.SILENT)}},"code exit":{key:D.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){var e=this.quill.getLine(t.index),n=b(e,2),r=n[0],o=n[1],i=(new N.default).retain(t.index+r.length()-o-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(i,S.default.sources.USER)}},"embed left":s(D.keys.LEFT,!1),"embed left shift":s(D.keys.LEFT,!0),"embed right":s(D.keys.RIGHT,!1),"embed right shift":s(D.keys.RIGHT,!0)}},e.default=D,e.SHORTKEY=B},function(t,e,n){"use strict";t.exports={align:{"":n(75),center:n(76),right:n(77),justify:n(78)},background:n(79),blockquote:n(80),bold:n(81),clean:n(82),code:n(40),"code-block":n(40),color:n(83),direction:{"":n(84),rtl:n(85)},float:{center:n(86),full:n(87),left:n(88),right:n(89)},formula:n(90),header:{1:n(91),2:n(92)},italic:n(93),image:n(94),indent:{"+1":n(95),"-1":n(96)},link:n(97),list:{ordered:n(98),bullet:n(99),check:n(100)},script:{sub:n(101),super:n(102)},strike:n(103),underline:n(104),video:n(105)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=function(){function t(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,o){var i=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&o)i.wrap(n,o);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var l=r.create(this.statics.scope);i.wrap(l),l.format(n,o)}},t.prototype.insertAt=function(t,e,n){var o=null==n?r.create("text",e):r.create(e,n),i=this.split(t);this.parent.insertBefore(o,i)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),o=n(29),i=n(30),l=n(1),a=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=o.default.keys(this.domNode),a=i.default.keys(this.domNode);e.concat(n).concat(a).forEach(function(e){var n=l.query(e,l.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)})},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach(function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)})},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach(function(t){e.attributes[t].remove(e.domNode)}),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce(function(e,n){return e[n]=t.attributes[n].value(t.domNode),e},{})},t}();e.default=a},function(t,e,n){"use strict";function r(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(function(t){return 0===t.indexOf(e+"-")})}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){r(t,this.keyName).forEach(function(e){t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=r(t,this.keyName)[0]||"",n=e.slice(this.keyName.length+1);return this.canAdd(t,n)?n:""},e}(i.default);e.default=l},function(t,e,n){"use strict";function r(t){var e=t.split("-"),n=e.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return e[0]+n}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map(function(t){return t.split(":")[0].trim()})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[r(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[r(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[r(this.keyName)];return this.canAdd(t,e)?e:""},e}(i.default);e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},u=function(){function t(t,e){for(var n=0;n '},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;nr.right&&(i=r.right-o.right,this.root.style.left=e+i+"px"),o.leftr.bottom){var l=o.bottom-o.top,a=t.bottom-t.top+l;this.root.style.top=n-a+"px",this.root.classList.add("ql-flip")}return i}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),t}();e.default=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?(e[1]||"https")+"://www.youtube.com/embed/"+e[2]+"?showinfo=0":(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(e[1]||"https")+"://player.vimeo.com/video/"+e[2]+"/":t}function s(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(function(e){var r=document.createElement("option");e===n?r.setAttribute("selected","selected"):r.setAttribute("value",e),t.appendChild(r)})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var u=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,v.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,v.default.sources.USER)),this.quill.root.scrollTop=e;break;case"video":t=a(t);case"formula":if(!t)break;var n=this.quill.getSelection(!0);if(null!=n){var r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,v.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(r+1," ",v.default.sources.USER),this.quill.setSelection(r+2,v.default.sources.USER)}}this.textbox.value="",this.hide()}}]),e}(A.default);e.BaseTooltip=M,e.default=L},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(46),i=r(o),l=n(34),a=n(36),s=n(62),u=n(63),c=r(u),f=n(64),h=r(f),p=n(65),d=r(p),y=n(35),v=n(24),b=n(37),g=n(38),m=n(39),_=r(m),O=n(66),w=r(O),x=n(15),k=r(x),E=n(67),N=r(E),j=n(68),A=r(j),q=n(69),T=r(q),P=n(70),S=r(P),C=n(71),L=r(C),M=n(13),R=r(M),I=n(72),B=r(I),D=n(73),U=r(D),F=n(74),H=r(F),K=n(26),z=r(K),Z=n(16),V=r(Z),W=n(41),G=r(W),Y=n(42),X=r(Y),$=n(43),Q=r($),J=n(107),tt=r(J),et=n(108),nt=r(et);i.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":y.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":b.FontClass,"attributors/class/size":g.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":y.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":b.FontStyle,"attributors/style/size":g.SizeStyle},!0),i.default.register({"formats/align":l.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":s.IndentClass,"formats/background":y.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":b.FontClass,"formats/size":g.SizeClass,"formats/blockquote":c.default,"formats/code-block":R.default,"formats/header":h.default,"formats/list":d.default,"formats/bold":_.default,"formats/code":M.Code,"formats/italic":w.default,"formats/link":k.default,"formats/script":N.default,"formats/strike":A.default,"formats/underline":T.default,"formats/image":S.default,"formats/video":L.default,"formats/list/item":p.ListItem,"modules/formula":B.default,"modules/syntax":U.default,"modules/toolbar":H.default,"themes/bubble":tt.default,"themes/snow":nt.default,"ui/icons":z.default,"ui/picker":V.default,"ui/icon-picker":X.default,"ui/color-picker":G.default,"ui/tooltip":Q.default},!0),e.default=i.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=r(o),l=n(6),a=r(l),s=n(3),u=r(s),c=n(14),f=r(c),h=n(23),p=r(h),d=n(31),y=r(d),v=n(33),b=r(v),g=n(5),m=r(g),_=n(59),O=r(_),w=n(8),x=r(w),k=n(60),E=r(k),N=n(61),j=r(N),A=n(25),q=r(A);a.default.register({"blots/block":u.default,"blots/block/embed":s.BlockEmbed,"blots/break":f.default,"blots/container":p.default,"blots/cursor":y.default,"blots/embed":b.default,"blots/inline":m.default,"blots/scroll":O.default,"blots/text":x.default,"modules/clipboard":E.default,"modules/history":j.default,"modules/keyboard":q.default}),i.default.register(u.default,f.default,y.default,m.default,O.default,x.default),e.default=a.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var o=n.length();if(ta?n(r,t-a,Math.min(e,a+u-t)):n(r,0,Math.min(u,t+e-a)),a+=u}},t.prototype.map=function(t){return this.reduce(function(e,n){return e.push(t(n)),e},[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(17),i=n(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},a=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver(function(t){n.update(t)}),n.observer.observe(n.domNode,l),n.attach(),n}return r(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach(function(t){t.remove()}):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,o){this.update(),t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var l=[].slice.call(this.observer.takeRecords());l.length>0;)e.push(l.pop());for(var a=function(t,e){void 0===e&&(e=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[i.DATA_KEY].mutations&&(t.domNode[i.DATA_KEY].mutations=[]),e&&a(t.parent))},s=function(t){null!=t.domNode[i.DATA_KEY]&&null!=t.domNode[i.DATA_KEY].mutations&&(t instanceof o.default&&t.children.forEach(s),t.optimize(n))},u=e,c=0;u.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(function(t){var e=i.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(a(i.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,function(t){var e=i.find(t,!1);a(e,!1),e instanceof o.default&&e.children.forEach(function(t){a(t,!1)})})):"attributes"===t.type&&a(e.prev)),a(e))}),this.children.forEach(s),u=[].slice.call(this.observer.takeRecords()),l=u.slice();l.length>0;)e.push(l.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),e=e||this.observer.takeRecords(),e.map(function(t){var e=i.find(t.target,!0);return null==e?null:null==e.domNode[i.DATA_KEY].mutations?(e.domNode[i.DATA_KEY].mutations=[t],e):(e.domNode[i.DATA_KEY].mutations.push(t),null)}).forEach(function(t){null!=t&&t!==r&&null!=t.domNode[i.DATA_KEY]&&t.update(t.domNode[i.DATA_KEY].mutations||[],n)}),null!=this.domNode[i.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[i.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="DIV",e}(o.default);e.default=a},function(t,e,n){"use strict";function r(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),l=n(1),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach(function(t){t instanceof i.default||(t=t.wrap(e.blotName,!0)),o.attributes.copy(t)}),this.unwrap())},e.prototype.formatAt=function(e,n,r,o){if(null!=this.formats()[r]||l.query(r,l.Scope.ATTRIBUTE)){this.isolate(e,n).format(r,o)}else t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var o=this.formats();if(0===Object.keys(o).length)return this.unwrap();var i=this.next;i instanceof e&&i.prev===this&&r(o,i.formats())&&(i.moveChildren(this),i.remove())},e.blotName="inline",e.scope=l.Scope.INLINE_BLOT,e.tagName="SPAN",e}(i.default);e.default=a},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(18),i=n(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(n){var r=i.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=i.query(n,i.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,o){null!=i.query(r,i.Scope.BLOCK)?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=i.query(n,i.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var o=this.split(e),l=i.create(n,r);o.parent.insertBefore(l,o)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="P",e}(o.default);e.default=l},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,o){0===e&&n===this.length()?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(o.default);e.default=i},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),i=n(1),l=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return r(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=i.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some(function(t){return"characterData"===t.type&&t.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=i.Scope.INLINE_BLOT,e}(o.default);e.default=l},function(t,e,n){"use strict";var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return arguments.length>1&&!this.contains(t)==!e?e:o.call(this,t)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),r=n.length>>>0,o=arguments[1],i=0;ie.length?t:e,l=t.length>e.length?e:t,a=i.indexOf(l);if(-1!=a)return r=[[y,i.substring(0,a)],[v,l],[y,i.substring(a+l.length)]],t.length>e.length&&(r[0][0]=r[2][0]=d),r;if(1==l.length)return[[d,t],[y,e]];var u=s(t,e);if(u){var c=u[0],f=u[1],h=u[2],p=u[3],b=u[4],g=n(c,h),m=n(f,p);return g.concat([[v,b]],m)}return o(t,e)}function o(t,e){for(var n=t.length,r=e.length,o=Math.ceil((n+r)/2),l=o,a=2*o,s=new Array(a),u=new Array(a),c=0;cn)v+=2;else if(x>r)p+=2;else if(h){var k=l+f-_;if(k>=0&&k=E)return i(t,e,O,x)}}}for(var N=-m+b;N<=m-g;N+=2){var E,k=l+N;E=N==-m||N!=m&&u[k-1]n)g+=2;else if(j>r)b+=2;else if(!h){var w=l+f-N;if(w>=0&&w=E)return i(t,e,O,x)}}}}return[[d,t],[y,e]]}function i(t,e,r,o){var i=t.substring(0,r),l=e.substring(0,o),a=t.substring(r),s=e.substring(o),u=n(i,l),c=n(a,s);return u.concat(c)}function l(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n=t.length?[r,o,i,s,f]:null}var r=t.length>e.length?t:e,o=t.length>e.length?e:t;if(r.length<4||2*o.lengthu[4].length?s:u:s;var c,f,h,p;return t.length>e.length?(c=i[0],f=i[1],h=i[2],p=i[3]):(h=i[0],p=i[1],c=i[2],f=i[3]),[c,f,h,p,i[4]]}function u(t){t.push([v,""]);for(var e,n=0,r=0,o=0,i="",s="";n1?(0!==r&&0!==o&&(e=l(s,i),0!==e&&(n-r-o>0&&t[n-r-o-1][0]==v?t[n-r-o-1][1]+=s.substring(0,e):(t.splice(0,0,[v,s.substring(0,e)]),n++),s=s.substring(e),i=i.substring(e)),0!==(e=a(s,i))&&(t[n][1]=s.substring(s.length-e)+t[n][1],s=s.substring(0,s.length-e),i=i.substring(0,i.length-e))),0===r?t.splice(n-o,r+o,[y,s]):0===o?t.splice(n-r,r+o,[d,i]):t.splice(n-r-o,r+o,[d,i],[y,s]),n=n-r-o+(r?1:0)+(o?1:0)+1):0!==n&&t[n-1][0]==v?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,o=0,r=0,i="",s=""}""===t[t.length-1][1]&&t.pop();var c=!1;for(n=1;n0&&r.splice(o+2,0,[l[0],a]),p(r,o,3)}return t}function h(t){for(var e=!1,n=function(t){return t.charCodeAt(0)>=56320&&t.charCodeAt(0)<=57343},r=2;r=55296&&t.charCodeAt(t.length-1)<=56319}(t[r-2][1])&&t[r-1][0]===d&&n(t[r-1][1])&&t[r][0]===y&&n(t[r][1])&&(e=!0,t[r-1][1]=t[r-2][1].slice(-1)+t[r-1][1],t[r][1]=t[r-2][1].slice(-1)+t[r][1],t[r-2][1]=t[r-2][1].slice(0,-1));if(!e)return t;for(var o=[],r=0;r0&&o.push(t[r]);return o}function p(t,e,n){for(var r=e+n-1;r>=0&&r>=e-1;r--)if(r+1=r&&!a.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,a);var c=e.scroll.line(t),f=u(c,2),h=f[0],p=f[1],y=(0,T.default)({},(0,O.bubbleFormats)(h));if(h instanceof w.default){var b=h.descendant(v.default.Leaf,p),g=u(b,1),m=g[0];y=(0,T.default)(y,(0,O.bubbleFormats)(m))}l=d.default.attributes.diff(y,l)||{}}else if("object"===s(o.insert)){var _=Object.keys(o.insert)[0];if(null==_)return t;e.scroll.insertAt(t,_,o.insert[_])}r+=i}return Object.keys(l).forEach(function(n){e.scroll.formatAt(t,i,n,l[n])}),t+i},0),t.reduce(function(t,n){return"number"==typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new h.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(o){if(null==n.scroll.whitelist||n.scroll.whitelist[o]){var i=n.scroll.lines(t,Math.max(e,1)),l=e;i.forEach(function(e){var i=e.length();if(e instanceof g.default){var a=t-e.offset(n.scroll),s=e.newlineIndex(a+l)-a+1;e.formatAt(a,s,o,r[o])}else e.format(o,r[o]);l-=i})}}),this.scroll.optimize(),this.update((new h.default).retain(t).retain(e,(0,N.default)(r)))}},{key:"formatText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e,o,r[o])}),this.update((new h.default).retain(t).retain(e,(0,N.default)(r)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(t,e){return t.concat(e.delta())},new h.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===e?this.scroll.path(t).forEach(function(t){var e=u(t,1),o=e[0];o instanceof w.default?n.push(o):o instanceof v.default.Leaf&&r.push(o)}):(n=this.scroll.lines(t,e),r=this.scroll.descendants(v.default.Leaf,t,e));var o=[n,r].map(function(t){if(0===t.length)return{};for(var e=(0,O.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=l((0,O.bubbleFormats)(n),e)}return e});return T.default.apply(T.default,o)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter(function(t){return"string"==typeof t.insert}).map(function(t){return t.insert}).join("")}},{key:"insertEmbed",value:function(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new h.default).retain(t).insert(o({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e.length,o,r[o])}),this.update((new h.default).retain(t).insert(e,(0,N.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.statics.blotName===w.default.blotName&&(!(t.children.length>1)&&t.children.head instanceof k.default)}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),r=this.scroll.line(t+e),o=u(r,2),i=o[0],l=o[1],a=0,s=new h.default;null!=i&&(a=i instanceof g.default?i.newlineIndex(l)-l+1:i.length()-l,s=i.delta().slice(l,l+a-1).insert("\n"));var c=this.getContents(t,e+a),f=c.diff((new h.default).insert(n).concat(s)),p=(new h.default).retain(t).concat(f);return this.applyDelta(p)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(P)&&v.default.find(e[0].target)){var o=v.default.find(e[0].target),i=(0,O.bubbleFormats)(o),l=o.offset(this.scroll),a=e[0].oldValue.replace(_.default.CONTENTS,""),s=(new h.default).insert(a),u=(new h.default).insert(o.value());t=(new h.default).retain(l).concat(s.diff(u,n)).reduce(function(t,e){return e.insert?t.insert(e.insert,i):t.push(e)},new h.default),this.delta=r.compose(t)}else this.delta=this.getDelta(),t&&(0,A.default)(r.compose(t),this.delta)||(t=r.diff(this.delta,n));return t}}]),t}();e.default=S},function(t,e){"use strict";function n(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(){this._events=new n,this._eventsCount=0}var i=Object.prototype.hasOwnProperty,l="~";Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(l=!1)),o.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(l?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t,e){var n=l?l+t:t,r=this._events[n];if(e)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o0){if(i instanceof y.BlockEmbed||f instanceof y.BlockEmbed)return void this.optimize();if(i instanceof _.default){var h=i.newlineIndex(i.length(),!0);if(h>-1&&(i=i.split(h+1))===f)return void this.optimize()}else if(f instanceof _.default){var p=f.newlineIndex(0);p>-1&&f.split(p+1)}var d=f.children.head instanceof g.default?null:f.children.head;i.moveChildren(f,d),i.remove()}this.optimize()}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function(t,n,r,o){(null==this.whitelist||this.whitelist[r])&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,o),this.optimize())}},{key:"insertAt",value:function(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==h.default.query(n,h.default.Scope.BLOCK)){var o=h.default.create(this.statics.defaultChild);this.appendChild(o),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),o.insertAt(0,n,r)}else{var i=h.default.create(n,r);this.appendChild(i)}else c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===h.default.Scope.INLINE_BLOT){var r=h.default.create(this.statics.defaultChild);r.appendChild(t),t=r}c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(a,t)}},{key:"lines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return function t(e,n,r){var o=[],i=r;return e.children.forEachAt(n,r,function(e,n,r){a(e)?o.push(e):e instanceof h.default.Container&&(o=o.concat(t(e,n,i))),i-=r}),o}(this,t,e)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t,n),t.length>0&&this.emitter.emit(d.default.events.SCROLL_OPTIMIZE,t,n))}},{key:"path",value:function(t){return c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(!0!==this.batch){var n=d.default.sources.USER;"string"==typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(d.default.events.SCROLL_BEFORE_UPDATE,n,t),c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(d.default.events.SCROLL_UPDATE,n,t)}}}]),e}(h.default.Scroll);x.blotName="scroll",x.className="ql-editor",x.tagName="DIV",x.defaultChild="block",x.allowedChildren=[v.default,y.BlockEmbed,w.default],e.default=x},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e,n){return"object"===(void 0===e?"undefined":x(e))?Object.keys(e).reduce(function(t,n){return s(t,n,e[n])},t):t.reduce(function(t,r){return r.attributes&&r.attributes[e]?t.push(r):t.insert(r.insert,(0,j.default)({},o({},e,n),r.attributes))},new q.default)}function u(t){if(t.nodeType!==Node.ELEMENT_NODE)return{};return t["__ql-computed-style"]||(t["__ql-computed-style"]=window.getComputedStyle(t))}function c(t,e){for(var n="",r=t.ops.length-1;r>=0&&n.length-1}function h(t,e,n){return t.nodeType===t.TEXT_NODE?n.reduce(function(e,n){return n(t,e)},new q.default):t.nodeType===t.ELEMENT_NODE?[].reduce.call(t.childNodes||[],function(r,o){var i=h(o,e,n);return o.nodeType===t.ELEMENT_NODE&&(i=e.reduce(function(t,e){return e(o,t)},i),i=(o[W]||[]).reduce(function(t,e){return e(o,t)},i)),r.concat(i)},new q.default):new q.default}function p(t,e,n){return s(n,t,!0)}function d(t,e){var n=P.default.Attributor.Attribute.keys(t),r=P.default.Attributor.Class.keys(t),o=P.default.Attributor.Style.keys(t),i={};return n.concat(r).concat(o).forEach(function(e){var n=P.default.query(e,P.default.Scope.ATTRIBUTE);null!=n&&(i[n.attrName]=n.value(t),i[n.attrName])||(n=Y[e],null==n||n.attrName!==e&&n.keyName!==e||(i[n.attrName]=n.value(t)||void 0),null==(n=X[e])||n.attrName!==e&&n.keyName!==e||(n=X[e],i[n.attrName]=n.value(t)||void 0))}),Object.keys(i).length>0&&(e=s(e,i)),e}function y(t,e){var n=P.default.query(t);if(null==n)return e;if(n.prototype instanceof P.default.Embed){var r={},o=n.value(t);null!=o&&(r[n.blotName]=o,e=(new q.default).insert(r,n.formats(t)))}else"function"==typeof n.formats&&(e=s(e,n.blotName,n.formats(t)));return e}function v(t,e){return c(e,"\n")||e.insert("\n"),e}function b(){return new q.default}function g(t,e){var n=P.default.query(t);if(null==n||"list-item"!==n.blotName||!c(e,"\n"))return e;for(var r=-1,o=t.parentNode;!o.classList.contains("ql-clipboard");)"list"===(P.default.query(o)||{}).blotName&&(r+=1),o=o.parentNode;return r<=0?e:e.compose((new q.default).retain(e.length()-1).retain(1,{indent:r}))}function m(t,e){return c(e,"\n")||(f(t)||e.length()>0&&t.nextSibling&&f(t.nextSibling))&&e.insert("\n"),e}function _(t,e){if(f(t)&&null!=t.nextElementSibling&&!c(e,"\n\n")){var n=t.offsetHeight+parseFloat(u(t).marginTop)+parseFloat(u(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function O(t,e){var n={},r=t.style||{};return r.fontStyle&&"italic"===u(t).fontStyle&&(n.italic=!0),r.fontWeight&&(u(t).fontWeight.startsWith("bold")||parseInt(u(t).fontWeight)>=700)&&(n.bold=!0),Object.keys(n).length>0&&(e=s(e,n)),parseFloat(r.textIndent||0)>0&&(e=(new q.default).insert("\t").concat(e)),e}function w(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!u(t.parentNode).whiteSpace.startsWith("pre")){var r=function(t,e){return e=e.replace(/[^\u00a0]/g,""),e.length<1&&t?" ":e};n=n.replace(/\r\n/g," ").replace(/\n/g," "),n=n.replace(/\s\s+/g,r.bind(r,!0)),(null==t.previousSibling&&f(t.parentNode)||null!=t.previousSibling&&f(t.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==t.nextSibling&&f(t.parentNode)||null!=t.nextSibling&&f(t.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return e.insert(n)}Object.defineProperty(e,"__esModule",{value:!0}),e.matchText=e.matchSpacing=e.matchNewline=e.matchBlot=e.matchAttributor=e.default=void 0;var x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),E=function(){function t(t,e){for(var n=0;n\r?\n +\<"),this.convert();var e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[F.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new q.default).insert(n,o({},F.default.blotName,e[F.default.blotName]))}var r=this.prepareMatching(),i=k(r,2),l=i[0],a=i[1],s=h(this.container,l,a);return c(s,"\n")&&null==s.ops[s.ops.length-1].attributes&&(s=s.compose((new q.default).retain(s.length()-1).delete(1))),V.log("convert",this.container.innerHTML,s),this.container.innerHTML="",s}},{key:"dangerouslyPasteHTML",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C.default.sources.API;if("string"==typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,C.default.sources.SILENT);else{var r=this.convert(e);this.quill.updateContents((new q.default).retain(t).concat(r),n),this.quill.setSelection(t+r.length(),C.default.sources.SILENT)}}},{key:"onPaste",value:function(t){var e=this;if(!t.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new q.default).retain(n.index),o=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(C.default.sources.SILENT),setTimeout(function(){r=r.concat(e.convert()).delete(n.length),e.quill.updateContents(r,C.default.sources.USER),e.quill.setSelection(r.length()-n.length,C.default.sources.SILENT),e.quill.scrollingContainer.scrollTop=o,e.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var t=this,e=[],n=[];return this.matchers.forEach(function(r){var o=k(r,2),i=o[0],l=o[1];switch(i){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:e.push(l);break;default:[].forEach.call(t.container.querySelectorAll(i),function(t){t[W]=t[W]||[],t[W].push(l)})}}),[e,n]}}]),e}(I.default);$.DEFAULTS={matchers:[],matchVisual:!0},e.default=$,e.matchAttributor=d,e.matchBlot=y,e.matchNewline=m,e.matchSpacing=_,e.matchText=w},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=t.ops[t.ops.length-1];return null!=e&&(null!=e.insert?"string"==typeof e.insert&&e.insert.endsWith("\n"):null!=e.attributes&&Object.keys(e.attributes).some(function(t){return null!=f.default.query(t,f.default.Scope.BLOCK)}))}function s(t){var e=t.reduce(function(t,e){return t+=e.delete||0},0),n=t.length()-e;return a(t)&&(n-=1),n}Object.defineProperty(e,"__esModule",{value:!0}),e.getLastChangeIndex=e.default=void 0;var u=function(){function t(t,e){for(var n=0;nr&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo),t=o.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}),this.stack.redo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}(y.default);v.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=v,e.getLastChangeIndex=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var l=function(){function t(t,e){for(var n=0;n0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return o({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(t,n){if(t instanceof v)u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var r=null==n?this.length():n.offset(this),o=this.split(r);o.parent.insertBefore(t,o)}}},{key:"optimize",value:function(t){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=f.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}]),e}(y.default);b.blotName="list",b.scope=f.default.Scope.BLOCK_BLOT,b.tagName=["OL","UL"],b.defaultChild="list-item",b.allowedChildren=[v],e.ListItem=v,e.default=b},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=n(39),a=function(t){return t&&t.__esModule?t:{default:t}}(l),s=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),e}(a.default);s.blotName="italic",s.tagName=["EM","I"],e.default=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=a(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,c.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(u.default.Embed);h.blotName="image",h.tagName="IMG",e.default=h},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=a(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"sanitize",value:function(t){return c.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(s.BlockEmbed);h.blotName="video",h.className="ql-video",h.tagName="IFRAME",e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var a=function(){function t(t,e){for(var n=0;n0||null==this.cachedText)&&(this.domNode.innerHTML=t(e),this.domNode.normalize(),this.attach()),this.cachedText=e)}}]),e}(v.default);b.className="ql-syntax";var g=new c.default.Attributor.Class("token","hljs",{scope:c.default.Scope.INLINE}),m=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!=typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var l=null;return r.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(l),l=setTimeout(function(){r.highlight(),l=null},r.options.interval)}),r.highlight(),r}return l(e,t),a(e,null,[{key:"register",value:function(){h.default.register(g,!0),h.default.register(b,!0)}}]),a(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var e=this.quill.getSelection();this.quill.scroll.descendants(b).forEach(function(e){e.highlight(t.options.highlight)}),this.quill.update(h.default.sources.SILENT),null!=e&&this.quill.setSelection(e,h.default.sources.SILENT)}}}]),e}(d.default);m.DEFAULTS={highlight:function(){return null==window.hljs?null:function(t){return window.hljs.highlightAuto(t).value}}(),interval:1e3},e.CodeBlock=b,e.CodeToken=g,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e,n){var r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("ql-"+e),null!=n&&(r.value=n),t.appendChild(r)}function u(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(function(e){var n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(function(t){if("string"==typeof t)s(n,t);else{var e=Object.keys(t)[0],r=t[e];Array.isArray(r)?c(n,e,r):s(n,e,r)}}),t.appendChild(n)})}function c(t,e,n){var r=document.createElement("select");r.classList.add("ql-"+e),n.forEach(function(t){var e=document.createElement("option");!1!==t?e.setAttribute("value",t):e.setAttribute("selected","selected"),r.appendChild(e)}),t.appendChild(r)}Object.defineProperty(e,"__esModule",{value:!0}),e.addControls=e.default=void 0;var f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var n=0;n '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;var a=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},s=function(){function t(t,e){for(var n=0;n0&&o===h.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var i=r.quill.getLines(e.index,e.length);if(1===i.length)r.position(r.quill.getBounds(e));else{var l=i[i.length-1],a=r.quill.getIndex(l),s=Math.min(l.length()-1,e.index+e.length-a),u=r.quill.getBounds(new y.Range(a,s));r.position(u)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}),r}return l(e,t),s(e,[{key:"listen",value:function(){var t=this;a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){t.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),r=this.root.querySelector(".ql-tooltip-arrow");if(r.style.marginLeft="",0===n)return n;r.style.marginLeft=-1*n-r.offsetWidth/2+"px"}}]),e}(p.BaseTooltip);_.TEMPLATE=['','
','','',"
"].join(""),e.BubbleTooltip=_,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},u=function(){function t(t,e){for(var n=0;n','','',''].join(""),e.default=w}]).default}); -//# sourceMappingURL=quill.min.js.map \ No newline at end of file diff --git a/public/quill/quill.snow.css b/public/quill/quill.snow.css deleted file mode 100644 index 70fc3eab7..000000000 --- a/public/quill/quill.snow.css +++ /dev/null @@ -1,945 +0,0 @@ -/*! - * Quill Editor v1.3.6 - * https://quilljs.com/ - * Copyright (c) 2014, Jason Chen - * Copyright (c) 2013, salesforce.com - */ -.ql-container { - box-sizing: border-box; - font-family: Helvetica, Arial, sans-serif; - font-size: 13px; - height: 100%; - margin: 0px; - position: relative; -} -.ql-container.ql-disabled .ql-tooltip { - visibility: hidden; -} -.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { - pointer-events: none; -} -.ql-clipboard { - left: -100000px; - height: 1px; - overflow-y: hidden; - position: absolute; - top: 50%; -} -.ql-clipboard p { - margin: 0; - padding: 0; -} -.ql-editor { - box-sizing: border-box; - line-height: 1.42; - height: 100%; - outline: none; - overflow-y: auto; - padding: 12px 15px; - tab-size: 4; - -moz-tab-size: 4; - text-align: left; - white-space: pre-wrap; - word-wrap: break-word; -} -.ql-editor > * { - cursor: text; -} -.ql-editor p, -.ql-editor ol, -.ql-editor ul, -.ql-editor pre, -.ql-editor blockquote, -.ql-editor h1, -.ql-editor h2, -.ql-editor h3, -.ql-editor h4, -.ql-editor h5, -.ql-editor h6 { - margin: 0; - padding: 0; - counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; -} -.ql-editor ol, -.ql-editor ul { - padding-left: 1.5em; -} -.ql-editor ol > li, -.ql-editor ul > li { - list-style-type: none; -} -.ql-editor ul > li::before { - content: '\2022'; -} -.ql-editor ul[data-checked=true], -.ql-editor ul[data-checked=false] { - pointer-events: none; -} -.ql-editor ul[data-checked=true] > li *, -.ql-editor ul[data-checked=false] > li * { - pointer-events: all; -} -.ql-editor ul[data-checked=true] > li::before, -.ql-editor ul[data-checked=false] > li::before { - color: #777; - cursor: pointer; - pointer-events: all; -} -.ql-editor ul[data-checked=true] > li::before { - content: '\2611'; -} -.ql-editor ul[data-checked=false] > li::before { - content: '\2610'; -} -.ql-editor li::before { - display: inline-block; - white-space: nowrap; - width: 1.2em; -} -.ql-editor li:not(.ql-direction-rtl)::before { - margin-left: -1.5em; - margin-right: 0.3em; - text-align: right; -} -.ql-editor li.ql-direction-rtl::before { - margin-left: 0.3em; - margin-right: -1.5em; -} -.ql-editor ol li:not(.ql-direction-rtl), -.ql-editor ul li:not(.ql-direction-rtl) { - padding-left: 1.5em; -} -.ql-editor ol li.ql-direction-rtl, -.ql-editor ul li.ql-direction-rtl { - padding-right: 1.5em; -} -.ql-editor ol li { - counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; - counter-increment: list-0; -} -.ql-editor ol li:before { - content: counter(list-0, decimal) '. '; -} -.ql-editor ol li.ql-indent-1 { - counter-increment: list-1; -} -.ql-editor ol li.ql-indent-1:before { - content: counter(list-1, lower-alpha) '. '; -} -.ql-editor ol li.ql-indent-1 { - counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-2 { - counter-increment: list-2; -} -.ql-editor ol li.ql-indent-2:before { - content: counter(list-2, lower-roman) '. '; -} -.ql-editor ol li.ql-indent-2 { - counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-3 { - counter-increment: list-3; -} -.ql-editor ol li.ql-indent-3:before { - content: counter(list-3, decimal) '. '; -} -.ql-editor ol li.ql-indent-3 { - counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-4 { - counter-increment: list-4; -} -.ql-editor ol li.ql-indent-4:before { - content: counter(list-4, lower-alpha) '. '; -} -.ql-editor ol li.ql-indent-4 { - counter-reset: list-5 list-6 list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-5 { - counter-increment: list-5; -} -.ql-editor ol li.ql-indent-5:before { - content: counter(list-5, lower-roman) '. '; -} -.ql-editor ol li.ql-indent-5 { - counter-reset: list-6 list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-6 { - counter-increment: list-6; -} -.ql-editor ol li.ql-indent-6:before { - content: counter(list-6, decimal) '. '; -} -.ql-editor ol li.ql-indent-6 { - counter-reset: list-7 list-8 list-9; -} -.ql-editor ol li.ql-indent-7 { - counter-increment: list-7; -} -.ql-editor ol li.ql-indent-7:before { - content: counter(list-7, lower-alpha) '. '; -} -.ql-editor ol li.ql-indent-7 { - counter-reset: list-8 list-9; -} -.ql-editor ol li.ql-indent-8 { - counter-increment: list-8; -} -.ql-editor ol li.ql-indent-8:before { - content: counter(list-8, lower-roman) '. '; -} -.ql-editor ol li.ql-indent-8 { - counter-reset: list-9; -} -.ql-editor ol li.ql-indent-9 { - counter-increment: list-9; -} -.ql-editor ol li.ql-indent-9:before { - content: counter(list-9, decimal) '. '; -} -.ql-editor .ql-indent-1:not(.ql-direction-rtl) { - padding-left: 3em; -} -.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { - padding-left: 4.5em; -} -.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { - padding-right: 3em; -} -.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { - padding-right: 4.5em; -} -.ql-editor .ql-indent-2:not(.ql-direction-rtl) { - padding-left: 6em; -} -.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { - padding-left: 7.5em; -} -.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { - padding-right: 6em; -} -.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { - padding-right: 7.5em; -} -.ql-editor .ql-indent-3:not(.ql-direction-rtl) { - padding-left: 9em; -} -.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { - padding-left: 10.5em; -} -.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { - padding-right: 9em; -} -.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { - padding-right: 10.5em; -} -.ql-editor .ql-indent-4:not(.ql-direction-rtl) { - padding-left: 12em; -} -.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { - padding-left: 13.5em; -} -.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { - padding-right: 12em; -} -.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { - padding-right: 13.5em; -} -.ql-editor .ql-indent-5:not(.ql-direction-rtl) { - padding-left: 15em; -} -.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { - padding-left: 16.5em; -} -.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { - padding-right: 15em; -} -.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { - padding-right: 16.5em; -} -.ql-editor .ql-indent-6:not(.ql-direction-rtl) { - padding-left: 18em; -} -.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { - padding-left: 19.5em; -} -.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { - padding-right: 18em; -} -.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { - padding-right: 19.5em; -} -.ql-editor .ql-indent-7:not(.ql-direction-rtl) { - padding-left: 21em; -} -.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { - padding-left: 22.5em; -} -.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { - padding-right: 21em; -} -.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { - padding-right: 22.5em; -} -.ql-editor .ql-indent-8:not(.ql-direction-rtl) { - padding-left: 24em; -} -.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { - padding-left: 25.5em; -} -.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { - padding-right: 24em; -} -.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { - padding-right: 25.5em; -} -.ql-editor .ql-indent-9:not(.ql-direction-rtl) { - padding-left: 27em; -} -.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { - padding-left: 28.5em; -} -.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { - padding-right: 27em; -} -.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { - padding-right: 28.5em; -} -.ql-editor .ql-video { - display: block; - max-width: 100%; -} -.ql-editor .ql-video.ql-align-center { - margin: 0 auto; -} -.ql-editor .ql-video.ql-align-right { - margin: 0 0 0 auto; -} -.ql-editor .ql-bg-black { - background-color: #000; -} -.ql-editor .ql-bg-red { - background-color: #e60000; -} -.ql-editor .ql-bg-orange { - background-color: #f90; -} -.ql-editor .ql-bg-yellow { - background-color: #ff0; -} -.ql-editor .ql-bg-green { - background-color: #008a00; -} -.ql-editor .ql-bg-blue { - background-color: #06c; -} -.ql-editor .ql-bg-purple { - background-color: #93f; -} -.ql-editor .ql-color-white { - color: #fff; -} -.ql-editor .ql-color-red { - color: #e60000; -} -.ql-editor .ql-color-orange { - color: #f90; -} -.ql-editor .ql-color-yellow { - color: #ff0; -} -.ql-editor .ql-color-green { - color: #008a00; -} -.ql-editor .ql-color-blue { - color: #06c; -} -.ql-editor .ql-color-purple { - color: #93f; -} -.ql-editor .ql-font-serif { - font-family: Georgia, Times New Roman, serif; -} -.ql-editor .ql-font-monospace { - font-family: Monaco, Courier New, monospace; -} -.ql-editor .ql-size-small { - font-size: 0.75em; -} -.ql-editor .ql-size-large { - font-size: 1.5em; -} -.ql-editor .ql-size-huge { - font-size: 2.5em; -} -.ql-editor .ql-direction-rtl { - direction: rtl; - text-align: inherit; -} -.ql-editor .ql-align-center { - text-align: center; -} -.ql-editor .ql-align-justify { - text-align: justify; -} -.ql-editor .ql-align-right { - text-align: right; -} -.ql-editor.ql-blank::before { - color: rgba(0,0,0,0.6); - content: attr(data-placeholder); - font-style: italic; - left: 15px; - pointer-events: none; - position: absolute; - right: 15px; -} -.ql-snow.ql-toolbar:after, -.ql-snow .ql-toolbar:after { - clear: both; - content: ''; - display: table; -} -.ql-snow.ql-toolbar button, -.ql-snow .ql-toolbar button { - background: none; - border: none; - cursor: pointer; - display: inline-block; - float: left; - height: 24px; - padding: 3px 5px; - width: 28px; -} -.ql-snow.ql-toolbar button svg, -.ql-snow .ql-toolbar button svg { - float: left; - height: 100%; -} -.ql-snow.ql-toolbar button:active:hover, -.ql-snow .ql-toolbar button:active:hover { - outline: none; -} -.ql-snow.ql-toolbar input.ql-image[type=file], -.ql-snow .ql-toolbar input.ql-image[type=file] { - display: none; -} -.ql-snow.ql-toolbar button:hover, -.ql-snow .ql-toolbar button:hover, -.ql-snow.ql-toolbar button:focus, -.ql-snow .ql-toolbar button:focus, -.ql-snow.ql-toolbar button.ql-active, -.ql-snow .ql-toolbar button.ql-active, -.ql-snow.ql-toolbar .ql-picker-label:hover, -.ql-snow .ql-toolbar .ql-picker-label:hover, -.ql-snow.ql-toolbar .ql-picker-label.ql-active, -.ql-snow .ql-toolbar .ql-picker-label.ql-active, -.ql-snow.ql-toolbar .ql-picker-item:hover, -.ql-snow .ql-toolbar .ql-picker-item:hover, -.ql-snow.ql-toolbar .ql-picker-item.ql-selected, -.ql-snow .ql-toolbar .ql-picker-item.ql-selected { - color: #06c; -} -.ql-snow.ql-toolbar button:hover .ql-fill, -.ql-snow .ql-toolbar button:hover .ql-fill, -.ql-snow.ql-toolbar button:focus .ql-fill, -.ql-snow .ql-toolbar button:focus .ql-fill, -.ql-snow.ql-toolbar button.ql-active .ql-fill, -.ql-snow .ql-toolbar button.ql-active .ql-fill, -.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill, -.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill, -.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill, -.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill, -.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill, -.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill, -.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill, -.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill, -.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill, -.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill, -.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill, -.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill, -.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill, -.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill, -.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, -.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, -.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, -.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, -.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, -.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, -.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill, -.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill { - fill: #06c; -} -.ql-snow.ql-toolbar button:hover .ql-stroke, -.ql-snow .ql-toolbar button:hover .ql-stroke, -.ql-snow.ql-toolbar button:focus .ql-stroke, -.ql-snow .ql-toolbar button:focus .ql-stroke, -.ql-snow.ql-toolbar button.ql-active .ql-stroke, -.ql-snow .ql-toolbar button.ql-active .ql-stroke, -.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke, -.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke, -.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke, -.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke, -.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke, -.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke, -.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke, -.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke, -.ql-snow.ql-toolbar button:hover .ql-stroke-miter, -.ql-snow .ql-toolbar button:hover .ql-stroke-miter, -.ql-snow.ql-toolbar button:focus .ql-stroke-miter, -.ql-snow .ql-toolbar button:focus .ql-stroke-miter, -.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter, -.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter, -.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter, -.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter, -.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, -.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, -.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter, -.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter, -.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter, -.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter { - stroke: #06c; -} -@media (pointer: coarse) { - .ql-snow.ql-toolbar button:hover:not(.ql-active), - .ql-snow .ql-toolbar button:hover:not(.ql-active) { - color: #444; - } - .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill, - .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill, - .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill, - .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill { - fill: #444; - } - .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke, - .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke, - .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter, - .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter { - stroke: #444; - } -} -.ql-snow { - box-sizing: border-box; -} -.ql-snow * { - box-sizing: border-box; -} -.ql-snow .ql-hidden { - display: none; -} -.ql-snow .ql-out-bottom, -.ql-snow .ql-out-top { - visibility: hidden; -} -.ql-snow .ql-tooltip { - position: absolute; - transform: translateY(10px); -} -.ql-snow .ql-tooltip a { - cursor: pointer; - text-decoration: none; -} -.ql-snow .ql-tooltip.ql-flip { - transform: translateY(-10px); -} -.ql-snow .ql-formats { - display: inline-block; - vertical-align: middle; -} -.ql-snow .ql-formats:after { - clear: both; - content: ''; - display: table; -} -.ql-snow .ql-stroke { - fill: none; - stroke: #444; - stroke-linecap: round; - stroke-linejoin: round; - stroke-width: 2; -} -.ql-snow .ql-stroke-miter { - fill: none; - stroke: #444; - stroke-miterlimit: 10; - stroke-width: 2; -} -.ql-snow .ql-fill, -.ql-snow .ql-stroke.ql-fill { - fill: #444; -} -.ql-snow .ql-empty { - fill: none; -} -.ql-snow .ql-even { - fill-rule: evenodd; -} -.ql-snow .ql-thin, -.ql-snow .ql-stroke.ql-thin { - stroke-width: 1; -} -.ql-snow .ql-transparent { - opacity: 0.4; -} -.ql-snow .ql-direction svg:last-child { - display: none; -} -.ql-snow .ql-direction.ql-active svg:last-child { - display: inline; -} -.ql-snow .ql-direction.ql-active svg:first-child { - display: none; -} -.ql-snow .ql-editor h1 { - font-size: 2em; -} -.ql-snow .ql-editor h2 { - font-size: 1.5em; -} -.ql-snow .ql-editor h3 { - font-size: 1.17em; -} -.ql-snow .ql-editor h4 { - font-size: 1em; -} -.ql-snow .ql-editor h5 { - font-size: 0.83em; -} -.ql-snow .ql-editor h6 { - font-size: 0.67em; -} -.ql-snow .ql-editor a { - text-decoration: underline; -} -.ql-snow .ql-editor blockquote { - border-left: 4px solid #ccc; - margin-bottom: 5px; - margin-top: 5px; - padding-left: 16px; -} -.ql-snow .ql-editor code, -.ql-snow .ql-editor pre { - background-color: #f0f0f0; - border-radius: 3px; -} -.ql-snow .ql-editor pre { - white-space: pre-wrap; - margin-bottom: 5px; - margin-top: 5px; - padding: 5px 10px; -} -.ql-snow .ql-editor code { - font-size: 85%; - padding: 2px 4px; -} -.ql-snow .ql-editor pre.ql-syntax { - background-color: #23241f; - color: #f8f8f2; - overflow: visible; -} -.ql-snow .ql-editor img { - max-width: 100%; -} -.ql-snow .ql-picker { - color: #444; - display: inline-block; - float: left; - font-size: 14px; - font-weight: 500; - height: 24px; - position: relative; - vertical-align: middle; -} -.ql-snow .ql-picker-label { - cursor: pointer; - display: inline-block; - height: 100%; - padding-left: 8px; - padding-right: 2px; - position: relative; - width: 100%; -} -.ql-snow .ql-picker-label::before { - display: inline-block; - line-height: 22px; -} -.ql-snow .ql-picker-options { - background-color: #fff; - display: none; - min-width: 100%; - padding: 4px 8px; - position: absolute; - white-space: nowrap; -} -.ql-snow .ql-picker-options .ql-picker-item { - cursor: pointer; - display: block; - padding-bottom: 5px; - padding-top: 5px; -} -.ql-snow .ql-picker.ql-expanded .ql-picker-label { - color: #ccc; - z-index: 2; -} -.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill { - fill: #ccc; -} -.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke { - stroke: #ccc; -} -.ql-snow .ql-picker.ql-expanded .ql-picker-options { - display: block; - margin-top: -1px; - top: 100%; - z-index: 1; -} -.ql-snow .ql-color-picker, -.ql-snow .ql-icon-picker { - width: 28px; -} -.ql-snow .ql-color-picker .ql-picker-label, -.ql-snow .ql-icon-picker .ql-picker-label { - padding: 2px 4px; -} -.ql-snow .ql-color-picker .ql-picker-label svg, -.ql-snow .ql-icon-picker .ql-picker-label svg { - right: 4px; -} -.ql-snow .ql-icon-picker .ql-picker-options { - padding: 4px 0px; -} -.ql-snow .ql-icon-picker .ql-picker-item { - height: 24px; - width: 24px; - padding: 2px 4px; -} -.ql-snow .ql-color-picker .ql-picker-options { - padding: 3px 5px; - width: 152px; -} -.ql-snow .ql-color-picker .ql-picker-item { - border: 1px solid transparent; - float: left; - height: 16px; - margin: 2px; - padding: 0px; - width: 16px; -} -.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg { - position: absolute; - margin-top: -9px; - right: 0; - top: 50%; - width: 18px; -} -.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before, -.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before, -.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before, -.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before, -.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before, -.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before { - content: attr(data-label); -} -.ql-snow .ql-picker.ql-header { - width: 98px; -} -.ql-snow .ql-picker.ql-header .ql-picker-label::before, -.ql-snow .ql-picker.ql-header .ql-picker-item::before { - content: 'Normal'; -} -.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { - content: 'Heading 1'; -} -.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { - content: 'Heading 2'; -} -.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { - content: 'Heading 3'; -} -.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { - content: 'Heading 4'; -} -.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before, -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { - content: 'Heading 5'; -} -.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before, -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { - content: 'Heading 6'; -} -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { - font-size: 2em; -} -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { - font-size: 1.5em; -} -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { - font-size: 1.17em; -} -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { - font-size: 1em; -} -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { - font-size: 0.83em; -} -.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { - font-size: 0.67em; -} -.ql-snow .ql-picker.ql-font { - width: 108px; -} -.ql-snow .ql-picker.ql-font .ql-picker-label::before, -.ql-snow .ql-picker.ql-font .ql-picker-item::before { - content: 'Sans Serif'; -} -.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before, -.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { - content: 'Serif'; -} -.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before, -.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { - content: 'Monospace'; -} -.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { - font-family: Georgia, Times New Roman, serif; -} -.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { - font-family: Monaco, Courier New, monospace; -} -.ql-snow .ql-picker.ql-size { - width: 98px; -} -.ql-snow .ql-picker.ql-size .ql-picker-label::before, -.ql-snow .ql-picker.ql-size .ql-picker-item::before { - content: 'Normal'; -} -.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before, -.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before { - content: 'Small'; -} -.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before, -.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before { - content: 'Large'; -} -.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before, -.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { - content: 'Huge'; -} -.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before { - font-size: 10px; -} -.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before { - font-size: 18px; -} -.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { - font-size: 32px; -} -.ql-snow .ql-color-picker.ql-background .ql-picker-item { - background-color: #fff; -} -.ql-snow .ql-color-picker.ql-color .ql-picker-item { - background-color: #000; -} -.ql-toolbar.ql-snow { - border: 1px solid #ccc; - box-sizing: border-box; - font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; - padding: 8px; -} -.ql-toolbar.ql-snow .ql-formats { - margin-right: 15px; -} -.ql-toolbar.ql-snow .ql-picker-label { - border: 1px solid transparent; -} -.ql-toolbar.ql-snow .ql-picker-options { - border: 1px solid transparent; - box-shadow: rgba(0,0,0,0.2) 0 2px 8px; -} -.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label { - border-color: #ccc; -} -.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options { - border-color: #ccc; -} -.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected, -.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover { - border-color: #000; -} -.ql-toolbar.ql-snow + .ql-container.ql-snow { - border-top: 0px; -} -.ql-snow .ql-tooltip { - background-color: #fff; - border: 1px solid #ccc; - box-shadow: 0px 0px 5px #ddd; - color: #444; - padding: 5px 12px; - white-space: nowrap; -} -.ql-snow .ql-tooltip::before { - content: "Visit URL:"; - line-height: 26px; - margin-right: 8px; -} -.ql-snow .ql-tooltip input[type=text] { - display: none; - border: 1px solid #ccc; - font-size: 13px; - height: 26px; - margin: 0px; - padding: 3px 5px; - width: 170px; -} -.ql-snow .ql-tooltip a.ql-preview { - display: inline-block; - max-width: 200px; - overflow-x: hidden; - text-overflow: ellipsis; - vertical-align: top; -} -.ql-snow .ql-tooltip a.ql-action::after { - border-right: 1px solid #ccc; - content: 'Edit'; - margin-left: 16px; - padding-right: 8px; -} -.ql-snow .ql-tooltip a.ql-remove::before { - content: 'Remove'; - margin-left: 8px; -} -.ql-snow .ql-tooltip a { - line-height: 26px; -} -.ql-snow .ql-tooltip.ql-editing a.ql-preview, -.ql-snow .ql-tooltip.ql-editing a.ql-remove { - display: none; -} -.ql-snow .ql-tooltip.ql-editing input[type=text] { - display: inline-block; -} -.ql-snow .ql-tooltip.ql-editing a.ql-action::after { - border-right: 0px; - content: 'Save'; - padding-right: 0px; -} -.ql-snow .ql-tooltip[data-mode=link]::before { - content: "Enter link:"; -} -.ql-snow .ql-tooltip[data-mode=formula]::before { - content: "Enter formula:"; -} -.ql-snow .ql-tooltip[data-mode=video]::before { - content: "Enter video:"; -} -.ql-snow a { - color: #06c; -} -.ql-container.ql-snow { - border: 1px solid #ccc; -} diff --git a/public/react/LICENSE b/public/react/LICENSE deleted file mode 100644 index 8aa26455d..000000000 --- a/public/react/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) [year] [fullname] - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/public/react/add.txt b/public/react/add.txt deleted file mode 100644 index 8bd5bb1d3..000000000 --- a/public/react/add.txt +++ /dev/null @@ -1,34 +0,0 @@ - -新版tpi改动的文件: -Index.js -contex/TPIContextProvider.js -page/main/LeftViewContainer.js -taskList/TaskList.js -TPMIndexHOC.js -App.js -CodeRepositoryViewContainer.js - -Index.js - choose={context.chooses} - - -TPIContextProvider.js - -LeftViewContainer.js - -TaskList.js - -TPMIndexHOC.js - -MainContentContainer - 新:rep_content返回值多了一层 {content: '...'} - - - - -TODO - 待同步 - 1、timer图标样式更换 - index.html - WebSSHTimer.css - WebSSHTimer.js \ No newline at end of file diff --git a/public/react/build b/public/react/build new file mode 160000 index 000000000..447edde15 --- /dev/null +++ b/public/react/build @@ -0,0 +1 @@ +Subproject commit 447edde157092e65f05b36bc41c472659c482c6a diff --git a/public/react/config/env.js b/public/react/config/env.js deleted file mode 100644 index 905ee7d2b..000000000 --- a/public/react/config/env.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const path = require('path'); -const paths = require('./paths'); - -// Make sure that including paths.js after env.js will read .env variables. -delete require.cache[require.resolve('./paths')]; - -const NODE_ENV = process.env.NODE_ENV; -if (!NODE_ENV) { - throw new Error( - 'The NODE_ENV environment variable is required but was not specified.' - ); -} - -// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use -var dotenvFiles = [ - `${paths.dotenv}.${NODE_ENV}.local`, - `${paths.dotenv}.${NODE_ENV}`, - // Don't include `.env.local` for `test` environment - // since normally you expect tests to produce the same - // results for everyone - NODE_ENV !== 'test' && `${paths.dotenv}.local`, - paths.dotenv, -].filter(Boolean); - -// Load environment variables from .env* files. Suppress warnings using silent -// if this file is missing. dotenv will never modify any environment variables -// that have already been set. Variable expansion is supported in .env files. -// https://github.com/motdotla/dotenv -// https://github.com/motdotla/dotenv-expand -dotenvFiles.forEach(dotenvFile => { - if (fs.existsSync(dotenvFile)) { - require('dotenv-expand')( - require('dotenv').config({ - path: dotenvFile, - }) - ); - } -}); - -// We support resolving modules according to `NODE_PATH`. -// This lets you use absolute paths in imports inside large monorepos: -// https://github.com/facebookincubator/create-react-app/issues/253. -// It works similar to `NODE_PATH` in Node itself: -// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders -// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored. -// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims. -// https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421 -// We also resolve them to make sure all tools using them work consistently. -const appDirectory = fs.realpathSync(process.cwd()); -process.env.NODE_PATH = (process.env.NODE_PATH || '') - .split(path.delimiter) - .filter(folder => folder && !path.isAbsolute(folder)) - .map(folder => path.resolve(appDirectory, folder)) - .join(path.delimiter); - -// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be -// injected into the application via DefinePlugin in Webpack configuration. -const REACT_APP = /^REACT_APP_/i; - -function getClientEnvironment(publicUrl) { - const raw = Object.keys(process.env) - .filter(key => REACT_APP.test(key)) - .reduce( - (env, key) => { - env[key] = process.env[key]; - return env; - }, - { - // Useful for determining whether we’re running in production mode. - // Most importantly, it switches React into the correct mode. - NODE_ENV: process.env.NODE_ENV || 'development', - // Useful for resolving the correct path to static assets in `public`. - // For example, . - // This should only be used as an escape hatch. Normally you would put - // images into the `src` and `import` them in code to get their paths. - PUBLIC_URL: '/forgeplus-react/build/.', - } - ); - // Stringify all values so we can feed into Webpack DefinePlugin - const stringified = { - 'process.env': Object.keys(raw).reduce((env, key) => { - env[key] = JSON.stringify(raw[key]); - return env; - }, {}), - }; - - return { raw, stringified }; -} - -module.exports = getClientEnvironment; diff --git a/public/react/config/jest/cssTransform.js b/public/react/config/jest/cssTransform.js deleted file mode 100644 index 0f38ef800..000000000 --- a/public/react/config/jest/cssTransform.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -// This is a custom Jest transformer turning style imports into empty objects. -// http://facebook.github.io/jest/docs/en/webpack.html - -module.exports = { - process() { - return 'module.exports = {};'; - }, - getCacheKey() { - // The output is always the same. - return 'cssTransform'; - }, -}; diff --git a/public/react/config/jest/fileTransform.js b/public/react/config/jest/fileTransform.js deleted file mode 100644 index 7d4bc6abe..000000000 --- a/public/react/config/jest/fileTransform.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -const path = require('path'); - -// This is a custom Jest transformer turning file imports into filenames. -// http://facebook.github.io/jest/docs/en/webpack.html - -module.exports = { - process(src, filename) { - return `module.exports = ${JSON.stringify(path.basename(filename))};`; - }, -}; diff --git a/public/react/config/paths.js b/public/react/config/paths.js deleted file mode 100644 index eca9f3738..000000000 --- a/public/react/config/paths.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -const path = require('path'); -const fs = require('fs'); -const url = require('url'); - -// Make sure any symlinks in the project folder are resolved: -// https://github.com/facebookincubator/create-react-app/issues/637 -const appDirectory = fs.realpathSync(process.cwd()); -const resolveApp = relativePath => path.resolve(appDirectory, relativePath); - -const envPublicUrl = process.env.PUBLIC_URL; - -function ensureSlash(path, needsSlash) { - const hasSlash = path.endsWith('/'); - if (hasSlash && !needsSlash) { - return path.substr(path, path.length - 1); - } else if (!hasSlash && needsSlash) { - return `${path}/`; - } else { - return path; - } -} - -const getPublicUrl = appPackageJson => - envPublicUrl || require(appPackageJson).homepage; - -// We use `PUBLIC_URL` environment variable or "homepage" field to infer -// "public path" at which the app is served. -// Webpack needs to know it to put the right - ` - var jsMinAllRegex = / - var result = data - .replace(jsMinAllRegex, code) - // .replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`) - // .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`) - - // ${cdnHost} 加了cdn后,这个文件里的字体文件加载会有跨域的报错 ../fonts/fontawesome-webfont.eot - // TODO tpi 评测结果关闭也使用了fontawesome - .replace('/css/css_min_all.css', `${cdnHost}/react/build/css/css_min_all.css?v=${newVersion}`) - .replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`) - .replace(/\/js\/create_kindeditor.js/g, `${cdnHost}/react/build/js/create_kindeditor.js?v=${newVersion}`) - - .replace(mainRegex, '') - // .replace('/react/build/./static/css/main', `${cdnHost}/react/build/./static/css/main`) - // .replace('/react/build/./static/js/main', `${cdnHost}/react/build/./static/js/main`) - - // .replace(/https:\/\/testeduplus2.educoder.net/g, ''); - // .replace(/http:\/\/testbdweb.educoder.net/g, ''); - - // .replace('/css/css_min_all.css', '/react/build/css/css_min_all.css'); - - fs2.writeFile(outputPath, result, 'utf8', function (err) { - if (err) return console.log(err); - // commitAndPush(); - }); - }); -} - -function commitAndPush() { - var exec = require('child_process').exec; - function puts(error, stdout, stderr) { console.log(stdout) } - var options = {cwd:"./build"}; - exec("git status && git commit -am 'b' && git push", options, puts); -} diff --git a/public/react/scripts/concat.js b/public/react/scripts/concat.js deleted file mode 100644 index bfb1d8544..000000000 --- a/public/react/scripts/concat.js +++ /dev/null @@ -1,98 +0,0 @@ -var fs = require('fs'); -var uglify = require("uglify-js"); -var path = require('path'); -var concat = require('concat') - -var results = []; -var walk = function(dir, done) { - - fs.readdir(dir, function(err, list) { - console.log(list) - if (err) return done(err); - var pending = list.length; - if (!pending) return done(null, results); - list.forEach(function(file) { - file = path.resolve(dir, file); - fs.stat(file, function(err, stat) { - if (stat && stat.isDirectory()) { - walk(file, function(err, res) { - // results = results.concat(res); - if (!--pending) done(null, results); - }); - } else { - results.push(file); - if (!--pending) done(null, results); - } - }); - }); - }); -}; - -// 需要输出文件名数组时改为true -var jsDir = './public/js/'; -var cssDir = './public/css' - -// true && -false && -walk(cssDir, function() { - console.log('results', results.length, results) -}) -// return; - -// ----------------------------------------------------------------------------- CSS - var cssResults = [ - - 'D:\\Code\\trustieplus\\public\\react\\public\\css\\edu-common.css', - 'D:\\Code\\trustieplus\\public\\react\\public\\css\\edu-public.css', - 'D:\\Code\\trustieplus\\public\\react\\public\\css\\taskstyle.css' , - - 'D:\\Code\\trustieplus\\public\\react\\public\\css\\font-awesome.css', - - 'D:\\Code\\trustieplus\\public\\react\\public\\css\\editormd.min.css', - 'D:\\Code\\trustieplus\\public\\react\\public\\css\\merge.css', - - ] - concat(cssResults, './public/css/css_min_all.css') - -return; - -// ----------------------------------------------------------------------------- JS - var _results = [ - - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\jquery-1.8.3.min.js', - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\underscore.min.js', - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\marked.min.js', - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\prettify.min.js', - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\raphael.min.js', - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\sequence-diagram.min.js', - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\flowchart.min.js', - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\jquery.flowchart.min.js', - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\editormd\\editormd.min.js', - - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\codemirror\\codemirror.js', - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\codemirror\\mode\\javascript.js', - - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\diff_match_patch.js', - - - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\merge.js', - - 'D:\\Code\\trustieplus\\public\\react\\public\\js\\edu_tpi.js', - - ] - - concat(_results, './public/js/js_min_all.js') - - // var uglified = uglify.minify(['./public/js/merge.js']); - // console.log('uglified', uglified) - // fs.writeFile('concat.min.js', uglified.code, function (err){ - // if(err) { - // console.log(err); - // } else { - // console.log("Script generated and saved:", 'concat.min.js'); - // } - // }); - - -// var uglified = uglify.minify(['file1.js', 'file2.js', 'file3.js']); - diff --git a/public/react/scripts/fileContentReplace.js b/public/react/scripts/fileContentReplace.js deleted file mode 100644 index fa4a4bd86..000000000 --- a/public/react/scripts/fileContentReplace.js +++ /dev/null @@ -1,23 +0,0 @@ -var fs2 = require('fs'); - -function generateNewIndexJsp() { - - var filePath = './build/index.html'; - - var outputPath = filePath - fs2.readFile(filePath, 'utf8', function (err,data) { - if (err) { - return console.log(err); - } - var result = data - .replace('/js/create_kindeditor.js', '/react/build/js/create_kindeditor.js') - .replace(/https:\/\/testeduplus2.educoder.net/g, ''); - // .replace(/http:\/\/testbdweb.educoder.net/g, ''); - - .replace('/css/css_min_all.css', '/react/build/css/css_min_all.css'); - - fs2.writeFile(outputPath, result, 'utf8', function (err) { - if (err) return console.log(err); - }); - }); -} \ No newline at end of file diff --git a/public/react/scripts/readme-cdn.txt b/public/react/scripts/readme-cdn.txt deleted file mode 100644 index 7d090ee7a..000000000 --- a/public/react/scripts/readme-cdn.txt +++ /dev/null @@ -1,16 +0,0 @@ -目前是判断域名的方式动态访问对应的cdn资源 -静态资源处理在build.js中,如下代码: -if (window.location.host == 'pre-newweb.educoder.net') { - _host = 'https://testali-cdn.educoder.net/react/build/' -} else if (window.location.host == 'www.educoder.net') { - _host = 'https://ali-cdn.educoder.net/react/build/' -} - -只对预上线和正式版做了处理 - -动态的chunk资源处理在public-path.js中,如下代码: -if ( window.location.host == 'pre-newweb.educoder.net') { - __webpack_public_path__ = 'https://testali-cdn.educoder.net/react/build/' -} else if ( window.location.host == 'www.educoder.net') { - __webpack_public_path__ = 'https://ali-cdn.educoder.net/react/build/' -} \ No newline at end of file diff --git a/public/react/scripts/start.js b/public/react/scripts/start.js deleted file mode 100644 index 321148cd3..000000000 --- a/public/react/scripts/start.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict'; - -// Do this as the first thing so that any code reading it knows the right env. -process.env.BABEL_ENV = 'development'; -process.env.NODE_ENV = 'development'; - - -// Makes the script crash on unhandled rejections instead of silently -// ignoring them. In the future, promise rejections that are not handled will -// terminate the Node.js process with a non-zero exit code. -process.on('unhandledRejection', err => { - throw err; -}); - -// Ensure environment variables are read. -require('../config/env'); - -const fs = require('fs'); -const chalk = require('chalk'); -const webpack = require('webpack'); -const WebpackDevServer = require('webpack-dev-server'); -const clearConsole = require('react-dev-utils/clearConsole'); -const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles'); -const { - choosePort, - createCompiler, - prepareProxy, - prepareUrls, -} = require('react-dev-utils/WebpackDevServerUtils'); -const openBrowser = require('react-dev-utils/openBrowser'); -const paths = require('../config/paths'); -const config = require('../config/webpack.config.dev'); -const createDevServerConfig = require('../config/webpackDevServer.config'); - -const useYarn = fs.existsSync(paths.yarnLockFile); -const isInteractive = process.stdout.isTTY; - -const portSetting = require(paths.appPackageJson).port -if ( portSetting ) { - process.env.port = portSetting -} - -// Warn and crash if required files are missing -if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) { - process.exit(1); -} - -// Tools like Cloud9 rely on this. -const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3007; -const HOST = process.env.HOST || '0.0.0.0'; - -if (process.env.HOST) { - console.log( - chalk.cyan( - `Attempting to bind to HOST environment variable: ${chalk.yellow( - chalk.bold(process.env.HOST) - )}` - ) - ); - console.log( - `If this was unintentional, check that you haven't mistakenly set it in your shell.` - ); - console.log(`Learn more here: ${chalk.yellow('http://bit.ly/2mwWSwH')}`); - console.log(); -} - -// We attempt to use the default port but if it is busy, we offer the user to -// run on a different port. `choosePort()` Promise resolves to the next free port. -choosePort(HOST, DEFAULT_PORT) - .then(port => { - if (port == null) { - // We have not found a port. - return; - } - const protocol = process.env.HTTPS === 'true' ? 'https' : 'http'; - const appName = require(paths.appPackageJson).name; - const urls = prepareUrls(protocol, HOST, port); - // Create a webpack compiler that is configured with custom messages. - const compiler = createCompiler(webpack, config, appName, urls, useYarn); - // Load proxy config - const proxySetting = require(paths.appPackageJson).proxy; - console.log('-------------------------proxySetting:', proxySetting) - const proxyConfig = prepareProxy(proxySetting, paths.appPublic); - // Serve webpack assets generated by the compiler over a web sever. - const serverConfig = createDevServerConfig( - proxyConfig, - urls.lanUrlForConfig - ); - const devServer = new WebpackDevServer(compiler, serverConfig); - // Launch WebpackDevServer. - devServer.listen(port, HOST, err => { - if (err) { - return console.log(err); - } - if (isInteractive) { - clearConsole(); - } - console.log(chalk.cyan('Starting the development server...\n')); - openBrowser(urls.localUrlForBrowser); - }); - - ['SIGINT', 'SIGTERM'].forEach(function(sig) { - process.on(sig, function() { - devServer.close(); - process.exit(); - }); - }); - }) - .catch(err => { - if (err && err.message) { - console.log(err.message); - } - process.exit(1); - }); diff --git a/public/react/scripts/test.js b/public/react/scripts/test.js deleted file mode 100644 index 45fd882fd..000000000 --- a/public/react/scripts/test.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -// Do this as the first thing so that any code reading it knows the right env. -process.env.BABEL_ENV = 'test'; -process.env.NODE_ENV = 'test'; -process.env.PUBLIC_URL = ''; - -// Makes the script crash on unhandled rejections instead of silently -// ignoring them. In the future, promise rejections that are not handled will -// terminate the Node.js process with a non-zero exit code. -process.on('unhandledRejection', err => { - throw err; -}); - -// Ensure environment variables are read. -require('../config/env'); - -const jest = require('jest'); -const argv = process.argv.slice(2); - -// Watch unless on CI or in coverage mode -if (!process.env.CI && argv.indexOf('--coverage') < 0) { - argv.push('--watch'); -} - - -jest.run(argv); diff --git a/public/react/src/App.css b/public/react/src/App.css deleted file mode 100644 index 07d3d718d..000000000 --- a/public/react/src/App.css +++ /dev/null @@ -1,107 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - animation: App-logo-spin infinite 20s linear; - height: 80px; -} - -.App-header { - background-color: #222; - height: 150px; - padding: 20px; - color: white; -} - -.App-title { - font-size: 1.5em; -} - -.App-intro { - font-size: large; -} - -@keyframes App-logo-spin { - from { transform: rotate(0deg); } - to { transform: rotate(360deg); } -} - - - -/* 控制md编辑器列行的宽度 - 见 codermirror maybeUpdateLineNumberWidth方法 -*/ -.editormd .CodeMirror-linenumbers { - padding: 0; -} -.editormd-html-preview hr, .editormd-preview-container hr { - /* 颜色加深 */ - border-top: 1px solid #ccc; -} - -/* 重置掉antd的一些样式 */ -html, body { - -webkit-font-smoothing: auto !important; -} - -.ant-progress-textyes { - color: #52c41a; -} -.ant-progress-textno{ - color: #f5222d; -} -/* md多空格 */ -.markdown-body p { - white-space: pre-wrap; - font-size: 16px!important -} -.markdown-body > p { - line-height: 25px; -} -/* https://www.educoder.net/courses/2346/group_homeworks/34405/question */ -.renderAsHtml.markdown-body p { - white-space: inherit; -} -/* resize */ -.editormd .CodeMirror { - border-right: none !important; -} -.editormd-preview { - border-left: 1px solid rgb(221, 221, 221); - /* 某些情况下,被cm盖住了 */ - z-index: 99; -} -/* 图片点击放大的场景,隐藏图片链接 */ -.editormd-image-click-expand .editormd-image-dialog { - height: 234px !important; -} - .editormd-image-click-expand .editormd-image-dialog .image-link { - display: none; - } -/* 解决鼠标框选时,左边第一列没高亮的问题 */ -.CodeMirror .CodeMirror-lines pre.CodeMirror-line, .CodeMirror .CodeMirror-lines pre.CodeMirror-line-like { - padding: 0 12px ; -} - - -/* antd扩展 */ -.formItemInline.ant-form-item { - display: flex; -} -.formItemInline .ant-form-item-control-wrapper { - flex: 1; -} -/* AutoComplete placeholder 不显示的问题 */ -.ant-select-auto-complete.ant-select .ant-select-selection__placeholder { - z-index: 2; -} - - -/* 兼容性 */ -/* 火狐有滚动条时高度问题 */ -@-moz-document url-prefix() { - .newContainers { - min-height: calc(100% - 60px) !important; - } -} \ No newline at end of file diff --git a/public/react/src/App.js b/public/react/src/App.js deleted file mode 100644 index ec306f8ae..000000000 --- a/public/react/src/App.js +++ /dev/null @@ -1,909 +0,0 @@ -import React, {Component} from 'react'; -import './public-path'; -import logo from './logo.svg'; -import './App.css'; -import {ConfigProvider} from 'antd' -import zhCN from 'antd/lib/locale-provider/zh_CN'; -import { - BrowserRouter as Router, - Route, - Switch -} from 'react-router-dom'; -import axios from 'axios'; -import '@icedesign/base/dist/ICEDesignBase.css'; - -import '@icedesign/base/index.scss'; - -import LoginDialog from './modules/login/LoginDialog'; -import Notcompletedysl from './modules/user/Notcompletedysl'; -import Trialapplicationysl from './modules/login/Trialapplicationysl'; -import Trialapplicationreview from './modules/user/Trialapplicationreview'; -import Addcourses from "./modules/courses/coursesPublic/Addcourses"; -import AccountProfile from "./modules/user/AccountProfile"; -import Accountnewprofile from './modules/user/Accountnewprofile'; -import Trialapplication from './modules/login/Trialapplication'; -import Certifiedprofessional from './modules/modals/Certifiedprofessional'; -import NotFoundPage from './NotFoundPage' - -import Loading from './Loading' - -import Loadable from 'react-loadable'; - - -import moment from 'moment' - -import {MuiThemeProvider, createMuiTheme} from 'material-ui/styles'; - -// import './AppConfig' - -import history from './history'; - -import {SnackbarHOC} from 'educoder' -import {initAxiosInterceptors} from './AppConfig' -import { Provider } from 'react-redux'; -import configureStore from './redux/stores/configureStore'; -// !!!tpi需要这个来加载css -import {TPMIndexHOC} from './modules/tpm/TPMIndexHOC'; -const store = configureStore(); - -const theme = createMuiTheme({ - palette: { - primary: { - main: '#4CACFF', - contrastText: 'rgba(255, 255, 255, 0.87)' - }, - secondary: {main: '#4CACFF'}, // #11cb5f This is just green.A700 as hex. - }, -}); -// -// const Trialapplication= Loadable({ -// loader: () =>import('./modules/login/Trialapplication'), -// loading:Loading, -// }) -//登入 -const EducoderLogin = Loadable({ - loader: () => import('./modules/login/EducoderLogin'), - loading: Loading, -}) - - -//微信登录 -const Otherlogin=Loadable({ - loader: () => import('./modules/login/Otherlogin'), - loading: Loading, -}) - -//微信登录 -const Loginqq=Loadable({ - loader: () => import('./modules/login/Loginqq'), - loading: Loading, -}) - - -const Otherloginstart=Loadable({ - loader: () => import('./modules/login/Otherloginstart'), - loading: Loading, -}) -const Otherloginsqq=Loadable({ - loader: () => import('./modules/login/Otherloginqq'), - loading: Loading, -}) -// const TestIndex = Loadable({ -// loader: () => import('./modules/test'), -// loading: Loading, -// }) - -const IndexWrapperComponent = Loadable({ - loader: () => import('./modules/page/IndexWrapper'), - loading: Loading, -}) - -const CommentComponent = Loadable({ - loader: () => import('./modules/comment/CommentContainer'), - loading: Loading, -}) - -// const TestMaterialDesignComponent = Loadable({ -// loader: () => import('./modules/test/md/TestMaterialDesign'), -// loading: Loading, -// }) -// const TestCodeMirrorComponent = Loadable({ -// loader: () => import('./modules/test/codemirror/TestCodeMirror'), -// loading: Loading, -// }) - -// const TestComponent = Loadable({ -// loader: () => import('./modules/test/TestRC'), -// loading: Loading, -// }) -// const TestUrlQueryComponent = Loadable({ -// loader: () => import('./modules/test/urlquery/TestUrlQuery'), -// loading: Loading, -// }) - -const TPMIndexComponent = Loadable({ - loader: () => import('./modules/tpm/TPMIndex'), - loading: Loading, -}) -const TPMShixunsIndexComponent = Loadable({ - loader: () => import('./modules/tpm/shixuns/ShixunsIndex'), - loading: Loading, -}) - -//实训课程(原实训路径) -const ShixunPaths = Loadable({ - loader: () => import('./modules/paths/Index'), - loading: Loading, -}) - -//在线课堂 -const CoursesIndex = Loadable({ - loader: () => import('./modules/courses/Index'), - loading: Loading, -}) -const SearchPage = Loadable({ - loader: () => import('./search/SearchPage'), - loading: Loading, -}) - -// 课堂讨论 -// const BoardIndex = Loadable({ -// loader: () => import('./modules/courses/boards/BoardIndex'), -// loading:Loading, -// }) - -// //课堂普通作业&分组作业 -// const CoursesWorkIndex = Loadable({ -// loader: () => import('./modules/courses/busyWork/Index'), -// loading:Loading, -// }) -// - -// const TPMShixunchildIndexComponent = Loadable({ -// loader: () => import('./modules/tpm/shixunchild/ShixunChildIndex'), -// loading: Loading, -// }) - - -// const TPMshixunfork_listIndexComponent = Loadable({ -// loader: () => import('./modules/tpm/shixunchild/Shixunfork_list'), -// loading: Loading, -// }) - - -const ForumsIndexComponent = Loadable({ - loader: () => import('./modules/forums/ForumsIndex'), - loading: Loading, -}) - -const ProjectIndex = Loadable({ - loader: () => import('./forge/Index'), - loading: Loading, -}) - -// trustie plus forum -// const TPForumsIndexComponent = Loadable({ -// loader: () => import('./modules/tp-forums/TPForumsIndex'), -// loading: Loading, -// }) - - -// const TestPageComponent = Loadable({ -// loader: () => import('./modules/page/Index'), -// loading: Loading, -// }) - - -//新建实训 -const Newshixuns = Loadable({ - loader: () => import('./modules/tpm/newshixuns/Newshixuns'), - loading: Loading, -}) - - -//实训首页 -const ShixunsHome = Loadable({ - loader: () => import('./modules/home/shixunsHome'), - loading: Loading, -}) - - -const CompatibilityPageLoadable = Loadable({ - loader: () => import('./modules/common/CompatibilityPage'), - loading: Loading, -}) - -//403页面 -const Shixunauthority = Loadable({ - loader: () => import('./modules/403/Shixunauthority'), - loading: Loading, -}) - - -//404页面 -const Shixunnopage = Loadable({ - loader: () => import('./modules/404/Shixunnopage'), - loading: Loading, -}) - -//500页面 -const http500 = Loadable({ - loader: () => import('./modules/500/http500'), - loading: Loading, -}) - -// 登录注册 -const LoginRegisterPage = Loadable({ - loader: () => import('./modules/user/LoginRegisterPage'), - loading: Loading, -}) -const AccountPage = Loadable({ - loader: () => import('./modules/user/AccountPage'), - loading: Loading, -}) - -// 个人主页 -const UsersInfo = Loadable({ - loader: () => import('./modules/user/usersInfo/Infos'), - loading: Loading, -}) -const InfosIndex = Loadable({ - loader: () => import('./modules/user/usersInfo/InfosIndex'), - loading: Loading, -}) -// 题库 -const BanksIndex = Loadable({ - loader: () => import('./modules/user/usersInfo/banks/BanksIndex'), - loading: Loading, -}) - - -// 教学案例 -const MoopCases = Loadable({ - loader: () => import('./modules/moop_cases/index'), - loading: Loading, -}) - -// 兴趣页面 -const Interestpage = Loadable({ - loader: () => import('./modules/login/EducoderInteresse'), - loading: Loading, -}) - -//众包创新 -// const ProjectPackages=Loadable({ -// loader: () => import('./modules/projectPackages/ProjectPackageIndex'), -// loading: Loading, -// }) - -//竞赛 -const NewCompetitions=Loadable({ - loader: () => import('./modules/competitions/Competitions'), - loading: Loading, -}) - -//黑客松定制竞赛 -const Osshackathon=Loadable({ - loader: () => import('./modules/osshackathon/Osshackathon'), - loading: Loading, -}) - -const Messagerouting= Loadable({ - loader: () => import('./modules/message/js/Messagerouting'), - loading: Loading, -}) - -const Topicbank= Loadable({ - loader: () => import('./modules/topic_bank/Topic_bank'), - loading: Loading, -}) - -const Help = Loadable({ - loader: () => import('./modules/help/Help'), - loading: Loading, -}) - -const Ecs = Loadable({ - loader: () => import('./modules/ecs/Ecs'), - loading: Loading, -}) - -// 添加开发者社区 -const Developer = Loadable({ - loader: () => import('./modules/developer'), - loading: Loading -}) -// 试题库 -const Headplugselection = Loadable({ - loader: () => import('./modules/question/Question'), - loading: Loading -}) - -//试题库新建 //题库编辑 -const Questionitem_banks = Loadable({ - loader: () => import('./modules/question/Questionitem_banks'), - loading: Loading -}) - -//试卷库 -const Testpaperlibrary= Loadable({ - loader: () => import('./modules/testpaper/Testpaperlibrary'), - loading: Loading -}) -//试卷编辑 -const Paperlibraryeditid= Loadable({ - loader: () => import('./modules/testpaper/Paperlibraryeditid'), - loading: Loading -}) -//试卷查看 -const Paperlibraryseeid= Loadable({ - loader: () => import('./modules/testpaper/Paperlibraryseeid'), - loading: Loading -}) -//人工组卷 -const Paperreview= Loadable({ - loader: () => import('./modules/question/Paperreview'), - loading: Loading -}) - -//智能组卷 -const Integeneration= Loadable({ - loader: () => import('./modules/testpaper/Intecomponents'), - loading: Loading -}) - -// 学院统计 -const College = Loadable({ - loader: () => import('./college/College'), - loading: Loading -}) - -// 开发者编辑模块 -const NewOrEditTask = Loadable({ - loader: () => import('./modules/developer/newOrEditTask'), - loading: Loading -}); -// 学员学习 -const StudentStudy = Loadable({ - loader: () => import('./modules/developer/studentStudy'), - loading: Loading -}); -// 提交记录详情 -const RecordDetail = Loadable({ - loader: () => import('./modules/developer/recordDetail'), - loading: Loading -}); -// jupyter tpi -const JupyterTPI = Loadable({ - loader: () => import('./modules/tpm/jupyter'), - loading: Loading -}); -// 微信代码编辑器 -// const WXCode = Loadable({ -// loader: () => import('./modules/wxcode'), -// loading: Loading -// }); -// //个人竞赛报名 -// const PersonalCompetit = Loadable({ -// loader: () => import('./modules/competition/personal/PersonalCompetit.js'), -// loading: Loading, -// }); -class App extends Component { - constructor(props) { - super(props) - this.state = { - Addcoursestype:false, - Addcoursestypes:false, - mydisplay:false, - occupation:0, - mygetHelmetapi: null, - } - - } - HideAddcoursestypess=(i)=>{ - console.log("调用了"); - this.setState({ - Addcoursestype:false, - Addcoursestypes:false, - mydisplay:true, - occupation:i, - }) - }; - hideAddcoursestypes=()=>{ - this.setState({ - Addcoursestypes:false - }) - }; - ModalCancelsy=()=>{ - this.setState({ - mydisplay:false, - }) - window.location.href = "/"; - }; - ModalshowCancelsy=()=>{ - this.setState({ - mydisplay:true, - }) - }; - - disableVideoContextMenu = () => { - window.$( "body" ).on( "mousedown", "video", function(event) { - if(event.which === 3) { - window.$('video').bind('contextmenu',function () { return false; }); - } else { - window.$('video').unbind('contextmenu'); - } - }); - } - componentDidMount() { - document.title = "loading..."; - this.disableVideoContextMenu(); - // force an update if the URL changes - history.listen(() => { - this.forceUpdate() - const $ = window.$ - // https://www.trustie.net/issues/21919 可能会有问题 - $("html").animate({ scrollTop: $('html').scrollTop() - 0 }) - }); - - initAxiosInterceptors(this.props); - // 顶部和底部的动态设置 - // this.getAppdata(); - // - // axios.interceptors.response.use((response) => { - // // console.log("response"+response); - // if(response!=undefined) - // // console.log("response"+response.data.statu); - // if (response&&response.data.status === 407) { - // this.setState({ - // isRenders: true, - // }) - // } - // return response; - // }, (error) => { - // //TODO 这里如果样式变了会出现css不加载的情况 - // }); - - window.addEventListener('error', (event) => { - const msg = `${event.type}: ${event.message}`; - console.log(msg) - }); - } - //修改登录方法 - Modifyloginvalue=()=>{ - this.setState({ - isRender:false, - }) - }; - - //获取数据为空的时候 - gettablogourlnull = () => { - this.setState({ - mygetHelmetapi: undefined - }); - document.title = "EduCoder"; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); - link.id = 'dynamic-favicon'; - link.rel = 'shortcut icon'; - link.href = "/forgeplus-react/build/./favicon.ico"; - if (oldLink) { - document.head.removeChild(oldLink); - } - document.head.appendChild(link); - }; - - //获取数据的时候 - gettablogourldata = (response) => { - document.title = response.data.setting.name; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); - link.id = 'dynamic-favicon'; - link.rel = 'shortcut icon'; - link.href = '/' + response.data.setting.tab_logo_url; - if (oldLink) { - document.head.removeChild(oldLink); - } - document.head.appendChild(link); - } - //获取当前定制信息 - getAppdata=()=>{ - let url = "/setting.json"; - axios.get(url).then((response) => { - // console.log("app.js开始请求/setting.json"); - // console.log("获取当前定制信息"); - if(response){ - if(response.data){ - this.setState({ - mygetHelmetapi:response.data.setting - }); - //存储配置到游览器 - localStorage.setItem('chromesetting',JSON.stringify(response.data.setting)); - localStorage.setItem('chromesettingresponse',JSON.stringify(response)); - try { - if (response.data.setting.tab_logo_url) { - this.gettablogourldata(response); - } else { - this.gettablogourlnull(); - } - } catch (e) { - this.gettablogourlnull(); - } - - - } else { - - this.gettablogourlnull(); - - } - - } else { - this.gettablogourlnull(); - - } - - }).catch((error) => { - this.gettablogourlnull(); - - }); - }; - - render() { - return ( - - - - - this.Modifyloginvalue()}> - - - - this.HideAddcoursestypess(i)}/> - - - - - - {/* 项目 */} - { - - return () - } - }> - - () - } - /> - {/*题库*/} - { - - return () - } - }> - {/*题库*/} - { - - return () - } - }> - {/*/!*众包创新*!/*/} - {/**/} - {/*竞赛*/} - { - - return () - } - }> - - {/*黑客松定制竞赛*/} - { - return( - - ) - } - } - /> - - {/*认证*/} - - - {/*403*/} - - - - - {/*404*/} - - - - { - - return () - } - } - /> - { - - return () - } - } - /> - - - - - - { - - return () - } - }> - - { - return () - } - }> - {/* ()*/} - {/*}*/} - {/*/>*/} - { - - return () - } - } - /> - {/**/} - - - () - }/> - {/* jupyter */} - { - return () - } - } - /> - - () - } - /> - () - } /> - () - }/> - () - }/> - () - }/> - - () - }/> - - () - } /> - () - } /> - - () - } /> - () - } /> - () - }/> - - () - }/> - - () - }/> - - () - }/> - {/*()*/} - {/* }*/} - {/*/>*/} - () - } - /> - - - - - - - - ); - } -} - -// moment国际化,设置为中文 -moment.defineLocale('zh-cn', { - months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), - monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), - weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'), - weekdaysMin: '日_一_二_三_四_五_六'.split('_'), - longDateFormat: { - LT: 'Ah点mm分', - LTS: 'Ah点m分s秒', - L: 'YYYY-MM-DD', - LL: 'YYYY年MMMD日', - LLL: 'YYYY年MMMD日Ah点mm分', - LLLL: 'YYYY年MMMD日ddddAh点mm分', - l: 'YYYY-MM-DD', - ll: 'YYYY年MMMD日', - lll: 'YYYY年MMMD日Ah点mm分', - llll: 'YYYY年MMMD日ddddAh点mm分' - }, - meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === '凌晨' || meridiem === '早上' || - meridiem === '上午') { - return hour; - } else if (meridiem === '下午' || meridiem === '晚上') { - return hour + 12; - } else { - // '中午' - return hour >= 11 ? hour : hour + 12; - } - }, - meridiem: function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return '凌晨'; - } else if (hm < 900) { - return '早上'; - } else if (hm < 1130) { - return '上午'; - } else if (hm < 1230) { - return '中午'; - } else if (hm < 1800) { - return '下午'; - } else { - return '晚上'; - } - }, - calendar: { - sameDay: function () { - return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT'; - }, - nextDay: function () { - return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT'; - }, - lastDay: function () { - return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT'; - }, - nextWeek: function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]'; - return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; - }, - lastWeek: function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]'; - return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; - }, - sameElse: 'LL' - }, - ordinalParse: /\d{1,2}(日|月|周)/, - ordinal: function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'DDD': - return number + '日'; - case 'M': - return number + '月'; - case 'w': - case 'W': - return number + '周'; - default: - return number; - } - }, - relativeTime: { - future: '%s内', - past: '%s前', - s: '几秒', - m: '1分钟', - mm: '%d分钟', - h: '1小时', - hh: '%d小时', - d: '1天', - dd: '%d天', - M: '1个月', - MM: '%d个月', - y: '1年', - yy: '%d年' - }, - week: { - // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } -}); -export default SnackbarHOC()(App) ; diff --git a/public/react/src/App.test.js b/public/react/src/App.test.js deleted file mode 100644 index 821c6d3f6..000000000 --- a/public/react/src/App.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; - -it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(, div); - ReactDOM.unmountComponentAtNode(div); -}); diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js deleted file mode 100644 index c9346918c..000000000 --- a/public/react/src/AppConfig.js +++ /dev/null @@ -1,420 +0,0 @@ -import React from "react"; - -import axios from 'axios'; -import md5 from 'md5'; -import { requestProxy } from "./indexEduplus2RequestProxy"; -import { broadcastChannelOnmessage ,SetAppModel, isDev, queryString } from 'educoder'; -import { notification } from 'antd'; -import cookie from 'react-cookies'; -import './index.css'; -const $ = window.$; -const opens ="79e33abd4b6588941ab7622aed1e67e8"; -let timestamp; -let checkSubmitFlg = false; -let message501=false; - -broadcastChannelOnmessage('refreshPage', () => { - window.location.reload() -}) - -function locationurl(list){ - if (window.location.port === "3007") { - - } else { - window.location.href=list - } -} - - - - - -// TODO 开发期多个身份切换 - let debugType ="" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -} -// 超管 -// debugType="admin"; -// 老师 -//debugType="teacher"; -// 学生 -//debugType="student"; - - - - - -function clearAllCookie() { - cookie.remove('_educoder_session', {path: '/'}); - cookie.remove('autologin_trustie', {path: '/'}); - setpostcookie() -} -clearAllCookie(); -function setpostcookie() { - - const str =window.location.pathname; - // console.log(str.indexOf("/wxcode")) - let newdomain=".educoder.net" - if(str.indexOf("/wxcode") !== -1){ - console.log("123") - cookie.remove('_educoder_session', {path: '/'}); - cookie.remove('autologin_trustie', {path: '/'}); - // console.log("开始重写cookis"); - const _params = window.location.search; - // console.log("1111"); - if (_params) { - // console.log("22222"); - let _search = _params.split('?')[1]; - let _educoder_sessions= _search.split('&')[0].split('='); - cookie.save('_educoder_session',_educoder_sessions[1], { domain:'.educoder.net', path: '/'}); - let autologin_trusties=_search.split('&')[1].split('='); - cookie.save('autologin_trustie',autologin_trusties[1], { domain:'.educoder.net', path: '/'}); - - } - } -} -setpostcookie(); - - - function railsgettimes(proxy) { - - clearAllCookie() - - if(timestamp&&checkSubmitFlg===false){ - $.ajax({url:proxy,async:false,success:function(data){ - if(data.status===0){ - timestamp=data.message; - setpostcookie(); - } - }}) - checkSubmitFlg=true - window.setTimeout(()=>{ - checkSubmitFlg=false; - }, 2000); - }else if(checkSubmitFlg===false){ - $.ajax({url:proxy,async:false,success:function(data){ - if(data.status===0){ - timestamp=data.message; - setpostcookie(); - } - }}) - checkSubmitFlg=true - window.setTimeout( ()=>{ - checkSubmitFlg=false; - }, 2000); - } - -} - - - - - -window._debugType = debugType; -export function initAxiosInterceptors(props) { - initOnlineOfflineListener() - - // TODO 避免重复的请求 https://github.com/axios/axios#cancellation - // https://github.com/axios/axios/issues/1497 - - // TODO 读取到package.json中的配置? - var proxy = "http://localhost:3000" - // proxy = "http://testbdweb.trustie.net" - // proxy = "http://testbdweb.educoder.net" - // proxy = "https://testeduplus2.educoder.net" - //proxy="http://47.96.87.25:48080" - // proxy="https://pre-newweb.educoder.net" - // proxy="https://test-newweb.educoder.net" - // proxy="https://test-jupyterweb.educoder.net" - // proxy="https://test-newweb.educoder.net" - // proxy="https://test-jupyterweb.educoder.net" - //proxy="http://192.168.2.63:3001" - - var //proxy = "http://localhost:3000" - // proxy="http://123.59.135.93:56666" - proxy="http://localhost:3000" - - // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; - // 如果需要支持重复的请求,考虑config里面自定义一个allowRepeat参考来控制 - const requestMap = {}; - - window.setfalseInRequestMap = function(keyName) { - requestMap[keyName] = false; - } - - //响应前的设置 - axios.interceptors.request.use( - config => { - setpostcookie() - clearAllCookie() - // config.headers['Content-Type']= 'no-cache' - // if (token) { // 每次发送请求之前判断是否存在token,如果存在,则统一在http请求的header都加上token,不用每次请求都手动添加了 - // config.headers.Authorization = token; - // } - - // --------------------------------------------- 測試3007连测试服的代码 - // if (url.indexOf('file_update') != -1 || url.indexOf('game_build') != -1 || url.indexOf('game_status') != -1) { - // proxy = 'https://testbdweb.trustie.net' - // } else { - // proxy = 'http://localhost:3000' - // } - // --------------------------------------------- - // console.log("开始请求了"); - // console.log(config.url); - // console.log(window.location.pathname); - // - - // try { - // const str =window.location.pathname; - // if(str.indexOf("/wxcode") !== -1){ - // // console.log("开始重写cookis"); - // const _params = window.location.search; - // // console.log("1111"); - // if (_params) { - // // console.log("22222"); - // let _search = _params.split('?')[1]; - // var _educoder_sessionmys=""; - // var autologin_trusties=""; - // _search.split('&').forEach(item => { - // const _arr = item.split('='); - // if(_arr[0]==='_educoder_session'){ - // cookie.save('_educoder_session',_arr[1], { domain: '.educoder.net', path: '/'}); - // _educoder_sessionmys=_arr[1]; - // }else{ - // cookie.save('autologin_trustie',_arr[1], { domain: '.educoder.net', path: '/'}); - // autologin_trusties=_arr[1]; - // } - // }); - // try { - // const autlogins= `_educoder_session=${_educoder_sessionmys}; autologin_trustie=${autologin_trusties} `; - // config.params = {'Cookie': autlogins} - // config.headers['Cookie'] =autlogins; - // // console.log("设置了cookis"); - // } catch (e) { - // - // } - // try { - // const autloginysls= `_educoder_session=${_educoder_sessionmys}; autologin_trustie=${autologin_trusties} `; - // config.params = {'autloginysls': autloginysls} - // config.headers['Cookie'] =autloginysls; - // // console.log("设置了cookis"); - // }catch (e) { - // - // } - // } - // } - // }catch (e) { - // - // } - - - - if (config.url.indexOf(proxy) != -1 || config.url.indexOf(':') != -1) { - return config - } - requestProxy(config) - - let url = `/api${config.url}`; - - //qq登录去掉api - if(config.params&&config.params.redirect_uri!=undefined){ - if(config.params.redirect_uri.indexOf('otherloginqq')!=-1){ - url = `${config.url}`; - } - } - if(`${config[0]}`!=`true`){ - let timestamp = Date.parse(new Date())/1000; - if (window.location.port === "3007") { - // let timestamp=railsgettimes(proxy); - // console.log(timestamp) - // `https://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp` - railsgettimes( `${proxy}/api/main/first_stamp.json`); - let newopens=md5(opens+timestamp) - config.url = `${proxy}${url}`; - if (config.url.indexOf('?') == -1) { - config.url = `${config.url}?debug=${debugType}&randomcode=${timestamp}&client_key=${newopens}`; - } else { - config.url = `${config.url}&debug=${debugType}&randomcode=${timestamp}&client_key=${newopens}`; - } - } else { - // 加api前缀 - // railsgettimes(`http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`); - - railsgettimes( `/api/main/first_stamp.json`); - let newopens=md5(opens+timestamp) - config.url = url; - if (config.url.indexOf('?') == -1) { - config.url = `${config.url}?randomcode=${timestamp}&client_key=${newopens}`; - } else { - config.url = `${config.url}&randomcode=${timestamp}&client_key=${newopens}`; - } - } - setpostcookie(); - } - // - // console.log(config); - if (config.method === "post") { - if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息 - // console.log(config); - // console.log(JSON.parse(config)); - // console.log(config.url); - // console.log("被阻止了是重复请求================================="); - return false; - } - } - // 非file_update请求 - if (config.url.indexOf('update_file') === -1) { - requestMap[config.url] = true; - - window.setTimeout("setfalseInRequestMap('"+config.url+"')", 900) - } - // setTimeout("setfalseInRequestMap(" + config.url + ")", 1200) - return config; - }, - err => { - return Promise.reject(err); - }); - - axios.interceptors.response.use(function (response) { - - // console.log(".............") - if(response===undefined){ - return - } - const config = response.config - if (response.data.status === -1) { - // console.error('error:', response.data.message) - // throw new Error() - - // https://github.com/axios/axios/issues?utf8=%E2%9C%93&q=cancel+request+in+response+interceptors+ - // https://github.com/axios/axios/issues/583 - // message.info(response.data.message || '服务端返回status -1,请联系管理员。'); - // props.showSnackbar( response.data.message || '服务器异常,请联系管理员。' ) - if (window.location.pathname.startsWith('/tasks/')) { - props.showSnackbar( response.data.message || '服务器异常,请联系管理员。' ) - } else { - notification.open({ - message:"提示", - description: response.data.message || '服务器异常,请联系管理员。', - style: { - zIndex: 99999999 - }, - }); - // notification['error']({ - // message:"提示", - // description: response.data.message || '服务器异常,请联系管理员。', - // }); - } - - throw new axios.Cancel('Operation canceled by the user.'); - } else { - // hash跳转 - // var hash = window.location.hash; - // if (hash) { - // hashTimeout && window.clearTimeout(hashTimeout) - // hashTimeout = setTimeout(() => { - // var element = document.querySelector(hash); - // if (element) { - // element.scrollIntoView(); - // } - // }, 400) - // } - } - // if(response.data.status === 401){ - // console.log("401401401") - // } - if (response.data.status === 403||response.data.status === "403") { - - locationurl('/403'); - } - - if (response.data.status === 404) { - locationurl('/nopage'); - } - - if (response.data.status === 500) { - locationurl('/500'); - } - - if (response.data.status === 501) { - if(message501===false){ - message501=true - notification.open({ - message:"提示", - description:response.data.message || '访问异常,请求不合理', - style: { - zIndex: 99999999 - } - }) - } - window.setTimeout(function () { - message501=false - }, 2000); - } - - - // if (response.data.status === 402) { - // console.log(response.data.status); - // console.log(response.data); - // // locationurl(402); - // } - - // - // if (response.data.status === 401) { - // console.log("161"); - // console.log(config); - // return config; - // } - // if (response.data.status === 407) { - // 在app js 中解决 Trialapplication - // // - // ///在appjs - // notification.open({ - // message:"提示", - // description: "账号未认证", - // }); - // throw new axios.Cancel('Operation canceled by the user.'); - // // - // } - - requestMap[response.config.url] = false; - setpostcookie(); - return response; - }, function (error) { - return Promise.reject(error); - }); -// ----------------------------------------------------------------------------------- - -} - - -function initOnlineOfflineListener() { - const $ = window.$ - $(window).bind("online", () => { - notification.destroy() - notification.success({ - duration: 2, - message: '网络恢复正常', - description: - '网络恢复正常,感谢使用。', - }) - }); - $(window).bind("offline", () => { - notification.destroy() - - notification.warning({ - duration: null, - message: '网络异常', - description: - '网络异常,请检测网络后重试。', - }) - }); -} diff --git a/public/react/src/CustomLoadable.js b/public/react/src/CustomLoadable.js deleted file mode 100644 index 31e0e8a17..000000000 --- a/public/react/src/CustomLoadable.js +++ /dev/null @@ -1,12 +0,0 @@ -import Loadable from 'react-loadable'; - -import Loading from "./Loading"; - -const CustomLoadable = (loader, loading = Loading) => { - return Loadable({ - loader, - loading - }) -} - -export default CustomLoadable \ No newline at end of file diff --git a/public/react/src/Loading.js b/public/react/src/Loading.js deleted file mode 100644 index e05a36a54..000000000 --- a/public/react/src/Loading.js +++ /dev/null @@ -1,34 +0,0 @@ -import React, { Component } from 'react'; - -import { BrowserRouter as Router, Route, Link } from "react-router-dom"; - -import { Spin } from 'antd'; - -class Loading extends Component { - componentDidUpdate(prevProps, prevState) { - if (!prevProps.error && this.props.error) { - console.log(this.props.error) - window.location.reload() - } - } - - render() { - // Loading - return ( -
- - -
- ); - } -} - -export default Loading; diff --git a/public/react/src/NotFoundPage.js b/public/react/src/NotFoundPage.js deleted file mode 100644 index 9aceec861..000000000 --- a/public/react/src/NotFoundPage.js +++ /dev/null @@ -1,41 +0,0 @@ -import React, { Component } from 'react'; - -import { BrowserRouter as Router, Route, Link } from "react-router-dom"; - -class NotFoundPage extends Component { - render() { - return ( -
- 404 Page -

-   - Index - |  - tpm challenges - |  - tpm discuss - |  - forums -  |  - Comment -  |  - testMaterial -  |  - testCodeMirror -  |  - taskList -  |  - testRCComponent - |  - tpforums - - - |  - url-query test - -
- ); - } -} - -export default NotFoundPage; diff --git a/public/react/src/college/College.js b/public/react/src/college/College.js deleted file mode 100644 index fb116429d..000000000 --- a/public/react/src/college/College.js +++ /dev/null @@ -1,1261 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, -} from "antd"; -import Colleagechart from './colleagechart/Colleagechart' -import Colleagechartzu from './colleagechart/Colleagechartzu' -import {TPMIndexHOC} from "../modules/tpm/TPMIndexHOC"; -import NoneData from './../modules/courses/coursesPublic/NoneData'; - -import './colleagecss/colleage.css'; -import Shixunechart from "../modules/courses/shixunHomework/shixunreport/Shixunechart"; -class College extends Component { - constructor(props) { - super(props); - // this.answerMdRef = React.createRef(); - this.state = { - coursesloading:false, - columns: [ - { - title: '名称', - dataIndex: 'name', - key: 'name', - align: 'center', - className: "edu-txt-center font-14 maxnamewidth247", - render: (text, record) => ( - { - record.name - } - ) - }, - { - title: '管理教师', - dataIndex: 'teachers', - key: 'teachers', - align: 'center', - className: "edu-txt-center font-14 maxnamewidth340", - render: (text, record) => ( - - { - record.teachers - } - - ) - }, - { - title: '评测次数', - dataIndex: 'times', - key: 'times', - align: 'center', - className: "edu-txt-center font-14 maxnamewidth175", - render: (text, record) => ( - - { - record.evaluating_count - } - - ), - }, - { - title: '学生', - key: 'student', - dataIndex: 'student', - align: 'center', - className: "edu-txt-center font-14 maxnamewidth255", - render: (text, record) => ( - - { - record.student_count - } - - ) - }, - { - title: '实训作业', - dataIndex: 'training', - key: 'training', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.shixun_work_count - } - - ) - - }, - { - title: '资源', - dataIndex: 'resources', - key: 'resources', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.attachment_count - } - - ), - }, - { - title: '帖子', - dataIndex: 'posts', - key: 'posts', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - { - record.message_count - } - ) - }, - { - title: '其它任务', - dataIndex: 'othertasks', - key: 'othertasks', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.other_work_count - } - - ) - }, - { - title: '状态', - dataIndex: 'states', - key: 'states', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.is_end? - "已结束" - : - "正在进行" - } - - ) - }, - { - title: '时间', - dataIndex: 'timemy', - key: 'timemy', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.activity_time - } - - ) - }, - ], - page:1, - limit:10, - total_users:50, - teachersloading:false, - teacherranking:[ - { - title: '排名', - dataIndex: 'ranking', - key: 'ranking', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.id - } - - ) - }, - { - title: '姓名', - dataIndex: 'name', - key: 'name', - align: 'center', - className: "edu-txt-center font-14 maxnamewidth105", - render: (text, record) => ( - { - record.name - } - - ) - }, - { - title: '管理课堂', - dataIndex: 'classroom', - key: 'classroom', - align: 'center', - className: "edu-txt-center font-14 maxnamewidth175", - render: (text, record) => ( - - { - record.course_count - } - - ), - }, - { - title: '已发布实训作业', - key: 'assignment', - dataIndex: 'assignment', - align: 'center', - className: "edu-txt-center font-14 maxnamewidth255", - render: (text, record) => ( - - { - record.shixun_work_count - } - - ) - }, - { - title: '未发布实训作业', - dataIndex: 'released', - key: 'released', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.un_shixun_work_count - } - - ) - - }, - { - title: '学生数', - dataIndex: 'studentnumber', - key: 'studentnumber', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.student_count - } - - ), - }, - { - title: '完成率', - dataIndex: 'completionrate', - key: 'completionrate', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.complete_rate+"%" - } - - ) - }, - { - title: '发布实训', - dataIndex: 'releasetraining', - key: 'releasetraining', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.publish_shixun_count - } - - ) - } - ], - studentranking:[ - { - title: '排名', - dataIndex: 'ranking', - key: 'ranking', - align: 'center', - className: "edu-txt-center font-14", - width:'100px', - render: (text, record) => ( - - { - record.id===1? - :record.id===2? - - :record.id===3? - - :record.id - } - - ) - }, - { - title: '姓名', - dataIndex: 'name', - key: 'name', - align: 'center', - className: "edu-txt-center font-14 maxnamewidth105", - width:'100px', - render: (text, record) => ( - { - record.name - } - - ) - }, - { - title: '学号', - dataIndex: 'studentid', - key: 'studentid', - align: 'center', - className: "edu-txt-center font-14 maxnamewidth175", - render: (text, record) => ( - - { - record.student_id - } - - ), - }, - { - title: '完成实训', - key: 'training', - dataIndex: 'training', - align: 'center', - className: "edu-txt-center font-14 maxnamewidth255", - render: (text, record) => ( - - { - record.shixun_count - } - - ) - }, - { - title: '在学实训', - dataIndex: 'learning', - key: 'learning', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.study_shixun_count - } - - ) - - }, - { - title: '金币', - dataIndex: 'goldcoin', - key: 'goldcoin', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.grade - } - - ), - }, - { - title: '经验值', - dataIndex: 'empirical', - key: 'empirical', - align: 'center', - className: "edu-txt-center font-14", - render: (text, record) => ( - - { - record.experience - } - - ) - }, - ], - school:"", - teachers_count:null, - students_count:null, - courses_count:null, - shixuns_count:null, - shixun_report_count:null, - shixun_time:null, - courses:null, - course_count:0, - pages:1, - limits:10, - teachers:null, - teacher_count:0, - students:null, - student_count:0, - shixun_chart_data:null, - shixun_chart_datanames:null, - studentionsnames:null, - studentionsvalues:null - } - - } - - - componentDidMount(){ - console.log("College"); - console.log(this.props.match.params.id); - this.gettop(); - this.Numberofinternshipreports(); - this.Actualcombattimeoftrainees(); - this.Classnumber(1,10); - this.Teacherranking(1,10); - this.Studentranking(1,10); - this.Onlinetraining(); - this.Hottest(); - } - //头部 - gettop=()=>{ - const id =this.props.match.params.id; - const url=`/colleges/${id}/statistics.json`; - axios.get(url).then((response) => { - if(response===null||response===undefined){ - this.setState({ - teachers_count:0, - students_count:0, - courses_count:0, - shixuns_count:0, - school:"", - }) - return - } - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - this.setState({ - teachers_count:0, - students_count:0, - courses_count:0, - shixuns_count:0, - school:"", - }) - }else{ - this.setState({ - teachers_count:response.data.teachers_count, - students_count:response.data.students_count, - courses_count:response.data.courses_count, - shixuns_count:response.data.shixuns_count, - school:response.data.school, - }) - } - }).catch((error) => { - console.log(error) - this.setState({ - teachers_count:0, - students_count:0, - courses_count:0, - shixuns_count:0, - school:"", - }) - }); - } - - //获取实训报告数 - Numberofinternshipreports=()=>{ - const id =this.props.match.params.id; - const url=`/colleges/${id}/shixun_report_count.json`; - axios.get(url).then((response) => { - if(response===null||response===undefined){ - this.setState({ - shixun_report_count:0, - }) - return - } - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - this.setState({ - shixun_report_count:0, - }) - }else{ - if (response.data.status === -1){ - this.setState({ - shixun_report_count:0, - }) - return - } - this.setState({ - shixun_report_count:response.data.shixun_report_count, - }) - } - }).catch((error) => { - console.log(error) - this.setState({ - shixun_report_count:0, - }) - }); - } - - //学员实战时间 - Actualcombattimeoftrainees=()=>{ - const id =this.props.match.params.id; - const url=`/colleges/${id}/shixun_time.json`; - axios.get(url).then((response) => { - if(response===null||response===undefined){ - this.setState({ - shixun_time:0, - }) - return - } - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - this.setState({ - shixun_time:0, - }) - }else{ - if (response.data.status === -1){ - this.setState({ - shixun_time:0, - }) - return - } - this.setState({ - shixun_time:response.data.shixun_time, - }) - } - }).catch((error) => { - console.log(error) - this.setState({ - shixun_time:0, - }) - }); - } - - //课堂信息 - Classnumber=(page,per_page)=>{ - const id =this.props.match.params.id; - const url=`/colleges/${id}/course_statistics.json`; - this.setState({ - coursesloading:true - }) - axios.get(url,{params:{ - page:page, - per_page:per_page, - } - }).then((response) => { - if(response===null||response===undefined){ - this.setState({ - courses:[], - course_count:0 - }) - return - } - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - this.setState({ - courses:[], - course_count:0 - }) - }else{ - if (response.data.status === -1){ - this.setState({ - courses:[], - course_count:0 - }) - return - } - this.setState({ - courses:response.data.courses, - course_count:response.data.course_count, - page:page, - limit:per_page - }) - } - this.setState({ - coursesloading:false - }) - }).catch((error) => { - this.setState({ - courses:[], - course_count:0, - coursesloading:false - }) - }); - } - - //教师排名 - Teacherranking=(page,per_page)=>{ - const id =this.props.match.params.id; - const url=`/colleges/${id}/teachers.json`; - this.setState({ - teachersloading:true - }) - axios.get(url,{params:{ - page:page, - per_page:per_page, - } - }).then((response) => { - if(response===null||response===undefined){ - this.setState({ - teachers:[], - teacher_count:0 - }) - return - } - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - this.setState({ - teachers:[], - teacher_count:0 - }) - }else{ - if (response.data.status === -1){ - this.setState({ - teachers:[], - teacher_count:0 - }) - return - } - let teachers=[]; - if(response.data.teachers){ - for(let i=0;i { - this.setState({ - teachers:[], - teacher_count:0, - teachersloading:false - }) - }); - } - //学生排名 - - Studentranking=(page,per_page)=>{ - const id =this.props.match.params.id; - const url=`/colleges/${id}/student_shixun.json`; - this.setState({ - studentsloading:true - }) - axios.get(url,{params:{ - page:page, - per_page:per_page, - } - }).then((response) => { - if(response===null||response===undefined){ - this.setState({ - students:[], - student_count:0, - }) - return - } - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - this.setState({ - students:[], - student_count:0, - }) - }else{ - if (response.data.status === -1){ - this.setState({ - students:[], - student_count:0, - }) - return - } - let students=[]; - if(response.data.teachers){ - for(let i=0;i { - this.setState({ - students:[], - student_count:0, - studentsloading:false - }) - }); - } - - //在线实训情况 - Onlinetraining=()=>{ - const id =this.props.match.params.id; - const url=`/colleges/${id}/shixun_chart_data.json`; - axios.get(url).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - this.setState({ - shixun_chart_data:[], - shixun_chart_datanames:[] - }) - }else{ - if (response.data.status === -1){ - this.setState({ - shixun_chart_data:[], - shixun_chart_datanames:[] - }) - return - } - - this.setState({ - shixun_chart_data:response.data.data, - shixun_chart_datanames:response.data.names - }) - } - }).catch((error) => { - this.setState({ - shixun_chart_data:[], - shixun_chart_datanames:[] - }) - }); - } - //最热测评 - Hottest=()=>{ - const id =this.props.match.params.id; - const url=`/colleges/${id}/student_hot_evaluations.json`; - axios.get(url).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - this.setState({ - studentionsnames: [], - studentionsvalues: [] - }) - }else { - if (response.data.status === -1) { - this.setState({ - studentionsnames: [], - studentionsvalues: [] - }) - return - } - this.setState({ - studentionsnames: response.data.names, - studentionsvalues: response.data.values - }) - } - }).catch((error) => { - this.setState({ - studentionsnames: [], - studentionsvalues: [] - }) - }); - } - - table1handleChange(){ - - } - - //塞选 - paginationonChange=(pageNumber)=>{ - this.Classnumber(pageNumber,10); - } - - paginationonChanges=(pageNumber)=>{ - this.Teacherranking(pageNumber,10); - } - paginationonChangess=(pageNumber)=>{ - this.Studentranking(pageNumber,10); - } - render() { - let {columns,page,limit,total_users,teacherranking,studentranking, - teachers_count,students_count, courses_count, shixuns_count,shixun_report_count,shixun_time,courses,course_count,school,teachers, - pages,limits, teacher_count,teachersloading,coursesloading,pagess,limitss,studentsloading,students,student_count,shixun_chart_data, - shixun_chart_datanames, studentionsnames,studentionsvalues - } = this.state; - - return ( -
-
-
-
{school}
-
-
- {/*//教师1*/} -
- 教师 -
-
- {teachers_count?teachers_count:0} -
-
- -
-
- 学生 -
-
- {students_count?students_count:0} -
-
- -
-
- 课堂 -
-
- {courses_count?courses_count:0} -
-
- -
-
- 共建实训 -
-
- {shixuns_count?shixuns_count:0} -
-
- {/*//教师2*/} - - - - -
-
-
-
-

- 基本使用情况 -

- {/*基本使用情况1*/} -
-

- 教师 -

-

- 学生 -

-

- 课堂 -

-

- 共建实训 -

-

- 实习报告 -

-

- 学员实战时间 -

-
- - - {/*基本使用情况2*/} -
-
- { - teachers_count? -
{teachers_count}
- : - - } -
-
- { - students_count? -
{students_count}
- : - - } -
-
- { - courses_count? -
{courses_count}
- : - - } -
-
- { - shixuns_count? -
{shixuns_count}
- : - - } -
-
- { - shixun_report_count? -
{shixun_report_count}
- : - - } -
-
- { - shixun_time? -
{shixun_time}
- : - - } -
-
- {/*基本使用情况3结束*/} -
- - -
-

- 课堂 -

- { - courses===null? -
- -
- - : - JSON.stringify(courses) === "[]" ? - - - - : -
-
- -
- {courses === undefined ? "" : } - - - { - course_count>=11? -
-
- -
- -
- :"" - } - - - } - - - - - -
-
-

- 教师排名 -

- { - teachers===null? -
- -
- - : - JSON.stringify(teachers) === "[]" ? - - - - : -
- -
- {teachers === undefined ? "" :
} - - - } - - - - {/*
*/} - {/*
*/} - {/* */} - {/*
*/} - - {/*
*/} - - -
-

- 在线实训情况 -

- { - shixun_chart_data===null? -
- -
- - : - JSON.stringify(shixun_chart_data) === "[]" ? - - - - : - - - - } - -
-
- - - -
-
-

- 学生排名 -

- { - students === null ? -
- -
- - : - JSON.stringify(students) === "[]" ? - - - - : -
- -
- {students === undefined ? "" :
} - - - } - {/*
*/} - {/*
*/} - {/* */} - {/*
*/} - - {/*
*/} - - - - -
- -
-

- 最热评测 -

- { - studentionsnames===null? -
- -
- - : - JSON.stringify(studentionsnames) === "[]" ? - - - - : - - - - } - - -
-
- - - ) - } -} -export default SnackbarHOC() (TPMIndexHOC ( College )); - - diff --git a/public/react/src/college/colleagechart/Colleagechart.js b/public/react/src/college/colleagechart/Colleagechart.js deleted file mode 100644 index fca01280a..000000000 --- a/public/react/src/college/colleagechart/Colleagechart.js +++ /dev/null @@ -1,84 +0,0 @@ -import React, {Component} from "react"; -import {WordsBtn} from 'educoder'; -import {Table} from "antd"; -import {Link,Switch,Route,Redirect} from 'react-router-dom'; -const echarts = require('echarts'); - - - -function startechart(data,datanane){ - var effChart = echarts.init(document.getElementById('shixun_skill_chart')); - - var option = { - - tooltip : { - trigger: 'item', - formatter: "{d}%
" - }, - legend: { - // orient: 'vertical', - // top: 'middle', - bottom: 50, - left: 'center', - data: datanane - }, - series : [ - { - type: 'pie', - radius : '65%', - center: ['50%', '35%'], - selectedMode: 'single', - data:data, - itemStyle: { - emphasis: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - } - } - } - ] - }; - effChart.setOption(option); -} -class Colleagechart extends Component { - - constructor(props) { - super(props); - this.state = { - } - } - - componentDidMount() { - startechart(this.props.data,this.props.datanane) - } - - - componentDidUpdate = (prevProps) => { - if (prevProps.data!= this.props.data) { - startechart(this.props.data,this.props.datanane) - } - } - - - render() { - let {data}=this.props; - - return ( -
- -
-
- - - - -
- - ) - } -} - -export default Colleagechart; diff --git a/public/react/src/college/colleagechart/Colleagechartzu.js b/public/react/src/college/colleagechart/Colleagechartzu.js deleted file mode 100644 index 5c0269700..000000000 --- a/public/react/src/college/colleagechart/Colleagechartzu.js +++ /dev/null @@ -1,149 +0,0 @@ -import React, {Component} from "react"; -import {WordsBtn} from 'educoder'; -import {Table} from "antd"; -import {Link,Switch,Route,Redirect} from 'react-router-dom'; -const echarts = require('echarts'); - - - -function startechart(names, values){ - var effChart = echarts.init(document.getElementById('shixun_skill_charts')); - - var Color = ['#962e66', '#623363', '#CCCCCC', '#9A9A9A', '#FF8080', '#FF80C2', '#B980FF', '#80B9FF', '#6FE9FF', '#4DE8B4', '#F8EF63', '#FFB967']; - - var option = { - backgroundColor: '#fff', - grid: { - left: '3%', - right: '8%', - bottom: '15%', - containLabel: true - }, - - tooltip: { - show: "true", - trigger: 'item', - formatter: '{c0}', - backgroundColor: 'rgba(0,0,0,0.7)', // 背景 - padding: [8, 10], //内边距 - extraCssText: 'box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);', //添加阴影 - axisPointer: { // 坐标轴指示器,坐标轴触发有效 - type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' - } - }, - xAxis: { - type: 'value', - axisTick: { - show: false - }, - axisLine: { - show: true, - lineStyle: { - color: '#CCCCCC' - } - }, - splitLine: { - show: false, - lineStyle: { - color: '#CCCCCC' - } - }, - axisLabel: { - textStyle: { - color: '#656565', - fontWeight: 'normal', - fontSize: '12' - }, - formatter: '{value}' - } - }, - yAxis: { - type: 'category', - axisLine: { - lineStyle: { - color: '#cccccc' - } - }, - splitLine: { - show: false - }, - axisTick: { - show: false - }, - splitArea: { - show: false - }, - axisLabel: { - inside: false, - textStyle: { - color: '#656565', - fontWeight: 'normal', - fontSize: '12' - } - }, - data: names - }, - series: [{ - name: '', - type: 'bar', - itemStyle: { - normal: { - show: true, - color: function(params) { - return Color[params.dataIndex] - }, - barBorderRadius: 50, - borderWidth: 0, - borderColor: '#333' - } - }, - barGap: '0%', - barCategoryGap: '50%', - data: values - } - - ] - }; - effChart.setOption(option); -} -class Colleagechartzu extends Component { - - constructor(props) { - super(props); - this.state = { - } - } - - componentDidMount() { - startechart(this.props.data,this.props.datavule) - } - - - componentDidUpdate = (prevProps) => { - if (prevProps.data!= this.props.data) { - startechart(this.props.data,this.props.datavule) - } - } - - - render() { - let {data}=this.props; - - return ( -
- -
-
- - - - -
- - ) - } -} - -export default Colleagechartzu; diff --git a/public/react/src/college/colleagecss/colleage.css b/public/react/src/college/colleagecss/colleage.css deleted file mode 100644 index 801b86603..000000000 --- a/public/react/src/college/colleagecss/colleage.css +++ /dev/null @@ -1,213 +0,0 @@ -.yslstatistic-header { - width: 100%; - height: 240px; - background-image: url('/images/educoder/statistics.jpg'); - background-size: 100% 100%; -} -.yslborder{ - border: 1px solid; -} -.yslstatistic-header-title{ - flex: 1; - display: flex; - align-items: center; - color: #4CACFF; - font-size: 32px; -} -.yslstatistic-header-content{ - width: 100%; - display: flex; - justify-content: space-around; -} -.yslstatistic-header-item{ - margin-bottom: 22px; - display: flex; - flex-direction: column; - align-items: center; - color: #fff; -} -.yslstatistic-header-item-label{ - color: #989898; -} - -.yslstatistic-base-item-label{ - width: 217px; - text-align: center; - font-size: 16px; - height: 48px; - line-height: 48px; - color: #686868; - background: #F5F5F5; - border-top: 1px solid #EBEBEB; -} -.yslstatistic-base-item-labels{ - width: 217px; - text-align: center; - height: 100px; - line-height: 100px; - background: #ffffff; - border-top: 1px solid #EBEBEB; - border-bottom: 1px solid #EBEBEB; -} -.yslstatistic-base-item-labelsp{ - color: #000000; - font-size: 24px; -} -.yslstatistic-base-item-labelsspan{ - color: #000000; - margin-left: 5px; - font-size: 16px; -} -.jibenshiyong100{ - width: 100%; -} - -.yslstatistic-header-item-content{ - font-size: 24px; -} -/* 中间居中 */ -.intermediatecenter{ - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} -/* 简单居中 */ -.intermediatecenterysls{ - display: flex; - align-items: center; -} -.spacearound{ - display: flex; - justify-content: space-around; - -} -.spacebetween{ - display: flex; - justify-content: space-between; -} -/* 头顶部居中 */ -.topcenter{ - display: -webkit-flex; - flex-direction: column; - align-items: center; - -} - - -/* x轴正方向排序 */ -/* 一 二 三 四 五 六 七 八 */ -.sortinxdirection{ - display: flex; - flex-direction:row; -} -/* x轴反方向排序 */ -/* 八 七 六 五 四 三 二 一 */ -.xaxisreverseorder{ - display: flex; - flex-direction:row-reverse; -} -/* 垂直布局 正方向*/ -/* 一 - 二 - 三 - 四 - 五 - 六 - 七 - 八 */ -.verticallayout{ - display: flex; - flex-direction:column; -} -/* 垂直布局 反方向*/ -.reversedirection{ - display: flex; - flex-direction:column-reverse; -} - -.h4{ - font-size: 1.5rem; - font-weight: 500 !important; -} -.ysllinjibenshiyong{ - font-weight: 500; - line-height: 1.2; - padding: 2rem 1.25rem; - border-bottom: unset; - background:#fff; -} -.linjibenshiyong{ - font-weight: 500; - line-height: 1.2; - padding: 2rem 1.25rem; - border-bottom: unset; - background:#fff; - box-shadow:0px 6px 12px 0px rgba(0,0,0,0.1); - border-radius:2px; -} -.yslslinjibenshiyong{ - font-weight: 500; - line-height: 1.2; - border-bottom: unset; - box-shadow:0px 6px 12px 0px rgba(0,0,0,0.1); - border-radius:2px; -} -.yinyin{ - background: #fff; - box-shadow:0px 6px 12px 0px rgba(0,0,0,0.1); - border-radius:2px; -} -.edu-back-eeee{ - background:#EEEEEE !important; -} -.mt-4{ - margin-top: 1.5rem !important; -} - -.statistic-label{ - padding: 2rem 1.25rem; - font-size: 1.5rem; - font-weight: 400 !important; -} -.mb50{ - padding-bottom: 50px !important; -} -.mt40{ - margin-top: 40px; -} -.mb80{ - margin-bottom: 80px; -} -.task-hide{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} -a:hover{ - color:#0056b3; -} -.color-blue{ - color: #4CACFF; -} - -.color-huang{ - color:#ffc107 !important -} -.maxnamewidth105{ - max-width: 105px; - overflow:hidden; - text-overflow:ellipsis; - white-space:nowrap; - cursor: default; -} -.maxnamewidth247{ - max-width: 247px; - overflow:hidden; - text-overflow:ellipsis; - white-space:nowrap; - cursor: default; -} -.maxnamewidth340{ - max-width: 340px; - overflow:hidden; - text-overflow:ellipsis; - white-space:nowrap; - cursor: default; -} diff --git a/public/react/src/common/Component.js b/public/react/src/common/Component.js deleted file mode 100644 index e49d83b84..000000000 --- a/public/react/src/common/Component.js +++ /dev/null @@ -1,5 +0,0 @@ -import md5 from 'md5'; -export function setmiyah(logins){ - const opens ="79e33abd4b6588941ab7622aed1e67e8"; - return md5(opens+logins); -} diff --git a/public/react/src/common/Const.js b/public/react/src/common/Const.js deleted file mode 100644 index f680cb78d..000000000 --- a/public/react/src/common/Const.js +++ /dev/null @@ -1,19 +0,0 @@ -/** -EDU_ADMIN = 1 # 超级管理员 -EDU_BUSINESS = 2 # 运营人员 -EDU_SHIXUN_MANAGER = 3 # 实训管理员 -EDU_SHIXUN_MEMBER = 4 # 实训成员 -EDU_CERTIFICATION_TEACHER = 5 # 平台认证的老师 -EDU_GAME_MANAGER = 6 # TPI的创建者 -EDU_TEACHER = 7 # 平台老师,但是未认证 -EDU_NORMAL = 8 # 普通用户 -*/ - -export const EDU_ADMIN = 1 // 超级管理员 -export const EDU_BUSINESS = 2 // # 运营人员 -export const EDU_SHIXUN_MANAGER = 3 // 实训管理员 -export const EDU_SHIXUN_MEMBER = 4 // 实训成员 -export const EDU_CERTIFICATION_TEACHER = 5 // 平台认证的老师 -export const EDU_GAME_MANAGER = 6 // TPI的创建者 -export const EDU_TEACHER = 7 // 平台老师,但是未认证 -export const EDU_NORMAL = 8 // 普通用户 \ No newline at end of file diff --git a/public/react/src/common/DateUtil.js b/public/react/src/common/DateUtil.js deleted file mode 100644 index dc2288ff3..000000000 --- a/public/react/src/common/DateUtil.js +++ /dev/null @@ -1,69 +0,0 @@ -import moment from "moment"; - -// 处理整点 半点 -// 取传入时间往后的第一个半点 -export function handleDateString(dateString) { - if (!dateString) return dateString; - const ar = dateString.split(':') - if (ar[1] == '00' || ar[1] == '30') { - return dateString - } - const miniute = parseInt(ar[1]); - if (miniute < 30 || miniute == 60) { - return [ar[0], '30'].join(':') - } - if (miniute < 60) { - // 加一个小时 - const tempStr = [ar[0], '00'].join(':'); - const format = "YYYY-MM-DD HH:mm"; - const _moment = moment(tempStr, format) - _moment.add(1, 'hours') - return _moment.format(format) - } - - return dateString -} - -// 给moment对象取下一个半点或整点 -export function getNextHalfHourOfMoment(moment) { - if (!moment) { - return moment - } - const minutes = moment.minutes() - if (minutes < 30) { - moment.minutes(30) - } else if (minutes < 60) { - moment.minutes(0).add(1, 'hours') - } - return moment -} - -export function formatDuring(mss){ - var days = parseInt(mss / (1000 * 60 * 60 * 24)); - var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); - var minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60)); - // console.log("formatDuringformatDuring"); - // console.log(days); - // console.log(hours); - // console.log(minutes); - // console.log(Math.abs(days)); - // console.log(Math.abs(hours)); - // console.log(Math.abs(minutes)); - - try { - days = Math.abs(days); - } catch (e) { - - } - try { - hours = Math.abs(hours); - } catch (e) { - - } - try { - minutes = Math.abs(minutes); - } catch (e) { - - } - return days + "天" + hours + "小时" + minutes + "分"; -} \ No newline at end of file diff --git a/public/react/src/common/Env.js b/public/react/src/common/Env.js deleted file mode 100644 index 9830d7725..000000000 --- a/public/react/src/common/Env.js +++ /dev/null @@ -1,8 +0,0 @@ -export function isDev() { - return window.location.port === "3007"; -} - -// const isMobile -export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); - -// const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase())); diff --git a/public/react/src/common/EventUtil.js b/public/react/src/common/EventUtil.js deleted file mode 100644 index 0b98925ef..000000000 --- a/public/react/src/common/EventUtil.js +++ /dev/null @@ -1,70 +0,0 @@ -const $ = window.$; -export function trigger(eventName, data) { - $(window).trigger(eventName, data); -} - -export function on(eventName, callback) { - $(window).on(eventName, (event, data)=>{ - callback && callback(event, data) - }); -} - -export function off(eventName) { - $(window).off(eventName); -} - -// https://stackoverflow.com/questions/28230845/communication-between-tabs-or-windows -const broadcastChannelMap = {} - -const localStorageMap = {} -function postMessageByLocalStorage(eventName, message) { - console.log('storage event trigger:', eventName) - localStorage.setItem(eventName, JSON.stringify(message)); -} -function onMessageByLocalStorage(eventName, callback) { - console.log('storage event register:', eventName) - localStorageMap[eventName] = callback; -} -window.addEventListener("storage", function(ev) { - const cb = localStorageMap[ev.key]; - // console.log('storage event:', ev) - if (cb) { - cb(JSON.parse(ev.newValue)) - } -}); -export function broadcastChannelPostMessage(eventName, message) { - if (!window.BroadcastChannel) { - console.error('浏览器不支持BroadcastChannel') - - postMessageByLocalStorage(eventName, message) - return; - } - var bc; - if (!broadcastChannelMap[eventName]) { - bc = new window.BroadcastChannel(eventName); - broadcastChannelMap[eventName] = bc - } else { - bc = broadcastChannelMap[eventName] - } - bc.postMessage(message); /* send */ - -} - -export function broadcastChannelOnmessage(eventName, callback) { - if (!window.BroadcastChannel) { - console.error('浏览器不支持BroadcastChannel') - onMessageByLocalStorage(eventName, callback) - return; - } - var bc; - if (!broadcastChannelMap[eventName]) { - bc = new window.BroadcastChannel(eventName); - broadcastChannelMap[eventName] = bc - } else { - bc = broadcastChannelMap[eventName] - } - bc.onmessage = function (ev) { - console.log(ev); - callback && callback(ev) - } -} \ No newline at end of file diff --git a/public/react/src/common/IEVersion.js b/public/react/src/common/IEVersion.js deleted file mode 100644 index 046344381..000000000 --- a/public/react/src/common/IEVersion.js +++ /dev/null @@ -1,28 +0,0 @@ -export function IEVersion(){ - var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 - var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器 - var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器 - var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; - if(isIE) { - var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); - reIE.test(userAgent); - var fIEVersion = parseFloat(RegExp["$1"]); - if(fIEVersion == 7) { - return 7; - } else if(fIEVersion == 8) { - return 8; - } else if(fIEVersion == 9) { - return 9; - } else if(fIEVersion == 10) { - return 10; - } else { - return 6;//IE版本<=7 - } - } else if(isEdge) { - return 'edge';//edge - } else if(isIE11) { - return 11; //IE11 - }else{ - return -1;//不是ie浏览器 - } -} \ No newline at end of file diff --git a/public/react/src/common/LoadingSpin.js b/public/react/src/common/LoadingSpin.js deleted file mode 100644 index 80a798906..000000000 --- a/public/react/src/common/LoadingSpin.js +++ /dev/null @@ -1,29 +0,0 @@ -import React, { Component } from 'react'; -import {Spin} from 'antd'; -class LoadingSpin extends Component{ - constructor(props) { - super(props) - } - render(){ - const { style } = this.props; - return( -
- - -
- ) - } -} -export default LoadingSpin; \ No newline at end of file diff --git a/public/react/src/common/LogUtil.js b/public/react/src/common/LogUtil.js deleted file mode 100644 index da5cbc75e..000000000 --- a/public/react/src/common/LogUtil.js +++ /dev/null @@ -1,61 +0,0 @@ -import moment from 'moment' -const log = require('loglevel'); -log.enableAll(); - -// 获取后可以改变日志级别 -window.getLog = () => { - return log; -} -window._logWithTimeStamp = true; - -const timeStamp = () => { - if (window._logWithTimeStamp) { - return `[${moment().format('hh:mm:ss')}] ` - } - return '' -} -/* - 带trace的、默认折叠起来的控制台输出 - 第一个参数最好传入string类型的标识,接着可以跟任意类型任意个数的参数,各个参数都会打印到控制台 -*/ -export function trace_collapse(content) { - if (console.groupCollapsed) { - console.groupCollapsed(typeof content == 'string' ? content : 'trace_collapse'); - log.trace(arguments); - console.groupEnd(); - } else { - trace(content) - } -} - -export function trace(content) { - log.trace(content); -} -export function debug(content) { - log.debug(content); -} -export function info(content) { - log.info(content); -} -export function warn(content) { - log.warn(content); -} -export function error(content) { - log.error(content); -} - -export function trace_c(content) { - log.trace(`${timeStamp()}%c${content}`, 'color:magenta;'); -} -export function debug_c(content) { - log.debug(`${timeStamp()}%c${content}`, 'color:cyan;'); -} -export function info_c(content) { - log.info(`${timeStamp()}%c${content}`, 'color:blue;'); -} -export function warn_c(content) { - log.warn(`${timeStamp()}%c${content}`, 'color:crimson;'); -} -export function error_c(content) { - log.error(`${timeStamp()}%c${content}`, 'color:red;'); -} diff --git a/public/react/src/common/RouterUtil.js b/public/react/src/common/RouterUtil.js deleted file mode 100644 index d20a152b5..000000000 --- a/public/react/src/common/RouterUtil.js +++ /dev/null @@ -1,15 +0,0 @@ -import { queryString } from 'educoder' -export function updatePageParams(pageNum, props) { - const url = props.match.url - - const _search = props.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - - // 修改page參數 - parsed.page = pageNum - - props.history.push(`${url}?${queryString.stringify(parsed)}`) -} diff --git a/public/react/src/common/ShowSpin.js b/public/react/src/common/ShowSpin.js deleted file mode 100644 index 2058caa9d..000000000 --- a/public/react/src/common/ShowSpin.js +++ /dev/null @@ -1,33 +0,0 @@ -import React, { Component } from 'react'; -import { SnackbarHOC } from 'educoder'; -import { TPMIndexHOC } from '../modules/tpm/TPMIndexHOC'; -import {Spin,Alert} from 'antd'; - -class ShowSpin extends Component{ - constructor(props) { - super(props) - } - - - - render() { - let marigin={ - width: '100%', - minHeight: '500px', - } - return ( - - - - - - - - ) - } -} - -export default SnackbarHOC() ( TPMIndexHOC(ShowSpin) ); \ No newline at end of file diff --git a/public/react/src/common/SnackbarHOC.js b/public/react/src/common/SnackbarHOC.js deleted file mode 100644 index fe5bc4901..000000000 --- a/public/react/src/common/SnackbarHOC.js +++ /dev/null @@ -1,91 +0,0 @@ -import React, { Component } from 'react'; -import Snackbar from 'material-ui/Snackbar'; -import Fade from 'material-ui/transitions/Fade'; -import { notification } from 'antd' -export function SnackbarHOC(options = {}) { - return function wrap(WrappedComponent) { - return class Wrapper extends Component { - constructor(props) { - super(props); - this.showSnackbar = this.showSnackbar.bind(this) - this.state = { - snackbarText: '', - snackbarOpen: false, - } - } - - handleSnackbarClose() { - this.setState({ - snackbarOpen: false, - snackbarVertical: '', - snackbarHorizontal: '', - }) - } - - // 全局的snackbar this.props.showSnackbar调用即可 - // showSnackbar(description, message = "提示",icon) { - // // this.setState({ - // // snackbarOpen: true, - // // snackbarText: text, - // // snackbarVertical: vertical, - // // snackbarHorizontal: horizontal, - // // }) - // const data = { - // message, - // description - // } - // if (icon) { - // data.icon = icon; - // } - // notification.open(data); - // } - - showSnackbar(text, vertical, horizontal) { - this.setState({ - snackbarOpen: true, - snackbarText: text, - snackbarVertical: vertical, - snackbarHorizontal: horizontal, - }) - } - //个别情况需要走 - showNotification = (description, message = "提示", icon) => { - const data = { - message, - description - } - if (icon) { - data.icon = icon; - } - notification.open(data); - } - render() { - const { snackbarOpen, snackbarText, snackbarHorizontal, snackbarVertical } = this.state; - - - return ( - - this.handleSnackbarClose()} - transition={Fade} - SnackbarContentProps={{ - 'aria-describedby': 'message-id', - }} - resumeHideDuration={2000} - message={{this.state.snackbarText}} - /> - - - - - ) - } - } - } -} \ No newline at end of file diff --git a/public/react/src/common/Store.js b/public/react/src/common/Store.js deleted file mode 100644 index b3c0dee50..000000000 --- a/public/react/src/common/Store.js +++ /dev/null @@ -1,14 +0,0 @@ -import store from 'store' - -export function toStore(key, val) { - let _config = store.get('__ec'); - if (!_config) _config = {}; - _config[key] = val; - store.set('__ec', _config) -} - -export function fromStore(key, defaultVal) { - let _config = store.get('__ec'); - if (!_config) return defaultVal; - return _config[key] === undefined ? defaultVal : _config[key]; -} \ No newline at end of file diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js deleted file mode 100644 index 4c445dcbf..000000000 --- a/public/react/src/common/TextUtil.js +++ /dev/null @@ -1,79 +0,0 @@ -import { bytesToSize, getUrl, getUrl2 } from 'educoder'; -const $ = window.$ - -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 - if (selector && oldContent && oldContent.startsWith(' { - _doDownload(options) - }); - } - -} - -export function appendFileSizeToUploadFile(item) { - return `${item.title}${uploadNameSizeSeperator}${item.filesize}` -} -export function appendFileSizeToUploadFileAll(fileList) { - return fileList.map(item => { - if (item.name.indexOf(uploadNameSizeSeperator) == -1) { - return Object.assign({}, item, {name: `${item.name}${uploadNameSizeSeperator}${bytesToSize(item.size)}`}) - } - return item - }) -} -export const uploadNameSizeSeperator = '  ' - -export const sortDirections = ["ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", - "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", - "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", - "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", "ascend", "descend", ] \ No newline at end of file diff --git a/public/react/src/common/UnitUtil.js b/public/react/src/common/UnitUtil.js deleted file mode 100644 index 8b115dffb..000000000 --- a/public/react/src/common/UnitUtil.js +++ /dev/null @@ -1,6 +0,0 @@ -export function bytesToSize(bytes) { - var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; - if (bytes == 0) return '0 Byte'; - var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))); - return parseFloat(bytes / Math.pow(1024, i), 2).toFixed(1) + ' ' + sizes[i]; -} \ No newline at end of file diff --git a/public/react/src/common/UrlTool.js b/public/react/src/common/UrlTool.js deleted file mode 100644 index 30afcf8a5..000000000 --- a/public/react/src/common/UrlTool.js +++ /dev/null @@ -1,187 +0,0 @@ -import React from "react"; -import md5 from 'md5'; -import {Input} from "antd"; -const { Search } = Input; - -const $ = window.$; -const isDev = window.location.port == 3007; -export const TEST_HOST = "https://test-newweb.educoder.net" -export function getImageUrl(path) { - // https://www.educoder.net - // https://testbdweb.trustie.net - // const local = 'http://localhost:3000' - const local = 'https://test-newweb.educoder.net' - if (isDev) { - return `${local}/${path}` - } - return `/${path}`; -} - -export function setImagesUrl(path){ - const local = 'https://test-newweb.educoder.net' - let firstStr=path.substr(0,1); - // console.log(firstStr); - if(firstStr=="/"){ - return isDev?`${local}${path}`:`${path}`; - }else{ - return isDev?`${local}/${path}`:`/${path}`; - } -} - -export function getUrl(path, goTest) { - // https://www.educoder.net - // https://testbdweb.trustie.net - - // 如果想所有url定位到测试版,可以反注释掉下面这行 - //goTest = true - // testbdweb.educoder.net testbdweb.trustie.net - // const local = goTest ? 'https://testeduplus2.educoder.net' : 'http://localhost:3000' - // const local = 'https://testeduplus2.educoder.net' - const local = 'http://localhost:3007' - if (isDev) { - return `${local}${path?path:''}` - } - return `${path ? path: ''}`; -} - -export function getUrlmys(path, goTest) { - // https://www.educoder.net - // https://testbdweb.trustie.net - - // 如果想所有url定位到测试版,可以反注释掉下面这行 - //goTest = true - // testbdweb.educoder.net testbdweb.trustie.net - // const local = goTest ? 'https://testeduplus2.educoder.net' : 'http://localhost:3000' - // const local = 'https://testeduplus2.educoder.net' - const local = 'https://test-jupyterweb.educoder.net' - if (isDev) { - return `${local}${path?path:''}` - } - return `${path ? path: ''}`; -} -export function getStaticUrl() { - const local = TEST_HOST; - if (isDev) { - return local - } - // todo cdn - return '' -} -export function getUrl2(path, goTest) { - const local = 'http://localhost:3000' - if (isDev) { - return `${local}${path?path:''}` - } - return `${path ? path: ''}`; -} -const newopens ="79e33abd4b6588941ab7622aed1e67e8"; -let newtimestamp; -let checkSubmitFlgs = false; -function railsgettimess(proxy) { - if(checkSubmitFlgs===false){ - $.ajax({url:proxy, - async:false,success:function(data){ - if(data.status===0){ - newtimestamp=data.message; - checkSubmitFlgs = true; - } - }}) - - window.setTimeout(function () { - checkSubmitFlgs=false; - }, 2500); - } -} - - - - -export function Railsgettimes() { - railsgettimess(`${getUrl()}/api/main/first_stamp.json`); - // railsgettimess(`https://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`); -} -export function getmyUrl(geturl) { - - return `${getUrl()}${geturl}`; -} - -export function getUploadActionUrl(path, goTest) { - Railsgettimes() - let anewopens=md5(newopens+newtimestamp); - return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}`; -} - -export function getUploadActionUrltwo(id) { - Railsgettimes() - let anewopens=md5(newopens+newtimestamp); - return `${getUrlmys()}/api/shixuns/${id}/upload_data_sets.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` -} - -export function getUploadActionUrlthree() { - Railsgettimes() - let anewopens=md5(newopens+newtimestamp); - return `${getUrlmys()}/api/jupyters/import_with_tpm.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` -} - -export function getUploadActionUrlOfAuth(id) { - Railsgettimes() - let anewopens=md5(newopens+newtimestamp); - return `${getUrl()}/api/users/accounts/${id}/auth_attachment.json${isDev ? `?debug=${window._debugType || 'admin'}&randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`}` -} - -export function getRandomNumber(type) { - Railsgettimes() - let anewopens=md5(newopens+newtimestamp); - return type===true?`randomcode=${newtimestamp}&client_key=${anewopens}`:`?randomcode=${newtimestamp}&client_key=${anewopens}` -} - -export function test(path) { - return `${path}`; -} - -export function toPath(path) { - window.open(path, '_blank'); -} - - -export function getTaskUrlById(id) { - return `/tasks/${id}` -} - -export function getRandomcode(url) { - Railsgettimes() - let anewopens=md5(newopens+newtimestamp); - - if (url.indexOf('?') == -1) { - return `${url}?randomcode=${newtimestamp}&client_key=${anewopens}` - }else { - return `${url}&randomcode=${newtimestamp}&client_key=${anewopens}` - } - -} - -export function htmlEncode(str) { - var s = ""; - if (str.length === 0) { - return ""; - } - s = str.replace(/&/g, "&"); - s = s.replace(//g, ">"); - s = s.replace(/ /g, " "); - s = s.replace(/\'/g, "'");//IE下不支持实体名称 - s = s.replace(/\"/g, """); - return s; -} - -export function publicSearchs(Placeholder,onSearch,onInputs,onChanges,loadings) { - return() -} diff --git a/public/react/src/common/UrlTool2.js b/public/react/src/common/UrlTool2.js deleted file mode 100644 index ae2e3e8e6..000000000 --- a/public/react/src/common/UrlTool2.js +++ /dev/null @@ -1,51 +0,0 @@ -const queryString = { - stringify: function(params) { - let paramsUrl = ''; - for (let key in params) { - // https://stackoverflow.com/questions/6566456/how-to-serialize-an-object-into-a-list-of-url-query-parameters - if (params[key] != undefined) { - if (params[key].constructor === Array) { - for (let singleArrIndex of params[key]) { - paramsUrl = paramsUrl + key + '[]=' + singleArrIndex + '&' - } - } else { - paramsUrl += `${key}=${encodeURIComponent(params[key])}&` - } - } - } - if (paramsUrl == '') { - return ''; - } - paramsUrl = paramsUrl.substring(0, paramsUrl.length - 1); - return paramsUrl; - }, - parse: function(search) { - // ?a=1&b=2 - if (!search) { - return {} - } - if (search.startsWith('?')) { - search = search.substring(1); - } - if (!search) { - return {} - } - const keyValArray = search.split('&'); - const result = {} - keyValArray.forEach(keyValItem => { - const keyAndVal = keyValItem.split('='); - result[keyAndVal[0]] = keyAndVal[1] - }) - return result; - } -} -/* - query-string用不了 - - Failed to minify the code from this file: - - ./node_modules/_query-string@6.1.0@query-string/index.js:8 - - Read more here: http://bit.ly/2tRViJ9 -*/ -module.exports = queryString diff --git a/public/react/src/common/components/ConditionToolTip.js b/public/react/src/common/components/ConditionToolTip.js deleted file mode 100644 index 254ac0fdf..000000000 --- a/public/react/src/common/components/ConditionToolTip.js +++ /dev/null @@ -1,28 +0,0 @@ -import React,{ Component } from "react"; -import { Modal,Input, Tooltip} from "antd"; - -class ConditionToolTip extends Component{ - constructor(props){ - super(props); - this.state={ - } - } - render(){ - - let { condition } = this.props; - return( - - { - condition ? - - {this.props.children} - : - - {this.props.children} - - } - - ) - } -} -export default ConditionToolTip; \ No newline at end of file diff --git a/public/react/src/common/components/Cropper.js b/public/react/src/common/components/Cropper.js deleted file mode 100644 index 3ce30a8b5..000000000 --- a/public/react/src/common/components/Cropper.js +++ /dev/null @@ -1,288 +0,0 @@ -import React, { Component } from 'react'; - -import { getUrl2, isDev } from 'educoder' -const $ = window.$ - -let _url_origin = getUrl2() -// let _url_origin = `http://47.96.87.25:48080`; - - - -function save_avatar(){ - - // if($(img_lg).html().trim() == ""){ - // $("#avatar-name").html("请先选择图片上传").css("color", 'red'); - // } else { - // $("#avatar-name").html("").css("color", '#333'); - const previewId = this.props.previewId - var img_lg = document.getElementById(previewId || 'img-preview'); - // 截图小的显示框内的内容 - window.html2canvas(img_lg).then(function(canvas) { - // for test - // document.getElementById('canvasWrap').appendChild(canvas); - - var dataUrl = canvas.toDataURL("image/jpeg"); - console.log(dataUrl) - // TODO upload base64 image data to server - }); - return - - // 老版接口: - // html2canvas(img_lg, { - // allowTaint: true, - // taintTest: false, - // onrendered: function(canvas) { - // canvas.id = "mycanvas"; - // //生成base64图片数据 - // var dataUrl = canvas.toDataURL("image/jpeg"); - // console.log(dataUrl) - - // var newImg = document.getElementById("showImg"); - // newImg.src = dataUrl; - // return; - - // imagesAjax(dataUrl); - // $(".avatar-save").attr("disabled","true"); - // } - // }); - // } -} -/** - props 说明: - imageId 源图片标签的id - previewId crop后预览dom的id - imageSrc 源图片src - width 数字格式 - height 数字格式 -*/ -class Cropper extends Component { - state = { - }; - - handleChange = (info) => { - } - - componentDidMount() { - this.options = { - aspectRatio: 1, - crop(event) { - // console.log(event.detail.x); - // console.log(event.detail.y); - // console.log(event.detail.width); - // console.log(event.detail.height); - // console.log(event.detail.rotate); - // console.log(event.detail.scaleX); - // console.log(event.detail.scaleY); - }, - preview: this.props.previewId ? `#${this.props.previewId}` : '.img-preview', - } - - if (!window.Cropper) { - $.ajaxSetup({ - cache: true - }); - const _isDev = isDev() - let _path = _isDev ? 'public' : 'build' - - $('head').append($('') - .attr('href', `${_url_origin}/react/${_path}/js/cropper/cropper.min.css`)); - - $.getScript( - `${_url_origin}/react/${_path}/js/cropper/cropper.js`, - (data, textStatus, jqxhr) => { - - }); - $.getScript( - `${_url_origin}/react/${_path}/js/cropper/html2canvas.min.js`, - (data, textStatus, jqxhr) => { - - }); - } - - setTimeout(() => { - const image = document.getElementById(this.props.imageId || '__image'); - this.cropper = new window.Cropper(image, this.options); - }, 1200) - } - - renew = (image) => { - this.cropper && this.cropper.destroy(); - this.cropper = new window.Cropper(image, this.options); - - } - render() { - - const { width, height, previewId, imageSrc } = this.props; - - return ( -
- {/* This rule is very important, please do not ignore this! */} - -
- {/* http://localhost:3007/images/footNavLogo.png 图片转了后不对 - || "/images/testPicture.jpg" - || "/images/shixun0.jpg" - */} - -
- {/* background: 'aquamarine', - 'border-radius': '128px' - */} - {!previewId &&
-
} - - {/* */} - - {/*
*/} - {/* */} -
- ); - } -} - -export default Cropper; - - -// function aaa () { -// function showedit_headphoto() { -// var html = ` -// - */ - -if(window.wx) { - wx.ready(function () { //需在用户可能点击分享按钮前就先调用 - alert('got wx1') - wx.updateAppMessageShareData({ - title: ' title', // 分享标题 - desc: 'hello world', // 分享描述 - link: 'https://www.educoder.net', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 - imgUrl: 'https://test-newweb.educoder.net/images/educoder/headNavLogo.png', // 分享图标 - success: function () { - // 设置成功 - } - }) - }); - -// wx.onMenuShareAppMessage({ -//             title:' title', // 分享标题 -//             desc:'hello world', // 分享描述 -//             link: 'https://www.educoder.net', //location.href, // 分享链接 -//             imgUrl: 'https://pre-newweb.educoder.net/images/educoder/headNavLogo.png', // 分享图标 -//             type: '', // 分享类型,music、video或link,不填默认为link -//             dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空 -//             success: function () {  -//                 // 用户确认分享后执行的回调函数 -//             }, -//             cancel: function () {  -//                 // 用户取消分享后执行的回调函数 -//             } -//         }); - } \ No newline at end of file diff --git a/public/react/src/modules/test/TestCrop.js b/public/react/src/modules/test/TestCrop.js deleted file mode 100644 index b539ef2b4..000000000 --- a/public/react/src/modules/test/TestCrop.js +++ /dev/null @@ -1,25 +0,0 @@ -import React, { Component } from 'react'; - -import Cropper from '../../common/components/Cropper' -import ChangeHeaderPicModal from '../user/account/ChangeHeaderPicModal' -class TestCrop extends Component { - state = { - }; - - handleChange = (info) => { - } - - render() { - - const props = this.props; - return ( -
- - - -
- ); - } -} - -export default (TestCrop); diff --git a/public/react/src/modules/test/TestRC.js b/public/react/src/modules/test/TestRC.js deleted file mode 100644 index 45645a722..000000000 --- a/public/react/src/modules/test/TestRC.js +++ /dev/null @@ -1,144 +0,0 @@ -import React, { Component } from 'react'; - -import moment from 'moment' -import Select, {Option, OptGroup} from 'rc-select'; -import 'rc-select/assets/index.css'; - -import { Upload, Icon, message } from 'antd'; - -import 'antd/lib/upload/style/index.css' -import Radio, { RadioGroup } from 'material-ui/Radio'; -import Checkbox from 'material-ui/Checkbox'; -import { withStyles } from 'material-ui/styles'; - -const Dragger = Upload.Dragger; - -const props = { - name: 'file', - multiple: true, - action: '//jsonplaceholder.typicode.com/posts/', - onChange(info) { - const status = info.file.status; - if (status !== 'uploading') { - console.log(info.file, info.fileList); - } - if (status === 'done') { - message.success(`${info.file.name} file uploaded successfully.`); - } else if (status === 'error') { - message.error(`${info.file.name} file upload failed.`); - } - }, -}; -// ------------------------------------------- - -function getBase64(img, callback) { - const reader = new FileReader(); - reader.addEventListener('load', () => callback(reader.result)); - reader.readAsDataURL(img); -} - -function beforeUpload(file) { - const isJPG = file.type === 'image/jpeg'; - // if (!isJPG) { - // message.error('You can only upload JPG file!'); - // } - const isLt2M = file.size / 1024 / 1024 < 2; - if (!isLt2M) { - message.error('Image must smaller than 2MB!'); - } - // return isJPG && isLt2M; - return isLt2M; -} - -// ------------------------------------------- -const children = []; -for (let i = 10; i < 36; i++) { - // value={i} - children.push( - - ); -} -// DOC https://v1-0-0.material-ui.com/customization/themes/ -const myStyles = theme => ({ - // root: { - // color: 'inherit', - // textDecoration: 'inherit', - // '&:hover': { - // textDecoration: 'underline', - // }, - // }, - // 使用主题的主色 - primary: { - color: theme.palette.primary.main, - }, - radio: { - '&$checked': { - color: '#4B8DF8' - }, - color: 'red' - }, - checked: {} -}); - -class TestRC extends Component { - state = { - loading: false, - }; - - handleChange = (info) => { - if (info.file.status === 'uploading') { - this.setState({ loading: true }); - return; - } - if (info.file.status === 'done') { - // Get this url from response in real world. - getBase64(info.file.originFileObj, imageUrl => this.setState({ - imageUrl, - loading: false, - })); - } - } - - render() { - const uploadButton = ( -
- -
Upload
-
- ); - const imageUrl = this.state.imageUrl; - /* - - labelStyle={{color: 'yellow'}} - iconStyle={{ fill: 'red', color: 'blue' }} - */ - const props = this.props; - return ( -
- 111 - - - {imageUrl ? avatar : uploadButton} - -
- ); - } -} - -export default withStyles(myStyles)(TestRC); diff --git a/public/react/src/modules/test/codemirror/TestCodeMirror.js b/public/react/src/modules/test/codemirror/TestCodeMirror.js deleted file mode 100644 index f451bc356..000000000 --- a/public/react/src/modules/test/codemirror/TestCodeMirror.js +++ /dev/null @@ -1,63 +0,0 @@ -import React, { Component } from 'react'; - -import CodeMirror from 'react-codeMirror' - -require('codemirror/lib/codemirror.css'); -require('codemirror/mode/javascript/javascript'); -require('codemirror/mode/xml/xml'); -require('codemirror/mode/markdown/markdown'); -/* - -*/ -class TestCodeMirror extends Component { - constructor(props) { - super(props) - - this.updateCode = this.updateCode.bind(this) - - this.state = { - code: '// Code\n //2 \n //3 \n //4 \n //5 \n\n\n\n\n\n\n' - } - } - - updateCode(newCode) { - this.setState({ - code: newCode, - }); - } - - componentDidMount() { - var readOnlyLines = [0,1,2,3,8]; - - this.refs.editor.getCodeMirror().on('beforeChange',function(cm,change) { - console.log('change.from.line', change.from.line) - if ( readOnlyLines.indexOf(change.from.line) !== -1 - // 有问题:如果用回车将有内容的行挤到不可编辑的行,那么无法删除掉不可编辑行里的内容了 - // 解决办法:将所需的行数固定写好,禁用掉回车键。 - // || change.from.line > ( readOnlyLines[readOnlyLines.length -1] + 1 ) - ) { - change.cancel(); - } - }); - } - setCode() { - this.setState({ - code: 'test' - }) - } - - render() { - var options = { - lineNumbers: true, - mode: 'javascript', - }; - return ( -
- - -
- ) - } -} - -export default TestCodeMirror; \ No newline at end of file diff --git a/public/react/src/modules/test/dnd/TestDragBeautiful.js b/public/react/src/modules/test/dnd/TestDragBeautiful.js deleted file mode 100644 index 4782512e9..000000000 --- a/public/react/src/modules/test/dnd/TestDragBeautiful.js +++ /dev/null @@ -1,110 +0,0 @@ -import React, { Component } from "react"; -import ReactDOM from "react-dom"; -import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd"; -import styled from "styled-components"; - -// fake data generator -const getItems = count => - Array.from({ length: count }, (v, k) => k).map(k => ({ - id: `item-${k}`, - content: `item ${k}` - })); - -// a little function to help us with reordering the result -const reorder = (list, startIndex, endIndex) => { - const result = Array.from(list); - const [removed] = result.splice(startIndex, 1); - result.splice(endIndex, 0, removed); - - return result; -}; - -const List = styled.div` - background: lightgrey; - padding: 10px; -`; - -const Item = styled.div` - display: flex; - align-items: center; - padding: 10px; - margin-bottom: 10px; - border: 1px solid grey; - background: white; - &:hover { - background: lightgrey; - } -`; - -const DragHandle = styled.div` - width: 15px; - height: 15px; - margin-right: 8px; - background: grey; - visibility: hidden; - &:hover { - background: black; - } - ${Item}:hover & { - visibility: visible; - } -`; - -class App extends Component { - constructor(props) { - super(props); - this.state = { - items: getItems(10) - }; - this.onDragEnd = this.onDragEnd.bind(this); - } - - onDragEnd(result) { - // dropped outside the list - if (!result.destination) { - return; - } - - const items = reorder( - this.state.items, - result.source.index, - result.destination.index - ); - - this.setState({ - items - }); - } - - // Normally you would want to split things out into separate components. - // But in this example everything is just done in one place for simplicity - render() { - return ( - - - {(provided, snapshot) => ( - - {this.state.items.map((item, index) => ( - - {(provided, snapshot) => ( - - - {item.content} - - )} - - ))} - {provided.placeholder} - - )} - - - ); - } -} - -export default App; - - -// Put the thing into the DOM! -// ReactDOM.render(, document.getElementById("root")); diff --git a/public/react/src/modules/test/index.js b/public/react/src/modules/test/index.js deleted file mode 100644 index 8b7e8ac8b..000000000 --- a/public/react/src/modules/test/index.js +++ /dev/null @@ -1,30 +0,0 @@ -import React, { Component } from 'react'; -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import MonacoTest from './monaco' -import TestCrop from './TestCrop' -import TestDragBeautiful from './dnd/TestDragBeautiful' - -class TestIndex extends Component { - state = { - loading: false, - }; - - render() { - - return ( -
- test page - - - - - - - -
- ); - } -} - -export default TestIndex; diff --git a/public/react/src/modules/test/md/TestMaterialDesign.js b/public/react/src/modules/test/md/TestMaterialDesign.js deleted file mode 100644 index be2fef5d4..000000000 --- a/public/react/src/modules/test/md/TestMaterialDesign.js +++ /dev/null @@ -1,195 +0,0 @@ -import React, { Component } from 'react'; - - -// import Divider from 'material-ui/Divider'; -// import Dialog, { -// DialogActions, -// DialogContent, -// DialogContentText, -// DialogTitle, -// } from 'material-ui/Dialog'; - -// import AppBar from 'material-ui/AppBar'; - -// import getMuiTheme from 'material-ui/styles/getMuiTheme' - - -// import MobileTearSheet from '../../../MobileTearSheet'; - -// import ActionGrade from 'material-ui/svg-icons/action/grade'; -// import Divider from 'material-ui/Divider'; -// import Avatar from 'material-ui/Avatar'; - - -// import PropTypes from 'prop-types'; - -// import Tabs, { Tab } from 'material-ui/Tabs'; - -// import Input, { InputLabel } from 'material-ui/Input'; -// import { FormControl, FormHelperText } from 'material-ui/Form'; - - -import { IIHOC as DebuggerHOC, stringify } from './ii_debug' - -const style = { - paper: { - display: 'inline-block', - float: 'left', - margin: '16px 32px 16px 0', - }, - rightIcon: { - textAlign: 'center', - lineHeight: '24px', - }, -}; -/* - -*/ - -// https://material-ui-next.com/discover-more/showcase/ -// class TestMaterialDesign extends Component { - -// // ------------------------------------------------ -// // static childContextTypes = { -// // muiTheme: PropTypes.object -// // } - -// // getChildContext() { -// // return { -// // muiTheme: getMuiTheme() -// // } -// // } -// // ------------------------------------------------ - -// state = { -// open: false, -// value: 0, -// }; - -// handleOpen = () => { -// this.setState({open: true}); -// }; - -// handleClose = () => { -// this.setState({open: false}); -// }; - -// handleChange = (event, value) => { -// this.setState({ value }); -// }; -// onGoldRewardInputChange(event) { -// this.setState({ goldRewardInput: event.target.value }); -// } -// render() { - -// const {value} = this.state - -// return ( - -// -// {"奖励设置"} -// - -// -// 1请输入奖励的金币数量 -// this.onGoldRewardInputChange(e)} /> - -// -// -// -// -// -// ); -// } -// } -// const TestMaterialDesign = () => ( - -// -// ); - -// export default TestMaterialDesign; - - - -// -------------------------------------------------------- -// Props Proxy and state abstraction demonstration -function PPHOC(WrappedComponent) { - return class PP extends React.Component { - componentDidMount() { - // console.log('componentDidMount1 componentDidMount1 ') - } - constructor(props) { - super(props) - this.state = { fields: {} } - } - - getField(fieldName) { - if (!this.state.fields[fieldName]) { - // TODO 从服务端取state对应的数据 - // 共享state - this.state.fields[fieldName] = { - value: '', - onChange: event => { - this.state.fields[fieldName].value = event.target.value - this.forceUpdate() - } - } - } - - return { - value: this.state.fields[fieldName].value, - onChange: this.state.fields[fieldName].onChange - } - } - - render() { - const props = Object.assign({}, this.props, { - fields: this.getField.bind(this), - }) - return ( -
-

- PP HOC -

-

Im a Props Proxy HOC that abstracts controlled inputs

- -
- ) - } - } -} - -class Example extends React.Component { - componentDidMount() { - console.log('componentDidMount componentDidMount ') - } - render() { - return ( -
-

- Wrapped Component -

-

- Props -

-
{stringify(this.props)}
-
- - - -
- ) - } -} - -const EnhancedExample = DebuggerHOC(PPHOC(Example)) - -// module.exports = EnhancedExample; - -export default EnhancedExample \ No newline at end of file diff --git a/public/react/src/modules/test/md/ii_debug.js b/public/react/src/modules/test/md/ii_debug.js deleted file mode 100644 index 8e015198f..000000000 --- a/public/react/src/modules/test/md/ii_debug.js +++ /dev/null @@ -1,68 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom' - -function replacer(key, value) { - if (typeof value === 'function') { - return `function ${value.name}() {...}` - } - - return value -} - -export function stringify(value) { - return JSON.stringify(value, replacer, 2) -} - -// II debug example -// We are using the Inheritance Inversion technique to display -// the current state and props of the WrappedComponent (the component you want to debug). -// This is based on the technique that Mickael Jackson and Ryan Florence recommend -export function IIHOC(WrappedComponent) { - return class II extends WrappedComponent { - render() { - return ( -
-

- HOC Debugger Component -

-

- Props -

-
{stringify(this.props)}
-

- State -

-
{stringify(this.state)}
- {super.render()} -
- ) - } - } -} - - -class Example extends React.Component { - constructor(props) { - super(props) - this.state = { - name: 'fran', - email: 'franleplant@gmail.com' - } - } - - render() { - return ( -
-

- Wrapped Component -

-

Im a wrapped component

-
- ) - } -} - -// const EnhancedExample = IIHOC(Example) - -// ReactDOM.render(, document.getElementById('root')) \ No newline at end of file diff --git a/public/react/src/modules/test/monaco/index.js b/public/react/src/modules/test/monaco/index.js deleted file mode 100644 index 051b060b7..000000000 --- a/public/react/src/modules/test/monaco/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import React, { Component } from 'react'; - -import TPIMonaco from '../../page/component/monaco/TPIMonaco' -class MonacoTest extends Component { - state = { - loading: false, - }; - - render() { - console.log('monacoTest render') - return ( - - ); - } -} - -export default MonacoTest; diff --git a/public/react/src/modules/test/urlquery/TestUrlQuery.js b/public/react/src/modules/test/urlquery/TestUrlQuery.js deleted file mode 100644 index 8a398ee79..000000000 --- a/public/react/src/modules/test/urlquery/TestUrlQuery.js +++ /dev/null @@ -1,85 +0,0 @@ -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; -import { addUrlProps, UrlQueryParamTypes } from 'react-url-query'; - -/** - * Specify how the URL gets decoded here. This is an object that takes the prop - * name as a key, and a query param specifier as the value. The query param - * specifier can have a `type`, indicating how to decode the value from the - * URL, and a `queryParam` field that indicates which key in the query - * parameters should be read (this defaults to the prop name if not provided). - */ -const urlPropsQueryConfig = { - bar: { type: UrlQueryParamTypes.string }, - foo: { type: UrlQueryParamTypes.number, queryParam: 'fooInUrl' }, -}; - -class TestUrlQuery extends PureComponent { - static propTypes = { - bar: PropTypes.string, - foo: PropTypes.number, - // change handlers are automatically generated and passed if a config is provided - // and `addChangeHandlers` isn't false. They use `replaceIn` by default, just - // updating that single query parameter and keeping the other existing ones. - onChangeFoo: PropTypes.func, - onChangeBar: PropTypes.func, - onChangeUrlQueryParams: PropTypes.func, - } - - static defaultProps = { - foo: 123, - bar: 'bar', - } - - render() { - const { - foo, bar, onChangeFoo, onChangeBar, onChangeUrlQueryParams - } = this.props; - - return ( -
-
- - - - - - - - - - - - - - - - - -
foo{foo}(url query param) - -
bar{bar}(url query param) - -
- -
-
- ); - } -} - -/** - * We use the addUrlProps higher-order component to map URL query parameters - * to props for TestUrlQuery. In this case the mapping happens automatically by - * first decoding the URL query parameters based on the urlPropsQueryConfig. - */ -export default addUrlProps({ urlPropsQueryConfig })(TestUrlQuery); diff --git a/public/react/src/modules/testpaper/Intecomponents.js b/public/react/src/modules/testpaper/Intecomponents.js deleted file mode 100644 index 8776b6a9e..000000000 --- a/public/react/src/modules/testpaper/Intecomponents.js +++ /dev/null @@ -1,418 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Drawer, - Input, - Button, - Breadcrumb -} from "antd"; -import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; -import './testioncss/testioncss.css'; -import '../tpm/newshixuns/css/Newshixuns.css'; -import Bottomsubmit from "../../modules/modals/Bottomsubmit"; -import Intelligentcomponents from "../question/comthetestpaper/Intelligentcomponents"; - -//试卷编辑 -class Intecomponents extends Component { - constructor(props) { - super(props); - this.Judquestio = React.createRef(); - this.state = { - paperlibrartdata: [], - disciplinesdata: [], - knowledgepoints: [], - disciplmy: [], - item_banksedit: [], - newmyshixunmodelbool:false, - single_question_count:0, - multiple_question_count:0, - judgement_question_count:0, - program_question_count:0, - } - - - } - - getJudquestio = (Ref) => { - //console.log("子组件对象"); - //console.log(Ref); - this.Judquestio = Ref; - } - - //初始化 - componentDidMount() { - let urls = `/disciplines.json`; - axios.get(urls, { - params: { - source: "question" - } - }).then((response) => { - if (response) { - this.setState({ - disciplinesdata: response.data.disciplines, - }) - if (response.data) { - if (response.data.disciplines) { - - const didata = response.data.disciplines; - - for (var i = 0; i < didata.length; i++) { - const childern = []; - //方向 - const fxdidata = didata[i].sub_disciplines; - - - for (var j = 0; j < fxdidata.length; j++) { - //课程 - const zsddata = fxdidata[j].tag_disciplines; - childern.push( - { - value: fxdidata[j].id, - label: fxdidata[j].name, - } - ) - for (var k = 0; k < zsddata.length; k++) { - //知识点 - this.state.knowledgepoints.push(zsddata[k]); - - - } - } - - const datakec = { - value: didata[i].id, - label: didata[i].name, - children: childern, - } - this.state.disciplmy.push(datakec); - } - - this.setState({ - knowledgepoints: this.state.knowledgepoints, - disciplmy: this.state.disciplmy, - }) - - - } - - } - - } - }); - - - - - } - //难度 - getdatas=()=>{ - if (this.Judquestio.Getdatas().length === 0) { - this.scrollToAnchor("Itembankstopid"); - return false; - } - //console.log(this.Judquestio.Getdatas()); - var myrbkc=[]; - var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd; - for(let myda of Getdatasdatas) { - myrbkc.push(myda.id); - } - const url="/examination_intelligent_settings/optinal_items.json"; - var data={ - sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1], - tag_discipline_id:myrbkc, - source:this.Judquestio.Getdatas()[7].rbly, - difficulty:this.Judquestio.Getdatas()[0].rbnd, - } - - this.getwangluodata(url,data); - - } - //课程 - getdatasss=(kech)=>{ - if (this.Judquestio.Getdatas().length === 0) { - this.scrollToAnchor("Itembankstopid"); - return false; - } - //console.log(this.Judquestio.Getdatas()); - var myrbkc=[]; - var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd; - for(let myda of Getdatasdatas) { - myrbkc.push(myda.id); - } - const url="/examination_intelligent_settings/optinal_items.json"; - var data={ - sub_discipline_id:kech, - tag_discipline_id:myrbkc, - source:this.Judquestio.Getdatas()[7].rbly, - difficulty:this.Judquestio.Getdatas()[0].rbnd, - } - - this.getwangluodata(url,data); - - } - //知识点 - getdatassss=(zhishidian)=>{ - if (this.Judquestio.Getdatas().length === 0) { - this.scrollToAnchor("Itembankstopid"); - return false; - } - //console.log(this.Judquestio.Getdatas()); - var myrbkc=[]; - var Getdatasdatas=zhishidian; - for(let myda of Getdatasdatas) { - myrbkc.push(myda.id); - } - const url="/examination_intelligent_settings/optinal_items.json"; - var data={ - sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1], - tag_discipline_id:myrbkc, - source:this.Judquestio.Getdatas()[7].rbly, - difficulty:this.Judquestio.Getdatas()[0].rbnd, - } - this.getwangluodata(url,data); - } - - //来源 - getdatassssy=(rbly)=>{ - if (this.Judquestio.Getdatas().length === 0) { - this.scrollToAnchor("Itembankstopid"); - return false; - } - //console.log(this.Judquestio.Getdatas()); - var myrbkc=[]; - var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd; - for(let myda of Getdatasdatas) { - myrbkc.push(myda.id); - } - const url="/examination_intelligent_settings/optinal_items.json"; - var data={ - sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1], - tag_discipline_id:myrbkc, - source:rbly, - difficulty:this.Judquestio.Getdatas()[0].rbnd, - } - this.getwangluodata(url,data); - } - - - getwangluodata=(url,data)=>{ - axios.post(url,data).then((response) => { - if (response) { - //console.log("智能组卷"); - //console.log(response); - if(response.data){ - this.setState({ - single_question_count:response.data.single_question_count, - multiple_question_count:response.data.multiple_question_count, - judgement_question_count:response.data.judgement_question_count, - program_question_count:response.data.program_question_count, - }) - - } - - } - }); - } - //难度 - getdatass=(nandu)=>{ - if (this.Judquestio.Getdatas().length === 0) { - this.scrollToAnchor("Itembankstopid"); - return false; - } - //console.log(this.Judquestio.Getdatas()); - var myrbkc=[]; - var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd; - for(let myda of Getdatasdatas) { - myrbkc.push(myda.id); - } - const url="/examination_intelligent_settings/optinal_items.json"; - var data={ - sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1], - tag_discipline_id:myrbkc, - source:this.Judquestio.Getdatas()[7].rbly, - difficulty:nandu, - } - - axios.post(url,data).then((response) => { - if (response) { - //console.log("智能组卷"); - //console.log(response); - if(response.data){ - this.setState({ - single_question_count:response.data.single_question_count, - multiple_question_count:response.data.multiple_question_count, - judgement_question_count:response.data.judgement_question_count, - program_question_count:response.data.program_question_count, - }) - - } - - } - }); - - } - - - componentDidUpdate(prevProps) { - - } - - - - //跳转道描点的地方 - scrollToAnchor = (anchorName) => { - try { - if (anchorName) { - // 找到锚点 - let anchorElement = document.getElementById(anchorName); - // 如果对应id的锚点存在,就跳转到锚点 - if (anchorElement) { - anchorElement.scrollIntoView(); - } - } - } catch (e) { - - } - - } - preservation = () => { - if (this.Judquestio.Getdatas().length === 0) { - this.scrollToAnchor("Itembankstopid"); - return; - } - var myrbkc=[]; - var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd; - for(let myda of Getdatasdatas) { - myrbkc.push(myda.id); - } - // //console.log(myrbkc); - // //console.log("preservation"); - // //console.log(this.Judquestio.Getdatas()); - - - var question_settings =[ - { - "item_type": "SINGLE", - "count": this.Judquestio.Getdatas()[3].rbdxt - }, - { - "item_type": "MULTIPLE", - "count": this.Judquestio.Getdatas()[4].rbdxtx - }, - { - "item_type": "JUDGMENT", - "count": this.Judquestio.Getdatas()[5].rbpdt - }, - { - "item_type": "PROGRAM", - "count": this.Judquestio.Getdatas()[6].rbbct - } - ] - - - const url="/examination_intelligent_settings.json" - var data = { - discipline_id: this.Judquestio.Getdatas()[2].rbkc[0], - sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1], - tag_discipline_id:myrbkc, - source:this.Judquestio.Getdatas()[7].rbly, - difficulty:this.Judquestio.Getdatas()[0].rbnd, - question_settings:question_settings, - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - //console.log("组卷成功"); - this.props.history.push(`/Integeneration/Intelligence/${result.data.exam_setting_id}`); - } - }).catch((error) => { - //console.log(error); - }) - - } - - - setitem_type = (item_type) => { - - - } - - setCohetepaperbool = (bool) => { - - } - getcontentMdRef = (Ref) => { - this.contentMdRef = Ref; - } - - setnewmyshixunmodelbool=()=>{ - - } - - render() { - let {paperlibrartdata,newmyshixunmodelbool,single_question_count,multiple_question_count,judgement_question_count,program_question_count} = this.state; - const params = this.props && this.props.match && this.props.match.params; - return ( -
-
- -
-
- - 试题库 - 智能组卷 - -
- this.getdatas()} - getdatass={(nd)=>this.getdatass(nd)} - getJudquestio={(ref) => this.getJudquestio(ref)} - getdatasss={(e)=>this.getdatasss(e)} - getdatassss={(e)=>this.getdatassss(e)} - getdatassssy={(e)=>this.getdatassssy(e)} - > - - - - -
- - -
- { - newmyshixunmodelbool === true ? "" : - this.setCohetepaperbool(bool)} - onSubmits={() => this.preservation()} url={'/paperlibrary'}> - } -
- ) - - } - - -} - -export default SnackbarHOC()(TPMIndexHOC(Intecomponents)); - - diff --git a/public/react/src/modules/testpaper/Paperlibraryeditid.js b/public/react/src/modules/testpaper/Paperlibraryeditid.js deleted file mode 100644 index c65191e96..000000000 --- a/public/react/src/modules/testpaper/Paperlibraryeditid.js +++ /dev/null @@ -1,319 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Drawer, - Input, - Button, - Breadcrumb -} from "antd"; -import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; -import NoneData from './component/NoneData'; -import './testioncss/testioncss.css'; -import '../tpm/newshixuns/css/Newshixuns.css'; -import Bottomsubmit from "../../modules/modals/Bottomsubmit"; -import Seeoagertits from "./component/Seeoagertits"; -import Paperlibraryseeid_item from './component/Paperlibraryseeid_item'; -import Comthetestpaperst from '../question/comthetestpaper/Comthetestpaperst'; -import Paperlibraryseeid_itemss from './component/Paperlibraryseeid_itemss'; -import JudquestionEditor from "../question/component/JudquestionEditor"; -import NewMyShixunModel from "../question/NewMyShixunModel"; - - -//试卷编辑 -class Paperlibraryeditid extends Component { - constructor(props) { - super(props); - this.Judquestio = React.createRef(); - this.state = { - paperlibrartdata: [], - disciplinesdata: [], - knowledgepoints: [], - disciplmy: [], - item_banksedit: [], - newmyshixunmodelbool:false, - } - - - } - - getJudquestio = (Ref) => { - //console.log("子组件对象"); - //console.log(Ref); - this.Judquestio = Ref; - } - - //初始化 - componentDidMount() { - this.getdata(); - let urls = `/disciplines.json`; - axios.get(urls, { - params: { - source: "question" - } - }).then((response) => { - if (response) { - this.setState({ - disciplinesdata: response.data.disciplines, - }) - if (response.data) { - if (response.data.disciplines) { - - const didata = response.data.disciplines; - - for (var i = 0; i < didata.length; i++) { - const childern = []; - //方向 - const fxdidata = didata[i].sub_disciplines; - - - for (var j = 0; j < fxdidata.length; j++) { - //课程 - const zsddata = fxdidata[j].tag_disciplines; - childern.push( - { - value: fxdidata[j].id, - label: fxdidata[j].name, - } - ) - for (var k = 0; k < zsddata.length; k++) { - //知识点 - this.state.knowledgepoints.push(zsddata[k]); - - - } - } - - const datakec = { - value: didata[i].id, - label: didata[i].name, - children: childern, - } - this.state.disciplmy.push(datakec); - } - - this.setState({ - knowledgepoints: this.state.knowledgepoints, - disciplmy: this.state.disciplmy, - }) - - - } - - } - - } - }); - - } - - - getdata = () => { - let urls = `/examination_banks/${this.props.match.params.id}.json`; - axios.get(urls).then((response) => { - if (response) { - this.setState({ - paperlibrartdata: response.data, - item_banksedit: response.data.exam, - }) - } - }); - - } - - - //跳转道描点的地方 - scrollToAnchor = (anchorName) => { - try { - if (anchorName) { - // 找到锚点 - let anchorElement = document.getElementById(anchorName); - // 如果对应id的锚点存在,就跳转到锚点 - if (anchorElement) { - anchorElement.scrollIntoView(); - } - } - } catch (e) { - - } - - } - preservation = () => { - //保存试卷 - if (this.Judquestio.Getdatas().length === 0) { - this.scrollToAnchor("Itembankstopid"); - return; - } - var myrbkc=[]; - var Getdatasdatas=this.Judquestio.Getdatas()[2].rbzsd; - for(let myda of Getdatasdatas) { - myrbkc.push(myda.id); - } - const url = `/examination_banks/${this.props.match.params.id}.json`; - var data={ - difficulty:this.Judquestio.Getdatas()[0].rbnd, - name:this.Judquestio.Getdatas()[4].classroom, - duration:this.Judquestio.Getdatas()[5].kssc, - discipline_id: this.Judquestio.Getdatas()[3].rbkc[0], - sub_discipline_id: this.Judquestio.Getdatas()[3].rbkc[1], - tag_discipline_id: myrbkc, - } - axios.put(url, data) - .then((result) => { - if (result.data.status === 0) { - // this.props.showNotification(`试卷更新成功`); - this.props.history.push('/paperlibrary'); - } - }).catch((error) => { - //console.log(error); - }) - - } - - - setitem_type = (item_type) => { - - - } - - setCohetepaperbool = (bool) => { - - } - getcontentMdRef = (Ref) => { - this.contentMdRef = Ref; - } - - setnewmyshixunmodelbool=(bool)=>{ - if(bool===true){ - let scrollToTop = window.setInterval(function() { - let pos = window.pageYOffset; - if ( pos > 0 ) { - window.scrollTo( 0, pos - 20 ); // how far to scroll on each step - } else { - window.clearInterval( scrollToTop ); - } - }, 2); - } - this.setState({ - newmyshixunmodelbool:bool - }) - this.getdata(); - } - - render() { - let {paperlibrartdata,newmyshixunmodelbool} = this.state; - const params = this.props && this.props.match && this.props.match.params; - // //console.log("newmyshixunmodelbool"); - // //console.log(newmyshixunmodelbool); - return ( -
-
- { - newmyshixunmodelbool===true? - - :"" - } - - { - newmyshixunmodelbool===true? -
- this.setnewmyshixunmodelbool(e)}> -
- : - "" - } - - -
-
- - 试卷库 - 公告试卷库 - 试卷编辑 - -
- this.getJudquestio(ref)} - > - - -
- -
- this.setnewmyshixunmodelbool(e)} - all_score={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_questions_count} - all_questions_count={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_score} - difficulty={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.difficulty} - > - -
- this.getdata()} - single_questions={paperlibrartdata && paperlibrartdata.single_questions && paperlibrartdata.single_questions.questions.length > 0 ? paperlibrartdata.single_questions : null} - multiple_questions={paperlibrartdata && paperlibrartdata.multiple_questions - && paperlibrartdata.multiple_questions.questions.length > 0 ? paperlibrartdata.multiple_questions : null - } - judgement_questions={paperlibrartdata && paperlibrartdata.judgement_questions - && paperlibrartdata.judgement_questions.questions.length > 0 ? paperlibrartdata.judgement_questions : null - } - program_questions={paperlibrartdata && paperlibrartdata.program_questions - && paperlibrartdata.program_questions.questions.length > 0 ? paperlibrartdata.program_questions : null - } - > - - -
- - -
- - -
- { - newmyshixunmodelbool === true ? "" : - this.setCohetepaperbool(bool)} - onSubmits={() => this.preservation()} url={'/paperlibrary'}> - } -
- ) - - } - - -} - -export default SnackbarHOC()(TPMIndexHOC(Paperlibraryeditid)); - - diff --git a/public/react/src/modules/testpaper/Paperlibraryseeid.js b/public/react/src/modules/testpaper/Paperlibraryseeid.js deleted file mode 100644 index aa9263e67..000000000 --- a/public/react/src/modules/testpaper/Paperlibraryseeid.js +++ /dev/null @@ -1,185 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Drawer, - Input, - Button, - Breadcrumb -} from "antd"; -import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; -import NoneData from './component/NoneData'; -import './testioncss/testioncss.css'; -import '../tpm/newshixuns/css/Newshixuns.css'; -import Bottomsubmit from "../../modules/modals/Bottomsubmit"; -import Seeoagertit from "./component/Seeoagertit"; -import Paperlibraryseeid_item from './component/Paperlibraryseeid_item'; -//人工组卷预览 -class Paperlibraryseeid extends Component { - constructor(props) { - super(props); - this.contentMdRef = React.createRef(); - this.state = { - paperlibrartdata:[], - - - } - - - } - - //初始化 - componentDidMount() { - ////console.log("Paperlibraryseeid"); - this.getdata(); - - - } - - - getdata = () => { - let urls = `/examination_banks/${this.props.match.params.id}.json`; - axios.get(urls).then((response) => { - if (response) { - this.setState({ - paperlibrartdata: response.data, - }) - } - }); - - } - - - //跳转道描点的地方 - scrollToAnchor = (anchorName) => { - try { - if (anchorName) { - // 找到锚点 - let anchorElement = document.getElementById(anchorName); - // 如果对应id的锚点存在,就跳转到锚点 - if (anchorElement) { - anchorElement.scrollIntoView(); - } - } - } catch (e) { - - } - - } - preservation = () => { - //保存试卷 - - - - - } - - - setitem_type = (item_type) => { - - - } - - setCohetepaperbool =(bool)=>{ - - } - getcontentMdRef = (Ref) => { - this.contentMdRef = Ref; - } - render() { - let {paperlibrartdata} = this.state; - const params = this.props && this.props.match && this.props.match.params; - // ////console.log(params); - return ( -
-
- - -
-
- - 试卷库 - 公告试卷库 - 试卷查看 - -
- -
- {paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.name} -
- -
- - - - - - - this.getdata()} - single_questions={paperlibrartdata&&paperlibrartdata.single_questions&&paperlibrartdata.single_questions.questions.length>0?paperlibrartdata.single_questions:null} - multiple_questions={paperlibrartdata&&paperlibrartdata.multiple_questions - &&paperlibrartdata.multiple_questions.questions.length>0?paperlibrartdata.multiple_questions:null - } - judgement_questions={paperlibrartdata&&paperlibrartdata.judgement_questions - &&paperlibrartdata.judgement_questions.questions.length>0?paperlibrartdata.judgement_questions:null - } - program_questions={paperlibrartdata&&paperlibrartdata.program_questions - &&paperlibrartdata.program_questions.questions.length>0?paperlibrartdata.program_questions:null - } - > - - - - - - - - - - - -
- - - - - -
- - -
- - this.setCohetepaperbool(bool)} - onSubmits={() => this.preservation()} url={'/paperlibrary'}> -
- ) - - } - - -} - -export default SnackbarHOC()(TPMIndexHOC(Paperlibraryseeid)); - - diff --git a/public/react/src/modules/testpaper/Testpaperlibrary.js b/public/react/src/modules/testpaper/Testpaperlibrary.js deleted file mode 100644 index fe244b9c4..000000000 --- a/public/react/src/modules/testpaper/Testpaperlibrary.js +++ /dev/null @@ -1,484 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Drawer, - Input -} from "antd"; -import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; -import NoneData from './component/NoneData'; -import './testioncss/testioncss.css'; -import Contentpart from "./component/Contentpart"; -import SiderBar from "../tpm/SiderBar"; -import Headplugselections from "../question/component/Headplugselections"; -import QuestionModal from "./component/QuestionModal"; -import QuestionModals from "./component/QuestionModals"; -class Testpaperlibrary extends Component { - constructor(props) { - super(props); - this.state = { - Headertop: "", - disciplinesdata:null, - discipline_id:null, - sub_discipline_id:null, - tag_discipline_id:null, - public:null, - difficulty:null, - item_type:null, - keywords:null, - page:1, - per_page:10, - booljupyterurls:false, - Contentdata:[], - items_count:0, - defaultActiveKey:"1", - modalsTypes:false, - modalsType:false, - timuid:0, - } - } - getContainer = () => { - return this.container; - }; - saveContainer = container => { - this.container = container; - }; - - //初始化 - componentDidMount() { - let url = `/users/get_navigation_info.json`; - axios.get(url, {}).then((response) => { - // //////console.log("开始请求/get_navigation_info.json"); - // //////console.log(response); - if (response != undefined) { - if (response.status === 200) { - this.setState({ - Headertop: response.data.top, - Footerdown: response.data.down - }) - } - } - }); - //获取题库筛选资料 - let urls = `/disciplines.json`; - axios.get(urls, {params: { - source:"question" - }}).then((response) => { - if (response) { - this.setState({ - disciplinesdata: response.data.disciplines, - }) - } - }); - } - - paginationonChange=(pages)=>{ - this.setState({ - page:pages - }) - var data={ - page:pages, - discipline_id:this.state.discipline_id, - sub_discipline_id:this.state.sub_discipline_id, - tag_discipline_id:this.state.tag_discipline_id, - public: this.state.defaultActiveKey, - difficulty: this.state.difficulty, - keywords: null, - per_page:10, - } - this.getdata(data); - } - - setdatafunsval = (e) => { - this.setState({ - keywords: e.target.value - }) - - } - - setdatafuns = (value) => { - this.setState({ - keywords: value, - }) - var data={ - page:this.state.page, - discipline_id:this.state.discipline_id, - sub_discipline_id:this.state.sub_discipline_id, - tag_discipline_id:this.state.tag_discipline_id, - public: this.state.defaultActiveKey, - difficulty: this.state.difficulty, - keywords: value, - per_page:10, - } - this.getdata(data); - } - callback = (key) => { - this.setState({ - defaultActiveKey: key, - difficulty:null, - keywords:null, - page:1, - }) - var data={ - page:1, - discipline_id:this.state.discipline_id, - sub_discipline_id:this.state.sub_discipline_id, - tag_discipline_id:this.state.tag_discipline_id, - public: key, - difficulty:null, - keywords: null, - per_page:10, - } - this.getdata(data); - } - - //获取数据 - getdata=(data)=>{ - const url = `/examination_banks.json`; - this.setState({ - booljupyterurls:true, - }) - axios.get((url), {params: data}).then((response) => { - setTimeout(()=>{ - this.setState({ - booljupyterurls:false, - }) - },1000); - if (response === null || response === undefined) { - - return - } - if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) { - - } else { - - } - //////console.log("item_banks"); - //////console.log(response); - this.setState({ - Contentdata: response.data, - items_count: response.data.exam_count, - }) - }).catch((error) => { - //////console.log(error) - this.setState({ - booljupyterurls:false, - }) - }); - - } - setdiscipline_id=(discipline_id)=>{ - this.setState({ - discipline_id:discipline_id, - sub_discipline_id:null, - tag_discipline_id:null, - keywords:null, - page: 1, - per_page:10, - }) - var data = { - discipline_id:discipline_id, - sub_discipline_id:null, - tag_discipline_id:null, - public: this.state.defaultActiveKey, - difficulty: this.props.difficulty, - keywords: null, - page: 1, - per_page:10, - }; - this.getdata(data); - - } - setsub_discipline_id=(discipline_id,sub_discipline_id)=>{ - this.setState({ - sub_discipline_id:sub_discipline_id, - tag_discipline_id:null, - keywords:null, - page:1, - per_page:10, - }) - var data = { - discipline_id:discipline_id, - sub_discipline_id:sub_discipline_id, - tag_discipline_id:null, - public: this.state.defaultActiveKey, - difficulty: this.state.difficulty, - keywords: null, - page:1, - per_page:10, - }; - this.getdata(data); - } - - settag_discipline_id=(tag_discipline_id)=>{ - this.setState({ - tag_discipline_id:tag_discipline_id, - keywords:null, - page:1, - per_page:10, - }) - var data = { - discipline_id:this.state.discipline_id, - sub_discipline_id:this.state.sub_discipline_id, - tag_discipline_id:tag_discipline_id, - public: this.state.defaultActiveKey, - difficulty: this.state.difficulty, - keywords: null, - page: 1, - per_page:10, - }; - this.getdata(data); - } - - - modalCancels=()=>{ - this.setState({ - modalsTypes: false - }) - } - setDownloads=(item_type)=>{ - this.Deletebigquestiontype(item_type); - this.setState({ - modalsTypes: false - }) - } - //删除大题型 - Deletebigquestiontype =(item_type)=>{ - - } - modalCancel = () => { - this.setState({ - modalsType: false - }) - } - setDownload = () => { - //确认 - if (this.state.titbool === true) { - //公开 - this.publicopentimu(this.state.timuid); - } else { - // 删除 - this.deletetimu(this.state.timuid); - } - this.setState({ - modalsType: false - }) - } - - //公开试卷 - publicopentimu = (id) => { - - const url = `/examination_banks/${id}/set_public.json`; - axios.post(url) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`公开试卷成功`); - var data = { - discipline_id:this.state.discipline_id, - sub_discipline_id:this.state.sub_discipline_id, - tag_discipline_id:this.state.tag_discipline_id, - public: this.state.defaultActiveKey, - difficulty: this.state.difficulty, - keywords: this.state.keywords, - page: this.state.page, - per_page:10, - }; - this.getdata(data); - } - }).catch((error) => { - ////console.log(error); - }) - } - - //删除试卷 - deletetimu = (id) => { - - const url = `/examination_banks/${id}.json`; - axios.delete(url) - .then((response) => { - if (response.data.status == 0) { - // this.props.showNotification('删除试卷成功'); - // props.history.push(response.data.right_url) - var data = { - discipline_id:this.state.discipline_id, - sub_discipline_id:this.state.sub_discipline_id, - tag_discipline_id:this.state.tag_discipline_id, - public: this.state.defaultActiveKey, - difficulty: this.state.difficulty, - keywords: this.state.keywords, - page: this.state.page, - per_page:10, - }; - this.getdata(data); - } - }) - .catch(function (error) { - ////console.log(error); - }); - } - - showmodels = (id) => { - this.setState({ - modalsType: true, - titilesm: "设为公开后,所有成员均可使用试卷", - titiless: "是否设置为公开?", - titbool: true, - timuid: id - }) - }; - - Testpapereditor=(id)=>{ - this.props.history.push(`/paperlibrary/edit/${id}`); - } - - - - - showmodelysl = (id) => { - this.setState({ - modalsType: true, - titilesm: "确认删除后,无法撤销", - titiless: "是否确认删除?", - titbool: false, - timuid: id - }) - }; - - setdifficulty=(difficulty)=>{ - this.setState({ - difficulty: difficulty, - visiblemys: false, - keywords:"", - page: 1, - per_page:10, - }) - - var data = { - discipline_id:this.state.discipline_id, - sub_discipline_id:this.state.sub_discipline_id, - tag_discipline_id:this.state.tag_discipline_id, - public: this.state.defaultActiveKey, - difficulty: difficulty, - keywords:null, - page:1, - per_page:10, - }; - - this.getdata(data); - - } - - - - setitem_types = (item_type) => { - this.setState({ - item_type: item_type, - visiblemyss: false, - keywords:null, - page: 1, - per_page:10, - }) - - var data = { - discipline_id:this.state.discipline_id, - sub_discipline_id:this.state.sub_discipline_id, - tag_discipline_id:this.state.tag_discipline_id, - public: this.state.defaultActiveKey, - difficulty: this.state.difficulty, - item_type: item_type, - keywords:"", - page: 1, - per_page:10, - }; - - this.getdata(data); - } - - - - - render() { - let{Headertop,items_count,page,per_page,modalsTypes,modalsType}=this.state; - - const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; - const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; - const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; - - - return ( -
- { - modalsTypes===true? - this.modalCancels()} - setDownloads={(e) => this.setDownloads(e)}> - :"" - } - { - modalsType===true? - this.modalCancel()} - setDownload={() => this.setDownload()}> - :"" - } - {/*试卷库*/} - this.showDrawer()} - Headertop={Headertop}/> - {/*顶部*/} - this.setdiscipline_id(e)} - setsub_discipline_id={(e,id)=>this.setsub_discipline_id(e,id)} - settag_discipline_id={(e)=>this.settag_discipline_id(e)} - setitem_types={(e) => this.setitem_types(e)} - setdifficulty={(e) => this.setdifficulty(e)} - > - {/*头部*/} - this.Testpapereditor(e)} - setdifficulty={(e)=>this.setdifficulty(e)} - showmodels={(e)=>this.showmodels(e)} - showmodelysl={(e)=>this.showmodelysl(e)} - setdatafuns={(key)=>this.setdatafuns(key)} - callback={(key)=>this.callback(key)} - setdatafunsval={(key)=>this.setdatafunsval(key)} - setdifficulty={(bool)=>this.setdifficulty(bool)} - > - - - {/*内容*/} - - - - { - items_count&&items_count>10? -
- -
- : -
-
- } - - - -
- ) - - } - - -} - -export default SnackbarHOC()(TPMIndexHOC(Testpaperlibrary)); diff --git a/public/react/src/modules/testpaper/component/Contentpart.js b/public/react/src/modules/testpaper/component/Contentpart.js deleted file mode 100644 index 7df1997cd..000000000 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ /dev/null @@ -1,247 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Tabs, - Input, - Popover -} from "antd"; -import './../testioncss/testioncss.css'; - -import NoneDatas from '../component/NoneDatas'; -import Contentquestionbank from "./Contentquestionbank"; -import LoadingSpin from '../../../common/LoadingSpin'; -import Listjihe from "./Listjihe"; -const { TabPane } = Tabs; -const Search = Input.Search; -class Contentpart extends Component { - constructor(props) { - super(props); - this.state = { - page:1, - - } - } - //初始化 - componentDidMount(){ - - - } - //跳转人工组卷 - Mantegeneration=()=>{ - this.props.history.push('/question'); - } - - - componentDidUpdate(prevProps) { - if(prevProps.current_user !== this.props.current_user) { - const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; - const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; - const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; - let {defaultActiveKey} = this.props; - var defaultActiveKeys=defaultActiveKey; - if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ - defaultActiveKeys="0" - }else{ - defaultActiveKeys="1" - } - this.props.callback(defaultActiveKeys); - } - } - - render() { - let {page}=this.state; - let {defaultActiveKey}=this.props; - - - const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; - const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; - const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; - - const contents = ( -
-

this.props.setdifficulty(null)}>全部

-

-

this.props.setdifficulty(1)}>简单

-

-

this.props.setdifficulty(2)}>适中

-

-

this.props.setdifficulty(3)}>困难

-

-
- ); - - - return ( -
-
-
- - - { - isysladmins===true||(is_teacher===true&&professional_certification===true)? - this.props.callback(e)}> - - - - - - : - this.props.callback(e)}> - - - - } -
- -
- this.props.setdatafunsval(e)} - onSearch={ (value)=>this.props.setdatafuns(value)} - value={this.props.keywords} - /> - - { - isysladmins===true||(is_teacher===true&&professional_certification===true)? - - :"" - } - -
- -
-
- {/*内容*/} - { - this.props.Contentdata.exams === undefined ||this.props.Contentdata.exams === null||this.props.Contentdata.exams.length===0 ? -
- : -
- { - defaultActiveKey===1||defaultActiveKey==="1"? - - :"" - } - { - defaultActiveKey===0||defaultActiveKey==="0"? - - :"" - } -
- } - - -
- {/*列表集合*/} -
- { - this.props.booljupyterurls===true? - - : - this.props.Contentdata.exams === undefined ||this.props.Contentdata.exams === null||this.props.Contentdata.exams.length===0? - - - - : this.props.Contentdata.exams.map((object, index) => { - return ( - this.props.Testpapereditor(e)} - showmodels={(e)=>this.props.showmodels(e)} - showmodelysl={(e)=>this.props.showmodelysl(e)} - Isitapopup={this.props.Isitapopup} - > - - - ) - })} - - - -
- -
- - -
-
- ) - - } - - - -} -export default Contentpart diff --git a/public/react/src/modules/testpaper/component/Contentquestionbank.js b/public/react/src/modules/testpaper/component/Contentquestionbank.js deleted file mode 100644 index 2ed246023..000000000 --- a/public/react/src/modules/testpaper/component/Contentquestionbank.js +++ /dev/null @@ -1,68 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Radio, - Checkbox -} from "antd"; -import './../testioncss/testioncss.css'; -class Contentquestionbank extends Component { - constructor(props) { - super(props); - this.state = { - page:1, - } - } - //初始化 - componentDidMount(){ - //////console.log("componentDidMount"); - //////console.log(this.state); - //////console.log(this.props); - // let homeworkid = this.props.match.params.homeworkid; - // let url = "/homework_commons/" + homeworkid + "/end_groups.json"; - // axios.get(url).then((response) => { - // if (response.status === 200) { - // this.setState({}) - // } - // }).catch((error) => { - // //////console.log(error) - // }); - - } - onChange=(e)=> { - //////console.log(`checked = ${e.target.checked}`); - } - - render() { - - return ( - -
-
-
-
- -
-
- 共{this.props.items_count?this.props.items_count:0}个试卷 -
-
- - - - -
-
- ) - - } - - - -} -export default Contentquestionbank ; diff --git a/public/react/src/modules/testpaper/component/Listjihe.js b/public/react/src/modules/testpaper/component/Listjihe.js deleted file mode 100644 index 53fc7181a..000000000 --- a/public/react/src/modules/testpaper/component/Listjihe.js +++ /dev/null @@ -1,159 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl,markdownToHTML} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Radio -} from "antd"; -import './../testioncss/testioncss.css'; -const tagArray = [ - 'A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.', - 'J.', 'K.', 'L.', 'M.', 'N.', 'O.', 'P.', 'Q.', 'R.', - 'S.', 'T.', 'U.', 'V.', 'W.', 'X.', 'Y.', 'Z.' -] -class Listjihe extends Component { - constructor(props) { - super(props); - this.state = { - page:1, - name:"单选题", - nd:"简单", - chakanjiexibool:false, - } - } - //初始化 - componentDidMount(){ - - - } - - chakanjiexibool=()=>{ - if(this.state.chakanjiexibool===true){ - this.setState({ - chakanjiexibool:false - }) - }else{ - this.setState({ - chakanjiexibool:true - }) - } - - } - //选用 - Selectingpracticaltraining=(id)=>{ - let data={ - item_ids:[id] - } - this.props.getitem_baskets(data); - } - //撤销 - Selectingpracticaltrainings=(id)=>{ - - this.props.getitem_basketss(id); - } - - - gotoseesj=(id)=>{ - this.props.history.push(`/paperlibrary/see/${id}`); - } - - - render() { - let {page,name,nd,chakanjiexibool}=this.state; - let {defaultActiveKey,items}=this.props; - - const names= items&&items.name&&items.name; - const question_counts=items&&items.question_count&&items.question_count; - const total_scores =items&&items.total_score&&items.total_score; - const difficultys=items&&items.difficulty&&items.difficulty===1?"简单":items&&items.difficulty&&items.difficulty===2?"适中":items&&items.difficulty&&items.difficulty===3?"困难":"" - const update_times=items&&items.update_time&&items.update_time; - const quotess =items&&items.quotes&&items.quotes; - const authors=items&&items.author&&items.author.name; - return ( -
-
-
- -
-
-

this.gotoseesj(items.id)}>{names}

-
-

试题数:{question_counts}

-

总分:{total_scores}

-

难度:{difficultys}

-
-
-
-

- 更新时间:{update_times} - -

-

- 使用次数:{quotess} -

- { - defaultActiveKey===1||defaultActiveKey==="1"? -

- 创建者:{authors} -

- : - "" - } - - -
- - { - defaultActiveKey===0||defaultActiveKey==="0"? -
-

this.props.showmodelysl(items.id)}> - - 删除 -

- { - this.props.Isitapopup&&this.props.Isitapopup==="true"? - "" - : - -

this.props.Testpapereditor(items.id)}> - - 编辑 -

-
- } - - { - items.public === false ? -

this.props.showmodels(items.id)}> - - 公开 -

- :"" - } -
- :""} - - - -
-
- -
-
-

发起考试

-
-
- -
- -
- ) - - } - -} -export default Listjihe; diff --git a/public/react/src/modules/testpaper/component/NoneData.js b/public/react/src/modules/testpaper/component/NoneData.js deleted file mode 100644 index 123b7524e..000000000 --- a/public/react/src/modules/testpaper/component/NoneData.js +++ /dev/null @@ -1,37 +0,0 @@ -import React, { Component } from 'react'; -import { getImageUrl , getUrl } from 'educoder'; - -class NoneData extends Component{ - constructor(props) { - super(props) - } - render(){ - const { style } = this.props; - return( -
- - -

暂无相关数据

-

请选择试题进行组卷

-
- ) - } -} -export default NoneData; diff --git a/public/react/src/modules/testpaper/component/NoneDatas.js b/public/react/src/modules/testpaper/component/NoneDatas.js deleted file mode 100644 index c36cc29d1..000000000 --- a/public/react/src/modules/testpaper/component/NoneDatas.js +++ /dev/null @@ -1,36 +0,0 @@ -import React, { Component } from 'react'; -import { getImageUrl , getUrl } from 'educoder'; - -class NoneDatas extends Component{ - constructor(props) { - super(props) - } - render(){ - const { style } = this.props; - return( -
- - -

暂无相关数据

-
- ) - } -} -export default NoneDatas; diff --git a/public/react/src/modules/testpaper/component/Paperlibraryseeid_item.js b/public/react/src/modules/testpaper/component/Paperlibraryseeid_item.js deleted file mode 100644 index 06298299f..000000000 --- a/public/react/src/modules/testpaper/component/Paperlibraryseeid_item.js +++ /dev/null @@ -1,640 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, getImageUrl} from 'educoder'; -import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Drawer, - Input, - Button, - Breadcrumb -} from "antd"; -import '../testioncss/testioncss.css'; -import '../../tpm/newshixuns/css/Newshixuns.css'; -import Paperlibraryseeid_items from './Paperlibraryseeid_items'; - - -const reorder = (list, startIndex, endIndex) => { - const result = Array.from(list); - const [removed] = result.splice(startIndex, 1); - result.splice(endIndex, 0, removed); - - return result; -}; - -class Paperreview_item extends Component { - constructor(props) { - super(props); - - this.state = { - questions: 0, - totalscore: 0, - total: 0, - modalsTypedel: false, - modalsTypey: false, - modalsTypeys: false, - modalsTypedels: false, - titilesm: "", - titilesms: "", - singlebool: false, - multiplebool: false, - judgmentbool: false, - programbool: false, - paperreviewsingleindex: "无", - set_scoreid:null, - item_bank_id:null - } - - } - - //初始化 - componentDidMount() { - - - } - - - preservation = () => { - - - } - - - setitem_type = (item_type) => { - - - } - onDragEnd = (result) => { - //console.log("单选题"); - //console.log(result); - const ids = this.props.single_questions.questions[result.source.index].id; - const positions = this.props.single_questions.questions[result.destination.index].position; - - const url = `/examination_items/${ids}/adjust_position.json`; - var data = { - position: positions - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`拖动成功`); - this.props.getdata(); - } - }).catch((error) => { - //console.log(error); - }) - } - - onDragEnds = (result) => { - //console.log("多选题"); - //console.log(result); - const ids = this.props.multiple_questions.questions[result.source.index].id; - const positions = this.props.multiple_questions.questions[result.destination.index].position; - const url = `/examination_items/${ids}/adjust_position.json`; - var data = { - position: positions - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`拖动成功`); - this.props.getdata(); - } - }).catch((error) => { - //console.log(error); - }) - - - } - - - onDragEndss = (result) => { - //console.log("判断题"); - //console.log(result); - const ids = this.props.judgement_questions.questions[result.source.index].id; - const positions = this.props.judgement_questions.questions[result.destination.index].position; - const url = `/examination_items/${ids}/adjust_position.json`; - var data = { - position: positions - } - axios.post(url, data) - .then((result) => { - debugger - if (result.data.status == 0) { - // this.props.showNotification(`拖动成功`); - this.props.getdata(); - } - }).catch((error) => { - //console.log(error); - }) - - } - - onDragEndsss = (result) => { - //console.log("编程题"); - //console.log(result); - - const ids = this.props.program_questions.questions[result.source.index].id; - const positions = this.props.program_questions.questions[result.destination.index].position; - const url = `/examination_items/${ids}/adjust_position.json`; - var data = { - position: positions - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`拖动成功`); - this.props.getdata(); - } - }).catch((error) => { - //console.log(error); - }) - - } - Singlemagazine = (name, bool) => { - if (bool === true) { - this.setState({ - modalsTypey: true, - titilesm: name - }) - } else { - this.setState({ - modalsTypey: false, - titilesm: "" - }) - } - - - } - - setDownloady = (fenshu) => { - const url = "/item_baskets/batch_set_score.json"; - var data = { - score: fenshu, - item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '', - - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`调分成功`); - this.props.getdata({}); - this.Singlemagazine("", false); - } - }).catch((error) => { - //console.log(error); - }) - } - - setDownloadys=(value)=>{ - const url = `/item_baskets/${this.state.set_scoreid}/set_score.json`; - var data = { - score: value, - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`调分成功`); - this.props.getdata({}); - this.Singlemagazines(false); - } - }).catch((error) => { - //console.log(error); - }) - } - - Singlemagazines=(bool,id,name)=>{ - if(bool===true){ - this.setState({ - set_scoreid:id, - modalsTypeys:bool, - titilesm: name - }) - }else{ - this.setState({ - modalsTypeys:bool, - set_scoreid:null, - titilesm: null - }) - } - - - } - hideparagraph = (name) => { - //console.log("hideparagraph"); - - } - - hideparagraphs = () => { - this.setState({ - singlebool: false, - multiplebool: false, - judgmentbool: false, - programbool: false, - }) - } - showparagraph = (name) => { - //console.log("showparagraph"); - if (name === "SINGLE") { - this.setState({ - singlebool: true, - multiplebool: false, - judgmentbool: false, - programbool: false, - paperreviewsingleindex:"无", - paperreviewsinglename:"", - - }) - - } else if (name === "MULTIPLE") { - this.setState({ - singlebool: false, - multiplebool: true, - judgmentbool: false, - programbool: false, - paperreviewsingleindex:"无", - paperreviewsinglename:"", - - - }) - } else if (name === "JUDGMENT") { - this.setState({ - singlebool: false, - multiplebool: false, - judgmentbool: true, - programbool: false, - paperreviewsingleindex:"无", - paperreviewsinglename:"", - - }) - } else if (name === "PROGRAM") { - this.setState({ - singlebool: false, - multiplebool: false, - judgmentbool: false, - programbool: true, - paperreviewsingleindex:"无", - paperreviewsinglename:"", - - }) - - } - } - - jixuxuantioncli = () => { - this.props.history.replace("/question"); - } - - showparagraphs = (e,name) => { - // //console.log("showparagraphs"); - // //console.log(e); - this.setState({ - paperreviewsingleindex: e, - paperreviewsinglename:name, - singlebool: false, - multiplebool: false, - judgmentbool: false, - programbool: false, - }) - } - - Setscore=(id)=>{ - - - } - - - - render() { - let { - questions, totalscore, total, modalsTypedel, modalsTypey, modalsTypedels, - singlebool, - multiplebool, - judgmentbool, - programbool, - paperreviewsingleindex, - modalsTypeys - } = this.state; - let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props; - return ( -
- -
- - {/*单选题*/} - { - single_questions && single_questions ? -
- -
-
-

一、单选题

(共{single_questions && single_questions.questions_count}题;共{single_questions && single_questions.questions_score}分)

-
- - - - {(provided, snapshot) => ( -
- { - single_questions && single_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
- - - - - - -
- )} -
- ) - }) - - } -
- )} -
-
- - -
-
- - : "" - } - - - { - multiple_questions && multiple_questions ? -
-
-
-

{single_questions === null ? "一" : "二"}、多选题

-

(共{multiple_questions && multiple_questions.questions_count}题;共{multiple_questions && multiple_questions.questions_score}分)

-
- - - - - - {(provided, snapshot) => ( -
- { - multiple_questions && multiple_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
- - - - - -
- )} -
- ) - }) - - } -
- )} -
-
- - -
-
- : - "" - } - - { - judgement_questions && judgement_questions ? -
-
-
-

{single_questions === null && multiple_questions === null ? "一" : single_questions === null && multiple_questions !== null ? "二" - : single_questions !== null && multiple_questions === null ? "二" - : "三"}、判断题

(共{judgement_questions && judgement_questions.questions_count}题;共{judgement_questions && judgement_questions.questions_score}分)

-
- - - - - {(provided, snapshot) => ( -
- { - judgement_questions && judgement_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
- - - - - -
- )} -
- ) - }) - - } -
- )} -
-
-
-
- : "" - } - - - { - program_questions && program_questions ? -
- -
-
-

- {single_questions === null && multiple_questions === null && program_questions === null ? "一" - : single_questions === null && multiple_questions === null && program_questions !== null ? "二" - : single_questions !== null && multiple_questions === null && program_questions === null ? "二" - : single_questions === null && multiple_questions !== null && program_questions === null ? "二" - : single_questions !== null && multiple_questions !== null && program_questions === null ? "三" - : single_questions === null && multiple_questions !== null && program_questions !== null ? "三" - : single_questions !== null && multiple_questions == null && program_questions !== null ? "三" : - "四"} - 、编程题

(共{program_questions && program_questions.questions_count}题;共{program_questions && program_questions.questions_score}分)

-
- - - - - {(provided, snapshot) => ( -
- { - program_questions && program_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
- - - - -
- )} -
- ) - }) - - } -
- )} -
-
- - -
-
- : - "" - } - - -
-
- ) - - } - - -} - -export default Paperreview_item - - diff --git a/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js b/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js deleted file mode 100644 index 7d66a19c4..000000000 --- a/public/react/src/modules/testpaper/component/Paperlibraryseeid_items.js +++ /dev/null @@ -1,256 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, getImageUrl, markdownToHTML} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Drawer, - Input, - Button, - Breadcrumb, - Radio -} from "antd"; -import '../testioncss/testioncss.css'; -import '../../tpm/newshixuns/css/Newshixuns.css'; -import QuillForEditor from "../../../common/quillForEditor"; - -const tagArray = [ - 'A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.', - 'J.', 'K.', 'L.', 'M.', 'N.', 'O.', 'P.', 'Q.', 'R.', - 'S.', 'T.', 'U.', 'V.', 'W.', 'X.', 'Y.', 'Z.' -] - -//单选题 -class Paperlibraryseeid_items extends Component { - constructor(props) { - super(props); - - this.state = { - questions: 0, - totalscore: 0, - total: 0, - } - - } - - //初始化 - componentDidMount() { - - - } - - - getdata = (data) => { - - } - - preservation = () => { - - - } - - - setitem_type = (item_type) => { - - - } - showparagraph = (indexx) => { - - - } - Singlemagaziness = () => { - - } - - render() { - let {questions, totalscore, total, items} = this.state; - let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props; - - - var itemssname=""; - try { - itemssname= JSON.parse(objectsingle.name); - }catch (e) { - } - if(itemssname===undefined){ - itemssname=objectsingle.name - } - - var itemsnamesy=""; - try { - itemsnamesy= JSON.parse(objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description); - - }catch (e) { - itemsnamesy=objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description; - } - return ( -
- - {/*顶部*/} -
-
-

{indexx}

、 -
- - { - objectsingle.item_type==="PROGRAM"? -
-
- ({objectsingle.score}分) -
-
- -
-
- : -
-
- ({objectsingle.score}分) -
-
- - -
-
- } - -
- {/*内容*/} -
- - { - objectsingle.item_type === "JUDGMENT" ? -

- { - objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { - return ( -

- - {object.choice_text} - -

- ) - }) - } -

- : - objectsingle.item_type === "PROGRAM" ? -

-

- { - objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description? -

- -

- : - ""} -

-

- : -

- { - objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { - var string="" - try { - string=JSON.parse(object.choice_text); - }catch (e) { - string=object.choice_text; - } - return ( -

- {tagArray[index]} -

- {object ? - object.choice_text === undefined || object.choice_text=== null || object.choice_text === "" ? - "" - : - object.choice_text.length>0? - - :"" - : - "" - } -

-

- ) - }) - } -

- } - -
- - -
- ) - - } - - -} - -export default Paperlibraryseeid_items - - diff --git a/public/react/src/modules/testpaper/component/Paperlibraryseeid_itemss.js b/public/react/src/modules/testpaper/component/Paperlibraryseeid_itemss.js deleted file mode 100644 index b725b4e5e..000000000 --- a/public/react/src/modules/testpaper/component/Paperlibraryseeid_itemss.js +++ /dev/null @@ -1,790 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, getImageUrl} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Drawer, - Input, - Button, - Breadcrumb -} from "antd"; -import '../../question/questioncss/questioncom.css'; -import '../../tpm/newshixuns/css/Newshixuns.css'; -import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd'; -import PaperDeletModel from '../../question/component/PaperDeletModel'; -import PaperDeletModels from '../../question/component/PaperDeletModels'; -import Paperreview_itemModel from '../../question/component/Paperreview_itemModel'; -import Paperreview_itemModels from '../../question/component/Paperreview_itemModels'; -import Paperlibraryseeid_itemsss from './Paperlibraryseeid_itemsss'; - - -const reorder = (list, startIndex, endIndex) => { - const result = Array.from(list); - const [removed] = result.splice(startIndex, 1); - result.splice(endIndex, 0, removed); - - return result; -}; - -//这不是唯一的 试题库还有 Paperreview_item.js -class Paperlibraryseeid_itemss extends Component { - constructor(props) { - super(props); - - this.state = { - questions: 0, - totalscore: 0, - total: 0, - modalsTypedel: false, - modalsTypey: false, - modalsTypeys: false, - modalsTypedels: false, - titilesm: "", - titilesms: "", - singlebool: false, - multiplebool: false, - judgmentbool: false, - programbool: false, - paperreviewsingleindex: "无", - set_scoreid:null, - item_bank_id:null - } - - } - - //初始化 - componentDidMount() { - - - } - - - getdata = (data) => { - - } - - preservation = () => { - - - } - - - setitem_type = (item_type) => { - - - } - onDragEnd = (result) => { - - const ids = this.props.single_questions.questions[result.source.index].id; - const positions = this.props.single_questions.questions[result.destination.index].position; - - const url = `/examination_items/${ids}/adjust_position.json`; - var data = { - position: positions - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`拖动成功`); - this.props.getdata({}); - } - }).catch((error) => { - //console.log(error); - }) - } - - onDragEnds = (result) => { - - const ids = this.props.multiple_questions.questions[result.source.index].id; - const positions = this.props.multiple_questions.questions[result.destination.index].position; - const url =`/examination_items/${ids}/adjust_position.json`; - var data = { - position: positions - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`拖动成功`); - this.props.getdata({}); - } - }).catch((error) => { - //console.log(error); - }) - - - } - - - onDragEndss = (result) => { - const ids = this.props.judgement_questions.questions[result.source.index].id; - const positions = this.props.judgement_questions.questions[result.destination.index].position; - const url = `/examination_items/${ids}/adjust_position.json`; - var data = { - position: positions - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`拖动成功`); - this.props.getdata({}); - } - }).catch((error) => { - //console.log(error); - }) - - } - - onDragEndsss = (result) => { - - const ids = this.props.program_questions.questions[result.source.index].id; - const positions = this.props.program_questions.questions[result.destination.index].position; - const url = `/examination_items/${ids}/adjust_position.json`; - var data = { - position: positions - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`拖动成功`); - this.props.getdata({}); - } - }).catch((error) => { - //console.log(error); - }) - - } - Singlemagazine = (name, bool) => { - if (bool === true) { - this.setState({ - modalsTypey: true, - titilesm: name - }) - } else { - this.setState({ - modalsTypey: false, - titilesm: "" - }) - } - - - } - - setDownloady = (fenshu) => { - const url = "/examination_items/batch_set_score.json"; - var data = { - exam_id:this.props.match.params.id, - score: fenshu, - item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '', - - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`调分成功`); - this.props.getdata({}); - this.Singlemagazine("", false); - } - }).catch((error) => { - //console.log(error); - }) - } - - setDownloadys=(value)=>{ - const url = `/examination_items/${this.state.set_scoreid}/set_score.json`; - var data = { - score: value, - } - axios.post(url, data) - .then((result) => { - if (result.data.status == 0) { - // this.props.showNotification(`调分成功`); - this.props.getdata({}); - this.Singlemagazines(false); - } - }).catch((error) => { - //console.log(error); - }) - } - - Singlemagazines=(bool,id,name)=>{ - if(bool===true){ - this.setState({ - set_scoreid:id, - modalsTypeys:bool, - titilesm: name - }) - }else{ - this.setState({ - modalsTypeys:bool, - set_scoreid:null, - titilesm: null - }) - } - - - } - setmodalsTypedel = (bool, type, names) => { - if (type === 1) { - this.setState({ - modalsTypedel: bool, - titilesms: names - }) - } else { - this.setState({ - modalsTypedel: bool, - titilesms: names - }) - const url = `/examination_items/delete_item_type.json`; - axios.delete((url), { - data: { - exam_id:this.props.match.params.id, - item_type: names - } - }) - .then((response) => { - if (response.data.status == 0) { - // this.props.showNotification('大题删除成功'); - this.props.getdata({}); - this.setState({ - titilesms: "" - }) - } - }) - .catch(function (error) { - ////console.log(error); - }); - - - - } - - } - - setmodalsTypedels = (bool, type) => { - if (type === 1) { - this.setState({ - modalsTypedels: bool, - }) - }else { - //确定 - const url = `/examination_items/${this.state.item_bank_id}.json`; - axios.delete((url)) - .then((response) => { - if (response.data.status == 0) { - // this.props.showNotification('试题删除成功'); - this.props.getdata({}); - } - }) - .catch(function (error) { - - }); - - this.setState({ - modalsTypedels: bool, - }) - } - - } - - showsetmodalsTypedels=(id,bool,type)=>{ - debugger - this.setState({ - item_bank_id:id, - }) - this.setmodalsTypedels(bool,type); - } - - hideparagraph = (name) => { - //console.log("hideparagraph"); - - } - - hideparagraphs = () => { - this.setState({ - singlebool: false, - multiplebool: false, - judgmentbool: false, - programbool: false, - }) - } - showparagraph = (name) => { - //console.log("showparagraph"); - if (name === "SINGLE") { - this.setState({ - singlebool: true, - multiplebool: false, - judgmentbool: false, - programbool: false, - paperreviewsingleindex:"无", - paperreviewsinglename:"", - - }) - - } else if (name === "MULTIPLE") { - this.setState({ - singlebool: false, - multiplebool: true, - judgmentbool: false, - programbool: false, - paperreviewsingleindex:"无", - paperreviewsinglename:"", - - - }) - } else if (name === "JUDGMENT") { - this.setState({ - singlebool: false, - multiplebool: false, - judgmentbool: true, - programbool: false, - paperreviewsingleindex:"无", - paperreviewsinglename:"", - - }) - } else if (name === "PROGRAM") { - this.setState({ - singlebool: false, - multiplebool: false, - judgmentbool: false, - programbool: true, - paperreviewsingleindex:"无", - paperreviewsinglename:"", - - }) - - } - } - - jixuxuantioncli = () => { - this.props.history.replace("/question"); - } - - showparagraphs = (e,name) => { - // //console.log("showparagraphs"); - // //console.log(e); - this.setState({ - paperreviewsingleindex: e, - paperreviewsinglename:name, - singlebool: false, - multiplebool: false, - judgmentbool: false, - programbool: false, - }) - } - - Setscore=(id)=>{ - - - } - - - - render() { - let { - questions, totalscore, total, modalsTypedel, modalsTypey, modalsTypedels, - singlebool, - multiplebool, - judgmentbool, - programbool, - paperreviewsingleindex, - modalsTypeys - } = this.state; - let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props; - return ( -
- { - modalsTypedel === true ? - this.setmodalsTypedel(bool, type, name)}> - : "" - } - { - modalsTypey === true ? - this.setDownloady(fs)} - Singlemagazine={(name, bool) => this.Singlemagazine(name, bool)}> - : "" - } - - { - modalsTypeys === true ? - this.setDownloadys(value)} - Singlemagazines={(bool,id,name) => this.Singlemagazines(bool,id,name)}> - : "" - } - { - modalsTypedels === true ? - this.setmodalsTypedels(id,bool, type)}> - : "" - } -
- {/*单选题*/} - { - single_questions && single_questions ? -
- -
-
this.showparagraph("SINGLE")} onMouseLeave={() => this.hideparagraph("SINGLE")}> -

一、单选题

(共{single_questions && single_questions.questions_count}题;共{single_questions && single_questions.questions_score}分)

-
- { - singlebool === true ? -
-
this.setmodalsTypedel(true, 1, "SINGLE")}>删除
-
this.Singlemagazine("单选题", true)}>批量设置得分
-
: "" - } - - - {(provided, snapshot) => ( -
- { - single_questions && single_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
- - this.showsetmodalsTypedels(id,bool,type)} - Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)} - showparagraphs={(e,name) => this.showparagraphs(e,name)} - object={object} - hideparagraphs={() => this.hideparagraphs()} - > - - - - -
- )} -
- ) - }) - - } -
- )} -
-
- - -
-
- - : "" - } - - - { - multiple_questions && multiple_questions ? -
-
-
-
this.showparagraph("MULTIPLE")} - onMouseLeave={() => this.hideparagraph("MULTIPLE")}> -

{single_questions === null ? "一" : "二"}、多选题

-

(共{multiple_questions && multiple_questions.questions_count}题;共{multiple_questions && multiple_questions.questions_score}分)

-
- { - multiplebool === true ? -
-
this.setmodalsTypedel(true, 1, "MULTIPLE")}>删除 -
-
this.Singlemagazine("多选题", true)}>批量设置得分
-
- - : "" - } - - - - - {(provided, snapshot) => ( -
- { - multiple_questions && multiple_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
- - - this.showsetmodalsTypedels(id,bool,type)} - Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)} - showparagraphs={(e,name) => this.showparagraphs(e,name)} - object={object} - hideparagraphs={() => this.hideparagraphs()} - > - - -
- )} -
- ) - }) - - } -
- )} -
-
- - -
-
- : - "" - } - - { - judgement_questions && judgement_questions ? -
-
-
-
this.showparagraph("JUDGMENT")} - onMouseLeave={() => this.hideparagraph("JUDGMENT")}> -

{single_questions === null && multiple_questions === null ? "一" : single_questions === null && multiple_questions !== null ? "二" - : single_questions !== null && multiple_questions === null ? "二" - : "三"}、判断题

(共{judgement_questions && judgement_questions.questions_count}题;共{judgement_questions && judgement_questions.questions_score}分)

-
- { - judgmentbool === true ? -
-
this.setmodalsTypedel(true, 1, "JUDGMENT")}>删除 -
-
this.Singlemagazine("判断题", true)}>批量设置得分
-
- : ""} - - - - {(provided, snapshot) => ( -
- { - judgement_questions && judgement_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
- - - this.showsetmodalsTypedels(id,bool,type)} - Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)} - showparagraphs={(e,name) => this.showparagraphs(e,name)} - object={object} - hideparagraphs={() => this.hideparagraphs()} - > - - -
- )} -
- ) - }) - - } -
- )} -
-
-
-
- : "" - } - - - { - program_questions && program_questions ? -
- -
-
-
this.showparagraph("PROGRAM")} - onMouseLeave={() => this.hideparagraph("PROGRAM")}> -

- {single_questions === null && multiple_questions === null && program_questions === null ? "一" - : single_questions === null && multiple_questions === null && program_questions !== null ? "二" - : single_questions !== null && multiple_questions === null && program_questions === null ? "二" - : single_questions === null && multiple_questions !== null && program_questions === null ? "二" - : single_questions !== null && multiple_questions !== null && program_questions === null ? "三" - : single_questions === null && multiple_questions !== null && program_questions !== null ? "三" - : single_questions !== null && multiple_questions == null && program_questions !== null ? "三" : - "四"} - 、编程题

(共{program_questions && program_questions.questions_count}题;共{program_questions && program_questions.questions_score}分)

-
- { - programbool === true ? -
-
this.setmodalsTypedel(true, 1, "PROGRAM")}>删除
-
this.Singlemagazine("编程题", true)}>批量设置得分
-
- : "" - } - - - - {(provided, snapshot) => ( -
- { - program_questions && program_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
- - - this.showsetmodalsTypedels(id,bool,type)} - Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)} - showparagraphs={(e,name) => this.showparagraphs(e,name)} - object={object} - hideparagraphs={() => this.hideparagraphs()} - > - -
- )} -
- ) - }) - - } -
- )} -
-
- - -
-
- : - "" - } - - -
-
- ) - - } - - -} - -export default Paperlibraryseeid_itemss - - diff --git a/public/react/src/modules/testpaper/component/Paperlibraryseeid_itemsss.js b/public/react/src/modules/testpaper/component/Paperlibraryseeid_itemsss.js deleted file mode 100644 index 4ec68c8a1..000000000 --- a/public/react/src/modules/testpaper/component/Paperlibraryseeid_itemsss.js +++ /dev/null @@ -1,88 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, getImageUrl,markdownToHTML} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Drawer, - Input, - Button, - Breadcrumb -} from "antd"; -import '../../question/questioncss/questioncom.css'; -import '../../tpm/newshixuns/css/Newshixuns.css'; -import Paperreview_single from "../../question/Paperreview_single"; - -//判断题 -//这不是唯一的 试题库还有Paperreview_items -class Paperlibraryseeid_itemsss extends Component { - constructor(props) { - super(props); - - this.state = { - - } - - } - - //初始化 - componentDidMount() { - - - - - } - - - getdata = (data) => { - - } - - preservation = () => { - - - - - } - - - setitem_type = (item_type) => { - - - } - - render() { - let {paperreviewsingleindex,paperreviewsinglename,typenames,indexs,object,typenamesn}=this.props; - - return ( -
- { - paperreviewsingleindex===indexs&&paperreviewsinglename===typenames? -
-
this.props.showsetmodalsTypedels(object.id,true,1)}>删除
-
this.props.Singlemagazines(true,object.id,typenamesn)}>设置得分
-
- :
-
- } - this.props.showparagraphs(e,name)} - objectsingle={object} key={indexs} indexx={indexs + 1} - indexxy={indexs} - hideparagraphs={() => this.props.hideparagraphs()}> -
- ) - - } - - -} - -export default Paperlibraryseeid_itemsss - - diff --git a/public/react/src/modules/testpaper/component/QuestionModal.js b/public/react/src/modules/testpaper/component/QuestionModal.js deleted file mode 100644 index 159da6f7a..000000000 --- a/public/react/src/modules/testpaper/component/QuestionModal.js +++ /dev/null @@ -1,43 +0,0 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import { Modal} from 'antd'; -import axios from 'axios'; -import './../testioncss/testioncss.css' -//立即申请试用 -class QuestionModal extends Component { - - constructor(props) { - super(props); - this.state={ - - } - } - - - render() { - - return( - -
-

{this.props.titilesm}

-

{this.props.titiless}

- -
-
- ) - } -} - -export default QuestionModal; diff --git a/public/react/src/modules/testpaper/component/QuestionModals.js b/public/react/src/modules/testpaper/component/QuestionModals.js deleted file mode 100644 index 05afdc270..000000000 --- a/public/react/src/modules/testpaper/component/QuestionModals.js +++ /dev/null @@ -1,66 +0,0 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import { Modal} from 'antd'; -import axios from 'axios'; -import './../testioncss/testioncss.css' -//立即申请试用 -class QuestionModals extends Component { - - constructor(props) { - super(props); - this.state={ - - } - } - - - render() { - - return( - -
-

是否删除试题栏中{ - - this.props.titilesms&&this.props.titilesms==="SINGLE"? - "单选题" - : - this.props.titilesms&&this.props.titilesms==="MULTIPLE"? - "多选题" - : - this.props.titilesms&&this.props.titilesms==="JUDGMENT"? - "判断题" - : - this.props.titilesms&&this.props.titilesms==="COMPLETION"? - "填空题" - : - this.props.titilesms&&this.props.titilesms==="SUBJECTIVE"? - "简答题" - : - this.props.titilesms&&this.props.titilesms==="PROGRAM"? - "编程题" - : - this.props.titilesms&&this.props.titilesms==="PRACTICAL"? - "实训题" - :"" - - }

- -
-
- ) - } -} - -export default QuestionModals; diff --git a/public/react/src/modules/testpaper/component/Seeoagertit.js b/public/react/src/modules/testpaper/component/Seeoagertit.js deleted file mode 100644 index 6a835ce98..000000000 --- a/public/react/src/modules/testpaper/component/Seeoagertit.js +++ /dev/null @@ -1,56 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Radio, - Checkbox -} from "antd"; -import './../testioncss/testioncss.css'; -class Seeoagertit extends Component { - constructor(props) { - super(props); - this.state = { - page:1, - } - } - //初始化 - componentDidMount(){ - - - } - onChange=(e)=> { - } - - render() { - - return ( - -
-
-
-

题数:{this.props.all_score}

-

总分:{this.props.all_questions_count}

-
-
-
-
-
拖动试题可调整排序
- - -
-
- ) - - } - - - -} -export default Seeoagertit ; diff --git a/public/react/src/modules/testpaper/component/Seeoagertits.js b/public/react/src/modules/testpaper/component/Seeoagertits.js deleted file mode 100644 index a983bd67e..000000000 --- a/public/react/src/modules/testpaper/component/Seeoagertits.js +++ /dev/null @@ -1,70 +0,0 @@ -import React, {Component} from "react"; -import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder'; -import axios from 'axios'; -import { - notification, - Spin, - Table, - Pagination, - Radio, - Checkbox -} from "antd"; -import './../testioncss/testioncss.css'; -class Seeoagertit extends Component { - constructor(props) { - super(props); - this.state = { - page:1, - } - } - //初始化 - componentDidMount(){ - - - } - onChange=(e)=> { - } - jixuxuantioncli = () => { - this.props.history.replace("/question"); - } - - render() { - - return ( - -
-
-
-

题数:{this.props.all_score}

-

总分:{this.props.all_questions_count}

-

难度: - {this.props.difficulty===undefined?"": - this.props.difficulty===1?"简单":this.props.difficulty===2?"适中":this.props.difficulty===3?"困难":"" - } -

- -
-
-
this.props.setnewmyshixunmodelbool(true)}> - 继续选题 -
-
-
-
-
-
拖动试题可调整排序
- - -
-
- ) - - } - - - -} -export default Seeoagertit ; diff --git a/public/react/src/modules/testpaper/testioncss/testioncss.css b/public/react/src/modules/testpaper/testioncss/testioncss.css deleted file mode 100644 index 2025779ab..000000000 --- a/public/react/src/modules/testpaper/testioncss/testioncss.css +++ /dev/null @@ -1,929 +0,0 @@ -.w1200{ - width:1062px; - height:177px; - background:rgba(255,255,255,1); - box-shadow:0px 6px 8px 0px rgba(0,0,0,0.03); - border-radius:2px; -} -.w1200wuh{ - width:1062px; - background:rgba(255,255,255,1); - box-shadow:0px 6px 8px 0px rgba(0,0,0,0.03); - border-radius:2px; -} -.w1200dbl{ - width:1062px; - min-height:60px; - background:rgba(255,255,255,1); - box-shadow:0px 6px 8px 0px rgba(0,0,0,0.03); - border-radius:2px; -} -.w1200fpx{ - width:1200px; - background:rgba(255,255,255,1); - box-shadow:0px 6px 8px 0px rgba(0,0,0,0.03); - border-radius:2px; -} -.w1200mss{ - width:1200px; -} -.w1200ms{ - width:1062px; -} -.w1200s{ - width:1062px; - background:rgba(255,255,255,1); - box-shadow:0px 6px 8px 0px rgba(0,0,0,0.03); - border-radius:2px; -} -.h177{ - height: 177px; -} -/* 中间居中 */ -.intermediatecenter{ - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} -/* 简单居中 */ -.intermediatecenterysls{ - display: flex; - align-items: center; -} -.spacearound{ - display: flex; - justify-content: space-around; - -} -.spacebetween{ - display: flex; - justify-content: space-between; -} -/* 头顶部居中 */ -.topcenter{ - display: -webkit-flex; - flex-direction: column; - align-items: center; - -} - - -/* x轴正方向排序 */ -/* 一 二 三 四 五 六 七 八 */ -.sortinxdirection{ - display: flex; - flex-direction:row; -} -/* x轴反方向排序 */ -/* 八 七 六 五 四 三 二 一 */ -.xaxisreverseorder{ - display: flex; - flex-direction:row-reverse; -} -/* 垂直布局 正方向*/ -/* 一 - 二 - 三 - 四 - 五 - 六 - 七 - 八 */ -.verticallayout{ - display: flex; - flex-direction:column; -} -/* 垂直布局 反方向*/ -.reversedirection{ - display: flex; - flex-direction:column-reverse; -} -.w100{ - width: 100px; -} -.mt21{ - margin-top: 21px; -} -.mt23{ - margin-top: 23px; -} -.mt19{ - margin-top: 19px; -} -.mt15{ - margin-top: 10px; -} -.h40{ - height: 40px; -} - -.tophom{ - padding-top: 33px; - padding-bottom: 40px; - padding-left: 26px; - padding-right: 26px; -} -.tophoms{ - padding-top: 15px; - padding-left: 26px; - padding-right: 26px; -} -.borderwd{ - border: 1px solid #000000; -} -.borderwds{ - width: 1020px !important; - background: #FFFFFF; - border: 1px solid #DDDDDD; - margin-left: 20px; - min-height:150px; -} -.borderwdsst{ - width: 1020px !important; - background: #FFFFFF; - border: 1px solid #DDDDDD; - margin-left: 20px; - min-height:150px; -} -.borderwdswuh{ - width: 1020px !important; - background: #FFFFFF; - border: 1px solid #DDDDDD; - min-height:150px; -} - -.borderwdswuh:hover{ - background: #F9F9F9; -} -.borderwds283{ - width: 1020px !important; - min-height:283px; - background:#F9F9F9; - border:1px solid #DDDDDD; - margin-left: 20px; -} -.w64{ - width: 64px; -} -.w70{ - width: 70px !important; -} - -.tophomsembold{ - height:21px; - font-size:16px; - color:#333333; - line-height:21px; -} - -.tophomsembolds{ - width:42px; - height:19px; - font-size:14px; - font-family:MicrosoftYaHeiSemibold; - color:rgba(51,51,51,1); - line-height:31px; -} -/*Contentpart*/ -.contentparttit{ - padding-top: 10px; - padding-left: 20px; - padding-right: 20px; -} - -.subjecttit{ - width:28px; - height:19px; - font-size:14px; - color:rgba(51,51,51,1); - line-height: 42px; - cursor:pointer; - -} - -.subjecttitys{ - height:19px; - font-size:14px; - color:rgba(51,51,51,1); - line-height: 42px; - cursor:pointer; - -} -.ml55{ - margin-right: 55px; - -} - -.lg{ - line-height: 42px; -} -.ml7{ - margin-left: 7px; -} - -.icondowncolor{ - color:#9E9E9E; - -} -.icondowncolorss{ - color: #9E9E9E; - position: absolute; - top: -20px; - right: -16px; -} - -.questiontype{ - width: 100%; - font-size: 12px; - color: #333333; - line-height: 17px; - text-align: center; - padding: 11px; - cursor:pointer; - -} -.questiontypes{ - width:37px; - height:17px; - font-size:12px; - color:rgba(51,51,51,1); - line-height:17px; - cursor:pointer; - -} -.questiontypeheng{ - width:100%; - height:1px; - background: #EEEEEE; -} -.questiontype:hover{ - color: #4CACFF; -} -.questiontype:active{ - color: #4CACFF; -} - -.w100s{ - width:100% !important; -} -.stestcen{ - text-align: center; -} -.w70s{ - width:70%; -} -.w30s{ - width:30%; -} -.w60s{ - width:60%; -} -.w40s{ - width:40%; -} -.w65s{ - width:65%; -} -.w35s{ - width:35%; -} -.w50s{ - width: 50%; -} -.testpaper{ - font-size:12px; - color:#888888; - line-height:28px; - text-align: center; -} - -.setequesbank{ - font-size:14px; - color:#333333; - line-height:28px; -} - -.Contentquestionbankstyle{ - padding-left: 20px; - padding-right: 20px; -} - -.pd20{ - padding-top: 20px; - padding-bottom: 20px; - padding-left: 30px; - padding-right: 30px; -} - -/*listjihe*/ -.listjihetixing{ - color: #888888; - font-size: 12px; - line-height: 17px; -} - -.listjihetixings{ - color: #333333; - font-size: 12px; - line-height: 17px; -} -.listjihetixingstit{ - color: #333333; - font-size: 14px; - line-height: 17px; - -} -.listjihetixingstits{ - color: #333333; - font-size: 14px; - line-height:19px; - margin-top: 19px; -} - -.updatetimes{ - color: #BBBBBB; - font-size: 12px; -} -.mt22{ - margin-top: 22px; -} -.viewparsings{ - color:#4CACFF; - font-size:12px; - line-height: 30px; -} - -.selection{ - width:88px; - height:30px; - background:#33BD8C; - border-radius:4px; - text-align: center; - line-height: 30px; - color: #FFFFFF; -} -.selectionss{ - width:88px; - height:30px; - background:#CCCCCC; - border-radius:4px; - text-align: center; - line-height: 30px; - color: #FFFFFF; -} -.lh30{ - line-height: 30px; - - -} - -.analysis{ - height:19px; - font-size:14px; - color:#333333; - line-height:19px; -} - -.testfondex{ - color: #808080; - font-size: 14px; -} -.pb20{ - padding-bottom: 20px; -} -.icontianjiadaohangcolor{ - color: #FFFFFF; -} - -.icontianjiadaohangcolors{ - color: #4CACFF; -} -.xiaoshou{ - cursor:pointer; -} -.xiaoshout{ - cursor:default; -} -.shubiao{ - cursor:default; -} -.mt40{ - margin-top: 40px; -} -.mt42{ - margin-top: 42px; -} -.drawerbutton{ - width:88px; - height:30px; - background:#4CACFF; - border-radius:4px; - font-size:14px; - color:#ffffff; - line-height:30px; - text-align: center; -} -.icondrawercolor{ - color: #979797; -} - -.mt25{ - margin-top: 25px; -} -.mb26{ - margin-bottom: 26px; -} -.drawernonedatadiv{ - height: 100%; -} - -.font-17{ - font-size: 17px; -} -.ml30{ - margin-right: 30px; -} -.mr25{ - margin-right: 25px; -} -.newbutoon{ - width:88px; - height:42px; - background:#33BD8C; - line-height: 42px; - border-radius:4px; - -} - -.newbutoons{ - width:106px; - height:34px; - background:rgba(76,172,255,1); - border-radius:4px; - line-height: 34px; - color:#ffffff; -} -.newbutoonss{ - width:106px; - height:34px; - background:rgba(51,189,140,1); - border-radius:4px; - line-height: 34px; - color:#ffffff; - - -} - -.newbutoontess{ - width:100%; - height:34px; - font-size:14px; - color:#ffffff; - line-height:34px; - text-align: center; -} - - -.newbutoontes{ - width:100%; - height:42px; - font-size:14px; - color:#ffffff; - line-height:42px; - text-align: center; -} -.educouddiv { - display: flex; - flex-direction: column; -} - -.tabeltext-alignleftysl{ - font-size:14px; - color:#000000; - line-height:19px; - -} -.tabeltext-alignleftysltwo{ - font-size:14px; - color:#848282; - line-height:19px; - -} - -.publictask-btn{ - width:80px; - height:34px; - background:#CCCCCC; - border-radius:4px; - color: #ffffff; - -} -.publictask-btns{ - width:80px; - height:34px; - background:#4CACFF; - border-radius:4px; - color: #ffffff; -} -.w80{ - width: 80px; -} - -.titiles{ - color: #333333; - font-size: 16px; -} - -.h12{ - height: 12px; - min-height: 12px; -} - -.mt19{ - margin-top: 19px; -} -.mytags{ - width:106px; - height:32px; - border-radius:2px; - border:1px solid #DDDDDD; - margin-right: 20px; -} -.lh32{ - line-height: 32px; -} - -.h20{ - height: 20px; - min-height: 20px; - line-height: 20px; -} -.xingcolor{ - color: rgba(224, 64, 64, 1); -} -.xingtigan{ - font-size:14px; - color:rgba(51, 51, 51, 1); -} -.mr4{ - margin-right: 4px; -} - -.xingtigans{ - width:100%; - font-size:14px; - color:rgba(136,136,136,1); -} - -.bottomdivs{ - width:100%; - height:55px; - background:rgba(255,255,255,1); - box-shadow:0px -2px 7px 0px rgba(1,6,22,0.04); -} -.mt50{ - margin-top: 50px; -} - -.divquxiao{ - width:88px; - height:32px; - background:rgba(255,255,255,1); - border-radius:4px; - border:1px solid rgba(204,204,204,1); -} -.divquxiaotest{ - width:100%; - height:32px; - font-size:12px; - color:rgba(136,136,136,1); - line-height:32px; - text-align: center; -} -.divbaocuntests{ - width:100%; - height:32px; - font-size:12px; - color:#ffffff; - line-height:32px; - text-align: center; -} -.divbaocun{ - width:88px; - height:32px; - background:rgba(76,172,255,1); - border-radius:4px; -} -.sortzhenque{ - width:49px; - height:33px; - border-radius:2px; - border:1px solid rgba(221,221,221,1); -} - -.sortzhenquetest{ - width:100%; - height:33px; - font-size:14px; - color:rgba(51,51,51,1); - line-height:33px; - -} - -.sortquxiao{ - - width:49px; - height:33px; - border-radius:2px; - border:1px solid rgba(221,221,221,1); -} -.sortquxiaotest{ - width:100%; - height:33px; - font-size:14px; - color:rgba(51,51,51,1); - line-height:33px; -} - -.ml45{ - margin-left: 45px; -} - -.programcss{ - height: 251px; - min-height: 100%; -} - -.titlesttingcss{ - min-width: 100px; - height:32px; - line-height: 32px; - background:rgba(76,172,255,1); - border-radius:16px; - text-align: center; - color: #fff; -} -.titlesttingcssmy{ - min-width: 100px; - height:32px; - line-height: 32px; - font-size:14px; - color:rgba(51,51,51,1); - text-align: center; -} -.minleng40{ - min-height: 40px; -} - -.w60{ - width: 60px !important; -} - -.h30{ - min-height: 30px !important; -} - -.minheight{ - min-height: 500px !important; -} -.pd20{ - padding: 20px; -} - -.ml58{ - margin-left: 58px; -} -.questionstishu{ - color: #888888; - font-size: 14px; -} -.questionstotal{ - color: #333333; - font-size: 14px; - -} -.pagertdstcolor{ - color: #888888; - font-size: 12px; -} - -.mb19{ - margin-bottom: 19px; -} - -.yldxtit{ - color: #333333; - font-size: 14px; - -} -.yldxtits{ - color: #888888; - font-size: 14px; -} -.mt25{ - margin-top: 25px; -} - -.postitonrelati{ - position: relative; -} -.postitonrelatis{ - position: absolute; - right: 2px; - top: 11px; -} - -.szdfd{ - width:88px; - height:34px; - background:rgba(51,189,140,1); - border-radius:4px 4px 0px 0px; - text-align: center; - color: #ffffff; - line-height: 32px; - margin-right: 27px; -} -.scd{ - width:88px; - height:34px; - background:#4CACFF; - border-radius:4px 4px 0px 0px; - text-align: center; - color: #ffffff; - line-height: 32px; - - -} - -.pd20{ - padding: 20px; -} - -.cretitlecolrlis{ - color: #333333; - font-size: 14px !important; -} - -.cretitlecolrlisobj{ - color: #888888; - font-size: 14px !important; - -} - -.cretitlecolrlist{ - color: #333333; - font-size: 14px !important; - -} -.lh28{ - line-height: 28px; -} -.h20{ - height: 20px; - background-color: #fff; -} -.lh20{ - line-height: 20px; - background-color: #fff; -} - -.backgroudwhites{ - background-color: #fff; -} - -.ml5{ - margin-left: 5px; -} - -.lh35{ - line-height: 35px; -} - -.mr39{ - margin-right: 30px; -} - -.sjimg{ - width: 104px; -} -.sjfqks{ - width: 100px; -} - -.sjtitle{ - width:100%; - height:21px; - font-size:16px; - color:#333333; - line-height:21px; -} - -.sjtitles{ - width:64px; - height:17px; - font-size:12px; - color:#888888; - line-height:17px; -} -.sjtitles span{ - color: #333333 !important; - -} -.ml48{ - margin-left: 48px; -} -.sjtitlesysl{ - height:17px; - font-size:12px; - color:#BBBBBB; - line-height:30px; - -} -.mt11{ - margin-top: 11px; -} -.ml37{ - margin-left: 37px; -} -.listjihecolor:hover{ - background: #F9F9F9; - background-color: #F9F9F9; -} - -.seesjtit{ - height:27px; - font-size:19px; - color:#333333; - line-height:27px; -} -.mt16{ - margin-top: 16px; -} -.mb20{ - margin-bottom: 20px; -} -.fudonxianshi{ - position: relative; -} - -.fudonxianshis{ - position:absolute; - z-index: 700; -} - -.sjtitle:hover{ - color: #4CACFF; -} -.nofabu{ - width:46px; - height:20px; - background:rgba(255,102,1,1); - border-radius:10px; - color: #ffffff; - text-align: center; - line-height: 20px; -} -.mt25{ - margin-top: 25px; -} - -.imgtp{ - width: 39px; - height: 44px; -} -.tites{ - color: #888888 !important; -} -.conditionsetting{ - width:64px; - height:21px; - font-size:16px; - color:#333333; - line-height:21px; -} - -.conditionsettings{ - width:80px; - height:21px; - font-size:16px; - font-family:MicrosoftYaHei; - color:rgba(51,51,51,1); - line-height:21px; -} -.hengxians{ - width:1021px; - height:1px; - background: #EEEEEE; -} -.mt13{ - margin-top: 13px; -} -.dxuantitie{ - width:57px; - height:19px; - font-size:14px; - font-family:MicrosoftYaHei; - color:rgba(51,51,51,1); - line-height:19px; -} diff --git a/public/react/src/modules/topic_bank/Topic_bank.js b/public/react/src/modules/topic_bank/Topic_bank.js deleted file mode 100644 index a4bbc9dd7..000000000 --- a/public/react/src/modules/topic_bank/Topic_bank.js +++ /dev/null @@ -1,51 +0,0 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import Loading from '../../Loading' - -import Loadable from 'react-loadable'; -import { TPMIndexHOC } from '../tpm/TPMIndexHOC' -import { SnackbarHOC } from 'educoder' - - -const PackageIndex = Loadable({ - loader: () => import('../user/usersInfo/InfosTopics'), - loading: Loading, -}) - - -class Topic_bank extends Component { - constructor(props) { - super(props) - } - - componentDidMount(){ - } - - render() { - return ( -
- - - () - } - > - - () - } - > - - -
- ); - } -} - -export default SnackbarHOC() (TPMIndexHOC (Topic_bank)) ; \ No newline at end of file diff --git a/public/react/src/modules/tpm/1.js b/public/react/src/modules/tpm/1.js deleted file mode 100644 index 1a1494e08..000000000 --- a/public/react/src/modules/tpm/1.js +++ /dev/null @@ -1,83 +0,0 @@ -import React, { Component } from 'react'; -import { Redirect } from 'react-router'; - -import PropTypes from 'prop-types'; - -import Comments from '../comment/Comments' - -import { commentHOC } from '../comment/CommentsHOC' -import { CircularProgress } from 'material-ui/Progress'; - -import './TPMShixunDiscuss.css' - -import TPMRightSection from './component/TPMRightSection' -import TPMNav from './component/TPMNav' - -class TPMShixunDiscuss extends Component { - constructor(props) { - super(props) - - } - - componentWillReceiveProps(newProps, newContext) { - if (newProps.shixun && newProps.shixun.id && (!this.props || !this.props.shixun || this.props.shixun.id != newProps.shixun.id) ) { - window.document.title = newProps.shixun.name - // this.props.fetchCommentIfNotFetched && - // this.props.fetchCommentIfNotFetched(); - } - } - - componentDidMount() { - // TODO 加了HOC后 mount了两次 - this.props.fetchCommentIfNotFetched && - this.props.fetchCommentIfNotFetched(); - } - // - - onPaginationChange = (page) => { - window.$("html,body").animate({"scrollTop":160}) - this.props.onPaginationChange(page) - } - - render() { - const { loadingComments, creator, shixun, myshixun, recommend_shixuns, current_user, watched, - aboutFocus, user, match - } = this.props; - - let _user = user; - if (user) { - _user = Object.assign({}, user); - _user.user_url = `/users/${user.login}` - } - return ( - -
- -
- - { loadingComments ? - : - - } -
- -
- -
-
-
- - ); - } -} - -export default commentHOC( TPMShixunDiscuss ); diff --git a/public/react/src/modules/tpm/Audit_situationComponent.js b/public/react/src/modules/tpm/Audit_situationComponent.js deleted file mode 100644 index 3739cd6db..000000000 --- a/public/react/src/modules/tpm/Audit_situationComponent.js +++ /dev/null @@ -1,261 +0,0 @@ -import React, { Component } from 'react'; -import { Redirect } from 'react-router'; -import { List,Typography,Tag,Modal,Radio} from 'antd'; - -import TPMRightSection from './component/TPMRightSection'; -import TPMNav from './component/TPMNav'; -import axios from 'axios'; - -class Audit_situationComponent extends Component { - constructor(props) { - super(props) - this.state = { - datas:undefined, - value:undefined, - } - } - - componentDidMount() { - this.getdatas() - - } - - - getdatas=()=>{ - - let url=`/shixuns/${this.props.match.params.shixunId}/review_newest_record.json`; - axios.get(url).then((response) => { - - if(response.data===undefined||JSON.stringify(response.data) == "{}"||response.data===null){ - this.setState({ - datas:[ - { - name: '内容审核情况', - id:"Content", - }, - { - name: '性能审核情况', - id:"Performance", - }, - ] - }) - }else{ - let newlist=[] - if(response.data.content_info!=undefined&&response.data.perference_info===undefined){ - let arr=[ - { - name: '内容审核情况', - id:"Content", - status:response.data.content_info.status, - username:response.data.content_info.username, - time:response.data.content_info.time, - }, - { - name: '性能审核情况', - id:"Performance", - }, - ] - newlist=arr - } - - if(response.data.content_info===undefined&&response.data.perference_info!=undefined){ - let arr=[ - { - name: '内容审核情况', - id:"Content", - }, - { - name: '性能审核情况', - id:"Performance", - status:response.data.perference_info.status, - username:response.data.perference_info.username, - time:response.data.perference_info.time, - }, - ] - newlist=arr - } - - if(response.data.content_info!=undefined&&response.data.perference_info!=undefined){ - let arr=[ - { - name: '内容审核情况', - id:"Content", - status:response.data.content_info.status, - username:response.data.content_info.username, - time:response.data.content_info.time, - }, - { - name: '性能审核情况', - id:"Performance", - status:response.data.perference_info.status, - username:response.data.perference_info.username, - time:response.data.perference_info.time, - }, - ] - newlist=arr - } - - this.setState({ - datas:newlist - }) - - } - }).catch((error) => { - console.log(error) - }); - } - - showModal = (id,status) => { - debugger - this.setState({ - visible: true, - editid:id, - value:status - }); - }; - - handleOk=(id,editid)=>{ - let url = `/shixuns/${this.props.match.params.shixunId}/review_shixun.json`; - axios.post(url, { - status: id===undefined?1:id, - review_type: editid, - }).then((response) => { - if(response.data.status===0){ - this.props.showNotification(response.data.message); - this.setState({ - visible: false, - }); - this.getdatas() - } - }).catch((error) => { - console.log(error) - }); - }; - - handleCancel = e => { - this.setState({ - visible: false, - }); - }; - - onChange = e => { - this.setState({ - value: e.target.value, - }); - }; - render() { - const { tpmLoading, shixun, user, match } = this.props; - let {value,editid,datas}=this.state; - - console.log(this.props) - return ( - - - {this.state.visible===true? -
- - - - 已完成 - 未完成 - - - - -
- -
:""} - - - - { tpmLoading ?
: - -
- -
- - - -
- {this.props.identity >2||this.props.identity===undefined?"": ( - this.showModal(item.id,item.status)} key={key}> - - , - ]} - > - -
{item.name}
- {item.status===undefined?"":item.status===1?已完成:未完成} -
} - description={ -
- {item.time===undefined?"":审核时间: {item.time}} - {item.username===undefined?"":审核人: {item.username}} -
- } - /> - - )} - />} -
- -
- -
- -
-
- - } - - ); - } -} - -export default Audit_situationComponent; diff --git a/public/react/src/modules/tpm/NewFooter.js b/public/react/src/modules/tpm/NewFooter.js deleted file mode 100644 index 051bfadc7..000000000 --- a/public/react/src/modules/tpm/NewFooter.js +++ /dev/null @@ -1,53 +0,0 @@ -import React, { Component } from 'react'; -import moment from 'moment'; -import { Link } from 'react-router-dom'; - - -class NewFooter extends Component { - render() { - return ( -
- - -
-
    -
  • 网站首页
  • -
  • 关于我们
  • -
  • 联系我们
  • -
  • 合作伙伴
  • -
  • 服务协议
  • -
  • 帮助中心
  • -
  • 意见反馈
  • -
-
-
-

- © {moment().year()} EduCoder - 湘ICP备17009477号 - - 湘公网安备43019002000962号 - - Trustie   &   IntelliDE inside. 版权所有 湖南智擎科技有限公司 -

-
-
-
- ); - } -} - -export default NewFooter; diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js deleted file mode 100644 index 2ebc23c96..000000000 --- a/public/react/src/modules/tpm/NewHeader.js +++ /dev/null @@ -1,1418 +0,0 @@ -import React, { Component } from 'react'; -import { BrowserRouter as Router, Route, Link } from "react-router-dom"; -import { Redirect } from 'react-router'; -import AccountProfile from"../user/AccountProfile"; -import PropTypes from 'prop-types'; -import Certifiedprofessional from "../../modules/modals/Certifiedprofessional" - -// import searchImg from '../../../../images/educoder/icon/search.svg' - -// /images/educoder/icon/search.svg - -import { getImageUrl, toPath ,trigger,broadcastChannelPostMessage} from 'educoder' - -import axios from 'axios'; - -import { Modal,Checkbox ,Radio,Input,message,notification,Popover} from 'antd'; - -import Addcourses from '../courses/coursesPublic/Addcourses'; - -import LoginDialog from '../login/LoginDialog'; - -import Trialapplication from '../login/Trialapplication'; - -import GotoQQgroup from '../../modal/GotoQQgroup' - -import 'antd/lib/modal/style/index.css'; - -import 'antd/lib/checkbox/style/index.css'; - -import 'antd/lib/radio/style/index.css'; - -import 'antd/lib/input/style/index.css'; - -import './TPMIndex.css'; - - - -const $ = window.$ -// TODO 这部分脚本从公共脚本中直接调用 - -const RadioGroup = Radio.Group; -const { Search } = Input; -let old_url; - -/* - _logined_header.html.erb - _unlogin_header.html.erb -*/ -window._header_componentHandler = null; -class NewHeader extends Component { - constructor(props) { - super(props) - this.state={ - Addcoursestypes:false, - tojoinitemtype:false, - tojoinclasstitle:undefined, - rolearr:["",""], - Checkboxteacherchecked:false, - Checkboxstudentchecked:false, - Checkboxteachingchecked:false, - Checkboxteachertype:false, - Checkboxteachingtype:false, - code_notice:false, - checked_notice:false, - RadioGroupvalue:undefined, - submitapplications:false, - isRender:false, - showSearchOpentype:false, - showTrial:false, - setevaluatinghides:false, - occupation:0, - mydisplay:false, - headtypesonClickbool:false, - headtypess:"/", - mygetHelmetapi2: null, - goshowqqgtounp:false, - visiblemyss:false, - } - // console.log("176") - // console.log(props); - // console.log("NewHeader1234567890"); - // console.log(this.props); - } - componentDidUpdate = (prevProps) => { - // console.log("componentDidMount2"); - // console.log(this.state.mygetHelmetapi2); - if(this.state.mygetHelmetapi2===undefined){ - this.getAppdata(); - } - } - componentDidMount() { - // console.log("componentDidMount1"); - this.getAppdata(); - window._header_componentHandler = this; - - //下拉框的显示隐藏 - var hoverTimeout; - var hoveredPanel; - $(".edu-menu-panel").hover(function(){ - if (hoverTimeout) { // 一次只显示一个panel - if (hoveredPanel && hoveredPanel != this) { - $(hoveredPanel).find(".edu-menu-list").hide() - } - clearTimeout(hoverTimeout); - hoverTimeout = null; - } - hoveredPanel = this; - $(this).find(".edu-menu-list").show(); - },function(){ - var that =this; - // 延迟hide - hoverTimeout = setTimeout(function() { - $(that).find(".edu-menu-list").hide(); - }, 800) - - }); - - //获取游览器地址 - try { - window.sessionStorage.setItem("yslgeturls", JSON.stringify(window.location.href)) - } catch (e) { - - } - // axios.interceptors.response.use((response) => { - // if (response != undefined) - // if (response && response.data.status === -1) { - // if (response.data.message === "该课堂要求成员完成实名认证") { - // - // } else if (response.data.message === "该课堂要求成员完成职业认证") { - // console.log("该课堂要求成员完成职业认证"); - // this.HideAddcoursestypess(2); - // - // - // - // return - // } else if (response.data.message === "该课堂要求成员完成实名和职业认证") { - // console.log("该课堂要求成员完成实名和职业认证"); - // this.HideAddcoursestypess(3); - // return - // - // } - // } - // return response; - // }, (error) => { - // - // }); - } - - componentDidUpdate = (prevProps) => { - // if(prevProps.user!=this.props.user){ - // // console.log("216") - // // console.log(prevProps.user); - // // console.log(this.props.user); - // if(this.props.user !== undefined){ - // this.setState({ - // user_phone_binded :this.props.user.user_phone_binded, - // }) - // } - // - // - // } - } - - openNotification = (messge) => { - notification.open({ - message: "提示", - description: - messge, - }); - }; - - componentWillReceiveProps(newProps, oldProps) { - this.setState({ - user:newProps.user - }) - if(newProps.Headertop!=undefined){ - old_url=newProps.Headertop.old_url - } - - } - getCookie=(key)=>{ - var arr,reg = RegExp('(^| )'+key+'=([^;]+)(;|$)'); - if (arr = document.cookie.match(reg)) //["username=liuwei;", "", "liuwei", ";"] - return decodeURIComponent(arr[2]); - else - return null; - } - - delCookie=(name)=>{ - var exp = new Date(); - exp.setTime(exp.getTime() - 1); - var cval=this.getCookie(name); - if(cval!=null){ - document.cookie= name + "="+cval+";expires="+exp.toGMTString(); - } - } - onLogout = () => { - const url = `/accounts/logout.json` - this.delCookie("autologin_trustie") - axios.get(url, { - }) - .then((response) => { - if(response.data.status===1){ - this.setState({ - user:undefined - }) - // let path="/"; - // this.props.history.push(path); - // broadcastChannelPostMessage('refreshPage') - window.location.href ="/login" - message.success('退出成功'); - } - }); - } - - tojoinclass=()=>{ - let{user} =this.state; - if(user===undefined){ - this.setState({ - isRender:true - }) - return - } - if(user&&user.login===""){ - this.setState({ - isRender:true - }) - return; - } - - if(user&&user.profile_completed===false){ - this.setState({ - AccountProfiletype:true - }) - return; - } - - this.setState({ - Addcoursestypes:true, - }) - } - - tojoinitem=()=>{ - if(this.props.user&&this.props.user.email===undefined||this.props.user&&this.props.user.email===null||this.props.user&&this.props.user.email===""){ - this.openNotification("请先绑定邮箱,谢谢"); - return - } - let{user} =this.state; - if(user===undefined){ - this.setState({ - isRender:true - }) - return - } - if(user&&user.login===""){ - this.setState({ - isRender:true - }) - return; - } - - if(user&&user.profile_completed===false){ - this.setState({ - AccountProfiletype:true - }) - return; - } - - this.setState({ - tojoinitemtype:true - }) - } - - - submitstatevalue=(sum,value,data)=>{ - this.setState({ - Addcoursestypes:false, - tojoinitemtype:false, - tojoinclasstitle:undefined, - rolearr:["",""], - Checkboxteacherchecked:false, - Checkboxstudentchecked:false, - Checkboxteachingchecked:false, - Checkboxteachertype:false, - Checkboxteachingtype:false, - code_notice:false, - checked_notice:false, - submitapplicationssum:sum, - submitapplications:true, - submitapplicationsvalue:value, - submitapplicationsvaluedata:data, - RadioGroupvalue:undefined - }) - } - - onChangeRadioGroup = (e) => { - this.setState({ - RadioGroupvalue: e.target.value, - }); - } - - submitsubmitapplications=()=>{ - let { - submitapplicationssum, - submitapplicationsvaluedata - }=this.state; - this.setState({ - submitapplications:false, - RadioGroupvalue:undefined - }) - if(submitapplicationssum===0){ - if(submitapplicationsvaluedata!=undefined){ - window.location.href = "/courses/"+submitapplicationsvaluedata; - } - }else if(submitapplicationssum===1){ - if(submitapplicationsvaluedata!=undefined){ - window.location.href = "/projects/"+submitapplicationsvaluedata; - } - } - } - - hidesubmitapplications=()=>{ - this.setState({ - Addcoursestypes:false, - tojoinitemtype:false, - tojoinclasstitle:undefined, - rolearr:["",""], - Checkboxteacherchecked:false, - Checkboxstudentchecked:false, - Checkboxteachingchecked:false, - Checkboxteachertype:false, - Checkboxteachingtype:false, - code_notice:false, - checked_notice:false, - submitapplications:false, - RadioGroupvalue:undefined - }) - } - educoderlogin=()=>{ - //登录账号 - this.setState({ - isRender:true - }) - // var url = `/accounts/logout.json`; - // - // axios.get((url)).then((result) => { - // if(result!==undefined){ - // // this.setState({ - // // isRender:true - // // }) - // window.location.href = "/"; - // } - // }).catch((error) => { - // console.log(error); - // }) - } - educoderloginysl=()=>{ - //退出账号 - // this.setState({ - // isRender:true - // }) - // let newTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings' - // let shixunopenprocess=this.props.user&&this.props.user.user_id+'shixunopenprocess' - // let openopenpublictype=this.props.user&&this.props.user.user_id+'openopenpublictype' - var url = `/accounts/logout.json`; - // let storage=window.localStorage; - axios.get((url)).then((result) => { - // storage.removeItem(newTPMsettings); - // storage.removeItem(shixunopenprocess); - // storage.removeItem( openopenpublictype); - if(result!==undefined){ - // this.setState({ - // isRender:true - // }) - // broadcastChannelPostMessage('refreshPage') - window.location.href = "/"; - } - }).catch((error) => { - console.log(error); - }) - } - - hideAddcoursestypes=()=>{ - this.setState({ - Addcoursestypes:false - }) - }; - HideAddcoursestypess=(i)=>{ - console.log("调用了"); - this.setState({ - Addcoursestypes:false, - mydisplay:true, - occupation:i, - }) - }; - ModalCancelsy=()=>{ - this.setState({ - mydisplay:false, - }) - }; - - - hidetojoinclass=()=>{ - this.setState({ - tojoinclasstype:false, - tojoinitemtype:false, - tojoinclasstitle:undefined, - rolearr:["",""], - Checkboxteacherchecked:false, - Checkboxstudentchecked:false, - Checkboxteachingchecked:false, - Checkboxteachertype:false, - Checkboxteachingtype:false, - code_notice:false, - checked_notice:false, - RadioGroupvalue:undefined - }) - } - -submittojoinclass=(value)=>{ - let {tojoinclasstitle,rolearr,RadioGroupvalue}=this.state; - - if(tojoinclasstitle===undefined){ - this.setState({ - code_notice:true - }) - return - } - let newrolearr=rolearr; - // if(value===1){ - if(tojoinclasstitle.length<6){ - this.setState({ - code_notice:true - }) - return - } - // }else if(value===0){ - // if(tojoinclasstitle.length<5){ - // this.setState({ - // code_notice:true - // }) - // return - // } - // } - if(tojoinclasstitle===""||tojoinclasstitle===undefined){ - this.setState({ - code_notice:true - }) - return - }else{ - this.setState({ - code_notice:false - }) - } - - let pamst=[]; - let num=0; - for(var i = 0 ; i { - // if( response.data.state===0){ - // this.submitstatevalue(0,"加入成功",response.data.course_id) - // }else if( response.data.state===1){ - // }else if( response.data.state===2){ - // this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)") - // }else if( response.data.state===3){ - // this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id) - // }else if( response.data.state===4){ - // this.submitstatevalue( 0,"您输入的邀请码错误)") - // }else if( response.data.state===5){ - // this.submitstatevalue( 0,"您还未登录") - // }else if( response.data.state===6){ - // this.submitstatevalue( 0,"申请已提交,请等待审核") - // }else if( response.data.state===7){ - // this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待") - // }else if( response.data.state===8){ - // this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id) - // }else if( response.data.state==9){ - // this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id) - // }else if( response.data.state==10){ - // this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id) - // }else if( response.data.state==11){ - // this.submitstatevalue(0," 该课堂已归档,请联系老师") - // }else if( response.data.state==12){ - // this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师") - // }else if( response.data.state==13){ - // this.submitstatevalue(0,"您申请已提交,请等待审核") - // }else if( response.data.state==14){ - // this.submitstatevalue("此邀请码已停用,请与老师联系") - // }else if( response.data.state==15){ - // this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行") - // }else { - // this.submitstatevalue(0," 未知错误,请稍后再试") - // } - // }) - // - // } - - if(value===1){ - let url="/project_applies.json" - // const form = new FormData(); - // form.append('code', tojoinclasstitle); - // form.append('role', RadioGroupvalue); - // form.append('type', 1); - axios.post(url,{ - code:tojoinclasstitle, - role:RadioGroupvalue - } - ).then((response) => { - if( response.data.status===1){ - this.submitstatevalue(1,"您输入的邀请码错误") - }else if( response.data.status===2){ - this.submitstatevalue( 1,"您已经是该项目成员",response.data.project) - }else if( response.data.status===3){ - this.submitstatevalue( 1,"请选择一个角色") - }else if( response.data.status===4){ - this.submitstatevalue( 1,"您的申请已提交,请等待项目管理员审批") - }else if( response.data.status===5){ - this.submitstatevalue( 1,"您已经申请加入该项目了,请耐心等待") - }else if( response.data.status===6){ - this.submitstatevalue( 1,"您已成功加入项目",response.data.project) - }else if( response.data.status===0){ - if(RadioGroupvalue==="reporter"){ - this.openNotification("您加入项目成功!"); - window.location.href=`/projects/${response.data.project_id}`; - }else{ - this.openNotification("您的申请已提交,请等待项目管理员审批!"); - } - } - }) - } - this.hidetojoinclass() -} - - // trialapplications =()=>{ - // console.log("点击了") - // this.setState({ - // isRenders: true, - // showTrial:true, - // }) - // } - - // 关闭 - cancelModulationModels = () => { - this.setState({isRenders: false}) - } - - inputjoinclassvalue=(e)=>{ - console.log(e.target.value.length); - if(e.target.value.length>=7){ - this.openNotification("请输入6位项目邀请码!"); - return - } - this.setState({ - tojoinclasstitle:e.target.value - }) - } - - showSearchOpen=(e)=>{ - this.setState({ - showSearchOpentype:true - }) - - } - - hideshowSearchOpen=(e)=>{ - let {setevaluatinghides}=this.state; - if(setevaluatinghides===true){ - this.setState({ - showSearchOpentype:false, - setevaluatinghides:false - }) - - } - } - - onKeywordSearchKeyDown = (value) => { - let url=`/search?value=${value}`; - this.props.history.push(url) - } - - onKeywordSearchKeyDowns=()=>{ - this.setState( - { - setevaluatinghides:false - } - ) - } - - setevaluatinghides=()=>{ - this.setState( - { - setevaluatinghides:true - } - ) - } - //头部获取是否已经登录了 - getUser=(url,type)=>{ - - if(type==="projects"){ - if(this.props.user&&this.props.user.email===undefined||this.props.user&&this.props.user.email===null||this.props.user&&this.props.user.email===""){ - this.openNotification("请先绑定邮箱,谢谢"); - return - } - } - // console.log("点击了503") - // console.log(url); - let{user} =this.state; - - if(user===undefined){ - this.setState({ - isRender:true - }) - return - } - - if(user&&user.login===""){ - this.setState({ - isRender:true - }) - return; - } - - if(user&&user.profile_completed===false){ - this.setState({ - AccountProfiletype:true - }) - return; - } - - - if(type==="newshixuns"){ - if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){ - this.setgoshowqqgtounp(true); - return; - } - } - - - - - - - if(url !== undefined || url!==""){ - window.location.href = url; - } - - - } - - //修改登录方法 - Modifyloginvalue=()=>{ - this.setState({ - isRender:false, - }) - } - - hideAccountProfile=()=>{ - this.setState({ - AccountProfiletype:false - }) - }; - headtypesonClick=(url,bool)=>{ - this.setState({ - headtypess:url, - headtypesonClickbool:bool, - }) - } - //获取数据为空的时候 - gettablogourlnull = () => { - this.setState({ - mygetHelmetapi2: undefined - }); - document.title = "EduCoder"; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); - link.id = 'dynamic-favicon'; - link.rel = 'shortcut icon'; - link.href = "/react/build/./favicon.ico"; - if (oldLink) { - document.head.removeChild(oldLink); - } - document.head.appendChild(link); - }; - - //获取数据的时候 - gettablogourldata = (response) => { - document.title = response.data.setting.name; - var link = document.createElement('link'), - oldLink = document.getElementById('dynamic-favicon'); - link.id = 'dynamic-favicon'; - link.rel = 'shortcut icon'; - link.href = '/' + response.data.setting.tab_logo_url; - if (oldLink) { - document.head.removeChild(oldLink); - } - document.head.appendChild(link); - } - - - handleVisibleChanges = (boll) => { - this.setState({ - visiblemyss: boll, - }) - - } - - - getAppdata=()=>{ - try { - var chromesettingArray = JSON.parse(localStorage.getItem('chromesetting')); - var chromesettingresponseArray = JSON.parse(localStorage.getItem('chromesettingresponse')); - // console.log("NewHeaderNewHeaderNewHeader"); - // console.log(chromesettingArray); - // console.log(chromesettingresponseArray); - - this.setState({ - mygetHelmetapi2:chromesettingArray - }); - if (chromesettingArray.tab_logo_url) { - this.gettablogourldata(chromesettingresponseArray); - } else { - this.gettablogourlnull(); - } - }catch (e) { - console.log("head获取游览器配置失败 重新请求开始读取配置"); - this.geturlsdata(); - } - }; - - geturlsdata=()=>{ - let url = "/setting.json"; - axios.get(url).then((response) => { - // console.log("app.js开始请求/setting.json"); - // console.log("获取当前定制信息"); - if(response){ - if(response.data){ - this.setState({ - mygetHelmetapi2:response.data.setting - }); - localStorage.setItem('chromesetting',JSON.stringify(response.data.setting)); - localStorage.setItem('chromesettingresponse',JSON.stringify(response)); - try { - if (response.data.setting.tab_logo_url) { - this.gettablogourldata(response); - } else { - this.gettablogourlnull(); - } - } catch (e) { - this.gettablogourlnull(); - } - - - } else { - - this.gettablogourlnull(); - - } - - } else { - this.gettablogourlnull(); - - } - - }).catch((error) => { - this.gettablogourlnull(); - - }); - } - - - matchpaths=(url)=>{ - const {match} = this.props; - if (url=== '/forums'&&match.path === '/forums') { - return true - } else if (url.startsWith('/shixuns')&&match.path.startsWith('/shixuns')) { - return true - }else if (url.startsWith('/paths')&&match.path.startsWith('/paths')) { - return true - } else if (url.startsWith('/courses')&&match.path.startsWith('/courses')) { - return true - }else if (url.startsWith('/competitions')&&match.path.startsWith('/competitions')) { - return true - }else if (url.startsWith('/crowdsourcing')&&match.path.startsWith('/crowdsourcing')) { - return true - }else if(url.startsWith('/moop_cases')&&match.path.startsWith('/moop_cases')){ - return true - }else if(url.startsWith('/developer')&&match.path.startsWith('/developer')){ - return true - }else { - return false - } - } - - - // 处理弹框 - setgoshowqqgtounp=(bool)=>{ - this.setState({ - goshowqqgtounp:bool - }) - } - render() { - const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 - const {match} = this.props; - - let {Addcoursestypes, - tojoinitemtype, - tojoinclasstitle, - code_notice, - checked_notice, - AccountProfiletype, - submitapplications, - submitapplicationsvalue, - user, - isRender, - showSearchOpentype, - headtypesonClickbool, - headtypess, - mygetHelmetapi2, - goshowqqgtounp, - }=this.state; - /* - 用户名称 用户头像url - */ - let activeIndex = false; - let activeForums = false; - let activeShixuns = false; - let activePaths = false; - let coursestype=false; - let activePackages=false; - let activeMoopCases=false; - let activeCompetitions=false; - - if (match.path === '/forums') { - activeForums = true; - } else if (match.path.startsWith('/shixuns')) { - activeShixuns = true; - }else if (match.path.startsWith('/paths')) { - activePaths = true; - } else if (match.path.startsWith('/courses')) { - coursestype = true; - }else if (match.path.startsWith('/crowdsourcing')) { - activePackages = true; - }else if(match.path.startsWith('/moop_cases')){ - activeMoopCases = true; - }else if(match.path.startsWith('/competitions')){ - activeCompetitions = true; - }else { - activeIndex = true; - } - - let headtypes='/'; - - // console.log("mygetHelmetapi2"); - // console.log(mygetHelmetapi2); - if(mygetHelmetapi2) { - if (mygetHelmetapi2.navbar) { - if (mygetHelmetapi2.navbar.length > 0) { - // console.log("mygetHelmetapi2.navbar.length>0====-=-=--=-=-=-="); - // - // console.log(match.path); - if (match.path === '/') { - if (headtypesonClickbool === false) { - headtypes = undefined; - } else { - headtypes = headtypess; - } - } else { - for (var i = 0; i < mygetHelmetapi2.navbar.length; i++) { - if (match.path === mygetHelmetapi2.navbar[i].link) { - headtypes = mygetHelmetapi2.navbar[i].link; - break; - } - } - } - - } - } - } - - // console.log(mygetHelmetapi2); - // console.log("NewHeadermygetHelmetapi123123123123"); - - let shixuntype=false; - let pathstype=false; - let coursestypes=false; - if(this.props&&this.props.mygetHelmetapi!=null){ - let shixun="/shixuns"; - let paths="/paths"; - let courses="/courses"; - this.props.mygetHelmetapi.navbar.map((item,key)=>{ - var reg = RegExp(item.link); - if(shixun.match(reg)){ - if(item.hidden===true){ - shixuntype=true - } - } - if(paths.match(reg)){ - if(item.hidden===true){ - pathstype=true - } - } - if(courses.match(reg)){ - if(item.hidden===true){ - coursestypes=true - } - } - }) - } - - const contents = ( -
-

试题库

-

-

试卷库

-

-
- ); - return ( - -
- - - {isRender===true?this.Modifyloginvalue()} - {...this.props} - {...this.state} - />:""} - - {AccountProfiletype===true?this.hideAccountProfile()} - {...this.props} - {...this.state} - />:""} - - { - goshowqqgtounp===true? - this.setgoshowqqgtounp(bool)}> - : - "" - } - - this.headtypesonClick("/",false)} className={"fl mr30 ml25 mt10"}> - { - mygetHelmetapi2 === null ? - "" - : - mygetHelmetapi2===undefined||mygetHelmetapi2.nav_logo_url===null||mygetHelmetapi2.nav_logo_url===undefined? - 高校智能化教学与实训平台 - : - 高校智能化教学与实训平台 - } - - - - { - mygetHelmetapi2 === null ? - "" : - mygetHelmetapi2!==undefined&&mygetHelmetapi2.navbar!==null&&mygetHelmetapi2.navbar!==undefined&&mygetHelmetapi2.navbar.length>0? -
-
    - {/*
  • 首页
  • */} - {/*
  • 实训路径
  • */} - { - mygetHelmetapi2.navbar && mygetHelmetapi2.navbar.map((item,key)=>{ - // console.log("headtypes"); - // console.log(headtypes);hidden - var str=new RegExp("http"); - var strbool=false; - //test方法返回值为(true或者false) - if(item.link){ - if(str.test(item.link)===true){ - strbool=true - }else{ - strbool=false - } - } - // console.log(item.hidden); - return( -
  • this.headtypesonClick(item.link,true)} className={`${this.matchpaths(item.link)===true?'pr active':'pr'}`} style={item.hidden==false?{display: 'block'}:{display: 'none'}}> - { - strbool===true? - {item.name} - : - {item.name} - } -
  • - ) - }) - } - - {/*
  • */} - {/* */} - {/*
    */} - {/*
    */} - {/* 题库*/} - {/*
    */} - {/*
    */} - {/*
    */} - {/*
  • */} - -
  • 工程认证
  • - -
  • 0 ? 'block' : 'none'}}> - 职业路径 -
    0 ? 'block' : 'none'}}> -
      - {this.props.Headertop === undefined ? "" : this.props.Headertop.career_url.map((item, key) => { - return( -
    • {item.name}
    • - ) - }) - } -
    -
    -
  • -
  • 开源项目
  • -
-
- : -
- -
    - {/*
  • 首页
  • */} - - {/*
  • 实训路径
  • */} -
  • - 实践课程 -
  • - - {/*
  • 课堂
  • */} -
  • - {/*课堂*/} - 翻转课堂 -
  • -
  • - 实训项目 - {/**/} - {/**/} -
  • - -
  • 0 ? 'block' : 'none'}}> - 职业路径 -
    0 ? 'block' : 'none'}}> -
      - {this.props.Headertop === undefined ? "" : this.props.Headertop.career_url.map((item, key) => { - return( -
    • {item.name}
    • - ) - }) - } -
    -
    -
  • - - {/*
  • 教学案例
  • */} -
  • - 在线竞赛 - {/**/} -
  • -
  • 教学案例
  • - {/*
  • */} - {/*众包创新*/} - {/*
  • */} -
  • 交流问答
  • -
  • 工程认证
  • -
-
- } - - - - - - - -
-
- {/**/} -
- - 实训 - - -
- {/**/} - {/*搜索框*/} - {showSearchOpentype===true?
this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}> - this.onKeywordSearchKeyDowns()} - onSearch={(value) => this.onKeywordSearchKeyDown(value)} - // onPressEnter={this.onKeywordSearchKeyDown} - style={{ width: 300,height:32}} - autoFocus={true} - /> -
:""} - - {/**/} - {/*/!**!/*/} - {/**/} - - {/**/} - {/* TODO 需要服务端接口提供最近搜索 -
-
最近搜索
- - -
*/} -
-
- - {/* - <%= link_to '登录', signin_path, :className => "mr5" %> - - <%= link_to '注册', user_join_path, :className => "ml5" %> - */} - { user===undefined? - - this.educoderlogin()} className="mr5 color-white">登录 - - 注册 - :user.login===""? - this.educoderlogin()} className="mr5 color-white">登录 - - 注册 - : -
- - - - - -
- } - {/*href="https://www.educoder.net/login"*/} -
- {/*{ loadHeader()}*/} - {showSearchOpentype===true?"":this.props.user&&this.props.user.main_site===true?this.showSearchOpen(e)}> - {/*"/images/educoder/icon/search.svg" - */} - - - :""} - - {/*
*/} -
- - - - -
-
- - {coursestypes===true&&this.props.user&&this.props.user.main_site===false?"":} -
-
- - {this.props.user&&this.props.user.main_site===true? :""} - - -
-
-
    -
    -

    - {submitapplicationsvalue} -

    -
    -
  • - 取消 - 确定 -
  • - -
-
-
-
- -
- -
- - ); - } -} - -export default NewHeader; - diff --git a/public/react/src/modules/tpm/SiderBar.js b/public/react/src/modules/tpm/SiderBar.js deleted file mode 100644 index ebc71d116..000000000 --- a/public/react/src/modules/tpm/SiderBar.js +++ /dev/null @@ -1,162 +0,0 @@ -import React, { Component } from 'react'; -import { getImageUrl} from 'educoder'; -import {Tooltip} from 'antd'; -import './TPMIndex.css'; - -const $ = window.$; - -$(window).resize(function(){ - rightSlider(); -}); - -$(window).scroll(function(){ - if($(".gotop").length>0){ - if($(document).scrollTop()>0){ - $(".-task-sidebar .gotop").show(); - $(".gotop").click(function(){ - $("html,body").scrollTop(0); - }); - } - if($(document).scrollTop()==0){ - $(".-task-sidebar .gotop").hide(); - } - } -}); - -function rightSlider(){ - var poi=parseInt((parseInt($(window).width())- 1200 )/2)-81; - // console.log(parseInt($(window).width())+" "+poi); - if(poi>0){ - $(".-task-sidebar").css("right",poi); - }else{ - $(".-task-sidebar").css("right","0px"); - } - $(".-task-sidebar").show(); -} - - -function _initSider() { - var $descSide = $("
").appendTo("body"); - $(".-task-sidebar>div").hover(function(){ - //移入显示二维码 - if($(this).hasClass("scan")){ - $(".scan_ewm").show().css({right:"75px",opacity:0}).stop().animate({ - right:"45px",opacity:1 - }) - return; - } - var $tool = $(this).attr("tooltips"); - $descSide.html($tool+"
"); - $descSide.data('_dom', this) - $descSide.show().css({ - left:$(this).offset().left - $descSide.width()-30, - opacity:0, - top:$(this).offset().top - }).stop().animate({ - left:$(this).offset().left - $descSide.width()-5, - opacity:1 - },400); - },function(){ - if($(this).hasClass("scan")){ - $(".scan_ewm").stop().animate({right:"75px",opacity:0},200).hide(); - } - $descSide.stop().animate({ - left:$(this).offset().left - $descSide.width()-30, - opacity:0 - },200).hide(); - }); - rightSlider(); - - $(window).scroll(function() { - if ($descSide.height()) { - var hoverIcon = $descSide.data('_dom') - $descSide.css('top', $(hoverIcon).offset().top) - } - }) -} - -class SiderBar extends Component { - constructor(props) { - super(props) - - } - - componentDidMount() { - _initSider() - - } - - render() { - - - // console.log("SiderBar"); - // console.log(this.props); - - var mypath= this.props&&this.props.match&&this.props.match.path; - return ( - -
- - {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?
- - - - -
- - - -
-
- - - - -
- - - -
-
- - -
- -

-

- - -

微信扫一扫

-

关注公众号

-

-

- - }> - -
-
- - -
- - - -
-
- -
:""} -
- ); - } -} - -export default SiderBar; diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js deleted file mode 100644 index 9ba752827..000000000 --- a/public/react/src/modules/tpm/TPMBanner.js +++ /dev/null @@ -1,1415 +0,0 @@ -import React, {Component} from 'react'; - -import {Link} from "react-router-dom"; - -import {Rating, Progress} from "@icedesign/base"; - -import {Modal, Input, Radio, Pagination, message, Spin, Icon, Tooltip, Button,Popover} from 'antd'; - -import AccountProfile from "../user/AccountProfile"; - -import 'antd/lib/pagination/style/index.css'; - -import axios from 'axios' - -import Modals from '../modals/Modals'; - -import './shixuns/css/TPMBanner.css'; -import types from "../../redux/actions/actionTypes"; - -let $ = window.$; - -const Search = Input.Search; - -const RadioGroup = Radio.Group; - -const { TextArea } = Input; - -class TPMBanner extends Component { - constructor(props) { - super(props) - this.state = { - Forkvisible: false, - Senttothetype: false, - Senttothevcalue: undefined, - courses_count: 1, - course_list: [], - pagenum: 1, - publishbox: "", - publishboxstatus: 0, - pages: 1, - Issuevisible: false, - evaluation_set_position: [], - tag_position: [], - Forkauthentication: false, - can_fork: undefined, - certi_url: undefined, - showradios: false, - startbtn: false, - Searchvalue: "", - startshixunCombattype: false, - shixunsmessage: "", - shixunsreplace: false, - hidestartshixunsreplacevalue: "", - isIE: false, - Forkvisibletype: false, - isSpin: false, - Senttothevcaluetype: false, - jupyterbool: false, - openknow:false, - openshowpublictype:false, - Radiovalue:1, - TextAreaintshow:false, - - } - } - - - IEVersion = () => { - var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 - var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器 - var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器 - var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; - if (isIE) { - var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); - reIE.test(userAgent); - var fIEVersion = parseFloat(RegExp["$1"]); - if (fIEVersion == 7) { - return 7; - } else if (fIEVersion == 8) { - return 8; - } else if (fIEVersion == 9) { - return 9; - } else if (fIEVersion == 10) { - return 10; - } else { - return 6;//IE版本<=7 - } - } else if (isEdge) { - return 'edge';//edge - } else if (isIE11) { - return 11; //IE11 - } else { - return -1;//不是ie浏览器 - } - } - - openknow=()=>{ - let storage=window.localStorage; - this.setState({ - openknow:false - }) - let shixunopenprocess=this.props.user&&this.props.user.user_id+'shixunopenprocess'; - storage.setItem(shixunopenprocess,true); - } - - openshowpublic=()=>{ - let storage=window.localStorage; - this.setState({ - openshowpublictype:false - }) - let openopenpublictype=this.props.user&&this.props.user.user_id+'openopenpublictype'; - storage.setItem(openopenpublictype,true); - } - - - componentDidUpdate(prevProps, prevState) { - if (prevProps != this.props) { - - if(prevProps.user != this.props.user){ - if(this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.business===true){ - this.setState({ - TextArea:"云上实验室使用" - }) - } - } - let getshixunopenprocess=this.props.user&&this.props.user.user_id+'shixunopenprocess'; - let getopenopenpublictype=this.props.user&&this.props.user.user_id+'openopenpublictype'; - let shixunopenprocess=window.localStorage.getItem(getshixunopenprocess) - let openopenpublictype=window.localStorage.getItem(getopenopenpublictype) - if(this.props.status===0&&this.props.openknows===false){ - - if(this.props.shixunsDetails&&this.props.shixunsDetails.shixun_status === 0 && this.props.identity < 5){ - if(this.props.user&&this.props.user.user_id){ - if(shixunopenprocess===undefined||shixunopenprocess===false||shixunopenprocess===null){ - this.setState({ - openknow:true - }) - setTimeout(()=>{ - this.openknow() - this.setState({ - openknow:false - }) - }, 10000); - - }else{ - this.setState({ - openknow:false - }) - } - } - } - - }else{ - this.setState({ - openknow:false - }) - } - - - - if(this.props.public===0&&this.props.status>1&&this.props.openknows===false){ - if(this.props.shixunsDetails&&this.props.shixunsDetails.shixun_status === 2 && this.props.shixunsDetails&&this.props.shixunsDetails.public===0 && this.props.identity < 5){ - if(this.props.user&&this.props.user.user_id) { - if (openopenpublictype === undefined || openopenpublictype === false || openopenpublictype === null) { - this.setState({ - openshowpublictype: true - }) - setTimeout(()=>{ - this.openshowpublic() - this.setState({ - openshowpublictype:false - }) - }, 10000); - } else { - this.setState({ - openshowpublictype: false - }) - } - } - } - }else{ - this.setState({ - openshowpublictype:false - }) - } - - - - - } - } - - - componentDidMount() { - - let thiisie = this.IEVersion(); - if (thiisie != -1) { - this.setState({ - isIE: true - }) - } else { - this.setState({ - isIE: false - }) - } - - if (this.props.user && this.props.user.admin === true || this.props.user && this.props.user.business === true) { - this.setState({ - TextArea: "云上实验室使用" - }) - } - } - /* - * Fork - * */ - copyForkvisible = () => { - let {shixunsDetails} = this.props; - if (shixunsDetails.can_fork === null) { - this.setState({ - Forkvisible: true - }) - } else { - this.setState({ - Forkvisible: false, - Forkauthentication: true, - can_fork: shixunsDetails.can_fork.can_fork, - certi_url: shixunsDetails.can_fork.certi_url, - }) - } - - } - - hideForkvisible = () => { - this.setState({ - Forkvisible: false, - Forkauthentication: false - }) - } - - changeTextArea=(e)=>{ - this.setState({ - TextArea:e.target.value - }) - } - - addForkvisible = () => { - let reason; - switch (this.state.Radiovalue) { - case 1: - reason="Shixun"; - break; - case 2: - reason="Course"; - break; - case 3: - reason="Subject"; - break; - case 4: - reason=this.state.TextArea; - } - - if(this.state.Radiovalue===4){ - if(this.state.TextArea===null||this.state.TextArea===undefined||this.state.TextArea=== ""){ - this.setState({ - TextAreaintshow:true - }) - return - } - } - - this.setState({ - Forkvisibletype:true, - }) - - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/copy.json"; - axios.post(url, { - reason:reason, - }).then((response) => { - if (response.data.status === 401) { - - } else { - this.setState({ - Forkvisible: false, - Forkauthentication: false, - // Forkvisibletype:false - }) - window.location.href = "/shixuns/" + response.data.shixun + "/challenges"; - } - - }).catch((error) => { - console.log(error) - }); - - } - /* - * 发送至按钮 - * */ - Senttothe = () => { - if (this.props.checkIfLogin() === false) { - this.props.showLoginDialog() - return - } - - // if(this.props.checkIfProfileCompleted()===false){ - // this.setState({ - // AccountProfiletype:true - // }) - // return - // } - // - // if(this.props.checkIfProfessionalCertification()===false){ - // this.setState({ - // AccountProfiletype:true - // }) - // return - // } - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/search_user_courses.json"; - this.setState({ - Senttothetype: true - }) - - axios.get(url, { - params: { - page: 1, - limit: 10 - } - }).then((response) => { - this.setState({ - courses_count: response.data.courses_count, - course_list: response.data.course_list - }) - }).catch((error) => { - console.log(error) - }); - } - - SenttotheSearch = (value) => { - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/search_user_courses.json?search=" + value; - axios.get(encodeURI(url), { - params: { - page: 1, - limit: 10 - } - }).then((response) => { - this.setState({ - courses_count: response.data.courses_count, - course_list: response.data.course_list, - pages: 1, - Searchvalue: value - }) - }).catch((error) => { - console.log(error) - }); - } - - onChangeSenttothevcalue = (e) => { - this.setState({ - Senttothevcalue: e.target.value - }) - } - onChangesendeSenttothe = (pageNumber) => { - let {Searchvalue} = this.state; - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/search_user_courses.json?search=" + Searchvalue; - axios.get(url, { - params: { - page: pageNumber, - limit: 10 - } - }).then((response) => { - this.setState({ - courses_count: response.data.courses_count, - course_list: response.data.course_list, - pagenum: pageNumber, - pages: pageNumber - }) - }).catch((error) => { - console.log(error) - }); - } - sendeSenttothevcalue = () => { - - let {Senttothevcalue} = this.state; - - if (Senttothevcalue === undefined) { - this.setState({ - Senttothevcaluetype: true - }) - return - } - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/send_to_course.json"; - axios.post(url, { - course_id: Senttothevcalue - }).then((response) => { - - this.props.showSnackbar(response.data.message); - this.setState({ - Senttothetype: false, - Searchvalue: "", - pages: 1 - }) - // window.location.href = response.data.url; - // response.data.course_id - this.props.history.replace(response.data.first_category_url); - - }).catch((error) => { - console.log(error) - }); - - } - - hideSenttothevcalue = () => { - this.setState({ - Senttothetype: false, - Searchvalue: "", - pages: 1 - }) - - - } - - /* - * 撤销发布按钮 - * */ - - ModalCancel = () => { - this.setState({ - Modalstype: false, - Modalstopval: "", - modalsMidval:undefined, - ModalsBottomval:"", - modalstyles:"", - }) - } - ModalSave = () => { - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/cancel_publish.json"; - axios.get(url).then((response) => { - this.props.showSnackbar(response.data.message); - window.location.reload() - }).catch((error) => { - console.log(error) - }); - } - - cancel_publish = () => { - this.setState({ - Modalstype: true, - Modalstopval: "是否确认撤销发布?", - modalsMidval:"撤销发布后,学员将无法进行练习,若您新增关", - ModalsBottomval:"卡,学员需要重新体验实训", - ModalCancel: this.ModalCancel, - ModalSave: this.ModalSave, - modalstyles:"848282" - }) - } - ModalSaveopenpublic= () => { - this.setState({ - Modalstype: true, - Modalstopval: "公开申请已提交,请等待管理员的审核", - modalsMidval:"• 我们将在1-2个工作日内完成审核", - ModalCancel: this.eopenpublicupdatadata, - ModalSave: this.eopenpublicupdatadata, - Loadtype:true, - modalstyles:"848282" - }) - } - eopenpublicupdatadata=()=>{ - window.location.reload() - } - openpublic=()=>{ - let id = this.props.match.params.shixunId; - let url = `/shixuns/${id}/apply_public.json`; - axios.get(url).then((response) => { - if(response.data.status===0){ - this.ModalSaveopenpublic() - - } - }).catch((error) => { - console.log(error) - }); - } - - ModalhidenpublicSave=()=>{ - let id = this.props.match.params.shixunId; - let url = `/shixuns/${id}/cancel_apply_public.json`; - axios.get(url).then((response) => { - if(response.data.status===0){ - window.location.reload() - } - }).catch((error) => { - console.log(error) - }); - } - - hidenpublic=()=>{ - this.setState({ - Modalstype: true, - Modalstopval: "是否确认撤销申请公开?", - modalsMidval:" ", - ModalsBottomval:" ", - ModalCancel: this.ModalCancel, - ModalSave: this.ModalhidenpublicSave, - }) - - } - /* - * 申请发布按钮 - * */ - applyrelease = () => { - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/publish.json"; - axios.get(url).then((response) => { - let evaluation_set_position - if (response.data.evaluation_set_position === null) { - evaluation_set_position = [] - } else { - evaluation_set_position = response.data.evaluation_set_position - } - if(response.data.status===0){ - window.location.reload() - }else{ - this.setState({ - Issuevisible: true, - tag_position: response.data.tag_position, - evaluation_set_position: evaluation_set_position, - publishboxstatus: response.data.status, - }) - } - - }).catch((error) => { - console.log(error) - }); - }; - - hiddenIssuevisible = (val) => { - this.setState({ - Issuevisible: false - }) - if (val === 0 || val === 1) { - window.location.reload() - } - - } - - //重置按钮 - // resetshixunCombat=(id)=>{ - // let zrl="/myshixuns/"+id+"/reset_my_game.json"; - // axios.get(zrl).then((response) => { - // window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges"; - // message.success('重置成功'); - // }).catch((error) => { - // console.log(error) - // }); - // } - - // reset_my_game - hidestartshixunsreplace = (url) => { - this.setState({ - isSpin: true, - }) - axios.get(url).then((response) => { - if (response.status === 200) { - // let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; - // this.props.history.push(path); - message.success('重置成功,正在进入实训!'); - this.startshixunCombat(response.data.shixun_identifier, 1); - this.setState({ - shixunsreplace: false, - isSpin: false, - }) - - // message.success('重置成功,正在进入实训!'); - // this.startshixunCombat(); - } - } - ).catch((error) => { - this.setState({ - startbtn: false, - shixunsreplace: false, - isSpin: false - }) - }); - - } - - - //开始实战按钮 - startshixunCombat = (id, reset) => { - - if(this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter===true){ - if (this.props.checkIfLogin() === false) { - this.props.showLoginDialog() - return - } - - if (this.props.checkIfProfileCompleted() === false) { - this.setState({ - AccountProfiletype: true - }) - return - } - - // if(this.props.checkIfProfessionalCertification()===false){ - // this.setState({ - // AccountProfiletype:true - // }) - // return - // } - - let {shixunsDetails} = this.props - if (shixunsDetails.shixun_status > 1) { - this.setState({ - startbtn: true, - hidestartshixunsreplacevalue: "" - }) - } else { - this.setState({ - hidestartshixunsreplacevalue: "" - }) - } - - - let url = "/shixuns/" + id + "/jupyter_exec.json"; - if (reset) { - url += '?reset=' + reset - } - axios.get(url).then((response) => { - if (response.status === 200) { - if (response.data.status === -2) { - // this.resetshixunCombat(response.data.message); - this.setState({ - startbtn: false, - shixunsreplace: true, - hidestartshixunsreplacevalue: response.data.message + ".json" - }) - // this.shixunexec(response.data.message+".json") - } else if (response.data.status === -1) { - - } else if (response.data.status === -3) { - this.setState({ - shixunsmessage: response.data.message, - startshixunCombattype: true, - startbtn: false - }) - } else { - // let path="/tasks/"+response.data.game_identifier; - // this.props.history.push(path); - - - // this.context.router.history.push(path); - if (response.data.status != 401) { - window.location.href = "/tasks/" + response.data.identifier+`/jupyter`; - } - - } - } - }).catch((error) => { - this.setState({ - startbtn: false - }) - }); - }else{ - if (this.props.checkIfLogin() === false) { - this.props.showLoginDialog() - return - } - - if (this.props.checkIfProfileCompleted() === false) { - this.setState({ - AccountProfiletype: true - }) - return - } - - // if(this.props.checkIfProfessionalCertification()===false){ - // this.setState({ - // AccountProfiletype:true - // }) - // return - // } - - let {shixunsDetails} = this.props - if (shixunsDetails.shixun_status > 1) { - this.setState({ - startbtn: true, - hidestartshixunsreplacevalue: "" - }) - } else { - this.setState({ - hidestartshixunsreplacevalue: "" - }) - } - - - let url = "/shixuns/" + id + "/shixun_exec.json"; - if (reset) { - url += '?reset=' + reset - } - axios.get(url).then((response) => { - if (response.status === 200) { - if (response.data.status === -2) { - // this.resetshixunCombat(response.data.message); - this.setState({ - startbtn: false, - shixunsreplace: true, - hidestartshixunsreplacevalue: response.data.message + ".json" - }) - // this.shixunexec(response.data.message+".json") - } else if (response.data.status === -1) { - - } else if (response.data.status === -3) { - this.setState({ - shixunsmessage: response.data.message, - startshixunCombattype: true, - startbtn: false - }) - } else { - // let path="/tasks/"+response.data.game_identifier; - // this.props.history.push(path); - - - // this.context.router.history.push(path); - if (response.data.status != 401) { - window.location.href = "/tasks/" + response.data.game_identifier; - } - - } - } - }).catch((error) => { - this.setState({ - startbtn: false - }) - }); - } - - - } - - tocertification = () => { - let {certi_url} = this.state; - this.setState({ - Forkauthentication: false - }) - window.location.href = certi_url; - } - - SenttotheValue = (e) => { - this.setState({ - Searchvalue: e.target.value - }) - } - - hidestartshixunCombattype = () => { - this.setState({ - startshixunCombattype: false - }) - } - - hideAccountProfile = () => { - this.setState({ - AccountProfiletype: false - }) - } - - - onChangeRadiovalue=(e)=>{ - this.setState({ - Radiovalue:e.target.value - }) - if(e.target.value!=4){ - this.setState({ - TextAreaintshow:false - }) - } - } - - render() { - let { - Forkvisible, - Senttothetype, - Senttothevcalue, - evaluation_set_position, - Forkauthentication, - can_fork, - certi_url, - tag_position, - courses_count, - course_list, - Issuevisible, - publishboxstatus, - showradios, - startbtn, - Searchvalue, - startshixunCombattype, - shixunsmessage, - pages, - shixunsreplace, - hidestartshixunsreplacevalue, - Forkvisibletype, - AccountProfiletype, - isIE - } = this.state; - let {shixunsDetails, shixunId, star_info, star_infos} = this.props; - let challengeBtnTipText = ''; - let challengeBtnText = '模拟实战'; - // let star_info=[] - // if (shixunsDetails.status === 0) { - // - // } else if (shixunsDetails.status === 1) { - // - // } else if (shixunsDetails.status === 2) { - // challengeBtnTipText = '开始学习并完成实战任务' - // - // } - if (shixunsDetails != undefined) { - if (shixunsDetails.shixun_status === 0) { - challengeBtnText = '继续实战' - } else if (shixunsDetails.shixun_status === 1) { - challengeBtnText = '查看实战' - } else if (shixunsDetails.shixun_status === 3) { - challengeBtnText = '继续实战' - } else { - challengeBtnText = "开始实战" - } - } - - - // let list=shixunsDetails.task_operation; - // if(list!=undefined){ - // if (shixunsDetails.status === 0 ) { - // for(var i=0; i; - const MyRate = ({defaultValue, ...rest}) => { - let myValue = defaultValue; - return ; - }; - // - // console.log(this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter) - - // console.log(this.state) - return ( - - shixunsDetails === undefined ? "" : -
- -
- - {AccountProfiletype === true ? this.hideAccountProfile()} - {...this.props} - {...this.state} - /> : ""} - - - {this.state.Modalstype === true ? : ""} - -
-

- {shixunsDetails.name} - { - shixunsDetails.fork_from === undefined || shixunsDetails.fork_from === null ? "" : - - - - } - -

-
- -
    - {shixunsDetails&&shixunsDetails.stu_num===0?"":
  • - 学习人数 - {shixunsDetails.stu_num} -
  • } - {/*
  • */} - {/*经验值*/} - {/*{shixunsDetails.experience}*/} - {/*
  • */} -
  • - 难度级别 - {shixunsDetails.diffcult} - -
  • -
- { this.props.is_jupyter===true?"": - -
- -
-
-
- {star_infos[0]}分 - 总评分 -
- -
-
-
-
-
-
- -
- - {star_infos[1]}% -
-
-
- -
- - {star_infos[2]}% -
-
-
- -
- - {star_infos[3]}% -
-
-
- -
- - {star_infos[4]}% -
-
-
- -
- - {star_infos[5]}% -
-
-
-
-
- }> -
-
学员评分
-
- -
-
- } - - - { - startbtn === false && shixunsDetails.shixun_status != -1 ? - - this.startshixunCombat(this.props.match.params.shixunId)} - className="fr user_default_btn task-btn-orange font-18" - id="shixun_operation" data-remote="true" - > - {shixunsDetails.task_operation === undefined ? "" : shixunsDetails.shixun_status > 1 ? shixunsDetails.task_operation[0] : "模拟实战"} - - - : "" - } - - -
-

目前该实训项目尚在内测中,将于{shixunsmessage}之后开放,谢谢!

-
-
- {/*取消*/} - 知道啦 -
- {/*

*/} - {/*知道了*/} - {/*

*/} -
- - - -
-

实训已经更新了,正在为您重置!

-
- -
-
- - - - - - { - startbtn === true ? - 开启中 : "" - } - - {/*{*/} - {/*shixunsDetails.status=== 3 && shixunsDetails.task_operation[0]==="开始实战"?*/} - {/*{shixunsDetails.task_operation===undefined?"":shixunsDetails.task_operation[0]}:""*/} - {/*}*/} - - {shixunsDetails.shixun_status === 0 && this.props.identity < 5 ? - -
点击发布后,可以马上应用到自
-
己的课堂和课程
-
- - } - trigger="click" - placement="bottom" - visible={this.state.openknow} - > - - 发布 - -
: "" - } - - - { - publishboxstatus === 0 ?
-

- 发布申请已提交,请等待管理员的审核
-

-
: publishboxstatus === 1 ? -
-

- 发布申请已提交,请等待管理员的审核
- • 我们将在1-2个工作日内完成审核 -

-
: publishboxstatus === 2 ?
-

- 第 - { - evaluation_set_position.map((item, key) => { - return ( - {item}, - ) - }) - } - 关评测设置尚未完成,无法申请发布 -

-
: publishboxstatus === 3 ? -
-

- 每一个关卡至少需要一个技能标签
- 第 - { - tag_position.map((item, key) => { - return ( - {item}, - ) - }) - } - 关尚未设置技能标签,请补充 -

-
: -
-

- 尚未创建任务的实训,不能申请发布 -

-
- } - - -
- - {shixunsDetails.shixun_status === 2 && shixunsDetails.public===0 && this.props.identity < 5 ? - -
平台审核完成后,您的实训将会录入到平台的公共实训项目列表
-
您将获得实训对应的经验值和金币
-
- - } - trigger="click" - placement="bottom" - visible={this.state.openshowpublictype} - > - - - -
: "" - } - - {shixunsDetails.shixun_status === 2 && shixunsDetails.public===1 && this.props.identity < 5 ? - - - : "" - } - - {shixunsDetails.shixun_status === 2 && shixunsDetails.public===0 && this.props.identity < 5 ? - - 撤销发布 - - : "" - } - - { - this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter===true?"": - - 发送至 - - - } - - -
-
- -
- 选择的实训将会发送到指定课堂 -
- -
- this.SenttotheSearch(value)} - style={{width: '100%'}} - /> -
- - -
12 ? "cdefault " : "cdefault "}> -
-
    - - { - course_list === undefined ? "" : course_list.map((item, key) => { - return ( - {item.name} - ) - }) - } - -
-
-
- {this.state.Senttothevcaluetype === true ?
请选择你要发送的课堂
: ""} -
12 ? "block" : "none"}}> - -
- -
-
-
-
- 取消 - 确定 -
- - -
- -
-
-
- - {shixunsDetails.shixun_status === 3 && - 已关闭 - } - - {shixunsDetails.shixun_status === -1 && - 已删除 - } - - - {this.props.identity < 8 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0? -
- - - Fork - - - - - {Forkvisible===true?:""} - - { - this.state.TextAreaintshow===true?:"" - } - {Forkvisible===true? - {Forkvisibletype === true ? - - : -
-
-
请根据实际情况,填写fork本实训的原因
- - - 实训内容升级 - - - 课堂教学使用 - - - 实践课程使用 - - - 其它原因 - - {this.state.Radiovalue === 4 ? - -

执行命令不能为空

- - -
  • - - -
  • -
    - - - -
    -
  • - - -
  • -
    {this.state.languagewritetype === true ? "请填写该镜像语言" : ""}
    -
  • - - -
  • -
    {this.state.systemenvironmenttype === true ? "请填写该镜像语言系统环境" : ""}
    -
  • - - - -
  • -
    {this.state.testcoderunmodetype === true ? "请填写该镜像测试代码运行方式" : ""}
    -
  • - -
    - - - 上传附件 - (单个文件50M以内) - - -
    - -
  • -
    - {this.state.attachmentidstype === true ? "请上传附件" : ""} -
    -
  • - this.sendhideModaly()} - >取消 - -
  • -
    -
    -
    -
    - {this.props.identity < 5 ? - : ""} -
    - - ); - } -} - -const TopShixuninformation = Form.create({name: 'newshixun'})(Shixuninformation); - -export default TopShixuninformation; - - - diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js deleted file mode 100644 index 860798722..000000000 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ /dev/null @@ -1,233 +0,0 @@ -import React, {Component} from 'react'; - -import { - Button, - Tabs, - Modal -} from 'antd'; - -import './css/TPMsettings.css'; - -import TopShixuninformation from './Shixuninformation'; - -import Configuration from './Configuration'; - -import LearningSettings from './LearningSettings'; - -import axios from 'axios'; - -const {TabPane} = Tabs; - -// 处理整点 半点 - - -export default class TPMsettings extends Component { - constructor(props) { - super(props) - this.state = { - activeKeys:"1" - } - } - - - componentDidMount() { - this.getdatas("1") - } - - getdatas = (key) => { - - let id = this.props.match.params.shixunId; - let Url = `/shixuns/` + id + `/settings.json`; - axios.get(Url).then((response) => { - // alert(response.data.shixun.choice_standard_scripts) - if (response.status === 200) { - if(response.data){ - if (response.data.shixun&&response.data.shixun.scope_partment.length > 0) { - this.setState({ - scopetype: true - }) - } - } - this.setState({ - data: response.data - }) - } - - }); - // - // if(key==="3"&&this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === true){ - // window.location.href =`/shixuns/${this.props.match.params.shixunId}/challenges`; - // }else{ - // if(key){ - // this.setState({ - // activeKeys:key - // }) - // }else{ - // window.location.href =`/shixuns/${this.props.match.params.shixunId}/challenges`; - // } - // - // } - - } - - operateshixuns = (value) => { - this.setState({ - operateshixunstype: true, - delType: value - }) - } - - hideoperateshixuns = () => { - this.setState({ - operateshixunstype: false - }) - } - - - shixunsdel = () => { - let id = this.props.match.params.shixunId; - let cul = `/shixuns/` + id + `.json`; - - axios.delete(cul).then((response) => { - if (response.data.status === 1) { - this.props.showNotification("操作成功"); - this.setState({ - operateshixunstype: false, - }); - - window.location.href = "/shixuns"; - // this.props.history.replace( "/shixuns/"); - } - }).catch((error) => { - console.log(error) - }) - } - - shixunsclose = () => { - let id = this.props.match.params.shixunId; - let cul = `/shixuns/` + id + `/close.json`; - axios.post(cul).then((response) => { - if (response.data.status === 1) { - this.props.showNotification("操作成功"); - this.setState({ - operateshixunstype: false, - }); - - window.location.href = "/shixuns/" + id + "/challenges"; - // this.props.history.replace( "/shixuns/" + id + "/challenges"); - } - }).catch((error) => { - console.log(error) - }) - } - - callback = (key) => { - this.setState({ - activeKeys:key - }) - } - - render() { - - let showtabs = this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === true ? "" : "学习页面设置" - - // let a="isvnc"; - // let b="isVNC"; - // console.log(a.indexOf("vnc")) - // console.log(b.indexOf("vnc")) - - // console.log( this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails.is_jupyter === false ? "学习页面设置" : "") - return ( - -
    - - - - - { - this.props.identity < 5 && this.state.data && this.state.data.shixun.status == 0 ? - - : "" - } - { - this.props.identity == 1 && this.state.data && this.state.data.shixun.status == 2 ? - : "" - } - { - this.props.identity === 1 && this.state.data && this.state.data.shixun.status == 2 ? - : "" - } -
    - }> - - this.getdatas(key)} - /> - - - this.getdatas(key)} - /> - - {this.props.shixunsDetails === undefined ? "" : this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter === false ? - - this.getdatas(key)} - /> - :"" } - - -
    - {this.state.delType === 1 ?

    是否确认删除 ?

    : -

    关闭后,
    用户不能再开始挑战了是否确认关闭 ?

    } -
    -
    - 取消 - {this.state.delType === 1 ? 确定 : - 确定} -
    -
    -
    - - ); - } -} - - diff --git a/public/react/src/modules/tpm/TPMsettings/css/TPMsettings.css b/public/react/src/modules/tpm/TPMsettings/css/TPMsettings.css deleted file mode 100644 index 7abf2c70b..000000000 --- a/public/react/src/modules/tpm/TPMsettings/css/TPMsettings.css +++ /dev/null @@ -1,153 +0,0 @@ -.radioStyle{ - display: block; - height: 30px; - } -#settingsMarkdown{ - background:transparent; -} -#challenge_begin{ - height: 30px; - line-height: 30px; -} -#shixundescription .CodeMirror{ - margin-top: 31px !important; - height: 364px !important; -} -#shixundescription .editormd-preview{ - width:578px !important; - top: 40px !important; - height: 364px !important; -} - -#shixunmemoMD .CodeMirror{ - margin-top: 31px !important; - height: 578px !important; -} - -#shixunmemoMD .editormd-preview{ - width: 578px !important; - top: 40px !important; - height: 578px !important; -} - -.radioStyle { - display: block; - height: 30px; -} - -a.white-btn.use_scope-btn:hover { - color: #FFF !important; -} - -.shixunScopeInput { - width: 218px; - height: 33px; - display: block; - margin-bottom: 15px; -} - -.ant-modal-title { - text-align: center; -} - -a.newuse_scope-btn:hover { - border: 1px solid #F06200; - color: #fff !important; - background: #FF7500; -} - -a.newuse_scope-btn { - border: 1px solid #FF7500; - color: #FF7500 !important; -} - -.tpmprompt { - padding-left: 20px; - margin-top: -4px; -} -.ml36{ - margin-left: 26px; -} - -#shixunmemoMD{ - width:98% !important; - height: 620px !important; -} -#shixunmemoMDs{ - width: 98% !important; - height: 420px !important; -} -#shixunmemoMDs .CodeMirror { - /* width: 548px !important; */ - margin-top: 31px !important; - height: 402px !important; -} -.pdr20{ - padding-right:20px; -} - -.nonemodel{ - width: 59%; - height: 468px; - /*background: rgba(0, 0, 0, 0.65);*/ - background: #f5f5f5; - position: absolute; - z-index: 100; - opacity: 0.5; - left: 21.5%; -} - -.shixunmemoMDdiv{ - width: 99%; - height: 615px; -} - -.shixunspanred{ - margin-left: 142px; - margin-top: 5px; - margin-bottom: 5px; -} - -.ml82{ - margin-left:82px; -} - -.Permanentban{ - color:#5091FF !important; - border-color: #5091FF !important; -} - -/*tab*/ -.ant-tabs-nav{ - padding-bottom:18px; - padding-top: 18px; -} - -.ant-tabs-extra-content{ - margin-top: 18px; -} - -.pdb30{ - padding-bottom: 30px; -} - -.openrenyuan{ - margin-top: 5px !important; - display: inline-block; -} - -.ml81{ - margin-left:81px; -} - -.ml32s{ - margin-left: 32px; -} - -.ml64{ - margin-left: 64px; -} - -.ml160{ - margin-left: 160px; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/TPMsettings/oldTPMsettings.js b/public/react/src/modules/tpm/TPMsettings/oldTPMsettings.js deleted file mode 100644 index 3c42b38db..000000000 --- a/public/react/src/modules/tpm/TPMsettings/oldTPMsettings.js +++ /dev/null @@ -1,2437 +0,0 @@ -import React, { Component } from 'react'; - -import MonacoEditor from 'react-monaco-editor'; - -//MonacoDiffEditor 对比模式 -import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Icon,DatePicker,Breadcrumb,Upload,Button,notification, Tooltip} from 'antd'; - -// import "antd/dist/antd.css"; - -import locale from 'antd/lib/date-picker/locale/zh_CN'; - -import moment from 'moment'; - -import axios from 'axios'; - -import './css/TPMsettings.css'; - -import { getImageUrl, toPath, getUrl ,getUploadActionUrl} from 'educoder'; - -let origin = getUrl(); - -let path = getUrl("/editormd/lib/") - -const $ = window.$; - -let timeout; - -let currentValue; - -const Option = Select.Option; - -const RadioGroup = Radio.Group; -const confirm = Modal.confirm; -// 处理整点 半点 -// 取传入时间往后的第一个半点 -export function handleDateStrings(dateString) { - if (!dateString) return dateString; - const ar = dateString.split(':') - if (ar[1] == '00' || ar[1] == '30') { - return dateString - } - const miniute = parseInt(ar[1]); - if (miniute < 30 || miniute == 60) { - return [ar[0], '30'].join(':') - } - if (miniute < 60) { - // 加一个小时 - const tempStr = [ar[0], '00'].join(':'); - const format = "YYYY-MM-DD HH:mm"; - const _moment = moment(tempStr, format) - _moment.add(1, 'hours') - return _moment.format(format) - } - - return dateString -} - -// 恢复数据 -function md_rec_data(k,mdu,id, editor){ - if(window.sessionStorage.getItem(k+mdu) !== null){ - editor.setValue(window.sessionStorage.getItem(k+mdu)); - md_clear_data(k,mdu,id); - } -} - -// 保存数据 -function md_add_data(k,mdu,d){ - window.sessionStorage.setItem(k+mdu,d); -} - -// 清空保存的数据 -function md_clear_data(k,mdu,id){ - window.sessionStorage.removeItem(k+mdu); - var id1 = "#e_tip_"+id; - var id2 = "#e_tips_"+id; - if(k == 'content'){ - $(id2).html(""); - }else{ - $(id1).html(""); - } -} - -function md_elocalStorage(editor,mdu,id){ - if (window.sessionStorage){ - var oc = window.sessionStorage.getItem('content'+mdu); - if(oc !== null ){ - $("#e_tips_"+id).data('editor', editor); - var h = '您上次有已保存的数据,是否恢复 ? / 不恢复'; - $("#e_tips_"+id).html(h); - } - setInterval(function() { - var d = new Date(); - var h = d.getHours(); - var m = d.getMinutes(); - var s = d.getSeconds(); - h = h < 10 ? '0' + h : h; - m = m < 10 ? '0' + m : m; - s = s < 10 ? '0' + s : s; - if(editor.getValue().trim() != ""){ - md_add_data("content",mdu,editor.getValue()); - var id1 = "#e_tip_"+id; - var id2 = "#e_tips_"+id; - - $(id1).html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 "); - $(id2).html(""); - } - },10000); - - }else{ - $("#e_tip_"+id).after('您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!'); - } -} - -function create_editorMD(id, width, high, placeholder, imageUrl,initValue, callback) { - var editorName = window.editormd(id, { - width: width, - height: high, - path: path, // "/editormd/lib/" - markdown : initValue, - syncScrolling: "single", - tex: true, - tocm: true, - emoji: true, - taskList: true, - codeFold: true, - searchReplace: true, - htmlDecode: "style,script,iframe", - sequenceDiagram: true, - autoFocus: false, - placeholder: placeholder, - toolbarIcons: function () { - // Or return editormd.toolbarModes[name]; // full, simple, mini - // Using "||" set icons align right. - return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"] - }, - toolbarCustomIcons: { - testIcon: "
    ", - testIcon1: "
    " - }, - //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。 - saveHTMLToTextarea: true, - // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标 - dialogMaskOpacity: 0.6, - imageUpload: true, - imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], - imageUploadURL: imageUrl,//url - onload: function () { - // this.previewing(); - $("#" + id + " [type=\"latex\"]").bind("click", function () { - editorName.cm.replaceSelection("```latex"); - editorName.cm.replaceSelection("\n"); - editorName.cm.replaceSelection("\n"); - editorName.cm.replaceSelection("```"); - var __Cursor = editorName.cm.getDoc().getCursor(); - editorName.cm.setCursor(__Cursor.line - 1, 0); - }); - - $("#" + id + " [type=\"inline\"]").bind("click", function () { - editorName.cm.replaceSelection("`$$$$`"); - var __Cursor = editorName.cm.getDoc().getCursor(); - editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 3); - editorName.cm.focus(); - }); - $("[type=\"inline\"]").attr("title", "行内公式"); - $("[type=\"latex\"]").attr("title", "多行公式"); - - callback && callback() - } - }); - return editorName; -} - - -function updatamakedown(id){ - setTimeout(()=>{ - var shixunDescr = window.editormd.markdownToHTML(id, { - htmlDecode: "style,script,iframe", - taskList: true, - tex: true, - flowChart: true, - sequenceDiagram: true - }); - $("#"+id+" p:first").addClass("ReactMarkdown"); - $('#collaborators_list_info').show() - }, 200) -} - -function range(start, end) { - const result = []; - for (let i = start; i < end; i++) { - result.push(i); - } - return result; -} -function disabledDateTime() { - return { - // disabledHours: () => range(0, 24).splice(4, 20), - disabledMinutes: () => range(1, 30).concat(range(31, 60)), - // disabledSeconds: () => [0, 60], - }; -} - -function disabledDate(current) { - return current && current < moment().endOf('day').subtract(1, 'days'); -} -export default class TPMsettings extends Component { - constructor(props) { - super(props) - this.state = { - fileList: [], - commandLine: 0, - Openpublic: 0, - settingsData: undefined, - webssh: 0, - use_scope: 0, - shixunsstatus: 0, - shixunsID: undefined, - exec_time: undefined, - trainee: undefined, - can_copy: undefined, - task_pass: undefined, - test_set_permission: undefined, - code_edit_permission: undefined, - hide_code: undefined, - code_hidden: undefined, - forbid_copy: undefined, - vnc: undefined, - name: undefined, - scope_partment: undefined, - scopetype: false, - departmentslist: undefined, - description: '', - evaluate_script:undefined, - standard_scripts: undefined, - choice_main_type: "", - choice_small_type: [], - choice_standard_scripts:undefined, - editordescriptios: undefined, - editorevaluate_scripts: undefined, - choice_standard_scriptssum: undefined, - visibleTemplate: false, - Executiveordervalue: "", - Compilecommandvalue: "", - Executivetyoe: false, - postapplyvisible: false, - sendsure_applyvalue: undefined, - postapplytitle: false, - shixunnametype: false, - shixunmaintype: false, - evaluate_scripttype: false, - exec_timetype: false, - traineetype: false, - standard_scriptsModal:false, - standard_scriptsModals:false, - SelectTheCommandtype:false, - multi_webssh:false, - status:0, - opers:false, - operss:false, - testscripttiptype:false, - opersss:false, - operateshixunstype:false, - opening_time:"", - opensmail:false, - scope_partmenttype:false, - newuse_scope:undefined, - scope_partments:0, - shixun_service_configs:undefined, - shixun_service_configlist:undefined, - pod_exist_time: undefined, - pod_exist_timetype: false, - shixunmemoMDvalue:"", - language:"", - deleteisnot:true - } - } - descriptionMD=(initValue, id)=> { - - this.contentChanged = false; - const placeholder = ""; -// amp; -// 编辑时要传memoId - const imageUrl = `${getUploadActionUrl()}`; -// 创建editorMd - - const description_editormd =create_editorMD(id, '100%', 400, placeholder, imageUrl, initValue,()=> { - setTimeout(() => { - description_editormd.resize() - description_editormd.cm && description_editormd.cm.refresh() - }, 500) - - if (initValue != undefined) { - description_editormd.setValue(initValue) - } - description_editormd.cm.on("change", (_cm, changeObj) => { - console.log('....contentChanged') - this.contentChanged = true; - }) - }); - md_elocalStorage(description_editormd, `MemoQuestion_${id}`, `${id}Question`); - this.description_editormd = description_editormd; - window.description_editormd = description_editormd; - } - - evaluate_scriptMD=(initValue, id)=> { - this.contentChanged = false; - const placeholder = ""; -// amp; -// 编辑时要传memoId - const imageUrl = `${getUploadActionUrl()}`; -// 创建editorMd - - const evaluate_script_editormd =create_editorMD(id, '100%', 400, placeholder, imageUrl, initValue,()=> { - setTimeout(() => { - evaluate_script_editormd.resize() - evaluate_script_editormd.cm && evaluate_script_editormd.cm.refresh() - }, 500) - - if (initValue != undefined) { - evaluate_script_editormd.setValue(initValue) - } - evaluate_script_editormd.cm.on("change", (_cm, changeObj) => { - console.log('....contentChanged') - this.contentChanged = true; - }) - }); - md_elocalStorage(evaluate_script_editormd, `MemoQuestion_${id}`, `${id}Question`); - this.evaluate_script_editormd = evaluate_script_editormd; - window.evaluate_script_editormd = evaluate_script_editormd; - - } - - - - componentDidMount() { - - let id=this.props.match.params.shixunId; - - let Url=`/shixuns/`+id+`/settings.json`; - - axios.get(Url).then((response)=> { - // alert(response.data.shixun.choice_standard_scripts) - if(response.status===200){ - this.setState({ - shixunsID: id, - settingsData: response.data, - webssh: response.data.shixun.webssh, - use_scope: response.data.shixun.use_scope, - shixunsstatus: response.data.shixun.status, - exec_time: response.data.shixun.exec_time, - trainee: response.data.shixun.trainee, - can_copy: response.data.shixun.can_copy, - task_pass: response.data.shixun.task_pass, - test_set_permission: response.data.shixun.test_set_permission, - hide_code: response.data.shixun.hide_code, - code_edit_permission: response.data.shixun.code_edit_permission, - code_hidden: response.data.shixun.code_hidden, - is_secret_repository: response.data.shixun.is_secret_repository, - init_is_secret_repository: response.data.shixun.is_secret_repository, - forbid_copy: response.data.shixun.forbid_copy, - vnc: response.data.shixun.vnc, - vnc_evaluate: response.data.shixun.vnc_evaluate, - name: response.data.shixun.name, - scope_partment: response.data.shixun.scope_partment, - description: response.data.shixun.description, - evaluate_script: response.data.shixun.evaluate_script, - choice_main_type: response.data.shixun.choice_main_type, - choice_small_type: response.data.shixun.choice_small_type, - choice_standard_scripts: response.data.shixun.choice_standard_scripts, - standard_scripts:response.data.shixun.standard_scripts, - multi_webssh:response.data.shixun.multi_webssh, - status:response.data.shixun.status, - opening_time:response.data.shixun.opening_time, - newuse_scope:response.data.shixun.use_scope, - scope_partments: response.data.shixun.scope_partment.length, - shixunmemoMDvalue:response.data.shixun.evaluate_script, - shixun_service_configs:response.data.shixun.shixun_service_configs, - shixun_service_configlist:response.data.shixun.shixun_service_configs, - }) - - // if(response.data.status===403){ - // message: "您没有权限进行该操作" - // this.setState({ - // :true - // message403:response.data.message - // }) - // } - - - if(response.data.shixun.multi_webssh===true){ - this.setState({ - SelectTheCommandtype:true - }) - }else{ - this.setState({ - SelectTheCommandtype:false - }) - } - if (response.data.shixun.scope_partment.length > 0) { - this.setState({ - scopetype: true - }) - } - // console.log(response.data.shixun.description) - // console.log(response.data.shixun.evaluate_script) - // console.log(response.data.shixun.description) - // this.props.identity<4&&this.props.status==0||this.props.identity===1&&this.props.status==2 - - - // this.evaluate_scriptMD(response.data.shixun.evaluate_script, "shixunmemoMD"); - - this.descriptionMD(response.data.shixun.description, "shixundescription"); - - // this.bigClass() - // if (response.data.shixun.status === 2) { - // - // } else if (response.data.shixun.status === 1) { - // this.props.showSnackbar("这个实训已发布不能修改!"); - // } else if (response.data.shixun.status === 3) { - // this.props.showSnackbar("这个实训已关闭不能修改!"); - // } - } - - }); - - - let departmentsUrl = `/shixuns/departments.json`; - axios.get(departmentsUrl).then((response) => { - if (response.status === 200) { - if (response.data.message === undefined) { - this.setState({ - departmentslist: response.data.shools_name - }); - } - } - }).catch((error) => { - console.log(error) - }); - - - - } - - SelectshixunCommand=(e)=>{ - // console.log( e.target.value) - const webssh = e.target.value - if (webssh == 2) { - this.setState({ - webssh: webssh, - SelectTheCommandtype: true, - multi_webssh:false - }); - } else { - if (this.state.init_is_secret_repository && !this.state.vnc && this.state.is_secret_repository == true) { - this.confirmDeleteSecretRepo({ - onOk: () => { - this.setState({ - webssh: webssh, - SelectTheCommandtype: false, - multi_webssh:false - }); - } - }) - } else { - if (!this.state.vnc) { - this.setState({ - is_secret_repository: false, - }) - } - this.setState({ - webssh: webssh, - SelectTheCommandtype: false, - multi_webssh:false - }); - } - } - - // this.setState({ - // webssh: webssh, - // }); - // if(webssh===2){ - // this.setState({ - // SelectTheCommandtype: true, - // multi_webssh:false - // }); - // }else{ - // this.setState({ - // SelectTheCommandtype: false, - // multi_webssh:false - // }); - // } - } - - SelectOpenpublic=(e)=>{ - this.setState({ - Openpublic: e.target.value - }); - } - - can_copy=(e)=>{ - let sum = "" - if (e.target.checked === false) { - sum = 0 - } else if (e.target.checked === true) { - sum = 1 - } - this.setState({ - can_copy: sum, - }); - - } - - task_pass=(e)=>{ - - let sum = "" - if (e.target.checked === false) { - sum = 0 - } else if (e.target.checked === true) { - sum = 1 - } - this.setState({ - task_pass: sum, - }); - } - - test_set_permission=(e)=>{ - let sum = "" - if (e.target.checked === false) { - sum = 0 - } else if (e.target.checked === true) { - sum = 1 - } - this.setState({ - test_set_permission: sum, - }); - - } - - hide_code=(e)=>{ - let sum = "" - if (e.target.checked === false) { - sum = 0 - } else if (e.target.checked === true) { - sum = 1 - } - this.setState({ - hide_code: sum, - }); - - } - code_edit_permission = (e) => { - this.setState({ - code_edit_permission: e.target.checked - }) - } - code_hidden=(e)=>{ - let sum = "" - if (e.target.checked === false) { - sum = 0 - } else if (e.target.checked === true) { - sum = 1 - } - this.setState({ - code_hidden: sum, - }); - - } - confirmDeleteSecretRepo = ({title, onOk}) => { - confirm({ - title: title ||
    -
    已创建的私密版本库及其内容,将在“保存”时被删除。
    -
    是否确认取消勾选?
    -
    , - okText: '确定', - cancelText: '取消', - onOk: () => { - this.setState({ is_secret_repository: false }) - onOk && onOk() - }, - onCancel() { - }, - }); - } - is_secret_repository = (e) => { - const checked = e.target.checked - if (!checked) { - if (this.state.init_is_secret_repository) { - this.confirmDeleteSecretRepo({ - }) - } else { - this.setState({ is_secret_repository: false }) - } - } else { - this.setState({ is_secret_repository: true }) - } - } - forbid_copy = (e) => { - let sum = "" - if (e.target.checked === false) { - sum = 0 - } else if (e.target.checked === true) { - sum = 1 - } - this.setState({ - forbid_copy: sum, - }); - } - shixun_vnc_evaluate=(e) => { - this.setState({ - vnc_evaluate: e.target.checked, - }); - - } - - shixun_vnc=(e)=>{ - // let sum = "" - // if (e.target.checked === false) { - // sum = 0 - // } else if (e.target.checked === true) { - // sum = 1 - // } - const vnc = e.target.checked; - if (!vnc) { - if (this.state.init_is_secret_repository && this.state.webssh != 2 && this.state.is_secret_repository == true) { - this.confirmDeleteSecretRepo({ - onOk: () => { - this.setState({ - vnc: e.target.checked, - vnc_evaluate: false, - }); - } - }) - } else { - if (this.state.webssh != 2) { - this.setState({ - is_secret_repository: false - }) - } - this.setState({ - vnc: e.target.checked, - vnc_evaluate: false, - }); - } - } else { - this.setState({ - vnc: e.target.checked, - vnc_evaluate: false, - }); - } - } - shixunsname = (e) => { - // let {shixunsstatus}=this.state; - // if(shixunsstatus>0){ - // return - // } - this.setState({ - name: e.target.value, - shixunnametype:false - }) - } - - bigClass = (value) => { - // choice_main_type - // choice_small_type - let {settingsData,shixun_service_configs,choice_main_type,choice_small_type}=this.state; - - let list=[] - list.push(choice_main_type) - choice_small_type.map((item,key)=>{ - list.push(item) - }) - - let newshixun_service_configs=shixun_service_configs; - - let newshixun_service_configsagin=[] - - newshixun_service_configs.map((item,key)=>{ - list.map((its,index)=>{ - if(item.mirror_repository_id===its){ - newshixun_service_configsagin.push(item) - } - }) - }) - - - settingsData.shixun.main_type.some((item,key)=> { - if (item.id === value) { - newshixun_service_configsagin[0]={ - mirror_repository_id:value, - name:item.type_name, - cpu_limit:1, - lower_cpu_limit:0.1, - memory_limit:1024, - request_limit:10 - } - return true - } - } - ) - let url = `/shixuns/get_mirror_script.json?mirror_id=`+value; - axios.get(url).then((response) => { - if (response.status === 200) { - // console.log(response.data) - this.setState({ - choice_main_type: value, - standard_scripts:response.data, - choice_standard_scripts:null, - shixun_service_configs:newshixun_service_configsagin, - shixun_service_configlist:newshixun_service_configsagin, - }) - } - }).catch((error) => { - console.log(error) - }); - - - - } - Deselectlittle=(value)=>{ - - let {shixun_service_configs,choice_small_type}=this.state; - let newshixun_service_configs=shixun_service_configs; - let newchoice_small_type=choice_small_type; - - newshixun_service_configs.some((item,key)=> { - if (item.mirror_repository_id === value) { - newshixun_service_configs.splice(key, 1) - return true - } - } - ) - - newchoice_small_type.some((item,key)=> { - if (item === value) { - newchoice_small_type.splice(key, 1) - return true - } - } - ) - - - this.setState({ - choice_small_type: newchoice_small_type, - shixun_service_configs:newshixun_service_configs, - shixun_service_configlist:newshixun_service_configs, - }) - } - littleClass = (value) => { - - let {settingsData,shixun_service_configs,choice_small_type,choice_main_type}=this.state; - let newshixun_service_configs=shixun_service_configs; - let newchoice_small_type=choice_small_type; - // if(Array.isArray(value)===true){ - // value.map((item,key)=>{ - // settingsData.shixun.small_type.some((items,keys)=> { - // if (items.id === item) { - // newshixun_service_configs.push({ - // mirror_repository_id:value, - // name:items.type_name, - // cpu_limit:1, - // lower_cpu_limit:0.1, - // memory_limit:1024, - // request_limit:10 - // }) - // return true - // } - // } - // ) - // }) - // } - - let list=[] - list.push(choice_main_type) - choice_small_type.map((item,key)=>{ - list.push(item) - }) - - let newshixun_service_configsagin=[] - - newshixun_service_configs.map((item,key)=>{ - list.map((its,index)=>{ - if(item.mirror_repository_id===its){ - newshixun_service_configsagin.push(item) - } - }) - }) - - settingsData.shixun.small_type.some((items,keys)=> { - if (items.id === value) { - newshixun_service_configsagin.push({ - mirror_repository_id:value, - name:items.type_name, - cpu_limit:1, - lower_cpu_limit:0.1, - memory_limit:1024, - request_limit:10 - }) - return true - } - } - ) - - newchoice_small_type.push(value) - - this.setState({ - choice_small_type: newchoice_small_type, - shixun_service_configs:newshixun_service_configsagin, - shixun_service_configlist:newshixun_service_configsagin, - }) - } - onPodExistTimeChange = (e) => { - this.setState({ - pod_exist_time: e.target.value, - pod_exist_timetype: false, - }) - } - Timevalue = (e) => { - this.setState({ - exec_time: e.target.value - }) - } - SelectOpenpublic = (e) => { - this.setState({ - scopetype: false, - use_scope: e.target.value, - }); - if (e.target.value === 1) { - this.setState({ - scopetype: true - }); - } - - } - deleteScopeInput = (key) => { - let {scope_partment} = this.state; - let datalist = scope_partment; - datalist.splice(key, 1); - this.setState({ - scope_partment: datalist - }); - } - - shixunScopeInput = (e) => { - let {scope_partment} = this.state; - let datalist = scope_partment; - if (datalist===undefined) { - datalist=[] - } - - datalist.push(e) - // else { - // datalist[id] = e - // } - this.setState({ - scope_partment: datalist - }); - } - // adduse_scopeinput = () => { - // let {scope_partment} = this.state; - // let array = scope_partment; - // let newarray = "" - // array.push(newarray) - // this.setState({ - // scope_partment: array, - // }); - // } - submit_edit_shixun = () => { - if (this.saving == true) return; - this.saving = true; - if(this.state.status===-1){ - this.props.showSnackbar("该实训已被删除,保存失败!"); - return - } - - let { - name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum, vnc_evaluate, - evaluate_script, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh, - opening_time,shixunmemoMDvalue,shixun_service_configlist, is_secret_repository, code_edit_permission - } = this.state; - - let newshixun_service_configlist = shixun_service_configlist.map(v => { - let v1 = Object.assign({},v); - delete v1.name; - return v1 - }); - - // let operateauthority= - // this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false; - // this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1; - - const description_editormd = this.description_editormd.getValue(); - - let evaluate_script_editormd; - - if(this.state.status==0||this.state.status==1||this.state.status==2&&this.props.identity===1){ - // evaluate_script_editormd = this.evaluate_script_editormd.getValue(); - evaluate_script_editormd = shixunmemoMDvalue - }else{ - evaluate_script_editormd = evaluate_script; - } - - - - if (name === "") { - this.setState({ - shixunnametype: true - }) - $('html').animate({ - scrollTop: 10 - }, 1000); - return - } - if (choice_main_type === "") { - this.setState({ - shixunmaintype: true - }) - $('html').animate({ - scrollTop: 800 - }, 1000); - return - } - if (evaluate_script_editormd === "") { - this.setState({ - evaluate_scripttype: true - }) - $('html').animate({ - scrollTop: 1200 - }, 1000); - return - } - if(use_scope===1){ - - if(scope_partment===undefined||scope_partment.length===0){ - this.setState({ - scope_partmenttype: true - }) - $('html').animate({ - scrollTop: 2500 - }, 1000); - this.props.showSnackbar("公开程度,指定单位为空"); - return - } - } - // if (exec_time === "") { - // this.setState({ - // exec_timetype: true - // }) - // $('html').animate({ - // scrollTop: 1500 - // }, 1000); - // return - // } - - // if (!pod_exist_time) { - // this.setState({ - // pod_exist_timetype: true - // }) - // $("html, body").animate({ scrollTop: $('#pod_exist_time').offset().top - 100 }, 1000) - // return - // } - - if (trainee === "") { - this.setState({ - traineetype: true - }) - return - } - - let id = this.props.match.params.shixunId; - - let newmulti_webssh=multi_webssh; - - - if(newmulti_webssh===null){ - newmulti_webssh=false - } - - //exec_time: exec_time, - let Url = `/shixuns/` + id + `.json`; - let data = { - shixun:{ - - name: name, - webssh: webssh, - use_scope: use_scope, - can_copy: can_copy, - vnc: vnc===null?undefined:vnc, - vnc_evaluate: vnc_evaluate===null?undefined:vnc_evaluate, - test_set_permission: test_set_permission, - code_hidden: code_hidden, - code_edit_permission: code_edit_permission, - trainee: trainee, - task_pass: task_pass, - hide_code: hide_code, - forbid_copy: forbid_copy, - multi_webssh:newmulti_webssh, - opening_time:opening_time, - mirror_script_id:choice_standard_scriptssum===undefined?choice_standard_scripts:choice_standard_scriptssum, - }, - shixun_info:{ - description: description_editormd, - evaluate_script: evaluate_script_editormd, - }, - is_secret_repository: is_secret_repository, - main_type: choice_main_type, - small_type: choice_small_type, - scope_partment: scope_partment, - shixun_service_configs:newshixun_service_configlist - } - - axios.put(Url, data).then((response) => { - // console.log(response) - this.saving = false; - if(response.status){ - if (response.data.status === -1) { - this.props.showSnackbar(response.data.message); - return - } else { - window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges"; - } - } - - }).catch((error) => { - console.log(error) - this.saving = false; - }) - - - } - shixunsfetch = (value, callback) => { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - currentValue = value; - - function fake() { - let departmentsUrl = `/shixuns/departments.json?q=` + currentValue; - axios.get(departmentsUrl).then((response) => { - callback(response.data.shools_name); - }).catch((error) => { - console.log(error) - }); - } - - timeout = setTimeout(fake, 300); - } - shixunHandleSearch = (value) => { - this.shixunsfetch(value, departmentslist => this.setState({departmentslist})); - } - - - - - shixunsclose = () => { - let id = this.props.match.params.shixunId; - let cul = `/shixuns/` + id + `/close.json`; - axios.post(cul).then((response) => { - if(response.data.status===1){ - this.props.showSnackbar("操作成功"); - this.setState({ - operateshixunstype: false, - }); - - window.location.href = "/shixuns/" + id + "/challenges"; - } - }).catch((error) => { - console.log(error) - }) - } - - shixunsdel= () => { - let id = this.props.match.params.shixunId; - let cul = `/shixuns/` + id +`.json`; - - axios.delete(cul).then((response) => { - if(response.data.status===1){ - this.props.showSnackbar("操作成功"); - this.setState({ - operateshixunstype: false, - }); - - window.location.href = "/shixuns"; - } - }).catch((error) => { - console.log(error) - }) - } - - Executiveorder = (e) => { - this.setState({ - Executiveordervalue: e.target.value - }) - } - - Compilecommand = (e) => { - this.setState({ - Compilecommandvalue: e.target.value - }) - } - - handleCancelTemplate = (e) => { - this.setState({ - Executiveordervalue: "", - Compilecommandvalue: "", - visibleTemplate: false - }) - } - - hideModalTemplate = (e) => { - let id = this.props.match.params.shixunId; - let {Executiveordervalue, Compilecommandvalue} = this.state; - - if (Executiveordervalue === "") { - this.setState({ - Executivetyoe: true, - }); - return - } - // Executiveordervalue=String(Executiveordervalue); - // Compilecommandvalue=String(Compilecommandvalue); - let trl = `/shixuns/${id}/get_custom_script.json?compile=${Executiveordervalue}&excutive=${Compilecommandvalue}` - axios.get(trl).then((response) => { - // this.evaluate_scriptMD(response.data.shixun_script, "shixunmemoMD"); - this.setState({ - shixunmemoMDvalue:response.data.shixun_script - }) - }).catch((error) => { - console.log(error) - }); - this.setState({ - visibleTemplate: false - }) - } - - showModal = () => { - this.setState({ - visibleTemplate: true, - }); - } - Selecttrainee = (value) => { - this.setState({ - trainee: value, - }); - } - - post_apply = () => { - this.setState({ - postapplyvisible: true - }) - } - - sendsure_applyvalues = (e) => { - this.setState({ - sendsure_applyvalue: e.target.value - }) - } - - setlanguagewrite = (e)=>{ - this.setState({ - languagewrite: e.target.value - }) - } - - setsystemenvironment = (e) => { - this.setState({ - systemenvironment: e.target.value - }) - } - - settestcoderunmode = (e) => { - this.setState({ - testcoderunmode: e.target.value - }) - - } - - sendsure_apply = () => { - let {languagewrite,systemenvironment,testcoderunmode} = this.state; - // console.log("点击确定") - // console.log("languagewrite"+languagewrite); - // console.log("systemenvironment"+systemenvironment); - // console.log("testcoderunmode"+testcoderunmode); - - // let attachment_ids = undefined - // if (this.state.fileList) { - // attachment_ids = this.state.fileList.map(item => { - // return item.response ? item.response.id : item.id - // }) - // } - if(languagewrite === undefined || languagewrite === "" ){ - // this.props.showNotification(`请填写该镜像是基于什么语言`); - this.setState({ - languagewritetype:true - }) - return - } - if(systemenvironment === undefined || systemenvironment === ""){ - // this.props.showNotification(`请填写该镜像是基于什么语言系统环境`); - this.setState({ - systemenvironmenttype:true - }) - return; - - } - if(testcoderunmode === undefined || testcoderunmode === "") { - // this.props.showNotification(`请填写该镜像中测试代码运行方式`); - this.setState({ - testcoderunmodetype:true - }) - return; - } - var attachment_ids=undefined; - if (this.state.fileList) { - attachment_ids = this.state.fileList.map(item => { - return item.response ? item.response.id : item.id - }) - } - - if( attachment_ids === undefined || attachment_ids.length===0){ - - // notification.open( - // { - // message: '提示', - // description: - // '请上传附件!', - // - // } - // ) - this.setState({ - attachmentidstype:true - }) - return; - } - // console.log("attachment_ids"+attachment_ids); - - // alert(languagewrite +" "+systemenvironment +" "+testcoderunmode + " "+attachment_ids); - - var data={ - language:languagewrite, - runtime:systemenvironment, - run_method:testcoderunmode, - attachment_id:attachment_ids[0], - } - var url =`/shixuns/apply_shixun_mirror.json`; - axios.post(url,data - ).then((response) => { - - try { - if (response.data) { - // const { id } = response.data; - // if (id) { - if(this.state.file !== undefined){ - console.log("549"); - // this.deleteAttachment(this.state.file); - this.setState({ - file:undefined, - deleteisnot:true, - languagewrite:"", - systemenvironment:"", - testcoderunmode:"", - fileList:[] - }) - }else { - this.setState({ - file:undefined, - deleteisnot:true, - languagewrite:"", - systemenvironment:"", - testcoderunmode:"", - fileList:[] - }) - } - // this.props.showNotification('提交成功!'); - notification.open( - { - message: '提示', - description: - '提交成功!', - - } - ) - this.sendhideModaly() - // this.props.history.push(`/courses/${cid}/graduation_topics`); - // } - } - }catch (e) { - - } - - }) - - } - - sendhideModaly = () => { - this.setState({ - postapplyvisible: false, - }) - if(this.state.file !== undefined){ - console.log("580"); - // this.deleteAttachment(this.state.file); - this.setState({ - file:undefined, - deleteisnot:true, - languagewrite:"", - systemenvironment:"", - testcoderunmode:"", - fileList:[] - }) - }else { - this.setState({ - file:undefined, - deleteisnot:true, - languagewrite:"", - systemenvironment:"", - testcoderunmode:"", - fileList:[] - }) - } - } - - yeshidemodel = () => { - this.setState({ - postapplytitle: false - }) - } - - SelectScput = (value, e) => { - this.setState({ - choice_standard_scriptssum: value, - language:e.props.name, - choice_standard_scripts: {id:e.props.value,value:""}, - standard_scriptsModal:true - }) - } - - hidestandard_scriptsModal=()=>{ - this.setState({ - standard_scriptsModal:false, - standard_scriptsModals:false - }) - } - - get_mirror_script=()=>{ - let {choice_standard_scriptssum}=this.state; - let id = this.props.match.params.shixunId; - let pul = "/shixuns/" + id + "/get_script_contents.json?script_id=" + choice_standard_scriptssum; - axios.get(pul).then((response) => { - if(response.status===200){ - // this.evaluate_scriptMD(response.data.content, "shixunmemoMD"); - this.setState({ - standard_scriptsModal:false, - standard_scriptsModals:true, - shixunmemoMDvalue:response.data.content - }) - } - - }).catch((error) => { - console.log(error) - }) - } - - - SelectTheCommandonChange=(e)=>{ - this.setState({ - multi_webssh:e.target.checked - }) - } - - bigopen=()=>{ - this.setState({ - opers:true - }) - - } - - bigopens=()=>{ - this.setState({ - opers:false, - operss:false, - opersss:false, - opensmail:false - }) - - } - bigopensmal=(e)=>{ - this.setState({ - opensmail:true - }) - - } - sbigopen=(e)=>{ - this.setState({ - operss:true - }) - - } - - sbigopens=()=>{ - this.setState({ - operss:false - }) - } - sbigopenss=(e)=>{ - this.setState({ - opersss:true - }) - - } - - sbigopensss=()=>{ - this.setState({ - opersss:false - }) - } - testscripttip=(val)=>{ - if(val===0){ - this.setState({ - testscripttiptype:true - }) - }else if(val===1){ - this.setState({ - testscripttiptype:false - }) - } - } - - operateshixuns=(value)=>{ - this.setState({ - operateshixunstype:true, - delType:value - }) - } - - hideoperateshixuns=()=>{ - this.setState({ - operateshixunstype:false - }) - } - onChangeTimePicker =(value, dateString)=> { - this.setState({ - opening_time: dateString=== ""?"":moment(handleDateStrings(dateString)) - }) - } - - getshixunmemoMDvalue=(value, e)=>{ - - this.setState({ - shixunmemoMDvalue:value - }) - } - - setConfigsInputs=(e,keys,str)=>{ - - let {shixun_service_configs}=this.state; - let newshixun_service_configs=shixun_service_configs; - newshixun_service_configs.map((item,key)=>{ - if(key===keys){ - switch (str) { - case 1: - item.cpu_limit=e.target.value - break; - case 2: - item.lower_cpu_limit=e.target.value - break; - case 3: - item.memory_limit=e.target.value - break; - case 4: - item.request_limit=e.target.value - break; - } - } - }) - - this.setState({ - shixun_service_configs:newshixun_service_configs, - shixun_service_configlist:newshixun_service_configs, - }) - - } - - handleChange = (info) => { - let {fileList}=this.state; - - if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { - console.log("handleChange1"); - - // if(fileList.length===0){ - let fileLists = info.fileList; - this.setState({ fileList:fileLists, - deleteisnot:false}); - // } - } - } - - onAttachmentRemove = (file) => { - if(!file.percent || file.percent == 100){ - confirm({ - title: '确定要删除这个附件吗?', - okText: '确定', - cancelText: '取消', - // content: 'Some descriptions', - onOk: () => { - console.log("665") - this.deleteAttachment(file) - }, - onCancel() { - console.log('Cancel'); - }, - }); - return false; - } - - } - - deleteAttachment = (file) => { - console.log(file); - let id=file.response ==undefined ? file.id : file.response.id - const url = `/attachments/${id}.json` - axios.delete(url, { - }) - .then((response) => { - if (response.data) { - const { status } = response.data; - if (status == 0) { - // console.log('--- success') - - this.setState((state) => { - - const index = state.fileList.indexOf(file); - const newFileList = state.fileList.slice(); - newFileList.splice(index, 1); - return { - fileList: newFileList, - deleteisnot:true - }; - }); - } - } - }) - .catch(function (error) { - console.log(error); - }); - } - - - - render() { - let { - postapplyvisible, - postapplytitle, - shixunnametype, - shixunmaintype, - evaluate_scripttype, - traineetype, - standard_scripts, - name, - settingsData, - webssh, - is_secret_repository, - use_scope, - shixunsID, - can_copy, - choice_standard_scripts, - Executiveordervalue, - Executivetyoe, - Compilecommandvalue, - task_pass, - test_set_permission, - hide_code, - forbid_copy, - code_edit_permission, - code_hidden, - vnc, - vnc_evaluate, - scopetype, - scope_partment, - departmentslist, - trainee, - choice_main_type, - choice_small_type, - standard_scriptsModal, - standard_scriptsModals, - SelectTheCommandtype, - testscripttiptype, - operateshixunstype, - opening_time, - scope_partmenttype, - newuse_scope, - scope_partments, - shixunmemoMDvalue,delType, - shixun_service_configs, - fileList, - } = this.state; - - let options; - - if (departmentslist != undefined) { - options = this.state.departmentslist.map((d, k) => { - return ( - - ) - }) - } - const uploadProps = { - width: 600, - fileList, - multiple: true, - // https://github.com/ant-design/ant-design/issues/15505 - // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - // showUploadList: false, - action: `${getUploadActionUrl()}`, - onChange: this.handleChange, - onRemove: this.onAttachmentRemove, - beforeUpload: (file, fileList) => { - if (this.state.fileList.length >= 1) { - return false - } - // console.log('beforeUpload', file.name); - const isLt150M = file.size / 1024 / 1024 < 50; - if (!isLt150M) { - // this.props.showNotification(`文件大小必须小于50MB`); - notification.open( - { - message: '提示', - description: - '文件大小必须小于50MB', - - } - ) - } - if(this.state.file !== undefined){ - console.log("763") - this.setState({ - file:file - }) - }else { - this.setState({ - file:file - }) - } - - console.log("handleChange2"); - return isLt150M; - }, - } - const dateFormat = 'YYYY-MM-DD HH:mm:ss'; - let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false; - - return ( -
    - - 实训详情 - 配置 - - -
    -
    - 配置 - { - this.props.identity===1&&this.state.status==2? - this.operateshixuns(2)}> - 永久关闭 - :"" - } - { - this.props.identity < 5 && this.state.status==0? - this.operateshixuns(1)}> - 删除实训 - :"" - } - { - this.props.identity == 1 && this.state.status == 2 ? - this.operateshixuns(1)}> - 删除实训 - :"" - } - - -
    - {delType===1?

    是否确认删除 ?

    :

    关闭后,
    用户不能再开始挑战了是否确认关闭 ?

    } -
    -
    - 取消 - {delType===1?确定:确定} -
    -
    - -
    - -
    - -

    实训名称

    - -
    - * -
    -
    - {settingsData === undefined ? "" : - } -
    -
    - 必填项 -
    -
    - - -
    - -
    -
    - -
    - -

    简介

    - -
    - -
    -
    -
    -

    -

    -
    - -
    -
    -

    技术平台

    - - -
    - * -
    - -

    - 列表中没有? - 申请新建 -

    - - -
    -
  • - - -
  • -
    {this.state.languagewritetype===true?"请填写该镜像语言":""}
    -
  • - - -
  • -
    {this.state.systemenvironmenttype===true?"请填写该镜像语言系统环境":""}
    -
  • - - - -
  • -
    {this.state.testcoderunmodetype===true?"请填写该镜像测试代码运行方式":""}
    -
  • - -
    - - - 上传附件 - (单个文件50M以内) - -
    -
  • -
    - {this.state.attachmentidstype===true?"请上传附件":""} -
    -
  • - this.sendhideModaly()} - >取消 - -
  • -
    -
    - -
    - - - - - -
    -

    新建申请已提交,请等待管理员的审核

    -
  • 我们将在1-2个工作日内与您联系 -
  • -
    -
    - 知道啦 -
    -
    -
    -
    - -
    - -
    -
    - 必填项 -
    - {/*

    请在配置页面完成后续的评测脚本设置操作

    */} - -
    -
    - {/*
    */} - {/*
    */} -
    -

    评测脚本

    -
    - - -
    -

    原有脚本将被新的脚本覆盖,无法撤销

    -

    是否确认执行覆盖操作

    -
    - - -
    - - -

    评测脚本生成成功!

    - -
    - - { - this.props.identity<5||this.props.power==true? - 使用自定义脚本 : "" - } -
    - this.testscripttip(0)}> -
    - -
    -

    - 使用自定义模板,平台无法自动更新脚本,
    - 请在关卡创建完后手动更新脚本中的必填参
    - 数和以下2个数组元素:
    - challengeProgramNames
    - sourceClassNames

    - 示例:有2个关卡的实训

    - 各关卡的待编译文件为:
    - src/step1/HelloWorld.java
    - src/step2/Other.java

    - 各关卡的编译后生成的执行文件为:
    - step1.HelloWorld
    - step2.Other

    - 则数组元素更新如下:
    - challengeProgramNames=("src/step1/
    - HelloWorld.java" "src/step2/Other.java")
    - sourceClassNames=("step1.HelloWorld
    - " "step2.Other")

    - 其它参数可按实际需求定制 -

    -
    -

    - this.testscripttip(1)}>知道了 -

    -
    -
    - - -
    -
  • - - -

    执行命令不能为空

    -
  • - -
  • - - -
  • -
    -
    -
    -
    - -
    -
    - * -
    - - -
    - {/**/} - -
    - - - {/*
    */} - {/*{evaluate_script===undefined?"":evaluate_script}*/} - - {/*
    */} - - - -
    - -
    -
    -
    - - 必填项 -
    -

    -

    -
    -
    - - {/*
    */} - {/***/} - - {/*

    程序最大执行时间

    */} - - {/* 秒*/} - - {/*
    */} - {/*必填项*/} - {/*
    */} - {/*
    */} - - {/*
    - * - -

    Pod存活时间

    - - - -
    - 必填项 -
    -
    */} - - -
    -

    命令行

    - - 无命令行窗口 (选中则不给学员的实践任务提供命令窗口) - 命令行练习窗口 (选中则给学员提供用于练习操作的命令行窗口) - 命令行评测窗口 (选中则给学员提供用于关卡评测的命令行窗口) - - 多个命令行窗口(选中则允许学员同时开启多个命令行窗口) - - -
    - -
    -

    公开程度

    - - 对所有公开 (选中则所有已被试用授权的用户可以学习) - 对指定单位公开 (选中则下方指定单位的已被试用授权的用户可以学习) - - -
    -
    -
    -
    -
    - -
    - (搜索并选中添加单位名称) -
    - {/*+*/} - {/*添加*/} -
    - -
    - - {/*{*/} - {/*scope_partment===undefined?"":scope_partment.map((item,key)=>{*/} - {/*return(*/} - {/*
    */} - {/*this.deleteScopeInput(key)} style={{ color: 'rgba(0,0,0,.25)' }} />}*/} - {/*value={item}*/} - {/*/>*/} - {/*
    */} - - {/*)*/} - {/*})*/} - {/*}*/} -
    - - - 请选择需要公开的单位 - -
    -
    -
    - -
    -

    发布信息

    - -
    - * - 面向学员: - -
    - -
    - 实训难易度定位,不限定用户群体 -
    - 必填项 -
    - -
    -
    - 复制: - - - - -
    - -
    - 跳关: - - - - -
    -
    - 测试集解锁: - - - - -
    - - {!code_hidden && !hide_code &&
    - 代码开放修改: - - - - -
    } - -
    - 隐藏代码窗口: - - - - -
    - -
    - 代码目录隐藏: - - - - -
    - - { (vnc || webssh == 2) &&
    - 私密版本库: - - - - -
    } - -
    - 禁用复制粘贴: - - - - -
    - -
    - 开启时间: - - - - -
    - - {this.props.identity<3?
    - VNC图形化: - - - - -
    :""} - {this.props.identity<3 && vnc ?
    - VNC图形化评测: - - - - -
    :""} - - - -
    - - {this.props.identity<3?
    -

    服务配置

    - { shixun_service_configs&&shixun_service_configs.map((item,key)=>{ - - return( -
    -
    -
    - {item.name} - {/*this.Deselectlittle(item.mirror_repository_id)}>*/} -
    -
    - -
    - this.setConfigsInputs(e,key,1)} - className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> -
    -
    -
    -
    - -
    - this.setConfigsInputs(e,key,2)} - className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> -
    -
    -
    -
    - -
    - this.setConfigsInputs(e,key,3)} - className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> -
    -
    -
    -
    - -
    - this.setConfigsInputs(e,key,4)} - className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" /> -
    - -
    -
    -
    -
    - ) - - })} -
    :""} - -

    - { - // this.props.identity<4&&this.props.status==0? - this.props.identity<5? -

    - 保存 - 取消 -
    :"" - } - -

    - -
    - ); - } -} - - diff --git a/public/react/src/modules/tpm/beian.png b/public/react/src/modules/tpm/beian.png deleted file mode 100755 index 9f763946dd6606addeab24e40e2369124d53a048..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19256 zcmeI4c{G&a_rPDYSRz?cRHh**jbW@aG4@bIvPT-TFwB@~W-OyD?Wzv>B_s{Rld(O-|_qor#_kBLkeeV0rob%2J%k9R3{F3|t z00^3z7+NvUVlyw^Ma=h*6RQQ8CqA-?0~G)SL}y-HKwQEK0N^*r8yHwxx|3)msym4c zGBq#&ktrk`o`3}azm~+EzV=b$%aQHl*rm4m&BNDY2nPVL41>2y*dbLo5_Jg5x422i0+8_A>U(Yr%K>1Rhwc|hyQVY6b(I8g z1LQ_US&_n%Gm*+2%rNj(k;LhZUs~+T33kyRV#pNJ8xk4foK3A(D&AUo>^XyWe)cdW-8O z41Fk1{o*-H0wdRsw0|i)&Ak8+-d;D<;?mXC#6zy+y5?QtnYjySu?5`QC!AGU`H~&^ zANx<7qH9j+u1QLYs+S*2-* zruU+}e6p=VyQ>%ID|?N1%Y3Ok5;PsUq5ie%b*D|@Cr9j0t?AQ$&3A^Qd&KsRs{a#~U#0uXjnh0(_WAgW{{ zOjm&mcodWV1^^1*t#G;&En!x{3jl`62R2^QTfF417^74u;qL0fQVDLe2muY_~&Dr*XMcZfJ0=p#!k+Os0*-ipGbd<*od zctufb5yzLghBkw1c_m^)7l2VFs*%Czpq}GmJHX{tlyvS)eUAud6PfoAiWoe^N%wPj zYZVA~a_VHEv2yf*oEYwr>QP=4nCXeSudHpMmzXcYDWFGciuE0 z;AAK|xL#QZcltTX>GUz9JtyoXyX@6$!_?5L?KOPFrAm`fL%g!wr-DWMd3PTc zzDGD19&T)JW^Zt5UB67ONCB@M-=V|G_tt}>E?MNR^B0*Y^K(U954YdKkQ-dPW^K~C z-Rp%!U7}26g&st9Zs%XSE*xemVCreoY63~$nT~7_#wVD`^@S53yzJ!731)y|BJ#qQ zhFe5VKDghRCx$3L{@RQ$Rn{s!T4bvlR;O#hh4V1|*yPJQ9%Uvy<-L3yao*9CnCxQ- z-FYliRMk6f-J|&B2G!}1w8qDAcsKmGJG6&Z!1v^FYgxL-Wtp~xA;8QU{~ zXSy$2+fZ$E8tIn>tgqNCy|UXj;NljW8D%Oa&fIlZ&P2bN&%#M5ALu@_ zod(p)I0h~Pm-u$?BQBwe>m9@J=LuVD*VYQw?t}0^bRgH8JhE_Efms?Y{w>8Vt^<^T z>-Na3aV+bN*+?%gJyV+UiI*m1Z7S1a7{S+o##1xe*N&_SC^JmyB9>1xu?~ermfGH8$9OrM$JzG ziDQsfxiVB=V%t2mP_B4bYkFCFd1vv4N70^fxPtoJC$yTHs!eT-X2yg5P~Ef+cDc`4AUm3zD<3^COd+qlwJIi zctm{ltxH+)S!F))#CEaQVqqH^HjM4`YEkZ=>gVr|>t8eg|A_jy?j!MI-RhcEBCDG= z(>Cv?(7bDW2;{=P^jE6)Gs`mX_t?2fxusAON7W=QZVRs#iSdb%*h$Pdnc;Qbzxqs< zVP9gsY5gU6FcdO_@h3yakjhAh0Z2)YC* zuD^s&&_S9KMJkneFExQyX>;2YS1a$XfoY|VDWuZswc-w^oNf#%~dTMU* z9`7(F9M6}=uZ)$L2oT$_5q4RzcSr6{+FsiDrY1(G!=zhL=tx-R>D!xIJ#JBa+!!7N zD+0PdK0i4Ba{d9oW1oyhVnk@7vU~$4I?I~Nv`@UDa(5HrR1!Mltk2TW*BN2lu$NZ%5=!lEm~%Y3!y`@``^ER2d%LsEBK&&%Jc75O&N z_RL4k7n=hNKD!^a*y3HG!e?QnK#y1%d0S@G+}5z^C8O^7-scc_bV77Onw22_Y_7sH zr9AmO3!H*Nlwc?QE%BjL)Uk)-oiY>D(N=N75wrTVT&rwLq2*@KOA3CwR_yZ2Hz_i4 ze5%rp`_elhBXDr}{-W?}migCiH0S#{jC6oYjP5L#Iki*5S5ev7ssQ7MA8rV!cCXGk zJ8k*e-pb~^2fgimsMVo{3l|I&4%(@n$&7wb?Unt(@itlQbWgAA?)vtN`}e)Ee3w#tzwQ2`_Sm4j zG2T8Cxn%5Tu#m1<#jNy&-w+9MO42czC( zU^0>tx9ey>jcuckn@z=fI`42UaxMl|rcD#DPPAi-C!MtyC{m_%3&mN_X)MuZbDLS907Y$YPOXYdVy;zmM zu3+qw&&L4?U;aU}HfR4ZzpGQlEz`Y=KQHYK%KdU3TT1Nsw5N1W-F=6pLqdGVlD>U;qW75Es8<;|8KQL$18u+3`>0pC+oxYoZmYAOY91Dt zI8|4YP0t*q3|+~*il~&SlrF5LYmZ!<%BpP*7|I_iXs;}ij+LL%{bD&<{~2AG@z`P< z*}ebE6mxTEz1`pjS0fX=uZLpo1xso~A0PBu7@uy&S`fs;J`+K6{7_bhKU&{}{bU?(?P#`}d z!HbIU(+1D_MKC|lG(*9l*)B9sZLr=vHoN;C3dUdi{7{V^cbnoh<- zt*}&*HwBF~^1*u1Wd3v!{6iQ}uqYadVof3ukl(Uw?%Nad%hOC& zf#mJ*UKo-ub%Pd^)nsnI=e%JJQ8X-)X{iQLR)#1mSt~P>Q5B)4q@bk9%*uIAzV&4B zVb08b42p*O7cal`W%WbC;BoYS@-o-+S0Co)2vaXA4dsQ#ni?XRV^_rEF$hg1S2PN) zsRmKS!CfKhSXB%JjzhyCSWTQN9Hy>;!Kq?r2l=b{Z>|kVXz!UkV7mUc@G&Gb)BVr1 zLSQi%6joCS4bjxlP-3#gszEeW;V6hJ8izrtE5S5zu%ChEIr}Y;1%iF`NvrP;O4hbCU`0{o9Oeh zjG1e*m1ie*@2{;t6a@Ti1tFs-RP4;c)CT`pnLkU;&x$f*GrPbMDD+J2L852U7mLw? z{?a;kSwAhmo8f<-&VNJj&Hp^}zsK-($9l0#|8K5ld;Q%Bm4u`Dq9|BBH)e+X%gX%b z^;a`i_gc`IT1~+JA4~)l<@3LrhJRaC|1YLtE{oCbC@(iG1_}L#83 z8tTC{RA8DaYO2aGRipnY(f(5KTrn6N8mEq9U-15v!`}k_ddXVQe;e>TE(Rn5iDFK| zV38{Gt>>EO=4GB0^H)a8Z$C03saD4NAX6g)b!E7^Is~T3ES_^0F|Xe|KNvIuN1_l> zG$fvga>GK&UT#{@xyE@tXKwxoW))^u1k`NxV|xFsjkUl1Of@BV&-T}VDKQVI^33~p z)A?#vQwR2@^VO`TbCxz#7UgY3n&xb|J!NmfEy~x4Eo)3$bgNp?Sdy#{SJs%b= z2Nw$v_96!tdp;~$4lWiT>_rYP_Iy~h99%3w*oz!o?D?>0Ik;GWuopSF*z;l0a&WN# zVJ~uUvFF30<=|og!d~RyV$X*~%fZD0guTeY#hwp~mV=802z!x(i#;C}Ee9715cVPm z7kfS|S`IE2AnZjBF7|v_v>aS4K-h~MTyCiIq73_^$(i;6nf~@s)Y*0RV3$0O;KV0Elw{AVG?BDc=GB3zwN1>RJ1> z7(VSI?HXHMIWm6x6Z7y%(DW(HS1^}p5oGWjV(XDlJ~W8&nkHT^9)UBq`# zdJ?Et6SOUO36LopDa_rTeMmN(=RhhpcPWg?a=hbK+C5LOET6D^Pw_6AL5}-L?BNKmM~&;h3|ExBu?QU^7N~q4;5#z? z**vMi?RNK|ma}hnz;Q z6*mp1{a+JplzQQp2Jf7ZiHT}iPi>`>?--2|cqaT;KR7Mo%ulv>DVvimRn%iS(TA@X zB&m#)%e|aZl9x@lT|##kXFzRFzN#FO=Do1ulKKYE&Zt1g5>0^sp)I}$@2!w<` z%r$U{SsZDYwLx@X$5O(oHM{b-Yn}Xujtx-gno*CFMUBMxF~|1d!Pf?RLAW=3mIUD$SCA(?T@?8@3G$HIFr zCwUNo++W{my$G6IbsMUG$9Qc`CdOA>-puI&Wmqfg*1cx;!x(RoD=DdRUA)2k!YaiG zMN+=HWap&cYpLanKl}R?X&u+ucVMtrmV!7+O*yI-o|dp-*cZNNL)7}>+q&x=$_fqc zRWabVxDO_X3f^stE>Ar4Wa^_`tKZ1PvQWqPlvgSqc0DlcOT^jq6I>X-!EVInMRKw6 z3!LJwp^461HaCijqH5mMO-3(Qd|&-a9{pyoTxhFPWZrP;MW}q)Mq22H`fNDkx%+V6 z;_SVnPt^!6#&sT-F5X&}Kenpy?fNiVi?4&%RN5=9e6ox~O&b^(jv^M=9K5`hdUtJ6 zwm_4QLFT;=tucEe9Ym)2T#FX<90=Havu0c;{ID=UbNm`W=$Sh3jQg3X9WucZfs&D?-Eu+@Lke}9aJ|NSbNy((&o`0*Er=e{`d^2D6Y($o+8 z&(#h|f-dFpG8V0nJc&y!PcCXpx4E2hbzlqh?Z{bTTh2OH&p7!^vFlJznHIYppWYp5 zdlp#~Va9cJjmV;nsN@bsN05F?BjV8mBiVJ_k%#xC>C4JRef3#;Wo1*H{;@`g=hl<% z8i>A|heqs103%Lk@{07bBdr~)XsW#%skOpUf1X6x@c_#dhPKRf^c diff --git a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js b/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js deleted file mode 100644 index 64cc373dc..000000000 --- a/public/react/src/modules/tpm/challengesnew/TPMMDEditor.js +++ /dev/null @@ -1,355 +0,0 @@ -import React, {Component} from 'react'; - -import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd'; - -import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; - -// import "antd/dist/antd.css"; - -import { getImageUrl, getUploadActionUrl, getUrl } from 'educoder'; -import '../../courses/css/Courses.css' - -import axios from 'axios'; - -import './css/TPMchallengesnew.css'; -require('codemirror/lib/codemirror.css'); - -let origin = getUrl(); - -let path = '/editormd/lib/' - path = getUrl("/editormd/lib/") -const $ = window.$; - -let timeout; - -let currentValue; - -const Option = Select.Option; - -const RadioGroup = Radio.Group; - - - -// 保存数据 -function md_add_data(k,mdu,d){ - window.sessionStorage.setItem(k+mdu,d); -} - -// 清空保存的数据 -function md_clear_data(k,mdu,id){ - window.sessionStorage.removeItem(k+mdu); - var id1 = "#e_tip_"+id; - var id2 = "#e_tips_"+id; - if(k == 'content'){ - $(id2).html(" "); - }else{ - $(id1).html(" "); - } -} -window.md_clear_data = md_clear_data -// editor 存在了jquery对象上,应用不需要自己写md_rec_data方法了 -function md_rec_data(k, mdu, id) { - if (window.sessionStorage.getItem(k + mdu) !== null) { - var editor = $("#e_tips_" + id).data('editor'); - editor.setValue(window.sessionStorage.getItem(k + mdu)); - // debugger; - // /shixuns/b5hjq9zm/challenges/3977/tab=3 setValue可能导致editor样式问题 - md_clear_data(k, mdu, id); - } -} -window.md_rec_data = md_rec_data; - -function md_elocalStorage(editor,mdu,id){ - if (window.sessionStorage){ - var oc = window.sessionStorage.getItem('content'+mdu); - if(oc !== null && oc != editor.getValue()){ - console.log("#e_tips_"+id) - $("#e_tips_"+id).data('editor', editor); - var h = '您上次有已保存的数据,是否恢复 ? / 不恢复'; - $("#e_tips_"+id).html(h); - } - setInterval(function() { - var d = new Date(); - var h = d.getHours(); - var m = d.getMinutes(); - var s = d.getSeconds(); - h = h < 10 ? '0' + h : h; - m = m < 10 ? '0' + m : m; - s = s < 10 ? '0' + s : s; - if(editor.getValue().trim() != ""){ - md_add_data("content",mdu,editor.getValue()); - var id1 = "#e_tip_"+id; - var id2 = "#e_tips_"+id; - - var textStart = " 数据已于 " - var text = textStart + h + ':' + m + ':' + s +" 保存 "; - // 占位符 - var oldHtml = $(id2).html(); - if (oldHtml && oldHtml != ' ' && oldHtml.startsWith(textStart) == false) { - $(id2).html( oldHtml.split(' (')[0] + ` (${text})`); - } else { - $(id2).html(text); - } - // $(id2).html(""); - } - },10000); - - }else{ - $("#e_tip_"+id).after('您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!'); - } -} - - -function create_editorMD(id, width, high, placeholder, imageUrl, callback, initValue, - onchange, watch, { noStorage, showNullButton, emoji }, that) { - // 还是出现了setting只有一份,被共用的问题 - - var editorName = window.editormd(id, { - width: width, - height: high===undefined?400:high, - path: path, // "/editormd/lib/" - markdown : initValue, - - dialogLockScreen: false, - watch:watch===undefined?true:watch, - syncScrolling: "single", - tex: true, - tocm: true, - emoji: !!emoji , - taskList: true, - codeFold: true, - searchReplace: true, - htmlDecode: "style,script,iframe", - sequenceDiagram: true, - autoFocus: false, - - // mine - - toolbarIcons: function (mdEditor) { - let react_id = `react_${mdEditor.id}`; - const __that = window[react_id] - - // Or return editormd.toolbarModes[name]; // full, simple, mini - // Using "||" set icons align right. - const icons = ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "link", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"]; - // 试卷处用到的填空题新增按钮 - if (__that.props.showNullButton) { - icons.push('nullBtton') - } - return icons - }, - toolbarCustomIcons: { - testIcon: "
    ", - testIcon1: "
    ", - nullBtton: "
    点击插入填空项
    ", - }, - //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。 - saveHTMLToTextarea: true, - // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标 - dialogMaskOpacity: 0.6, - placeholder: placeholder, - imageUpload: true, - imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], - imageUploadURL: imageUrl,//url - onchange: onchange, - onload: function() { - let _id = this.id // 如果要使用this,这里不能使用箭头函数 - let _editorName = this; - let react_id = `react_${_editorName.id}`; - const __that = window[react_id] - - // this.previewing(); - // let _id = id; - $("#" + _id + " [type=\"latex\"]").bind("click", function () { - _editorName.cm.replaceSelection("```latex"); - _editorName.cm.replaceSelection("\n"); - _editorName.cm.replaceSelection("\n"); - _editorName.cm.replaceSelection("```"); - var __Cursor = _editorName.cm.getDoc().getCursor(); - _editorName.cm.setCursor(__Cursor.line - 1, 0); - }); - - $("#" + _id + " [type=\"inline\"]").bind("click", function () { - _editorName.cm.replaceSelection("`$$$$`"); - var __Cursor = _editorName.cm.getDoc().getCursor(); - _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 3); - _editorName.cm.focus(); - }); - $("[type=\"inline\"]").attr("title", "行内公式"); - $("[type=\"latex\"]").attr("title", "多行公式"); - - if (__that.props.showNullButton) { - const NULL_CH = '▁' - // const NULL_CH = '〇' - // const NULL_CH = '🈳' - - $("#" + _id + " [type=\"nullBtton\"]").bind("click", function () { - _editorName.cm.replaceSelection(NULL_CH); - // var __Cursor = _editorName.cm.getDoc().getCursor(); - // _editorName.cm.setCursor(__Cursor.line - 1, 0); - }); - } - - if (noStorage == true) { - - } else { - md_elocalStorage(_editorName, `MDEditor__${_id}`, _id); - } - - callback && callback(_editorName) - } - }); - return editorName; -} - - -export default class TPMMDEditor extends Component { - constructor(props) { - super(props) - this.state = { - initValue: '' - } - } - componentDidUpdate(prevProps, prevState) { - // 不能加,影响了试卷填空题 - // if (this.props.initValue != prevProps.initValue) { - // this.answers_editormd.setValue(this.props.initValue) - // } - } - - // react_mdEditor_ - componentDidMount = () => { - const { mdID, initValue, placeholder, showNullButton} = this.props; - - let _id = `mdEditor_${mdID}` - this.contentChanged = false; - const _placeholder = placeholder || ""; - // amp; - // 编辑时要传memoId - const imageUrl = `${getUploadActionUrl()}`; - // 创建editorMd - let react_id = `react_${_id}`; - // 将实例存到了window - window[react_id] = this - const answers_editormd = create_editorMD(_id, '100%', this.props.height, _placeholder, imageUrl, (_editorName) => { - const __editorName = _editorName; - react_id = `react_${__editorName.id}`; - const that = window[react_id] - - // 一个延迟的recreate或resize,不加这段代码,md初始化可能会出现样式问题 - setTimeout(() => { - if (that.props.needRecreate == true) { - __editorName.recreate() // 注意 必须在setValue之前触发,不然会清空 - } else { - __editorName.resize() - } - console.log('timeout', __editorName.id) - __editorName.cm && __editorName.cm.refresh() - }, that.props.refreshTimeout || 500) - if (this.props.noSetValueOnInit) { - that.onEditorChange() - } else { - if (that.props.initValue != undefined && that.props.initValue != '') { - __editorName.setValue(that.props.initValue) - } - if (that.state.initValue) { - __editorName.setValue(that.state.initValue) - } - } - - __editorName.cm.on("change", (_cm, changeObj) => { - that.contentChanged = true; - if (that.state.showError) { - that.setState({showError: false}) - } - that.onEditorChange() - }) - that.props.onCMBlur && __editorName.cm.on('blur', () => { - that.props.onCMBlur() - }) - that.props.onCMBeforeChange && __editorName.cm.on('beforeChange', (cm,change) => { - that.props.onCMBeforeChange(cm,change) - }) - that.answers_editormd = __editorName; - // 这里应该可以去掉了,方便调试加的 - window[__editorName.id+'_'] = __editorName; - }, initValue, this.onEditorChange,this.props.watch, { - noStorage: this.props.noStorage, - showNullButton: this.props.showNullButton, - emoji: this.props.emoji - }, this); - - } - // 用在form里时,validate失败时出现一个红色边框 - showError = () => { - this.setState({showError: true}) - } - onEditorChange = () => { - if (!this.answers_editormd) return; - const val = this.answers_editormd.getValue(); - //console.log('onEditorChange', this.props.id, val) - try { - this.props.onChange && this.props.onChange(val) - } catch(e) { - // http://localhost:3007/courses/1309/common_homeworks/6566/setting - // 从这个页面,跳转到编辑页面,再在编辑页面点击返回的时候,这里会报错 - console.error('出错') - console.error(e) - } - } - resize = () => { - if (!this.answers_editormd) { // 还未初始化 - return; - } - this.answers_editormd.resize() - this.answers_editormd.cm && this.answers_editormd.cm.refresh() - this.answers_editormd.cm.focus() - } - - getValue = () => { - try { - return this.answers_editormd.getValue() - } catch (e) { - return '' - } - } - setValue = (val) => { - try { - this.answers_editormd.setValue(val) - } catch (e) { - // TODO 这里多实例的时候,前一个实例的state会被后面这个覆盖 参考NewWork.js http://localhost:3007/courses/1309/homework/9300/edit/1 - // 未初始化 - this.setState({ initValue: val }) - } - } - - render() { - - let { - showError - } = this.state; - let { mdID, className, noStorage, imageExpand } = this.props; - let _style = {} - if (showError) { - _style.border = '1px solid red' - } - return ( - -
    - {/* padding10-20 */} -
    - -
    -
    -
    -
    -
    - {noStorage == true ? ' ' :
     
    } - {/* {noStorage == true ? ' ' :

     

    } */} -
    -
    - ) - } -} - - diff --git a/public/react/src/modules/tpm/challengesnew/TPManswer2.js b/public/react/src/modules/tpm/challengesnew/TPManswer2.js deleted file mode 100644 index 596dcc910..000000000 --- a/public/react/src/modules/tpm/challengesnew/TPManswer2.js +++ /dev/null @@ -1,353 +0,0 @@ -import React, {Component} from 'react'; - -import {Input, InputNumber, Button, Tooltip} from 'antd'; - -import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; - -import axios from 'axios'; - -import TPMMDEditor from './TPMMDEditor'; - -import Bottomsubmit from "../../modals/Bottomsubmit"; - -import './css/TPMchallengesnew.css'; - -const $ = window.$; - - - -export default class TPManswer extends Component { - constructor(props) { - super(props) - this.state = { - choice_url: undefined, - practice_url: undefined, - go_back_url: undefined, - value: 1, - answer:"", - id:undefined, - checkpointId:undefined, - power: false, - prev_challenge: undefined, - next_challenge: undefined, - answers: [] //testAnswers - } - } - - componentDidMount() { - let id = this.props.match.params.shixunId; - let checkpointId=this.props.match.params.checkpointId; - - let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; - let newpractice_url= "/shixuns/"+id+"/challenges/new"; - let newgo_back_url="/shixuns/"+id+"/challenges"; - this.setState({ - shixunId:id, - checkpointId:checkpointId - }) - - - let url = "/shixuns/" + id + "/challenges/" + checkpointId + "/edit.json?tab=2"; - axios.get(url).then((response) => { - let newprev_challenge = response.data.prev_challenge; - let next_challenge = response.data.next_challenge; - if (newprev_challenge != undefined) { - if(newprev_challenge.st===0){ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; - }else{ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion"; - } - } - if (next_challenge != undefined) { - - if(next_challenge.st===0){ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint"; - }else{ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion"; - } - } - this.setState({ - answer:response.data.answer, - power: response.data.power, - choice_url: newchoice_url, // 导航中的新建选择题url - practice_url: newpractice_url, //string 导航中新建实践题url - go_back_url: newgo_back_url, //string 导航中的返回url - position: response.data.position, //int 关卡位置,导航栏中的第几关 - prev_challenge: newprev_challenge, - next_challenge: next_challenge, - responsedata:response.data, - }) - - if(response.data.power===false){ - this.props.showNotification("没有权限修改"); - } - // if(response.data.answer===undefined||response.data.answer===null){ - // this.answerMD("", "answerMD"); - // }else{ - // this.answerMD(response.data.answer, "answerMD"); - // } - - }).catch((error) => { - console.log(error) - }); - - - let urlAnswer = `/shixuns/${id}/challenges/${checkpointId}/answer.json`; - axios.get(urlAnswer).then((response) => { - if (response.data.status === 401) { - - } else if (response.data) { - this.setState({ answers: response.data }) - } - }) - } - - challenge_answer_submit=()=> { - // `levelSection${index}` - // this.refs.md0 - const { answers } = this.state; - const answersParams = answers.slice(0) - // console.log(answersParams) - let isValidate = true; - let totalScore = 0; - answersParams.forEach( (item, index) => { - if (!isValidate) { - return; - } - const sectionId = `#levelSection${index}`; - const mdContnet = this.refs[`md${index}`].getValue().trim();; - item.contents = mdContnet; - item.name = item.name.trim() - totalScore += item.score; - delete item.id; - if (!item.name) { - this.props.showNotification("请先填写参考答案名称"); - isValidate = false; - } else if (!mdContnet) { - this.props.showNotification("请先填写参考答案内容"); - isValidate = false; - } - if (!isValidate) { - $("html, body").animate({ scrollTop: $(`${sectionId}`).offset().top - 100}) - } - }) - if (!isValidate) { - return; - } - if (answersParams.length != 0 && totalScore != 100) { - this.props.showNotification("请先保证占比和为100%"); - return; - } - let id = this.props.match.params.shixunId; - let {checkpointId} = this.state; - let url = `/shixuns/${id}/challenges/${checkpointId}/crud_answer.json`; - - axios.post(url,{ - challenge_answer: answersParams - } - ).then((response) => { - if (response.data) { - if (response.data.message) { - this.props.showNotification(response.data.message); - } - if (response.data.status == 1) { - window.location.href=`/shixuns/${id}/challenges`; - // $("html").animate({ scrollTop: 0 }) - } - } - - }).catch((error) => { - console.log(error) - }); - } - onNameChange = (e, index) => { - const newAnswer = Object.assign({}, this.state.answers[index]) - newAnswer.name = e.target.value - const newAnswers = this.state.answers.slice(0) - newAnswers[index] = newAnswer - this.setState({ answers: newAnswers}) - } - onScoreChange = (val, index) => { - const newAnswer = Object.assign({}, this.state.answers[index]) - newAnswer.score = val - const newAnswers = this.state.answers.slice(0) - newAnswers[index] = newAnswer - this.setState({ answers: newAnswers}) - } - answerOnChange = (val, index) => { - if (!this.state.answers[index]) { - // 1、2、3删除2会走到这里 - return; - } - const newAnswer = Object.assign({}, this.state.answers[index]) - newAnswer.contents = val - const newAnswers = this.state.answers.slice(0) - newAnswers[index] = newAnswer - this.setState({ answers: newAnswers}) - } - addAnswer = () => { - const newAnswers = this.state.answers.slice(0) - newAnswers.push({ - "name": `解题思路${newAnswers.length + 1}`, - "contents": "", - "score": 10 - }) - this.setState({ answers: newAnswers }) - } - - delanswers=(index)=>{ - let {answers}=this.state; - let newanswers=answers; - newanswers.splice(index,1) - this.setState({ - answers:newanswers - }, () => { - for(let i = index; i < newanswers.length; i ++) { - this.refs[`md${i}`].setValue(newanswers[i].contents) - } - }) - } - - gotocheckpoint=(url)=>{ - this.props.history.replace(url); - } - render() { - - let { - choice_url, - practice_url, - responsedata, - position, - task_pass_default, - submit_url, - shixunId, - checkpointId, - power, - prev_challenge, - next_challenge, - answers, - } = this.state; - let tab1url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/editcheckpoint"; - let tab2url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=2"; - let tab3url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=3"; - // console.log(this.props) - return ( - -
    -
    - 第{position}关:{responsedata&&responsedata.st === 0 ?"实践题":responsedata&&responsedata.st === 1?"选择题":""} - {this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"": - } - {this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"": - } - {next_challenge===undefined?"": - } - {prev_challenge===undefined?"": - } -
    - -
    -
  • - 1、本关任务 -
  • - {tab2url === "" ? "":
  • >
  • } -
  • - 2、评测设置 -
  • - {tab3url === "" ? "":
  • >
  • } -
  • - 3、参考答案 -
  • -
    - -
    - -
    -

    - 可以将参考答案分级设置,让学员自行选择级别,每级查看后按照比例扣分值(学员已完成任务再查看,则不影响学员已获得的成绩) -

    -

    -

    示例:级别1,扣减分值占比25%;级别2,扣减分值占比35%;级别3,扣减分值占比40%;
    -
    若学员选择查看级别1的答案,将被扣减25%的分值;选择查看级别2的答案,将被扣减60%的分值;选择查看级别3的答案,将被扣减100%的分值。
    -

    - - - - { - answers.map((answer, index) => { - return
    - * -

    级别:{index + 1}

    - - this.delanswers(index)}> - - - -
    -
    -
    -
    名称:
    -
    扣减分值占比:
    -
    -
    - this.onNameChange(e, index)}> - - - this.onScoreChange(e, index)} > % -
    -
    -
    - 内容: - this.answerOnChange(val, index)}> -
    -
    -
    - }) - } - -
    4||this.props.identity===undefined||power===false?"none":"block"}}> - {/*新增参考答案*/} - -
    -
    - - -
    - -
    - - {this.props.identity>4||this.props.identity===undefined||power===false?"":
    - {/*提交*/} - {/*/!*取消*!/*/} - {/*取消*/} - -
    } -
    - ) - } -} - - diff --git a/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js b/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js deleted file mode 100644 index b0deafd95..000000000 --- a/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js +++ /dev/null @@ -1,774 +0,0 @@ -import React, {Component} from 'react'; - -import {Input, Select, Radio, Badge, message, Button} from 'antd'; - -import {Link} from "react-router-dom"; - -import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; - -import Bottomsubmit from "../../modals/Bottomsubmit"; - -import axios from 'axios'; - -import './css/TPMchallengesnew.css'; - -const $ = window.$; - -const Option = Select.Option; - -const RadioGroup = Radio.Group; - -function isNulltpm( str ){ - if ( str == "" ) return true; - var regu = "^[ ]+$"; - var re = new RegExp(regu); - return re.test(str); -} - -export default class TPMchallengesnew extends Component { - constructor(props) { - super(props) - this.exercisememoMDRef=React.createRef(); - this.state = { - choice_url: undefined, - practice_url: undefined, - go_back_url: undefined, - task_pass_default: undefined, - submit_url: undefined, - shixunCreatePracticeGroup: undefined, - optionsums:[100,200], - activetype:0, - setopen: false, - shixunCreatePractice: undefined, - onshixunsmarkvalue: undefined, - shixunsskillvalue: undefined, - shixunsskillvaluelist: [], - tab2url: "", - tab3url: "", - prev_challenge:undefined, - next_challenge:undefined, - power: false, - shixunCreatePracticetype: false, - shixunsskillvaluelisttype: false, - marktype:false, - editPracticesendtype:false, - CreatePracticesendtype:false, - exec_time:20, - shixunExec_timeType:false, - onshixunsmarkvaluetype:false, - shixunCreatePracticeGrouptype:false - } - } - - getdatas=()=>{ - let id = this.props.match.params.shixunId; - let checkpointId=this.props.match.params.checkpointId; - - let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; - let newpractice_url= "/shixuns/"+id+"/challenges/new"; - let newgo_back_url="/shixuns/"+id+"/challenges" - if(checkpointId===undefined){ - //新建模式 - let url = "/shixuns/" + id + "/challenges/new.json" - axios.get(url).then((response) => { - this.setState({ - choice_url: newchoice_url, - practice_url: newpractice_url, - go_back_url: newgo_back_url, - position: response.data.position, - task_pass_default: response.data.task_pass_default, - submit_url: response.data.submit_url, - checkpointId:checkpointId, - exercisememoMDRefval:response.data.task_pass_default, - responsedata:response.data - }) - - this.exercisememoMDRef.current.setValue(response.data.task_pass_default||'') - }).catch((error) => { - console.log(error) - }); - }else{ - //编辑模式 - let url="/shixuns/"+id+"/challenges/"+checkpointId+".json?tab=0"; - axios.get(url).then((response) => { - - let optionsum; - if(response.data.difficulty===1){ - optionsum=[100,200]; - }else if(response.data.difficulty===2){ - optionsum=[300,400,500,600]; - }else if(response.data.difficulty===3){ - optionsum=[700,800,900,1000] - } - let newprev_challenge=response.data.prev_challenge; - let next_challenge=response.data.next_challenge; - if (newprev_challenge != undefined) { - if(newprev_challenge.st===0){ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; - }else{ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion"; - } - } - if (next_challenge != undefined) { - if(next_challenge.st===0){ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint"; - }else{ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion"; - } - } - this.setState({ - power: response.data.power, - prev_challenge:newprev_challenge, - next_challenge:next_challenge, - choice_url: newchoice_url, - practice_url: newpractice_url, - go_back_url: newgo_back_url, - shixunCreatePractice:response.data.subject, - position:response.data.position, - shixunCreatePracticeGroup:response.data.difficulty, - optionsums:optionsum, - onshixunsmarkvalue:response.data.score, - shixunsskillvaluelist:response.data.tags, - checkpointId:checkpointId, - tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2", - tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3", - exercisememoMDRefval:response.data.task_pass, - responsedata:response.data - }) - // exec_time:response.data.exec_time, - if(response.data.power===false){ - this.props.showNotification("你没有权限修改"); - - } - - this.exercisememoMDRef.current.setValue(response.data.task_pass||'') - }).catch((error) => { - console.log(error) - }); - - } - - } - componentDidUpdate=(prevProps, prevState)=>{ - if(prevProps!=this.props){ - this.getdatas() - } - } - componentDidMount() { - this.getdatas() - } - - onshixunCreatePracticeChange = (e) => { - if(e.target.value===undefined||e.target.value=== ""||e.target.value=== null){ - - }else{ - this.setState({ - shixunCreatePracticeGrouptype:false, - onshixunsmarkvaluetype:false - }) - } - let optionsum; - let onshixunsmark; - if(e.target.value===1){ - optionsum=[100,200]; - onshixunsmark=100; - }else if(e.target.value===2){ - optionsum=[300,400,500,600]; - onshixunsmark=300; - }else if(e.target.value===3){ - optionsum=[700,800,900,1000] - onshixunsmark=700; - } - this.setState({ - shixunCreatePracticeGroup: e.target.value, - optionsums:optionsum, - onshixunsmarkvalue:onshixunsmark - }) - } - - shixunCreatePractice = (e) => { - - if (e.target.value === undefined|| e.target.value== ""){ - - }else{ - this.setState({ - shixunCreatePracticetype:false - }) - } - this.setState({ - shixunCreatePractice: e.target.value - }) - - } - - CreatePracticesend = () => { - const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim(); - - this.setState({ - CreatePracticesendtype:true - }) - - if(this.props.status===2){ - this.props.showNotification("该实训已经发布不能新建") - this.setState({ - CreatePracticesendtype:false - }) - return - } - let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,exec_time} = this.state; - - - if (shixunCreatePractice === undefined||shixunCreatePractice=="") { - this.setState({ - shixunCreatePracticetype: true, - CreatePracticesendtype:false - }) - - $('html').animate({ - scrollTop: 10 - }, 1000); - - return - } - - if (shixunCreatePractice.match(/^[ ]*$/)) { - this.props.showNotification("任务名称为空,请勿输入空格"); - this.setState({ - shixunCreatePracticetype: true, - CreatePracticesendtype:false - }) - $('html').animate({ - scrollTop: 10 - }, 1000); - return - } - - - if (exercise_editormdvalue === undefined||exercise_editormdvalue==""||exercise_editormdvalue===null) { - this.setState({ - tpmcourseMessageMDType:true, - CreatePracticesendtype:false - }) - this.props.scrollToAnchor("tpmcourseMessageMD"); - return - } - - if(isNulltpm(exercise_editormdvalue)){ - this.setState({ - tpmcourseMessageMDType:true, - CreatePracticesendtype:false - }) - this.props.scrollToAnchor("tpmcourseMessageMD"); - return - } - - - if(shixunCreatePracticeGroup===undefined){ - this.setState({ - shixunCreatePracticeGrouptype:true, - CreatePracticesendtype:false - }) - this.props.scrollToAnchor("shixunCreatePracticeGroupid"); - return - } - - if(onshixunsmarkvalue===undefined){ - this.setState({ - onshixunsmarkvaluetype:true, - CreatePracticesendtype:false - }) - this.props.scrollToAnchor("input_task_tag"); - return - } - if (shixunsskillvaluelist.length === 0) { - this.setState({ - shixunsskillvaluelisttype: true, - CreatePracticesendtype:false - }) - // this.props.showNotification("技能标签为空") - this.props.scrollToAnchor("input_task_tag"); - return - } - - - // if(exec_time===null||exec_time===undefined||exec_time === ""){ - // this.setState({ - // shixunExec_timeType:true, - // CreatePracticesendtype:false - // }) - // this.props.scrollToAnchor("exec_time"); - // return - // } - - // if (exec_time.match(/^[ ]*$/)) { - // this.props.showNotification("评测时限,请勿输入空格"); - // this.setState({ - // shixunExec_timeType:true, - // CreatePracticesendtype:false - // }) - // this.props.scrollToAnchor("exec_time"); - // return - // } - - - - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/challenges.json"; - // exec_time:exec_time - axios.post(url, { - identifier:id, - subject: shixunCreatePractice, - task_pass: exercise_editormdvalue, - difficulty: shixunCreatePracticeGroup, - score: onshixunsmarkvalue, - challenge_tag: shixunsskillvaluelist, - st: 0, - }).then((response) => { - if (response.data.status === 1) { - // $("html").animate({ scrollTop: 0 }) - //window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/editcheckpoint?tab=2`; - // window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/tab=2`; - this.props.history.replace(`/shixuns/${id}/challenges/${response.data.challenge_id}/tab=2`); - // this.setState({ - // setopen: true, - // CreatePracticesendtype:false, - // tab2url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2", - // tab3url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3", - // }) - - } - // this.props.showNotification(response.data.messages); - }).catch((error) => { - console.log(error) - }); - - - - } - - onshixunsmark = (value) => { - this.setState({ - onshixunsmarkvalue: value - }) - } - - shixunsskill = (e) => { - this.setState({ - shixunsskillvalue: e.target.value - }) - } - - clickshixunsskill = () => { - - let {shixunsskillvalue, shixunsskillvaluelist} = this.state; - if (shixunsskillvalue === "") { - return - } else if (shixunsskillvalue === undefined) { - return - } - - if(shixunsskillvalue == "" || shixunsskillvalue == undefined || shixunsskillvalue == null || (shixunsskillvalue.length>0 && shixunsskillvalue.trim().length == 0)){ - message.error("输入为空,不能保存!"); - return - } - - let list = shixunsskillvaluelist; - list.push(shixunsskillvalue); - - if (list.length> 0) { - this.setState({ - shixunsskillvaluelisttype: false, - }) - } - this.setState({ - shixunsskillvaluelist: list, - shixunsskillvalue: "" - }) - } - - delshixunsskilllist = (key) => { - let {shixunsskillvaluelist} = this.state; - let newshixunsskillvaluelist = shixunsskillvaluelist; - newshixunsskillvaluelist.splice(key, 1); - this.setState({ - shixunsskillvaluelist: newshixunsskillvaluelist - }) - } - - editPracticesend=()=>{ - this.setState({ - editPracticesendtype:true - }) - let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,checkpointId,exec_time} = this.state; - let id = this.props.match.params.shixunId; - let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json"; - const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim(); - - if (shixunCreatePractice === undefined||shixunCreatePractice=="") { - this.setState({ - shixunCreatePracticetype: true, - editPracticesendtype:false - }) - // this.props.showNotification("任务名称为空") - $('html').animate({ - scrollTop: 10 - }, 1000); - - return - } - - if (shixunCreatePractice.match(/^[ ]*$/)) { - this.props.showNotification("任务名称为空,请勿输入空格"); - this.setState({ - shixunCreatePracticetype: true, - editPracticesendtype:false - }) - $('html').animate({ - scrollTop: 10 - }, 1000); - return - } - - if (exercise_editormdvalue === undefined||exercise_editormdvalue==""||exercise_editormdvalue===null) { - this.setState({ - tpmcourseMessageMDType:true, - editPracticesendtype:false - }) - this.props.scrollToAnchor("tpmcourseMessageMD"); - return - } - - if(isNulltpm(exercise_editormdvalue)){ - this.setState({ - tpmcourseMessageMDType:true, - editPracticesendtype:false - }) - this.props.scrollToAnchor("tpmcourseMessageMD"); - this.props.showNotification("过关任务,请勿输入空格"); - return - } - - if(shixunCreatePracticeGroup===undefined){ - this.setState({ - shixunCreatePracticeGrouptype:true, - editPracticesendtype:false - }) - this.props.scrollToAnchor("shixunCreatePracticeGroupid"); - return - } - if(onshixunsmarkvalue===undefined){ - this.setState({ - onshixunsmarkvaluetype:true, - editPracticesendtype:false - }) - this.props.scrollToAnchor("input_task_tag"); - return - } - - if (shixunsskillvaluelist.length === 0) { - this.setState({ - shixunsskillvaluelisttype: true, - editPracticesendtype:false, - }) - this.props.scrollToAnchor("input_task_tag"); - return - } - - // if(exec_time===null||exec_time===undefined||exec_time === ""){ - // this.setState({ - // shixunExec_timeType:true, - // editPracticesendtype:false - // }) - // this.props.scrollToAnchor("exec_time"); - // return - // } - - // if (exec_time.match(/^[ ]*$/)) { - // this.props.showNotification("评测时限,请勿输入空格"); - // this.setState({ - // shixunExec_timeType:true, - // editPracticesendtype:false - // }) - // this.props.scrollToAnchor("exec_time"); - // return - // } - // exec_time:exec_time - axios.put(url, { - tab:0, - identifier:id, - id:checkpointId, - challenge:{ - subject: shixunCreatePractice, - task_pass: exercise_editormdvalue, - difficulty: shixunCreatePracticeGroup, - score: onshixunsmarkvalue, - }, - challenge_tag:shixunsskillvaluelist - }).then((response) => { - this.props.showNotification(response.data.messages); - if (response.data.status === 1) { - // window.location.href=`/shixuns/${id}/challenges/${checkpointId}/tab=2`; - this.setState({ - setopen: true, - editPracticesendtype:false, - tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2", - tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3", - }) - this.props.history.replace(`/shixuns/${id}/challenges/${checkpointId}/tab=2`); - // window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2" - } - }).catch((error) => { - console.log(error) - }); - - - } - - onshixunsmarks=()=> { - this.setState({ - marktype:true - }) - } - - onshixunsmarkss=()=> { - this.setState({ - marktype:false - }) - } - - setexec_time=(e)=>{ - this.setState({ - exec_time:e.target.value - }) - } - - gotocheckpoint=(url)=>{ - this.props.history.replace(url); - } - render() { - - let shixuntype = this.props.match.params.type; - - - let {responsedata, - shixunCreatePracticetype, shixunsskillvaluelisttype, - choice_url, practice_url, go_back_url, position, task_pass_default, submit_url, setopen,checkpointId,prev_challenge,next_challenge,power, - shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvalue, shixunsskillvaluelist, tab2url, tab3url,optionsums, - CreatePracticesendtype,editPracticesendtype - } = this.state; - - let options; - if(optionsums!=undefined){ - options = optionsums.map((d, k) => { - return ( - - ) - }) - } - - // console.log(this.props) - // console.log(this.state) - //a console.log(shixunCreatePractice) - - return ( - -
    -
    - 第{position}关:{responsedata&&responsedata.st === 0 ?"实践题":responsedata&&responsedata.st === 1?"选择题":""} - {this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"": - } - {this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"": - } - {next_challenge===undefined?"": - } - {prev_challenge===undefined?"": - } -
    - -
    - -
  • - 1、本关任务 -
  • - {tab2url === "" ? "":
  • >
  • } -
  • - {tab2url === "" ? : 2、评测设置} -
  • - {tab3url === "" ? "":
  • >
  • } -
  • - {tab3url === "" ? : 3、参考答案} -
  • -
    - -
    -
    -

    *名称

    -
    -
    - -
    -
    - 必填项:不能为空 -
    -
    -
    -
    - - -
    - -

    *过关任务

    - - - -

    -

    - - {this.state.tpmcourseMessageMDType===true?
    必填项:不能为空
    :""} -
    - - -
    -

    - * - 难度系数: - - 简单 - 中等 - 困难 - - {this.state.shixunCreatePracticeGrouptype===true?

    - 必选项:不能为空
    :""} -

    -

    * 奖励经验值: (如果学员答题正确,将获得相应的经验值;如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+100经验值、+100金币)

    -
    - {this.state.onshixunsmarkvaluetype===true?:""} - - {this.state.onshixunsmarkvaluetype===true?
    - 必选项:不能为空
    :""} -
    -
    - - -
    -

    *技能标签: (学员答题正确将获得技能,否则不能获得技能)

    -
    -
    - -
    (回车添加标签)
    -
    - { - shixunsskillvaluelist===undefined?"":shixunsskillvaluelist.length === 0 ? "" : shixunsskillvaluelist.map((itme, key) => { - return ( -
  • - this.delshixunsskilllist(key)}> - - -
  • - ) - }) - } -
    -
    -
    必选项:不能为空
    -
    -
    - - {/*
    */} - {/*

    * 服务配置:评测时限(S)

    */} - {/*
    */} - {/*
    */} - {/* /!**!/*/} - {/* */} - {/*
    */} - {/* 必填项:不能为空
    */} - {/*
    */} - {/*
    */} - - -
    - {this.props.identity>4||this.props.identity===undefined?"":
    4||this.props.identity===undefined?"none":'block'}} - > - {/*{checkpointId===undefined?提交:*/} - {/*提交}*/} - {/*取消*/} - {/*取消*/} - this.CreatePracticesend():()=>this.editPracticesend()} - loadings={CreatePracticesendtype===true?true:editPracticesendtype===true?true:false}/> -
    } - - ) - } -} - - diff --git a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js b/public/react/src/modules/tpm/challengesnew/TPMevaluation.js deleted file mode 100644 index 7ff0942cc..000000000 --- a/public/react/src/modules/tpm/challengesnew/TPMevaluation.js +++ /dev/null @@ -1,1091 +0,0 @@ -import React, {Component} from 'react'; - -import {Input, Select, Radio, Checkbox, Modal,Button,Tooltip} from 'antd'; - -import { Link} from "react-router-dom"; - -import axios from 'axios'; - -import Bottomsubmit from "../../modals/Bottomsubmit"; - -import { getImageUrl } from 'educoder'; - -import './css/TPMchallengesnew.css'; - -const $ = window.$; - -const Option = Select.Option; - -const RadioGroup = Radio.Group; - -const { TextArea } = Input; - -function isNulltpm( str ){ - if ( str == "" ) return true; - var regu = "^[ ]+$"; - var re = new RegExp(regu); - return re.test(str); -} - -export default class TPMevaluation extends Component { - constructor(props) { - super(props) - this.state = { - choice_url: undefined, - practice_url: undefined, - go_back_url: undefined, - task_pass_default: undefined, - submit_url: undefined, - value: 1, - evaluationlist:[], - shixunId:undefined, - power:false, - shixunfilepath:undefined, - evaluationvisible:false, - trees:undefined, - path:"", - main:[], - saveshixunfilepath:undefined, - selectpath:undefined, - shixunfilepathplay:undefined, - shixunfileexpectpicturepath:undefined, - shixunfilestandardpicturepath:undefined, - shixunfilepicturepath:undefined, - pathoptionvalue:-1, - showrepositoryurltiptype: false, - prev_challenge: undefined, - next_challenge: undefined, - StudentTaskPapers:false, - StudentTaskDocs:false, - selectpatharr:[], - handpathopt:false, - scorevalue:false, - markvalue:true, - scoretype:undefined, - web_route:null, - exec_time:undefined - } - } - - componentDidMount() { - let id = this.props.match.params.shixunId; - let checkpointId=this.props.match.params.checkpointId; - this.setState({ - shixunId:id, - checkpointId:checkpointId - }) - let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; - let newpractice_url= "/shixuns/"+id+"/challenges/new"; - let newgo_back_url="/shixuns/"+id+"/challenges"; - - let url = "/shixuns/" + id + "/challenges/" + checkpointId + "/edit.json?tab=1"; - axios.get(url).then((response) => { - let newprev_challenge = response.data.prev_challenge; - let next_challenge = response.data.next_challenge; - if (newprev_challenge != undefined) { - if(newprev_challenge.st===0){ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; - }else{ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion"; - } - } - if (next_challenge != undefined) { - - if(next_challenge.st===0){ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint"; - }else{ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion"; - } - } - let newevaluationlist=[] - if(response.data.test_sets.length===0){ - let newlist=[ - {hidden:0,input:"",output:"",score:100}, - ] - newevaluationlist=newlist - }else{ - newevaluationlist=response.data.test_sets - } - - this.setState({ - power: response.data.power, - evaluationlist:newevaluationlist, - shixunfilepath:response.data.path, - shixunfilepathplay:response.data.exec_path, - pathoptionvalue:response.data.show_type, - shixunfileexpectpicturepath:response.data.original_picture_path, - shixunfilestandardpicturepath:response.data.expect_picture_path, - shixunfilepicturepath:response.data.picture_path, - prev_challenge: newprev_challenge, - next_challenge: next_challenge, - choice_url: newchoice_url, // 导航中的新建选择题url - practice_url: newpractice_url, //string 导航中新建实践题url - go_back_url: newgo_back_url, //string 导航中的返回url - position: response.data.position, //int 关卡位置,导航栏中的第几关 - scorevalue:response.data.test_set_score, - markvalue:response.data.test_set_average, - web_route:response.data.web_route, - has_web_route:response.data.has_web_route, - responsedata:response.data, - exec_time:response.data.exec_time, - }) - this.evaluationoninputvalueonload(); - if(response.data.power===false){ - this.props.showNotification("你没有权限修改"); - } - - - }).catch((error) => { - console.log(error) - }); - - } - - - setevaluationlist=(newevaluationlist)=>{ - this.setState({ - evaluationlist:newevaluationlist - }) - console.log(newevaluationlist) - } - - - addevaluationon=()=>{ - let {evaluationlist,markvalue}=this.state; - let newevaluationlist=evaluationlist; - newevaluationlist.push({hidden:0,input:"",output:"",score:0,match_rule:"full"}); - newevaluationlist=this.oneditevaluationlist(newevaluationlist,markvalue); - this.setevaluationlist(newevaluationlist); - } - - del_test_array=(key)=>{ - let {evaluationlist,markvalue}=this.state; - let newevaluationlist=evaluationlist; - newevaluationlist.splice(key,1); - newevaluationlist=this.oneditevaluationlist(newevaluationlist,markvalue); - this.setevaluationlist(newevaluationlist); - } - - getfilepath=(e,shixunfilepath,type)=>{ - this.setState({ - evaluationvisible: true, - selectpath:e.target.value, - selectpatharr:[], - pathtype:type - }); - let id = this.props.match.params.shixunId; - let url ="/shixuns/"+id+"/repository.json"; - axios.post(url,{ - path: "" - }).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - this.setState({ - trees:response.data.trees, - saveshixunfilepath:shixunfilepath, - path:"", - main:[], - }) - } - - }).catch((error) => { - console.log(error) - }); - } - - sendgetfilepath=(newpath,type,newpathtype)=>{ - let id = this.props.match.params.shixunId; - let{path,main,pathtype}=this.state; - let ary=main; - let paths=path; - - this.setState({ - selectpatharr:[], - }) - if(paths===""&&type==="tree"){ - newpath=newpath+"/"; - paths=""; - if(main.length===0){ - ary.push({val:"根目录/",path:""},{val:newpath,path:paths+newpath}) - }else{ - ary.push({val:newpath,path:paths+newpath}) - } - - }else if(paths!=""&&type==="tree"){ - newpath=newpath+"/"; - ary.push({val:newpath,path:paths+newpath}) - } - - - let url ="/shixuns/"+id+"/repository.json"; - if(type==="tree"){ - - axios.post(url,{ - path: paths+newpath - }).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - this.setState({ - trees:response.data.trees, - path:paths+newpath, - main:ary, - // selectpath:"" - }) - } - - }).catch((error) => { - console.log(error) - }); - } - - if(pathtype===2){ - this.setState({ - selectpath: newpathtype, - }) - } - } - - goblakepath=(path,key)=>{ - let {main,selectpath,pathtype} =this.state; - let newmain=[] - for(var i=0;i<=key;i++){ - newmain.push(main[i]) - } - let id = this.props.match.params.shixunId; - let url ="/shixuns/"+id+"/repository.json"; - axios.post(url,{ - path: path - }).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else { - this.setState({ - trees: response.data.trees, - path: path, - main: newmain, - // selectpath:selectpath - }) - } - }).catch((error) => { - console.log(error) - }); - - if(pathtype===2){ - let paths = path.substring(0,path.length-1); - console.log(paths) - this.setState({ - selectpath: paths, - }) - } - - - } - - savegetfilepath=(value)=>{ - let {selectpath,saveshixunfilepath,pathtype} = this.state - - if(pathtype===1){ - let newselectpath; - - if(saveshixunfilepath==="shixunfilepathplay"){ - newselectpath=value - }else{ - const type = selectpath.split(';'); - let types=false; - for(var i=0; i{ - let {saveshixunfilepath,selectpath}=this.state; - this.setState({ - evaluationvisible: false, - [saveshixunfilepath]:selectpath - }); - } - evaluationhideModal=()=>{ - this.setState({ - evaluationvisible: false, - }); - } - handpathoptionvalue=(value)=>{ - this.setState({ - pathoptionvalue:value, - shixunfileexpectpicturepath:undefined, - shixunfilestandardpicturepath:undefined, - shixunfilepicturepath:undefined - }) - } - showrepositoryurltip=(type)=>{ - if(type===1){ - this.setState({ - showrepositoryurltiptype:true - }) - }else{ - this.setState({ - showrepositoryurltiptype:false - }) - } - } - - evaluationonChange=(e,key)=>{ - let {evaluationlist}=this.state; - let newevaluationlist=evaluationlist; - let newtype; - if(e===1){ - newtype=0; - }else{ - newtype=1; - } - newevaluationlist[key].hidden=newtype; - - this.setState({ - evaluationlist:newevaluationlist - }) - this.setevaluationlist(newevaluationlist); - } - - // 填写分数百分比 - editpercentage=(e,key)=>{ - let {evaluationlist,scoretype}=this.state; - - if(scoretype===key){ - this.setState({ - scoretype:undefined - }) - } - let newevaluationlist=evaluationlist; - let sum =parseInt(e.target.value); - if(isNaN(sum)){ - sum=0 - } - newevaluationlist[key].score=sum; - - this.setState({ - evaluationlist:newevaluationlist, - markvalue:false - }) - this.setevaluationlist(newevaluationlist); - } - - // 修改测试集的匹配规则 - changeEvaluationRule=(e,key)=>{ - let {evaluationlist}=this.state; - let newevaluationlist=evaluationlist; - newevaluationlist[key].match_rule=e.target.value - this.setevaluationlist(newevaluationlist); - } - - evaluationoninputvalue=(e,key,type)=>{ - $.fn.autoHeight = function(){ - function autoHeight(elem){ - elem.style.height = 'auto'; - elem.style.maxHeight = '140px'; - elem.scrollTop = 0; //防抖动 - elem.style.height = elem.scrollHeight + 'px'; - } - this.each(function(){ - autoHeight(this); - $(this).on('keyup', function(){ - autoHeight(this); - }); - }); - } - $('textarea[autoHeight]').autoHeight(); - - let {evaluationlist}=this.state; - let newevaluationlist=evaluationlist; - if(type==="sr"){ - newevaluationlist[key].input=e.target.value - }else if(type==="yq"){ - // 统一转成\r\n - newevaluationlist[key].output= e.target.value ? e.target.value.replace(/\r?\n/g, "\r\n") : e.target.value - } - this.setevaluationlist(newevaluationlist); - } - - - evaluationoninputvalueonload=()=>{ - $.fn.autoHeight = function(){ - function autoHeight(elem){ - elem.style.height = 'auto'; - elem.style.maxHeight = '140px'; - elem.scrollTop = 0; //防抖动 - elem.style.height = elem.scrollHeight + 'px'; - } - this.each(function(){ - autoHeight(this); - $(this).on('keyup', function(){ - autoHeight(this); - }); - }); - } - $('textarea[autoHeight]').autoHeight(); - } - submitarbitrationevaluation=()=>{ - let{exec_time,evaluationlist,shixunfilepath,shixunfilepathplay,shixunfileexpectpicturepath,shixunfilestandardpicturepath,shixunfilepicturepath,pathoptionvalue,scorevalue,markvalue,web_route}=this.state; - - - let newscorevalue; - if(scorevalue===false){ - newscorevalue=false - }else{ - //判断占比 - newscorevalue=true - - let sum=0; - for(var i=0; i100){ - this.props.showNotification("测试集的评分占比不能大于100"); - this.setState({ - scoretype:i - }) - return - } - sum=sum+evaluationlist[i].score - } - - if(sum>100||sum<100){ - this.props.showNotification("测试集的评分占比之和必须等于100"); - return - } - - - } - - - if(exec_time===null||exec_time===undefined||exec_time === ""){ - this.setState({ - shixunExec_timeType:true, - }) - this.props.scrollToAnchor("exec_timeid"); - return - } - - if (isNulltpm(exec_time)) { - this.props.showNotification("评测时长,请勿输入空格"); - this.setState({ - shixunExec_timeType:true, - }) - this.props.scrollToAnchor("exec_timeid"); - return - } - - if(shixunfilepath===undefined||shixunfilepath===""||shixunfilepath===null){ - // this.props.showSnackbar("学员任务文件路径为空"); - this.setState({ - StudentTaskPapers:true - }) - this.props.scrollToAnchor("Studenttaskfile"); - return - } - - if(shixunfilepathplay===undefined||shixunfilepathplay===""||shixunfilepathplay===null){ - // this.props.showSnackbar("评测执行文件路径为空"); - this.setState({ - StudentTaskDocs:true - }) - this.props.scrollToAnchor("Benchmarkexecutable"); - return - } - - if(evaluationlist.length===0){ - this.props.showSnackbar("测试集不能为空"); - this.props.scrollToAnchor("Thetestset"); - return - } - let id = this.props.match.params.shixunId; - let{checkpointId}=this.state; - let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json"; - let newchallenge={ - path:shixunfilepath, - exec_path:shixunfilepathplay, - show_type:pathoptionvalue, - original_picture_path:pathoptionvalue===-1?undefined:shixunfileexpectpicturepath===undefined?null:shixunfileexpectpicturepath, - expect_picture_path:pathoptionvalue===-1?undefined:shixunfilestandardpicturepath===undefined?null:shixunfilestandardpicturepath, - picture_path:pathoptionvalue===-1?undefined:shixunfilepicturepath===undefined?null:shixunfilepicturepath, - test_set_score:newscorevalue, - test_set_average:markvalue, - web_route:web_route===null?undefined:web_route, - exec_time:exec_time - } - axios.put(url,{ - tab:1, - challenge:newchallenge, - test_set:evaluationlist - } - ).then((response) => { - this.props.showNotification(response.data.messages); - window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/tab=3`; - // if(response.data.status===1){ - // window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3" - // } - }).catch((error) => { - console.log(error) - }); - } - - saveselectpath=(e)=>{ - - this.setState({ - selectpath:e.target.value - }) - - } - updatepath=(e,name,type)=>{ - this.setState({ - [name]:e.target.value, - pathtype:type - }) - } - - - oneditevaluationlist=(newevaluationlist,markvalue)=>{ - - if(markvalue===true){ - if(100%newevaluationlist.length===0){ - let sum=100/newevaluationlist.length; - for(var i=0; i{ - - let {markvalue,evaluationlist}=this.state; - let newevaluationlist=evaluationlist; - - if(e.target.value===true){ - newevaluationlist=this.oneditevaluationlist(newevaluationlist,markvalue) - } - - this.setState({ - scorevalue: e.target.value, - evaluationlist:newevaluationlist - }); - - this.setevaluationlist(newevaluationlist); - } - - //均匀比例 - onChangemarkvalue=(e)=>{ - let {evaluationlist}=this.state; - - if(e.target.value===true){ - let newevaluationlist=evaluationlist; - newevaluationlist=this.oneditevaluationlist(newevaluationlist,e.target.value); - this.setevaluationlist(newevaluationlist); - } - - this.setState({ - markvalue: e.target.value, - }); - - } - - updatewebroute=(e)=>{ - this.setState({ - web_route:e.target.value - }) - } - - gotocheckpoint=(url)=>{ - this.props.history.replace(url); - } - - setexec_time=(e)=>{ - if(e.target.value===null||e.target.value===undefined||e.target.value === ""||e.target.value.match(/^[ ]*$/)){ - - }else{ - this.setState({ - shixunExec_timeType:false, - }) - } - this.setState({ - exec_time:e.target.value - }) - } - - render() { - - let { - choice_url, - practice_url, - go_back_url, - position, - evaluationlist, - shixunId, - checkpointId, - power, - shixunfileexpectpicturepath, - shixunfilestandardpicturepath, - shixunfilepicturepath, - shixunfilepath, - evaluationvisible, - trees, - path, - main, - selectpath, - shixunfilepathplay, - pathoptionvalue, - showrepositoryurltiptype, - prev_challenge, - next_challenge, - StudentTaskPapers, - StudentTaskDocs, - web_route, - scorevalue, - markvalue, - scoretype, - has_web_route, - responsedata - } = this.state; - - let tab1url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/editcheckpoint"; - let tab2url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=2"; - let tab3url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=3"; - // console.log(this.props) - const radioStyle = { - display: 'block', - height: '30px', - lineHeight: '30px', - marginLeft: '20px', - }; - - return ( - -
    -
    - 第{position}关:{responsedata&&responsedata.st === 0 ?"实践题":responsedata&&responsedata.st === 1?"选择题":""} - {this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"": - } - {this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"": - } - {next_challenge===undefined?"": - } - {prev_challenge===undefined?"": - } -
    - -
    -
  • - 1、本关任务 -
  • - {tab2url === "" ? "":
  • >
  • } -
  • - 2、评测设置 -
  • - {tab3url === "" ? "":
  • >
  • } -
  • - 3、参考答案 -
  • -
    - -

    -

    - 请先上传本关任务的所有代码文件、标准图片等所有必要的文件到 - 版本库 -
    -

    - -
    -

    * 评测时长限制(程序评测运行时间限制时长,单位:秒)

    -
    -
    - -
    -
    必填项:不能为空
    -
    -
    - - -
    -
    -

    * 评测效果展现方式(学员评测本关任务时,查看效果页上需要展现的文件类型)

    -
    - - this.showrepositoryurltip(1)}> -
    - -
    -

    - 图片:处理或输出图片类型的任务,请选填此项
    - 可以通过设置图片路径和学员答案文件路径,展示代码对应的图片效果

    - apk/exe:写可执行文件的任务,请选填此项
    - 可以通过设置学员答案文件路径,展示二维码以供扫码下载

    - txt:输出txt文档类型的任务,请选填此项
    - 可以通过学员答案文件路径设置,展示txt文件内容

    - html:web类型的任务,请选填此项
    - 可以通过Web路由设置,展示html效果预览页

    - mp3/mp4:mp3/mp4文件类型的任务,请选填此项
    - 可以通过学员答案文件路径设置,展示mp3/mp4文件内容

    -

    -

    this.showrepositoryurltip(2)} - >知道了 -

    -
    -
    -
    -
    - - -
    -
    -

    * 学员任务文件(该文件将直接显示给学生,需要学生在其中填写代码)

    -
    -
    - this.updatepath(e,"shixunfilepath",1)} - onClick={(e)=>this.getfilepath(e,"shixunfilepath",1)} - /> -
    -
    - 必选项:不能为空 -
    -
    -
    -
    - - - - -
    -
    - -
    - - this.saveselectpath(e)} - value={selectpath}/> -
    - - this.evaluationenter()}>确定 - this.evaluationhideModal()}>取消 -
    -
    -
    - -
    -
    -

    *评测执行文件(若执行平台脚本,请输入学员任务文件路径;若使用自己设计的脚本测试学生代码,请输入设计的脚本文件路径)

    -
    -
    - this.updatepath(e,"shixunfilepathplay",1)} - onClick={(e)=>this.getfilepath(e,"shixunfilepathplay",1)} - /> -
    -
    - - 必选项:不能为空 - -
    -
    -
    -
    - - {pathoptionvalue===4&&web_route!=null||pathoptionvalue===4&&has_web_route===true?
    -
    -

    Web路由(请注意将服务器程序的端口号映射到8080端口)

    -
    -
    - this.updatewebroute(e)} - placeholder="网站类型实训,请填写Web路由地址。例:java/mypage"/> -
    -
    -
    -
    :""} - - {pathoptionvalue===1||pathoptionvalue===5||pathoptionvalue===6?
    -
    -

    待处理文件路径(该路径下的文件将在学员评测本关任务时,作为原始文件显示在查看效果页,供学员参考;请注意与程序文件所在文件夹分开)

    -
    -
    - this.updatepath(e,"shixunfileexpectpicturepath",2)} - onClick={(e)=>this.getfilepath(e,"shixunfileexpectpicturepath",2)} - /> -
    -
    -
    -
    -
    :""} - - - {pathoptionvalue===1||pathoptionvalue===5||pathoptionvalue===6?
    -
    -

    标准答案文件路径(该路径下的文件将在学员评测本关任务时,作为参考答案显示在查看效果页,供学员参考;请注意与程序文件所在文件夹分开)

    -
    -
    - this.updatepath(e,"shixunfilestandardpicturepath",2)} - onClick={(e)=>this.getfilepath(e,"shixunfilestandardpicturepath",2)} - /> -
    -
    -
    -
    -
    :""} - - - {pathoptionvalue===-1?"":
    -
    -

    学员答案文件路径(学员评测本关任务时生成的文件将保存在该路径下,并作为实际输出显示在查看效果页,供学员确认;请注意与程序文件所在文件夹分开)

    -
    -
    - this.updatepath(e,"shixunfilepicturepath",2)} - onClick={(e)=>this.getfilepath(e,"shixunfilepicturepath",2)} - placeholder="请在版本库中指定用来保存学员代码实际输出结果的路径。例:src/step1/outputfiles"/> -
    -
    -
    -
    -
    } - - -
    -
    - {/*

    测试集

    */} -

    测试集和系统评分规则

    -

    - 得分规范: - - - 通过全部测试集 - (学员评测,仅当所有测试集都正确时,才获得一次性奖励) - - - 通过部分测试集 - (学员评测,当至少有一组测试集正确时,即可获得其对应比例的奖励) - -

    - -

    - - 系统评分占比: - - 均分比例 - 自定义比例 - - - -

    - -
    -
    - -
    - - {evaluationlist===undefined?"":evaluationlist.length===0?"":evaluationlist.map((item,key)=>{ - return( -
    -

    - * - 组{key+1} - - {/*checked={item.is_public===1?false:true}*/} - - this.editpercentage(e,key)} - value={item.score} /> - % - - - this.evaluationonChange(item.hidden,key)} checked={item.hidden===1?true:false}>隐藏(选中则对学员隐藏本测试集内容) - - - -

    this.del_test_array(key)}> - -
    - -

    - - -
    - 匹配规则: - this.changeEvaluationRule(e,key)}> - 完全匹配(实际输出与预期输出完全相同) - 末尾匹配(实际输出的末尾内容与预期输出完全相同) - -
    -
    - ) - })} - -
    -
    - -

    - -

    - -

    温馨提示:公开测试集和隐藏测试集结合使用,可以降低作弊的几率;隐藏测试集,在“提交评测”时也将被系统自动检测

    -
    -
    -
    - -
    - - {this.props.identity>4||this.props.identity===undefined||power===false?"":
    - {/*提交*/} - {/*/!*取消*!/*/} - {/*取消*/} - -
    } -
    - ) - } -} - - diff --git a/public/react/src/modules/tpm/challengesnew/TPMquestion.js b/public/react/src/modules/tpm/challengesnew/TPMquestion.js deleted file mode 100644 index b76e17b17..000000000 --- a/public/react/src/modules/tpm/challengesnew/TPMquestion.js +++ /dev/null @@ -1,1052 +0,0 @@ -import React, {Component} from 'react'; - -import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Tooltip,notification} from 'antd'; - -import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; - -// import "antd/dist/antd.css"; - -import axios from 'axios'; - -import { getImageUrl, toPath } from 'educoder'; - -import './css/TPMchallengesnew.css'; - -import {getUrl} from 'educoder'; - -import TpmQuestionMain from './TpmQuestionMain'; - -import TpmQuestionNew from './TpmQuestionNew'; - -import TpmQuestionEdit from './TpmQuestionEdit'; - -let origin = getUrl(); - -let path = getUrl("/editormd/lib/") - -const $ = window.$; - -const Option = Select.Option; - -const RadioGroup = Radio.Group; - -var letterArr = []; -for (var i = 65, j = 0; i < 91; i++, j++) { - letterArr[j] = String.fromCharCode(i); -} - - -export default class TPMquestion extends Component { - constructor(props) { - super(props) - this.contentMdRef = React.createRef(); - this.newquestioMDMdRef = React.createRef(); - this.newquestioMDMdCont=React.createRef(); - this.neweditanswerRef=React.createRef(); - this.editanswersRef=React.createRef(); - this.state = { - choice_url: undefined, - practice_url: undefined, - go_back_url: undefined, - position: undefined, - task_pass_default: undefined, - submit_url: undefined, - questionsInputvalue:undefined, - questionaddsum:0, - questionaddarray:[], - questionaddtype:true, - activetype:"", - questionlists:[{str:"A",val:"",type:false},{str:"B",val:"",type:false},{str:"C",val:"",type:false},{str:"D",val:"",type:false}], - answeshixunsGroup: 1, - answeoptions:[10,20], - answeonshixunsmark:10, - shixunssanswerkillvalue:"", - shixunsskillanswerlist:[], - challenge_id:"", - challenge_choose_id:undefined, - questionlistss:[], - newcnttype:false, - newquestioMDvaluetype:false, - challenge_tagtype:false, - editquestionaddtype:false, - mancheckpointId:undefined, - power:false, - questionInputvaluetype:false, - questioMD:"", - standard_answer:"", - subject:"", - newquestioMDvaluetypes:false, - questionInputvaluetypes:false, - prev_challenge:undefined, - next_challenge:undefined, - newcnttypesum:1, - marktype:false, - answer:"", - sumittype:false - } - } - - - questionInputvalue=(e)=>{ - this.setState({ - questionsInputvalue: e.target.value - }) - } - - componentDidMount() { - if(this.props.status===2){ - - } - let id = this.props.match.params.shixunId; - let checkpointId=this.props.match.params.checkpointId; - - this.setState({ - mancheckpointId:id, - }) - - let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; - let newpractice_url= "/shixuns/"+id+"/challenges/new"; - let newgo_back_url="/shixuns/"+id+"/challenges"; - - if(this.props.match.params.choose_id===undefined){ - if(checkpointId===undefined){ - //新建模式 - let nurl = "/shixuns/" + id + "/challenges/new.json" - axios.get(nurl).then((response) => { - - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else { - this.setState({ - choice_url: newchoice_url, - practice_url: newpractice_url, - go_back_url: newgo_back_url, - position: response.data.position, - task_pass_default: response.data.task_pass_default, - submit_url: response.data.submit_url, - power:true, - activetype:"first", - - }) - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - this.setState({ - contentMdRefval:"" - }) - } else { - - this.setState({ - contentMdRefval:response.data.task_pass_default - }) - this.contentMdRef.current.setValue(response.data.task_pass_default || '') - } - this.shixunsautoHeight() - } - - }).catch((error) => { - console.log(error) - }); - - }else{ - //编辑模式 - let url = "/shixuns/"+ id +"/challenges/"+checkpointId+"/edit.json?st=1" - axios.get(url).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else { - let newprev_challenge=response.data.prev_challenge; - let next_challenge=response.data.next_challenge; - if (newprev_challenge != undefined) { - if(newprev_challenge.st===0){ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; - }else{ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion"; - } - } - if (next_challenge != undefined) { - if(next_challenge.st===0){ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint"; - }else{ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion"; - } - } - this.setState({ - questionaddtype:false, - newquestionaddtype:false, - activetype:"first", - prev_challenge:newprev_challenge, - next_challenge:next_challenge, - questionsInputvalue:response.data.subject, - questionaddarray:response.data.chooses, - challenge_id:response.data.id, - mancheckpointId:checkpointId, - position: response.data.position, - choice_url: newchoice_url, - practice_url: newpractice_url, - go_back_url: newgo_back_url, - power:response.data.power, - // questioMD:response.data.task_pass, - answer:response.data.answer - - }) - - this.setState({ - contentMdRefval:response.data.task_pass - }) - // this.contentMdRef.current.setValue(response.data.task_pass || '') - if(response.data.chooses.length===0){ - // 新建选择题时,没法切回 ‘本关任务’ tab - // this.questionadd() - } - - this.shixunsautoHeight() - } - - }).catch((error) => { - console.log(error) - }); - } - - }else{ - $('html').animate({ - scrollTop:10 - }, 500); - - let{challenge_id} =this.state; - - let id = this.props.match.params.shixunId; - let url = "/shixuns/"+ id +"/challenges/"+checkpointId+"/edit.json?st=1" - axios.get(url).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else { - let newprev_challenge=response.data.prev_challenge; - let next_challenge=response.data.next_challenge; - if (newprev_challenge != undefined) { - if(newprev_challenge.st===0){ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; - }else{ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion"; - } - } - if (next_challenge != undefined) { - if(next_challenge.st===0){ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint"; - }else{ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion"; - } - } - this.setState({ - questionaddtype:false, - newquestionaddtype:false, - prev_challenge:newprev_challenge, - next_challenge:next_challenge, - questionsInputvalue:response.data.subject, - questionaddarray:response.data.chooses, - challenge_id:response.data.id, - mancheckpointId:checkpointId, - position: response.data.position, - choice_url: newchoice_url, - practice_url: newpractice_url, - go_back_url: newgo_back_url, - power:response.data.power, - // questioMD:response.data.task_pass, - - }) - - this.setState({ - contentMdRefval:response.data.task_pass - }) - // this.contentMdRef.current.setValue(response.data.task_pass || '') - if(response.data.chooses.length===0){ - this.questionadd() - } - this.shixunsautoHeight() - } - - }).catch((error) => { - console.log(error) - }); - - let zrl ='/shixuns/'+this.props.match.params.shixunId+'/challenges/'+this.props.match.params.checkpointId+'/edit_choose_question.json?choose_id='+this.props.match.params.choose_id; - axios.get(zrl).then((response) => { - if(response.status===200){ - let choose_contents=response.data.choose_contents; - let newchoose_contentslist=[] - for(var i=0; i { - }); - - } - } - - clickquestionsumit=()=>{ - this.setState({ - sumittype:true - }) - let checkpointId=this.props.match.params.checkpointId; - if(this.props.status===2&&checkpointId===undefined){ - this.props.showSnackbar("该实训已经发布不能新建") - this.setState({ - sumittype:false - }) - return - } - let {questionsInputvalue} =this.state; - // const exercise_editormdvalue = this.questio_editormd.getValue(); - const exercise_editormdvalue = this.contentMdRef.current.getValue().trim(); - let id = this.props.match.params.shixunId; - - if(questionsInputvalue===undefined||questionsInputvalue===null||questionsInputvalue===""){ - this.setState({ - questionInputvaluetype:true - }) - $('html').animate({ - scrollTop: 10 - }, 1000); - this.setState({ - sumittype:false - }) - return - } - - - if(exercise_editormdvalue===null ||exercise_editormdvalue===""){ - this.setState({ - questionInputvaluetypes:true - }) - $('html').animate({ - scrollTop: 500 - }, 1000); - this.setState({ - sumittype:false - }) - return - } - if(checkpointId===undefined){ - - let url = "/shixuns/" + id + "/challenges.json"; - - axios.post(url, { - identifier:id, - subject: questionsInputvalue, - task_pass: exercise_editormdvalue, - st: 1 - }).then((response) => { - this.props.showSnackbar(response.data.messages); - // if(response.data.status===1){ - // - // this.setState({ - // questionaddtype:false, - // challenge_id:response.data.challenge_id - // }) - // - // this.questionadd() - // } - window.location.href = '/shixuns/'+id+'/challenges/'+response.data.challenge_id+'/editquestion'; - - }).catch((error) => { - console.log(error) - }); - }else{ - let url ="/shixuns/"+id+"/challenges/"+checkpointId+".json"; - axios.put(url, { - tab:0, - subject: questionsInputvalue, - task_pass: exercise_editormdvalue, - }).then((response) => { - if(response.data.status===1){ - this.setState({ - questionaddtype:false, - challenge_id:response.data.challenge_id - }) - } - $('html').animate({ - scrollTop: 10 - }, 200); - this.props.showSnackbar(response.data.messages); - window.location.href = '/shixuns/'+id+'/challenges/'+response.data.challenge_id+'/editquestion'; - }).catch((error) => { - console.log(error) - }); - } - - } - - questionall=()=>{ - // this.setState({ - // activetype:"first", - // newquestionaddtype:false, - // editquestionaddtype:false, - // questionaddtype:false - // }) - - window.location.href = '/shixuns/'+this.props.match.params.shixunId+'/challenges/'+this.props.match.params.checkpointId+'/editquestion'; - } - questionadd=()=>{ - - let{questionaddarray}=this.state; - - let questionaddsums=questionaddarray.length; - - if(questionaddsums-1>9){ - this.props.showSnackbar("选择题目最大支持设置9道题") - return - } - - let questionaddarrays=questionaddarray; - - questionaddarrays.map((item,key)=>{ - if(item.choose_id===0){ - questionaddarrays.splice(key,1) - } - }) - - questionaddarrays.push({type:0,choose_id:0}); - this.setState({ - activetype:0, - questionaddarray:questionaddarrays, - questionaddtype:true, - editquestionaddtype:false, - newquestionaddtype:true, - questionlists:[{str:"A",val:"",type:false},{str:"B",val:"",type:false},{str:"C",val:"",type:false},{str:"D",val:"",type:false}], - answeshixunsGroup: 1, - answeoptions:[10,20], - answeonshixunsmark:10, - shixunssanswerkillvalue:"", - shixunsskillanswerlist:[], - contentMdRefval:"", - newquestioMDMdContval:"", - }) - - - setTimeout(() => { - this.newquestioMDMdRef.current.setValue('') - }, 1000) - setTimeout(() => { - this.newquestioMDMdCont.current.setValue('') - }, 1500) - // this.shixunsautoHeight() - } - - editquestionlists=(newquestionlists)=>{ - let newlist=newquestionlists; - let list=[] - for(var i=0; i{ - let{questionlists} = this.state; - let newquestionlists=questionlists; - let newli={str:letterArr[questionlists.length],val:"",type:false}; - newquestionlists.push(newli); - this.editquestionlists(newquestionlists); - } - - - delquestionlists=(key)=>{ - let{questionlists} = this.state; - let newquestionlists=questionlists; - newquestionlists.splice(key,1); - for(var i=0; i{ - let{questionlists} = this.state; - let newquestionlists=questionlists; - if(newquestionlists[key].type===true){ - newquestionlists[key].type=false; - }else if(newquestionlists[key].type===false){ - newquestionlists[key].type=true; - } - - this.editquestionlists(newquestionlists); - } - - onshixunGroupanswe=(e)=> { - let optionsum; - let onshixunsmark; - if(e.target.value===1){ - optionsum=[10,20]; - onshixunsmark=10; - }else if(e.target.value===2){ - optionsum=[30,40,50,60]; - onshixunsmark=30; - }else if(e.target.value===3){ - optionsum=[70,80,90,100] - onshixunsmark=70; - } - this.setState({ - answeshixunsGroup: e.target.value, - answeoptions:optionsum, - answeonshixunsmark:onshixunsmark - }) - } - shixunssanswerkill = (e) => { - this.setState({ - shixunssanswerkillvalue: e.target.value - }) - - } - clickshixunsanswerskill = () => { - - let {shixunssanswerkillvalue, shixunsskillanswerlist} = this.state; - if (shixunssanswerkillvalue === "") { - return - } else if (shixunssanswerkillvalue === undefined) { - return - } - - if(shixunssanswerkillvalue == "" || shixunssanswerkillvalue == undefined || shixunssanswerkillvalue == null || (shixunssanswerkillvalue.length>0 && shixunssanswerkillvalue.trim().length == 0)){ - message.error("输入为空,不能保存!"); - return - } - - let list = shixunsskillanswerlist; - list.push(shixunssanswerkillvalue); - this.setState({ - shixunsskillanswerlist: list, - shixunssanswerkillvalue: "" - }) - } - delshixunssnswerllist=(key)=>{ - let {shixunsskillanswerlist} = this.state; - let newshixunsskillanswerlist = shixunsskillanswerlist; - newshixunsskillanswerlist.splice(key, 1); - this.setState({ - shixunsskillanswerlist: newshixunsskillanswerlist - }) - } - onInputoquestionption=(e,key)=>{ - - $.fn.autoHeight = function(){ - function autoHeight(elem){ - elem.style.height = 'auto'; - elem.style.maxHeight = '140px'; - elem.scrollTop = 0; //防抖动 - elem.style.height = elem.scrollHeight + 'px'; - } - this.each(function(){ - autoHeight(this); - $(this).on('keyup', function(){ - autoHeight(this); - }); - }); - } - $("#"+e.target.id).autoHeight(); - - let {questionlists}=this.state; - let newquestionlists=questionlists; - newquestionlists[key].val=e.target.value; - this.editquestionlists(newquestionlists); - } - - onshixunsansweSelect=(value)=>{ - this.setState({ - answeonshixunsmark: value - }) - } - - answer_subit=(sumtype,challenge_choose_id)=>{ - $('html').animate({ - scrollTop:10 - }, 500); - - let {challenge_id,questionlists,shixunsskillanswerlist,answeonshixunsmark,answeshixunsGroup,questionaddarray} =this.state; - if(challenge_id===undefined){ - message.error("关卡id为空"); - return - } - let newquestionlists=questionlists; - let newlist=""; - let newtype=[]; - let newcnt=[]; - let list=0; - for(var i=0; i { - console.log(error) - }); - }else{ - - let newquestioMDvalue = this.newquestioMDMdRef.current.getValue().trim(); - if(newquestioMDvalue===""||newquestioMDvalue==="请输入选择题的题干内容"){ - this.setState({ - newquestioMDvaluetype:true, - }) - $('html').animate({ - scrollTop:100 - }, 200); - message.error("题干为空"); - return - } - let newnewanswerMDvalue = this.newquestioMDMdCont.current.getValue().trim(); - - if(newnewanswerMDvalue===""||newnewanswerMDvalue===" "){ - newnewanswerMDvalue=undefined - } - url="/shixuns/" + id + "/challenges/" + challenge_id + "/create_choose_question.json"; - axios.post(url, { - challenge_choose: {subject: newquestioMDvalue, answer: newnewanswerMDvalue, standard_answer:newlist , score: answeonshixunsmark, difficult: answeshixunsGroup}, - challenge_tag: shixunsskillanswerlist, - question: {cnt: newcnt}, - choice: {answer: newtype} - }).then((response) => { - - let questionaddsums=questionaddarray.length; - let questionaddarrays=questionaddarray; - questionaddarrays[questionaddsums-1].choose_id=response.data.challenge_choose_id; - if(newlist.length===1){ - questionaddarrays[questionaddsums-1].type=1; - }else if(newlist.length>1){ - questionaddarrays[questionaddsums-1].type=2; - } - this.setState({ - challenge_choose_id:response.data.challenge_choose_id, - questionaddtype:false, - editquestionaddtype:false, - newquestioMDvaluetype:false, - newquestioMDvaluetypes:false, - questionaddarray:questionaddarrays - }) - $('html').animate({ - scrollTop: 10 - }, 200); - - notification.open({ - message: '提示', - description: - '新建成功,请点击右侧加号继续添加', - }); - window.location.href=`/shixuns/${id}/challenges/${checkpointId}/editquestion/${response.data.challenge_choose_id}`; - - // this.getanswer_subitlist() - // this.gochooseid("/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+response.data.challenge_choose_id) - }).catch((error) => { - console.log(error) - }); - } - - - } - - questionlist=(key,challenge_choose_id,type)=>{ - $('html').animate({ - scrollTop:10 - }, 500); - - let{challenge_id} =this.state; - - if(challenge_choose_id===""||type===0){ - - - // this.neweditanswerRef.current.setValue('') - // this.editanswersRef.current.setValue('') - this.setState({ - activetype:challenge_choose_id, - editquestionaddtype:true, - questionaddtype:true, - newquestionaddtype:false, - questionlists:[{str:"A",val:"",type:false},{str:"B",val:"",type:false},{str:"C",val:"",type:false},{str:"D",val:"",type:false}], - answeshixunsGroup: 1, - answeoptions:[10,20], - answeonshixunsmark:10, - shixunssanswerkillvalue:"", - shixunsskillanswerlist:[], - neweditanswerRefval:'', - editanswersRefval:'' - }) - this.newquestioMDMdRef.current.setValue('') - this.newquestioMDMdCont.current.setValue('') - }else{ - let id = this.props.match.params.shixunId; - let url ='/shixuns/'+id+'/challenges/'+challenge_id+'/edit_choose_question.json?choose_id='+challenge_choose_id; - axios.get(url).then((response) => { - if(response.status===200){ - let choose_contents=response.data.choose_contents; - let newchoose_contentslist=[] - for(var i=0; i { - }); - - } - - } - - shixunsautoHeight=()=>{ - $.fn.autoHeight = function(){ - function autoHeight(elem){ - elem.style.height = 'auto'; - elem.style.maxHeight = '140px'; - elem.scrollTop = 0; //防抖动 - if(elem.scrollHeight===0){ - elem.style.height = 62 + 'px'; - }else{ - - elem.style.height = elem.scrollHeight + 'px'; - } - - } - this.each(function(){ - autoHeight(this); - $(this).on('keyup', function(){ - autoHeight(this); - }); - }); - } - $('textarea[autoHeight]').autoHeight(); - } - - gochooseid=(url)=>{ - window.location.href =url - // window.location.Reload(url) - // this.props.history.replace( url ); - // this.props.history.push( url ); - // 返回 - // this.props.history.goBack(); - } - - render() { - - let {choice_url, - practice_url, - go_back_url, - position, - answeoptions, - questionaddarray, - questionaddtype, - activetype, - newquestionaddtype, - editquestionaddtype, - challenge_choose_id, - prev_challenge, - next_challenge, - answer, - - } = this.state; - - let options; - - - options = answeoptions.map((d, k) => { - return ( - - ) - }) - - return ( - -
    - - -
    - - -
  • - 本关任务 -
  • -
    - - { - questionaddarray.length===0?"":questionaddarray.map((item,key)=>{ - return( -
  • this.questionlist(key,item.choose_id,item.type):""} - > - - { - item.choose_id!=0? - this.gochooseid("/shixuns/"+this.props.match.params.shixunId+"/challenges/"+this.props.match.params.checkpointId+"/editquestion"+"/"+item.choose_id)}> - {key+1}.{item.type===2?"多选题":item.type===1?"单选题":'选择题'} - :activetype==="first"?"":{key+1}.{item.type===2?"多选题":item.type===1?"单选题":'选择题'} - } - -
  • - ) - }) - } - - -
  • - - + - -
  • - -
    - - {/*x选择题首页*/} - {activetype==="first"?this.questionInputvalue(e)} - clickquestionsumit={(e)=>this.clickquestionsumit(e)} - - />:""} - - {/*新建*/} - - {newquestionaddtype===true? - this.selquestionlists(key)} - onInputoquestionption={(e,key)=>this.onInputoquestionption(e,key)} - delquestionlists={(key)=>this.delquestionlists(key)} - addquestionlists={(e)=>this.addquestionlists(e)} - onshixunGroupanswe={(e)=>this.onshixunGroupanswe(e)} - onshixunsansweSelect={(e)=>this.onshixunsansweSelect(e)} - shixunssanswerkill={(e)=>this.shixunssanswerkill(e)} - clickshixunsanswerskill={(e)=>this.clickshixunsanswerskill(e)} - delshixunssnswerllist={(key)=>this.delshixunssnswerllist(key)} - answer_subit={()=>this.answer_subit()} - />:""} - - - {/*修改*/} - {editquestionaddtype===true? - this.selquestionlists(key)} - onInputoquestionption={(e,key)=>this.onInputoquestionption(e,key)} - delquestionlists={(key)=>this.delquestionlists(key)} - addquestionlists={(e)=>this.addquestionlists(e)} - onshixunGroupanswe={(e)=>this.onshixunGroupanswe(e)} - onshixunsansweSelect={(e)=>this.onshixunsansweSelect(e)} - shixunssanswerkill={(e)=>this.shixunssanswerkill(e)} - clickshixunsanswerskill={(e)=>this.clickshixunsanswerskill(e)} - delshixunssnswerllist={(key)=>this.delshixunssnswerllist(key)} - answer_subit={()=>this.answer_subit("edit",challenge_choose_id)} - /> - :""} - -
    -
    - ) - } -} - diff --git a/public/react/src/modules/tpm/challengesnew/TpmQuestionEdit.js b/public/react/src/modules/tpm/challengesnew/TpmQuestionEdit.js deleted file mode 100644 index ccf22057f..000000000 --- a/public/react/src/modules/tpm/challengesnew/TpmQuestionEdit.js +++ /dev/null @@ -1,233 +0,0 @@ -import React, {Component} from 'react'; - -import {Input, Select, Radio,Button, Badge, message, Modal,Tooltip} from 'antd'; - -import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; - -import axios from 'axios'; - -import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; - -const Option = Select.Option; - -const RadioGroup = Radio.Group; - -export default class TpmQuestionEdit extends Component { - constructor(props) { - super(props) - this.state = { - - } - } - - componentDidMount() { - - } - delecbtns=()=>{ - let url=`/shixuns/${this.props.match.params.shixunId}/challenges/${this.props.match.params.checkpointId}/destroy_challenge_choose.json`; - axios.delete((url), { data: { - choose_id:this.props.match.params.choose_id - }}) - .then((result)=>{ - if(result.data.status===1){ - window.location.href=`/shixuns/${this.props.match.params.shixunId}/challenges/${this.props.match.params.checkpointId}/editquestion`; - } - }) - } - - render() { - - return ( -
    - -
    -
    -

    题干

    -
    - * -
    - -
    - - -
    - 必填项 -
    - -
    -

    -

    -
    - { - this.props.questionlists===undefined||this.props.questionlists.length===0?"":this.props.questionlists.map((item,key)=>{ - return( -
  • - - - this.props.delquestionlists(key)}> - - -
  • - ) - }) - } -

    - this.props.addquestionlists()} - className="fl edu-default-btn edu-greyline-btn mb20 option_icon_add">新增选项 - - - {this.props.newcnttypesum===0?"请选择答案":"选项内容不能为空"} - -

    -
  • - - -
  • -
    -
    -
    - - -
    -
    -

    参考答案

    -
    -
    - -
    -
    - 必填项 -
    -
    -

    -

    -
    -
    - -
    -

    难度系数

    -
    - - this.props.onshixunGroupanswe(e)}> - 简单 - 中等 - 困难 - - -
    -

    奖励经验值

    -
    - * - - -

    - 如果学员答题错误,则不能得到相应的经验值
    - 如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+10经验值、+10金币 -

    - - 必填项 -
    -
    - -
    -

    技能标签

    -
    - * -
    - this.props.shixunssanswerkill(e)} - value={this.props.shixunssanswerkillvalue} - onPressEnter={(e)=>this.props.clickshixunsanswerskill(e)} - onBlur={(e)=>this.props.clickshixunsanswerskill(e)} - /> - {/*+ 添加*/} -
    学员答题正确将获得技能,否则不能获得技能(回车添加标签) - - 必填项 - -
    -
    - - { - this.props.shixunsskillanswerlist.length === 0 ? "" : this.props.shixunsskillanswerlist.map((itme, key) => { - return ( -
  • - this.props.delshixunssnswerllist(key)}> - - -
  • - ) - }) - } - - -
    - -
    - -
    -
    - - -
    4||this.props.identity===undefined||this.props.power===false?"none":"block"}}> - this.props.answer_subit()}>提交 - {/*取消*/} - 取消 - this.delecbtns()} - className="delectshixuncdbtn fr">删除 -
    - -
    - - ) - } -} - - - diff --git a/public/react/src/modules/tpm/challengesnew/TpmQuestionMain.js b/public/react/src/modules/tpm/challengesnew/TpmQuestionMain.js deleted file mode 100644 index c4008f89c..000000000 --- a/public/react/src/modules/tpm/challengesnew/TpmQuestionMain.js +++ /dev/null @@ -1,84 +0,0 @@ -import React, {Component} from 'react'; - -import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; -import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; - - -export default class TpmQuestionMain extends Component { - constructor(props) { - super(props) - this.state = { - - } - } - - componentDidMount() { - - } - - - render() { - return ( -
    -
    -
    -

    任务名称

    -
    - * -
    - -
    -
    - 必填项 -
    -
    -
    -
    - - -
    -

    过关任务

    -
    - * -
    - -
    -
    - 必填项 -
    -
    -

    -

    -
    - - -
    4 || this.props.identity === undefined || this.props.power === false ? "none" : "block"}}> - 提交 - {/*取消*/} - 取消 -
    - -
    - - ) - } - } - - - diff --git a/public/react/src/modules/tpm/challengesnew/TpmQuestionNew.js b/public/react/src/modules/tpm/challengesnew/TpmQuestionNew.js deleted file mode 100644 index 602aa6d16..000000000 --- a/public/react/src/modules/tpm/challengesnew/TpmQuestionNew.js +++ /dev/null @@ -1,229 +0,0 @@ -import React, {Component} from 'react'; - -import {Input, Select, Radio, Checkbox, Popconfirm, Button, Badge,Tooltip} from 'antd'; - -import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; - -import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; - -import './css/newquestion.css'; - -const Option = Select.Option; - -const RadioGroup = Radio.Group; - -export default class TpmQuestionNew extends Component { - constructor(props) { - super(props) - this.state = { - - } - } - - componentDidMount() { - - } - - - render() { - // console.log( this.props.questionlists) - return ( -
    - -
    -
    -

    题干

    -
    - * -
    - -
    - - -
    - 必填项 -
    - -
    -

    -

    - - -
    - { - this.props.questionlists===undefined||this.props.questionlists.length===0?"":this.props.questionlists.map((item,key)=>{ - return( -
  • - - - this.props.delquestionlists(key)}> - - - - - -
  • - ) - }) - } -

    - this.props.addquestionlists()} - className="fl edu-default-btn edu-greyline-btn mb20 option_icon_add">新增选项 - - - {this.props.newcnttypesum===0?"请选择答案":"选项内容不能为空"} - -

    -
  • - - -
  • -
    -
    -
    - - -
    -
    -

    参考答案

    -
    -
    - -
    -
    - 必填项 -
    -
    -

    -

    - -
    -
    - -
    -

    难度系数

    -
    - - this.props.onshixunGroupanswe(e)} - > - 简单 - 中等 - 困难 - - -
    -

    奖励经验值

    -
    - * - - - -

    - 如果学员答题错误,则不能得到相应的经验值
    - 如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+10经验值、+10金币 -

    - - 必填项 -
    -
    - -
    -

    技能标签

    -
    - * -
    - this.props.shixunssanswerkill(e)} - value={this.props.shixunssanswerkillvalue} - onPressEnter={(e)=>this.props.clickshixunsanswerskill(e)} - onBlur={(e)=>this.props.clickshixunsanswerskill(e)} - /> - {/*+ 添加*/} -
    学员答题正确将获得技能,否则不能获得技能(回车添加标签) - - 必填项 - -
    -
    - - { - this.props.shixunsskillanswerlist.length === 0 ? "" : this.props.shixunsskillanswerlist.map((itme, key) => { - return ( -
  • - - this.props.delshixunssnswerllist(key)}> - - - -
  • - ) - }) - } - - -
    - -
    - -
    -
    - - -
    4||this.props.identity===undefined||this.props.power===false?"none":"block"}}> - 提交 - 取消 - {/*取消*/} -
    - -
    - - ) - } -} - - - diff --git a/public/react/src/modules/tpm/challengesnew/TpmTask/TpmTaskIndex.js b/public/react/src/modules/tpm/challengesnew/TpmTask/TpmTaskIndex.js deleted file mode 100644 index 5a64daf9e..000000000 --- a/public/react/src/modules/tpm/challengesnew/TpmTask/TpmTaskIndex.js +++ /dev/null @@ -1,55 +0,0 @@ -import React, {Component} from 'react'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import Loadable from 'react-loadable'; - -import Loading from "../../../../Loading"; - -import Bottomsubmit from "../../../modals/Bottomsubmit"; - - -const TPMchallengestask = Loadable({ - loader: () => import('../../challengesnew/TPMchallengesnew'), - loading: Loading, -}) - -export default class TpmTaskIndex extends Component { - constructor(props) { - super(props) - this.state = { - - } - } - - - componentDidMount() { - - } - - - render() { - // console.log(a.indexOf("vnc")) - // console.log(b.indexOf("vnc")) - - return ( - -
    - - {/*新建关卡*/} - () - }> - - {/*编辑关卡*/} - () - }> - -
    - - ); - } -} - - diff --git a/public/react/src/modules/tpm/challengesnew/css/TPMchallengesnew.css b/public/react/src/modules/tpm/challengesnew/css/TPMchallengesnew.css deleted file mode 100644 index a65c3b7fa..000000000 --- a/public/react/src/modules/tpm/challengesnew/css/TPMchallengesnew.css +++ /dev/null @@ -1,331 +0,0 @@ -.CodeMirror-scroll { - overflow: auto !important; - margin-bottom: -30px; - margin-right: -30px; - padding-bottom: 30px; - height: 100%; - outline: none; - position: relative; -} -a.white-btn.orange-btn:hover { - border: 1px solid #F06200; - color: #FFF !important; -} -.flex1 a.white-btn.orange-btn:hover { - border: 1px solid #F06200; - color: #FFF !important; -} - -/*.challenge_nav li a{*/ - /*color:#000 !important;*/ -/*}*/ - -.questionli{ - width: 95%; - margin-left: 37px; -} -#directory_file{ - height:200px; - overflow-y:auto; - background:#f5f5f5; - padding:10px; -} -.directory_filepath{ - width:120px; - text-align:left; -} - -a{ - text-decoration: none; - color: #05101a; -} -.repository_url_tippostion{ - position: absolute; - left: 22%; - width: 500px; - top: 100%; -} - -.top-black-trangleft { - display: block; - border-width: 8px; - position: absolute; - top: -16px; - /* right: 4px; */ - border-style: dashed solid dashed dashed; - border-color: transparent transparent rgba(5,16,26,0.6) transparent; - font-size: 0; - line-height: 0; -} - -#exercisememoMD .CodeMirror { - margin-top: 31px !important; - height: 370px !important; - /*width: 579px !important;*/ -} - -#exercisememoMD .editormd-preview { - top: 40px !important; - height: 370px !important; - width: 578px !important; -} -#exercisememoMD{ - /*height: 700px !important;*/ -} -#questioMD{ - /*width: 95% !important;*/ - height: 417px !important; - margin-left: 0% !important; -} - - -#questioMD .CodeMirror { - /*width: 550.5px !important;*/ - margin-top: 31px !important; - height: 374px !important; -} - -#questioMD .editormd-preview { - top: 40px !important; - height: 375px !important; - width: 550px !important; -} - -#newquestioMD .CodeMirror { - /*width: 549px !important;*/ - margin-top: 31px !important; - height: 364px !important; -} - -#newquestioMD .editormd-preview { - top: 40px !important; - height: 364px !important; - width: 578px !important; -} - -#challenge_choose_answer .CodeMirror { - margin-top: 31px !important; - height: 364px !important; - /*width: 578px !important;*/ -} - - -#challenge_choose_answer .editormd-preview { - top: 40px !important; - height: 364px !important; - width: 578px !important; -} - -#neweditanswer .CodeMirror { - margin-top: 31px !important; - height: 364px !important; - /*width: 549.5px !important;*/ -} - -#neweditanswer .editormd-preview { - top: 40px !important; - height: 364px !important; - width: 551px !important; -} - -#repository_url_tip { - top: 30px !important; - left: 249px !important; - width: 292px !important; -} - -#editanswers .CodeMirror{ - /*width: 548px !important;*/ - height: 358px !important; - margin-top: 30px !important; -} -#editanswers .editormd-preview{ - width: 578px !important; - height: 358px !important; - -} -#newquestioMDs .CodeMirror{ - /*width: 510px !important;*/ - height: 358px !important; - margin-top: 30px !important; -} - -#newquestioMDs .editormd-preview{ - width: 578px !important; - height: 358px !important; -} - -.choose_names{ - width: 80px; - margin-left: 20px; -} - -#answerMD .CodeMirror{ - /*width: 569px !important;*/ - height: 600px !important; - margin-top: 30px !important; -} - -#answerMD .editormd-preview{ - width: 578px !important; - height: 600px !important; -} - -#answerMD { - height: 600px !important; -} - -.textareavalue{ - width: 100%; - padding: 5px; - - box-sizing: border-box; -} -.greyInput{ - width: 107%; -} -.greyInpus{ - width: 100%; -} - -.pdr20{ - padding-right:20px; -} - -.winput-240-40s { - background-color: #F5F5F5; -} - - -.winput-240-40s:focus{ - background-color: #fff; -} -.input-100-45{ - background-color: #F5F5F5; -} -.input-100-45:focus{ - background-color: #fff; - } - -.wind100{ - width:100% !important; -} - -.color-bule-tip { - color: #5485f7 !important; -} -.martopf4{ - margin-top:-4px; -} - -.headdfgf{ - display: block; - width: 100px; - height: 30px; - line-height: 30px; - float: left; -} - -.color979797{ - color: #979797 !important; -} - -.border-left{ - width: 0; - height: 0; - border-bottom: 6px solid transparent; - border-right: 6px solid #cccbcb; - border-top: 6px solid transparent; - position: absolute; - left: 30px; - top: 12px; -} -.border-left span{ - display: block; - width: 0; - height: 0; - border-bottom: 6px solid transparent; - border-right: 6px solid #fff; - border-top: 6px solid transparent; - position: absolute; - left: 1px; - top: -6px; - z-index: 10; -} -.fillTip{ - position: absolute; - left: 36px; - top: 2px; - width: 125px; - font-size: 12px; - display: block; - padding: 5px; - border: 1px solid #eaeaea; - border-radius: 5px; - box-sizing: border-box; - height: 32px; - line-height: 20px; - font-family: "微软雅黑","宋体"; -} - -.borderbottomf4{ - border-bottom:1px solid #F4F4F4; -} - -.TPMchallengesnewtitles{ - height: 76px; - line-height: 56px; - padding: 10px 20px; -} - -.newpadding1020{ - padding: 20px 20px 20px; - box-sizing: border-box; -} -.newpadding02020{ - padding: 0px 20px 20px; -} -.mb10 { - margin-bottom: 10px !important; -} - -.tpmpointer{ - cursor: pointer; -} -.text-centers{text-align:center} -.bor25510211{ - width: 1180px; - height: 34px; - border: 1px solid rgba(255,102,1,1); - line-height: 34px; -} - -.padding1020tpms{ - padding: 10px 20px; - box-sizing: border-box; -} - -.bortopeeetpm{ - border-top: 1px solid #eee; -} - -.borbottomeeetpm { - border-bottom: 1px solid #eee; -} - -.height40pxtpm{ - height:40px -} - -.ml41{ - margin-left: 41px; -} - -.wind500height45{ - width: 500px; - height: 45px; -} - -.newaddswermargin{ - margin: 0 auto; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/challengesnew/css/newquestion.css b/public/react/src/modules/tpm/challengesnew/css/newquestion.css deleted file mode 100644 index 444ca8d16..000000000 --- a/public/react/src/modules/tpm/challengesnew/css/newquestion.css +++ /dev/null @@ -1,7 +0,0 @@ -.tpmpointer{ - cursor: pointer; -} -.Permanentban{ - color:#5091FF !important; - border-color: #5091FF !important; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/challengesnew/editorMD.js b/public/react/src/modules/tpm/challengesnew/editorMD.js deleted file mode 100644 index 26d21d86a..000000000 --- a/public/react/src/modules/tpm/challengesnew/editorMD.js +++ /dev/null @@ -1,122 +0,0 @@ -import React, {Component} from 'react'; - -import {getUrl,getUploadActionUrl} from 'educoder'; - -let path = getUrl("/editormd/lib/"); - -const $ = window.$; - -function create_editorMD(id, width, high, placeholder, imageUrl, callback) { - var editorName = window.editormd(id, { - width: width, - height: high, - path: path, // "/editormd/lib/" - - syncScrolling: "single", - tex: true, - tocm: true, - emoji: true, - taskList: true, - codeFold: true, - searchReplace: true, - htmlDecode: "style,script,iframe", - sequenceDiagram: true, - autoFocus: false, - toolbarIcons: function () { - // Or return editormd.toolbarModes[name]; // full, simple, mini - // Using "||" set icons align right. - return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"] - }, - toolbarCustomIcons: { - testIcon: "
    ", - testIcon1: "
    " - }, - //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。 - saveHTMLToTextarea: true, - // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标 - dialogMaskOpacity: 0.6, - placeholder: placeholder, - imageUpload: true, - imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], - imageUploadURL: imageUrl,//url - onload: function () { - // this.previewing(); - $("#" + id + " [type=\"latex\"]").bind("click", function () { - editorName.cm.replaceSelection("```latex"); - editorName.cm.replaceSelection("\n"); - editorName.cm.replaceSelection("\n"); - editorName.cm.replaceSelection("```"); - var __Cursor = editorName.cm.getDoc().getCursor(); - editorName.cm.setCursor(__Cursor.line - 1, 0); - }); - - $("#" + id + " [type=\"inline\"]").bind("click", function () { - editorName.cm.replaceSelection("`$$$$`"); - var __Cursor = editorName.cm.getDoc().getCursor(); - editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 3); - editorName.cm.focus(); - }); - $("[type=\"inline\"]").attr("title", "行内公式"); - $("[type=\"latex\"]").attr("title", "多行公式"); - - window.md_elocalStorage(editorName, `MemoQuestion_${id}`, `${id}Question`); - - callback && callback() - } - }); - return editorName; -} - - -export default class TPMeditorMD extends Component { - constructor(props) { - super(props) - - } - componentDidMount() { - - - } - - questioMD=(initValue, id)=> { - - this.contentChanged = false; - const placeholder = ""; -// amp; -// 编辑时要传memoId - // const imageUrl = `/upload_with_markdown?container_id=&container_type=Memo`; - const imageUrl = `${getUploadActionUrl()}`; -// 创建editorMd - - let questio_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => { - setTimeout(() => { - questio_editormd.resize() - questio_editormd.cm && questio_editormd.cm.refresh() - }, 500) - - if (initValue != undefined) { - questio_editormd.setValue(initValue) - } - questio_editormd.cm.on("change", (_cm, changeObj) => { - console.log('....contentChanged') - this.contentChanged = true; - }) - }); - this.questio_editormd = questio_editormd; - window.questio_editormd = questio_editormd; - - } - - componentWillReceiveProps(newProps) { - this.questioMD(newProps.value,newProps.id) - } - render() { - return ( -
    - -
    -
    -
    - ) - } -} diff --git a/public/react/src/modules/tpm/challengesnew/old/TPManswer.js b/public/react/src/modules/tpm/challengesnew/old/TPManswer.js deleted file mode 100644 index 350a5ca8d..000000000 --- a/public/react/src/modules/tpm/challengesnew/old/TPManswer.js +++ /dev/null @@ -1,367 +0,0 @@ -import React, {Component} from 'react'; - -import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd'; - -import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; - -// import "antd/dist/antd.css"; - -import { getImageUrl, getUploadActionUrl, getUrl } from 'educoder'; - -import axios from 'axios'; - -import '../css/TPMchallengesnew.css'; - -let origin = getUrl(); - -let path = getUrl("/editormd/lib/") - -const $ = window.$; - -let timeout; - -let currentValue; - -const Option = Select.Option; - -const RadioGroup = Radio.Group; - - -// 恢复数据 -function md_rec_data(k,mdu,id, editor){ - if(window.sessionStorage.getItem(k+mdu) !== null){ - editor.setValue(window.sessionStorage.getItem(k+mdu)); - md_clear_data(k,mdu,id); - } -} - -// 保存数据 -function md_add_data(k,mdu,d){ - window.sessionStorage.setItem(k+mdu,d); -} - -// 清空保存的数据 -function md_clear_data(k,mdu,id){ - window.sessionStorage.removeItem(k+mdu); - var id1 = "#e_tip_"+id; - var id2 = "#e_tips_"+id; - if(k == 'content'){ - $(id2).html(""); - }else{ - $(id1).html(""); - } -} - -function md_elocalStorage(editor,mdu,id){ - if (window.sessionStorage){ - var oc = window.sessionStorage.getItem('content'+mdu); - if(oc !== null ){ - console.log("#e_tips_"+id) - $("#e_tips_"+id).data('editor', editor); - var h = '您上次有已保存的数据,是否恢复 ? / 不恢复'; - $("#e_tips_"+id).html(h); - } - setInterval(function() { - var d = new Date(); - var h = d.getHours(); - var m = d.getMinutes(); - var s = d.getSeconds(); - h = h < 10 ? '0' + h : h; - m = m < 10 ? '0' + m : m; - s = s < 10 ? '0' + s : s; - if(editor.getValue().trim() != ""){ - md_add_data("content",mdu,editor.getValue()); - var id1 = "#e_tip_"+id; - var id2 = "#e_tips_"+id; - - $(id1).html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 "); - $(id2).html(""); - } - },10000); - - }else{ - $("#e_tip_"+id).after('您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!'); - } -} - - -function create_editorMD(id, width, high, placeholder, imageUrl, callback) { - var editorName = window.editormd(id, { - width: width, - height: high, - path: path, // "/editormd/lib/" - - syncScrolling: "single", - tex: true, - tocm: true, - emoji: true, - taskList: true, - codeFold: true, - searchReplace: true, - htmlDecode: "style,script,iframe", - sequenceDiagram: true, - autoFocus: false, - toolbarIcons: function () { - // Or return editormd.toolbarModes[name]; // full, simple, mini - // Using "||" set icons align right. - return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"] - }, - toolbarCustomIcons: { - testIcon: "
    ", - testIcon1: "
    " - }, - //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。 - saveHTMLToTextarea: true, - // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标 - dialogMaskOpacity: 0.6, - placeholder: placeholder, - imageUpload: true, - imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], - imageUploadURL: imageUrl,//url - onload: function () { - // this.previewing(); - $("#" + id + " [type=\"latex\"]").bind("click", function () { - editorName.cm.replaceSelection("```latex"); - editorName.cm.replaceSelection("\n"); - editorName.cm.replaceSelection("\n"); - editorName.cm.replaceSelection("```"); - var __Cursor = editorName.cm.getDoc().getCursor(); - editorName.cm.setCursor(__Cursor.line - 1, 0); - }); - - $("#" + id + " [type=\"inline\"]").bind("click", function () { - editorName.cm.replaceSelection("`$$$$`"); - var __Cursor = editorName.cm.getDoc().getCursor(); - editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 3); - editorName.cm.focus(); - }); - $("[type=\"inline\"]").attr("title", "行内公式"); - $("[type=\"latex\"]").attr("title", "多行公式"); - - md_elocalStorage(editorName, `answers__${id}`, "Memoanswers"); - - callback && callback() - } - }); - return editorName; -} - - -export default class TPManswer extends Component { - constructor(props) { - super(props) - this.state = { - choice_url: undefined, - practice_url: undefined, - go_back_url: undefined, - value: 1, - answer:"", - id:undefined, - checkpointId:undefined, - power: false, - prev_challenge: undefined, - next_challenge: undefined, - } - } - - answerMD(initValue, id) { - - this.contentChanged = false; - const placeholder = ""; - // amp; - // 编辑时要传memoId - const imageUrl = `${getUploadActionUrl()}`; - // 创建editorMd - - const answers_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => { - setTimeout(() => { - answers_editormd.resize() - answers_editormd.cm && answers_editormd.cm.refresh() - }, 500) - - if (initValue != undefined) { - answers_editormd.setValue(initValue) - } - answers_editormd.cm.on("change", (_cm, changeObj) => { - console.log('....contentChanged') - this.contentChanged = true; - }) - }); - this.answers_editormd = answers_editormd; - window.answers_editormd = answers_editormd; - - } - - componentDidMount() { - let id = this.props.match.params.shixunId; - let checkpointId=this.props.match.params.checkpointId; - - let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; - let newpractice_url= "/shixuns/"+id+"/challenges/new"; - let newgo_back_url="/shixuns/"+id+"/challenges"; - this.setState({ - shixunId:id, - checkpointId:checkpointId - }) - - - let url = "/shixuns/" + id + "/challenges/" + checkpointId + "/edit.json?tab=2"; - axios.get(url).then((response) => { - let newprev_challenge = response.data.prev_challenge; - let next_challenge = response.data.next_challenge; - if (newprev_challenge != undefined) { - if(newprev_challenge.st===0){ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; - }else{ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion"; - } - } - if (next_challenge != undefined) { - - if(next_challenge.st===0){ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint"; - }else{ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion"; - } - } - this.setState({ - answer:response.data.answer, - power: response.data.power, - choice_url: newchoice_url, // 导航中的新建选择题url - practice_url: newpractice_url, //string 导航中新建实践题url - go_back_url: newgo_back_url, //string 导航中的返回url - position: response.data.position, //int 关卡位置,导航栏中的第几关 - prev_challenge: newprev_challenge, - next_challenge: next_challenge, - }) - - if(response.data.power===false){ - this.props.showSnackbar("没有权限修改"); - } - if(response.data.answer===undefined||response.data.answer===null){ - this.answerMD("", "answerMD"); - }else{ - this.answerMD(response.data.answer, "answerMD"); - } - - }).catch((error) => { - console.log(error) - }); - } - - challenge_answer_submit=()=> { - let id = this.props.match.params.shixunId; - let{checkpointId}=this.state; - let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json"; - const answer_editormdvalue = this.answers_editormd.getValue(); - - axios.put(url,{ - tab:2, - identifier:id, - id:checkpointId, - challenge:{ - answer:answer_editormdvalue - } - } - ).then((response) => { - this.props.showSnackbar(response.data.messages); - - }).catch((error) => { - console.log(error) - }); - } - - render() { - - let { - choice_url, - practice_url, - go_back_url, - position, - task_pass_default, - submit_url, - shixunId, - checkpointId, - power, - prev_challenge, - next_challenge, - } = this.state; - let tab1url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/editcheckpoint"; - let tab2url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=2"; - let tab3url="/shixuns/" + shixunId + "/challenges/"+checkpointId+"/tab=3"; - // console.log(this.props) - return ( - -
    -
    - - - - 第{position}关 - 返回 - - {prev_challenge === undefined ? "" : - 上一关 - } - - {next_challenge === undefined ? "" : - 下一关 - } - - + 实践类型 - + 选择题类型 - -
    - -
    - -
  • - 本关任务 -
  • - -
  • - 评测设置 -
  • - -
  • - 参考答案 -
  • -
    - -
    - -
    -

    参考答案

    -
    -
    - -
    -
    -
    -
    -

    -

    -
    - -
    - -
    4||this.props.identity===undefined||power===false?"none":"block"}}> - 提交 - {/*取消*/} - 取消 -
    -
    -
    - ) - } -} - - diff --git a/public/react/src/modules/tpm/challengesnew/old/TPMchallengesnew.js b/public/react/src/modules/tpm/challengesnew/old/TPMchallengesnew.js deleted file mode 100644 index 6dfc04eef..000000000 --- a/public/react/src/modules/tpm/challengesnew/old/TPMchallengesnew.js +++ /dev/null @@ -1,617 +0,0 @@ -import React, {Component} from 'react'; - -import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd'; - -import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; - -// import "antd/dist/antd.css"; - -import TPMMDEditor from '../TPMMDEditor'; - -import axios from 'axios'; - -import '../css/TPMchallengesnew.css'; - -import { getImageUrl, toPath } from 'educoder'; - -import {getUrl} from 'educoder'; - -let origin = getUrl(); - -let path = getUrl("/editormd/lib/") - -const $ = window.$; - -let timeout; - -let currentValue; - -const Option = Select.Option; - -const RadioGroup = Radio.Group; - -export default class TPMchallengesnew extends Component { - constructor(props) { - super(props) - this.exercisememoMDRef=React.createRef(); - this.state = { - choice_url: undefined, - practice_url: undefined, - go_back_url: undefined, - task_pass_default: undefined, - submit_url: undefined, - shixunCreatePracticeGroup: 1, - optionsums:[100,200], - activetype:0, - setopen: false, - shixunCreatePractice: undefined, - onshixunsmarkvalue: 100, - shixunsskillvalue: undefined, - shixunsskillvaluelist: [], - tab2url: "", - tab3url: "", - prev_challenge:undefined, - next_challenge:undefined, - power: false, - shixunCreatePracticetype: false, - shixunsskillvaluelisttype: false, - marktype:false, - editPracticesendtype:false, - CreatePracticesendtype:false, - exec_time:20, - shixunExec_timeType:false - } - } - - - componentDidMount() { - let id = this.props.match.params.shixunId; - let checkpointId=this.props.match.params.checkpointId; - - let newchoice_url= "/shixuns/"+id+"/challenges/newquestion"; - let newpractice_url= "/shixuns/"+id+"/challenges/new"; - let newgo_back_url="/shixuns/"+id+"/challenges" - if(checkpointId===undefined){ - //新建模式 - let url = "/shixuns/" + id + "/challenges/new.json" - axios.get(url).then((response) => { - this.setState({ - choice_url: newchoice_url, - practice_url: newpractice_url, - go_back_url: newgo_back_url, - position: response.data.position, - task_pass_default: response.data.task_pass_default, - submit_url: response.data.submit_url, - checkpointId:checkpointId, - exercisememoMDRefval:response.data.task_pass_default - }) - - this.exercisememoMDRef.current.setValue(response.data.task_pass_default||'') - }).catch((error) => { - console.log(error) - }); - }else{ - //编辑模式 - let url="/shixuns/"+id+"/challenges/"+checkpointId+".json?tab=0"; - axios.get(url).then((response) => { - - let optionsum; - if(response.data.difficulty===1){ - optionsum=[100,200]; - }else if(response.data.difficulty===2){ - optionsum=[300,400,500,600]; - }else if(response.data.difficulty===3){ - optionsum=[700,800,900,1000] - } - let newprev_challenge=response.data.prev_challenge; - let next_challenge=response.data.next_challenge; - if (newprev_challenge != undefined) { - if(newprev_challenge.st===0){ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editcheckpoint"; - }else{ - newprev_challenge = "/shixuns/" + id + "/challenges/" + newprev_challenge.id + "/editquestion"; - } - } - if (next_challenge != undefined) { - if(next_challenge.st===0){ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editcheckpoint"; - }else{ - next_challenge = "/shixuns/" + id + "/challenges/" + next_challenge.id+ "/editquestion"; - } - } - this.setState({ - power: response.data.power, - prev_challenge:newprev_challenge, - next_challenge:next_challenge, - choice_url: newchoice_url, - practice_url: newpractice_url, - go_back_url: newgo_back_url, - shixunCreatePractice:response.data.subject, - position:response.data.position, - shixunCreatePracticeGroup:response.data.difficulty, - optionsums:optionsum, - onshixunsmarkvalue:response.data.score, - shixunsskillvaluelist:response.data.tags, - checkpointId:checkpointId, - exec_time:response.data.exec_time, - tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2", - tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3", - exercisememoMDRefval:response.data.task_pass - }) - if(response.data.power===false){ - this.props.showSnackbar("你没有权限修改"); - } - - this.exercisememoMDRef.current.setValue(response.data.task_pass||'') - }).catch((error) => { - console.log(error) - }); - - } - - } - - onshixunCreatePracticeChange = (e) => { - let optionsum; - let onshixunsmark; - if(e.target.value===1){ - optionsum=[100,200]; - onshixunsmark=100; - }else if(e.target.value===2){ - optionsum=[300,400,500,600]; - onshixunsmark=300; - }else if(e.target.value===3){ - optionsum=[700,800,900,1000] - onshixunsmark=700; - } - this.setState({ - shixunCreatePracticeGroup: e.target.value, - optionsums:optionsum, - onshixunsmarkvalue:onshixunsmark - }) - } - - shixunCreatePractice = (e) => { - this.setState({ - shixunCreatePractice: e.target.value - }) - } - - CreatePracticesend = () => { - - - this.setState({ - CreatePracticesendtype:true - }) - - if(this.props.status===2){ - this.props.showSnackbar("该实训已经发布不能新建") - this.setState({ - CreatePracticesendtype:false - }) - return - } - let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,exec_time} = this.state; - if (shixunCreatePractice === undefined||shixunCreatePractice=="") { - this.setState({ - shixunCreatePracticetype: true - }) - this.props.showSnackbar("任务名称为空") - $('html').animate({ - scrollTop: 10 - }, 1000); - - this.setState({ - CreatePracticesendtype:false - }) - return - } - - if (shixunsskillvaluelist.length === 0) { - this.setState({ - shixunsskillvaluelisttype: true, - CreatePracticesendtype:false - }) - this.props.showSnackbar("技能标签为空") - return - } - if(exec_time===null||exec_time===undefined||exec_time===""){ - - this.setState({ - shixunExec_timeType:false - }) - return - } - - const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim(); - let id = this.props.match.params.shixunId; - - let url = "/shixuns/" + id + "/challenges.json"; - - axios.post(url, { - identifier:id, - subject: shixunCreatePractice, - task_pass: exercise_editormdvalue, - difficulty: shixunCreatePracticeGroup, - score: onshixunsmarkvalue, - challenge_tag: shixunsskillvaluelist, - st: 0, - exec_time:exec_time - }).then((response) => { - if (response.data.status === 1) { - // $("html").animate({ scrollTop: 0 }) - //window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/editcheckpoint?tab=2`; - window.location.href=`/shixuns/${id}/challenges/${response.data.challenge_id}/tab=2`; - // this.setState({ - // setopen: true, - // CreatePracticesendtype:false, - // tab2url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2", - // tab3url: "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=3", - // }) - - } - // this.props.showSnackbar(response.data.messages); - }).catch((error) => { - console.log(error) - }); - - - - } - - onshixunsmark = (value) => { - this.setState({ - onshixunsmarkvalue: value - }) - } - - shixunsskill = (e) => { - this.setState({ - shixunsskillvalue: e.target.value - }) - } - - clickshixunsskill = () => { - - let {shixunsskillvalue, shixunsskillvaluelist} = this.state; - if (shixunsskillvalue === "") { - return - } else if (shixunsskillvalue === undefined) { - return - } - - if(shixunsskillvalue == "" || shixunsskillvalue == undefined || shixunsskillvalue == null || (shixunsskillvalue.length>0 && shixunsskillvalue.trim().length == 0)){ - message.error("输入为空,不能保存!"); - return - } - - let list = shixunsskillvaluelist; - list.push(shixunsskillvalue); - this.setState({ - shixunsskillvaluelist: list, - shixunsskillvalue: "" - }) - } - - delshixunsskilllist = (key) => { - let {shixunsskillvaluelist} = this.state; - let newshixunsskillvaluelist = shixunsskillvaluelist; - newshixunsskillvaluelist.splice(key, 1); - this.setState({ - shixunsskillvaluelist: newshixunsskillvaluelist - }) - } - - editPracticesend=()=>{ - - this.setState({ - editPracticesendtype:true - }) - - let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,checkpointId,exec_time} = this.state; - - const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim(); - - let id = this.props.match.params.shixunId; - - let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json"; - - if (shixunCreatePractice === undefined||shixunCreatePractice=="") { - // this.setState({ - // shixunCreatePracticetype: true - // }) - this.props.showSnackbar("任务名称为空") - $('html').animate({ - scrollTop: 10 - }, 1000); - this.setState({ - editPracticesendtype:false - }) - return - } - - if (shixunsskillvaluelist.length === 0) { - // this.setState({ - // shixunsskillvaluelisttype: true - // }) - this.props.showSnackbar("技能标签为空") - this.setState({ - editPracticesendtype:false - }) - return - } - - if(exec_time===null||exec_time===undefined||exec_time===""){ - - this.setState({ - shixunExec_timeType:false - }) - return - } - axios.put(url, { - tab:0, - identifier:id, - id:checkpointId, - challenge:{ - subject: shixunCreatePractice, - task_pass: exercise_editormdvalue, - difficulty: shixunCreatePracticeGroup, - score: onshixunsmarkvalue, - exec_time:exec_time - }, - challenge_tag:shixunsskillvaluelist - }).then((response) => { - this.props.showSnackbar(response.data.messages); - if (response.data.status === 1) { - window.location.href=`/shixuns/${id}/challenges/${checkpointId}/tab=2`; - this.setState({ - setopen: true, - editPracticesendtype:false, - tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2", - tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3", - }) - // window.location.href = "/shixuns/" + id + "/challenges/"+response.data.challenge_id+"/tab=2" - } - }).catch((error) => { - console.log(error) - }); - - - } - - onshixunsmarks=()=> { - this.setState({ - marktype:true - }) - } - - onshixunsmarkss=()=> { - this.setState({ - marktype:false - }) - } - - setexec_time=(e)=>{ - this.setState({ - exec_time:e.target.value - }) - } - render() { - - let shixuntype = this.props.match.params.type; - - - let {marktype, - shixunCreatePracticetype, shixunsskillvaluelisttype, - choice_url, practice_url, go_back_url, position, task_pass_default, submit_url, setopen,checkpointId,prev_challenge,next_challenge,power, - shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvalue, shixunsskillvaluelist, tab2url, tab3url,optionsums, - CreatePracticesendtype,editPracticesendtype - } = this.state; - - let options; - if(optionsums!=undefined){ - options = optionsums.map((d, k) => { - return ( - - ) - }) - } - - return ( - -
    - - -
    - -
  • - 本关任务 -
  • - -
  • - {tab2url === "" ? 评测设置 : 评测设置} -
  • - -
  • - {tab3url === "" ? 参考答案 : 参考答案} - -
  • -
    - -
    -
    -

    任务名称

    -
    - * -
    - -
    -
    - 必填项 -
    -
    -
    -
    - - -
    - -

    过关任务

    - - - -

    -

    -
    - - -
    -

    难度系数

    -
    - - - 简单 - 中等 - 困难 - - -
    -

    奖励经验值

    -
    - * - - - -

    - 如果学员答题错误,则不能得到相应的经验值
    - 如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+10经验值、+10金币 -

    - - 必填项 -
    -
    - - -
    -

    技能标签

    -
    - * -
    - - {/*+ 添加*/} -
    学员答题正确将获得技能,否则不能获得技能
    -
    - - { - shixunsskillvaluelist===undefined?"":shixunsskillvaluelist.length === 0 ? "" : shixunsskillvaluelist.map((itme, key) => { - return ( -
  • {itme} - this.delshixunsskilllist(key)}>× -
  • - ) - }) - } - - -
    -
    - - 必填项 -
    -
    - -
    -

    服务配置

    -
    - * - -
    - -
    - 必填项 -
    -
    -
    - -
    4||this.props.identity===undefined?"none":'block'}} - > - {checkpointId===undefined?提交: - 提交} - {/*取消*/} - 取消 -
    -
    -
    - ) - } -} - - diff --git a/public/react/src/modules/tpm/component/TPMNav.js b/public/react/src/modules/tpm/component/TPMNav.js deleted file mode 100644 index 24de62f1f..000000000 --- a/public/react/src/modules/tpm/component/TPMNav.js +++ /dev/null @@ -1,90 +0,0 @@ -import React, { Component } from 'react'; - -import { BrowserRouter as Router, Route, Link } from "react-router-dom"; - -class TPMNav extends Component { - - render() { - // console.log("componentDidMount"); - // console.log("TPMNavTPMNavTPMNavTPMNav"); - // console.log(this.props); - - const { user, match, shixun, secret_repository,is_jupyter} = this.props; - let isAdminOrCreator = false; - if (user) { - isAdminOrCreator = user.admin || user.manager - } - const shixunId = match.params.shixunId; - // const challengesPath = `/shixuns/${shixunId}/challenges`; - // console.log(this.props.propaedeutics) - const challengesPath = `/shixuns/${shixunId}/challenges`; - // console.log(match.path) - // console.log("TPMNavTPMNavTPMNav"); - // console.log(is_jupyter); - const is_teacher = this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:""; - const isfalse=true; - return ( - - - isfalse?"": - -
    - 任务 - - { - this.props.propaedeutics===undefined?"":this.props.propaedeutics===false?"":背景知识 - } - - { this.props.identity >4||this.props.identity===undefined ?"": - (this.props.is_jupyter===false? - 版本库 - :"") - } - - - - {this.props.identity >4||this.props.identity===undefined ?"": secret_repository && 私密版本库} - - 合作者 - - {/*jupyter*/} - { - this.props.is_jupyter===true? - 数据集 - :"" - } - - { - this.props.is_jupyter === false ? - 评论 - :"" - } - { - this.props.is_jupyter === false ? - 排行榜:"" - } - - {this.props.identity >2||this.props.identity===undefined?"": - 审核情况 - } - - {this.props.identity >4||this.props.identity===undefined ? "":配置} -
    - ); - } -} - -export default TPMNav; diff --git a/public/react/src/modules/tpm/component/TPMRightSection.js b/public/react/src/modules/tpm/component/TPMRightSection.js deleted file mode 100644 index 6b25635c8..000000000 --- a/public/react/src/modules/tpm/component/TPMRightSection.js +++ /dev/null @@ -1,279 +0,0 @@ -import React, {Component} from 'react'; - -import {BrowserRouter as Router, Route, Link} from "react-router-dom"; - -import axios from 'axios'; - -import {getImageUrl,} from "educoder"; - -import './TPMright.css'; - -import {Progress, Tooltip} from 'antd'; - -// import "antd/dist/antd.css"; - -class TPMRightSection extends Component { - constructor(props) { - super(props) - this.state = { - - TPMRightSection: false, - clickNewsubscripttype: false - } - } - - // componentDidMount() { - // let id=this.props.match.params.shixunId; - // - // let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`; - // - // axios.get(shixunsDetailsURL).then((response)=> { - // if(response.status===200){ - // this.setState({ - // TPMRightSectionData: response.data - // }); - // } - // }).catch((error)=>{ - // console.log(error) - // }); - // } - - // shouldComponentUpdate(nextProps, nextState) { - // return nextProps.TPMRightSectionData !== this.state.TPMRightSectionData - // } - clickNewsubscript = (val) => { - if (val === 0) { - this.setState({ - TPMRightSection: true, - clickNewsubscripttype: true - }) - } else { - this.setState({ - TPMRightSection: false, - clickNewsubscripttype: false - }) - } - - } - - render() { - let {TPMRightSection, clickNewsubscripttype} = this.state; - let {TPMRightSectionData} = this.props - let Progresssum; - if(TPMRightSectionData&&TPMRightSectionData.complete_count!=null){ - Progresssum=(parseInt(TPMRightSectionData&&TPMRightSectionData.complete_count) / parseInt(TPMRightSectionData&&TPMRightSectionData.challenge_count))*100; - } - - // console.log(this.props&&this.props.is_jupyter===true) - return ( -
    - - { - TPMRightSectionData === undefined ? "" : -
    -
    -

    创建者

    -
    - - 头像 - -
    - -
    -
    - {TPMRightSectionData === undefined ? "" : TPMRightSectionData.creator === undefined ? "" : TPMRightSectionData.creator.name} -
    -
    - 共发布实训 {TPMRightSectionData.user_shixuns_count} -
    -
    - {/*
    */} - {/* 发布实训项目*/} - {/* /!*粉丝 {TPMRightSectionData.fans_count}*!/*/} - {/* /!* 取消关注 *!/*/} - {/*
    */} - -
    -
    -
    - - {this.props&&this.props.is_jupyter===true?"":this.props&&this.props.status>1?
    -
    - 学习统计 - - 已完成 {TPMRightSectionData&&TPMRightSectionData.complete_count===null?0:TPMRightSectionData&&TPMRightSectionData.complete_count} 关 / 共 {TPMRightSectionData&&TPMRightSectionData.challenge_count} 关 - - -
    - - -
    :""} - { - TPMRightSectionData === undefined ? "" : TPMRightSectionData.tags === undefined ? "" : TPMRightSectionData.tags.length === 0 ? "" : -
    -

    - 技能标签 - - 已获得 {TPMRightSectionData&&TPMRightSectionData.user_tag_count} 个 / 共 {TPMRightSectionData&&TPMRightSectionData.tag_count} 个 - - -

    -
    -
    - {TPMRightSectionData.tags.map((item, key) => { - return ( - {item.tag_name} - ) - }) - } -
    -
    - - -
    15 && clickNewsubscripttype === false ? "textcenter color-grey-9 mt20 rightjinengs" : "none"} - onClick={() => this.clickNewsubscript(0)}> - -
    -

    展开全部

    -

    -
    -
    -
    - - -
    this.clickNewsubscript(1)}> - -
    -

    -

    收起全部

    -
    -
    -
    - -
    - - - } - - -
    -

    所属课程

    -
    - { - TPMRightSectionData === undefined ? "" : TPMRightSectionData.paths === undefined ? "" : TPMRightSectionData.paths.map((i, k) => { - if(k>2){ - - }else{ - return ( - -
    - - - - 实训 - - -
    - {i.name} -

    - - - {i.stages_count} - - - {/**/} - {/*{i.score_count}*/} - {/**/} - - - {i.members_count} - - -

    -
    - -
    - - ) - } - - }) - } -
    -
    - - {TPMRightSectionData === undefined ? "" : TPMRightSectionData.paths === undefined ? "" : TPMRightSectionData.paths.length === 0 ? "" : - this.props.user && this.props.user.main_site === true ?
    -

    推荐实训

    -
    - { - TPMRightSectionData === undefined ? "" : TPMRightSectionData.recommands === undefined ? "" : TPMRightSectionData.recommands.map((item, key) => { - if(key>2){ - - }else{ - return ( -
    - - 69?1526971094 - -
    - - {item.name} - -

    - {item.stu_num} 人学习 - {item.level} -

    - -
    -
    - ) - } - - }) - } -
    -
    : "" - } -
    - } -
    - ) - - - } -} - -export default TPMRightSection; diff --git a/public/react/src/modules/tpm/component/TPMright.css b/public/react/src/modules/tpm/component/TPMright.css deleted file mode 100644 index bef960742..000000000 --- a/public/react/src/modules/tpm/component/TPMright.css +++ /dev/null @@ -1,135 +0,0 @@ -/*b新标签*/ -.newedu-filter-btn { - display: block; - float: left; - padding: 0 9px; - /*height: 28px;*/ - line-height: 28px; - border-radius: 14px; - background-color: #F5F5F5; - color: #666; - margin-right: 10px; - margin-bottom: 9px; -} - -.newedbox { - /*flex-wrap: wrap;*/ - /*display: -webkit-flex; !* Safari *!*/ - /*display: flex;*/ - width: 360px; - position: relative; - overflow: hidden; -} - -.newsubscript { - position: absolute; - right: 23px; - bottom: 16px; - cursor: pointer; -} - -.newsubscript:hover { - color: deepskyblue; -} - -.edu-filter-btn29BD8B { - display: block; - float: left; - padding: 0 9px; - height: 28px; - line-height: 28px; - border-radius: 14px; - background-color: #29BD8B; - color: #FFF; - margin-right: 10px; - margin-bottom: 9px; -} - -.relative { - position: relative; -} - -.newedboxheight { - max-height: 177px; - overflow-y: hidden; -} - -.newminheight { - /*max-height: 670px;*/ - max-height: 300px; - overflow-y: auto; -} - -.delSubentry { - font-size: 7px; - font-family: MicrosoftYaHei; - font-weight: 400; - color: rgba(76, 172, 255, 1); - line-height: 9px; - cursor: pointer; -} - -.operationalter .delSubentry { - font-size: 15px !important; - line-height: 25px; -} - -/*临时的tpi关闭按钮样式*/ -.headerRight a { - color: #1a3f5f; -} - -/*实训做成弹窗a标签样式调整*/ -.-task-list-title a:link, .-task-list-title a:visited { - color: #bcc6cd; -} - -.-task-list-title a:hover { - color: #459be5; -} - -.headerLeft .-header-right { - height: 32px; -} - -.creatorname { - font-size: 16px; - color: rgba(51, 51, 51, 1); -} - -.creatornamelist { - cursor: default; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - width: 139px; -} - -.width80center { - font-size:12px; - text-align: center; -} - -.pd302020zuoze { - padding: 30px 20px 20px; -} - -.textcenter{ - text-align: center; -} -.padd252020px{ - padding: 25px 20px 15px; -} - -.rightjinengs{ - height: 35px; - margin-top: 20px; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.borderbottomf4{ - border-bottom:1px solid #F4F4F4; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js b/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js deleted file mode 100644 index 4b72ae2bd..000000000 --- a/public/react/src/modules/tpm/component/modal/RepositoryChooseModal.js +++ /dev/null @@ -1,153 +0,0 @@ -// import React, { useState, useEffect, memo } from 'react'; -// import axios from 'axios' -// import { Modal, Input } from 'antd'; - -// function RepositoryChooseModal(props) { -// const [trees, setTrees] = useState([]) -// const [path, setPath] = useState('') -// const [pathArray, setPathArray] = useState([{val: "根目录/", path: ""}]) -// const [modalVisible, setModalVisible] = useState(true) - -// useEffect(() => { -// repository('') -// }, []) -// function onOk() { - -// } -// function onCancel() { - -// } -// /** -// 点nav 会传入key -// 点item 会传入 newPath - -// item => name, type type tree/leaf -// */ -// const repository=(item, key, newPath)=>{ -// let newPathArray = [] // -// // -// if (key) { -// for(var i=0; i<=key; i++){ -// newPathArray.push(pathArray[i]) -// } -// } else if (item) { -// newPathArray = pathArray.slice(0) -// newPathArray.push({val: item.name, path: pathArray[pathArray.length - 1] + "/" + item.name}) -// } - -// const path = item || key ? newPathArray[newPathArray.length - 1] : '' - -// let id = props.match.params.shixunId; -// let url ="/shixuns/"+id+"/repository.json"; -// axios.post(url,{ -// path: path -// }).then((response) => { -// if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - -// }else{ -// setTrees(response.data.trees) -// setPath(path) -// pathArray(newPathArray) -// } - -// }).catch((error) => { -// console.log(error) -// }); -// } -// const savegetfilepath=(value)=>{ -// const state = {} -// let {selectpath,saveshixunfilepath,pathtype} = state - -// if(pathtype===1){ -// let newselectpath; - -// if(saveshixunfilepath==="shixunfilepathplay"){ -// newselectpath=value -// }else{ -// const type = selectpath.split(';'); -// let types=false; -// for(var i=0; i{ - -// } -// function sendgetfilepath() { - -// } -// return ( -// -//
    -//
    -// -//
    -// -// saveselectpath(e)} -// value={path}/> -//
    - -// onOk()}>确定 -// onCancel()}>取消 -//
    -//
    -//
    -// ) - -// } - -// export default RepositoryChooseModal \ No newline at end of file diff --git a/public/react/src/modules/tpm/jupyter/index.js b/public/react/src/modules/tpm/jupyter/index.js deleted file mode 100644 index 6883aa72f..000000000 --- a/public/react/src/modules/tpm/jupyter/index.js +++ /dev/null @@ -1,520 +0,0 @@ -/* - * @Description: jupyter tpi - * @Author: tangjiang - * @Github: - * @Date: 2019-12-11 08:35:23 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-13 15:25:50 - */ -import './index.scss'; -import React, { useEffect, useState } from 'react'; -import SplitPane from 'react-split-pane'; -import { Button, Modal,Drawer ,Pagination,Empty,Tooltip,Icon,message,Statistic,Spin} from 'antd'; -import { - connect -} from 'react-redux'; -import FloatButton from '../../page/component/FloatButton'; -import UserInfo from '../../developer/components/userInfo'; -import actions from '../../../redux/actions'; -import RightPane from './rightPane'; - -import MyIcon from "../../../common/components/MyIcon"; -function clearSlct() { - if("getSelection" in window){ - window.getSelection().removeAllRanges(); - }else{ - document.selection.empty(); - }; -} -function jsCopy(s) { - clearSlct(); - const copyEle = document.getElementById(s); - copyEle.select(); - const copyStatus=document.execCommand("Copy"); - // 对成功与否定进行提示 - copyStatuss(copyStatus) -} - -function copyStatuss(copyStatus){ - if (copyStatus) { - message.success('复制成功'); - } else { - message.error('复制失败'); - } -} -function JupyterTPI (props) { - - // 获取 identifier 值 - const { - match: { - params = {} - }, - url, - loading, // 保存按钮状态 - total, - pagination, - dataSets, // 数据集 - jupyter_info, - getJupyterInfo, - syncJupyterCode, - jupyter_tpi_url_state, - getJupyterTpiDataSet, - getJupyterTpiUrl, - saveJupyterTpi, - changeLoadingState, - changeGetJupyterUrlState, - jupyter_identifier, - changeCurrentPage, - changeshowDrawer, - drawervisible, - reset_with_tpi, - jupytertime, - endjupytertime, - active_with_tpi, - spinning, - updataspinning, - jupyter_folder_name - } = props; - - const emptyCtx = ( -
    - - -
    - ); - const { Countdown } = Statistic; - const {identifier} = params; - const [userInfo, setUserInfo] = useState({}); - const [jupyterInfo, setJupyterInfo] = useState({}); - const [updateTip, setUpdateTip] = useState(true); - const [myIdentifier, setMyIdentifier] = useState(''); - const [renderCtx, setRenderCtx] = useState(() => (emptyCtx)); - - let newHandletype=false - const newHandle = function (event) { - if(newHandletype===false){ - newHandletype=true - saveJupyterTpi(event); - setTimeout(()=>{newHandletype=false},500) - } - } - - // 保存代码 - const addEventListeners = () => { - window.addEventListener('message', (e) => { - // console.log("触发了jupytermessage"); - if(e){ - if(e.data){ - if(e.data==="jupytermessage"){ - newHandle() - } - } - } - }) - } - - const stopposttpip=(sum)=>{ - var _iframe = document.getElementById("rightPaneframe"); - if(_iframe == null || _iframe == undefined || _iframe == ""){ - return; - } - if(sum===1){ - _iframe.contentWindow.postMessage("stopParent", "*"); - }else{ - _iframe.contentWindow.postMessage("clonsParent", "*"); - } - - } - - - useEffect(() => { - addEventListeners() - }, []); - - useEffect(() => { - /* 先调用 jupyter的 TPI 接口, - * 获取 用户信息, - * 实训的 identifier, 状态, 名称, 是否被修改等信息 - */ - getJupyterInfo(identifier); - }, [identifier]); - - useEffect(() => { - - // 设置jupyter信息 - setJupyterInfo(jupyter_info || {}); - const {user, tpm_modified, myshixun_identifier} = jupyter_info; - if (user) { - setUserInfo(user); - } - - if (myshixun_identifier) { - setMyIdentifier(myshixun_identifier); - } - - // 同步代码 - if (tpm_modified && updateTip && myshixun_identifier) { - - setUpdateTip(false); - updataspinning(true) - Modal.confirm({ - title: '更新通知', - content: (
    - {stopposttpip(1)} -

    该实训已更新,您选择更新后之前编写的实训代码将会丢失,如有需要请先使用【jupyter中-文件-下载】保存代码,再进行更新

    - {/*

    还未完成评测的任务代码,请自行保存

    */} -
    ), - okText: '立即更新', - cancelText: '稍后再说', - onOk () { - syncJupyterCode(myshixun_identifier, '同步成功'); - },onCancel() { - updataspinning(false) - stopposttpip(2) - }, - }) - } - }, [props]); - - - // 重置实训 - const handleClickResetTpi = () => { - stopposttpip(1) - updataspinning(true) - Modal.confirm({ - title: '重置实训', - content: ( -

    - 你在本文件中修改的内容将丢失,
    - 是否确定重新加载初始代码? -

    - ), - okText: '确定', - cancelText: '取消', - onOk () { - console.log('调用重置代码....', myIdentifier); - if (myIdentifier) { - syncJupyterCode(myIdentifier, '重置成功'); - } - }, - onCancel() { - stopposttpip(2) - updataspinning(false) - }, - }) - } - - - // 重置环境 - const handleEnvironmentTpi = () => { - stopposttpip(1) - updataspinning(true) - Modal.confirm({ - title: '重置环境', - content: ( -

    - 是否确定重置环境? -

    - ), - okText: '确定', - cancelText: '取消', - onOk () { - console.log('调用重置代码....', myIdentifier); - // if (myIdentifier) { - // - // } - reset_with_tpi(myIdentifier, '重置成功'); - }, - onCancel() { - updataspinning(false) - stopposttpip(2) - }, - }) - } - - // 退出实训 - const handleClickQuitTpi = () => { - // console.log(jupyterInfo); - const { identifier } = jupyterInfo; - if (!identifier) return; - props.history.push(`/shixuns/${identifier}/challenges`); - } - - // 重新获取 jupyter url - const handleOnReloadUrl = (id) => { - // console.log('jupyter 信息: ', jupyterInfo); - // 改变加载状态值 - changeGetJupyterUrlState(-1); - getJupyterTpiUrl({identifier: myIdentifier}); - } - - // 保存代码 - const handleOnSave = () => { - // 改变按钮状态 - changeLoadingState(true); - saveJupyterTpi(); - } - - // 分页信息改变时 - const handlePageChange = (current) => { - // 改变当前页 - changeCurrentPage(current); - // 分页查找数据 - getJupyterTpiDataSet(jupyter_identifier); - } - - const swtichFirstDrawer = () => { - changeshowDrawer(!drawervisible) - } - - const firstDrawerWidth = ()=>{ - return 260 - }; - let newPage=false - // 分页处理 - const handleChangePage = (e,page) => { - //滑动到底判断 - let newscrollTop=parseInt(e.currentTarget.scrollTop); - let allclientHeight=e.currentTarget.clientHeight+newscrollTop; - if(dataSets.length { - if (dataSets.length > 0) { - // console.log('数据集的个数: ', dataSets.length); - const oList = dataSets.map((item, i) => { - return ( -
  • - - - - -
  • - ); - }); - - const oUl = ( -
      handleChangePage(event,pagination.page)} > - { oList } -
    - ); - - setRenderCtx(oUl); - } - }, [props]); - - const onFinish= () =>{ - Modal.destroyAll(); - Modal.confirm({ - title: '倒计时截止', - content: ( -

    - 服务已中断,是否确认重置实验环境? -

    - ), - okText: '确定', - cancelText: '取消', - onOk () { - reset_with_tpi(myIdentifier, '重置成功'); - } - }) - } - const endonFinish= () =>{ - Modal.confirm({ - title: '服务中断提醒', - content: ( -

    - jupyter将于时间后服务中断,是否需要延长使用时间? -

    - ), - okText: '立即延长', - cancelText: '不需要', - onOk () { - active_with_tpi(myIdentifier, '延长成功'); - } - }) - } - return ( - -
    -
    - -

    - {jupyterInfo.name} - - - - {endjupytertime===false?"":} - - -

    -

    - {/*sync | poweroff */} - - - - - -

    -
    - -
    - - {/*
    */} - {/* */} - {/*
    */} - - - {"数据集"} - - -
    - - {/*

    */} -
    -

    - {/**/} - 数据集 - {/* 数据集 */} -

    - {dataSets&&dataSets.length===0?"":

    - 文件路径 - - -

    } - { renderCtx } - {/*
    */} - {/* {total<20?"":}*/} - {/*
    */} -
    - -
    -
    -
    -
    - ); -} - -const mapStateToProps = (state) => { - const { - jupyter_info, - jupyter_tpi_url, - jupyter_data_set, - jupyter_tpi_url_state, - jupyter_data_set_count, - jupyter_folder_name, - jupyter_pagination, - jupyter_identifier - } = state.jupyterReducer; - const { loading ,drawervisible,jupytertime,spinning,endjupytertime} = state.commonReducer; - return { - loading, - jupyter_info, - url: jupyter_tpi_url, - dataSets: jupyter_data_set, - jupyter_tpi_url_state, - total: jupyter_data_set_count, - pagination: jupyter_pagination, - jupyter_folder_name:jupyter_folder_name, - jupyter_identifier, - drawervisible, - jupytertime, - endjupytertime, - spinning - }; -} - -const mapDispatchToProps = (dispatch) => ({ - changeGetJupyterUrlState: (status) => dispatch(actions.changeGetJupyterUrlState(status)), - getJupyterInfo: (identifier) => dispatch(actions.getJupyterInfo(identifier)), - // 重置代码 - syncJupyterCode: (identifier, msg) => dispatch(actions.syncJupyterCode(identifier, msg)), - // 重置代码 - reset_with_tpi: (identifier, msg) => dispatch(actions.reset_with_tpi(identifier, msg)), - getJupyterTpiDataSet: (identifier, current) => dispatch(actions.getJupyterTpiDataSet(identifier, current)), - getJupyterTpiUrl: (identifier) => dispatch(actions.getJupyterTpiUrl(identifier)), - saveJupyterTpi: () => dispatch(actions.saveJupyterTpi()), - changeLoadingState: (flag) => dispatch(actions.changeLoadingState(flag)), - changeCurrentPage: (current) => dispatch(actions.changeCurrentPage(current)), - //展开Drawer - changeshowDrawer: (type) => dispatch(actions.changeshowDrawer(type)), - //倒计时增加 - addjypertime: (type) => dispatch(actions.addjypertime(type)), - //延时 - active_with_tpi:(identifier, msg) => dispatch(actions.active_with_tpi(identifier, msg)), - updataspinning:(identifier, msg) => dispatch(actions.updataspinning(identifier, msg)), -}); - -export default connect( - mapStateToProps, - mapDispatchToProps -)(JupyterTPI); diff --git a/public/react/src/modules/tpm/jupyter/index.scss b/public/react/src/modules/tpm/jupyter/index.scss deleted file mode 100644 index b2c900652..000000000 --- a/public/react/src/modules/tpm/jupyter/index.scss +++ /dev/null @@ -1,261 +0,0 @@ -.Resizer { - background: #000; - opacity: 0.2; - z-index: 1; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - -moz-background-clip: padding; - -webkit-background-clip: padding; - background-clip: padding-box; -} - -.Resizer:hover { - -webkit-transition: all 2s ease; - transition: all 2s ease; -} - -.Resizer.horizontal { - height: 11px; - margin: -5px 0; - border-top: 5px solid rgba(255, 255, 255, 0); - border-bottom: 5px solid rgba(255, 255, 255, 0); - cursor: row-resize; - width: 100%; -} -.filestyles{ - color: #28b887 !important; - font-size: 25px !important; - margin-left:48px; -} -.Resizer.horizontal:hover { - border-top: 5px solid rgba(0, 0, 0, 0.5); - border-bottom: 5px solid rgba(0, 0, 0, 0.5); -} - -.Resizer.vertical { - width: 11px; - margin: 0 -5px; - border-left: 5px solid rgba(255, 255, 255, 0); - border-right: 5px solid rgba(255, 255, 255, 0); - cursor: col-resize; -} - -.Resizer.vertical:hover { - border-left: 5px solid rgba(0, 0, 0, 0.5); - border-right: 5px solid rgba(0, 0, 0, 0.5); -} -.Resizer.disabled { - cursor: not-allowed; -} -.Resizer.disabled:hover { - border-color: transparent; -} - -.jupyter_area{ - - .jupyter_header{ - position: relative; - height: 60px; - line-height: 60px; - background-color: #070F1A; - padding-left: 30px; - z-index:999999; - .jupyter_title{ - display: flex; - flex-direction: column; - // justify-content: space-around; - align-items: center; - height: 100%; - color: #fff; - .title_desc{ - margin-top: 12px; - font-size: 16px; - } - .title_time{ - font-size: 12px; - } - // text-align: center; - } - - .jupyter_btn{ - position: absolute; - right: 10px; - top: 14px; - - .btn_common{ - color: #888; - } - .btn_common:hover{ - // background-color: #29BD8B; - // color: #29BD8B; - color: #1890ff; - } - } - } - - - .jupyter_ctx{ - position: relative; - height: calc(100vh - 60px); - } - - .update_notice{ - text-align: center; - .update_txt{ - line-height: 18px; - font-size: 14px; - } - } -} - -.RightPaneDrawer{ - .RightPaneDrawertop{ - width:330px; - height:29px; - background:rgba(17,28,36,1); - } - - .ant-drawer-content-wrapper{ - width:330px !important; - //box-shadow: -2px 0 8px #070F1A !important; - } - .ant-drawer-body{ - padding: 0px; - } - .ant-drawer-wrapper-body{ - overflow: hidden !important; - padding-top: 60px; - background: #070F1A; - padding-bottom: 40px; - } - - .jupyter_data_list{ - height:500px; - overflow-y: auto; - } - - .ant-pagination{ - color:#fff !important; - } - -} - -.newjupyter_data_sets_area{ - background:#070F1A !important; - .jupyter_h2_title { - padding-left: 20px; - height:49px; - line-height: 49px; - background: #070F1A !important; - //border-bottom: 1px solid #17212F !important; - color:#FFFFFF !important; - //border-top: 1px solid #17212F !important; - } - .iconfont{ - color:#28b887!important; - font-size: 30px !important; - margin-right: 20px; - } - .jupyter_pagination{ - border-top: 1px solid #070F1A !important; - padding-left: 50px; - } - - .jupyter_name{ - color:#FFFFFF !important; - } - .file_path_input{ - position: absolute; - right: -50%; - } -} - -.maxnamewidth150 { - max-width: 150px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; - width: 150px; -} -.sortinxdirection{ - display: flex; - flex-direction:row; -} - -.lineheighttaj{ -line-height: 50px !important; -} -.colorlineheighttaj{ - color: #ffffff; -} - -.jupytertitle_time{ - .ant-statistic-content{ - font-size: 20px !important; - } - .ant-statistic-content-value{ - color:#fff !important; - font-size: 14px !important; - } -} - -.jupyter_data_list{ - padding-left: 20px; - -} - -.bortop17212F{ - border-top: 1px solid #17212F !important; -} - -.borbottom17212F{ - border-bottom: 1px solid #17212F !important; -} - -.jupyterfilepaths{ - color: #888 !important; - font-size: 16px !important; - padding-left: 20px; - background: #070F1A !important; -} - -.maxnamewidth186JUPYTER{ - max-width: 186px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; - width: 186px; -} - -.maxnamewidth152{ - max-width:152px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; - width: 152px; -} - -.height45lineheight45{ - height: 45px; - line-height: 45px !important; -} - -.Countdowntypes{ - width:1px; - height:1px; - overflow: hidden; - display: block; -} - -.Countdownfonttpi{ - width: 60px; - display: inline-block; -} - -.Countdownfonttpi .ant-statistic-content-value{ - font-size: 14px; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/jupyter/leftPane/index.js b/public/react/src/modules/tpm/jupyter/leftPane/index.js deleted file mode 100644 index d87be9064..000000000 --- a/public/react/src/modules/tpm/jupyter/leftPane/index.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * @Description: - * @Author: tangjiang - * @Github: - * @Date: 2019-12-12 10:34:03 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-13 22:46:51 - */ -import './index.scss'; -import React, { useState, useEffect } from 'react'; -import {Icon, Empty, Pagination, Tooltip } from 'antd'; -import MyIcon from '../../../../common/components/MyIcon'; - -function LeftPane (props) { - - // 获取数据集 - const { - dataSets = [], - total, - pagination, - onPageChange - } = props; - - const emptyCtx = ( -
    - -
    - ); - - // const listCtx = ; - const [renderCtx, setRenderCtx] = useState(() => (emptyCtx)); - - useEffect(() => { - if (dataSets.length > 0) { - console.log('数据集的个数: ', dataSets.length); - const oList = dataSets.map((item, i) => { - return ( -
  • - - - {item.title} - -
  • - ); - }); - - const oUl = ( -
      - { oList } -
    - ); - - setRenderCtx(oUl); - } - }, [props]); - - // 分页处理 - const handleChangePage = (page) => { - // console.log(page, pageSize); - // setCurrent(page); - onPageChange && onPageChange(page); - } - return ( -
    -

    - 数据集 - {/* 数据集 */} -

    - { renderCtx } -
    - -
    - -
    - ) -} - -export default LeftPane; \ No newline at end of file diff --git a/public/react/src/modules/tpm/jupyter/leftPane/index.scss b/public/react/src/modules/tpm/jupyter/leftPane/index.scss deleted file mode 100644 index fdffdf5e7..000000000 --- a/public/react/src/modules/tpm/jupyter/leftPane/index.scss +++ /dev/null @@ -1,73 +0,0 @@ -.jupyter_data_sets_area{ - height: 100%; - background: #fff; - .jupyter_h2_title{ - //height: 44px; - //line-height: 44px; - // background-color: #EEEEEE; - background: #fff; - padding: 0 20px; - font-size: 16px; - // box-size: border-box; - box-sizing: border-box; - //border-bottom: 1px solid rgba(238,238,238,1); - .jupyter_data_icon{ - // color: #7286ff; - color: #1890ff; - font-size: 24px; - position: relative; - top: 2px; - transform: scale(1.5); - margin-right: 5px; - } - } - - .jupyter_data_list, - .jupyter_empty{ - //height: calc(100vh - 160px); - min-height: 350px; - overflow-y: auto; - } - - .jupyter_data_list{ - .jupyter_item{ - line-height:45px; - //border-bottom: 1px solid rgba(238,238,238, 1); - padding: 0 30px 0 45px; - overflow: hidden; - text-overflow:ellipsis; - white-space: nowrap; - cursor: pointer; - transition: .3s; - &:hover{ - background-color: rgba(235, 235, 235, .3); - } - .jupyter_icon{ - color: rgb(74, 188, 125); - font-size: 16px; - transform: scale(1.2); - margin-right: 5px; - } - .jupyter_name{ - color: #000; - font-size: 16px; - } - } - } - - .jupyter_empty{ - display: flex; - align-items: center; - justify-content: center; - width: 100%; - } - - .jupyter_pagination{ - display: flex; - justify-content: center; - align-items: center; - height: 56px; - box-sizing: border-box; - border-top: 1px solid rgba(238,238,238,1); - } -} diff --git a/public/react/src/modules/tpm/jupyter/rightPane/index.js b/public/react/src/modules/tpm/jupyter/rightPane/index.js deleted file mode 100644 index 5cfa96260..000000000 --- a/public/react/src/modules/tpm/jupyter/rightPane/index.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * @Description: - * @Author: tangjiang - * @Github: - * @Date: 2019-12-12 15:04:20 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-13 11:25:22 - */ -import './index.scss'; -import React, { useEffect, useState } from 'react'; -import { Spin, Button } from 'antd'; -function RightPane (props) { - const { - status, - url, - onReloadUrl, - onSave, - loading - } = props; - - const [renderCtx, setRenderCtx] = useState(() => loadInit); - // 重新获取 url - const handleClickReload = () => { - onReloadUrl && onReloadUrl(); - } - - const loadInit = ( -
    - {/**/} -
    - ); - - const loadError = ( -
    - -

    - 实训加载失败, - 重新加载 -

    -
    - ); - - // 保存 - const handleClickSubmit = () => { - console.log('调用了保存接口....'); - onSave && onSave(); - } - - useEffect(() => { - if (status === -1) { - setRenderCtx(() => loadInit); - } else if (status === 0 && url) { - setRenderCtx(() => ( - -
    -
    - -
    - {/*
    */} - {/* 保存*/} - {/*
    */} -
    - - )); - } else { - setRenderCtx(() => loadError); - } - }, [status, url, loading]); - - return ( -
    - { renderCtx } -
    - ) -} - -export default RightPane; - diff --git a/public/react/src/modules/tpm/jupyter/rightPane/index.scss b/public/react/src/modules/tpm/jupyter/rightPane/index.scss deleted file mode 100644 index fe2d52456..000000000 --- a/public/react/src/modules/tpm/jupyter/rightPane/index.scss +++ /dev/null @@ -1,74 +0,0 @@ -.jupyter_right_pane_area{ - position: relative; - height: calc(100vh - 60px); - // background: pink; - - .jupyter_load_url_error, - .jupyter_loading_init{ - display: flex; - position: relative; - align-items: center; - justify-content: center; - height: 100%; - &::before{ - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - content: ''; - - } - } - - .jupyter_loading_init{ - &::before{ - background-color: rgba(0,0,0,.2); - } - } - - .jupyter_load_url_error{ - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - // &::before{ - // background-color: rgba(0,0,0,.2); - // } - .jupyter_error_txt{ - position: relative; - z-index: 1; - font-size: 12px; - .jupyter_reload{ - cursor: pointer; - color: #1890ff; - } - } - - .icon-error{ - position: relative; - color: #DCE0E6; - transform: scale(5); - top: -35px; - } - } - - .jupyter_result{ - height: 100%; - .jupyter_iframe{ - height: calc(100% - 56px); - // background: pink; - .jupyter_iframe_style{ - border: none; - outline: none; - } - } - .jupyter_submit{ - display: flex; - align-items: center; - height: 56px; - justify-content: flex-end; - padding-right: 20px; - } - } -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js deleted file mode 100644 index 361ed3248..000000000 --- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js +++ /dev/null @@ -1,751 +0,0 @@ -import React, {Component} from 'react'; - -import {TPMIndexHOC} from '../TPMIndexHOC'; - -import {SnackbarHOC} from 'educoder'; - -import {Select, Radio, Input, Modal, Button, Form, Tooltip, Upload, Icon, notification} from 'antd'; - -import axios from 'axios'; - -import {getUploadActionUrl} from 'educoder'; - -import './css/Newshixuns.css'; - -import TPMMDEditor from "../challengesnew/TPMMDEditor"; - -import Bottomsubmit from "../../modals/Bottomsubmit"; - -const Option = Select.Option; - -class Newshixuns extends Component { - constructor(props) { - super(props) - this.contentMdRef = React.createRef(); - this.state = { - shixunName: undefined, - NAME_COUNT: 60, - is_jupyter: "1", - newshixunlist: undefined, - language: undefined, - runtime: undefined, - run_method: undefined, - postapplyvisible: undefined, - fileList: [], - Radiovalue:"1" - } - } - - - componentDidMount() { - this.props.form.setFieldsValue({ - is_jupyter: `1`, - }); - - let newshixunUrl = `/shixuns/new.json`; - axios.get(newshixunUrl).then((response) => { - if (response.status === 200) { - if (response.data.message === undefined) { - this.setState({ - newshixunlist: response.data - }); - // this.contentMdRef.current.setValue(!response.data.sample[0][1] ? "" : response.data.sample[0][1]); - } - } - }).catch((error) => { - console.log(error) - }); - - let departmentsUrl = `/shixuns/departments.json`; - axios.get(departmentsUrl).then((response) => { - if (response.status === 200) { - if (response.data.message === undefined) { - this.setState({ - departmentslist: response.data.shools_name - }); - } - } - }).catch((error) => { - console.log(error) - }); - - - } - - shixunNameInput = (e) => { - this.setState({ - shixunName: e.target.value - }) - - this.props.form.setFieldsValue({ - name: e.target.value, - }); - } - - RadiovalueonChange = (e) => { - this.setState({ - Radiovalue: e.target.value, - }); - this.props.form.setFieldsValue({ - is_jupyter: e.target.value, - }); - }; - - handleSubmit = (e) => { - this.setState({ - loading: true - }) - const mdContnet = this.contentMdRef.current.getValue().trim(); - this.props.form.validateFieldsAndScroll((err, values) => { - debugger - if (!err) { - console.log('Received values of form: ', values); - - let Url = `/shixuns.json`; - axios.post(Url, { - description: mdContnet, - main_type: values.main_type, - sub_type: values.sub_type, - shixun: { - name: values.name, - trainee: values.select, - is_jupyter: values.is_jupyter === "2" ? true : false, - } - } - ).then((response) => { - if (response.status === 200) { - window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges"; - // window.open("/shixuns/"+response.data.shixun_identifier+"/challenges"); - } else { - this.setState({ - loading: false - }) - } - }).catch((error) => { - this.setState({ - loading: false - }) - }) - }else{ - this.setState({ - loading: false - }) - } - }); - }; - Selectthestudent = (value) => { - this.props.form.setFieldsValue({ - select: value, - }); - } - - main_type = (value, e) => { - this.props.form.setFieldsValue({ - main_type: value, - }); - this.setState({ - mainvalues: e.props.name - }) - } - - sub_type = (value, e) => { - this.props.form.setFieldsValue({ - sub_type: value, - }); - let newlist = "" - e.map((item, key) => { - if (item.props.name != "") { - newlist = newlist + `${item.props.name}` - } - }) - this.setState({ - subvalues: newlist - }) - } - - post_apply = () => { - this.setState({ - postapplyvisible: true - }) - } - - - sendhideModaly = () => { - this.setState({ - postapplyvisible: false, - }) - if (this.state.file !== undefined) { - // this.deleteAttachment(this.state.file); - this.setState({ - file: undefined, - deleteisnot: true, - language: "", - runtime: "", - run_method: "", - fileList: [] - }) - } else { - this.setState({ - file: undefined, - deleteisnot: true, - language: "", - runtime: "", - run_method: "", - fileList: [] - }) - } - } - - - sendsure_apply = () => { - let {language, runtime, run_method} = this.state; - - if (!language || language === "") { - // this.props.showNotification(`请填写该镜像是基于什么语言`); - this.setState({ - languagewritetype: true - }) - return - } - if (!runtime || runtime === "") { - // this.props.showNotification(`请填写该镜像是基于什么语言系统环境`); - this.setState({ - systemenvironmenttype: true - }) - return; - - } - if (!run_method || run_method === "") { - // this.props.showNotification(`请填写该镜像中测试代码运行方式`); - this.setState({ - testcoderunmodetype: true - }) - return; - } - - var attachment_ids = undefined; - if (this.state.fileList) { - attachment_ids = this.state.fileList.map(item => { - return item.response ? item.response.id : item.id - }) - } - - if (attachment_ids === undefined || attachment_ids.length === 0) { - this.setState({ - attachmentidstype: true - }) - return; - } - - var data = { - language: language, - runtime: runtime, - run_method: run_method, - attachment_id: attachment_ids[0], - } - var url = `/shixuns/apply_shixun_mirror.json`; - axios.post(url, data - ).then((response) => { - - try { - if (response.data) { - - if (this.state.file !== undefined) { - this.setState({ - file: undefined, - deleteisnot: true, - language: "", - runtime: "", - run_method: "", - fileList: [] - }) - } else { - this.setState({ - file: undefined, - deleteisnot: true, - language: "", - runtime: "", - run_method: "", - fileList: [] - }) - } - - notification.open( - { - message: '提示', - description: - '新建申请已提交,请等待管理员审核。', - - } - ) - this.sendhideModaly() - - } - } catch (e) { - - } - - }) - - } - - setlanguage = (e) => { - this.setState({ - language: e.target.value - }) - if (e.target.value) { - this.setState({ - languagewritetype: false - }) - } - } - setruntime = (e) => { - this.setState({ - runtime: e.target.value - }) - if (e.target.value) { - this.setState({ - systemenvironmenttype: false - }) - } - - } - - setrun_method = (e) => { - this.setState({ - run_method: e.target.value - }) - if (e.target.value) { - this.setState({ - testcoderunmodetype: false - }) - } - } - - - // 附件相关 START - handleChange = (info) => { - if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { - let {fileList} = this.state; - - if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { - console.log("handleChange1"); - // if(fileList.length===0){ - let fileLists = info.fileList; - this.setState({ - // fileList:appendFileSizeToUploadFileAll(fileList), - fileList: fileLists, - deleteisnot: false - }); - // } - } - } - } - - onAttachmentRemove = (file) => { - if (!file.percent || file.percent == 100) { - Modal.confirm({ - title: '确定要删除这个附件吗?', - okText: '确定', - cancelText: '取消', - // content: 'Some descriptions', - onOk: () => { - console.log("665") - this.deleteAttachment(file) - }, - onCancel() { - console.log('Cancel'); - }, - }); - return false; - } - - } - - deleteAttachment = (file) => { - console.log(file); - let id = file.response == undefined ? file.id : file.response.id - const url = `/attachments/${id}.json` - axios.delete(url, {}) - .then((response) => { - if (response.data) { - const {status} = response.data; - if (status == 0) { - // console.log('--- success') - - this.setState((state) => { - - const index = state.fileList.indexOf(file); - const newFileList = state.fileList.slice(); - newFileList.splice(index, 1); - return { - fileList: newFileList, - deleteisnot: true - }; - }); - } - } - }) - .catch(function (error) { - console.log(error); - }); - } - - render() { - const {getFieldDecorator} = this.props.form; - const {newshixunlist, fileList, postapplytitle, postapplyvisible} = this.state; - const uploadProps = { - width: 600, - fileList, - multiple: true, - action: `${getUploadActionUrl()}`, - onChange: this.handleChange, - onRemove: this.onAttachmentRemove, - beforeUpload: (file, fileList) => { - - if (this.state.fileList.length >= 1) { - return false - } - - const isLt150M = file.size / 1024 / 1024 < 50; - if (!isLt150M) { - - notification.open( - { - message: '提示', - description: - '文件大小必须小于50MB', - - } - ) - } - if (this.state.file !== undefined) { - this.setState({ - file: file - }) - } else { - this.setState({ - file: file - }) - } - return isLt150M; - }, - } - - return ( -
    - -
    -
    - -
    - -
    - 新建实训项目 - {this.props.user && this.props.user.main_site === true ? - 实训制作指南 : ""} -
    -
    -
    - - {getFieldDecorator('is_jupyter')( - - 普通实训 - Jupyter实训 - , - )} - - - {getFieldDecorator('name', { - rules: [{ - required: true, message: '请输入名称', - }, { - max: 60, message: '请输入名称,最大限制60个字符', - }, { - whitespace: true, message: '请勿输入空格' - }], - })( - - )} - - - - - - - - {getFieldDecorator('select', { - rules: [{required: true, message: '请选择难易度'}], - })( -
    - - -
    - )} - (实训的难易程度) -
    - - - -
    - - {getFieldDecorator('main_type', { - rules: [{required: true, message: '请选择主类别'}], - })( -
    - - - -
    - )} -
    -
    - - - -
    - {getFieldDecorator('sub_type')( -
    - -
    - )} - -
    - {this.state.mainvalues === undefined && this.state.subvalues === undefined || this.state.mainvalues === "" && this.state.subvalues === "" ? "" : -
    - {`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : this.state.mainvalues}`} - {`${this.state.subvalues === undefined || this.state.subvalues === "" ? "" : this.state.mainvalues === undefined || this.state.mainvalues === "" ? this.state.subvalues : this.state.subvalues}`} - {`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : this.state.mainvalues}${this.state.subvalues === undefined || this.state.subvalues === "" ? "" : - this.state.mainvalues === undefined || this.state.mainvalues === "" ? this.state.subvalues : this.state.subvalues}`} -
    } - -
    -
    -
    -
    - - -
    -
    -
    - 没有实验环境? - 申请新建 -
    - {postapplyvisible === true ? : ""} - - -
    -
  • - - -
  • -
    {this.state.languagewritetype === true ? "请填写该镜像语言" : ""}
    -
  • - - -
  • -
    {this.state.systemenvironmenttype === true ? "请填写该镜像语言系统环境" : ""}
    -
  • - - - -
  • -
    {this.state.testcoderunmodetype === true ? "请填写该镜像测试代码运行方式" : ""}
    -
  • - -
    - - - 上传附件 - (单个文件50M以内) - - -
    - -
  • -
    - {this.state.attachmentidstype === true ? "请上传附件" : ""} -
    -
  • - this.sendhideModaly()} - >取消 - -
  • -
    -
    - {/**/} -
    - -
    - -
    -
    -
    - this.handleSubmit()} loadings={this.state.loading}/> -
    - - ); - } -} - -const NewshixunsNew = Form.create({name: 'newshixun'})(Newshixuns); - -export default SnackbarHOC()(TPMIndexHOC(NewshixunsNew)); - - - - - - diff --git a/public/react/src/modules/tpm/newshixuns/Shixunmd.js b/public/react/src/modules/tpm/newshixuns/Shixunmd.js deleted file mode 100644 index 608c7ea63..000000000 --- a/public/react/src/modules/tpm/newshixuns/Shixunmd.js +++ /dev/null @@ -1,111 +0,0 @@ -import React, { Component } from 'react'; -import {Button,Form,Input} from 'antd'; -import axios from 'axios'; -import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; -class Osshackathonmd extends Component{ - constructor(props) { - super(props) - this.contentMdRef = React.createRef(); - this.state={ - title_num: 0, - title_value: undefined - } - } - componentDidUpdate =(prevState)=>{ - // if(prevState!=this.props){ - // let url=`/osshackathon/edit_hackathon.json`; - // axios.get(url).then((result)=>{ - // if(result.status==200){ - // this.setState({ - // title_value:result.data.name - // }) - // this.contentMdRef.current.setValue(result.data.description); - // } - // }) - // } - } - componentDidMount(){ - let url=`/osshackathon/edit_hackathon.json`; - axios.get(url).then((result)=>{ - if(result.status==200){ - this.setState({ - title_value:result.data.name - }) - this.contentMdRef.current.setValue(result.data.description === null ? "" : result.data.description); - } - }) - } - - - // 输入title - changeTitle = (e) => { - // title_num: 60 - parseInt(e.target.value.length), - this.setState({ - title_num: e.target.value.length, - title_value: e.target.value - }) - - } - handleSubmit = () => { - let {title_value}=this.state; - const mdContnet = this.contentMdRef.current.getValue().trim(); - // if(mdContnet.length>10000){ - // this.props.showNotification("内容超过10000个字"); - // return - // } - - let url=`/osshackathon/update_hackathon.json`; - axios.post(url,{ - name:title_value, - description:mdContnet, - } - ).then((response) => { - if(response.data.status===0){ - this.props.getosshackathon() - this.props.hidehackathonedit() - this.props.showNotification(`提交成功`); - } - }).catch((error) => { - console.log(error) - }) - - } - render() { - - - // console.log(this.props.tabkey) - // console.log(chart_rules) - - return ( -
    -
    - - - - - - - -
    - - - - -
    - - ) - } -} -export default Osshackathonmd; diff --git a/public/react/src/modules/tpm/newshixuns/TPMNewshixuns/TPMNewshixuns.js b/public/react/src/modules/tpm/newshixuns/TPMNewshixuns/TPMNewshixuns.js deleted file mode 100644 index 8b102651f..000000000 --- a/public/react/src/modules/tpm/newshixuns/TPMNewshixuns/TPMNewshixuns.js +++ /dev/null @@ -1,19 +0,0 @@ -import React, { Component } from 'react'; - -import axios from 'axios'; - -export default class TPMNewshixuns extends Component { - constructor(props) { - super(props) - this.state = { - - } - } - render() { - return ( - - ); - } -} - - diff --git a/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css b/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css deleted file mode 100644 index 003002749..000000000 --- a/public/react/src/modules/tpm/newshixuns/css/Newshixuns.css +++ /dev/null @@ -1,833 +0,0 @@ -/* BASICS */ - -.CodeMirror { - /* Set height, width, borders, and global font properties here */ - font-family: monospace; - height: 300px; - color: black; - direction: ltr; -} - -/* PADDING */ - -.CodeMirror-lines { - padding: 4px 0; /* Vertical padding around content */ -} -.CodeMirror pre { - padding: 0 4px; /* Horizontal padding of content */ -} - -.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - background-color: white; /* The little square between H and V scrollbars */ -} - -/* GUTTER */ - -.CodeMirror-gutters { - border-right: 1px solid #ddd; - background-color: #f7f7f7; - white-space: nowrap; -} -.CodeMirror-linenumbers {} -.CodeMirror-linenumber { - padding: 0 3px 0 5px; - min-width: 20px; - text-align: right; - color: #999; - white-space: nowrap; -} - -.CodeMirror-guttermarker { color: black; } -.CodeMirror-guttermarker-subtle { color: #999; } - -/* CURSOR */ - -.CodeMirror-cursor { - border-left: 1px solid black; - border-right: none; - width: 0; -} -/* Shown when moving in bi-directional text */ -.CodeMirror div.CodeMirror-secondarycursor { - border-left: 1px solid silver; -} -.cm-fat-cursor .CodeMirror-cursor { - width: auto; - border: 0 !important; - background: #7e7; -} -.cm-fat-cursor div.CodeMirror-cursors { - z-index: 1; -} -.cm-fat-cursor-mark { - background-color: rgba(20, 255, 20, 0.5); - -webkit-animation: blink 1.06s steps(1) infinite; - animation: blink 1.06s steps(1) infinite; -} -.cm-animate-fat-cursor { - width: auto; - border: 0; - -webkit-animation: blink 1.06s steps(1) infinite; - animation: blink 1.06s steps(1) infinite; - background-color: #7e7; -} -@-webkit-keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} -@keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} - -/* Can style cursor different in overwrite (non-insert) mode */ -.CodeMirror-overwrite .CodeMirror-cursor {} - -.cm-tab { display: inline-block; text-decoration: inherit; } - -.CodeMirror-rulers { - position: absolute; - left: 0; right: 0; top: -50px; bottom: -20px; - overflow: hidden; -} -.CodeMirror-ruler { - border-left: 1px solid #ccc; - top: 0; bottom: 0; - position: absolute; -} - -/* DEFAULT THEME */ - -.cm-s-default .cm-header {color: blue;} -.cm-s-default .cm-quote {color: #090;} -.cm-negative {color: #d44;} -.cm-positive {color: #292;} -.cm-header, .cm-strong {font-weight: bold;} -.cm-em {font-style: italic;} -.cm-link {text-decoration: underline;} -.cm-strikethrough {text-decoration: line-through;} - -.cm-s-default .cm-keyword {color: #708;} -.cm-s-default .cm-atom {color: #219;} -.cm-s-default .cm-number {color: #164;} -.cm-s-default .cm-def {color: #00f;} -.cm-s-default .cm-variable, -.cm-s-default .cm-punctuation, -.cm-s-default .cm-property, -.cm-s-default .cm-operator {} -.cm-s-default .cm-variable-2 {color: #05a;} -.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;} -.cm-s-default .cm-comment {color: #a50;} -.cm-s-default .cm-string {color: #a11;} -.cm-s-default .cm-string-2 {color: #f50;} -.cm-s-default .cm-meta {color: #555;} -.cm-s-default .cm-qualifier {color: #555;} -.cm-s-default .cm-builtin {color: #30a;} -.cm-s-default .cm-bracket {color: #997;} -.cm-s-default .cm-tag {color: #170;} -.cm-s-default .cm-attribute {color: #00c;} -.cm-s-default .cm-hr {color: #999;} -.cm-s-default .cm-link {color: #00c;} - -.cm-s-default .cm-error {color: #f00;} -.cm-invalidchar {color: #f00;} - -.CodeMirror-composing { border-bottom: 2px solid; } - -/* Default styles for common addons */ - -div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;} -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} -.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } -.CodeMirror-activeline-background {background: #e8f2ff;} - -/* STOP */ - -/* The rest of this file contains styles related to the mechanics of - the editor. You probably shouldn't touch them. */ - -.CodeMirror { - position: relative; - overflow: hidden; - background: white; -} - -.CodeMirror-scroll { - overflow: scroll !important; /* Things will break if this is overridden */ - /* 30px is the magic margin used to hide the element's real scrollbars */ - /* See overflow: hidden in .CodeMirror */ - margin-bottom: -30px; margin-right: -30px; - padding-bottom: 30px; - height: 100%; - outline: none; /* Prevent dragging from highlighting the element */ - position: relative; -} -.CodeMirror-sizer { - position: relative; - border-right: 30px solid transparent; -} - -/* The fake, visible scrollbars. Used to force redraw during scrolling - before actual scrolling happens, thus preventing shaking and - flickering artifacts. */ -.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - position: absolute; - z-index: 6; - display: none; -} -.CodeMirror-vscrollbar { - right: 0; top: 0; - overflow-x: hidden; - overflow-y: scroll; -} -.CodeMirror-hscrollbar { - bottom: 0; left: 0; - overflow-y: hidden; - overflow-x: scroll; -} -.CodeMirror-scrollbar-filler { - right: 0; bottom: 0; -} -.CodeMirror-gutter-filler { - left: 0; bottom: 0; -} - -.CodeMirror-gutters { - position: absolute; left: 0; top: 0; - min-height: 100%; - z-index: 3; -} -.CodeMirror-gutter { - white-space: normal; - height: 100%; - display: inline-block; - vertical-align: top; - margin-bottom: -30px; -} -.CodeMirror-gutter-wrapper { - position: absolute; - z-index: 4; - background: none !important; - border: none !important; -} -.CodeMirror-gutter-background { - position: absolute; - top: 0; bottom: 0; - z-index: 4; -} -.CodeMirror-gutter-elt { - position: absolute; - cursor: default; - z-index: 4; -} -.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent } -.CodeMirror-gutter-wrapper ::selection { background-color: transparent } -.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent } - -.CodeMirror-lines { - cursor: text; - min-height: 1px; /* prevents collapsing before first draw */ -} -.CodeMirror pre { - /* Reset some styles that the rest of the page might have set */ border-radius: 0; - border-width: 0; - background: transparent; - font-family: inherit; - font-size: inherit; - margin: 0; - white-space: pre; - word-wrap: normal; - line-height: inherit; - color: inherit; - z-index: 2; - position: relative; - overflow: visible; - -webkit-tap-highlight-color: transparent; - -webkit-font-variant-ligatures: contextual; - font-variant-ligatures: contextual; -} -.CodeMirror-wrap pre { - word-wrap: break-word; - white-space: pre-wrap; - word-break: normal; -} - -.CodeMirror-linebackground { - position: absolute; - left: 0; right: 0; top: 0; bottom: 0; - z-index: 0; -} - -.CodeMirror-linewidget { - position: relative; - z-index: 2; - padding: 0.1px; /* Force widget margins to stay inside of the container */ -} - -.CodeMirror-widget {} - -.CodeMirror-rtl pre { direction: rtl; } - -.CodeMirror-code { - outline: none; -} - -/* Force content-box sizing for the elements where we expect it */ -.CodeMirror-scroll, -.CodeMirror-sizer, -.CodeMirror-gutter, -.CodeMirror-gutters, -.CodeMirror-linenumber { - -webkit-box-sizing: content-box; - box-sizing: content-box; -} - -.CodeMirror-measure { - position: absolute; - width: 100%; - height: 0; - overflow: hidden; - visibility: hidden; -} - -.CodeMirror-cursor { - position: absolute; - pointer-events: none; -} -.CodeMirror-measure pre { position: static; } - -div.CodeMirror-cursors { - visibility: hidden; - position: relative; - z-index: 3; -} -div.CodeMirror-dragcursors { - visibility: visible; -} - -.CodeMirror-focused div.CodeMirror-cursors { - visibility: visible; -} - -.CodeMirror-selected { background: #d9d9d9; } -.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } -.CodeMirror-crosshair { cursor: crosshair; } -.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } -.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } -.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } - -.cm-searching { - background-color: #ffa; - background-color: rgba(255, 255, 0, .4); -} - -/* Used to force a border model for a node */ -.cm-force-border { padding-right: .1px; } - -@media print { - /* Hide the cursor when printing */ - .CodeMirror div.CodeMirror-cursors { - visibility: hidden; - } -} - -/* See issue #2901 */ -.cm-tab-wrap-hack:after { content: ''; } - -/* Help users use markselection to safely style text background */ -span.CodeMirror-selectedtext { background: none; } - - - - -.radioStyle{ - display: block; - height: 30px; - } -a.white-btn.use_scope-btn:hover{ - -} -.shixunScopeInput{ - width:218px; - height:33px; - display:block; - margin-bottom:15px; -} - -#memoMD .CodeMirror { - /*width: 576px !important;*/ - margin-top: 31px !important; - height: 364px !important; -} - -#memoMD .editormd-preview { - width: 578px !important; - top: 40px !important; - height: 364px !important; -} - -.ml36{ - margin-left: 26px; -} -#person-unit a.white-btn.use_scope-btn:hover { - border: 1px solid #F06200; - color:#FFF !important; -} - -.shixunspanred{ - margin-left: 142px; - margin-top: 5px; - margin-bottom: 5px; -} - -.ml82{ - margin-left: 82px; -} - -.ant-btn-primary.active, .ant-btn-primary:active { - color: #fff; - background-color: #096dd9; - border-color: #096dd9; -} - -/*.ant-btn:hover, .ant-btn:focus, .ant-btn:active, .ant-btn.active{*/ -/* background-color: #4CACFF;*/ -/*}*/ - -.newViewAfter .ant-input{ - line-height: 40px !important; - height: 40px !important; - box-shadow: none!important; -} - -.width30{ - width: 30%; -} - -.newshixunheadersear{ - display: -ms-flexbox; - display: flex; - -ms-flex-pack: center; - justify-content: center; - margin: 0 auto; -} -.packinput .ant-input{ - height: 55px; - width:663px !important; - font-size: 14px; - /*color: #681616 !important;*/ - border-color: #E1EDF8 !important; - padding-left: 20px; -} - -.packinput .ant-input-group-addon .ant-btn{ - width:137px !important; - font-size: 18px; - height: 53px; - background:rgba(76,172,255,1); - -} -.tabtitle{ - height: 62px !important; - -webkit-box-shadow: 3px 10px 21px 0px rgba(76, 76, 76, 0.15); - box-shadow: 3px 10px 21px 0px rgba(76, 76, 76, 0.15); - border-radius: 6px; - background: #fff; - display: -ms-flexbox; - display: flex; - -ms-flex-pack: center; - justify-content: center; -} -.tabtitles2{ - background: #fff; - height: 62px !important; - width: 1200px; -} - -.tabtitless{ - height: 62px !important; - line-height: 62px !important; - -} -.tabtitle1{ - -} -.tabtitle2{ - margin-left: 30px !important; - -} - - -.counttit{ - display: -ms-flexbox; - display: flex; - -ms-flex-pack: center; - justify-content: center; -} - -.counttittext{ - text-align: left; - width: 1200px; - height: 18px; - color: #888888; - font-size: 13px; - margin-top: 24px; - - -} -.counttittexts{ - color: #4CACFF !important; - font-size: 13px; -} - -.mainx{ - display: -ms-flexbox; - display: flex; - -ms-flex-pack: center; - justify-content: center; - margin-top: 17px; -} -.project-packages-list{ - -} -.project-package-item{ - display: -ms-flexbox; - display: flex; - -ms-flex-direction:column; - flex-direction:column; - margin-bottom: 20px; - padding: 20px; - background: white; - /* box-shadow: 1px 3px 3px 1px rgba(156,156,156,0.16); */ - -} -.xuxianpro{ - height: 20px; - border-bottom: 1px dashed; - border-color: #EAEAEA; - margin-bottom: 18px; -} -.magr11{ - margin-top: 11px; -} -.highlight{ - color: #4CACFF; -} -.fonttext{ - font-size: 20px; - font-weight:bold; -} - -.fontextcolor{ - color: #777777; -} -.tzbq{ - margin-left: 68px; -} -.tzbqx{ - /* margin-left: 24px; */ -} -.bjyss{ - background: #F8F8F8; -} -.zj{ - overflow:hidden; - -o-text-overflow:ellipsis; - text-overflow:ellipsis; - white-space:nowrap -} -.ziticor{ - color: #777777; - font-size: 13px; -} -.foohter{ - margin-top: 20px; - display: -ms-flexbox; - display: flex; - -ms-flex-direction:row; - flex-direction:row; -} - -.maxwidth1100{ - max-width: 1100px; - overflow:hidden; - -o-text-overflow:ellipsis; - text-overflow:ellipsis; - white-space:nowrap; - font-size: 18px !important; - font-weight: 500; - color: rgba(51,51,51,1) !important; -} - - -.newshixunmodelmidfont{ - font-size: 14px; - font-weight: 400; - color: #999999; - margin-top: 15px; - margin-left: 30px; - max-width: 1100px; - overflow: hidden; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 2; -} - -.newshixunmodelbotfont{ - font-size:12px; - font-weight:400; - color:rgba(102,102,102,1); - margin-top: 15px; - margin-left: 30px; -} - -.newshixunlist{ - max-height:227px; - width: 1200px; -} - -.xuxianpro { - height: 20px; - border-bottom: 1px dashed; - border-color: #eaeaea; - margin-bottom: 18px; -} - -.newshixunpd030{ - padding: 0px 30px; -} - -.pd303010{ - padding: 30px 30px 10px; -} - -.newshixunfont12{ - font-size: 12px; - color: rgba(76,172,255,1); - line-height: 21px; -} - -.newshixunmode{ - width: 100px; - height: 38px; - border-radius: 3px; - /*border: 1px solid rgba(191,191,191,1);*/ -} - -.ntopsj { - position: absolute; - top: -4px; -} - -.nyslbottomsj { - position: absolute; - bottom: -6px; -} - -.inherits .ant-dropdown-menu-item{ - cursor: inherit !important; -} - -.menus{ - width: 91px; - text-align: center; -} - -.newshixunmodelbotfont span{ - display: inline-block; - margin-right: 34px; -} - -.minhegiht300{ - min-height: 300px; -} - -.newshixunlist:hover{ - -webkit-box-shadow: 1px 6px 16px rgba(156,156,156,0.16); - box-shadow: 1px 6px 16px rgba(156,156,156,0.16); - opacity: 1; - border-radius: 2px; -} - -.newshixun500{ - max-width: 500px; - overflow: hidden; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - white-space: nowrap; -} - -.mt3 { - margin-top: 3px !important; -} - -.highlight{ - color: #4CACFF; -} - -.newshixunbottombtn{ - position: fixed; - z-index: 1000; - bottom: 0px; - width: 100%; - height: 63px; - background: rgba(255,255,255,1); - -webkit-box-shadow: 0px -4px 4px 0px rgba(0,0,0,0.05); - box-shadow: 0px -4px 4px 0px rgba(0,0,0,0.05); -} - - -.mb60shixun{ - margin-bottom: 60px !important; -} - -.padding13-30 { - padding: 13px 30px; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -.displaymodulat { - display: -ms-flexbox; - display: flex; - display: -webkit-flex; - -ms-flex-direction: column; - flex-direction: column; - -ms-flex-align: center; - align-items: center; -} - -.WordNumberTextarea { - outline: none; /* 去掉输入字符时的默认样式 */ - appearance: none; - -webkit-appearance: none; - -moz-appearance: none; - background-color: white; - text-shadow: none; - -webkit-writing-mode: horizontal-tb !important; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - resize: none; /*禁止拉伸*/ - border: none; /*去掉默认边框*/ - width: 100%; - height: 130px; - border: none; - display: block; -} - -.WordNumbernote { - padding: 0; - margin: 0; - list-style: none; - text-decoration: none; - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - height: auto; - border: 1px solid rgba(234, 234, 234, 1); - border-radius: 0.125rem; - margin: 10px 10px 0px 10px; - padding: 10px 10px 5px 10px; - backgroud: rgba(234, 234, 234, 1); - width: 530px; - margin-left: 10px; - margin-top: 5px; - height: 214px !important; -} - -.WordNumbernote .WordNumberTextarea { - outline: none; - appearance: none; - -webkit-appearance: none; - -moz-appearance: none; - background-color: white; - text-shadow: none; - -webkit-writing-mode: horizontal-tb !important; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - resize: none; - border: none; - width: 100%; - height: 169px !important; - border: none; - display: block; -} - -.WordNumberTextarea-count { - display: inline-block; - float: right; - font-size: 16px; - color: #adadad; - padding-right: 0.25rem; -} - -.borerinput { - border: 1px solid #DD1717 !important; -} - -.borerinputs { - border: 1px solid #eee !important; -} - - -.mexertwo { - display: -ms-flexbox; - display: flex; - -ms-flex-direction: initial; - flex-direction: initial; -} - -.mexeheigth { - line-height: 40px; -} - -.mexeheigth2 { - line-height: 40px; - width: 74px; -} - -.minbuttionte { - /* display: flex; */ - margin-top: 20px; - width: 100%; - /* align-items: center; */ - margin-bottom: 17px; - display: -ms-flexbox; - display: flex; - -ms-flex-direction: column; - flex-direction: column; - -ms-flex-align: center; - align-items: center; - -ms-flex-pack: center; - justify-content: center; - -ms-flex-direction: initial; - flex-direction: initial; -} - -.initialflex{ - display: -ms-flexbox; - display: flex; - -ms-flex-direction:initial; - flex-direction:initial; -} - -.newshixunheadersear{ - margin: 0 auto; -} - -.newshixunmodels{ - margin: 0 auto; -} - -.backgroundFFF{ - background: #FFF !important; -} - -.relative{ - position: relative; -} - -.pd40px{ - padding-bottom: 40px; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/newshixuns/oldNewshixuns.js b/public/react/src/modules/tpm/newshixuns/oldNewshixuns.js deleted file mode 100644 index 4904219bb..000000000 --- a/public/react/src/modules/tpm/newshixuns/oldNewshixuns.js +++ /dev/null @@ -1,1356 +0,0 @@ -import React, {Component} from 'react'; - -import {TPMIndexHOC} from '../TPMIndexHOC'; - -import {SnackbarHOC,appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder'; - -import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification,Tooltip} from 'antd'; - -// import "antd/dist/antd.css"; - -import locale from 'antd/lib/date-picker/locale/zh_CN'; - -import axios from 'axios'; - -import './css/Newshixuns.css'; - -import {getUrl} from 'educoder' - -import moment from 'moment'; - -let path = getUrl("/editormd/lib/") - -const $ = window.$; - -let timeout; - -let currentValue; - -const Option = Select.Option; - -const RadioGroup = Radio.Group; -const confirm = Modal.confirm; - - -// 处理整点 半点 -// 取传入时间往后的第一个半点 -export function handleDateStrings(dateString) { - if (!dateString) return dateString; - const ar = dateString.split(':') - if (ar[1] == '00' || ar[1] == '30') { - return dateString - } - const miniute = parseInt(ar[1]); - if (miniute < 30 || miniute == 60) { - return [ar[0], '30'].join(':') - } - if (miniute < 60) { - // 加一个小时 - const tempStr = [ar[0], '00'].join(':'); - const format = "YYYY-MM-DD HH:mm"; - const _moment = moment(tempStr, format) - _moment.add(1, 'hours') - return _moment.format(format) - } - - return dateString -} - - - -// 恢复数据 -function md_rec_data(k, mdu, id, editor) { - if (window.sessionStorage.getItem(k + mdu) !== null) { - editor.setValue(window.sessionStorage.getItem(k + mdu)); - md_clear_data(k, mdu, id); - } -} - -// 保存数据 -function md_add_data(k, mdu, d) { - window.sessionStorage.setItem(k + mdu, d); -} - -// 清空保存的数据 -function md_clear_data(k, mdu, id) { - window.sessionStorage.removeItem(k + mdu); - var id1 = "#e_tip_" + id; - var id2 = "#e_tips_" + id; - if (k == 'content') { - $(id2).html(""); - } else { - $(id1).html(""); - } -} - -function md_elocalStorage(editor, mdu, id) { - if (window.sessionStorage) { - var oc = window.sessionStorage.getItem('content' + mdu); - if (oc !== null) { - $("#e_tips_" + id).data('editor', editor); - var h = '您上次有已保存的数据,是否恢复 ? / 不恢复'; - $("#e_tips_" + id).html(h); - } - setInterval(function () { - var d = new Date(); - var h = d.getHours(); - var m = d.getMinutes(); - var s = d.getSeconds(); - h = h < 10 ? '0' + h : h; - m = m < 10 ? '0' + m : m; - s = s < 10 ? '0' + s : s; - if (editor.getValue().trim() != "") { - md_add_data("content", mdu, editor.getValue()); - var id1 = "#e_tip_" + id; - var id2 = "#e_tips_" + id; - - $(id1).html(" 数据已于 " + h + ':' + m + ':' + s + " 保存 "); - $(id2).html(""); - } - }, 10000); - - } else { - $("#e_tip_" + id).after('您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!'); - } -} - - -function create_editorMD(id, width, high, placeholder, imageUrl, callback) { - var editorName = window.editormd(id, { - width: width, - height: high, - path: path, // "/editormd/lib/" - - syncScrolling: "single", - tex: true, - tocm: true, - emoji: true, - taskList: true, - codeFold: true, - searchReplace: true, - htmlDecode: "style,script,iframe", - sequenceDiagram: true, - autoFocus: false, - toolbarIcons: function () { - // Or return editormd.toolbarModes[name]; // full, simple, mini - // Using "||" set icons align right. - return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"] - }, - toolbarCustomIcons: { - testIcon: "
    ", - testIcon1: "
    " - }, - //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。 - saveHTMLToTextarea: true, - // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标 - dialogMaskOpacity: 0.6, - placeholder: placeholder, - imageUpload: true, - imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], - imageUploadURL: imageUrl,//url - onload: function () { - // this.previewing(); - $("#" + id + " [type=\"latex\"]").bind("click", function () { - editorName.cm.replaceSelection("```latex"); - editorName.cm.replaceSelection("\n"); - editorName.cm.replaceSelection("\n"); - editorName.cm.replaceSelection("```"); - var __Cursor = editorName.cm.getDoc().getCursor(); - editorName.cm.setCursor(__Cursor.line - 1, 0); - }); - - $("#" + id + " [type=\"inline\"]").bind("click", function () { - editorName.cm.replaceSelection("`$$$$`"); - var __Cursor = editorName.cm.getDoc().getCursor(); - editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 3); - editorName.cm.focus(); - }); - $("[type=\"inline\"]").attr("title", "行内公式"); - $("[type=\"latex\"]").attr("title", "多行公式"); - - md_elocalStorage(editorName, `memoNew_${id}`, "memoNew"); - - callback && callback() - } - }); - return editorName; -} - -function range(start, end) { - const result = []; - for (let i = start; i < end; i++) { - result.push(i); - } - return result; -} -function disabledDateTime() { - return { - // disabledHours: () => range(0, 24).splice(4, 20), - disabledMinutes: () => range(1, 30).concat(range(31, 60)), - // disabledSeconds: () => [0, 60], - }; -} - -function disabledDate(current) { - return current && current < moment().endOf('day').subtract(1, 'days'); -} -class Newshixuns extends Component { - constructor(props) { - super(props) - this.state = { - fileList: [], - newshixunlist: undefined, - departmentslist: undefined, - name: "", - main_type: "", - small_type: "", - trainee: "", - webssh: 0, - use_scope: 0, - can_copy: "", - scope_partment: undefined, - vnc: "", - scopetype: false, - postapplyvisible: false, - sendsure_applyvalue: undefined, - postapplytitle: false, - shixun_nametype: false, - main_types: false, - trainee_types: false, - SelectTheCommandtype: false, - opers: false, - operss: false, - TimePickervalue: "", - opensmail: false, - onSearchvalue: "", - scope_partmenttype: false, - languagewrite: undefined, - systemenvironment:undefined, - testcoderunmode:undefined, - file:undefined, - deleteisnot:true, - languagewritetype:false, - systemenvironmenttype:false, - testcoderunmodetype:false, - attachmentidstype:false, - datalisttype:false, - bottonloading:false - } - } - - initMD(initValue) { - this.contentChanged = false; - const placeholder = ""; - // amp; - // 编辑时要传memoId - const imageUrl = `getUploadActionUrl`; - // 创建editorMd - - const taskpass_editormd = create_editorMD("memoMD", '100%', 400, placeholder, imageUrl, () => { - setTimeout(() => { - taskpass_editormd.resize() - taskpass_editormd.cm && taskpass_editormd.cm.refresh() - }, 500) - - if (initValue) { - taskpass_editormd.setValue(initValue) - } - taskpass_editormd.cm.on("change", (_cm, changeObj) => { - // console.log('....contentChanged') - this.contentChanged = true; - }) - }); - this.taskpass_editormd = taskpass_editormd; - window.taskpass_editormd = taskpass_editormd; - - } - - componentDidMount() { - let newshixunUrl = `/shixuns/new.json`; - axios.get(newshixunUrl).then((response) => { - if (response.status === 200) { - if (response.data.message===undefined) { - this.setState({ - newshixunlist: response.data - }); - this.initMD(response.data.sample[0][1]); - } - - } - }).catch((error) => { - console.log(error) - }); - - let departmentsUrl = `/shixuns/departments.json`; - axios.get(departmentsUrl).then((response) => { - if (response.status === 200) { - if (response.data.message===undefined) { - this.setState({ - departmentslist: response.data.shools_name - }); - } - } - }).catch((error) => { - console.log(error) - }); - } - - setlanguagewrite = (e)=>{ - this.setState({ - languagewrite: e.target.value - }) - } - - setsystemenvironment = (e) => { - this.setState({ - systemenvironment: e.target.value - }) - } - settestcoderunmode = (e) => { - this.setState({ - testcoderunmode: e.target.value - }) - - } - shixunname = (e) => { - this.setState({ - name: e.target.value, - shixun_nametype: false - }); - } - - bigClass = (value) => { - this.setState({ - main_type: value - }) - } - - littleClass = (value) => { - this.setState({ - small_type: value - }) - } - - Selectthestudent = (value) => { - this.setState({ - trainee: value - }) - } - - SelectTheCommand = (e) => { - this.setState({ - webssh: e.target.value, - }); - - if (e.target.value === 2) { - this.setState({ - SelectTheCommandtype: true, - multi_webssh: false - }); - } else { - this.setState({ - SelectTheCommandtype: false, - multi_webssh: false - }); - } - } - - Selectpublic = (e) => { - this.setState({ - scopetype: false, - use_scope: e.target.value, - }); - if (e.target.value === 1) { - this.setState({ - scopetype: true - }); - } - - } - - Teacherscopy = (e) => { - let sum = "" - if (e.target.checked === false) { - sum = 0 - } else if (e.target.checked === true) { - sum = 1 - } - this.setState({ - can_copy: sum, - }); - } - - TeachersUbuntu = (e) => { - let sum = "" - if (e.target.checked === false) { - sum = 0 - } else if (e.target.checked === true) { - sum = 1 - } - this.setState({ - vnc: sum, - }); - } - - adduse_scopeinput = () => { - let {scope_partment} = this.state; - let array = scope_partment; - let newarray = "" - array.push(newarray) - this.setState({ - scope_partment: array, - }); - } - - shixunScopeInput = (e, id) => { - let types=false - let {scope_partment} = this.state; - let datalist = scope_partment; - if (datalist === undefined) { - datalist = [] - } - - datalist.map((item,key)=>{ - if(e===item){ - types=true - this.setState({ - datalisttype:true - }) - return - } - }) - - if(types===false){ - datalist.push(e) - this.setState({ - scope_partment: datalist, - onSearchvalue: "" - }); - } - - - } - - deleteScopeInput = (key) => { - let {scope_partment} = this.state; - let datalist = scope_partment; - datalist.splice(key, 1); - this.setState({ - scope_partment: datalist - }); - } - - //提交数据 - submit_new_shixun = () => { - const mdVal = this.taskpass_editormd.getValue(); - let {can_copy, main_type, name, scope_partment, small_type, trainee, use_scope, vnc, webssh, multi_webssh, TimePickervalue} = this.state; - let Url = `/shixuns.json` - if (name === "") { - this.setState({ - shixun_nametype: true - }) - this.props.showSnackbar("实训名称为空"); - $('html').animate({ - scrollTop: 10 - }, 1000); - return - } - if (main_type === "") { - this.setState({ - main_types: true - }) - $('html').animate({ - scrollTop: 700 - }, 1000); - this.props.showSnackbar("请选择技术平台大类别"); - - return - } - - if (use_scope === 1) { - if (scope_partment === undefined || scope_partment.length === 0) { - this.setState({ - scope_partmenttype: true - }) - $('html').animate({ - scrollTop: 900 - }, 1000); - this.props.showSnackbar("公开程度,指定单位为空"); - return - } - } - if (trainee === "") { - this.setState({ - trainee_types: true - }) - // $('html').animate({ - // scrollTop: 700 - // }, 1000); - this.props.showSnackbar("请选择发布信息"); - return - } - let newmulti_webssh = multi_webssh; - if (newmulti_webssh === true) { - newmulti_webssh = 1 - } else { - newmulti_webssh = "" - } - this.setState({ - bottonloading:true - }) - axios.post(Url, { - name: name, - can_copy: can_copy, - description: mdVal, - main_type: main_type, - scope_partment: scope_partment, - small_type: small_type, - trainee: trainee, - use_scope: use_scope, - vnc: vnc, - webssh: webssh, - multi_webssh: newmulti_webssh, - task_pass: 1, - opening_time: TimePickervalue - } - ).then((response) => { - if (response.status === 200) { - window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges"; - // window.open("/shixuns/"+response.data.shixun_identifier+"/challenges"); - }else{ - this.setState({ - bottonloading:false - }) - } - }).catch((error) => { - console.log(error) - this.setState({ - bottonloading:false - }) - }) - } - - - shixunsfetch = (value, callback) => { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - currentValue = value; - - function fake() { - let departmentsUrl = `/shixuns/departments.json?q=` + currentValue; - axios.get(departmentsUrl).then((response) => { - if (response.data.message===undefined) { - callback(response.data.shools_name); - } - }).catch((error) => { - console.log(error) - }); - } - - timeout = setTimeout(fake, 300); - } - - shixunHandleSearch = (value) => { - - this.shixunsfetch(value, departmentslist => this.setState({departmentslist})); - - this.setState({ - onSearchvalue: "" - }) - } - - post_apply = () => { - this.setState({ - postapplyvisible: true - }) - } - sendsure_apply = () => { - let {languagewrite,systemenvironment,testcoderunmode} = this.state; - // console.log("点击确定") - // console.log("languagewrite"+languagewrite); - // console.log("systemenvironment"+systemenvironment); - // console.log("testcoderunmode"+testcoderunmode); - - // let attachment_ids = undefined - // if (this.state.fileList) { - // attachment_ids = this.state.fileList.map(item => { - // return item.response ? item.response.id : item.id - // }) - // } - if(languagewrite === undefined || languagewrite === "" ){ - // this.props.showNotification(`请填写该镜像是基于什么语言`); - this.setState({ - languagewritetype:true - }) - return - } - if(systemenvironment === undefined || systemenvironment === ""){ - // this.props.showNotification(`请填写该镜像是基于什么语言系统环境`); - this.setState({ - systemenvironmenttype:true - }) - return; - - } - if(testcoderunmode === undefined || testcoderunmode === "") { - // this.props.showNotification(`请填写该镜像中测试代码运行方式`); - this.setState({ - testcoderunmodetype:true - }) - return; - } - var attachment_ids=undefined; - if (this.state.fileList) { - attachment_ids = this.state.fileList.map(item => { - return item.response ? item.response.id : item.id - }) - } - - if( attachment_ids === undefined || attachment_ids.length===0){ - - // notification.open( - // { - // message: '提示', - // description: - // '请上传附件!', - // - // } - // ) - this.setState({ - attachmentidstype:true - }) - return; - } - // console.log("attachment_ids"+attachment_ids); - - // alert(languagewrite +" "+systemenvironment +" "+testcoderunmode + " "+attachment_ids); - - var data={ - language:languagewrite, - runtime:systemenvironment, - run_method:testcoderunmode, - attachment_id:attachment_ids[0], - } - var url =`/shixuns/apply_shixun_mirror.json`; - axios.post(url,data - ).then((response) => { - - try { - if (response.data) { - // const { id } = response.data; - // if (id) { - if(this.state.file !== undefined){ - console.log("549"); - // this.deleteAttachment(this.state.file); - this.setState({ - file:undefined, - deleteisnot:true, - languagewrite:"", - systemenvironment:"", - testcoderunmode:"", - fileList:[] - }) - }else { - this.setState({ - file:undefined, - deleteisnot:true, - languagewrite:"", - systemenvironment:"", - testcoderunmode:"", - fileList:[] - }) - } - // this.props.showNotification('提交成功!'); - notification.open( - { - message: '提示', - description: - '提交成功!', - - } - ) - this.sendhideModaly() - // this.props.history.push(`/courses/${cid}/graduation_topics`); - // } - } - }catch (e) { - - } - - }) - - } - sendhideModaly = () => { - this.setState({ - postapplyvisible: false, - }) - if(this.state.file !== undefined){ - console.log("580"); - // this.deleteAttachment(this.state.file); - this.setState({ - file:undefined, - deleteisnot:true, - languagewrite:"", - systemenvironment:"", - testcoderunmode:"", - fileList:[] - }) - }else { - this.setState({ - file:undefined, - deleteisnot:true, - languagewrite:"", - systemenvironment:"", - testcoderunmode:"", - fileList:[] - }) - } - } - sendsure_applyvalues = (e) => { - this.setState({ - sendsure_applyvalue: e.target.value - }) - } - yeshidemodel = () => { - this.setState({ - postapplytitle: false - }) - } - - SelectTheCommandonChange = (e) => { - this.setState({ - multi_webssh: e.target.checked - }) - } - - - bigopen = (e) => { - this.setState({ - opers: true - }) - - } - - bigopens = (e) => { - this.setState({ - opers: false, - operss: false, - opensmail: false - }) - - } - - bigopensmal = (e) => { - this.setState({ - opensmail: true - }) - - } - - sbigopen = (e) => { - this.setState({ - operss: true - }) - - } - - // sbigopens=()=>{ - // this.setState({ - // operss:false - // }) - // } - - onChangeTimePicker = (value, dateString) => { - this.setState({ - TimePickervalue: dateString=== ""?"":moment(handleDateStrings(dateString)) - }) - } - - // 附件相关 START - handleChange = (info) => { - if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { - let {fileList} = this.state; - - if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { - console.log("handleChange1"); - // if(fileList.length===0){ - let fileLists = info.fileList; - this.setState({ - // fileList:appendFileSizeToUploadFileAll(fileList), - fileList: fileLists, - deleteisnot: false - }); - // } - } - } - } - onAttachmentRemove = (file) => { - if(!file.percent || file.percent == 100){ - confirm({ - title: '确定要删除这个附件吗?', - okText: '确定', - cancelText: '取消', - // content: 'Some descriptions', - onOk: () => { - console.log("665") - this.deleteAttachment(file) - }, - onCancel() { - console.log('Cancel'); - }, - }); - return false; - } - - } - deleteAttachment = (file) => { - console.log(file); - let id=file.response ==undefined ? file.id : file.response.id - const url = `/attachments/${id}.json` - axios.delete(url, { - }) - .then((response) => { - if (response.data) { - const { status } = response.data; - if (status == 0) { - // console.log('--- success') - - this.setState((state) => { - - const index = state.fileList.indexOf(file); - const newFileList = state.fileList.slice(); - newFileList.splice(index, 1); - return { - fileList: newFileList, - deleteisnot:true - }; - }); - } - } - }) - .catch(function (error) { - console.log(error); - }); - } - - - handleSubmit=()=>{ - // console.log(this.state.languagewrite) - // console.log(this.state.systemenvironment) - // console.log(this.state.testcoderunmode) - var attachment_ids; - if (this.state.fileList) { - attachment_ids = this.state.fileList.map(item => { - return item.response ? item.response.id : item.id - }) - } - // console.log(attachment_ids); - // var data={ - // language:"", - // runtime:"", - // run_method:"", - // attachment_id:"", - // } - // axios.post(url,data - // ).then((response) => { - // if (response.data) { - // // const { id } = response.data; - // // if (id) { - // this.props.showNotification('提交成功!'); - // // this.props.history.push(`/courses/${cid}/graduation_topics`); - // // } - // } - // }) - - - - } - render() { - const { getFieldDecorator } = this.props.form; - let {testcoderunmode ,systemenvironment,languagewrite,deleteisnot, fileList,TimePickervalue, scope_partmenttype, opensmail, newshixunlist, name, scope_partment, departmentslist, postapplyvisible, sendsure_applyvalue, postapplytitle, shixun_nametype, main_types, trainee_types, SelectTheCommandtype, opers, datalisttype, onSearchvalue} = this.state; - let options - if (departmentslist != undefined) { - options = this.state.departmentslist.map((d, k) => { - return ( - - ) - }) - } - const uploadProps = { - width: 600, - fileList, - multiple: true, - // https://github.com/ant-design/ant-design/issues/15505 - // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - // showUploadList: false, - action: `${getUploadActionUrl()}`, - onChange: this.handleChange, - onRemove: this.onAttachmentRemove, - beforeUpload: (file, fileList) => { - - if (this.state.fileList.length >= 1) { - return false - } - // console.log('beforeUpload', file.name); - const isLt150M = file.size / 1024 / 1024 < 50; - if (!isLt150M) { - // this.props.showNotification(`文件大小必须小于50MB`); - notification.open( - { - message: '提示', - description: - '文件大小必须小于50MB', - - } - ) - } - if(this.state.file !== undefined){ - console.log("763") - this.setState({ - file:file - }) - }else { - this.setState({ - file:file - }) - } - - console.log("handleChange2"); - return isLt150M; - }, - } - // const uploadProps = { - // width: 600, - // fileList, - // multiple: true, - // // https://github.com/ant-design/ant-design/issues/15505 - // // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - // // showUploadList: false, - // action: `${getUrl()}/api/attachments.json`, - // onChange: this.handleChange, - // onRemove: this.onAttachmentRemove, - // beforeUpload: (file) => { - // // console.log('beforeUpload', file.name); - // const isLt50M = file.size / 1024 / 1024 < 50; - // if (!isLt50M) { - // this.props.showNotification('文件大小必须小于150MB!'); - // } - // return isLt50M; - // }, - // }; - - return ( - -
    -
    -
    - -
    -

    - 创建实训 - {this.props.user&&this.props.user.main_site===true?实训制作指南:""} -

    - -
    -

    实训名称

    -
    - * -
    - - - 必填项 - -
    - -
    -
    - -
    - - -
    - -

    简介

    - -
    -
    - -
    -
    -

    -

    -
    - -
    -

    技术平台

    -
    - * -
    - -

    - 列表中没有? - 申请新建 -

    - - - {/*
    */} -
    -
  • - - -
  • -
    {this.state.languagewritetype===true?"请填写该镜像语言":""}
    -
  • - - -
  • -
    {this.state.systemenvironmenttype===true?"请填写该镜像语言系统环境":""}
    -
  • - - - -
  • -
    {this.state.testcoderunmodetype===true?"请填写该镜像测试代码运行方式":""}
    -
  • - -
    - - - 上传附件 - (单个文件50M以内) - - -
    - -
  • -
    - {this.state.attachmentidstype===true?"请上传附件":""} -
    -
  • - this.sendhideModaly()} - >取消 - -
  • -
    -
    - {/*
    */} -
    - - - - -
    -

    新建申请已提交,请等待管理员的审核

    -
  • 我们将在1-2个工作日内与您联系 -
  • -
    -
    - 知道啦 -
    -
    -
    -
    -
    - -
    -

    请在配置页面完成后续的评测脚本设置操作

    -
    - 必填项 -
    -
    -
    - - -
    -

    命令行

    -
    - - 无命令行窗口 (选中则不给学员的实践任务提供命令窗口) - 命令行练习窗口 (选中则给学员提供用于练习操作的命令行窗口) - 命令行评测窗口 (选中则给学员提供用于关卡评测的命令行窗口) - - 多个命令行窗口(选中则允许学员同时开启多个命令行窗口) - - -
    -
    - - -
    -

    公开程度

    -
    - - 对所有公开 (选中则所有已被试用授权的用户可以学习) - 对指定单位公开 (选中则下方指定单位的已被试用授权的用户可以学习) - - -
    -
    -
    -
    -
    - -
    - (搜索选中添加单位名称) - {this.state.datalisttype===true?请勿选择重复单位:""} - {/*+ 添加*/} -
    -
    - -
    -
    - { - scope_partment === undefined ? "" : scope_partment.map((item, key) => { - return ( -
  • {item} - this.deleteScopeInput(key)}>× -
  • - ) - }) - } -
    - {/*{*/} - {/*scope_partment===undefined?"":scope_partment.map((item,key)=>{*/} - {/*return(*/} - {/*
    */} - {/*this.deleteScopeInput(key)} style={{ color: 'rgba(0,0,0,.25)' }} />}*/} - {/*value={item}*/} - {/*/>*/} - {/*
    */} - - {/*)*/} - {/*})*/} - {/*}*/} -
    - - - - 请选择需要公开的单位 - -
    -
    -
    -
    - - -
    -

    发布信息

    -
    -
    - *面向学员: -
    - -
    - 实训难易度定位,不限定用户群体 -
    - 必填项 -
    -
    -
    -
  • - 复制: - - -
  • -
    - 开启时间: -
  • - - -
  • -
    -
    - {/*
    */} - {/*

    VNC图形化

    */} - {/*
  • */} - {/**/} - {/**/} - {/*
  • */} - {/*
    */} - - -
    - - 取消 -
    - - -
    -
    -
    - - ); - } -} -const NewshixunsNew = Form.create({ name: 'newshixunsnew' })(Newshixuns); -export default SnackbarHOC()(TPMIndexHOC(NewshixunsNew)); - - - - - - diff --git a/public/react/src/modules/tpm/roundedRectangle.png b/public/react/src/modules/tpm/roundedRectangle.png deleted file mode 100755 index 0d2d0b0dcdb359def884705254f050d1fbdcb3fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 720 zcmV;>0x$iEP)7i5*ItXH}O~epQUU@HhV58rh1Hvd($Uc{~fs`t{WtAox?*xd!!y}DOtA`$57 zLY|)^QYobCBD`;Yr82JGz!@)1cQ*z z!_W{i5J0S~ToGY^e4O2hiAqE@{{u?X1RqfE4-ODpTgdr&7#@aj7_q*NY;5GXwUtBQ z)G&Bv+iaUAztw#}LwrviVMS9fBDu5#jsq<%2+KkNMRPMOEFk;(5Xq#LCpS7u{q!_n z+Sa7-)NP@?@QOwQd_d*ESt3Dxb(Ok-0n!^A)P_QYdwMt+ z8{=?tQX5pj$F_~*0sU2^QcweFQGi+Ct@c34W?2xAmvR`1P_Qgc;&FaC4ld9%I7mZ# zJF-|Lv$Mm=+FGRw1Ca<1EsLXgT(?8HHi}*!O8BITCRi+uwpRke7flH{;0QPd&VX94 z+LUwUb4nTYu8gYXGp@gT|J(vBK7jYWaaXz^;VbamyT1m!5Rkpir19Uq4!94r0-u4` zq7+=!)^$KNiDG)P`&*_;$V)&8_kcG7rmJNCikZJnpcOq`ZNy>#0000 { - let id = this.props.match.params.shixunId; - let ChallengesURL = `/shixuns/` + id + `/challenges.json`; - - axios.get(ChallengesURL).then((response) => { - if (response.status === 200) { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - configShareForCustom(this.props.shixunsDetails.name, response.data.description) - this.setState({ - ChallengesDataList: response.data, - sumidtype: false, - }); - - if(response.data.description=== ""||response.data.description===null||response.data.description===undefined){ - this.setState({ - isopentitletype:"Less", - }) - } - this.getjianjiesize() - } - } - }).catch((error) => { - console.log(error) - }); - } - - getjianjiesize=()=>{ - let {ChallengesDataList}=this.state; - let boxoffsetHeigh; - let box=document.getElementById("shixunchallengesid"); - - if(box){ - boxoffsetHeigh=box.offsetHeight - if(ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined){ - - }else{ - if(this.state.isopentitletype==="greater"){ - - }else{ - if(boxoffsetHeigh>=300){ - this.setState({ - opentitletype:true, - isopentitletype:"greater", - boxoffsetHeigh:boxoffsetHeigh - }) - }else{ - this.setState({ - isopentitletype:"Less", - boxoffsetHeigh:boxoffsetHeigh - }) - } - } - - } - - } - } - - componentDidMount() { - if(this.state.isopentitletype==="greater"){ - - }else { - this.ChallengesList() - } - - } - componentDidUpdate = (prevProps,prevState) => { - - //防止陷入无限循环 - if(prevState.ChallengesDataList!=this.state.ChallengesDataList){ - if(this.state.isopentitletype==="greater"){ - - }else{ - this.getjianjiesize() - } - } - - } - updatamakedown = (id) => { - setTimeout(() => { - var shixunDescr = window.editormd.markdownToHTML(id, { - htmlDecode: "style,script,iframe", - taskList: true, - tex: true, - flowChart: true, - sequenceDiagram: true - }); - $("#" + id + " p:first").addClass("ReactMarkdown"); - }, 200) - } - - // 关卡的上移下移操作 - operations = (sumid, type) => { - this.setState({ - operationstrue:true - }) - let { ChallengesDataList } = this.state; - let operationUrl; - if (type === "up") { - operationUrl = "/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + sumid + "/index_up.json"; - } else if (type === "down") { - operationUrl = "/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + sumid + "/index_down.json"; - } - if (this.state.operate) { - - this.setState({ - operate: false - }); - axios.get(operationUrl).then((response) => { - if (response.status === 200) { - this.setState({ - operate: true, - operationstrue:false - }); - this.ChallengesList(); - - } - }).catch((error) => { - console.log(error); - this.setState({ - operate: true, - operationstrue:false - }); - this.ChallengesList() - }) - } - } - delOperations = (sumid) => { - this.setState({ - sumid: sumid, - sumidtype: true - }) - } - - clonedelOperationss = () => { - this.setState({ - sumidtype: false - }) - } - delOperationss = () => { - let { ChallengesDataList, sumid } = this.state; - let operationUrl = "/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + sumid+".json" - - if (this.state.operate) { - this.setState({ - operate: false, - sumidtype: false - }) - axios.delete(operationUrl, { - withCredentials: true - }).then((response) => { - if (response.status === 200) { - this.setState({ - operate: true, - sumidtype: false - }); - this.ChallengesList(); - } - this.ChallengesList() - }).catch((error) => { - console.log(error); - this.setState({ - operate: true, - sumidtype: false - }); - this.ChallengesList() - }) - } - } - - startgameid=(id)=>{ - - let url = "/shixuns/" + id + "/shixun_exec.json"; - axios.get(url).then((response) => { - - if (response.data.status === -2) { - this.setState({ - shixunsreplace:true, - hidestartshixunsreplacevalue:response.data.message+".json" - }) - } else if (response.data.status === -1) { - console.log(response) - }else if(response.data.status===-3){ - this.setState({ - shixunsmessage:response.data.message, - startshixunCombattype:true, - }) - } else { - window.location.href = "/tasks/" + response.data.game_identifier; - // window.location.href = path - // let path="/tasks/"+response.data.game_identifier; - // this.props.history.push(path); - } - }).catch((error) => { - - }); - - - } - - hidestartshixunsreplace=(url)=>{ - this.setState({ - isSpin:true, - }) - axios.get(url).then((response) => { - if(response.status===200){ - // let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; - // this.props.history.push(path); - message.success('重置成功,正在进入实训!'); - this.startgameid(response.data.shixun_identifier); - this.setState({ - shixunsreplace:false, - isSpin:false, - }) - - // message.success('重置成功,正在进入实训!'); - // this.startshixunCombat(); - }} - ).catch((error) => { - - }); - - } - - //编辑实训题目选择题 - EditTraining=(type, ids, path)=>{ - let { ChallengesDataList } = this.state; - window.location.href = "/shixuns/" + ChallengesDataList.shixun_identifier + "/challenges/" + ids + path; - } - - //开始实战按钮 - startshixunCombat = (type, ids, id) => { - - if(this.props.checkIfLogin()===false){ - this.props.showLoginDialog() - return - } - - if(this.props.checkIfProfileCompleted()===false){ - this.setState({ - AccountProfiletype:true - }) - return - } - - // if(this.props.checkIfProfessionalCertification()===false){ - // this.setState({ - // AccountProfiletype:true - // }) - // return - // } - - - let { ChallengesDataList } = this.state; - // let id = this.props.match.params.shixunId; - this.setState({ - startbtns: true - }) - let url = "/shixuns/" + ChallengesDataList.shixun_identifier + "/shixun_exec.json?challenge_id="+id; - axios.get(url).then((response) => { - - if (response.data.status === -2) { - this.setState({ - startbtns:false, - shixunsreplace:true, - hidestartshixunsreplacevalue:response.data.message+".json" - }) - } else if (response.data.status === -1) { - this.setState({ - startbtns: false - }) - console.log(response) - }else if(response.data.status===-3){ - this.setState({ - shixunsmessage:response.data.message, - startshixunCombattype:true, - startbtns:false - }) - } else { - window.location.href = "/tasks/" + response.data.game_identifier; - // window.location.href = path - // let path="/tasks/"+response.data.game_identifier; - // this.props.history.push(path); - } - }).catch((error) => { - - }); - - - // if(path===null){ - // }else{ - // if (type > 4 || type === false) { - // window.location.href = path; - // } else { - // - // } - // } - - - } - hidestartshixunCombattype=()=>{ - this.setState({ - startshixunCombattype:false - }) - } - - hideAccountProfile=()=>{ - this.setState({ - AccountProfiletype:false - }) - } - - opentitle=()=>{ - this.setState({ - opentitletype:!this.state.opentitletype, - }) - } - - render() { - let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state; - let { loadingContent } = this.props; - if (ChallengesDataList != undefined) { - this.updatamakedown("ReactMarkdown") - } - let id = this.props.match.params.shixunId; - const antIcon = ; - - return ( - - {AccountProfiletype===true?this.hideAccountProfile()} - {...this.props} - {...this.state} - />:""} - - {loadingContent ? - : - -
    - {/*

    */} - {/* {this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?*/} - {/* */} - {/* */} - {/* */} - {/* 实践任务*/} - {/* */} - - {/* : ""*/} - {/* }*/} - {/* {this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ?*/} - {/* */} - {/* */} - {/* */} - {/* 选择题任务*/} - {/* */} - {/* : ""*/} - {/* }*/} - {/*

    */} - - -

    -

    - 简介 - - {this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? - - {/**/} - 编辑 - :""} - {this.props.user && this.props.user.main_site === true ? - this.props.identity < 5?实训制作指南 : "":""} -
    - -
    -
    - - - - {ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined?:""} - - - {ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined?"":this.state.isopentitletype==="greater"&&this.state.opentitletype===true? - :""} - - -
    - {ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined? -
    - {this.props.identity < 5?:} -

    暂时还没有相关数据哦!

    -
    - :

    - {ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"": -

    - } -

    } -
    -
    - - {this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}> - 阅读全文 - :this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}> - 收起全文 - } - -
    -

    - -
    - 全部任务 - - {/* */} - {/**/} - {/* */} - {this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ? - - - : "" - } - {this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status=== 0 ? - - - : "" - } - {/**/} - {/* */} - {/* */} - -
    - -
    - - {ChallengesDataList === undefined ?
    -
    - {this.props.identity < 5?:} -

    暂时还没有相关数据哦!

    -
    -
    : ChallengesDataList.challenge_list === undefined ? -
    -
    - {this.props.identity < 5?:} -

    暂时还没有相关数据哦!

    -
    -
    - : ChallengesDataList.challenge_list.length === 0 ? -
    -
    - {this.props.identity < 5?:} -

    暂时还没有相关数据哦!

    -
    -
    - : ChallengesDataList.challenge_list.map((item, key) => { - return ( -
    -
    -
    第{key+1}关:{item.st === 0 ?"实践题":"选择题"} - - {/*this.startshixunCombat(false,undefined, item.challenge_id)}*/} - {/* // onClick={() => this.startshixunCombat(false)}*/} - {/* title={"查看挑战关卡"}*/} - {/*>已完成*/} - {/*判断比较复杂 有排第一不能是灰色按钮*/} - {item.status === 2 ? - - : "" - } - - {/* this.startshixunCombat(false,undefined, item.challenge_id)} - // onClick={() => this.startshixunCombat(false)} - >直接挑战 */} - { - ChallengesDataList.allow_skip === true && item.status === 1? - - : "" - } - - {/* - this.startshixunCombat(false,undefined, item.challenge_id)} - style={{marginTop: '-2px'}}>直接挑战 - - */} - { - ChallengesDataList.allow_skip === false ? item.status === 1? - - :"":"" - - } - - {/**/} - {/* this.startshixunCombat(false,undefined, item.challenge_id):""}*/} - {/* style={{marginTop: '-2px'}}>直接挑战*/} - {/**/} - - { - item.status === 0 ? - - :"" - } -
    - - - {item.delete_url != undefined && - - this.delOperations(item.challenge_id)} - style={{ display:this.props.user.admin===true?"block":this.props.identity < 5 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }} - className="fl mr25"> - {/**/} - - - - } - - - {item.up_url != undefined && - - this.operations(item.challenge_id, "up")} - style={{ display:this.props.user.admin===true?"block":this.props.identity < 5 && ChallengesDataList.shixun_status === 0 ? "block" : 'none' }} - className="fl mr25"> - {/**/} - - - - } - {item.down_url != undefined && - - this.operations(item.challenge_id, "down")} - style={{ display: this.props.user.admin===true?"block":this.props.identity < 5 && ChallengesDataList.shixun_status=== 0 ? "block" : 'none' }} - className="fl mr25"> - {/**/} - - - - - } - - { - item.st === 1 ? - - - {/**/} - - - - : - - - {/**/} - - - - } - - -
    - - -
    - {/*onClick={() => this.EditTraining(this.props.identity, item.challenge_id, "/editquestion")}*/} - {this.props.identity<5? - item.st === 1 ? -
    {item.name}
    - : -
    {item.name}
    :
    this.startshixunCombat(this.props.identity, item.challenge_id, "/editcheckpoint")} - className="font-16 color05101a fonthiddens">{item.name}
    - } - {/* onClick={() => this.EditTraining(this.props.identity, item.challenge_id, "/editcheckpoint")}*/} - - - - - -
    -
    - - 正在挑战: {item.playing_count}人 - 完成挑战: {item.passed_count}人 - 可获经验: {item.score}点 - -
    -
    - ) - })} -
    - - - - - - -
    -

    目前该实训项目尚在内测中,将于{shixunsmessage}之后开放,谢谢!

    -
    -
    - {/*取消*/} - 知道了啦 -
    - {/*

    */} - {/*知道了*/} - {/*

    */} -
    - - - -
    -

    实训已经更新了,正在为您重置!

    -
    - -
    -
    -
    - } -
    - - ) - } -} - -export default Challenges; - // { - // ChallengesDataList.allow_skip === false ? item.status === 1 && newstatus === 2 ? - // - // this.startshixunCombat(false,undefined, item.challenge_id)} - // style={{marginTop: '-2px'}}>直接挑战 - // - // - // : item.status === 1 && newstatus === 1 ? - // - // this.startshixunCombat(false,undefined, item.challenge_id)} - // style={{marginTop: '-2px'}}>直接挑战 - // : "" : "" - // - // } \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js deleted file mode 100644 index 9e50e44d5..000000000 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ /dev/null @@ -1,862 +0,0 @@ -import React, { Component } from 'react'; -import { Link } from "react-router-dom"; -import { markdownToHTML, configShareForCustom,getImageUrl,getUploadActionUrlthree,appendFileSizeToUploadFileAll} from 'educoder' -import { Divider, Tooltip,Upload,Modal,Statistic} from 'antd'; -import LoadingSpin from '../../../../common/LoadingSpin'; -import 'antd/lib/pagination/style/index.css'; -import '../shixunchildCss/Challenges.css'; -import axios from 'axios'; -import {addjypertime} from "../../../../redux/actions/jupyter"; -const $ = window.$; -const { Countdown } = Statistic; -class Challengesjupyter extends Component { - constructor(props) { - super(props) - this.state = { - ChallengesDataList: undefined, - operate: true, - startbtns: false, - iFrameHeight: '0px', - jupyter_port:0, - jupyter_url:null, - jupyter_urls:null, - username:"", - booljupyterurls:false, - loading:false, - boxoffsetHeigh:0, - opentitletype:true, - isopentitletype:"Less", - enlarge:false, - fileList:[], - shuaxin:false, - showtime:false, - jupytertime:Date.now() +3600 * 1000, - endtimes:false - } - } - - ChallengesList = () => { - let id = this.props.match.params.shixunId; - let ChallengesURL = `/shixuns/` + id + `/challenges.json`; - - axios.get(ChallengesURL).then((response) => { - if (response.status === 200) { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - configShareForCustom(this.props.shixunsDetails.name, response.data.description) - this.setState({ - ChallengesDataList: response.data, - sumidtype: false, - }); - if(response.data.description=== ""||response.data.description===null||response.data.description===undefined){ - this.setState({ - isopentitletype:"Less", - }) - } - this.getjianjiesize() - } - } - }).catch((error) => { - //console.log(error) - }); - } - - - getjianjiesize=()=>{ - let {ChallengesDataList}=this.state; - let boxoffsetHeigh; - let box=document.getElementById("shixunchallengesid"); - - if(box){ - boxoffsetHeigh=box.offsetHeight - if(ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined){ - - }else{ - if(this.state.isopentitletype==="greater"){ - - }else{ - if(boxoffsetHeigh>=300){ - // if(this.state.enlarge===false){ - // this.setState({ - // opentitletype:false, - // isopentitletype:"greater", - // boxoffsetHeigh:boxoffsetHeigh - // }) - // }else{ - // - // } - this.setState({ - opentitletype:false, - isopentitletype:"greater", - boxoffsetHeigh:boxoffsetHeigh - }) - }else{ - this.setState({ - isopentitletype:"Less", - boxoffsetHeigh:boxoffsetHeigh - }) - } - } - - } - - } - } - componentDidUpdate = (prevProps,prevState) => { - - //防止陷入无限循环 - if(prevState.ChallengesDataList!=this.state.ChallengesDataList){ - if(this.state.isopentitletype==="greater"){ - - }else{ - this.getjianjiesize() - } - } - - } - - gettimeinfo_with_tpm=(datas,type)=>{ - let timeinfo_with_tpm=`/jupyters/timeinfo_with_tpm.json` - axios.get(timeinfo_with_tpm, {params: datas}).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - if(response.data.status===0){ - if(response.data.remainingSeconds===null){ - this.handleClickResetTpi() - }else{ - let remainingSeconds=response.data.remainingSeconds; - // let summain=3600 * 1000; - let sums= remainingSeconds * 1000; - let endsms=(remainingSeconds-300<=0?0:remainingSeconds-300)*1000 - // let sum=summain-sums; - setTimeout(()=>{ - this.setState({ - jupytertime:Date.now() +sums, - endtimes:endsms===0?Date.now()+1000:Date.now() +endsms - }) - },500); - if(type===true){ - this.props.showNotification('延长成功!'); - } - } - }else{ - - } - } - }).catch((error) => { - - }); - } - componentDidMount() { - let that=this; - setTimeout(this.ChallengesList(), 1000); - let id = this.props.match.params.shixunId; - let datas={ - identifier:id, - } - let ChallengesURL = `/jupyters/get_info_with_tpm.json`; - axios.get(ChallengesURL, {params: datas}).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - setTimeout(() => { - this.setState({ - booljupyterurls:true, - }) - }, 600) - }else{ - if(response.data.status===0){ - this.gettimeinfo_with_tpm(datas) - setTimeout(() => { - this.setState({ - jupyter_url:response.data.url, - jupyter_urls:response.data.url, - jupyter_port:response.data.port, - booljupyterurls:true, - }) - }, 800) - }else{ - setTimeout(() => { - this.setState({ - booljupyterurls:true, - }) - }, 600) - } - } - - - }).catch((error) => { - setTimeout(() => { - this.setState({ - booljupyterurls:true, - }) - }, 600) - - }); - setTimeout(this.getjianjiesize(), 1000); - - - window.addEventListener('message', (e) => { - if(e){ - if(e.data){ - if(e.data==="jupytermessage"){ - if(this.state.showtime===false){ - that.modifyjupyter(); - this.setState({ - showtime:true - }) - } - } - } - - } - - }); - } - - updatamakedowns = () => { - this.setState({ - loading:true, - booljupyterurls:false - }) - let id = this.props.match.params.shixunId; - let ChallengesURL = `/jupyters/get_info_with_tpm.json`; - let datas={ - identifier:id, - } - axios.get(ChallengesURL, {params: datas}).then((response) => { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - setTimeout(() => { - this.setState({ - booljupyterurls:true, - }) - }, 600) - }else{ - if(response.data.status===0){ - setTimeout(() => { - this.setState({ - jupyter_url:response.data.url, - jupyter_urls:response.data.url, - jupyter_port:response.data.port, - booljupyterurls:true, - }) - }, 800) - this.setState({ - - }) - }else{ - setTimeout(() => { - this.setState({ - booljupyterurls:true, - }) - }, 600) - } - } - }).catch((error) => { - setTimeout(() => { - this.setState({ - booljupyterurls:true, - }) - }, 600) - - }); - - } - - - modifyjupyter=()=>{ - // this.props.showNotification('实训正在保存中...!'); - setTimeout(() => { - let id=this.props.match.params.shixunId; - var jupyter_port=""; - try{ - jupyter_port= parseInt(this.state.jupyter_port); - }catch (e) { - jupyter_port=this.state.jupyter_port; - - } - const url=`/jupyters/save_with_tpm.json`; - const data={ - identifier:id, - jupyter_port:jupyter_port, - } - axios.get(url, {params: data}) - .then((result) => { - if (result.data.status === 0) { - // this.props.showNotification(`应用成功`); - // console.log("应用成功了"); - this.props.showNotification('保存成功!'); - setTimeout(() => { - this.setState({ - showtime:false - }) - }, 800) - - }else{ - this.setState({ - showtime:false - }) - this.props.showNotification(result.data.message); - } - }).catch((error) => { - this.setState({ - showtime:false - }) - this.props.showNotification('实训保存失败!'); - }) - }, 800) - } - - - opentitle=()=>{ - - this.setState({ - opentitletype:!this.state.opentitletype - }) - } - - onclki=(bool)=>{ - this.setState({ - enlarge:bool - }) - } - - Importingfiles=()=>{ - // 导入文件 - - } - - handleChange = (info) => { - if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){ - let fileList = info.fileList; - this.setState({ - fileList: appendFileSizeToUploadFileAll(fileList), - }); - - if(info.file.status === 'done'){ - if(info.file.response){ - if(info.file.response.status===-1||info.file.response.status==="-1"){ - - }else{ - - } - } - } - - if(info.file.response){ - if(info.file.response.status===-1||info.file.response.status==="-1"){ - - }else{ - if(info.file.response.status===0){ - try { - this.modifyjupyter(); - }catch (e) { - - } - try { - this.setState({ - jupyter_url : null, - booljupyterurls:false, - }) - setTimeout(()=>{ - this.setState({ - jupyter_url : this.state.jupyter_urls, - booljupyterurls:true, - }) - },1000); - this.props.showNotification('上传文件成功!'); - }catch (e) { - this.setState({ - jupyter_url : null, - booljupyterurls:false, - }) - setTimeout(()=>{ - this.setState({ - jupyter_url : this.state.jupyter_urls, - booljupyterurls:true, - }) - },1000); - } - } - - } - } - - } - } - - handleClickResetTpisync_code=(id)=>{ - this.setState({ - jupyter_url : null, - booljupyterurls:false, - }) - const url = `/jupyters/reset_with_tpm.json`; - axios.get(url,{params:{ - identifier:id - }}).then((response) => { - if(response.data.status===0){ - setTimeout(()=>{ - this.setState({ - jupyter_url :response.data.url, - jupyter_port:response.data.port, - booljupyterurls:true, - }) - },500); - this.props.showNotification('重置环境成功!'); - - setTimeout(()=>{ - this.setState({ - booljupyterurls:true, - }) - },1000); - - } - }); - } - // 重置实训 - handleClickResetTpi = () => { - let id=this.props.match.params.shixunId; - let that=this; - Modal.confirm({ - title: '重置环境', - content: ( -

    - 是否确定重置环境? -

    - ), - okText: '确定', - cancelText: '取消', - onOk () { - that.handleClickResetTpisync_code(id) - }, - onCancel() { - - }, - }) - } - - onFinish=()=>{ - Modal.destroyAll(); - let id=this.props.match.params.shixunId; - let that=this; - Modal.confirm({ - title: '倒计时截止', - content: ( -

    - 服务已中断,是否确认重置实验环境? -

    - ), - okText: '确定', - cancelText: '取消', - onOk () { - that.handleClickResetTpisync_code(id) - } - }) - } - - onendFinish=()=>{ - let id=this.props.match.params.shixunId; - let that=this; - Modal.confirm({ - title:"服务中断提醒", - content: ( -

    - jupyter将于时间后服务中断,是否需要延长使用时间? -

    - ), - okText: '立即延长', - cancelText: '不需要', - onOk () { - that.onendhandleClickResetTpi(id) - } - }) - } - - - onendhandleClickResetTpi=(id)=>{ - let datas={ - identifier:id, - } - const url = `/jupyters/active_with_tpm.json`; - axios.get(url,{params:{ - identifier:id - }}).then((response) => { - if(response.data.status===0){ - this.gettimeinfo_with_tpm(datas,true) - // setTimeout(()=>{ - // this.setState({ - // jupytertime:Date.now() + 900 * 1000, - // endtimes:Date.now() + 300 * 1000 - // }) - // },500); - } - }); - } - render() { - let{ChallengesDataList,booljupyterurls,enlarge,fileList,endtimes}=this.state; - let id = this.props.match.params.shixunId; - //老师 - const is_teacher = this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; - //运营人员 - const business = this.props&&this.props.current_user&&this.props.current_user.business?this.props.current_user.business:false; - //管理员 - const admin = this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; - - let mysidentity =false; - try { - mysidentity =this.props.identity < 5 &&ChallengesDataList&& ChallengesDataList.shixun_status< 3?true:false; - }catch (e) { - - } - const uploadProps = { - width: 600, - fileList, - multiple: false, - data:{ - identifier:id, - }, - //multiple 是否支持多选 查重的时候不能多选 不然弹许多框出来 - // https://github.com/ant-design/ant-design/issues/15505 - // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - // showUploadList: false, - action: `${getUploadActionUrlthree()}`, - showUploadList:false, - onChange: this.handleChange, - beforeUpload: (file) => { - //上传前的操作 - // console.log('beforeUpload', file.name); - if(file.name.indexOf('.ipynb') === -1){ - this.props.showNotification('请上传10m以内ipynb格式的文件!'); - return false - - } - const isLt10M = file.size / 1024 / 1024 < 10; - if (!isLt10M) { - this.props.showNotification('请上传10m以内ipynb格式的文件!'); - } - return isLt10M; - }, - }; - return ( - -
    - - - {/*this.state.jupytertime*/} - - {endtimes===false?"":} - - -

    -

    - 简介 - - - 编辑 - - -
    - -
    - - - {ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined?:""} - {ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined?"":this.state.isopentitletype==="greater"&&this.state.opentitletype===true? - :""} - -
    -

    - {/*{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":*/} - {/*

    */} - {/*}*/} - - {ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined? -
    - {this.props.identity < 5?:} -

    暂时还没有相关数据哦!

    -
    - :

    - {ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"": -

    - } -

    } -

    - -
    - - {/*this.state.enlarge===false?"":*/} - {/*{this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>*/} - {/* 阅读全文 */} - {/*:this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>*/} - {/* 收起全文 */} - {/*}*/} - - -
    - -

    - -
    - - { - this.state.jupyter_url === null || this.state.jupyter_url === undefined ? - enlarge===true? -
    - -
    -
    -

    任务详情

    -

    (请将实训题目写在下方并保存)

    -
    -
    - { - enlarge===true? - this.onclki(false)}> - : - this.onclki(true)}> - } - - -
    -

    导入

    -
    -
    - - -
    - -
    -
    - - : "" - : - ( - admin===true||business===true||mysidentity===true? - -
    - -
    -
    -

    任务详情

    -

    (请将实训题目写在下方并保存)

    -
    -
    - { - enlarge===true? - this.onclki(false)}> - : - this.onclki(true)}> - } - - -
    -

    导入

    -
    -
    - - -
    - -
    -
    - - : - "" - ) - - } - - - { - admin===true||business===true||mysidentity===true? -
    -
    - { - this.state.jupyter_url===null || this.state.jupyter_url===undefined? - ( - booljupyterurls===false? -
    - -
    - : -
    -
    - -

    加载实训失败,

    this.updatamakedowns()}>重新加载

    - -
    -
    - ) - : -
    - -
    - - } -
    -
    - :"" - } -
    -
    - -
    - - ) - } -} - -export default Challengesjupyter; -{/*{*/} -{/* booljupyterurls===true?*/} -{/* (*/} -{/* this.state.jupyter_url === null?*/} -{/*
    */} -{/* */} -{/*

    加载实训失败,

    this.updatamakedowns()}>重新加载

    */} - -{/*
    */} - -{/* :""*/} -{/* )*/} -{/* :""*/} -{/*}*/} diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.css b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.css deleted file mode 100644 index a628787e5..000000000 --- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.css +++ /dev/null @@ -1,200 +0,0 @@ -.height40 { - height: 30px; - line-height: 30px; -} - -.height28 { - height: 30px; - line-height:28px; -} - -.line27{ - line-height: 27px; - vertical-align: 1px; -} -/* 中间居中 */ -.intermediatecenter{ - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} -/* 简单居中 */ -.intermediatecenterysls{ - display: flex; - align-items: center; -} -.spacearound{ - display: flex; - justify-content: space-around; - -} -.spacebetween{ - display: flex; - justify-content: space-between; -} -/* 头顶部居中 */ -.topcenter{ - display: -webkit-flex; - flex-direction: column; - align-items: center; - -} - - -/* x轴正方向排序 */ -/* 一 二 三 四 五 六 七 八 */ -.sortinxdirection{ - display: flex; - flex-direction:row; - -} -/* x轴反方向排序 */ -/* 八 七 六 五 四 三 二 一 */ -.xaxisreverseorder{ - display: flex; - flex-direction:row-reverse; -} -/* 垂直布局 正方向*/ -/* 一 - 二 - 三 - 四 - 五 - 六 - 七 - 八 */ -.verticallayout{ - display: flex; - flex-direction:column; -} -/* 垂直布局 反方向*/ -.reversedirection{ - display: flex; - flex-direction:column-reverse; -} - -.yslwushiwidth{ - width: 50%; -} -.yslwushiwidth90{ - width: 90%; -} -.yslwushiwidth10{ - width: 10%; -} -.yslwushiwidthbuton{ - width: 110px; -} -.yslwushiwidthcolortest{ - color: #A8A8A8; - font-size:16px; -} -.yslusername{ - color: #000000; - font-size: 18px; -} -.yslusercjz{ - width:60px; - height:28px; - border-radius:3px; - border:1px solid #F38B03; -} -.yslusercjztest{ - width:60px; - height:28px; - font-size:16px; - color:#F38B03; - line-height:28px; - text-align: center; -} -.w18{ - width: 18px; -} - -.maxnamewidth150{ - width: 150px; - max-width: 150px; - overflow:hidden; - text-overflow:ellipsis; - white-space:nowrap; - cursor: default; -} -.fabushixunwidth{ - color: #000000; - font-size: 12px; -} -.fabushixunwidthcolor{ - color: #4CACFF; - font-size: 16px; -} -.divfontexdivs{ - border-left: 1px solid #eeeeee; - border-top: 1px solid #eeeeee; - border-right: 1px solid #eeeeee; - border-bottom: 1px solid #eeeeee; -} - -.space-between{ - justify-content:space-between -} - -.heighthezuo34{ - height:34px; - line-height: 34px; -} -.hezuozhe655{ - width: 655px; -} -.hezuozhe655{ - width: 655px; -} -.color333hezuo{ - color:#333333; -} - -.color888hezuo{ - color:#888888; -} - -.newyslusercjz{ - display: inline-block; - position: absolute; - bottom: 10px; - left: -18px; - width: 44px; - height: 18px; - border-radius: 13px; - background: #F38B03; - color: #fff; -} - -.newyslusercjztest{ - width: 45px; - height: 29px; - font-size: 10px; - color: #fff; - line-height: 18px; - text-align: center; -} - -.fontnewreds{ - color: rgb(255, 85, 85); -} - -.fontneweees { - color: #BBBBBB; -} - -.maxfont450{ - width: 450px; - max-width:450px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; -} -.centertop20{ - text-align: center; - padding-top: 20%; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js deleted file mode 100644 index eceb6c5db..000000000 --- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js +++ /dev/null @@ -1,769 +0,0 @@ -import React, {Component} from 'react'; - -import {Modal, Button, Radio, Input, Checkbox, message, Spin, Icon, Pagination} from 'antd'; - -import {getImageUrl, toPath} from 'educoder' - -import axios from 'axios'; - -import NoneData from "../../../courses/coursesPublic/NoneData"; - -import './Collaborators.css'; - - -const RadioGroup = Radio.Group; - - - -class Collaborators extends Component { - constructor(props) { - super(props) - this.state = { - collaboratorList: [], - Collaboratorsvisible: false, - Collaboratorsvisibleadmin: false, - value: 1, - page: 1, - Searchadmin: undefined, - allChangechecked: false, - Collaboratorslist: [], - Collaboratorslisttype: false, - collaborators_deletetype: false, - collaborators_deletevalue: null, - onSearchcalue: "", - collaboratorListsum: 10, - collaboratorListsumtype: true, - user_name: undefined, - school_name: undefined, - spinnings: false, - useristrue: false, - mylistansum: 6, - limit: 20, - } - } - - componentDidMount() { - let id = this.props.match.params.shixunId; - - let collaborators = `/shixuns/` + id + `/collaborators.json`; - axios.get(collaborators).then((response) => { - if (response.status === 200) { - if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) { - - } else { - this.setState({ - collaboratorList: response.data - }); - } - - } - }).catch((error) => { - console.log(error) - }); - } - - updatacomponentDiddata = (pageNumber) => { - let id = this.props.match.params.shixunId; - - let collaborators = `/shixuns/` + id + `/collaborators.json`; - axios.get((collaborators),{params:{ - page:pageNumber?pageNumber:undefined - }}).then((response) => { - if (response.status === 200) { - if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) { - - } else { - this.setState({ - collaboratorList: response.data - }); - } - } - }).catch((error) => { - console.log(error) - }); - } - CollaboratorsshowModal = (type) => { - - if (type === "cooperation") { - this.setState({ - Collaboratorsvisibleadmin: false, - Collaboratorslist: [], - Searchadmin: [], - addadminrediovalue:undefined - }); - } else if (type === "admin") { - this.setState({ - Collaboratorsvisible: false, - Collaboratorslist: [], - Searchadmin: [], - addadminrediovalue:undefined - }); - } else if (type === "collaborators_deletetype") { - this.setState({ - collaborators_deletetype: false, - addadminrediovalue:undefined - }); - } - } - - showCollaboratorsvisible = (type) => { - - this.setState({ - Collaboratorslist: [], - Searchadmin: undefined, - onSearchcalue: "" - }) - let admintype = this.props.identity; - if (admintype > 4) { - this.props.showNotification("您没有权限"); - return - } - if (type === "cooperation") { - this.setState({ - Collaboratorsvisibleadmin: true, - Collaboratorsvisible: false, - }); - } else if ("admin") { - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/change_manager.json"; - axios.get(url).then((response) => { - if (response.status === 200) { - // this.setState({ - // Collaboratorsvisible: true - // }) - if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) { - - } else { - this.setState({ - Collaboratorsvisible: true, - Collaboratorsvisibleadmin: false, - Collaboratorslist: response.data - }) - } - } - }).catch((error) => { - console.log(error) - }); - - } - } - - onChange = (e) => { - this.setState({ - value: e.target.value, - }); - } - onSearchadmins = (e) => { - this.setState({ - onSearchcalue: e.target.value - }) - } - onSearchadmin = (value) => { - - let {collaboratorList, user_name, school_name} = this.state; - this.setState({ - // Searchadmin: undefined, - spinnings: true, - }) - // if (value === "") { - // this.setState({ - // Searchadmin: [], - // collaboratorList: collaboratorList - // }) - // } else { - // - // } - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/add_collaborators.json"; - axios.get(url, { - params: { - user_name: user_name, - school_name: school_name, - } - }).then((response) => { - if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) { - this.setState({ - spinnings: false - }) - } else { - let newlist = response.data.users; - for (var i = 0; i < newlist.length; i++) { - newlist[i].checked = false - } - this.setState({ - Searchadmin: newlist, - collaboratorList: collaboratorList, - spinnings: false - }) - } - - }).catch((error) => { - console.log(error) - }); - } - - selectChangenickname = (e, key) => { - - let {Searchadmin} = this.state; - let newlist = Searchadmin; - for (var i = 0; i < newlist.length; i++) { - newlist[key].checked = e.target.checked - } - - let arrlist = []; - let alltype = false; - for (var z = 0; z < newlist.length; z++) { - if (newlist[z].checked === true) { - arrlist.push(newlist[z]) - } - } - - if (Searchadmin.length === arrlist.length) { - alltype = true - } else { - alltype = false - } - - if (newlist.length === 0) { - this.setState({ - Searchadmin: newlist, - allChangechecked: alltype, - }) - } else { - this.setState({ - Searchadmin: newlist, - allChangechecked: alltype, - useristrue: false - }) - } - - - } - allChange = (e) => { - - let {Searchadmin} = this.state; - let newlist = Searchadmin; - for (var i = 0; i < newlist.length; i++) { - newlist[i].checked = e.target.checked - } - this.setState({ - Searchadmin: newlist, - allChangechecked: e.target.checked - }) - } - submit_add_collaborators_form = () => { - - let id = this.props.match.params.shixunId; - let {Searchadmin, collaboratorList} = this.state; - let newlist = Searchadmin; - let user_ids = [] - if (newlist.length === 0) { - this.setState({ - Collaboratorslisttype: true - }) - return - } - for (var i = 0; i < newlist.length; i++) { - if (newlist[i].checked === true) { - user_ids.push(newlist[i].user_id) - } - } - - for (var i = 0; i < user_ids.length; i++) { - for (var j = 0; j < collaboratorList.length; j++) { - if (user_ids[i] === collaboratorList[j].user.user_id) { - message.error("添加失败,重复添加!"); - - return - } - } - } - - if (user_ids.length === 0) { - this.setState({ - useristrue: true - }) - return - } - let url = "/shixuns/" + id + "/shixun_members_added.json"; - axios.post(url, { - user_ids: user_ids - }).then((response) => { - this.updatacomponentDiddata(); - this.props.showNotification(response.data.message); - this.setState({ - Collaboratorsvisibleadmin: false, - Collaboratorslist: [], - Searchadmin: [] - }) - }).catch((error) => { - console.log(error) - }); - } - addadminredio = (e) => { - this.setState({ - addadminrediovalue: e - }) - - } - submit_addadminredio = () => { - - let {addadminrediovalue} = this.state; - - let id = this.props.match.params.shixunId; - - let url = "/shixuns/" + id + "/change_manager.json"; - if (addadminrediovalue === undefined) { - this.setState({ - // Collaboratorsvisible: false, - // Collaboratorslist: [], - // Searchadmin: [], - addadminrediovalue:undefined - }); - this.props.showNotification("所选人员为空,没有更换成功"); - // this.CollaboratorsshowModal("admin") - return - } - - - axios.post(url, { - user_id: addadminrediovalue - }).then((response) => { - this.setState({ - Collaboratorsvisible: false, - Collaboratorslist: [], - Searchadmin: [], - addadminrediovalue:undefined - }); - this.updatacomponentDiddata(); - this.props.showNotification(response.data.message); - // window.location.reload(); - }).catch((error) => { - console.log(error) - }); - } - - collaborators_delete = (value) => { - this.setState({ - collaborators_deletetype: true, - collaborators_deletevalue: value - }) - - } - collaborators_deletes = () => { - let {collaborators_deletevalue} = this.state; - if (collaborators_deletevalue === null) { - return - } - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/collaborators_delete.json?user_id=" + collaborators_deletevalue; - axios.delete(url).then((response) => { - if (this.props.current_user.user_id == collaborators_deletevalue) { - this.props.history.push('/shixuns') - return; - } - this.props.showNotification(response.data.message); - this.updatacomponentDiddata(); - this.setState({ - collaborators_deletetype: false - }) - }).catch((error) => { - console.log(error) - }); - } - - loadMore = () => { - let {collaboratorList} = this.state; - this.setState({ - collaboratorListsum: collaboratorList.length, - collaboratorListsumtype: false - }) - } - - - contentViewScrolledit = (e) => { - - //滑动到底判断 - let newscrollTop = parseInt(e.currentTarget.scrollTop); - let allclientHeight = e.currentTarget.clientHeight + newscrollTop; - - if (e.currentTarget.scrollHeight - allclientHeight === 0 || e.currentTarget.scrollHeight - allclientHeight === 1 || e.currentTarget.scrollHeight - allclientHeight === -1) { - let {page, collaboratorList, user_name, school_name, Searchadmin} = this.state; - let newpage = page + 1; - let newSearchadmin = Searchadmin - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/add_collaborators.json"; - axios.get(url, { - params: { - user_name: user_name, - school_name: school_name, - page: newpage - } - }).then((response) => { - if (response.data.status === 403 || response.data.status === 401 || response.data.status === 500) { - - } else { - let newlist = response.data.users; - for (var i = 0; i < newlist.length; i++) { - newlist[i].checked = false - newSearchadmin.push(newlist[i]) - } - - this.setState({ - Searchadmin: newSearchadmin, - collaboratorList: collaboratorList, - page: newpage - }) - } - - }).catch((error) => { - console.log(error) - }); - - } - - } - onChangepageNumber=(pageNumber)=>{ - this.updatacomponentDiddata(pageNumber); - } - toggleHover=(type,key)=>{ - this.setState({ - hovertype:type, - hoverkey:type===false?undefined:key - }) - } - render() { - let { - collaboratorList, - Collaboratorsvisible, - Collaboratorsvisibleadmin, - Searchadmin, - allChangechecked, - Collaboratorslist, - Collaboratorslisttype, - collaborators_deletetype, - onSearchcalue, - collaboratorListsum, - collaboratorListsumtype, - user_name, - school_name, - useristrue, - mylistansum, - page, - limit - } = this.state; - let {loadingContent} = this.props; - const radioStyle = { - display: 'block', - height: '30px', - lineHeight: '30px', - }; - - const antIcon = ; - - // console.log(collaboratorList) - return ( - - -
    -

    -

    -

    {collaboratorList && collaboratorList.member_count}人

    -
    - - - -

    - - -
    - 选择的成员将会成为新的管理员
    您将不再拥有管理员的权限,但您仍是合作团队的一员 -
    -
    -
      -
    • - {Collaboratorslist&&Collaboratorslist.length===0? - 请先将新的管理员通过 this.showCollaboratorsvisible("cooperation")}>"添加合作者" 加入合作者列表 - :""} - - { - Collaboratorslist.length === 0 ? "" : Collaboratorslist.map((item, key) => { - return ( - this.addadminredio(item.user_id)}>{item.name} - ) - }) - } - -
    • -
    -
    - - - -
    - - {Collaboratorsvisibleadmin === true ? - {/* this.onSearchadmin(value)}*/} - {/*onInput={this.onSearchadmins}*/} - {/*style={{width: '100%'}}*/} - {/*/>*/} - 姓名或手机号: - - { - this.setState({user_name: e.target.value}) - }} - style={{width: '215px'}} - > - 单位: - { - this.setState({school_name: e.target.value}) - }} - style={{width: '215px'}} - > - - - this.onSearchadmin()} - style={{height: '30px', lineHeight: '30px', width: '70px'}} - >搜索 -

    - 姓名 - 职业 - 单位 -

    - - -
    - -
    -
      - {Searchadmin === undefined ?
    • - 请试试搜索一下 -
    • : Searchadmin.length === 0 ? : Searchadmin.map((item, key) => { - return ( -
    • - this.selectChangenickname(e, key)} - id={item.user_id}> - {item.nickname} - {item.identify} - {item.school_name} -
    • - ) - }) - - } -
    -
    -
    -
    -
    - - - 全选 -
    - 请至少选择一个用户 -
    -
    - - -
    - {useristrue === true ? 请先选择用户 : ""} - -
    : ""} - -
    - { - collaboratorList === undefined || collaboratorList.length === 0 ? "" : collaboratorList.members.map((item, key) => { - return ( -
    - - 用户头像 - -

    {item.user.shixun_manager === true ? "创建者" : ""}

    -
    - - -
    -

    - {item.user.name} - {item.user.shixun_manager === true ? "" : - this.collaborators_delete(item.user.user_id)} - onMouseEnter={()=>this.toggleHover(true,key)} - onMouseLeave={()=>this.toggleHover(false,key)} - > } - {/*{item.user.shixun_manager === true ? "创建者" : ""}

    */} -

    - -

    -

    - {/*

    {item.user.identity}

    */} -

    {item.user.school_name}

    -

    发布实训项目  {item.user.user_shixuns_count}

    -

    - {/*删除n12.17*/} - {/*
    */} - {/* {item.user.shixun_manager === true ? "" :*/} - - {/* this.collaborators_delete(item.user.user_id)}>*/} - {/* */} - {/* }*/} - {/*
    */} - -

    - {/*

    */} - {/* */} - {/* /!*粉丝  *!/*/} - {/* /!*{item.user.fans_count}*!/*/} - {/* /!**!/*/} - {/*

    */} - {/*

    {item.user.brief_introduction}

    */} -
    - {/*取消关注*/} -
    - ) - }) - } - -
    -
    确定要删除吗?
    -
    - - -
    -
    - - {/* 10 && collaboratorListsumtype === true ? "" : "none"}*/} - {/* style={{textAlign: 'center', borderTop: '1px solid #eee'}}>*/} - {/* 加载更多*/} - {/* /!*{*!/*/} - {/* /!* mylistansum>5?*!/*/} - {/* /!*
    *!/*/} - {/* /!* *!/*/} - {/* /!*
    *!/*/} - {/* /!* :""*!/*/} - {/* /!*}*!/*/} - - {/*
    */} -
    - - {collaboratorList && collaboratorList.member_count>10?
    - -
    :""} - - - - - ); - } -} - -export default Collaborators; diff --git a/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js b/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js deleted file mode 100644 index c28833d96..000000000 --- a/public/react/src/modules/tpm/shixunchild/Propaedeutics/Propaedeu_tics.js +++ /dev/null @@ -1,126 +0,0 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import { getImageUrl, toPath } from 'educoder'; - -import { Tooltip } from 'antd'; - -import axios from 'axios'; - -import { CircularProgress } from 'material-ui/Progress'; - -const $ = window.$; - -class Propaedeutics extends Component { - constructor(props) { - super(props) - this.state={ - PropaedeuticsListcontent:undefined, - shixunId:undefined - } - } - - componentDidMount() { - let id = this.props.match.params.shixunId; - this.setState({ - shixunId:id - }) - let url="/shixuns/"+id+"/propaedeutics.json"; - axios.get(url).then((response) => { - - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - if(response.data.content!=null){ - this.setState({ - PropaedeuticsListcontent:response.data.content - }) - }else{ - this.setState({ - PropaedeuticsListcontent:"" - }) - } - } - }).catch((error) => { - console.log(error) - }); - - } - - updatamakedown=(id)=>{ - setTimeout(()=>{ - var shixunDescr = window.editormd.markdownToHTML(id, { - htmlDecode: "style,script,iframe", - taskList: true, - tex: true, - flowChart: true, - sequenceDiagram: true - }); - $("#"+id+" p:first").addClass("ReactMarkdown"); - $('#collaborators_list_info').show() - }, 200) - } - render() { - let {loadingContent} = this.props; - let {PropaedeuticsListcontent,shixunId}=this.state - - if(PropaedeuticsListcontent!=undefined){ - this.updatamakedown("ReactMarkdown") - } - - return ( - -

    - - - {/**/} - 编辑 - - -

    - - - { - loadingContent ? - : -
    - {PropaedeuticsListcontent===undefined?"": -

    - - {PropaedeuticsListcontent === undefined ||PropaedeuticsListcontent === ""? -

    -
    -
    - -

    暂时还没有相关数据哦!

    -
    -
    -
    - :} - -

    - } -
    - } -
    - ); - } -} - -export default Propaedeutics; diff --git a/public/react/src/modules/tpm/shixunchild/Ranking_list/Ranking_list.js b/public/react/src/modules/tpm/shixunchild/Ranking_list/Ranking_list.js deleted file mode 100644 index e1d2d269e..000000000 --- a/public/react/src/modules/tpm/shixunchild/Ranking_list/Ranking_list.js +++ /dev/null @@ -1,145 +0,0 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import { getImageUrl, toPath } from 'educoder'; - -import { CircularProgress } from 'material-ui/Progress'; - -import axios from 'axios'; - -const $ = window.$; - -class Ranking_list extends Component { - constructor(props) { - super(props) - this.state = { - Ranking_listData:[] - } - } - - Ranking_listList = (id) => { - let Ranking_listURL = `/shixuns/` + id + `/ranking_list.json`; - axios.get(Ranking_listURL).then((response) => { - if (response.status === 200) { - if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { - - }else{ - this.setState({ - Ranking_listData: response.data - }); - } - } - - }).catch((error) => { - console.log(error) - }); - } - - componentDidMount() { - let id = this.props.match.params.shixunId; - setTimeout(this.Ranking_listList(id), 1000); - } - checkAddZone=(num)=>{ - return num<10 ? '0' + num.toString() : num - } - dateTimeFormatter=(t)=> { - if (!t) return '' - t = new Date(t).getTime() - t = new Date(t) - var year = t.getFullYear() - var month = (t.getMonth() + 1) - month = this.checkAddZone(month) - - var date = t.getDate() - date = this.checkAddZone(date) - - var hour = t.getHours() - hour = this.checkAddZone(hour) - - var min = t.getMinutes() - min = this.checkAddZone(min) - - return year + '-' + month + '-' + date + ' ' + hour + ':' + min - } - - formatSeconds=(value)=> { - var theTime = parseInt(value);// 秒 - var theTime1 = 0;// 分 - var theTime2 = 0;// 小时 - if(theTime > 60) { - theTime1 = parseInt(theTime/60); - theTime = parseInt(theTime%60); - if(theTime1 > 60) { - theTime2 = parseInt(theTime1/60); - theTime1 = parseInt(theTime1%60); - } - } - var result = ""+parseInt(theTime)+"秒"; - if(theTime1 > 0) { - result = ""+parseInt(theTime1)+"分"+result; - } - if(theTime2 > 0) { - result = ""+parseInt(theTime2)+"小时"+result; - } - return result; - } - - render() { - let { Ranking_listData } = this.state; - let { loadingContent } = this.props; - - // console.log(Ranking_listData) - return ( - - { loadingContent ? - : - -
    - {Ranking_listData===undefined||Ranking_listData.length===0? -
    - -

    我们在等你,不轻言放弃

    -
    - :Ranking_listData.map((item,key)=>{ - var keys=key+1 - return( -
    -
  • - - 2?"block":"none"}} - >{key+1} - - 头像 - - - {item.users.name} -
  • - -
  • {this.dateTimeFormatter(item.time)}通关
  • - {/*
  • */} - {/*/!*{item.accuracy} %准确率*!/*/} - {/*
  • */} -
  • {item.use_time===null?"":this.formatSeconds(item.use_time)}
  • -
  • +{item.gold}金币
  • -
    - ) - })} -
    - } -
    - - ); - } -} - -export default Ranking_list; diff --git a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js b/public/react/src/modules/tpm/shixunchild/Repository/Repository.js deleted file mode 100644 index c477422e8..000000000 --- a/public/react/src/modules/tpm/shixunchild/Repository/Repository.js +++ /dev/null @@ -1,266 +0,0 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import axios from 'axios'; - -import { trace, trace_collapse ,getImageUrl, toPath} from "educoder"; - -import RepositoryDirectories from './RepositoryDirectories' - -import { ActionBtn , NoneData } from 'educoder' -import RepositoryCombinePath from './RepositoryCombinePath' -const $ = window.$; - -// 点击按钮复制功能 -function jsCopy(){ - var e = document.getElementById("copy_rep_content"); - e.select(); - document.execCommand("Copy"); -} -/** - 提交记录 - 使用指南 - */ -class Repository extends Component { - constructor(props) { - super(props); - this.state={ - - } - } - componentDidMount() { - } - onRepoFileClick = (item) => { - - this.props.fetchRepo(item) - - } - render() { - let { match, author, git_url, lastest_commit,repositoryLoading, commits,trees,pathArray , TPMRightSectionData } = this.props; - - if (!author) { - author = {} - } - let userauthority=false; - if(this.props.author!=undefined){ - userauthority=this.props.author.login===""||this.props.author.user_id===""||this.props.author.login===null||this.props.author.user_id===null; - } - return ( - - {/* jfinalshop/WebRoot */} - {/*
    - - - 分支 1 - - Git使用指南 -
    */} - - { repositoryLoading ?
    : - -
    -
    -
    -
    -
    - {/*
    - -
    - -
    - - - -
    */} - - Git使用指南 - { - this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ? - !this.props.secret_repository_tab && - +添加文件 - :"" - } - - - -
    - - - { - jsCopy() - }} data-tip-down="点击复制版本库地址" - className="fl ml5"> - - - - - {/* Git使用指南 */} - - - { $('#repository_url_tip').css('display') === 'none' - ? $('#repository_url_tip').show() - : $('#repository_url_tip').hide() }} - className="fl ml6 mt1"> - - - - -
    -
    - - {this.props.secret_repository_tab && - - } - -
    -
    - - - {/* 用户、最近提交时间 */} - { - trees === undefined || trees === null ||trees.length===0? : -
    - {commits===undefined?"":commits===null||commits.length===0?"":
    - {author.name} - {commits[0].author.name} - 提交于 - - {commits===undefined?"":commits[0].time} - :{commits===undefined?"":commits[0].title} - - - - 提交记录 - -
    } - -
    -
    - {/* 当前目录位置 */} - - -
    - { trees === undefined ?"": trees === null || trees.length===0?"":trees.map((item, index) => { - return ( -
  • - - - this.onRepoFileClick(item)}> -  {item.name} - - -
  • - ) - })} -
    -
    -
    -
    - } - - {/* 当前分支的文件 */} - -
    -
    - } -
    - - ); - } -} -/* - 提交记录 -
    - { RepositoryList===undefined?"":RepositoryList.commits.map((item,key)=>{ - // {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"} - return( -
    -
    {item.email}
    -
    {item.title}
    -
    {item.id}
    -
    {item.time}
    -
    - ) - }) } -
    - - - -
  • - - - 1-1.py - -
  • - - - -*/ - -export default Repository; diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js deleted file mode 100644 index e074908e3..000000000 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFile.js +++ /dev/null @@ -1,201 +0,0 @@ -import React, { Component } from 'react'; -import { ActionBtn } from 'educoder' - -import { Form , Modal , Input , Breadcrumb , Button } from 'antd' - -import { Link } from 'react-router-dom' - -import axios from 'axios' - -/** - ---------------------------- START - */ -function getModeByMirrorName(mirror_name) { - let mode = 'javascript' - if (mirror_name && mirror_name.length) { - for (let i = 0; i < mirror_name.length; i++) { - let modeVal = mirrorNameModeMap[mirror_name[i]]; - if (modeVal) { - mode = modeVal; - break; - } - } - } - return mode; -} -const _extraKeys = {"Alt-/": "autocomplete"}; -function createCMOptions(mirror_name) { - let mode = getModeByMirrorName(mirror_name) - - let 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; -} - -const 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 -*/ - -class RepositoryAddFile extends Component { - constructor(props) { - super(props); - } - - componentDidMount(){ - let cmOptions = createCMOptions(this.props.mirror_name) - const 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; - } - - checkPath= (rule, value, callback) =>{ - if(!value){ - callback('文件名不能为空'); - }else if (value == "/" || value.indexOf('.') == -1 ) { - callback('请输入正确的文件路径,如:src/HelloWorld.java'); - }else{ - callback(); - } - } - - handleSubmit = () =>{ - this.props.form.validateFieldsAndScroll((err, values) => { - if(!err){ - let shixunId = this.props.match.params.shixunId; - let url = `/shixuns/${shixunId}/add_file.json` - axios.post(url,{ - path:values.path, - message:values.message, - content:this.extend_editor.getValue() - }).then((result)=>{ - if(result){ - this.props.history.push(`${result.data.url}`) - } - }).catch((error)=>{ - console.log(error); - }) - } - }) - } - render(){ - const {getFieldDecorator} = this.props.form; - let { shixunId } = this.props.match.params; - return( -
    - -

    - - 实训项目 - 版本库 - 添加新文件 - -

    -
    -
    - - {getFieldDecorator('path', { - rules: [ - { - validator:this.checkPath - }] - })( - - )} - -
    -
    -

    - -

    - -
    - -
    - - - {getFieldDecorator('message', { - rules: [{required: true, message: "请输入提交信息"}], - })( - - )} - -
    -
    - - 取消 -
    -
    - -
    - ) - } -} -const WrappedRepositoryAddFile = Form.create({name: 'taskRepositoryAddFile'})(RepositoryAddFile); -// RouteHOC() -export default (WrappedRepositoryAddFile); \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js deleted file mode 100644 index 51f6e35f2..000000000 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCodeEditor.js +++ /dev/null @@ -1,185 +0,0 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import axios from 'axios'; - -import RepositoryDirectories from './RepositoryDirectories' - -import { trace_collapse } from 'educoder' - -import Popconfirm from 'antd/lib/popconfirm'; -import 'antd/lib/popconfirm/style/css'; - -import { message } from 'antd'; - -require('codemirror/lib/codemirror.css'); - -const $ = window.$; - - -/** - ---------------------------- START - */ -function getModeByMirrorName(mirror_name) { - let mode = 'javascript' - if (mirror_name && mirror_name.length) { - for (let i = 0; i < mirror_name.length; i++) { - let modeVal = mirrorNameModeMap[mirror_name[i]]; - if (modeVal) { - mode = modeVal; - break; - } - } - } - return mode; -} -const _extraKeys = {"Alt-/": "autocomplete"}; -function createCMOptions(mirror_name) { - let mode = getModeByMirrorName(mirror_name) - - let 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; -} - -const 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 - */ - -class RepositoryCodeEditor extends Component { - constructor(props) { - super(props) - this.state = { - codeSaving: false - } - } - componentDidUpdate = (prevProps, prevState) => { - - if (this.props.fileContent && this.props.fileContent != prevProps.fileContent) { - // window.setTimeout(() => { - this.extend_editor.setValue(this.props.fileContent) - // }, 2000) - } - } - componentDidMount(){ - let cmOptions = createCMOptions(this.props.mirror_name) - const 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; - } - - saveCode = () => { - const { shixunId, pathArray } = this.props; - const url = `/shixuns/${shixunId}/update_file.json` - const path = pathArray.join('/') - this.setState({ codeSaving: true }) - axios.post(url, { - secret_repository: this.props.secret_repository_tab, - content: this.extend_editor.getValue(), - // type: forTest === true ? 1 : 0, - path: path - } - ).then((response) => { - if (response.data.content) { - message.success('保存成功'); - this.setState({ codeSaving: false }) - } - }) - } - render() { - const { fileContent, match, saveCode } = this.props; - const { codeSaving } = this.state; - return ( - - -
    - - -
    -
    -
    -
    - { codeSaving ? - 保存中... - : this.saveCode(this.extend_editor.getValue())} - okText="确定" cancelText="取消"> - {/* onClick={this.saveCode} - onClick={() => saveCode(this.extend_editor.getValue())} - */} - 保存 - } -
    -
    -
    - - -
    - -
    -
    - -
    - - ); - } -} -export default RepositoryCodeEditor; diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCombinePath.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCombinePath.js deleted file mode 100644 index aba008e20..000000000 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryCombinePath.js +++ /dev/null @@ -1,82 +0,0 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import axios from 'axios'; - -import { trace_collapse, WordsBtn } from 'educoder' - -import { message, Input } from 'antd'; - - -const $ = window.$; - - -class RepositoryCombinePath extends Component { - constructor(props) { - super(props) - this.state = { - value: this.props.secret_dir_path || '', - isEdit: false, - } - } - - onSave = () => { - const { shixunId, pathArray } = this.props; - const url = `/shixuns/${shixunId}/set_secret_dir.json` - - this.setState({ codeSaving: true }) - axios.post(url, { - secret_dir_path: this.state.value - } - ).then((response) => { - if (response.data) { - message.success('保存成功'); - this.setState({isEdit: false}) - } - }) - } - onChange = (e) => { - const { value } = e.target; - this.setState({ value }) - } - onEdit = () => { - this.setState({isEdit: true}, () => { - window.$('.combinePathEditRow input')[0].focus() - }); - } - render() { - const { fileContent, match, saveCode } = this.props; - const { isEdit, value } = this.state; - return ( - -
    - - 第一版本库合并路径: - - {!isEdit && 修改} - {isEdit && 保存} -
    - - - ); - } -} -export default RepositoryCombinePath; diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js deleted file mode 100644 index 7c6eca37a..000000000 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryDirectories.js +++ /dev/null @@ -1,66 +0,0 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import axios from 'axios'; - -import { trace_collapse } from 'educoder' -const $ = window.$; - - -class RepositoryDirectories extends Component { - constructor(props) { - super(props) - this.state = { - - } - } - componentDidMount() { - } - render() { - const { match, pathArray, fetchRepo - } = this.props; - let { RepositoryList } = this.state; - return ( - - - { pathArray.length !== 0 && -
    - fetchRepo(0)} - > - {match.params.shixunId} - - / - { pathArray.map((item, index) => { - // /shixuns/3ozvy5f8/repository/3ozvy5f8/master/shixun_show/src - return ( - - { this.props.nameTypeMap[item] === 'tree' || item.indexOf('.') === -1 - ? fetchRepo(index + 1)} - className="color-blue"> - {item} - : - - {item} - } - {index !== pathArray.length - 1 && /} - - ) - }) - } -
    } - -
    - - ); - } -} -export default RepositoryDirectories; diff --git a/public/react/src/modules/tpm/shixunchild/Repository/TPMRepositoryCommits.js b/public/react/src/modules/tpm/shixunchild/Repository/TPMRepositoryCommits.js deleted file mode 100644 index 37a4217a6..000000000 --- a/public/react/src/modules/tpm/shixunchild/Repository/TPMRepositoryCommits.js +++ /dev/null @@ -1,146 +0,0 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import axios from 'axios'; - -import TPMNav from '../../component/TPMNav' -import TPMRightSection from '../../component/TPMRightSection' -import { CircularProgress } from 'material-ui/Progress'; - -import { trace_collapse } from 'educoder' -const $ = window.$; - -// 点击按钮复制功能 -function jsCopy(){ - var e = document.getElementById("copy_rep_content"); - e.select(); - document.execCommand("Copy"); -} -class TPMRepositoryCommits extends Component { - constructor(props) { - super(props) - this.state = { - RepositoryList: undefined, - } - } - componentDidMount() { - let id = this.props.match.params.shixunId; - - let collaborators=`/shixuns/`+id+`/commits.json`; - axios.post(collaborators, { - secret_repository: this.props.secret_repository_tab - }).then((response)=> { - - if(response.status===200){ - this.setState({ - RepositoryList: response.data - }); - } - trace_collapse('repo commits res', response.data) - - }).catch((error)=>{ - console.log(error) - }); - - } - render() { - const { loadingContent, creator, shixun, myshixun, recommend_shixuns, current_user, watched, - aboutFocus, user, match - } = this.props; - let { RepositoryList } = this.state; - return ( - - -
    - {/* 可能会影响到其他页面的样式,需要测试、协商 */} -
    - - { loadingContent ? - - : - -
    -
    - - 提交记录 - - {/*  35 */} - - 返回 - -
    - - -
    -
      - { RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{ - return ( -
    • - {item.email} -

      - {item.title} -

      - {item.time} - -
      -
    • ) - }) - } -
    -
    -
    - } -
    - -
    - -
    -
    - - -
    - - ); - } -} - -/** - { RepositoryList === undefined ? "" : RepositoryList.commits.map( (item, key)=>{ - // {"email":"李暾","title":"2\n","id":"80cb6fc55a14bdd64a9c99913f416966238ed3de","time":"49年前"} - return ( -
    -
    {item.email}
    -
    {item.title}
    -
    {item.id}
    -
    {item.time}
    -
    - ) - }) - */ -export default TPMRepositoryCommits; diff --git a/public/react/src/modules/tpm/shixunchild/ShixunDiscuss/ShixunDiscuss.js b/public/react/src/modules/tpm/shixunchild/ShixunDiscuss/ShixunDiscuss.js deleted file mode 100644 index 4e9470f89..000000000 --- a/public/react/src/modules/tpm/shixunchild/ShixunDiscuss/ShixunDiscuss.js +++ /dev/null @@ -1,170 +0,0 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import { getImageUrl, toPath } from 'educoder' - -import axios from 'axios'; - -const $ = window.$; - -class ShixunDiscuss extends Component { - constructor(props) { - super(props) - this.state = { - TPMRightSectionData: undefined - } - } - getshixunsDetailsList = (id) => { - let shixunsDetailsURL = `/shixuns/` + id + `/discusses.json`; - axios.get(shixunsDetailsURL).then((response) => { - if (response.status === 200) { - this.setState({ - TPMRightSectionData: response.data - }); - } - }).catch((error) => { - console.log(error) - }); - } - - componentDidMount() { - let id = this.props.match.params.shixunId; - setTimeout(this.getshixunsDetailsList(id), 1000); - } - render() { - let { TPMRightSectionData } = this.state; - - return ( -
    -
    -
    - - - { - TPMRightSectionData===undefined?"":TPMRightSectionData.map((item,key)=>{ - return( -
    -
    - - 用户头像 - -
    - -
    -
    -
    - -
    -
    - {item.user.name} - {item.time} - [第{item.round}关] -
    -
    - -
    -
    -

    {item.content}

    -
    -
    -
    -
    - - { - item.replies.map((i,k)=>{ - return( -
    -
    -
    -
    -
    - {i.user.name} - {i.time} -
    -

    - - - - - - - -

    -
    -
    -
    -
    -

    {i.content}

    -
    -
    -
    -
    -
    -
    - - ) - }) - } - - -

    - - - - - - - - - - - - - - - - - 3 - - -

    - - -
    -
    - - 0?1442652658 - -
    - -
    -
    - -
    -
    调整高度
    - 发送 -
    -
    -
    -
    -
    -
    - ) - }) - } - -
    -
    -
    - ) - } - } - - export default ShixunDiscuss; diff --git a/public/react/src/modules/tpm/shixunchild/Shixunfork_list.js b/public/react/src/modules/tpm/shixunchild/Shixunfork_list.js deleted file mode 100644 index f813441f1..000000000 --- a/public/react/src/modules/tpm/shixunchild/Shixunfork_list.js +++ /dev/null @@ -1,69 +0,0 @@ -import React, { Component } from 'react'; -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link} from "react-router-dom"; - -import { Switch } from 'antd'; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames' - -import { TPMIndexHOC } from '../TPMIndexHOC' - -import { SnackbarHOC } from 'educoder' - -import ShixunCard from '.././shixuns/ShixunCard'; - -import { Pagination,Row,Col,Rate } from 'antd'; - - import './shixunchildCss/Shixunfork_list.css'; - -import 'antd/lib/rate/style/index.css'; - -const $ = window.$; - -class Shixunforklist extends Component { - constructor(props) { - super(props) - this.state = { - - } - } - - handleChange = (value) => { - console.log('Page: ', value); - // this.setState({ value }); - } - //JSX - render() { - const { match, history } = this.props - - return ( -
    - -
    -
    - Fork实训列表 - 返回 -
    - - - - - - -
    -
    -
      - -
    -
    -
    -
    -
    -
    - ); - } -} -export default SnackbarHOC() (TPMIndexHOC ( Shixunforklist )); diff --git a/public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css b/public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css deleted file mode 100644 index abfafc46a..000000000 --- a/public/react/src/modules/tpm/shixunchild/shixunchildCss/Challenges.css +++ /dev/null @@ -1,265 +0,0 @@ -.editormd-html-preview, .editormd-preview-container { - width: 100% !important; -} -.Finish_button{ - height: 30px; - line-height: 30px; - margin-top: -8px; -} -.startbtnModal .ant-modal-content{ - background: transparent; - box-shadow: 0 4px 12px transparent; -} - -.startbtnModal .ant-modal-content .ant-modal-body .ant-spin-spinning{ - margin-left: 45%; -} - -.color05101a{ - color:#05101a; -} - -.mtf3{ - margin-top: -3px; -} -.addshixuns{ - height: 27px; - line-height: 25px; -} -.challenbaocun{ - width:60px; - height:30px; - background:#29BD8B; - border-radius:3px; - cursor:pointer -} -.challenbaocuntest{ - width:60px; - height:30px; - font-size:16px; - color:#FFFFFF; - text-align: center; - line-height:30px; - cursor:pointer -} -.renwuxiangqdiv{ - width:72px; - height:30px; - font-size:18px; - color:#000000; - line-height:30px; -} -.renwuxiangqdivtest{ - height:30px; - font-size:16px; - line-height:30px; -} - -.renwuxiangssi{ - width: 50%; -} -.renwuxiangssit{ - width: 50%; -} - -.pb47{ - padding-bottom: 47px; -} -.colorbluetwo{ - color: #1E8FFD; - font-size: 12px; - cursor:pointer; - margin-right: 18px; -} -.colorbluetest{ - color: #06101A; - font-size: 12px; - cursor:default -} -.shixunbingbaocun{ - font-size:14px; - color:#888888; -} -.intermediatecenter{ - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} -.iconfontysl{ - vertical-align:middle; - font-family:"iconfont" !important; - font-style:normal; - -webkit-font-smoothing: antialiased; - -webkit-text-stroke-width: 0.2px; - font-size: 100px; - color: #F5F5F5; -} -.juplbool{ - position: relative; -} - -.juplboolp{ - position: absolute; - bottom: 21px; -} - - -.shixunjianjie{ - height: 76px; - line-height: 35px; - padding: 20px; - border-bottom: 1px solid #eeee; - /*margin-bottom: 10px;*/ -} - -.pd20{ - padding:20px; -} - -.shixunbingbaocun12{ - font-size:12px; - color:#888888; -} - -.shixunbingbaocun33312{ - font-size:12px; - color:#333333 -} - -.shixunjianjiecballenges{ - height: 76px; - line-height: 35px; - padding: 20px; -} - -.padding1020pxshixun{ - padding: 10px 20px 0px 20px; -} - -.shixunstartbutton33BD8C{ - /* border: #33BD8C !important; */ - cursor: inherit !important; - border: 1px solid #33BD8C !important; - background: transparent !important; - color: #33BD8C !important; - box-shadow: none; - text-shadow: none; -} - -.shixunstartbuttonFF6601{ - /*background: #FF6601 !important;*/ - /*border: #FF6601 !important;*/ - /*cursor: inherit !important;*/ - /* border: #33BD8C !important; */ - cursor: inherit !important; - border: 1px solid #FF6601 !important; - background: transparent !important; - color: #FF6601 !important; - box-shadow: none; - text-shadow: none; -} - -.shixunstartbutton666666{ - font-size:14px; - color:#666666; -} - -.newedu-nodata-img{ - width: 300px; - margin: 50px 0px; - display: block; - margin-left: 41%; -} - -.fonthiddens{ - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.icon-bianji_Hover,.icon-xiayi_Hover,.icon-shangyi_Hover,.icon-shanchu_Hover{ - color:#BBBBBB !important; -} - -.icon-bianji_Hover:hover{ - color: rgb(80, 145, 255) !important; -} - -.icon-xiayi_Hover:hover{ - color: rgb(51, 189, 140) !important; -} - -.icon-shangyi_Hover:hover{ - color: rgb(51, 189, 140) !important; -} - -.icon-shanchu_Hover:hover{ - color:rgb(255, 85, 85) !important; -} -.ysliconfont{ - text-align: center; - line-height: 29px; - color: #8a8a8a; -} - -.fangdaone{ - height: 63px; - width: 100%; - position: fixed; - top: 0px; - left: 0px; - z-index: 2800; - right: 0px; -} - -.fangdatwo{ - height: 100%; - width: 100%; - position: fixed; - top:0px; - margin-top: 63px; - bottom: 0px; - left: 0px; - z-index: 2800; - right: 0px; -} - -.fangdatwoswidth{ - border-top: 1px solid #eeee; -} - -.jupyterswidth{ - width: 1140px; -} - -.chongzhistyles{ - color: #fff; - width: 85px !important; - height: 32px !important; - margin-right: 20px; -} - -.chongzhistyles:hover, .chongzhistyles:focus{ - color: #fff !important; - background-color: #29BD8B !important; - border-color: transparent; -} -.chongzhistyles:active, .chongzhistyles:active{ - color: #fff !important; - background-color: #29BD8B !important; - border-color: transparent ; -} - -.Countdownfonttpm{ - width: 60px; - display: inline-block; -} - -.Countdownfonttpm .ant-statistic-content-value{ - font-size: 14px; -} - -.boreee{ - border-bottom: 1px solid #F4F4F4; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixunchild/shixunchildCss/Shixunfork_list.css b/public/react/src/modules/tpm/shixunchild/shixunchildCss/Shixunfork_list.css deleted file mode 100644 index d6ef5ebfe..000000000 --- a/public/react/src/modules/tpm/shixunchild/shixunchildCss/Shixunfork_list.css +++ /dev/null @@ -1,6 +0,0 @@ -.ant-rate{ - color: #FFAA05 !important; -} -.ant-pagination-options-quick-jumper input{ - height: 22 !important; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixuns/ShixunCard.js b/public/react/src/modules/tpm/shixuns/ShixunCard.js deleted file mode 100644 index a292f4d87..000000000 --- a/public/react/src/modules/tpm/shixuns/ShixunCard.js +++ /dev/null @@ -1,244 +0,0 @@ -import React, { Component } from 'react'; -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames'; - -import { Rating ,Pagination} from "@icedesign/base"; - -import {getImageUrl,setImagesUrl, toPath,getUrl} from 'educoder'; - -import { Spin,Icon,Tooltip ,Rate} from 'antd'; -import LoadingSpin from '../../../common/LoadingSpin'; -import './shixunCss/shixunCard.css'; - -// 引入业务组件样式 - -import axios from 'axios'; - -const $ = window.$; - -class ShixunCard extends Component { - constructor(props) { - super(props) - - this.state = { - startValue:[], - order_by:"", - page:1, - limit:16, - keyword:"", - status:0, - diff:0, - hideme:false, - tag_level:3, - tag_id:'' - } - - } - - PaginationonChange=(pageNumber)=> { - this.props.shixunsPage(pageNumber); - } - - render() { - let {middleshixundata, pagination, typepvisible, pages, totalcount} = this.props; - const MyRate = ({ defaultValue, ...rest }) => { - let myValue = defaultValue; - // console.log(myValue-Math.floor(myValue)) - // if (myValue < Math.ceil(myValue)) { - // myValue = Math.floor(myValue) + 0.5; - // } - - return ; - }; - return ( -
    - - - - { middleshixundata === undefined?"":middleshixundata.length === 0 ?
    - - -

    暂时还没有相关数据哦!

    -
    :""} - - -
    - -
    -
    - {middleshixundata === undefined || middleshixundata.length === 0?" ":middleshixundata.map((item,key)=>{ - return( -
    - - { - item.tag_name === null ? "": -
    - {item.tag_name} - {/**/} -
    - } - { - item.is_jupyter===true? -
    -

    Jupyter

    - {/**/} -
    - :""} - -
    - -

    非试用内容,需要授权

    -
    - - - {/**/} - - - {/*target="_blank"*/} - -
    -

    - - {item.name} - -

    - - {/*target="_blank"*/} - {/**/} -

    - - {/**/} - - - {item.score_info===null?"5分":item.score_info+"分"} -

    - -

    - {item.is_jupyter===false? - - {item.challenges_count} - - :""} - - {/**/} - {/**/} - {/*{item.exp}*/} - {/**/} - {/**/} - - - - {item.stu_num} - - - - {item.level} -

    - -
    -
    - ) - }) - } - -
    - -
    - {/*totalcount*/} -
    - {/**/} - {/* 不加参数请求的时候,没返回总数了。加了个比较大的数字,让他可以翻页 */} - -
    - -
    - -
    -
    -
    - ) - } -} - -export default ShixunCard; diff --git a/public/react/src/modules/tpm/shixuns/ShixunCardList.js b/public/react/src/modules/tpm/shixuns/ShixunCardList.js deleted file mode 100644 index 235b11323..000000000 --- a/public/react/src/modules/tpm/shixuns/ShixunCardList.js +++ /dev/null @@ -1,316 +0,0 @@ -import React, { Component } from 'react'; -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route} from "react-router-dom"; - -import { Switch ,Input,Tooltip,Icon} from 'antd'; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames' - -import 'antd/lib/switch/style/index.css' - -import './shixunCss/ShixunCardList.css'; -import GotoQQgroup from '../../../modal/GotoQQgroup' - -import { on, off } from 'educoder' - -const $ = window.$; - -const Search = Input.Search; - -class ShixunCardList extends Component { - - constructor(props) { - super(props); - this.state={ - allevent:"desc", - mine:0, - InputValue: props.keyword || "", - typemy:0, - hots:0, - news:0, - shixunid:"", - upcircle:false, - typekeyid:undefined, - goshowqqgtounp:false, - } - } - - componentDidUpdate = (prevProps, prevState) => { - if (this.props.keyword != prevProps.keyword) { - this.setState({ - InputValue: this.props.keyword - }) - } - } - componentDidMount = () => { - on('searchKeywordChange', (event, data) => { - // console.log(data) - this.Input_search(data) - }) - } - componentWillUnmount = () => { - off('searchKeywordChange') - } - - - latestHot=(e,key)=>{ - - let{upcircle,typekeyid}=this.state; - - let id = e.target.id; - $("#"+id).siblings().removeClass("active"); - $("#"+id).addClass("active"); - - let type; - - // if(id==="all"){ - // type="publish_time"; - // } - if(id==="hot"){ - type="hot"; - }else if(id==="new"){ - type="new"; - - } - - if(typekeyid===key){ - if(upcircle===true){ - this.setState({ - upcircle:false, - }) - // this.props.Shixunsupcircles("desc") - }else if(upcircle===false){ - this.setState({ - upcircle:true, - }) - // this.props.Shixunsupcircles("desc") - } - }else{ - this.setState({ - typekeyid:key - }) - } - - - this.props.ShixunsState(false,type,"desc"); - } - - - onSwitchChange=(e,key)=>{ - let id=e.target.id - $("#"+id).siblings().removeClass("active"); - $("#"+id).addClass("active"); - let {typemy,upcircle,typekeyid}=this.state; - - if(typekeyid===key){ - if(upcircle===true){ - this.setState({ - upcircle:false, - }) - this.props.Shixunsupcircles("desc") - }else if(upcircle===false){ - this.setState({ - upcircle:true - }) - this.props.Shixunsupcircles("asc") - } - }else{ - this.setState({ - typekeyid:key - }) - } - - - if(typemy===0){ - this.setState({ - typemy:1 - }) - }else{ - this.setState({ - typemy:0 - }) - } - // allevent - this.props.ShixunsSwitch(); - } - //输入框搜索 - Input_search = (value) => { - this.setState({ - InputValue: value - }) - this.props.OnSearchInput(value,true); - } - - Input_searchs = (e) => { - this.setState({ - InputValue: e.target.value - }) - this.props.OnSearchInput(e.target.value,false); - } - upcircles=(val)=>{ - if(val==="asc"){ - this.setState({ - upcircle:false, - }) - this.props.Shixunsupcircles("desc") - }else if(val==="desc"){ - this.setState({ - upcircle:true - }) - this.props.Shixunsupcircles("asc") - } - } - - //头部获取是否已经登录了 - getUser=(url,type)=>{ - if(this.props.checkIfLogin()===false){ - this.props.showLoginDialog() - return - } - if(this.props.checkIfProfileCompleted()===false){ - this.props.showProfileCompleteDialog() - return - } - if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){ - this.setgoshowqqgtounp(true); - return; - } - - if(url !== undefined || url!==""){ - window.location.href = url; - } - - - } - - // 处理弹框 - setgoshowqqgtounp=(bool)=>{ - this.setState({ - goshowqqgtounp:bool - }) - } - render(){ - let {mine,InputValue,upcircle,goshowqqgtounp}=this.state; - - // console.log("NewHeadermygetHelmetapi123123123123"); - let shixuntype=false; - if(this.props&&this.props.mygetHelmetapi!=null){ - let shixun="/shixuns"; - let paths="/paths"; - let courses="/courses"; - this.props.mygetHelmetapi.navbar.map((item,key)=>{ - var reg = RegExp(item.link); - if(shixun.match(reg)){ - if(item.hidden===true){ - shixuntype=true - } - } - }) - } - - console.log(this.props.middleshixundata.search_tags) - return ( -
    -
    - - { - goshowqqgtounp===true? - this.setgoshowqqgtounp(bool)}> - : - "" - } - - {/*
    this.latestHot(e,1)}>全部*/} - {/*
    */} - {/*
    this.onSwitchChange(e,2)}>我的*/} - {/*
    */} - -
    this.latestHot(e,4)}>最新 -
    - -
    this.latestHot(e,3)}>最热 -
    - - {shixuntype===true?"":this.getUser("/shixuns/new")}>+新建实训项目} - -
    - { - this.props.middleshixundata&&this.props.middleshixundata.search_tags - } -
    - {/*
    this.upcircles("asc")}*/} - {/*>*/} - {/**/} - {/**/} - {/*/!**!/*/} - {/**/} - {/*
    */} - {/*
    this.upcircles("desc")}*/} - {/*style={{display:upcircle===true?"none":"block"}}*/} - {/*>*/} - {/**/} - {/**/} - {/*/!**!/*/} - {/**/} - {/*
    */} - - {/*
    */} - {/* this.Input_search(value)}*/} - {/*enterButton*/} - {/*/>*/} - - {/* this.Input_search(value)} - autoComplete="off" - > */} - {/*
    */} - {/*
    */} - {/*{*/} - {/*this.props.search_tags === null ? "" : this.props.search_tags*/} - {/*}*/} - {/*
    */} - {/*/!*
    */} - {/* *!/*/} - {/**/} - {/*
    */} - {/*隐藏我的*/} - - {/*
    */} - {/**/} -
    -
    - ); - } -} - -export default ShixunCardList; diff --git a/public/react/src/modules/tpm/shixuns/ShixunSearchBar.js b/public/react/src/modules/tpm/shixuns/ShixunSearchBar.js deleted file mode 100644 index b884d7bf0..000000000 --- a/public/react/src/modules/tpm/shixuns/ShixunSearchBar.js +++ /dev/null @@ -1,290 +0,0 @@ -import React, { Component } from 'react'; - -import { Select, Input,Menu, Dropdown } from 'antd'; - -import 'antd/lib/style/index.css'; - -import 'antd/lib/select/style/index.css'; - -import 'antd/lib/input/style/index.css'; - -import './shixunCss/ShixunSearchBar.css'; - -import axios from 'axios'; - -const $ = window.$; - -const Option = Select.Option; - -const Search = Input.Search; - - -class ShixunSearchBar extends Component { - - constructor(props) { - super(props) - this.state = { - status: undefined, - diff: 0, - InputValue: undefined, - shixunhoverData: [], - shixunchildValues:'', - shixunsearchAllvalue:"a", - openStatus:false, - openLevel:false - } -} - - //状态筛选 - status_search = (value) => { - let newvalue = value; - if (newvalue === "0") { - newvalue = " " - } else if (newvalue === "1") { - newvalue = 2 - } else if (newvalue === "2") { - newvalue = 1 - } else if (newvalue === "3") { - newvalue = 3 - } - - this.setState({ - status: newvalue, - openStatus:false - }) - let list = [{'type': 1}, {'value': newvalue}]; - this.props.StatusEnquiry(list); -} - - //难度筛选 -diff_search = (value) => { - this.setState({ - diff: value, - openLevel:false - }) - let list=[{'type':2},{'value':value}]; - this.props.StatusEnquiry(list); -} - - //输入框搜索 -Input_search = (value) => { - this.setState({ - InputValue: value - }) - this.props.OnSearchInput(value); -} - //查询 -shixunsearchAll = (e) => { - let{shixunsearchAllvalue}=this.state; - let id = e.target.value; - - if(shixunsearchAllvalue===id){ - return - } - if(id===0){ - id=" " - this.setState({ - InputValue: " " - }) - this.props.OnSearchInput(""); - } - let list=[{'tag_level':1},{'tag_id':id}]; - if(id!=undefined){ - this.setState({ - shixunsearchAllvalue:id, - shixunchildValues:"" - }) - this.props.Updatasearchlist(list); - } - -} - - shixunsearchall=(e)=>{ - let{shixunsearchAllvalue}=this.state; - let id = "a"; - - if(shixunsearchAllvalue===id){ - return - } - this.setState({ - shixunsearchAllvalue:"a", - shixunchildValues:"" - }) - this.props.allUpdatashixunlist(); - } - - //选择Tab页详情 - getshixunchildValue = (e) => { - let id = e.target.name; - let newid=e.target.id; - let list=[{'tag_level':2},{'tag_id':id}]; - if(id!=undefined||newid!=undefined){ - this.setState({ - shixunsearchAllvalue:newid - }) - this.props.Updatasearchlist(list); - } - } - -getshixunchildValues = (e) => { - let id = e.target.id; - let newid=e.target.name; - let list=[{'tag_level':3},{'tag_id':id}]; - if(id!=undefined||newid!=undefined){ - this.setState({ - shixunchildValues:id, - shixunsearchAllvalue:newid - }) - this.props.Updatasearchlist(list); - } - -} - -componentDidMount() { - let hoverUrlArr = []; - let hoverUrl = `/shixuns/menus.json`; - axios.get(hoverUrl - ).then((response) => { - hoverUrlArr = response.data; - // hoverUrlArr.reverse(); - this.setState({ - shixunhoverData: hoverUrlArr - }) - }).catch((error) => { - console.log(error) - }) -} - -render() { - let {shixunhoverData, shixunchildValues, shixunsearchAllvalue, InputValue,openStatus,openLevel} = this.state; - let {typepvisible} = this.props; - // //实训首页筛选的移入和点击事件 - // $(".shaiItem").hover(function(){ - // var hei=parseInt($(".shaiAllItem").height())-2; - // $(this).find(".subshaicontent").css("top", '34px'); - // $(this).find(".subshaicontent").show(); - // },function(){ - // $(this).find(".subshaicontent").hide(); - // }); - // - // $(".shaiItem").live("click",function(){ - // $(".shaiItem").removeClass("active"); - // $(this).addClass("active"); - // $(".subshaicontent").hide(); - // }); - // - // $(".subshaicontent").live("click", function(event){ - // $(".subshaicontent").hide(); - // event.stopPropagation(); - // }); - - let overlaymenu=(item,id)=>( - - { - item.map((list,k)=>{ - return( - -
    - {list.name} -
    - { - list.tags.map((tag,e)=>{ - return( - {tag.name} - ) - }) - } -
    -
    -
    - ) - }) - } -
    - ) - - return ( -
    -
    -
    -
    - 方向: -
    -
  • 全部
  • - - { - shixunhoverData.map((item,key)=>{ - return( - =8?"bottomLeft":"bottomCenter"}> -
  • - {item.name} -
  • -
    - ) - }) - } - - -
    -
    -
    - 筛选: - { - - } -
    -
  • this.diff_search(0)}>全部难度
  • -
  • this.diff_search(1)}>初级
  • -
  • this.diff_search(2)}>中级
  • -
  • this.diff_search(3)}>中高级
  • -
  • this.diff_search(4)}>高级
  • -
    - -
    -
    -
    -
    - ); -} -} - -export default ShixunSearchBar; diff --git a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js b/public/react/src/modules/tpm/shixuns/ShixunsIndex.js deleted file mode 100644 index 82fa6a3f9..000000000 --- a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js +++ /dev/null @@ -1,430 +0,0 @@ -import React, { Component } from 'react'; - -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import axios from 'axios'; - -import { Spin } from 'antd'; - -import { TPMIndexHOC } from '../TPMIndexHOC'; - -import { SnackbarHOC } from 'educoder'; - -import ShixunCardList from './ShixunCardList'; - -import ShixunSearchBar from './ShixunSearchBar'; - -import ShixunCard from './ShixunCard'; - -import UpgradeModals from '../../modals/UpgradeModals'; - -const queryString = require('query-string'); - -const $ = window.$; - -class ShixunsIndex extends Component { - constructor(props) { - super(props) - this.state={ - order_by: "new", - page:1, - limit:16, - keyword:"", - status:0, - diff:0, - tag_level: 1, - tag_id:'', - middleshixundata:[], - typepvisible:true, - pages:1, - search_tags:null, - parsedid:undefined, - newtag_level:undefined, - newpalce:undefined, - sort:"desc" - } - } - componentDidMount(){ - - const upsystem=`/users/system_update.json`; - axios.get(upsystem).then((response)=>{ - let updata=response.data; - this.setState({ - updata:updata - }) - }).catch((error)=>{ - console.log(error); - }) - - - - let _keyword; - if (window.__headSearchKeyword) { - this.setState({ keyword: window.__headSearchKeyword }) - _keyword = window.__headSearchKeyword - delete window.__headSearchKeyword - } - const parsed = queryString.parse(this.props.location.search); - if(parsed.id===undefined&&parsed.type===undefined){ - let {order_by, tag_level, tag_id, page, limit, keyword, status, diff} = this.state; - let params={ - order_by:order_by, - tag_level:tag_level, - tag_id:tag_id, - page:page, - limit:limit, - keyword: _keyword || keyword , - status:status, - diff:diff, - sort: "desc" - } - this.shixunresultend(params); - }else{ - let {order_by,page, limit, keyword, status, diff} = this.state; - let nawparsed=parsed.type; - let newpalce=parsed.palce; - if(nawparsed==="rep"){ - nawparsed=1 - } - else if(nawparsed==="sub"){ - nawparsed=2 - }else if(nawparsed==="tag"){ - nawparsed=3 - } - let params={ - order_by:order_by, - tag_level:nawparsed, - tag_id:parsed.id, - page:page, - limit:limit, - keyword: _keyword || keyword, - status:status, - diff:diff, - sort: "desc" - } - this.setState({ - parsedid:parsed.id, - newtag_level:nawparsed, - tag_level:nawparsed, - newpalce:newpalce, - tag_id:parsed.id, - keyword: _keyword || keyword, - }) - this.shixunresultend(params); - } - - } - - allUpdatashixunlist=()=>{ - let{sort,order_by}=this.state; - - this.setState({ - tag_level: 1, - tag_id:'', - page: 1, - limit: 16, - keyword:'', - status: 0, - diff: 0, - }) - - let params={ - order_by:order_by, - tag_level: 1, - tag_id:'', - page: 1, - limit: 16, - keyword:'', - status: 0, - diff: 0, - sort:sort - } - this.shixunresultend(params) - } - Updatasearchlist=(value)=>{ - if (value[1].tag_id === " ") { - this.setState({ - keyword: "" - }) - } - this.setState({ - tag_level:value[0].tag_level, - tag_id:value[1].tag_id, - typepvisible:true - }) - - let {order_by, sort, limit, keyword, status, diff} = this.state; - - let params={ - order_by:order_by, - tag_level:value[0].tag_level, - tag_id:value[1].tag_id, - page:1, - limit:limit, - keyword:keyword, - status:status, - diff:diff, - sort:sort - } - - this.shixunresultend(params) - } - - StatusEnquiry=(key)=>{ - - let Vrl=`/shixuns.json`; - let newstatus; - let newdiff; - if(key[0].type===1){ - this.setState({ - status: key[1].value, - typepvisible:true - }) - newstatus=key[1].value; - newdiff=this.state.diff; - }else if(key[0].type===2){ - this.setState({ - diff: key[1].value, - typepvisible:true - }) - newdiff=key[1].value; - newstatus=this.state.status; - } - let params= { - order_by:this.state.order_by, - tag_level:this.state.tag_level, - tag_id:this.state.tag_id, - page:1, - limit:this.state.limit, - keyword:this.state.keyword, - status:newstatus, - diff:newdiff, - } - this.shixunresultend(params) - - } - - OnSearchInput=(value,type)=>{ - if(type===true){ - this.setState({ - keyword:value, - typepvisible:true, - pages:1 - }) - let {order_by, tag_level, tag_id, sort, limit, status, diff} = this.state; - let params= { - order_by:order_by, - tag_level:tag_level, - tag_id:tag_id, - page:1, - limit:limit, - keyword:value, - status:status, - diff:diff, - sort:sort - } - this.shixunresultend(params) - }else{ - this.setState({ - keyword:value, - pages:1 - }) - } - - - } - - ShixunsSwitch=()=>{ - //types - this.setState({ - order_by:"mine", - typepvisible:true, - pages:1, - }) - let{tag_level,tag_id,page,limit,keyword,status,diff,sort}=this.state; - let newsort=sort; - if(newsort===undefined){ - newsort="desc" - } - let params= { - order_by:"mine", - tag_level:tag_level, - tag_id:tag_id, - page:1, - limit:limit, - keyword:keyword, - status:status, - diff:diff, - sort:newsort - } - this.shixunresultend(params) - } - - - shixunsPage=(value)=>{ - this.setState({ - page:value, - typepvisible:true, - pages:value - }) - let {order_by, tag_level, tag_id, limit, keyword, status, diff,sort} = this.state; - let params= { - order_by:order_by, - tag_level:tag_level, - tag_id:tag_id, - page:value, - limit:limit, - keyword:keyword, - status:status, - diff:diff, - sort:sort - } - - let Url=`/shixuns.json`; - axios.get(Url,{ - params - }).then((response)=> { - if(response.status===200){ - this.setState({ - middleshixundata: response.data, - typepvisible:false, - }); - } - }).catch((error)=>{ - console.log(error) - }); - } - ShixunsState=(val,type,sorts)=>{ - // sort, - let {tag_level, tag_id, page, limit, keyword, status, diff,sort} = this.state; - let newsort=sorts?sorts:sort; - this.setState({ - order_by:type, - typepvisible:true, - pages:1, - sort:sorts?sorts:sort - }) - - let params - // let vals=false - if(newsort===undefined){ - newsort="desc" - }else{ - newsort=sorts?sorts:sort - } - params= { - order_by:type, - tag_level:tag_level, - tag_id:tag_id, - page:1, - limit:limit, - keyword:keyword, - status:status, - diff:diff, - sort:newsort - } - this.shixunresultend(params) - } - - Shixunsupcircles=(sort)=>{ - console.log(sort) - this.setState({ - sort:sort - }) - let { - order_by, - tag_level, - tag_id, - limit, - keyword, - status, - diff, - } = this.state; - - - - let params= { - order_by:order_by, - tag_level:tag_level, - tag_id:tag_id, - page:1, - limit:limit, - keyword:keyword, - status:status, - diff:diff, - sort:sort - } - this.shixunresultend(params) - } - - - - - shixunresultend=(params)=>{ - let Url=`/shixuns.json`; - axios.get(Url,{ - params - }).then((response)=> { - // TODO 有keyword返回值时 显示一共有多少条记录 - if(response.status===200){ - this.setState({ - search_tags:response.data.search_tags, - middleshixundata: response.data, - typepvisible:false, - pages:1 - }); - } - }).catch((error)=>{ - console.log(error) - }); - } - render() { - let {middleshixundata, typepvisible, pages, search_tags, keyword,parsedid,newtag_level,newpalce} = this.state; - - // console.log(this.state.updata) - return ( -
    - {this.state.updata===undefined?"":} - {/**/} - - - - {/*下方图片*/} - - {/**/} -
    - ); - } -} - -export default SnackbarHOC() (TPMIndexHOC ( ShixunsIndex )); diff --git a/public/react/src/modules/tpm/shixuns/css/TPMBanner.css b/public/react/src/modules/tpm/shixuns/css/TPMBanner.css deleted file mode 100644 index 32fab5b47..000000000 --- a/public/react/src/modules/tpm/shixuns/css/TPMBanner.css +++ /dev/null @@ -1,168 +0,0 @@ -.shixunsdiffcult{ - width: 40px; - height: 21px; - overflow: hidden; - margin-left: 8px; - } - - .rateYo{ - text-align: center; - cursor: default; - width: 111px; - } - - a:link, a:visited { - color: #05101a; -} - -a:link{text-decoration:none;} - -a:visited{text-decoration:none;} - -a:hover{text-decoration:none;} - -a:active{text-decoration:none;} - - -.next-rating-overlay .next-icon{ - color: #FFA800!important; -} - -.displayblock{ - display:block; - text-align: center; - margin-bottom: 20px; -} - -.totalScore{ - justify-content: center; - align-items: center; - display: -webkit-flex; - height: 100%; -} - -.next-progress-line{ - width: 210px !important; - margin-left: 10px; - margin-top: 4px; -} - -.next-progress-line-overlay-normal{ - background-color: #FFA800 !important; -} -.next-rating-base-disabled{ - cursor: default!important; -} -/*#challenge_begin {*/ -/*!*height: 40px !important;*!*/ -/*line-height: 30px;*/ -/*}*/ -.ant-modal-title{ - font-size: 16px; - font-weight: bold !important; - color: #333; -} - -.ml60{ - margin-left:20px; -} - -.marginauto{ - margin:0 auto; -} -.margin152{ - margin-left: 152px; -} - -.margin-tp26{ - margin-top: -26px; -} -.edu-h315{ - height:315px; -} - -.height39 { - height: 39px !important; -} - -#commentsStar{ - margin-top: -7px; - width: 90px; - height: 80px; -} - -.startbtnModal .ant-modal-content{ - background: transparent; - box-shadow: 0 4px 12px transparent; -} - -.startbtnModal .ant-modal-content .ant-modal-body .ant-spin-spinning{ - margin-left: 45%; -} - -.mr51{ - margin-right:51px; -} - -.flexbannerright{ - display: flex; - justify-content: flex-end; -} - -.width360{ - width:360px; -} - -.bannerpd201{ - padding: 20px 20px 10px 20px; -} - -.FF6802{ - color:#FF6802; -} - -.xxtjbtn{ - - width: 103px; - height: 38px; - background: rgba(255,255,255,1); - border-radius: 4px; - border: 1px solid rgba(255,255,255,1); - color: #fff !important; - font-size: 15px !important; - line-height: 36px !important; -} -.kkbths{ - width:103px; - height:38px; - border-radius:4px; - line-height: 36px !important; - border:1px solid rgba(255,255,255,1)!important; - color: #ffffff !important; -} - -.kaike{ - border-radius: 4px; - border: 1px solid #ffffff !important; - padding: 0px 10px; - cursor: pointer; - font-size: 14px; - display: block; - width: 120px; - text-align: center; - height: 40px; - line-height: 40px!important; - border-radius: 4px; - box-sizing: border-box; - color: #ffffff !important; -} -.forkNumst{display: block;float: left;width: 36px;text-align: center;border-left: 1px solid #ffffff !important;color: #ffffff!important; } -.mlbanner36{ - margin-left: 36px; -} - - -.forkfactors{ - text-align: center; - color: #999999; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixuns/shixunCss/ShixunCardList.css b/public/react/src/modules/tpm/shixuns/shixunCss/ShixunCardList.css deleted file mode 100644 index c806434f5..000000000 --- a/public/react/src/modules/tpm/shixuns/shixunCss/ShixunCardList.css +++ /dev/null @@ -1,13 +0,0 @@ -#myshixuns_count{ - text-decoration:none !important; -} -#created_at{ - text-decoration:none !important; -} -.shixun_repertoire{ - cursor: pointer ; -} -.next-btn-medium:hover{ - color: #4CACFF; - border:1px solid #4CACFF; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixuns/shixunCss/ShixunSearchBar.css b/public/react/src/modules/tpm/shixuns/shixunCss/ShixunSearchBar.css deleted file mode 100644 index 9fba271ce..000000000 --- a/public/react/src/modules/tpm/shixuns/shixunCss/ShixunSearchBar.css +++ /dev/null @@ -1,20 +0,0 @@ -.iconfontShixunSearchBar{ - z-index: 1000; - position: absolute; - right: 3px; - top: 0px; -} - -.diffSelect{ - margin-left:20px !important; - } - .ant-input-search-button{ - /*margin-right: 10px;*/ - border: 1px solid transparent; - } -.Mousebox{ - width: 800px !important; -} -.subshaicontent a{ - height:30px; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixuns/shixunCss/shixunCard.css b/public/react/src/modules/tpm/shixuns/shixunCss/shixunCard.css deleted file mode 100644 index 1ec00a26e..000000000 --- a/public/react/src/modules/tpm/shixuns/shixunCss/shixunCard.css +++ /dev/null @@ -1,42 +0,0 @@ -.ml350 { - margin-left: 40%; -} - -.ml32 { - margin-left: 32%; -} - -.square-img{ - min-height: 210px; -} -.task-hide{ - margin-bottom: 0em; -} -.backFAFAFA{ - background:#FAFAFA; -} - -.demo { - width: 500px; - background-color: #0dcecb; - text-align: center; - padding:50px; -} -.next-loading { - margin-bottom: 5px; - width:100%; -} - -.next-rating-overlay .next-icon{ - color: #FFA800!important; -} - -.custom-pagination { - display: inline-block; - margin-left: 10px; -} - -.ml425{ - margin-left:42.5%; - margin-top:20px; -} \ No newline at end of file diff --git a/public/react/src/modules/tpm/shixuns/shixunCss/tag2.png b/public/react/src/modules/tpm/shixuns/shixunCss/tag2.png deleted file mode 100644 index 423d2f7e39a62908f164fd3315dcc03b82007541..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1170 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRo!3HEV4DF?Wlw^r(L`iUdT1k0gQ7VIDN`6wR zf@f}GdTLN=VoGJ<$y6H#24=O)kcg59UmvUF{9L_6kQ%*;+ybC(1_m4Zih{)C?9>v4 zq}24xJX@vryZ0+8WTx0Eg`4^s_!c;)W@LI)6{QAO`Gq7`WhYyvDB0U7*i={n4aiL` zNmQuF&B-gas<2f8n`;GRgM{^!6u?SKvTcwn`Gt*5rG`3JMx70H< zwX`rY(NQomFf`LQu+%p+(KRr%GO)BVFjRm7C7^9ZDQQ+gE^bh}fIM5JjFOT9D}DX) z@^Za$W4-*MbbUihOG|wNBYh(yU7!lx;>x^|#0uTKVr7^KE~&-IMVSR9nfZANAQKal z@=Hr>m4GgVcpfZU!c9<|c-Qt`{ - this.props.modalCancel() - } - - - - - render() { - - return( - -
    - { - this.props.itemtypebool===true? - -

    文件名重复

    - - :"" - } -

    {this.props.tittest}

    - -
    -
    - ) - } -} - -export default Tpmdatasetmodel; diff --git a/public/react/src/modules/tpm/tpmmodel/common.css b/public/react/src/modules/tpm/tpmmodel/common.css deleted file mode 100644 index 66780b2da..000000000 --- a/public/react/src/modules/tpm/tpmmodel/common.css +++ /dev/null @@ -1,318 +0,0 @@ -/*.login_register_content, .login_register_content .ant-tabs-tabpane {*/ -/* !*display: flex;*!*/ -/* justify-content: center;*/ -/*}*/ -.login_register_content .ant-input { - background:rgb(244,244,244); -} -.login_register_content .loginInputzhucheyslass{ - border:1px solid red !important; -} -.login_register_content .loginInputzhucheyslass:hover{ - border:1px solid red !important; -} -.login_register_content { - width: 434px; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - border-radius:6px; - background: #fff; -} - .login_register_content .ant-tabs-ink-bar { - width: 21px !important; - left: 19px; - } - .login_register_content .ant-tabs { - width: 354px; - } - - .login_section { - width: 100%; - display:flex; - justify-content: center; - align-items: center; - flex-direction: column; - } -.login_sectionysl{ - width: 100%; - display:flex; - align-items: center; - flex-direction: column; -} - .loginInput { - width: 100%; - margin-bottom: 16px; - height: 45px; - } - - .educouddiv { - display: flex; - flex-direction: column; - } - - - .left_right { - width: 100%; - display: flex; - justify-content: space-between; - } - .login_btn { - width: 100%; - margin-top: 26px; - margin-bottom: 26px; - } - .dragValidator { - margin-bottom: 16px; - } - .ysldivhome1{ - display: flex; - flex-direction: row; - margin-left: 100px; - margin-right: 129px; - } - .ysldivhome2{ - width: 800px; - display: flex; - flex-flow: row wrap; - align-content:stretch; - } - .ysldivhomediv{ - width: 101px; - } - .ysldivhomediv1{ - width: 17%; - height: 100px; - border-radius:50%; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - background: #fff; - display: flex; - flex-direction:column; - margin-left: 6.5%; - margin-top: 1%; - } -.ysldivhomediv2{ - width: 17%; - height: 100px; - border-radius:50%; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - background: #fff; - display: flex; - flex-direction:column; - margin-left: 6.5%; - margin-top: 3%; -} - .ysldivhomedivtxt{ - width:86%; - height:27px; - margin-bottom: 5px; - font-size: 14px; - text-align: center; - - } - .ysldivhomedivimgsy{ - - } - .ysldivhomedivimg{ - width: 80%; - } - .ysllogin_register_contents{ - display: flex; - justify-content: center; - - } - .ysllogin_section { - display: flex; - align-items: center; - flex-direction: column; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - border-radius:6px; - background: #fff; - } - .yslspans1{ - text-align: center; - font-size: 13px; - color: #111C24; - } - .yslspans2{ - text-align: center; - font-size: 13px; - color: #05101A; - margin-top: 1%; - } - .yslspans3{ - text-align: center; - font-size: 12px; - color: #656565; - } - .yslbutton{ - width:255px; - height: 36px; - margin-top: 20px; - - } - .mt22{ - margin-top: 22px; - } - .gouxuanimg{ - margin-right: 10px; - margin-bottom: 2px; - } - .textall{ - text-align: center; - font-size: 13px; - color: #4B4B4B; - } - .div1img{ - display: flex; - justify-content:center; - width: 42%; - margin-left: 30%; - - } -.yslgouxuanimg{ - width: 20%; - height: 20px; - margin-left: 86%; - float: right; -} -.yslgouxuanimg2{ - height: 20px; -} - -.yslbutondls{ - display: flex; - flex-direction:row; -} -。yslinpulsy input{ - -} -.loginInputzhuche{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - -} -.loginInputzhucheyslass { - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - -} -.loginInputzhucheyslass .ant-input{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - position: relative; - right: 5px; - width: 103%; - border: 1px solid #FF0000!important; - border-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; -} -.loginInputzhucheyslass .ant-input:hover{ - border: 1px solid #FF0000!important; - -} -.loginInputzhuche .ant-input{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - position: relative; - right: 5px; - width: 103%; -} - -.loginInputzhucheysl{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - border-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - -} -.loginInputzhucheysl .ant-input{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - position: relative; - right: 5px; - width: 103%; - border: 1px solid #FF0000!important; - border-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; -} -.loginInputzhucheysl .ant-input:hover{ - border: 1px solid #FF0000!important; -} - -.bth100{ - width: 100px; - margin: 0 auto; -} -.ant-input-affix-wrapper .ant-input-prefix, .ant-input-affix-wrapper .ant-input-suffix { - background: transparent !important; -} - -.startlogin{ - color:#888; -} -.weixinheight390{ - height: 390px; -} -#log_reg_content { - padding: 38px 30px 20px !important; -} -.task-btn-blues{ - background:#5091FF; - color:#fff; - width:100px; - height:32px; - border-radius:4px; -} -a:hover.task-btn-blue-test{ - height:16px; - font-size:14px; - font-family:MicrosoftYaHei; - color:#FFFFff; - line-height:30px; -} -.task-btn-blue-test{ - height:16px; - font-size:14px; - font-family:MicrosoftYaHei; - color:#FFFFff; - line-height:30px; -} -.tabeltext-alignleftysl{ - font-size:14px; - color:#000000; - line-height:19px; - -} -.tabeltext-alignleftysltwo{ - font-size:14px; - color:#848282; - line-height:19px; - -} -/* 中间居中 */ -.intermediatecenter{ - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} diff --git a/public/react/src/modules/tpm/tpmmodel/tpmmodel.css b/public/react/src/modules/tpm/tpmmodel/tpmmodel.css deleted file mode 100644 index ede2bbd72..000000000 --- a/public/react/src/modules/tpm/tpmmodel/tpmmodel.css +++ /dev/null @@ -1,140 +0,0 @@ -.tpmborder{ - border: 1px solid; -} -/* 中间居中 */ -.intermediatecenter{ - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} -/* 简单居中 */ -.intermediatecenterysls{ - display: flex; - align-items: center; -} -.spacearound{ - display: flex; - justify-content: space-around; - -} -.spacebetween{ - display: flex; - justify-content: space-between; -} -/* 头顶部居中 */ -.topcenter{ - display: -webkit-flex; - flex-direction: column; - align-items: center; - -} - - -/* x轴正方向排序 */ -/* 一 二 三 四 五 六 七 八 */ -.sortinxdirection{ - display: flex; - flex-direction:row; -} -/* x轴反方向排序 */ -/* 八 七 六 五 四 三 二 一 */ -.xaxisreverseorder{ - display: flex; - flex-direction:row-reverse; -} -/* 垂直布局 正方向*/ -/* 一 - 二 - 三 - 四 - 五 - 六 - 七 - 八 */ -.verticallayout{ - display: flex; - flex-direction:column; -} -/* 垂直布局 反方向*/ -.reversedirection{ - display: flex; - flex-direction:column-reverse; -} -.deletebutom{ - width:85px; - height:30px; - background:#C4C4C4; - border-radius:3px; - cursor:pointer - -} -.deletebutomtext{ - width:28px; - height:19px; - font-size:14px; - color:#FFFFFF; - line-height:19px; - cursor:pointer -} -.deletebuttom{ - width:85px; - height:30px; - background:#29BD8B !important; - border-radius:3px; - cursor:pointer -} -.deletebuttomtest{ - width:56px; - height:19px; - font-size:14px; - color:#FFFFFF; - line-height:19px; - cursor:pointer - -} -.tpmwidth{ - width: 50%; -} -.mr21{ - margin-right: 21px; -} - -.wenjiantit{ - width: 220px; -} -.zuihoushijian{ - width: 125px; -} -.zuihouxiugairen{ - width: 70px; -} -.wenjiandaxiao{ - width: 56px; -} -.deletebutomtextcode{ - width:85px; - height:30px; - background:#FF5555; - border-radius:3px; - cursor:pointer - -} -.light-row{ - background: #F7F7F8; -} -.dark-row{ - background: #FFFFFF; - -} -.file_path_input{ - position: absolute; - right: -50%; -} - -.questiontype:hover{ - color: #4CACFF !important; -} -.questiontype:active{ - color: #4CACFF !important; -} diff --git a/public/react/src/modules/user/AccountPage.js b/public/react/src/modules/user/AccountPage.js deleted file mode 100644 index 42a323dfd..000000000 --- a/public/react/src/modules/user/AccountPage.js +++ /dev/null @@ -1,152 +0,0 @@ -import React, { Component } from 'react'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; -import {CNotificationHOC} from '../courses/common/CNotificationHOC' -import Loading from '../../Loading'; - -import Loadable from 'react-loadable'; - -import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; - -import { SnackbarHOC, getImageUrl } from 'educoder'; -import AccountNav from './account/AccountNav' -import axios from 'axios' - -const AccountBasic= Loadable({ - loader: () => import('./account/AccountBasic'), - loading: Loading, -}) -const AccountBasicEdit= Loadable({ - loader: () => import('./account/AccountBasicEdit'), - loading: Loading, -}) - -const AccountCertification= Loadable({ - loader: () => import('./account/AccountCertification'), - loading: Loading, -}) - -const AccountSecure= Loadable({ - loader: () => import('./account/AccountSecure'), - loading: Loading, -}) - -const AccountBinding= Loadable({ - loader: () => import('./account/AccountBinding'), - loading: Loading, -}) -class AccountPage extends Component { - constructor (props) { - super(props) - this.state = { - basicInfo: {} - } - } - - componentDidUpdate =(prevState)=>{ - if(this.props.current_user && this.props.current_user != prevState.current_user){ - this.getBasicInfo(this.props.current_user.login); - } - } - - componentDidMount = () =>{ - if(this.props.current_user){ - this.getBasicInfo(this.props.current_user.login); - } - } - - getBasicInfo=(login)=>{ - let url=`/users/accounts/${login || this.props.current_user.login}.json`; - axios.get(url).then((result)=>{ - if(result.data){ - if(result.data && result.data.base_info_completed == false){ - this.props.history.push(`/account/profile/edit`); - } - // "authentication": "uncertified", // "uncertified" | "applying" | "certified" - this.setState({ - basicInfo: Object.assign({}, {...result.data}, { - avatar_url: `${result.data.avatar_url}`, - gender: result.data.gender == null || result.data.gender == undefined ? 0 : result.data.gender - }) - }) - } - }).catch((error)=>{ - console.log(error); - }) - } - render() { - let { basicInfo }=this.state; - const common = { basicInfo, getBasicInfo : this.getBasicInfo } - return ( -
    -
    - - -
    - - () - } - > - - () - } - > - - () - } - > - - () - } - > - - () - } - > - - (this.getBasicInfo()} {...this.props} {...props} {...this.state} {...common} />) - } - > - - - -
    -
    -
    - ); - } -} - -export default CNotificationHOC()(SnackbarHOC() ( TPMIndexHOC ( AccountPage ))); diff --git a/public/react/src/modules/user/AccountPhoneemail.js b/public/react/src/modules/user/AccountPhoneemail.js deleted file mode 100644 index a589d780a..000000000 --- a/public/react/src/modules/user/AccountPhoneemail.js +++ /dev/null @@ -1,79 +0,0 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import {Modal} from 'antd'; -import axios from 'axios'; -class AccountPhoneemail extends Component { - constructor(props) { - super(props); - this.state = { - AccountPhoneemailtype:false - } - } - componentDidMount() { - if(this.props.AccountPhoneemailtype!=undefined){ - this.setState({ - AccountPhoneemailtype:this.props.AccountPhoneemailtype - }) - } - - axios.interceptors.response.use((response) => { - if (response != undefined) - if (response && response.data.status === 402) { - this.setState({ - AccountPhoneemailtype: true - }) - - } - return response; - }, (error) => { - - }); - - } - - gotoback=()=>{ - if(this.props.AccountPhoneemailtype!=undefined){ - this.setState({ - AccountPhoneemailtype:false - }) - this.props.hideAccountProfile() - }else{ - window.location.href="/"; - this.setState({ - AccountPhoneemailtype:false - }) - } - } - - - /** - content: '您需要去完成您的职业认证,才能使用此功能', - okText: '立即完成', - okHref: '/account/certification' - */ - render() { - const { content, okText, okHref } = this.props; - return( - -
    -

    您需要完成手机号码或者邮箱的绑定,才能使用此功能

    - -
    -
    - ) - } -} - -export default AccountPhoneemail; \ No newline at end of file diff --git a/public/react/src/modules/user/AccountProfile.js b/public/react/src/modules/user/AccountProfile.js deleted file mode 100644 index ed8f94fcd..000000000 --- a/public/react/src/modules/user/AccountProfile.js +++ /dev/null @@ -1,85 +0,0 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import {Modal} from 'antd'; -import axios from 'axios'; -class AccountProfile extends Component { - constructor(props) { - super(props); - this.state = { - AccountProfiletype:false - } - } - componentDidMount() { - if(this.props.AccountProfiletype!=undefined){ - this.setState({ - AccountProfiletype:this.props.AccountProfiletype - }) - } - - axios.interceptors.response.use((response) => { - if (response != undefined) - if (response && response.data.status === 402) { - document.title = "提示"; - this.setState({ - AccountProfiletype: true - }) - - } - return response; - }, (error) => { - - }); - - } - - gotoback=(type)=>{ - if(type===true){ - window.location.href="/"; - }else{ - if(this.props.AccountProfiletype!=undefined){ - this.setState({ - AccountProfiletype:false - }) - this.props.hideAccountProfile() - }else{ - window.location.href="/"; - this.setState({ - AccountProfiletype:false - }) - } - } - - } - - -/** -content: '您需要去完成您的职业认证,才能使用此功能', -okText: '立即完成', -okHref: '/account/certification' - */ -render() { - const { content, okText, okHref,cannelText,Accounturltype} = this.props; - return( - -
    -

    {content || '您需要去完善您的个人资料,才能使用此功能'}

    - -
    -
    - ) - } -} - -export default AccountProfile; \ No newline at end of file diff --git a/public/react/src/modules/user/Accountnewprofile.js b/public/react/src/modules/user/Accountnewprofile.js deleted file mode 100644 index ee8039857..000000000 --- a/public/react/src/modules/user/Accountnewprofile.js +++ /dev/null @@ -1,71 +0,0 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import {Modal} from 'antd'; -import axios from 'axios'; -class Accountnewprofile extends Component { - constructor(props) { - super(props); - this.state = { - newAccountProfiletype:false - } - } - componentDidMount() { - - axios.interceptors.response.use((response) => { - if(response!=undefined) - if (response&&response.data.status === 411) { - document.title = "提示"; - this.setState({ - newAccountProfiletype:true, - content:response.data.message, - okText:"立即认证", - cannelText:"稍后认证", - okHref:`/account/certification`, - }) - } - return response; - }, (error) => { - - }); - } - - gotoback=()=>{ - window.location.href="/"; - this.setState({ - newAccountProfiletype:false - }) - } - - - - /** - content: '您需要去完成您的职业认证,才能使用此功能', - okText: '立即完成', - okHref: '/account/certification' - */ - render() { - const { content, okText, okHref,cannelText} = this.state; - return( - - - - ) - } -} - -export default Accountnewprofile; \ No newline at end of file diff --git a/public/react/src/modules/user/CheckInputysl.js b/public/react/src/modules/user/CheckInputysl.js deleted file mode 100644 index a057f12d4..000000000 --- a/public/react/src/modules/user/CheckInputysl.js +++ /dev/null @@ -1,104 +0,0 @@ -import React, { Component } from 'react'; -import "./secureCode.css"; - -/** - * An TextInput with Icon and check - * 带图标检查的输入框 - */ -class CheckInputysl extends Component { - constructor(){ - super(); - this.state = { - isMove:false, - start:0, - moveLength:0, - clear:false, - move:0, - width:0 - }; - this.onMouseUp = this.onMouseUp.bind(this); - this.onMouseDown = this.onMouseDown.bind(this); - this.onMouseMove = this.onMouseMove.bind(this); - } - componentDidMount() { - let dragHandler = document.getElementById("dragHandler"); - dragHandler.addEventListener("mousedown", this.onMouseDown); - } - onMouseDown(e){ - console.log("28"); - document.addEventListener("mousemove", this.onMouseMove); - document.addEventListener("mouseup", this.onMouseUp); - let event=e||window.event; - this.setState({ - isMove:true, - start:event.pageX - }); - } - onMouseUp(e){ - console.log("38"); - let event=e||window.event; - this.setState({ - isMove:false, - }); - let drag = window.getComputedStyle(this.verifyDOM); - let handler = window.getComputedStyle(this.handlerDOM); - let moveLength = event.clientX-this.verifyDOM.offsetLeft - Number.parseInt(handler.width) / 2; - // console.log(drag.width); - let maxWidth = Number.parseInt(drag.width) - Number.parseInt(handler.width); - console.log("moveLength="+moveLength); - console.log("maxWidth="+maxWidth); - if(moveLength <= maxWidth){ //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置 - this.setState({ - move:0, - width:0 - }); - document.removeEventListener("mousemove", this.onMouseMove); - document.removeEventListener("mouseup", this.onMouseUp); - } - if(this.props.onDrag){ - this.props.onDrag(this.state.clear); - } - } - onMouseMove(e){ - console.log("63"); - let event=e||window.event; - let drag = window.getComputedStyle(this.verifyDOM); - let handler = window.getComputedStyle(this.handlerDOM); - let moveLength = event.clientX-this.verifyDOM.offsetLeft - Number.parseInt(handler.width) / 2; - let maxWidth = Number.parseInt(drag.width) - Number.parseInt(handler.width); - if(this.state.isMove){ - if(moveLength<0){ - moveLength=0 - }else if(moveLength >= maxWidth){ - moveLength=maxWidth; - this.removeMouseMove(); - } - this.setState({ - move:moveLength, - width:moveLength - }); - } - } - //清空事件 - removeMouseMove(){ - this.setState({ - clear:true - }); - let dragHandler = document.getElementById("dragHandler"); - dragHandler.removeEventListener("mousedown", this.onMouseDown); - document.removeEventListener("mousemove", this.onMouseMove); - document.removeEventListener("mouseup", this.onMouseUp); - this.props.dragOkCallback(); - } - render(){ - return ( -
    {this.verifyDOM = dom}} style={{"color":this.state.clear ? "#fff" : "#252535"}}> -
    {this.bgDOM = dom}} style={{"width":this.state.width}}>
    -
    {this.state.clear ? "验证通过" : "拖动滑块验证"}
    -
    {this.handlerDOM = dom}}>
    -
    - ); - } -} - -export default ( CheckInputysl ); \ No newline at end of file diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js deleted file mode 100644 index baf099909..000000000 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ /dev/null @@ -1,824 +0,0 @@ -import React, {Component} from 'react'; - -import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; - -import {setmiyah} from 'educoder'; -import CheckInputysl1 from './CheckInputysl'; -import CheckInputysl2 from './CheckInputysl'; -import {Tabs, Input, Checkbox, Button, notification} from 'antd'; - - -import ReadPassword from './ReadPassword'; - -import axios from 'axios'; -import './common.css' -import './commontwo.css' - -const TabPane = Tabs.TabPane -const loginInputsyl = { - "width": " 100%", - "height": "40px", -} - -//父组件 EducoderLogin.js -class LoginRegisterComponent extends Component { - constructor(props) { - super(props) - this.state = { - login: "", - password: "", - passwords: "", - seconds: 60, - codes: "", - getverificationcodes: true, - Phonenumberisnotcobool: true, - Phonenumberisnotco: undefined, - Phonenumberisnotcosytdhk:undefined, - Phonenumberisnotcosmmm: undefined, - Phonenumberisnotcosymmmm:undefined, - Phonenumberisnotcosyzm:undefined, - s: 'text', - classpass: "text", - readonlyInput: true, - dragOk: false, - Whethertoverify:false, - modalsType:false, - pciphone:true, - boolyzm:false, - } - } - - //判断是否是手机端 - IsPC=()=> { - var userAgentInfo = navigator.userAgent; - var Agents = ["Android", "iPhone", - "SymbianOS", "Windows Phone", - "iPad", "iPod"]; - var flag = true;//这个意思是说自己的是pc 端 - for (var v = 0; v < Agents.length; v++) { - if (userAgentInfo.indexOf(Agents[v]) > 0) { - flag = false; - break; - } - } - return flag; - } - componentDidMount = () => { - let pcipns=this.IsPC(); - this.setState({ - pciphone:pcipns, - }) - - } - openNotification = (messge) => { - notification.open({ - message: "提示", - description: - messge, - onClick: () => { - console.log('Notification Clicked!'); - }, - }); - }; - StudyMakeMoney = () => { // 调用父组件方法 - this.props.Setshowbool(1); - - } - - // 点击表单后,改变type - changeType = () => { - this.setState({classpass: 'password'}); - } - changeTypey = () => { - - } - //倒计时 - getverificationcode = () => { - debugger - if(this.state.login === undefined || this.state.login.length===0){ - this.openNotification("请输入手机号或邮箱"); - return; - } - - //这是判断是否手机正确 - if(this.state.Phonenumberisnotcobool === false){ - this.openNotification(this.state.Phonenumberisnotco); - this.setState({ - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return; - } - //拖动滑动验证 - if(this.state.pciphone===true) { - if (this.state.dragOk === false) { - this.openNotification("拖动滑块验证"); - return; - } - } - - if (this.state.getverificationcodes === true) { - this.setState({ - getverificationcodes: undefined, - }) - let timer = setInterval(() => { - this.setState((preState) => ({ - seconds: preState.seconds - 1, - }), () => { - if (this.state.seconds == 0) { - clearInterval(timer); - this.setState({ - getverificationcodes: false, - seconds: 60, - }) - } - }); - }, 1000) - this.SMSverification(); - } else { - this.setState({ - getverificationcodes: undefined, - }) - let timer = setInterval(() => { - this.setState((preState) => ({ - seconds: preState.seconds - 1, - }), () => { - if (this.state.seconds == 0) { - clearInterval(timer); - this.setState({ - getverificationcodes: false, - seconds: 60, - - }) - } - }); - }, 1000) - this.SMSverification(); - } - } - //短信验证 - SMSverification = () => { - let logins=this.state.login; - var url = `/accounts/get_verification_code.json`; - axios.get((url), { - params: { - login: this.state.login, - type: 2, - smscode:setmiyah(logins) - } - }).then((result) => { - //验证有问题{"status":1,"message":"success"} - // this.openNotification("验证码已发送,请注意查收"); - if(result.data.status===1){ - this.openNotification("验证码已发送,请注意查收"); - }else if(result.data.status===-2){ - this.openNotification(result.data.message); - } - }).catch((error) => { - console.log(error); - - }) - } - - cancelReadOnly = () => { - this.setState({ - readonlyInput: false, - }) - } - //找回密码 - Retrievepassword = () => { - if (this.state.Phonenumberisnotcobool === false&&this.state.Phonenumberisnotco!==undefined) { - this.openNotification(this.state.Phonenumberisnotco); - this.setState({ - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return; - } - if (this.state.login === undefined|| this.state.login.length ===0 || this.state.login === "") { - this.setState({ - Phonenumberisnotco:"账号不能为空", - Phonenumberisnotcobool: false, - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, - }) - return - } - if(this.state.pciphone===true){ - if (this.state.dragOk === false) { - // this.openNotification(`请拖动滑块完成验证`,2); - this.setState({ - Phonenumberisnotcosytdhk:"请拖动滑块完成验证", - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, - }) - return - } - } - - if (this.state.password === undefined || this.state.password.length ===0 || this.state.password === "") { - this.setState({ - Phonenumberisnotcosmmm:"密码不能为空", - }) - return - } - if (this.state.passwords === undefined || this.state.passwords.length ===0 || this.state.passwords === "") { - this.setState({ - Phonenumberisnotcosymmmm:"二次密码不能为空" - }) - return - } - if (this.state.password !== this.state.passwords==="") { - this.openNotification(`两次输入的密码不一致`); - return - } - else if (this.state.password !==undefined&&this.state.password.length>0&&this.state.password.length<8){ - this.setState({ - Phonenumberisnotcosmmm:"密码不能少于8位", - }) - return - } else if (this.state.password !==undefined&&this.state.password.length>0&&this.state.password.length>16){ - this.setState({ - Phonenumberisnotcosmmm:"密码不能超过16位", - }) - return - } - else if (this.state.passwords !==undefined&&this.state.passwords.length>0&&this.state.passwords.length<8){ - this.setState({ - Phonenumberisnotcosymmmm:"二次密码不能少于8位", - }) - return - } else if (this.state.passwords !==undefined&&this.state.passwords.length>0&&this.state.passwords.length>16){ - this.setState({ - Phonenumberisnotcosymmmm:"二次密码不能超过16位", - }) - return - } - if (this.state.codes === undefined|| this.state.codes.length ===0 || this.state.codes === "") { - this.setState({ - Phonenumberisnotcosyzm:"验证码不能为空" - }) - return - } - var url = "/accounts/reset_password.json"; - axios.post(url, { - login: this.state.login, - code: this.state.codes, - new_password: this.state.password, - new_password_confirmation: this.state.passwords, - }).then((result) => { - // console.log(result); - //登录成功,会生成session - if(result){ - if(result.data.status===-2){ - if(result.data.message==="验证码不正确"){ - this.setState({ - Phonenumberisnotcosyzm:"验证码不正确", - }) - - return; - }else if(result.data.message==="验证码已失效"){ - this.setState({ - Phonenumberisnotcosyzm:"验证码不正确", - }) - - return; - }else if(result.data.message==="1小时内同一手机号发送次数超过限制"){ - this.setState({ - boolyzm:true, - }) - this.openNotification(result.data.message); - return; - }else { - this.openNotification(result.data.message); - return; - } - }else { - this.setState({ - modalsType:true - }) - } - } - }).catch((error) => { - - }) - - - } - openNotification = (messge) => { - notification.open({ - message: "提示", - description: - messge, - onClick: () => { - console.log('Notification Clicked!'); - }, - }); - }; - loginInputonChange = (e) => { - // console.log(e.target.value); - var stirngt; - if(e.target.value.length>0){ - var str= e.target.value.replace(/\s*/g,"") - stirngt=str; - }else{ - stirngt= e.target.value; - } - this.setState({ - login: stirngt, - Phonenumberisnotco:undefined, - dragOk:false, - boolyzm:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - } - loginInputonChanges = (e) => { - // console.log(e.target.value); - var stirngt; - if(e.target.value.length>0){ - var str= e.target.value.replace(/\s*/g,"") - stirngt=str; - }else{ - stirngt= e.target.value; - } - this.setState({ - password: stirngt, - Phonenumberisnotcosmmm:undefined, - }) - - } - loginInputonChangess = (e) => { - // console.log(e.target.value); - var stirngt; - if(e.target.value.length>0){ - var str= e.target.value.replace(/\s*/g,"") - stirngt=str; - }else{ - stirngt= e.target.value; - } - this.setState({ - passwords: stirngt, - Phonenumberisnotcosymmmm:undefined, - }) - - } - //获取code - codesonChange = (e) => { - this.setState({ - codes: e.target.value, - Phonenumberisnotcosyzm:undefined, - }) - } - inputOnBlur = (e) => { - this.isCorrectname(e.target.value); - // this.Emailphonenumberverification(e.target.value, id); - } - isCorrectname = (value) => { - console.log(value.length); - if (value.length === 0) { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: true, - }) - return; - } - // var telephone = $("#telephoneAdd.tianjia_phone").val(); - var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; - // var email = $("#add_email.tianjia_email").val(); - var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; - - // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 - var stringdata = undefined; - if (!regph.test(value)) { - stringdata = "手机号格式不正确"; - this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: false, - }) - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: true, - }) - return - } - - if (!regemail.test(value)) { - if ((value.indexOf("@") != -1) === true) { - stringdata = "邮箱格式不正确"; - } else { - stringdata = "手机号格式不正确"; - - } - this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: false, - }) - - this.Emailphonenumberverification(value) - return - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: true, - }) - return - } - } - - inputOnBlurzhuche = (e)=>{ - if(this.state.pciphone===false) { - if(this.state.login===""||this.state.login.length===0){ - this.setState({ - Phonenumberisnotco: "账号不能为空", - Phonenumberisnotcobool: false, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return - } - // console.log(e.target.value.length); - // if (e.target.value.length === 0) { - // this.setState({ - // Phonenumberisnotco: undefined, - // Phonenumberisnotcobool: false, - // }) - // return; - // } - // var telephone = $("#telephoneAdd.tianjia_phone").val(); - var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; - // var email = $("#add_email.tianjia_email").val(); - var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; - - // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 - var stringdata = undefined; - if (!regph.test(e.target.value)) { - stringdata = "手机号格式不正确"; - this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: false, - }) - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: true, - }) - return - } - - if (!regemail.test(e.target.value)) { - if ((e.target.value.indexOf("@") != -1) === true) { - stringdata = "邮箱格式不正确"; - } else { - stringdata = "手机号格式不正确"; - - } - this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: false, - }) - return - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: true, - }) - this.Emailphonenumberverification(e.target.value) - return - } - this.Emailphonenumberverification(e.target.value) - } - - } - //是否验证通过 - dragOkCallback = () => { - console.log(this.state.login); - this.setState({ - Phonenumberisnotcosytdhk:undefined, - }) - - if (this.state.login === "" || this.state.login.length === 0) { - this.setState({ - Phonenumberisnotco: "账号不能为空", - Phonenumberisnotcobool: false, - Phonenumberisnotcosytdhk:undefined, - dragOk: false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, - }) - return - } - // var telephone = $("#telephoneAdd.tianjia_phone").val(); - var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; - // var email = $("#add_email.tianjia_email").val(); - var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; - - // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 - var stringdata = undefined; - if (!regph.test(this.state.login)) { - stringdata = "手机号格式不正确"; - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: true, - Phonenumberisnotcosytdhk:undefined, - dragOk: true, - }) - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: true, - Phonenumberisnotcosytdhk:undefined, - dragOk: true, - - }); - this.Emailphonenumberverification(this.state.login) - - return - } - - if (!regemail.test(this.state.login)) { - if ((this.state.login.indexOf("@") != -1) === true) { - stringdata = "邮箱格式不正确"; - } else { - stringdata = "手机号格式不正确"; - - } - this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: false, - dragOk:false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, - }) - return - } else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: true, - dragOk: true, - }) - this.Emailphonenumberverification(this.state.login) - return - } - - this.setState({ - Phonenumberisnotcosytdhk: undefined, - }) - this.Emailphonenumberverification(this.state.login) - - - } - //邮箱手机号验证 - Emailphonenumberverification = (value) => { - var url = `/accounts/valid_email_and_phone.json`; - axios.get((url), { - params: { - login: value, - type: 2, - } - }).then((result) => { - // console.log(result); - if(result){ - if(result.data.status===-2){ - console.log(value.length); - this.setState({ - Phonenumberisnotco: result.data.message, - Phonenumberisnotcobool: false, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return; - }else { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: true, - dragOk:true, - }) - return; - } - } - - - }).catch((error) => { - console.log(error); - - }) - } - gobackshowbool=()=>{ - this.props.history.push("/login"); - this.props.Setshowbool(1) - } - render() { - const { - // 登录 - autoLogin, - // 注册 - readAgreement, dragOk, - login, - password, - passwords, - classpass, - seconds, - getverificationcodes, - Phonenumberisnotco, - Phonenumberisnotcosytdhk, - Phonenumberisnotcosmmm, - Phonenumberisnotcosymmmm, - Phonenumberisnotcosyzm, - readonlyInput, - codes, - Whethertoverify, - pciphone, - boolyzm, - } = this.state - // height: 346px; - return ( - -
    - this.StudyMakeMoney()} - /> - - - - - - -
    -
    - 找回密码 -
    -
    - - {/*onBlur={(e) => this.inputOnBlur(e)}*/} - this.inputOnBlurzhuche(e)} - onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}> - { - Phonenumberisnotco && Phonenumberisnotco !== "" ? -

    - {Phonenumberisnotco} -

    - :
    - } - - { - Whethertoverify===false&&pciphone===true? - - - : - "" - - } - { - Whethertoverify===true&&pciphone===true? - - - : - "" - } -
    - {pciphone===true? - ( - Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !=="" ? -

    - {Phonenumberisnotcosytdhk} -

    - :
    - ) - :""} -
    - - { - Phonenumberisnotcosmmm && Phonenumberisnotcosmmm !== "" ? -

    - {Phonenumberisnotcosmmm} -

    - :
    - } - - - { - Phonenumberisnotcosymmmm && Phonenumberisnotcosymmmm !== "" ? -

    - {Phonenumberisnotcosymmmm} -

    - :
    - } -
    - - - - { - getverificationcodes === undefined ? - - : getverificationcodes === true ? - - : - - } - - -
    - - { - Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ? -

    - {Phonenumberisnotcosyzm} -

    - :
    - } - - -

    - this.gobackshowbool()}>返回登录注册 -

    -
    -
    - -
    - ); - } -} - -export default (LoginRegisterComponent); diff --git a/public/react/src/modules/user/Interestpage.js b/public/react/src/modules/user/Interestpage.js deleted file mode 100644 index 1054d620e..000000000 --- a/public/react/src/modules/user/Interestpage.js +++ /dev/null @@ -1,313 +0,0 @@ -import React, {Component} from 'react'; -import {Button,notification} from 'antd'; -import {broadcastChannelPostMessage} from 'educoder'; -import MyEduCoderModal from './MyEduCoderModal'; -import axios from 'axios'; -import './common.css'; -import './MyeducoderI.css' -import mytc from './img/mytc.png'; -import skzbdx from './img/skzbdx.png'; -import zyrs1 from './img/zyrs1.png'; -import gouxuan from './img/gouxuan.png'; -import meigouxuan from './img/meigouxuan.png'; -import qdkf from './img/qdkf.png'; -import hdkf from './img/hdkf.png'; -import ydkf from './img/ydkf.png'; -import sjk from './img/sjk.png'; -import ysj from './img/ysj.png'; -import yunwei from './img/yunwei.png'; -import rgzn from './img/rgzn.png'; -import qita from './img/qita.png'; - -//父组件 EducoderLogin.js -class InterestpageComponent extends Component { - constructor(props) { - super(props) - this.state = { - gouxuans: "", - gouxuans2:0, - gouxuans4:[], - namezh:this.props.namezh, - passmm:this.props.passmm, - homedatalist:undefined, - hometypepvisible: undefined, - MyEduCoderModals:false, - } - } - openNotification = (messge) => { - // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 - notification.open({ - message: "提示", - description: messge, - onClick: () => { - console.log('Notification Clicked!'); - }, - }); - } - componentDidMount(){ - console.log("min"); - let{gouxuans4} =this.state; - let url=`/repertoires.json`; - axios.get(url).then((response)=> { - if(response){ - // console.log("53"); - // console.log(response.data); - for(var i=0;i{ - console.log(error) - }); - } - componentWillReceiveProps(nextProps) { - // console.log("46"); - // console.log(nextProps); - // console.log(this.props); - if (nextProps.namezh != this.props.namezh) { - // console.log("50"); - // console.log(nextProps.user); - if (nextProps.namezh !== undefined) { - // console.log("53"); - // console.log(nextProps.user); - this.setState({ - namezh: nextProps.namezh, - }) - } - - - } - if (nextProps.passmm != this.props.passmm) { - // console.log("50"); - // console.log(nextProps.user); - if (nextProps.passmm !== undefined) { - // console.log("53"); - // console.log(nextProps.user); - this.setState({ - passmm: nextProps.passmm, - }) - } - - - } - - - } - - - Clickteacher=(e)=>{ - // console.log(e); - if(e === "teacher"){ - this.setState({ - gouxuans:"teacher", - }) - }else if(e ==="student"){ - this.setState({ - gouxuans:"student", - }) - }else if(e === "professional"){ - this.setState({ - gouxuans:"professional", - }) - } - } - Clickteacher2=(e)=>{ - // console.log(e); - let {gouxuans4} =this.state; - for (var i=0;i{ - this.setState({ - MyEduCoderModals:true - }) - } - - //兴趣页面点击 - Interestcompletionpage(){ - if(this.state.gouxuans.length === 0){ - this.openNotification("请选择职业"); - return - } - - var ints=[]; - for (var i =0;i { - if (response !== undefined) { - // this.Jumptotheinterestpage(); - // window.location.href = "/" - if(response.data.status===0){ - - this.setMyEduCoderModals() - } - - } - - - }).catch((error) => { - console.log(error); - - }) - } - - // //跳转然后登入 - // Jumptotheinterestpage=()=>{ - // console.log(this.state.login); - // console.log(this.state.password); - // var url = "/accounts/login.json"; - // axios.post(url, { - // login: this.props.login, - // password: this.props.password, - // }).then((response) => { - // if (response === undefined) { - // return - // } - // if (response.status === 200) { - // // if (response.data.status === 402) { - // // window.location.href = response.data.url; - // // } else { - // // broadcastChannelPostMessage('refreshPage') - // // this.setState({ - // // isRender: false - // // }) - // window.location.href = "/" - // // } - // } - // - // - // }).catch((error) => { - // console.log(error); - // }) - // } - setNotcompleteds=()=>{ - this.setState({ - Notcompleteds:true, - MyEduCoderModals:false - }) - } - - render() { - const { - gouxuans, - gouxuans4, - } = this.state - console.log(window.screen.width); - return ( - -
    - - {this.setNotcompleteds()}} - /> - -
    -
    请选择你的职业
    -
    -
    -
    this.Clickteacher("teacher")}>{gouxuans ==="teacher"? :}老师
    -
    this.Clickteacher("teacher")} src={skzbdx} className="ysldivhomedivimg"/>
    -
    -
    -
    this.Clickteacher("student")}>{gouxuans==="student"? :}学生
    -
    this.Clickteacher("student")} src={mytc} className="ysldivhomedivimg"/>
    -
    -
    -
    this.Clickteacher("professional")}>{gouxuans==="professional"?:}专业人士
    -
    this.Clickteacher("professional")} src={zyrs1} className="ysldivhomedivimg"/>
    -
    -
    -

    选择你可能感兴趣的内容

    -

    基于你关注的内容推荐

    -
    - - {gouxuans4&&gouxuans4.map((item,key)=>{ - return( -
    this.Clickteacher2(item.id)}> - {item.bool===true?:
    } - -

    {item.name}

    -
    - - ) - })} -
    - -
    - -
    - ); - } -} - -export default (InterestpageComponent); diff --git a/public/react/src/modules/user/InterestpageMax.js b/public/react/src/modules/user/InterestpageMax.js deleted file mode 100644 index 6dc182154..000000000 --- a/public/react/src/modules/user/InterestpageMax.js +++ /dev/null @@ -1,311 +0,0 @@ -import React, {Component} from 'react'; -import {Button,notification} from 'antd'; -import {broadcastChannelPostMessage} from 'educoder'; -import MyEduCoderModal from './MyEduCoderModal'; -// import Notcompleted from '../../common/Notcompleted'; -import axios from 'axios'; -import './commontwo.css'; -import mytc from './img/mytc.png'; -import skzbdx from './img/skzbdx.png'; -import zyrs1 from './img/zyrs1.png'; -import gouxuan from './img/gouxuan.png'; -import meigouxuan from './img/meigouxuan.png'; -import qdkf from './img/qdkf.png'; -import hdkf from './img/hdkf.png'; -import ydkf from './img/ydkf.png'; -import sjk from './img/sjk.png'; -import ysj from './img/ysj.png'; -import yunwei from './img/yunwei.png'; -import rgzn from './img/rgzn.png'; -import qita from './img/qita.png'; - -//父组件 EducoderLogin.js -class InterestpageMax extends Component { - constructor(props) { - super(props) - this.state = { - gouxuans: "", - gouxuans2:0, - gouxuans4:[], - namezh:this.props.namezh, - passmm:this.props.passmm, - homedatalist:undefined, - hometypepvisible: undefined, - MyEduCoderModals:false - } - } - openNotification = (messge) => { - // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 - notification.open({ - message: "提示", - description: messge, - onClick: () => { - console.log('Notification Clicked!'); - }, - }); - } - componentDidMount(){ - console.log("max"); - let{gouxuans4} =this.state; - let url=`/repertoires.json`; - axios.get(url).then((response)=> { - if(response){ - console.log("53"); - console.log(response.data); - for(var i=0;i{ - console.log(error) - }); - - } - componentWillReceiveProps(nextProps) { - // console.log("46"); - // console.log(nextProps); - // console.log(this.props); - if (nextProps.namezh != this.props.namezh) { - // console.log("50"); - // console.log(nextProps.user); - if (nextProps.namezh !== undefined) { - // console.log("53"); - // console.log(nextProps.user); - this.setState({ - namezh: nextProps.namezh, - }) - } - - - } - if (nextProps.passmm != this.props.passmm) { - // console.log("50"); - // console.log(nextProps.user); - if (nextProps.passmm !== undefined) { - // console.log("53"); - // console.log(nextProps.user); - this.setState({ - passmm: nextProps.passmm, - }) - } - - - } - - - } - - - Clickteacher=(e)=>{ - console.log(e); - if(e === "teacher"){ - this.setState({ - gouxuans:"teacher", - }) - }else if(e ==="student"){ - this.setState({ - gouxuans:"student", - }) - }else if(e === "professional"){ - this.setState({ - gouxuans:"professional", - }) - } - } - Clickteacher2=(e)=>{ - console.log(e); - let {gouxuans4} =this.state; - for (var i=0;i{ - this.setState({ - MyEduCoderModals:true - }) - } - - //兴趣页面点击 - Interestcompletionpage(){ - if(this.state.gouxuans.length === 0){ - this.openNotification("请选择职业"); - return - } - - var ints=[]; - for (var i =0;i { - if (response !== undefined) { - // this.Jumptotheinterestpage(); - // window.location.href = "/" - if(response.data.status===0){ - this.setMyEduCoderModals() - } - } - - - }).catch((error) => { - console.log(error); - - }) - } - - // //跳转然后登入 - // Jumptotheinterestpage=()=>{ - // console.log(this.state.login); - // console.log(this.state.password); - // var url = "/accounts/login.json"; - // axios.post(url, { - // login: this.props.login, - // password: this.props.password, - // }).then((response) => { - // if (response === undefined) { - // return - // } - // if (response.status === 200) { - // // if (response.data.status === 402) { - // // window.location.href = response.data.url; - // // } else { - // // broadcastChannelPostMessage('refreshPage') - // // this.setState({ - // // isRender: false - // // }) - // window.location.href = "/" - // // } - // } - // - // - // }).catch((error) => { - // console.log(error); - // }) - // } - setNotcompleteds=()=>{ - this.setState({ - Notcompleteds:true, - MyEduCoderModals:false - }) - } - - render() { - const { - gouxuans, - gouxuans4, - } = this.state - // height: 346px; - return ( - -
    - - {this.setNotcompleteds()}} - /> - -
    -
    请选择你的职业
    -
    -
    -
    this.Clickteacher("teacher")}>{gouxuans ==="teacher"? :}老师
    -
    this.Clickteacher("teacher")} src={skzbdx} className="ysldivhomedivimg2"/>
    -
    -
    -
    this.Clickteacher("student")}>{gouxuans==="student"? :}学生
    -
    this.Clickteacher("student")} src={mytc} className="ysldivhomedivimg2"/>
    -
    -
    -
    this.Clickteacher("professional")}>{gouxuans==="professional"?:}专业人士
    -
    this.Clickteacher("professional")} src={zyrs1} className="ysldivhomedivimg2"/>
    -
    -
    -
    选择你可能感兴趣的内容
    -
    基于你关注的内容推荐
    -
    - - {gouxuans4&&gouxuans4.map((item,key)=>{ - return( -
    this.Clickteacher2(item.id)}> - {item.bool===true?:
    } - - {item.name} -
    - ) - })} -
    - -
    - -
    - ); - } -} - -export default (InterestpageMax); diff --git a/public/react/src/modules/user/LCCountDownButton.js b/public/react/src/modules/user/LCCountDownButton.js deleted file mode 100644 index da379471a..000000000 --- a/public/react/src/modules/user/LCCountDownButton.js +++ /dev/null @@ -1,205 +0,0 @@ -/** - * Created by lichengke on 2017/6/12. - */ - - -import React, { Component , PropTypes} from 'react'; -import { - AppRegistry, - StyleSheet, - Text, - View, - TextInput, - TouchableOpacity -} from 'react-native'; - -const LCCountDownButtonState = { - LCCountDownButtonActive : 0, - LCCountDownButtonDisable : 1, -} - -// {id , startTime, deathCount} -var timeRecodes = []; //根据id来记录LCCountDownButton的信息 - -export default class LCCountDownButton extends Component { - - // 构造 - constructor(props) { - super(props); - // 初始状态 - this.state={ - btnTitle:'默认' - } - } - - static defaultProps = { - id : "id", //按钮的身份标识,同一个页面的按钮是同一个id - beginText : "beginText", //初始状态按钮title - endText : "endText", //读秒结束后按钮的title - count : 10, //总的计时数 单位是秒s - pressAction : ()=>{}, //按下按钮的事件,但是触发倒数(startCountDown)需要你自己来调用 - changeWithCount : ()=>{}, //读秒变化的函数,该函数带有一个参数count,表示当前的剩余事件 - end : ()=>{}, //读秒完毕后的回调,读秒结束触发 - frameStyle : {}, //初始化的位置大小 - disableStyle : {}, //按钮禁用的时候样式 (有默认,见底部styles) - activeStyle : {}, //active情况下按钮样式 (有默认,见底部styles) - disableTextStyle : {}, //按钮禁用的时候里面文字的样式 (有默认,见底部styles) - activeTextStyle : {}, //active情况下按钮里面文字的样式 (有默认,见底部styles) - } - - buttonState = LCCountDownButtonState.LCCountDownButtonActive; - - componentWillMount() { - this.shouldSetState = true; - this.state = { - btnTitle:this.props.beginText, - } - } - - componentDidMount() { - const {id,changeWithCount} = this.props; - for(var i = 0 ; i{ - let detalTime = Math.round((Date.now() - this.startTime)/1000); - let content = changeWithCount(count - detalTime); - if (detalTime >= count){ - content = endText; - this.clearTime(); - end && end(); - this.buttonState = LCCountDownButtonState.LCCountDownButtonActive; - } - if(this.shouldSetState){ - this.setState({ - btnTitle:content - }) - } - },1000) - } - - recordButtonInfo(){ - const {id , count} = this.props; - var hasRecord = false; - for (var i = 0 ; i < timeRecodes.length ; i ++){ - let obj = timeRecodes[i]; - if(obj.id == id){ - obj.startTime = Date.now(); - hasRecord = true; - break; - } - } - if (!hasRecord){ - let buttonInfo = { - id:id, - deathCount:count, - startTime:Date.now() - } - timeRecodes.push(buttonInfo) - } - } - - //外界调用 - startCountDown(){ - this.startCountDownWithCount(Date.now()); - this.recordButtonInfo(); - } - - buttonPressed=()=>{ - const {pressAction} = this.props; - pressAction(); - } - - render(){ - let isDisable = this.buttonState == LCCountDownButtonState.LCCountDownButtonDisable; - const {frameStyle,disableStyle,activeStyle,disableTextStyle,activeTextStyle} - = this.props; - return ( - - - {this.state.btnTitle} - - - ); - } - - -} - -const styles = StyleSheet.create({ - - buttonCommonStyle:{ - borderRadius:3, - borderWidth:1, - borderColor:'gray', - paddingRight:8, - paddingLeft:8, - paddingTop:8, - paddingBottom:8, - justifyContent:'center', - alignItems:'center' - }, - //禁用时候的TouchableOpacity样式 - disableButtonStyle:{ - backgroundColor:'red', - }, - //可以点击时候的TouchableOpacity样式 - activeButtonStyle:{ - backgroundColor:'green', - }, - - txtCommonStyle:{ - fontSize:14, - }, - //禁用时候的Text样式 - disableTxtStyle:{ - color:'gray', - }, - //可以点击时候的Text样式 - activeTxtStyle:{ - color:'black', - } -}); \ No newline at end of file diff --git a/public/react/src/modules/user/LoginRegisterComponent.css b/public/react/src/modules/user/LoginRegisterComponent.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js deleted file mode 100644 index c42ceed88..000000000 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ /dev/null @@ -1,1308 +0,0 @@ -import React, {Component} from 'react'; -import {setmiyah,broadcastChannelPostMessage} from 'educoder'; -import {Tabs, Input, Checkbox, Button, notification,Menu} from 'antd'; -import passopen from '../../../src/images/login/passopen.png'; -import passoff from '../../../src/images/login/passoff.png'; -import axios from 'axios'; -import CheckInputysl1 from './CheckInputysl'; -import CheckInputysl2 from './CheckInputysl'; -import Notcompletedysl from './Notcompletedysl'; -import './common.css' -import './commontwo.css' -const { TabPane } = Tabs; -const loginInputsyl = { - "width":"434px", - "height": "462px", - "-webkit-box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)", - "box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)", - "border-radius": "6px", - "background": "#fff" -} - -//父组件EducoderLogin.js -class LoginRegisterComponent extends Component { - constructor(props) { - super(props) - - - // - // console.log("LoginRegisterComponent"); - // console.log("29"); - // console.log(props.loginstatus); - if(props.loginstatus === true){ - // console.log(props.loginstatus); - this.state = { - tab:["0"], - classpass: "text", - // 登录 - passopens: passoff, - seconds: 60, - discodeBtn: false, - clearInterval: false, - autoLogin: true, - classpassbool: false, - // 注册 - readAgreement: false, - getverificationcodes: true, - dragOk: false, - Agreetotheterms: true, - login: "", - password: "", - logins: "", - passwords: "", - codes: "", - Phonenumberisnotco: undefined, - Phonenumberisnotcos: undefined, - Phonenumberisnotcosyzm:undefined, - Phonenumberisnotcosymmm:undefined, - Phonenumberisnotcosytdhk:undefined, - Phonenumberisnotcosyfwtk:undefined, - Phonenumberisnotcodmm:undefined, - Phonenumberisnotcobool: false, - Whethertoverify:false, - pciphone:true, - MyEduCoderModals:false, - registered:undefined, - Phonenumberisnotcodmms:undefined, - weixinlogin:false, - qqlogin:false - } - } - if(props.loginstatus === false){ - // console.log(props.loginstatus); - this.state = { - tab:["1"], - classpass: "text", - // 登录 - passopens: passoff, - seconds: 60, - discodeBtn: false, - clearInterval: false, - autoLogin: true, - classpassbool: false, - // 注册 - readAgreement: false, - getverificationcodes: true, - dragOk: false, - Agreetotheterms: true, - login: "", - password: "", - logins: "", - passwords: "", - codes: "", - Phonenumberisnotco: undefined, - Phonenumberisnotcos: undefined, - Phonenumberisnotcosyzm:undefined, - Phonenumberisnotcosymmm:undefined, - Phonenumberisnotcosytdhk:undefined, - Phonenumberisnotcosyfwtk:undefined, - Phonenumberisnotcobool: false, - Phonenumberisnotcodmm:undefined, - Whethertoverify:false, - pciphone:true, - MyEduCoderModals:false, - registered:undefined, - Phonenumberisnotcodmms:undefined, - weixinlogin:false, - qqlogin:false - } - } - } - - //判断是否是手机端 - IsPC=()=> { - var userAgentInfo = navigator.userAgent; - var Agents = ["Android", "iPhone", - "SymbianOS", "Windows Phone", - "iPad", "iPod"]; - var flag = true;//这个意思是说自己的是pc 端 - for (var v = 0; v < Agents.length; v++) { - if (userAgentInfo.indexOf(Agents[v]) > 0) { - flag = false; - break; - } - } - return flag; - } -// 点击表单后,改变type - changeType = () => { - this.setState({classpass: 'password'}); - } - IsPC=()=>{ - var userAgentInfo = navigator.userAgent; - var Agents = ["Android", "iPhone", - "SymbianOS", "Windows Phone", - "iPad", "iPod"]; - var flag = true; - for (var v = 0; v < Agents.length; v++) { - if (userAgentInfo.indexOf(Agents[v]) > 0) { - flag = false; - break; - } - } - return flag; - } - componentDidMount = () => { - let flag = this.IsPC(); //true为PC端,false为手机端 - this.setState({ - isphone:flag - }) - // console.log("componentDidUpdate"); - // console.log(this.props); - let pcipns=this.IsPC(); - if (this.props.match.url === "/login") { - - // this.state = { - // tab:["0"], - // - // } - this.setState({ - tab:["0"] - }) - } else if (this.props.match.url === "/register") { - - // this.state = { - // tab:["1"], - // - // } - this.setState({ - tab:["1"] - }) - } - this.setState({ - pciphone:pcipns, - }) - - - } - openNotification = (messge,type) => { - // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 - notification.open({ - message: "提示", - description: messge, - onClick: () => { - - }, - }); - } - openNotifications = (btn) => { - // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 - notification.open({ - message: "提示", - description: btn, - onClick: () => { - - }, - }); - } - - - StudyMakeMoney = () => { // 调用父组件方法 - - // this.props.Setlogins(3); - this.setState({ - login: "", - password: "", - logins: "", - passwords: "", - codes: "", - }); - try { - this.props.Setshowbool(3); - }catch (e) { - - } - } - onTabChange = (activeKey) => { - - } - // -------------------- LOGIN START - //下次自动登入 - onAutoLoginChange = (e) => { - this.setState({autoLogin: e.target.checked}) - } - - // -------------------- LOGIN END - - isCorrectname = (value, id) => { - if (id === 1) { - - if (value.length === 0) { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - }) - return; - } - } else if (id === 2) { - if (value.length === 0) { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - }) - return; - } - } - this.Emailphonenumberverification(value, id) - - } - // -------------------- REGISTER START - onReadAgreementChange = (e) => { - this.setState({readAgreement: e.target.checked}) - } - //是否验证通过 - dragOkCallback = () => { - this.setState({ - Phonenumberisnotcosytdhk:undefined, - }) - if (this.state.logins.length === 0) { - this.setState({ - Phonenumberisnotcos:"账号不能为空", - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - - - return; - } - // var telephone = $("#telephoneAdd.tianjia_phone").val(); - var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; - // var email = $("#add_email.tianjia_email").val(); - var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; - - // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 - var stringdata = undefined; - if (!regph.test(this.state.logins)) { - stringdata = "手机号格式不正确"; - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - dragOk:true, - }) - - } else { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - dragOk:true, - }); - this.Emailphonenumberverification(this.state.logins, 2); - return - } - - if (!regemail.test(this.state.logins)) { - if ((this.state.logins.indexOf("@") != -1) === true) { - stringdata = "邮箱格式不正确"; - } else { - stringdata = "手机号格式不正确"; - - } - this.setState({ - Phonenumberisnotcos: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }); - - - return - } else { - - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - dragOk:true, - }) - this.Emailphonenumberverification(this.state.logins, 2); - return - } - - this.setState({ - Phonenumberisnotcosytdhk:undefined, - }) - this.Emailphonenumberverification(this.state.logins, 2) - - } - // -------------------- REGISTER END - - //是否同意 - onChange = (e) => { - this.setState({ - Agreetotheterms: e.target.checked, - }) - } - - //登入接口 - postLogin = () => { - - if (this.state.login === undefined || this.state.login == "") { - this.setState({ - Phonenumberisnotco:"账号不能为空", - }) - return - } else if (this.state.password === undefined || this.state.password == "") { - this.setState({ - Phonenumberisnotcodmm:"密码不能为空", - }) - return - } - var url = "/accounts/login.json"; - axios.post(url, { - login: this.state.login, - password: this.state.password, - }).then((response) => { - debugger - if (response === undefined) { - return - } - - if(response.data.status === -2){ - if(response.data.message==="该手机号尚未注册" || response.data.message==="该邮箱尚未注册"){ - this.setState({ - Phonenumberisnotco:response.data.message, - }) - return; - } - else if(response.data.message==="错误的账号或密码"){ - this.setState({ - Phonenumberisnotcodmms:response.data.message, - }) - return; - } - else if(response.data.message==="违反平台使用规范,账号已被锁定"){ - this.setState({ - Phonenumberisnotco:response.data.message, - }) - - return; - } else if (response.data.message === "登录密码出错已达上限,账号已被锁定, 请10分钟后重新登录或找回密码") { - const messge = ( -
    -

    - 登录密码出错已达上限,账号已被锁定; -

    -

    - 请10分钟后重新登录或找回密码 -

    -
    - ) - this.openNotifications(messge); - return; - } else { - this.openNotification(response.data.message); - return; - } - - - } - - // if(response.data.profile_completed !== null || response.data.profile_completed === false){ - // this.setMyEduCoderModals(); - // return; - // } - - if (response.status === 200) { - if (response.data.status === 402) { - window.location.href = response.data.url; - } else { - broadcastChannelPostMessage('refreshPage') - this.setState({ - isRender: false - }) - var weekArray = JSON.parse(window.sessionStorage.getItem('yslgeturls')); - if(weekArray===undefined){ - weekArray="/"; - } - if(weekArray===null){ - weekArray="/"; - } - if(weekArray==="null"){ - weekArray="/"; - } - window.location.href = weekArray; - } - } - - - }).catch((error) => { - - }) - - } - //注册接口 - postregistered = () => { - // if (this.state.logins === undefined || this.state.logins === "") { - // this.openNotification(`请输入登录手机号码或邮箱`,2); - // - // return - // } else if (this.state.dragOk === false) { - // this.openNotification(`请拖动滑块验证`,2); - // return - // } else if (this.state.codes === undefined || this.state.codes == "") { - // this.openNotification(`请输入验证码`,2); - // return - // } else if (this.state.passwords === undefined || this.state.passwords == "") { - // this.openNotification(`请输入密码`,2); - // return - // } else if (this.state.Agreetotheterms === false) { - // this.openNotification(`请同意服务协议条款`,2); - // return; - // } - if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) { - this.setState({ - Phonenumberisnotcos:"账号不能为空", - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return - } - if(this.state.pciphone===true){ - if (this.state.dragOk === false) { - // this.openNotification(`请拖动滑块完成验证`,2); - this.setState({ - Phonenumberisnotcosytdhk:"请拖动滑块完成验证", - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return - } - } - - if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) { - // this.openNotification(`请输入验证码`,2); - this.setState({ - Phonenumberisnotcosyzm:"验证码不能为空", - }) - return - } else if (this.state.passwords === undefined || this.state.passwords == "" ||this.state.passwords.length===0) { - this.setState({ - Phonenumberisnotcosymmm:"密码不能为空", - }) - return - } else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length<8){ - this.setState({ - Phonenumberisnotcosymmm:"密码不能少于8位", - }) - return - } else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length>16){ - this.setState({ - Phonenumberisnotcosymmm:"密码不能超过16位", - }) - return - } else if (this.state.Agreetotheterms === false) { - this.openNotification(`请同意服务协议条款`,2); - return; - } - - let url; - if(this.props.weixinlogin){ - url= '/weapps/register.json'; - }else{ - url = "/accounts/register.json"; - } - - axios.post(url, { - login: this.state.logins, - password: this.state.passwords, - code: this.state.codes, - }).then((result) => { - if(result){ - if(result.data.status===-2){ - if(result.data.message==="验证码不正确"){ - this.setState({ - Phonenumberisnotcosyzm:"验证码不正确", - }) - - return; - }else if(result.data.message==="验证码已失效"){ - this.setState({ - Phonenumberisnotcosyzm:"验证码不正确", - }) - - return; - }else { - this.openNotification(result.data.message); - return; - } - }else { - // this.setState({ - // logins: "", - // dragOk: false, - // codes: "", - // passwords: "", - // Agreetotheterms: "", - // }) - this.setMyEduCoderModals(); - } - } - }).catch((error) => { - - }) - } - - //邮箱手机号验证 - Emailphonenumberverification = (value, id) => { - var url = `/accounts/valid_email_and_phone.json`; - axios.get((url), { - params: { - login: value, - type: 1, - } - }).then((result) => { - - //验证有问题{"status":1,"message":"success"} - // console.log(result); - // this.setState({dragOk: true}) - - if(result){ - if(result.data.status===-2){ - if (id === 1) { - if(result.data.message==="该手机号码或邮箱已被注册"){ - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - dragOk:true, - }) - }else { - this.setState({ - Phonenumberisnotco: result.data.message, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - - - } - return; - } else if (id === 2) { - this.setState({ - Phonenumberisnotcos: result.data.message, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - - - return; - } - }else { - if (id === 1) { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - dragOk:true, - }) - return; - } else if (id === 2) { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - dragOk:true, - }) - return; - } - } - } - - }).catch((error) => { - - }) - }; - //短信验证 - SMSverification = () => { - let logins=this.state.logins; - var url = `/accounts/get_verification_code.json`; - axios.get((url), { - params: { - login: this.state.logins, - type: 1, - smscode:setmiyah(logins) - } - }).then((result) => { - //验证有问题{"status":1,"message":"success"} - // console.log(result); - if(result.data.status===1){ - this.openNotification("验证码已发送,请注意查收"); - }else if(result.data.status===-2){ - this.openNotification(result.data.message); - } - }).catch((error) => { - - - }) - } - //显示和不显示密码 - Showandhide = (e) => { - - if (this.state.classpassbool === true) { - this.setState({ - passopens:passoff , - classpass: "text", - classpassbool: false, - }) - } else { - this.setState({ - passopens: passopen , - classpass: "password", - classpassbool: true, - }) - } - - } - - //倒计时 - getverificationcode = () => { - // console.log(this.state.Phonenumberisnotcobool); - // console.log(this.state.dragOk); - if(this.state.logins === undefined || this.state.logins.length===0){ - this.openNotification("请输入手机号或邮箱"); - return; - } - //这是判断是否手机正确 - if(this.state.Phonenumberisnotcobool === true){ - this.openNotification(this.state.Phonenumberisnotcos); - this.setState({ - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return; - } - if(this.state.pciphone===true) { - if (this.state.dragOk === false) { - this.openNotification("请拖动滑块验证"); - return; - } - } - - if (this.state.getverificationcodes === true) { - this.setState({ - getverificationcodes: undefined, - }) - let timer = setInterval(() => { - this.setState((preState) => ({ - seconds: preState.seconds - 1, - }), () => { - if (this.state.seconds == 0) { - clearInterval(timer); - this.setState({ - getverificationcodes: false, - seconds: 60, - }) - } - }); - }, 1000) - this.SMSverification(); - } else { - this.setState({ - getverificationcodes: undefined, - }) - let timer = setInterval(() => { - this.setState((preState) => ({ - seconds: preState.seconds - 1, - }), () => { - if (this.state.seconds == 0) { - clearInterval(timer); - this.setState({ - getverificationcodes: false, - seconds: 60, - - }) - } - }); - }, 1000) - this.SMSverification(); - } - } - //滑动验证手机号 - - //获取登入 - loginInputonChange = (e) => { - // console.log(e.target.value); - var stirngt; - if(e.target.value.length>0){ - var str= e.target.value.replace(/\s*/g,"") - stirngt=str; - }else{ - stirngt= e.target.value; - } - - if (e.target.value.length === 0) { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - Phonenumberisnotcodmms:undefined, - login: stirngt, - }) - }else{ - this.setState({ - login: stirngt, - Phonenumberisnotco:undefined, - Phonenumberisnotcodmms:undefined, - }) - } - - } - //失去焦点判断 - inputOnBlur = (e, id) => { - this.Emailphonenumberverification(e.target.value, 1); - } - inputOnBlurzhuche = (e, id) => { - if (e.target.value.length === 0) { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - }) - return; - } - // var telephone = $("#telephoneAdd.tianjia_phone").val(); - var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; - // var email = $("#add_email.tianjia_email").val(); - var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; - - // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 - var stringdata = undefined; - if (!regph.test(e.target.value)) { - stringdata = "手机号格式不正确"; - this.setState({ - Phonenumberisnotcos: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - } else { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - - }) - return - } - - if (!regemail.test(e.target.value)) { - if ((e.target.value.indexOf("@") != -1) === true) { - stringdata = "邮箱格式不正确"; - } else { - stringdata = "手机号格式不正确"; - - } - this.setState({ - Phonenumberisnotcos: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return - } else { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - - }) - this.Emailphonenumberverification(e.target.value, id); - return - } - this.Emailphonenumberverification(e.target.value, id); - } - //获取登入密码 - passwordonChange = (e) => { - // console.log(e.target.value); - var stirngt; - if(e.target.value.length>0){ - var str= e.target.value.replace(/\s*/g,"") - stirngt=str; - }else{ - stirngt= e.target.value; - } - this.setState({ - password: stirngt, - Phonenumberisnotcodmm:undefined, - Phonenumberisnotcodmms:undefined, - }) - // this.setState({ - // password: e.target.value - // }) - } - //获取注册登入 - loginInputonChanges = (e) => { - - var stirngt; - if(e.target.value.length>0){ - var str= e.target.value.replace(/\s*/g,"") - stirngt=str; - }else{ - stirngt= e.target.value; - } - if (e.target.value.length === 0) { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - logins: stirngt, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - }else{ - this.setState({ - logins: stirngt, - Phonenumberisnotcos: undefined, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - } - - } - //获取注册密码 - passwordonChanges = (e) => { - // console.log(e.target.value); - var stirngt; - if(e.target.value.length>0){ - var str= e.target.value.replace(/\s*/g,"") - stirngt=str; - }else{ - stirngt= e.target.value; - } - this.setState({ - passwords: stirngt, - Phonenumberisnotcosymmm:undefined, - }) - } - //获取code - codesonChange = (e) => { - this.setState({ - codes: e.target.value, - Phonenumberisnotcosyzm:undefined, - }) - } - //切换tab - changeTab=(e)=>{ - this.setState({ - tab:e.key - }) - - if(e.key === 0){ - this.setState({ - Phonenumberisnotcos:undefined - }) - }else{ - this.setState({ - Phonenumberisnotco:undefined - }) - - } - - // this.props.history.push(`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/student_exercise_list?tab=`+e.key) - - } - loginonkeyup =(e)=>{ - if(e.keyCode==32){ - - return false; - } - }; - setNotcompleteds=()=>{ - this.setState({ - Notcompleteds:true, - MyEduCoderModals:false, - registered:undefined, - - }) - }; - setMyEduCoderModals=()=>{ - this.setState({ - MyEduCoderModals:true, - registered:"注册成功" - }) - }; - - openweixinlogin=()=>{ - this.setState({ - weixinlogin:true - }) - } - hideweixinlogin=()=>{ - this.setState({ - weixinlogin:false, - qqlogin:false, - tab:["0"] - }) - } - - openqqlogin=()=>{ - this.setState({ - qqlogin:true - }) - //window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2otherloginqq&response_type=code` - window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code` - // window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&tp=qq&response_type=code` - } - - openphoneqqlogin=()=>{ - window.open( - `https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code` - ) - } - render() { - const { - // 登录 - autoLogin, - classpass, - passopens, - seconds, - getverificationcodes, - Agreetotheterms, - Phonenumberisnotco, - Phonenumberisnotcos, - codes, - tab, - dragOk, - Whethertoverify, - classpassbool, - Phonenumberisnotcosytdhk, - Phonenumberisnotcosyzm, - Phonenumberisnotcosymmm, - Phonenumberisnotcodmm, - // 注册 - readAgreement, - pciphone, - Phonenumberisnotcodmms, - weixinlogin - } = this.state - // height: 346px; - if (this.state.seconds === 0) { - // window.location.href='http://www.cnblogs.com/a-cat/'; - } - - - return ( - -
    - - -
    - {weixinlogin===false&&this.props.weixinlogin===undefined? - 登录 - 注册 - :""} - - { - weixinlogin===false&&parseInt(tab[0])==0 && -
    - - - this.inputOnBlur(e, 1)} - style={{marginTop: '30px', height: '38px'}} - onPressEnter={() => this.postLogin()} - > - - { - Phonenumberisnotco && Phonenumberisnotco != "" ? -

    - {Phonenumberisnotco} -

    - :
    - } - - this.postLogin()} - className={Phonenumberisnotcodmm && Phonenumberisnotcodmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"} - placeholder="密码"> - { - Phonenumberisnotcodmm && Phonenumberisnotcodmm != "" ? -

    - {Phonenumberisnotcodmm} -

    - : (Phonenumberisnotcodmms=== undefined?
    :"") - } - { - Phonenumberisnotcodmms && Phonenumberisnotcodmms != "" ? -

    - {Phonenumberisnotcodmms} -

    - : "" - } - - - - - {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?this.state.isphone===true?

    - - ———————— 快速登录 ———————— -

    -

    :

    - ———————— 快速登录 ———————— -

    -

    :""} -
    - } - - - - { - weixinlogin===false&&parseInt(tab[0])==1 && -
    - this.inputOnBlurzhuche(e, 2)} - style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}> - { - Phonenumberisnotcos && Phonenumberisnotcos !== "" ? -

    - {Phonenumberisnotcos} -

    - :
    - - } - {this.state.MyEduCoderModals===true? {this.setNotcompleteds()}} - />:""} - - { - Whethertoverify===false&&pciphone===true? - - - : - "" - - } - { - Whethertoverify===true&&pciphone===true? - - - : - "" - } - -
    - { - pciphone===true? - ( - Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !== "" ? -

    - {Phonenumberisnotcosytdhk} -

    - :
    - - ) - :"" - } -
    - - - -
    - - - - { - getverificationcodes === undefined ? - - : getverificationcodes === true ? - - : - - } - -
    -
    - { - Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ? -

    - {Phonenumberisnotcosyzm} -

    - :
    - - } -
    - - - - - this.Showandhide(key)}> - - }> - { - Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ? -

    - {Phonenumberisnotcosymmm} -

    - :
    - - } - {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?我已阅读并同意 - - 《服务协议条款》 - :""} - - - {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?this.state.isphone===true?

    - - ———————— 快速登录 ———————— -

    -

    :

    - ———————— 快速登录 ———————— -

    -

    :"" - } -
    - } - - - - - {weixinlogin===true?:""} - {weixinlogin===true?

    - this.hideweixinlogin()}>返回登录注册 -

    :""} -
    - -
    - ); - } -} - -export default (LoginRegisterComponent); diff --git a/public/react/src/modules/user/LoginRegisterPage.js b/public/react/src/modules/user/LoginRegisterPage.js deleted file mode 100644 index 8990f1d78..000000000 --- a/public/react/src/modules/user/LoginRegisterPage.js +++ /dev/null @@ -1,30 +0,0 @@ -import React, { Component } from 'react'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import Loading from '../../Loading'; - -import Loadable from 'react-loadable'; - -// import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; - -import { SnackbarHOC, getImageUrl } from 'educoder'; -import LoginRegisterComponent from './LoginRegisterComponent'; -import FindPasswordComponent from './FindPasswordComponent'; - -class LoginRegisterPage extends Component { - render() { - // newMain clearfix - return ( -
    - - -

    -

    - -
    - ); - } -} - -export default SnackbarHOC() ( ( LoginRegisterPage )); diff --git a/public/react/src/modules/user/MyEduCoderModal.js b/public/react/src/modules/user/MyEduCoderModal.js deleted file mode 100644 index 83a87448a..000000000 --- a/public/react/src/modules/user/MyEduCoderModal.js +++ /dev/null @@ -1,53 +0,0 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import { Modal} from 'antd'; -import axios from 'axios'; -import './common.css' -//立即申请试用 -class MyEduCoderModal extends Component { - - constructor(props) { - super(props); - this.state={ - - } - } - - modalCancel=()=>{ - window.location.href = "/" - } - - setDownload=()=>{ - //立即联系 - this.props.setNotcompleteds() - } - - - render() { - - return( - -
    -

    欢迎使用EduCoder,您可以试用1天

    -

    超过期限,需要经过管理员的授权审核

    - -
    -
    - ) - } -} - -export default MyEduCoderModal; \ No newline at end of file diff --git a/public/react/src/modules/user/MyeducoderI.css b/public/react/src/modules/user/MyeducoderI.css deleted file mode 100644 index 4c9d6ade3..000000000 --- a/public/react/src/modules/user/MyeducoderI.css +++ /dev/null @@ -1,3 +0,0 @@ -.yslfont { - font-size: 10%; -} \ No newline at end of file diff --git a/public/react/src/modules/user/Notcompletedysl.js b/public/react/src/modules/user/Notcompletedysl.js deleted file mode 100644 index 63c58d933..000000000 --- a/public/react/src/modules/user/Notcompletedysl.js +++ /dev/null @@ -1,79 +0,0 @@ -import React, { Component } from 'react'; -import { Modal} from 'antd'; -import axios from 'axios'; -import '../../modules/user/common.css'; -//完善个人资料 -class Notcompletedysl extends Component { - - constructor(props) { - super(props) - this.state ={ - modalsType:false, - } - - } - componentDidMount() { - // console.log("Notcompletedysl"); - // console.log("开发了402了"); - - // axios.interceptors.response.use((response) => { - // // console.log(response); - // if (response != undefined) - // if (response && response.data.status === 402) { - // this.setState({ - // modalsType: true - // }) - // } - // return response; - // }, (error) => { - // //TODO 这里如果样式变了会出现css不加载的情况 - // - // }); - - } - - modalCancel=()=>{ - var weekArray = JSON.parse(window.sessionStorage.getItem('yslgeturls')); - if(weekArray===undefined){ - weekArray="/"; - } - if(weekArray===null){ - weekArray="/"; - } - if(weekArray==="null"){ - weekArray="/"; - } - window.location.href = weekArray; - } - - setDownload=()=>{ - window.location.href ='/account/profile'; - } - - - render() { - // console.log(this.props) - return( - -
    -

    完善您的资料,将获得更多的使用权限

    - -
    -
    - ) - } -} - -export default Notcompletedysl; \ No newline at end of file diff --git a/public/react/src/modules/user/ReadPassword.js b/public/react/src/modules/user/ReadPassword.js deleted file mode 100644 index 6beab8e62..000000000 --- a/public/react/src/modules/user/ReadPassword.js +++ /dev/null @@ -1,43 +0,0 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import { Modal} from 'antd'; -import axios from 'axios'; -import './common.css' -//密码已重置,请重新登录 -class ReadPassword extends Component { - - constructor(props) { - super(props); - - } - - - setDownload=()=>{ - //立即联系 - window.location.href = "/login" - } - - - render() { - - return( - -
    -

    密码已重置,请重新登录

    - this.setDownload()}>知道啦 -
    -
    - ) - } -} - -export default ReadPassword; \ No newline at end of file diff --git a/public/react/src/modules/user/Trialapplicationreview.js b/public/react/src/modules/user/Trialapplicationreview.js deleted file mode 100644 index e3bcf43d5..000000000 --- a/public/react/src/modules/user/Trialapplicationreview.js +++ /dev/null @@ -1,65 +0,0 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import { Modal} from 'antd'; -import axios from 'axios'; -import './common.css' -//您的试用申请正在审核中,请耐心等待 -class Trialapplicationreview extends Component { - - constructor(props) { - super(props); - this.state={ - modalsType:false, - } - - } - - componentDidMount() { - axios.interceptors.response.use((response) => { - if (response != undefined) - if (response && response.data.status === 408) { - this.setState({ - modalsType: true - }) - - } - return response; - }, (error) => { - //TODO 这里如果样式变了会出现css不加载的情况 - - }); - } - - - setDownload=()=>{ - //立即联系 - this.setState({ - modalsType:false - }) - - } - - - render() { - - return( - -
    -

    您的试用申请正在审核中,请耐心等待

    - this.setDownload()}>知道啦 -
    -
    - ) - } -} - -export default Trialapplicationreview; \ No newline at end of file diff --git a/public/react/src/modules/user/account/AccountBasic.js b/public/react/src/modules/user/account/AccountBasic.js deleted file mode 100644 index aef66e5c2..000000000 --- a/public/react/src/modules/user/account/AccountBasic.js +++ /dev/null @@ -1,120 +0,0 @@ -import React, { Component } from 'react'; - -import { SnackbarHOC, getImageUrl, City } from 'educoder'; -import { Form, Button, Input, Radio, Select, Tooltip, Icon } from 'antd' -import './common.css' -import { getHiddenName } from './AccountBasicEdit' - -const RadioGroup = Radio.Group; -const Option = Select.Option -const radioOptions = [ - { label: '男', value: 'boy' }, - { label: '女', value: 'girl' }, -]; -export const identityMap={"teacher":"教师", "student":"学生", "professional":"专业人士"} -class AccountBasicEdit extends Component { - constructor(props){ - super(props); - - } - - render() { - const { getFieldDecorator } = this.props.form; - const {basicInfo} =this.props - const showRealName = false; - return ( -
    -
    - -
    -
    基本信息
    - -
    - -
    - - {basicInfo && basicInfo.nickname} - - - - {basicInfo && (basicInfo.show_realname == true ? basicInfo.name : getHiddenName(basicInfo.name))} - - - - {basicInfo && basicInfo.gender == 0?"男":"女"} - - - - - {basicInfo && basicInfo.location} {basicInfo && basicInfo.location_city} - - - - { basicInfo && basicInfo.identity && identityMap[basicInfo.identity] } {basicInfo && ( basicInfo.technical_title || basicInfo.student_id)} - - - - {basicInfo && basicInfo.school_name} - - - - {basicInfo && basicInfo.department_name} - -
    -
    -
    * 我们确保你所提供的信息均处于严格保密状态,不会泄露
    -
    - ); - } -} -const WrappedAccountBasicEdit = Form.create({ name: 'AccountBasicEdit' })(AccountBasicEdit); - -export default WrappedAccountBasicEdit; diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js deleted file mode 100644 index 7d6fc13d2..000000000 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ /dev/null @@ -1,696 +0,0 @@ -import React, { Component } from 'react'; - -import { SnackbarHOC, getImageUrl, City, ConditionToolTip } from 'educoder'; -import { Form, Button, Input, Radio, Select, Tooltip, Icon, AutoComplete } from 'antd' -import ApplyForAddOrgModal from '../modal/ApplyForAddOrgModal' -import ApplyForAddChildOrgModal from '../modal/ApplyForAddChildOrgModal' -import AccountBasicEditItem from './AccountBasicEditItem'; -import axios from 'axios' -import { identityMap } from './AccountBasic' -const RadioGroup = Radio.Group; -const Option = Select.Option; - -const map = identityMap // {"teacher":"教师", "student":"学生", "professional":"专业人士"} -export function getHiddenName(name) { - if (!name) return '' - let len=parseInt(name.length)-1; - let str=""; - for(var i = 0; i < len; i++){ str += "*"; } - const newName = name.substr(0,1)+str; - return newName -} -const MAX_NAME_LENGTH = 10 -const MAX_NICKNAME_LENGTH = 20 -class AccountBasic extends Component { - constructor(props){ - super(props); - this.state={ - nameLength:0, - showRealName:true, - schoolList:undefined, - filterSchoolList:undefined, - school:undefined, - departments:undefined, - filterDepartments:undefined, - departmentsName:undefined, - identity:"teacher", - school_id:undefined, - department_id:undefined - } - } - - componentDidUpdate =(prevProps)=>{ - if(this.props.basicInfo && (prevProps.basicInfo == undefined || prevProps.basicInfo.id != this.props.basicInfo.id)){ - this.setValue(this.props.basicInfo); - this.getSchoolList(this.props.basicInfo); - } - } - - componentDidMount = () =>{ - if(this.props.basicInfo){ - this.setValue(this.props.basicInfo); - this.getSchoolList(this.props.basicInfo); - } - } - - setValue=(basicInfo)=>{ - if(basicInfo){ - this.props.form.setFieldsValue({ - nickname:basicInfo.nickname, - name:!basicInfo.show_realname ? this.hideRealName(basicInfo.name) : basicInfo.name, - sex:String(basicInfo.gender), - job:basicInfo.identity, - org:basicInfo.school_name, - org2:basicInfo.department_name, - - city:[basicInfo.location,basicInfo.location_city] - }) - setTimeout(() => { - // 等显示后再set - this.props.form.setFieldsValue({ - student_No:basicInfo.student_id, - job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", - job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", - }) - }, 100) - //if(basicInfo.nickname){ - this.setState({ - forDisable: true, - nameLength:basicInfo.nickname?basicInfo.nickname.length:0, - showRealName:basicInfo.show_realname, - realName: basicInfo.name, - identity:basicInfo.identity, - school_id:basicInfo.school_id, - department_id:basicInfo.department_id - }) - //} - } - } - - // 获取学校、单位 - getSchoolList=(basicInfo, selectedName)=>{ - let url=`/schools/for_option.json`; - axios.get(url).then((result)=>{ - if(result){ - this.setState({ - schoolList:result.data.schools - }) - if (selectedName) { - let school_id - result.data.schools.reverse().some( item => { - if (item.name == selectedName) { - school_id = item.id - return true; - } - }) - this.props.form.setFieldsValue({ - org: selectedName - }) - this.setState({ - school_id, - school: selectedName - }, () => { - this.filterList(selectedName) - }) - } else if(basicInfo && basicInfo.school_name){ - this.setState({ - school:basicInfo.school_name, - filterSchoolList:this.state.schoolList.filter(function(item){ - return item.name.indexOf(basicInfo.school_name)>-1; - }) - }) - this.getDepartments(basicInfo.school_name,false); - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - // 输入昵称时change剩余的字数 - changeNickName=(e)=>{ - let num= MAX_NICKNAME_LENGTH - parseInt(e.target.value.length); - this.setState({ - nameLength:num < 0 ? 0 : num - }) - } - - handleSubmit = () => { - this.props.form.validateFieldsAndScroll({ force: true }, (err, values) => { - console.log(values); - let {basicInfo}=this.props; - if(!err ){ - if (!this.state.school_id) { - this.props.showNotification('请先选择学校/单位') - return; - } - if (!this.state.department_id) { - this.props.showNotification('请先选择院系/部门') - return; - } - - let url=`/users/accounts/${basicInfo.id}.json` - axios.put((url),{ - nickname:values.nickname, - // 认证中的不能修改 - name: basicInfo.authentication == 'uncertified' ? - (this.state.showRealName ? values.name : this.state.realName ) : basicInfo.name, - show_realname:this.state.showRealName, - gender:parseInt(values.sex), - location:values.city[0], - location_city:values.city[1], - identity: this.state.identity || (values.job=="teacher"?"teacher":values.job=="student"?"student":"professional"), - technical_title:values.job1 || values.job2, - student_id:values.job=="student" ? values.student_No : null, - school_id:this.state.school_id, - department_id:this.state.department_id - }).then((result)=>{ - if(result){ - this.props.showNotification('保存成功') - // 如果是第一次完善资料,重新拉头部接口更新 - if (!this.props.basicInfo.base_info_completed) { - this.props.fetchUser() - } - this.props.getBasicInfo(); - this.props.history.push('/account/profile') - - } - }).catch((error)=>{ - console.log(error); - }) - } - }) - } - - // 隐藏或显示真实姓名 - showOrHide=(flag)=>{ - const name = this.props.form.getFieldsValue().name || this.props.basicInfo.name - this.setState({ - showRealName:flag==true?false:true - }) - if(flag==true){ // 隐藏真实姓名 - this.hideRealName(name); - }else{ // 显示 - this.props.form.setFieldsValue({ - name: this.state.realName - }) - } - } - - // 将名字隐藏起来 - hideRealName=(name)=>{ - this.setState({ realName: name }) - const newName = getHiddenName(name) - - this.props.form.setFieldsValue({ - name: newName - }) - return newName - } - - // 过滤学校 - filterList =(e)=>{ - const inputVal = e.trim() - let arr=[]; - if(inputVal){ - arr= this.state.schoolList.filter(function(item){ - return item.name.indexOf(inputVal)>-1; - }); - this.props.form.setFieldsValue({ - org: inputVal - }) - this.setState({ - school: inputVal, - filterSchoolList: arr - }) - } else { - this.setState({ - school: '', - }) - } - // else{ - // let {school}=this.state; - // arr= this.state.schoolList.filter(function(item){ - // return item.name.indexOf(school)>-1; - // }); - // } - } - //搜索部门 - searchDepartment=(e)=>{ - if (e) { - this.props.form.setFieldsValue({ - org2:e - }) - let arr = this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){ - return item.name.indexOf(e) > -1 - }) : [] - this.setState({ - filterDepartments:arr, - departmentsName:e - }) - } else { - this.setState({ - filterDepartments: this.state.departments - }) - } - } - - // 选择部门、学院 - changeDepartment=(e)=>{ - let arr = this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){ - return item.name == e; - }) : []; - if (!arr[0]) { - this.setState({ - department_id: '', - departmentsName: e, - filterDepartments: [], - }) - this.this_department_id = '' - return; - } - this.this_department_id = arr[0].id - this.setState({ - departmentsName:e, - department_id: arr[0].id, - }) - } - - // 选择学校(获取对应学校的学院、部门) - changeList=(e)=>{ - this.getDepartments(e.trim(),true); - } - - getDepartments=(e,flag)=>{ - let arr=this.state.schoolList.filter(function(item){ - if(item.name.indexOf(e) > -1){ - return item.name; - } - }); - if (!arr[0]) { - if (!e) { - this.setState({ - filterSchoolList: [] - }) - } - // 没找到学校,清空部门 - this.setState({ - departments: [], - filterDepartments: [], - departmentsName: '', - school_id: '', - department_id: '', - }) - this.this_school_id = '' - this.props.form.setFieldsValue({ - org2: '' - }) - return; - } - this.props.form.setFieldsValue({ - org: arr[0].name - }) - this.filterList(e) - // 保存选择的学校id - this.this_school_id = arr[0].id - this.setState({ - school_id: arr[0].id, - school:e, - }) - this._getDepartments(arr[0].id, flag) - } - _getDepartments = (schoolId, flag, selectedName) => { - let url=`/schools/${schoolId || this.state.school_id}/departments/for_option.json`; - axios.get(url).then((result)=>{ - if(result){ - this.setState({ - departments:result.data.departments, - filterDepartments:result.data.departments - }) - if (selectedName) { - let department_id - result.data.departments.reverse().some( item => { - if (item.name == selectedName) { - department_id = item.id - return true; - } - }) - this.props.form.setFieldsValue({ - org2: selectedName - }) - this.setState({ - department_id, - // school: selectedName - }) - } else if(result.data.departments && result.data.departments.length>0 && flag==true){ - // 切换学校后,部门默认选择第一个 - this.props.form.setFieldsValue({ - org2:result.data.departments[0].name - }) - this.setState({ - department_id: result.data.departments[0].id - }) - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - - - addOrgSuccess = (name) => { - // const schoolList = this.state.schoolList.slice(0) - // schoolList.push({ id: schoolList.length + 2000, name: name}) - // this.setState({ schoolList }) - - this.getSchoolList(this.props.basicInfo, name); - this.props.form.setFieldsValue({ - org: name - }) - } - - addChildOrgSuccess = (deptName) => { - - this._getDepartments(this.state.school_id, false, deptName); - - } - - showApplyForAddOrgModal = () => { - this.applyForAddOrgForm.setVisible(true) - } - showApplyForAddChildOrgModal = () => { - let{school,schoolList}=this.state; - let arr=schoolList.filter(function(item){ - return item.name == school; - }); - if(arr.length > 0){ - this.applyForAddChildOrgForm.setVisible(true) - }else{ - this.props.showNotification("请先选择正确的单位或者学校!"); - } - } - // checkNameLength = (rule, value, callback) => { - // if (value && value.length <= MAX_NAME_LENGTH) { - // callback(); - // return; - // } - // callback(`请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`); - // } - // 切换职称 - changeJob=(e)=>{ - this.setState({ - identity:e - }) - let {basicInfo}=this.props; - if(basicInfo){ - this.props.form.setFieldsValue({ - job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", - job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", - }) - } - } - //昵称 - handleSubmitName(rule, value, callback){ - if (value) { - let iconRule1 = /[`~!@#$%^&*()\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im; -// 判断是否含有emoji表情 - let iconRule2 = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig; -// 如果为true,字符串含有emoji表情 ,false不含 - const iconRule2s =iconRule2.test(value); -// 如果为true,字符串含有特殊符号 ,false不 - const iconRule1s =iconRule1.test(value); - - if (iconRule2s===true|| iconRule1s===true) { - callback('2-20位中英文、数字及下划线'); - } - else if(value.length<2){ - callback('2-20位中英文、数字及下划线'); - }else if(value.length>=21){ - callback('2-20位中英文、数字及下划线'); - } - } - callback(); - } - - // 姓名 - handleSubmitNames(rule, value, callback){ - if (value) { - let iconRule1 = /[`~!@#$%^&()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&()——\-+={}|《》?:“”【】、;‘’,。、]/im; -// 判断是否含有emoji表情 - let iconRule2 = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig; -// 如果为true,字符串含有emoji表情 ,false不含 - const iconRule2s =iconRule2.test(value); -// 如果为true,字符串含有特殊符号 ,false不 - const iconRule1s =iconRule1.test(value); - - if (iconRule2s===true|| iconRule1s===true) { - callback('2-10位中英文、数字'); - } - else if(value.length<2){ - callback('2-10位中英文、数字'); - }else if(value.length>=11){ - callback('2-10位中英文、数字'); - } - } - callback(); - } - render() { - let{ - nameLength, - showRealName, - filterSchoolList, - filterDepartments, - school, - school_id, - departments, - departmentsName, - identity - }=this.state; - const { getFieldDecorator } = this.props.form; - let{ basicInfo }=this.props - let common = { - changeJob:this.changeJob, - filterList:this.filterList, - changeList:this.changeList, - searchDepartment:this.searchDepartment, - changeDepartment:this.changeDepartment, - showApplyForAddOrgModal:this.showApplyForAddOrgModal, - showApplyForAddChildOrgModal:this.showApplyForAddChildOrgModal - } - // 已职业认证的账户不能修改职业,学校/单位,院系/部门(true为disable) - const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ; - - // form合并了 - const propsWithoutForm = Object.assign({}, this.props) - delete propsWithoutForm.form - return ( -
    - this.applyForAddOrgForm = form} schoolName={school} - {...propsWithoutForm} addOrgSuccess={this.addOrgSuccess} - > - this.applyForAddChildOrgForm = form} - addChildOrgSuccess={this.addChildOrgSuccess} - > - -
    - -
    基本信息
    - -
    - - {getFieldDecorator('nickname', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: '请输入您的昵称', - }, - { validator: this.handleSubmitName }, - ], - validateTrigger: 'onSubmit', // 设置进行表单验证的时机为onSubmit - })( - {String(nameLength)}/{MAX_NICKNAME_LENGTH} - }> - )} - - - - { basicInfo.authentication == 'uncertified' ? {getFieldDecorator('name', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: `请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`, - }, - { validator: this.handleSubmitNames }, - - ], - validateTrigger: 'onSubmit', // 设置进行表单验证的时机为onSubmit - })( - this.showOrHide(showRealName)}> - }> - )} - { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } - : -
    - - {showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)} - - this.showOrHide(showRealName)}> - { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } -
    - } -
    - - - {getFieldDecorator('sex', { - rules: [{ - required: true, - message: '请选择性别', - }], - })( - - - - - - - )} - - - - - {getFieldDecorator('city', { - rules: [{ - type: 'array', - required: true, - message: '请先选择所在地', - }], - })( - - )} - - - {/* htmlType="submit" */} - {/* -
    */} - - - {this.props.basicInfo.base_info_completed && - } - {/*
    -
    */} -
    -
    -
    * 我们确保你所提供的信息均处于严格保密状态,不会泄露
    -
    - ); - } -} -const WrappedAccountBasic = Form.create({ name: 'AccountBasic' })(AccountBasic); - -export default WrappedAccountBasic; diff --git a/public/react/src/modules/user/account/AccountBasicEditItem.js b/public/react/src/modules/user/account/AccountBasicEditItem.js deleted file mode 100644 index 9f362d973..000000000 --- a/public/react/src/modules/user/account/AccountBasicEditItem.js +++ /dev/null @@ -1,210 +0,0 @@ -import React, { Component } from 'react'; - -import { SnackbarHOC, getImageUrl, City, ConditionToolTip } from 'educoder'; -import { Form, Button, Input, Radio, Select, Tooltip, Icon, AutoComplete } from 'antd' -const RadioGroup = Radio.Group; -const Option = Select.Option; -class AccountBasicEditItem extends Component { - constructor(props){ - super(props); - } - - render(){ - let { - professionalFlag , - getFieldDecorator , - identity , - filterSchoolList , - filterDepartments, - departmentsName, - school, - departments, - department_id - } = this.props - return( -
    -
    - - (

    已提交职业认证

    可在认证信息中通过“重新认证”进行修改

    )} condition= { professionalFlag }> - {getFieldDecorator('job', { - rules: [{ - initialValue:"teacher", - required: true, - message: '请先选择职业', - }], - })( - - )} -
    -
    - { - identity && identity=="student" && - - (

    已提交职业认证

    可在认证信息中通过“重新认证”进行修改

    )} condition= { professionalFlag }> - {getFieldDecorator('student_No', { - rules: [{ - required: true, - message: '请先输入学号', - }], - })( - - )} -
    -
    - } - { - identity && identity=="teacher" && - - (

    已提交职业认证

    可在认证信息中通过“重新认证”进行修改

    )} condition= { professionalFlag }> - {getFieldDecorator('job1', { - rules: [{ - initialValue:"教授", - required: true, - message: '请先选择职称', - }], - })( - - )} -
    -
    - } - { - identity && identity=="professional" && - - (

    已提交职业认证

    可在认证信息中通过“重新认证”进行修改

    )} condition= { professionalFlag }> - {getFieldDecorator('job2', { - rules: [{ - initialValue:"企业管理者", - required: true, - message: '请先选择职称', - }], - })( - - )} -
    -
    - } -
    - - (

    已提交职业认证

    可在认证信息中通过“重新认证”进行修改

    )} condition= { professionalFlag }> - {getFieldDecorator('org', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - // type: 'array', - required: true, - message: '请先选择学校/单位', - - // 做不了,输入时和submit时都会执行这里 - // validator: (rule, value, callback) => { - // if (this.this_school_id) { - // callback(); - // return; - // } - // callback('请先选择学校/单位'); - // } - - }], - })( - - { - filterSchoolList && filterSchoolList.map((item,key)=>{ - return() - }) - } - - )} -
    -
    - - {!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school && -
    - - 未找到包含“{school}”的高校, - 申请新增 - -
    - } - - - (

    已提交职业认证

    可在认证信息中通过“重新认证”进行修改

    )} condition= { professionalFlag }> - {getFieldDecorator('org2', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - // type: 'array', - required: true, - message: '请先选择院系/部门', - // validator: (rule, value, callback) => { - // if (this.this_department_id) { - // callback(); - // return; - // } - // callback('请先选择院系/部门'); - // } - }], - })( - - { - filterDepartments && filterDepartments.map((item,key)=>{ - return( - - ) - }) - } - - )} -
    -
    - { - filterDepartments != undefined && ( (filterDepartments && filterDepartments.length==0 ) - || (departmentsName == '' && ! department_id - && (!departments || departments.length == 0) )) && -
    - - {departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}, - 申请新增 - -
    - } -
    - ) - } -} -export default AccountBasicEditItem; \ No newline at end of file diff --git a/public/react/src/modules/user/account/AccountBinding.js b/public/react/src/modules/user/account/AccountBinding.js deleted file mode 100644 index 05fe59482..000000000 --- a/public/react/src/modules/user/account/AccountBinding.js +++ /dev/null @@ -1,313 +0,0 @@ -import React, { Component } from 'react'; - -import { SnackbarHOC, getImageUrl, WordsBtn } from 'educoder'; -import { Form, Button, Input ,Modal } from 'antd' -import Modals from "../../modals/Modals"; -import '../../courses/css/Courses.css' -import './common.css' -import axios from 'axios' - -class AccountSecure extends Component { - constructor (props) { - super(props) - this.state = { - Modalstype:false, - list:[{ - en_type: "wechat", - id: null, - nickname: "", - },{ - en_type: "qq", - id: null, - nickname: "", - } - ] - } - } - IsPC=()=>{ - var userAgentInfo = navigator.userAgent; - var Agents = ["Android", "iPhone", - "SymbianOS", "Windows Phone", - "iPad", "iPod"]; - var flag = true; - for (var v = 0; v < Agents.length; v++) { - if (userAgentInfo.indexOf(Agents[v]) > 0) { - flag = false; - break; - } - } - return flag; - } - - componentDidMount() { - let {basicInfo}=this.props; - let {list}=this.state; - let newlist=list; - if(basicInfo===undefined||JSON.stringify(basicInfo) == "{}"||basicInfo&&basicInfo.open_users.length===0){ - - }else{ - basicInfo&&basicInfo.open_users.map((item,key)=>{ - newlist.map((items,keys)=>{ - if(items.en_type===item.en_type){ - items.id=item.id; - items.nickname=item.nickname; - } - }) - }) - } - - this.setState({ - list:newlist - }) - - } - - componentDidUpdate=(prevProps)=>{ - if(prevProps!=this.props){ - let {basicInfo}=this.props; - let {list}=this.state; - let newlist=list; - if(basicInfo===undefined||JSON.stringify(basicInfo) == "{}"||basicInfo&&basicInfo.open_users.length===0){ - - }else{ - basicInfo&&basicInfo.open_users.map((item,key)=>{ - newlist.map((items,keys)=>{ - if(items.en_type===item.en_type){ - items.id=item.id; - items.nickname=item.nickname; - } - }) - }) - } - - this.setState({ - list:newlist - }) - } - } - showModal=()=>{ - this.setState({ - visible: true, - }); - }; - - handleOk=(e)=> { - this.setState({ - visible: false, - }); - }; - - handleCancel=()=>{ - this.setState({ - visible: false, - }); - }; - - Cancelundologins=()=>{ - this.setState({ - Modalstype:false, - ModalCancel:this.Cancelundologin, - ModalSave:this.Saveundologin, - }) - } - - Saveundologin=(type,id)=>{ - let {basicInfo}=this.props; - let {list}=this.state; - let newlist=list; - let url=`/users/accounts/${basicInfo.id}/open_users/${id}.json`; - axios.delete(url).then((result)=>{ - if(result.data.status===0){ - newlist.map((item,key)=>{ - if(item.en_type===type){ - item.id=null - } - }) - this.setState({ - list:newlist - }) - this.props.showNotification('解绑成功'); - this.Cancelundologins() - this.props.getBasicInfo() - } - }).catch((error)=>{ - console.log(error) - }) - } - - undologin=(type,id)=>{ - this.setState({ - Modalstype:true, - Modalstopval:type==="wechat"?"是否确定解绑微信账号?":"是否确定解绑QQ账号?", - ModalCancel:this.Cancelundologins, - ModalSave:()=>this.Saveundologin(type,id), - }) - } - openqqlogin=()=>{ - window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=account,${window.location.host}&response_type=code` - } - - openphoneqqlogin=()=>{ - window.open( - `https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=account,${window.location.host}&response_type=code` - ) - } - render() { - let flag = this.IsPC(); //true为PC端,false为手机端 - let {list}=this.state; - console.log(window.location.host) - return ( -
    -
    - {/*提示*/} - - -
    绑定登录账号
    - -
    - - {list.map((item,key)=>{ - return( -
    -
    -
    -
    - {item.en_type!="qq"?:} - {item.en_type!="qq"?微信:QQ} -
    - -
    - {item.id===null?"":item.nickname} -
    - -
    - {item.en_type!="qq"? this.showModal("wechat"):() => this.undologin("wechat",item.id) - } - >{item.id===null?"绑定":"解绑"}: this.openqqlogin():() => this.openphoneqqlogin():() => this.undologin("qq",item.id) - } - >{item.id===null?"绑定":"解绑"}} -
    -
    -
    -
    - ) - }) - } - -
    - - - - -
    -
    * 我们确保你所提供的信息均处于严格保密状态,不会泄露
    -
    - ); - } -} -const WrappedAccountSecure = Form.create({ name: 'AccountSecure' })(AccountSecure); - -export default WrappedAccountSecure; diff --git a/public/react/src/modules/user/account/AccountCertification.js b/public/react/src/modules/user/account/AccountCertification.js deleted file mode 100644 index 00f8f3230..000000000 --- a/public/react/src/modules/user/account/AccountCertification.js +++ /dev/null @@ -1,171 +0,0 @@ -import React, { Component } from 'react'; -// import { Button } from 'antd' -import { WordsBtn, getImageUrl } from 'educoder'; -import RealNameCertificationModal from '../modal/RealNameCertificationModal' -import '../../courses/css/Courses.css' -import {CNotificationHOC} from '../../courses/common/CNotificationHOC' -import axios from 'axios'; - - -class AccountCertification extends Component { - constructor(props){ - super(props); - this.state={ - certification:1 - } - } - - checkBasicInfo = (index) => { - if ( this.props.basicInfo.base_info_completed == true) { - this.showRealNameCertificationModal(index) - } else { - this.props.confirm({ - okText: `立即完善`, - content: `请先完善基本信息`, - onOk: () => { - this.props.history.push('/account/profile/edit') - } - }) - } - - } - - - - // 撤销认证 - cancelCertification=(type)=>{ - this.props.confirm({ - okText: '确认', - content: '是否确认撤销认证?', - onOk: () => { - this.cancelCertificationAction(type); - } - }) - } - - cancelCertificationAction=(type)=>{ - let login =this.props.current_user.login; - var url = `/users/accounts/${login}/${ type == 1 ? 'authentication_apply.json':'professional_auth_apply.json'}`; - axios.delete(url).then((result)=>{ - if(result){ - this.props.showNotification("撤销成功!"); - try { - this.props.getBasicInfo(); - } catch (e) { - } - try { - this.props.Getdata(); - } catch (e) { - - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - showRealNameCertificationModal = (index) => { - this.setState({ - certification:index, - }, () => { - if (index == 1) { - this.realNameCertificationModal1.setVisible(true) - } else if (index == 2) { - this.realNameCertificationModal2.setVisible(true) - } - }) - } - render() { - let {certification}=this.state - let {basicInfo} = this.props; - return ( -
    - {this.state.certification===1? this.realNameCertificationModal1 = form} certification={certification} - >:""} - - {this.state.certification===2? this.realNameCertificationModal2 = form} certification={certification} - >:""} -
    - -
    认证信息
    -
    -
    -
    实名认证
    -
    实名认证可以增强你在平台的江湖地位,还可以获得500金币的奖励~
    -
    - { - basicInfo && basicInfo.authentication =="uncertified" ? - this.checkBasicInfo(1)} >立即认证: - basicInfo && basicInfo.authentication =="applying" ? - - this.cancelCertification(1)}>撤销认证 - 待审核 - - : - - this.checkBasicInfo(1)}>重新认证 - 已认证 - - } -
    -
    - -
    -
    职业认证
    - - {basicInfo && (basicInfo.identity == "teacher" - ?
    教师通过认证,可以克隆实训、免金币查看实训答案和隐藏测试集...
    - :
    通过认证,可以获得500金币的奖励~
    )} -
    - { - basicInfo && basicInfo.professional_certification =="uncertified" ? - this.checkBasicInfo(2)} >立即认证 - : - basicInfo && basicInfo.professional_certification =="applying" ? - - this.cancelCertification(2)}>撤销认证 - 待审核 - - : - - this.checkBasicInfo(2)} >重新认证 - 已认证 - - } -
    -
    -
    -
    -
    * 我们确保你所提供的信息均处于严格保密状态,不会泄露
    -
    - ); - } -} - -export default AccountCertification; diff --git a/public/react/src/modules/user/account/AccountImg.js b/public/react/src/modules/user/account/AccountImg.js deleted file mode 100644 index b8e060750..000000000 --- a/public/react/src/modules/user/account/AccountImg.js +++ /dev/null @@ -1,59 +0,0 @@ -import React, { Component } from 'react'; - -import { SnackbarHOC, getImageUrl } from 'educoder'; -import ChangeHeaderPicModal from './ChangeHeaderPicModal' -class AccountImg extends Component { - editImg = () => { - this.refs['picModal'].setVisible(true) - } - render() { - const picUrl = getImageUrl("images/"+this.props.src) - return ( -
    - - - 头像 -

    修改头像

    -
    - ); - } -} - -export default AccountImg; diff --git a/public/react/src/modules/user/account/AccountNav.js b/public/react/src/modules/user/account/AccountNav.js deleted file mode 100644 index c4d8b0630..000000000 --- a/public/react/src/modules/user/account/AccountNav.js +++ /dev/null @@ -1,124 +0,0 @@ -import React, { Component } from 'react'; - -import { SnackbarHOC, getImageUrl } from 'educoder'; -import AccountImg from './AccountImg' -class AccountNav extends Component { - toBasic = () => { - this.props.history.push(`/account/profile`) - } - toCertification = () => { - this.props.history.push(`/account/certification`) - } - toSecure = () => { - this.props.history.push(`/account/secure`) - } - isBinding = () => { - this.props.history.push(`/account/binding`) - } - render() { - let { basicInfo, current_user } = this.props - // console.log(this.props); - const path = window.location.pathname - const isBasic = path.indexOf('profile') != -1 || path == "/account" - const isCertification = path.indexOf('certification') != -1 - const isSecure = path.indexOf('secure') != -1 - const isBinding = path.indexOf('binding') != -1 - return ( -
    - - { - basicInfo && basicInfo.id && - -
    - - {basicInfo.name || (current_user ? "" : '')} - {basicInfo.technical_title} -
    - -
    -
    账号管理
    -
      -
    • - - 基本信息 - { - basicInfo.base_info_completed == true ? - : - - } -
    • -
    • - 认证信息 - { - basicInfo.professional_certification == 'certified' && basicInfo.authentication == 'certified' ? - : - - } -
    • -
    • - 安全设置 -
    • - {this.props.user&&this.props.user.main_site===true?
    • - 绑定登录账号 -
    • :""} -
    -
    -
    - } -
    - ); - } -} - -export default AccountNav ; diff --git a/public/react/src/modules/user/account/AccountSecure.js b/public/react/src/modules/user/account/AccountSecure.js deleted file mode 100644 index 07905b3a5..000000000 --- a/public/react/src/modules/user/account/AccountSecure.js +++ /dev/null @@ -1,508 +0,0 @@ -import React, { Component } from 'react'; - -import { SnackbarHOC, setmiyah, WordsBtn } from 'educoder'; -import { Form, Button, Input } from 'antd' - -import '../../courses/css/Courses.css' -import './common.css' - -import axios from 'axios' - -const PHONE = 'PHONE' -const EMAIL = 'EMAIL' -const PASSWORD = 'PASSWORD' - -function regPhoneAndEmail(value){ - if(value.indexOf("@")>-1){ - // 加密邮箱 - let beforeStr=value.split("@")[0]; - let afterStr=value.split("@")[1]; - return beforeStr.substr(0,3)+"**"+beforeStr.substr(beforeStr.length-1,1)+"@"+afterStr; - }else{ - // 加密手机号码 - return value.substr(0,3)+"****"+value.substr(7,4); - } -} -class AccountSecure extends Component { - constructor (props) { - super(props) - this.state = { - updating: '', - secondsFlag:false, - seconds:60 - } - } - - // 获取验证码倒计时 - remainTime=()=>{ - this.setState({ - seconds: 60 - }) - this.timer = setInterval(() => { - let { seconds } =this.state; - let s = parseInt(seconds)-1; - if(s > -1){ - this.setState({ - seconds:s - }) - }else{ - this.setState({ - secondsFlag:false - }) - clearInterval(this.timer); - } - },1000) - } - - // 获取验证码 - getCode=(index)=>{ - let url=`/accounts/get_verification_code.json` - let login = ''; - let values=this.props.form.getFieldsValue(); - - if(index == 3){ - //绑定手机号码 - login=values.phone; - let reg=/^1\d{10}$/; - if(reg.test(login)==false){ - this.props.showNotification(`请先输入正确的手机号码`); - return; - } - }else if(index == 4){ - // 绑定邮箱 - login=values.email; - let reg=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/; - if(reg.test(login)==false){ - this.props.showNotification(`请先输入正确的邮箱地址`); - return; - } - } - let type = index; - if(!login){ - this.props.showNotification(`请先输入${index==3?"手机号码":"邮箱地址"}`); - return; - } - let smscode=setmiyah(login) - axios.get((url),{params:{ - login,type,smscode - }}).then((result)=>{ - if(result){ - // 倒计时 - if(result.data.status===1){ - this.props.showNotification("验证码已发送,请注意查收"); - }else if(result.data.status===-2){ - this.props.showNotification(result.data.message); - } - this.setState({ - secondsFlag:true - }) - this.remainTime(); - } - }).catch((error)=>{ - console.log(error); - }) - } -// 绑定手机 - onPhoneSubmit = () => { - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - let {login}=this.props.current_user; - let reg=/^1\d{10}$/; - if(reg.test(values.phone)){ - let url=`/users/accounts/${login}/phone_bind.json` - axios.post((url),{ - phone:values.phone, - code:values.phoneValidateCode - }).then((result)=>{ - if(result){ - this.props.showNotification("手机号码绑定成功!"); - this.setState({ - updating:'' - }) - this.props.getBasicInfo(); - } - }).catch((error)=>{ - console.log(error); - }) - }else{ - this.props.showNotification("请输入有效的11位手机号码"); - } - } - }) - } - - // 绑定邮箱 - onEmailSubmit = () => { - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - let {login}=this.props.current_user; - let reg=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/; - if(reg.test(values.email)){ - let url=`/users/accounts/${login}/email_bind.json` - axios.post((url),{ - email:values.email, - code:values.emailValidateCode - }).then((result)=>{ - if(result){ - this.props.showNotification("邮箱地址绑定成功!"); - this.setState({ - updating:'' - }) - this.props.getBasicInfo(); - } - }).catch((error)=>{ - console.log(error); - }) - }else{ - this.props.showNotification("请输入正确的邮箱地址"); - } - } - }) - } - onPasswordSubmit = () => { - let {basicInfo}=this.props; - this.props.form.validateFieldsAndScroll((err, values) => { - if (!err) { - if(basicInfo&&basicInfo.has_password===true){ - if(values.p_old == values.p_new){ - this.props.showNotification("新密码不能与旧密码相同!"); - return; - } - } - - if(values.p_again != values.p_new){ - this.props.showNotification("两次输入的新密码必须一致!"); - return; - } - let {login}=this.props.current_user; - let url=`/users/accounts/${login}/password.json`; - let p_old=undefined; - if(basicInfo&&basicInfo.has_password===true){ - p_old=values.p_old - } - axios.put((url),{ - old_password:p_old, - password:values.p_new - }).then((result)=>{ - if(result){ - this.props.showNotification("密码更新成功!"); - this.setState({ - updating:'' - }) - this.props.getBasicInfo(); - } - }).catch((error)=>{ - console.log(error); - }) - } - }) - } - - //取消编辑 - hideUpdating=()=>{ - this.setState({ - updating:"" - }) - } - - // 修改密码-判断规则 - comfirmNewPassword=(rule,value,callback)=>{ - const { form } = this.props; - if (value != form.getFieldsValue().p_new) { - callback("两次输入的新密码必须一致!"); - }else { - callback(); - } - } - - InputNewPassword=(rule,value,callback)=>{ - const { form } = this.props; - if (!value) { - callback("请输入8-16位字符的新密码,区分大小写!"); - } else if (value.length<8 || value.length>16) { - callback("请输入8-16位字符的新密码,区分大小写!"); - } else { - callback(); - } - } - - render() { - let {basicInfo}=this.props; - const { getFieldDecorator } = this.props.form; - const { updating,seconds,secondsFlag } = this.state - - console.log(basicInfo&&basicInfo.has_password) - return ( -
    -
    - -
    安全设置
    -
    -
    -
    -
    -
    手机
    -
    - { - basicInfo && basicInfo.phone ? - { basicInfo.phone } - : - 未绑定 - } - {basicInfo.phone ? '仅自己可见,可用手机号码登录EduCoder' : '绑定手机号码,将获得500金币的奖励哟~,手机号码仅自己可见~'} -
    - { - updating != PHONE && -
    - this.setState({updating: PHONE})} - >{basicInfo && basicInfo.phone ? "更换" : "立即绑定" } -
    - } -
    - - { updating == PHONE && - - - {getFieldDecorator('phone', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: `请输入要${basicInfo.phone ? '更换' : '绑定'}的手机号码`, - }], - })( - - )} - - - - {getFieldDecorator('phoneValidateCode', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: '请输入手机获取的验证码', - }], - })( - - )} - - - -
    - - -
    -
    } -
    - -
    -
    -
    邮箱
    -
    - { - basicInfo && basicInfo.mail ? - { basicInfo.mail } - : - 未绑定 - } - 邮箱账号仅自己可见,可用于邮箱账号登录EduCoder -
    - { - updating != EMAIL && -
    - this.setState({updating: EMAIL})} - >{basicInfo && basicInfo.mail ?"更换":"立即绑定"} -
    - } -
    - - { updating == EMAIL && - - - {getFieldDecorator('email', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: basicInfo && basicInfo.mail ?'请输入要更换的新邮箱地址':'请输入邮箱地址', - }], - })( - - )} - - - - {getFieldDecorator('emailValidateCode', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: '请输入邮箱收到的验证码', - }], - })( - - )} - - - -
    - - -
    -
    } - -
    - - -
    -
    -
    密码
    -
    - ********** - 用于保护账户信息和登录安全 -
    - { - updating != PASSWORD && -
    - this.setState({updating: PASSWORD})} - >修改 -
    - } -
    - - { updating == PASSWORD && - - {basicInfo&&basicInfo.has_password===true? - {getFieldDecorator('p_old', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: '请设置8~16位密码,区分大小写', - }], - })( - - )} - :""} - - - {getFieldDecorator('p_new', { - rules: [{ - validator:this.InputNewPassword - }], - })( - - )} - - - - {getFieldDecorator('p_again', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: '请再次输入新密码', - },{ - validator:this.comfirmNewPassword - }], - })( - - )} - - -
    - - -
    -
    } -
    - -
    -
    -
    -
    * 我们确保你所提供的信息均处于严格保密状态,不会泄露
    -
    - ); - } -} -const WrappedAccountSecure = Form.create({ name: 'AccountSecure' })(AccountSecure); - -export default WrappedAccountSecure; diff --git a/public/react/src/modules/user/account/ChangeHeaderPicModal.js b/public/react/src/modules/user/account/ChangeHeaderPicModal.js deleted file mode 100644 index 0a2205261..000000000 --- a/public/react/src/modules/user/account/ChangeHeaderPicModal.js +++ /dev/null @@ -1,231 +0,0 @@ -import React, { Component } from "react"; -import { Spin } from "antd"; -import axios from 'axios' -import ModalWrapper from "../../courses/common/ModalWrapper" -import { Cropper, getUrl } from 'educoder' - -const imageId = 'changeHeaderPic' -const previewId = 'changeHeader_imagePreview' -let uploadedImageType; -let uploadedImageName; -let uploadedImageURL; -class ChangeHeaderPicModal extends Component{ - constructor(props){ - super(props); - this.state={ - uploading: false - } - } - init = () => { - var inputImage = document.getElementById('inputImage'); - const that = this; - inputImage.onchange = function () { - var files = this.files; - var file; - - // cropper && - if (files && files.length) { - file = files[0]; - - if (/^image\/\w+/.test(file.type)) { - if (file.size > 2 * 1024 * 1024) { - this.props.showNotification && this.props.showNotification("仅支持文件大小小于2M的文件") - return; - } - uploadedImageType = file.type; - uploadedImageName = file.name; - - if (uploadedImageURL) { - URL.revokeObjectURL(uploadedImageURL); - } - const image = document.getElementById( imageId ); - - // base64 - var reader = new FileReader(); - reader.readAsBinaryString(file); - - reader.onload = () => { - let base64_content = btoa(reader.result); - console.log(); - - image.src = `data:${file.type};base64,${base64_content}` // uploadedImageURL = URL.createObjectURL(file); - that.fileUploaded = true; - that.refs['cropper'].renew(image) - // cropper.destroy(); - // cropper = new Cropper(image, options); - inputImage.value = null; - }; - reader.onerror = function() { - console.log('there are some problems'); - }; - - - } else { - this.props.showNotification && this.props.showNotification("请选择一个图片格式的文件") - // window.alert('Please choose an image file.'); - } - } - }; - } - componentDidMount() { - } - setVisible = (visible) => { - - this.refs['modalWrapper'].setVisible(visible) - if (visible) { - this.fileUploaded = false; - - setTimeout(() => { - this.init() - }, 500) - } - } - - onSendOk = () => { - - - } - onOk = () => { - if (this.state.uploading == true) return; - if (this.fileUploaded != true) { - this.props.showNotification("请先上传图片") - return; - } - console.log(new Date().getTime()) - this.setState({ uploading: true }, () => { - window.setTimeout(() => { - console.log(new Date().getTime()) - this._onOk() - }, 10) - - }) - } - _onOk = () => { - - var img_lg = document.getElementById(previewId); - // https://github.com/niklasvh/html2canvas/issues/1908 - // 截图小的显示框内的内容 - window.html2canvas(img_lg).then((canvas) => { - var dataUrl = canvas.toDataURL("image/jpeg"); - console.log(dataUrl) - - const url = `/users/accounts/${this.props.userLogin}/avatar.json` - axios.put(url, { - image: dataUrl - }) - .then((response) => { - // {"status":0,"message":"success","avatar_url":"avatars/User/15739"} - if (response.data.status == 0) { - // this.props.getBasicInfo() - // https://www.trustie.net/issues/22461 - if ( this.props.current_user.image_url.indexOf('avatars/User/b') != -1 - || this.props.current_user.image_url.indexOf('avatars/User/g') != -1 ) { - window.setTimeout(() => { - this.doAfterUpdated() - }, 1000) - } else { - this.doAfterUpdated(); - } - this.setState({ uploading: false }) - } - }) - .catch(function (error) { - this.setState({ uploading: false }) - - console.log(error); - }); - }); - } - doAfterUpdated = () => { - this.props.fetchUser() - // 头像更新后会触发AccountPage的DidUpdate,然后会调用getBasicInfo - this.props.showNotification && this.props.showNotification("修改头像成功") - this.setVisible(false) - } - - render(){ - const { course_lists } = this.state - const { moduleName, current_user } = this.props - const userHeaderImgUrl = current_user ? `${getUrl()}/images/${current_user.image_url}` : '' - return( - this.setState({ uploading: false })} - > - -
    -
    - - 仅支持JPG、GIF、PNG,且文件小于2M -
    -
    -
    -
    - {userHeaderImgUrl && } -
    -
    头像预览
    -
    - -
    -
    -
    - ) - } -} - -export default ChangeHeaderPicModal; - - diff --git a/public/react/src/modules/user/account/common.css b/public/react/src/modules/user/account/common.css deleted file mode 100644 index 6039ffd26..000000000 --- a/public/react/src/modules/user/account/common.css +++ /dev/null @@ -1,119 +0,0 @@ -.basicForm { - background: #fff; - padding: 30px; - margin-bottom: 10px; - box-sizing: border-box; - width: 100%; - min-height: 390px; -} - .basicForm .title { - font-size: 16px; - padding-left: 30px; - margin-bottom: 10px; - } -.flexTable { - display: flex; - flex-direction: column; -} -.flexRow { - display: flex; -} - -.mb15{margin-bottom: 15px!important;} -/* BUTTOn */ -.ant-btn { - border-radius: 2px; -} -button.ant-btn.ant-btn-primary.grayBtn { - background: #CBCBCB; - border-color: #CBCBCB; -} -.borderBottom { - border-bottom: 1px solid #4CACFF; -} - -/* form ---------------- START */ -.formItemInline { - display: flex; -} -.formItemInline .ant-form-item-control-wrapper { - display: inline-block; -} -.hideRequireTag .ant-form-item-required:before{ - display: none; -} - - - /* .basicForm .ant-form-item-label { - width: 100px; - padding-right: 10px; - } - .basicForm .ant-form-item-label label { - color: #979797 - } */ - - -.courseNormalForm .ant-select-show-search { - height: 40px; -} -.courseNormalForm .ant-select-auto-complete.ant-select .ant-input { - height: 40px; -} -.courseNormalForm .ant-select-search__field__mirror { - height: 40px; -} -.courseNormalForm .ant-input-lg { - height: 40px; -} -.courseNormalForm .ant-select-selection--single { - height: 40px; -} -.courseNormalForm .ant-select-auto-complete.ant-select .ant-select-selection--single { - height: 40px -} -.courseNormalForm .ant-input-affix-wrapper { - height: 40px; -} -/* 职业 */ -.courseNormalForm .ant-select-selection-selected-value { - line-height: 38px -} -.courseNormalForm input { - height: 40px; -} -.autoModal .ant-modal-body{ - height: auto; - overflow-y: auto; -} - -@media screen and (max-height: 765px) { - .autoModal .ant-modal-body { - height: 670px; - overflow-y: auto; - } -} -@media screen and (max-height: 735px) { - .autoModal .ant-modal-body { - height: 600px; - overflow-y: auto; - } -} -@media screen and (max-height: 635px) { - .autoModal .ant-modal-body { - height: 500px; - overflow-y: auto; - } -} -@media screen and (max-height: 566px) { - .autoModal .ant-modal-body { - height: 465px; - overflow-y: auto; - } -} -@media screen and (max-height: 472px) { - .autoModal .ant-modal-body { - height: 360px; - overflow-y: auto; - } -} - diff --git a/public/react/src/modules/user/common.css b/public/react/src/modules/user/common.css deleted file mode 100644 index db37f3406..000000000 --- a/public/react/src/modules/user/common.css +++ /dev/null @@ -1,278 +0,0 @@ -/*.login_register_content, .login_register_content .ant-tabs-tabpane {*/ -/* !*display: flex;*!*/ -/* justify-content: center;*/ -/*}*/ -.login_register_content .ant-input { - background:rgb(244,244,244); -} -.login_register_content .loginInputzhucheyslass{ - border:1px solid red !important; -} -.login_register_content .loginInputzhucheyslass:hover{ - border:1px solid red !important; -} -.login_register_content { - width: 434px; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - border-radius:6px; - background: #fff; -} - .login_register_content .ant-tabs-ink-bar { - width: 21px !important; - left: 19px; - } - .login_register_content .ant-tabs { - width: 354px; - } - - .login_section { - width: 100%; - display:flex; - justify-content: center; - align-items: center; - flex-direction: column; - } -.login_sectionysl{ - width: 100%; - display:flex; - align-items: center; - flex-direction: column; -} - .loginInput { - width: 100%; - margin-bottom: 16px; - height: 45px; - } - - .educouddiv { - display: flex; - flex-direction: column; - } - - - .left_right { - width: 100%; - display: flex; - justify-content: space-between; - } - .login_btn { - width: 100%; - margin-top: 26px; - margin-bottom: 26px; - } - .dragValidator { - margin-bottom: 16px; - } - .ysldivhome1{ - display: flex; - flex-direction: row; - margin-left: 100px; - margin-right: 129px; - } - .ysldivhome2{ - width: 800px; - display: flex; - flex-flow: row wrap; - align-content:stretch; - } - .ysldivhomediv{ - width: 101px; - } - .ysldivhomediv1{ - width: 17%; - height: 100px; - border-radius:50%; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - background: #fff; - display: flex; - flex-direction:column; - margin-left: 6.5%; - margin-top: 1%; - } -.ysldivhomediv2{ - width: 17%; - height: 100px; - border-radius:50%; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - background: #fff; - display: flex; - flex-direction:column; - margin-left: 6.5%; - margin-top: 3%; -} - .ysldivhomedivtxt{ - width:86%; - height:27px; - margin-bottom: 5px; - font-size: 14px; - text-align: center; - - } - .ysldivhomedivimgsy{ - - } - .ysldivhomedivimg{ - width: 80%; - } - .ysllogin_register_contents{ - display: flex; - justify-content: center; - - } - .ysllogin_section { - display: flex; - align-items: center; - flex-direction: column; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - border-radius:6px; - background: #fff; - } - .yslspans1{ - text-align: center; - font-size: 13px; - color: #111C24; - } - .yslspans2{ - text-align: center; - font-size: 13px; - color: #05101A; - margin-top: 1%; - } - .yslspans3{ - text-align: center; - font-size: 12px; - color: #656565; - } - .yslbutton{ - width:255px; - height: 36px; - margin-top: 20px; - - } - .mt22{ - margin-top: 22px; - } - .gouxuanimg{ - margin-right: 10px; - margin-bottom: 2px; - } - .textall{ - text-align: center; - font-size: 13px; - color: #4B4B4B; - } - .div1img{ - display: flex; - justify-content:center; - width: 42%; - margin-left: 30%; - - } -.yslgouxuanimg{ - width: 20%; - height: 20px; - margin-left: 86%; - float: right; -} -.yslgouxuanimg2{ - height: 20px; -} - -.yslbutondls{ - display: flex; - flex-direction:row; -} -。yslinpulsy input{ - -} -.loginInputzhuche{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - -} -.loginInputzhucheyslass { - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - -} -.loginInputzhucheyslass .ant-input{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - position: relative; - right: 5px; - width: 103%; - border: 1px solid #FF0000!important; - border-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; -} -.loginInputzhucheyslass .ant-input:hover{ - border: 1px solid #FF0000!important; - -} -.loginInputzhuche .ant-input{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - position: relative; - right: 5px; - width: 103%; -} - -.loginInputzhucheysl{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - border-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - -} -.loginInputzhucheysl .ant-input{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - position: relative; - right: 5px; - width: 103%; - border: 1px solid #FF0000!important; - border-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; -} -.loginInputzhucheysl .ant-input:hover{ - border: 1px solid #FF0000!important; -} - -.bth100{ - width: 100px; - margin: 0 auto; -} -.ant-input-affix-wrapper .ant-input-prefix, .ant-input-affix-wrapper .ant-input-suffix { - background: transparent !important; -} - -.startlogin{ - color:#888; -} -.weixinheight390{ - height: 390px; -} -#log_reg_content { - padding: 38px 30px 20px !important; -} \ No newline at end of file diff --git a/public/react/src/modules/user/commontwo.css b/public/react/src/modules/user/commontwo.css deleted file mode 100644 index c5acd81ff..000000000 --- a/public/react/src/modules/user/commontwo.css +++ /dev/null @@ -1,288 +0,0 @@ -/*.login_register_content, .login_register_content .ant-tabs-tabpane {*/ -/* !*display: flex;*!*/ -/* justify-content: center;*/ -/*}*/ -.login_register_content .ant-input { - background:rgb(244,244,244); -} -.login_register_content .loginInputzhucheyslass{ - border:1px solid red !important; -} -.login_register_content .loginInputzhucheyslass:hover{ - border:1px solid red !important; -} -.login_register_content { - width: 434px; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - border-radius:6px; - background: #fff; -} -.login_register_content .ant-tabs-ink-bar { - width: 21px !important; - left: 19px; -} -.login_register_content .ant-tabs { - width: 354px; -} - -.login_section { - width: 100%; - display:flex; - justify-content: center; - align-items: center; - flex-direction: column; -} -.login_sectionysl{ - width: 100%; - display:flex; - align-items: center; - flex-direction: column; -} -.loginInput { - width: 100%; - margin-bottom: 16px; - height: 45px; -} - -.educouddiv { - display: flex; - flex-direction: column; -} - - -.left_right { - width: 100%; - display: flex; - justify-content: space-between; -} -.login_btn { - width: 100%; - margin-top: 26px; - margin-bottom: 20px; -} -.dragValidator { - margin-bottom: 16px; -} -.ysldivhome12{ - display: flex; - flex-direction: row; - margin-left: 100px; - margin-right: 129px; - margin-top: 10px; -} -.ysldivhome22{ - width: 800px; - display: flex; - flex-flow: row wrap; - align-content:stretch; -} -.ysldivhomediv222{ - width: 101px; - height: 130px; - -} -.ysldivhomediv12{ - width: 110px; - height: 110px; - border-radius:50%; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - background: #fff; - display: flex; - flex-direction:column; - margin-left: 73px; - margin-top: 5px; -} -.ysldivhomediv22{ - width: 110px; - height: 110px; - border-radius:50%; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - background: #fff; - display: flex; - flex-direction:column; - margin-left: 73px; - margin-top: 15px; -} -.ysldivhomedivtxt2{ - width:101px; - height:27px; - margin-bottom: 5px; - font-size: 14px; - text-align: center; - -} -.ysldivhomedivimg2{ - width: 90px; - height: 90px; -} -.ysllogin_register_contents2{ - display: flex; - justify-content: center; - box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); - border-radius:6px; - background: #fff; -} -.ysllogin_section2 { - width:800px; - height: 600px; - display: flex; - align-items: center; - flex-direction: column; -} -.yslspans12{ - text-align: center; - font-size: 16px; - color: #111C24; -} -.yslspans22{ - text-align: center; - font-size: 15px; - color: #05101A; -} -.yslspans32{ - text-align: center; - font-size: 13px; - color: #656565; -} -.yslbutton2{ - width:255px; - height: 36px; - margin-top: 20px; - -} -.mt22{ - margin-top: 22px; -} -.gouxuanimg2{ - margin-right: 10px; - margin-bottom: 2px; -} -.textall2{ - text-align: center; - font-size: 13px; - color: #4B4B4B; -} -.div1img2{ - display: flex; - justify-content:center; - width: 60px; - margin-left: 26px; - -} -.div1img2xx{ - width: 20px; - margin-left: 26px; - -} -.yslgouxuanimg22x{ - width: 20px; - height: 20px; - margin-left: 75px; - -} -.yslgouxuanimg2x{ - height: 20px; - width: 20px; - margin-left: 75px; -} - -.yslbutondls{ - display: flex; - flex-direction:row; -} -。yslinpulsy input{ - -} -.loginInputzhuche{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - -} -.loginInputzhucheyslass { - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - -} -.loginInputzhucheyslass .ant-input{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - position: relative; - right: 5px; - width: 103%; - border: 1px solid #FF0000!important; - border-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; -} -.loginInputzhucheyslass .ant-input:hover{ - border: 1px solid #FF0000!important; - -} -.loginInputzhuche .ant-input{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - position: relative; - right: 5px; - width: 103%; -} - -.loginInputzhucheysl{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - border-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - -} -.loginInputzhucheysl .ant-input{ - width: 100%; - background-color: #fff!important; - height: 45px !important; - padding: 5px; - position: relative; - right: 5px; - width: 103%; - border: 1px solid #FF0000!important; - border-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; -} -.loginInputzhucheysl .ant-input:hover{ - border: 1px solid #FF0000!important; -} - -.bth100{ - width: 100px; - margin: 0 auto; -} -.ysllw100{ - width: 100%; -} - -.textcenter{ - text-align: center; -} - -.weixinregister{ - width: 434px; - border-radius: 6px; - background: #fff; - display: flex; - justify-content: center; -} \ No newline at end of file diff --git a/public/react/src/modules/user/img/WeChat.png b/public/react/src/modules/user/img/WeChat.png deleted file mode 100644 index afadeb36f4a738ef40f349990f4dbf3e8b0b0890..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2844 zcmV+%3*+>OP)@O!8OLjM@)l_kC^^J?H^6mq)8wC zqt)7KQ=`!)4J(a?CZxU!1}&%*6NRF%xC_X#EbeP|XXZXnbMDR^?#|xXU94^5CS)>q z?#%uCe&_ppoZmt475yoNn9ffLftt>JQ{6MIho${U67*3JD>@Lg!~X4v<4uUwl`ri9 z<`+;au0qiP``b|ua~l538gjnM6Vqg!lCySVsK{T0&1`{#RJKp;(b5Wx{s^Fvg z9aL)>)v}s!Kc|g2Qv;?Ao&;t)vb71(Q^06#Le9u@ZYIaoD6W)(3lOvkXp#b?prGIw z@Ckx<9fvpj207eQAZ%?S=qaGMiZEV<=^8L4cp9)>z$mm~pDo#7DmDti<$w@^$kqB) zL+iizHM*uhlPCeZ{g7un9kw(b!*#!e0h5Bq(6@9T?`=nXbO^&KV$RERwFQp}I6nqW zLhEbefa@FasT;8A-vhjv$>Xm&kKpMJ)aG_VZS-W`uL~YScYxG79(6IzERC}p`L%$% z#(B8nV0<3vjqpOplY!A}5BgC;|3)?}N2 zWwnxs-%lxx%9E;EPpm?041$BB0qakmq-QGlRB)~7b>~L0WXTLomccgQ()ghj{Y61o ztMQ}(Rk_qa#zC9*eFS??Ijk@AQvkd-4ijq4*Xn&7xc0Wr&))&L_n%k|Hnx%H38}cV zUJ$0OKrE5?vsmNN^%PIn%123F=sM1Wqb}~HYw&h3mM)X<6T!D*%xc3Z^982_|-Ug;3R7ugJQFX z+q0S=>Gi6|Bk=7Qi@@w{A~VD0RtbMd7L%kW$5NTW1ugfoyyeF<+Dj(1Gy~3FJ{kBG zpBFcuj)h99j2tkTYy|l5qmNGTm$?O;Zt#;{kHBlaowLarUX(>Ht6lck!&&nz*0pVA zPJYc)jT}cuHuJ&BJ5iLUrSWQ(f%gxMu)gF{uJw8qTo;=C+p%V~VOyhIh+tRbl$10k zg~<&|b}}cYD?PZu5K>r}GG8^q4F)ho4nt<6Yu$yH_~7L2shKD(yHr+M4Y^!#BH%#( zG29hb;pyD2wO$2(b`Pdbf1^3F8IO&?FY6VWm9y?+&HSe#piud|d}slU))KB?yeqoq zhecjJynvSMYQEd{M%9=d$FJs8>8&yNDP$6RJqY>frz8Bap+s4y$BnD;tKg3)B>OPu zfE~Exgy2~rxT#jt@%!&DeUCZ0%OW796mNfiD-G5{zBTu;iZKB@k8hwQa|x?vKU!Ut z!^6+;asNZ(^vRsIKhGgS3_GA$;a2YlQ$%r!xV zBH+y1i{GvbQUnfivy_pzt%ZU&wA>dGcc1cHIXMK1D76lcz)+_1Q!^EeHzI1lUCQF3Mjc@@wpz)nQ> zSi@BLcip0`ENZ^7E_m0l?!^KYH{Uv`aY0yO=ZW=vQQk2DKGDy+or5g(M=7?QLuvmZ zyeKVd@O$=Pt_I5s$oU2hN^(#t?0V7O)_4s!EcyHCl#{>XY-8s9XVm0b@^V-p6D7Yc%=?LZKvv8x#k_H|+ zY!iwVO6yp1)j zPfQD3e}8M&IRt9tG<0HheZj*ghIuYEIBU}(4i`EuZ^R{klI>P%F)@V2jZ5C%<*&k7&bBXRT-&Fcz3=gMMup|}q3=FE>hw9(U8ZBha*%Z8kHEk#;4mvSu)vbI^PW{>ebNi~mGwr=+f7I@3ZGOA@#x2@Hi|C9pcT9t_hV}!>%E!qExYHiN#o+o? zw*m2_R>Nl{w&Rf%c{0)`t3q;q$hBceyMR^kuqtg}6i*5&Sw)Z1K2m}X*XK1MDTO9w zRm90yl*=KmhCbt=XFYgboM^%dOJqutjPS?^8_QN$UdX~AKo3|h5rW0KU~q% zvZIt*cwJfJ(>8s0b!rwyCXeCkBNhk4urWdtsT^eJA$>UpZiXmn5sD0<^a%r(z|Rnv zHoj9NnB7nCl^0000%fnzNW*vjs*fIo6j2-L{%a$d}ddt#`H1Fx|dfdC`R@be$RbAcF zlE#MQFt$#=s;aBM``z#V{r~sYEy2&(pHhgWJS8DeOL@GLJ=T)`xZ^#U#lXGs#uWT5 z3rDt|CU4$oe`)$+%a-mS|12BfSp~cszzMip(EoGmtrp8S!?vxxv3}E)C~jS7fz6vy zNgLb<-5TN9Y=CD4@G_uF0ZzfaLW6WAJn_&1(1-dEn>uu%ZNS>b0;@M(gkme)2iT3U zSOYv8z(1pacLI9LmXyU7z)uXdz#ZvpJw9D+Jr37c^*}QEOp;@d!Hq6xkYj7v3i1nwz#9;*Mpf-k> zaq~dWPPSeT4(GLcC`Q#sQ5=Mk)u{dZV5EuCji4LA^n?ujF;q9!KNG+&Dd44y24QqL z0Xmfm&Ey1R522YmP(jrE7P!l+I5oxdsqj2su|YX(5O4;PWjG89l79%nEHEns(+c(o z#f}JesEB`?iFtUciA)+HM9l>#-4kY_7WkU^T6*r=3Y#q8x6mGNmlF6T1H6pYMmlVu zn@4ci0MQtZ0r}7j&KWCN>-qee<8g(MTm~!`*4dfoDbP8}C!eXL0g`{opJED!e?oCz zJ>c(m9OBU0A*2D{8%44Ms;iJ~z?VqPQh|QbfOnFQO}8S7Ko8Ygk}+^5B07dM;?w6l z{5lSAb_CjEI0FebE^jFwDB554mYKHX-J>YPx_{@037p7;KnU7KK98xnrlbRXS*p;Zwv}|Qj zW=;n569(J{+XO|M)%QJ$v!aSfq$6dt7{VV3_+1Cy53Dc@wLvZg-v%{(t_l)jeu&*r zx#OlUvhNfelY*Ofg?vuU5E{m7;Ey#?SDcSD`d-HN69xT*055`VYxUZc)pKJw!4OW= zhZE1@j0|(B?{YJWO-5@CXqt(RlQJ@;vH{+fkxr~H%8%U>+TwuSP^})Ytse0HJ%{!BG`7E}w`ej=bBH{hjUTN2V-j$>FoxeIrAlwOK7 zNmnPm+14DhZNGHeLS2E!yH)UD^PW$w0|xC9Y$^ffxWS z@G_9CVA-bmB@JuZAbE6nct-M${rh=pxJKN!0{L`fL1M;8b^Rnj?-}rJV2?eDV@rtF z!0jL83gPg-wRg6IS{cat^GuTqT5HRNVW@r5nX4($^kO{dsPA^e38o{(TlXH~zNnAb zmYC7=ktYj!Pk{Fd_GANhcr8vfFjRMYt=(mfU=ESf_F@kyx*3bv zw%f5Ay3j*{7~Zp|!EKX=ki&h%M%Pak^hE(*6zl<<;3$qah&x@!9j@^XPb9%nhrwKe zl7W=!ch53VOlmCcFLNikKv|~wb_3{hG4|1JIDw2M?|*EJzg<=%j%JA~E0F_p$dduR zXTY`fOWcSKkRWUsF<_6>c&&h2k_4t0)Y5L7FxPx$fGk?QZhD_Gzvx~JTf4d%TiR>v7zL<0A3V4p)AhgdO9Yx$XigQM4`!Z%%xzd5JA*f_0 zY+OL$TkI4(r^nr-#$swN=vuvHv0z-3lVT6luUkx6C=~!f81u&MN7-tFzGoD9#TasI z45fX#og8%oy(8ddVCz&}`)qCfs#CaHvnvC*%d4Cv1osNXvZ5QwGQJKOp)CnzQqYO9 z_V<*wgo(Z^W?*zMoIbyBp&E>?}G8&)WE9i>?ZlvVK ztvCj3ZT-fkaJ?FCPdQ>MKT~4emqXB)(l}Nk3-ihUx>?)KXGihO4v4Z~(6&`F)|dF$2Sj z>~;f~lg}K0^@jOD#bDW1Zf!3({} zdYuM21 z<)yU3*um;XlJ`D2&evl>Xjq=p@)E~V#_+r|(b_$Sm#|ynR~27FaYc~@Wx80}#RaS% z{8g@Ae;bbQmjrBckeOgR-#_#U>hbR6t+MYg8#QVRqQ(H(ECmUT|U;XzZJ%2-|StexC~{<5`$FX!6z-@2swH=5uhNo|qjha{85ng-FHu}9aZD1><7^~k;pLa^)P&)ld z6*1npp8@Z52K+NhH`_mZ8~=Rd`rKTV(g6# z66!Lpsk4k+gtW6y4SLdGR=`Z;1YHdrz;UN>bqYTNz6*X|h5w}_FYjsWuz2FYW$SKX z}jE(zRdY?B#DSZIpZWU(1okJqUa*U-x&c8+cXe@$Nf#4deBD zlB~C_eq)_mS{&*Sjo;f6ANIQ780eO{&R%o3qgRyJ==vd<*z%ouL;d*ZAGIcY|C{X?x_=|xZ??&txvzn=o?Y@VmKW&0n=`8_HS!e%I-Qaw6I8{1qSNf|a=` z`MG`W+0{Dx9|(rWDFl*^)i2D)XZUU}wsId$;bj@mrce4Iy*eTqJJ6&I}hFups~ zfw>Q|WAd{M`e*apkq@*5-)4M_W_*NZJjUY_H*vWB?d&+YQbG@Pm~Ou>pVUG9kdrm$h0J|f-s(1AaRgC(;7r^#}Ojp|^5M?S)*h@=qA5^xkvo(LuIPew-(#KZCBE=4$CyBb1Uy zpR6_TZF+`sczpK+*Hs`81s%WOoK|fm2Y6e+OtVWT!WVIi;UeS*La{zKMXjX!IJaFVUX~qXKws*=eiY~{F zQK`=Fe`1=KCJc88rAKIIog;SO)C^Am-_lBW?0^aQ^tS+)4Su4_vGy-4t!I~5Ful*^ z>pst>mA`Ys0O=j~&D_ELPrs9E*5Ad-+QlbzEWPt=xQp){yn=?*7ZSDp>`b!Ld~`ct zCg3|v?3&>P8gS+bF@D?*oHw>cf)baa2OCHSi7P8{=jZTDu}Xj+2`WOdU8FOq?C706 z?=Yv&Fn)FI5`O)h`%f68dh|4R?0OzouKy;h`;+V3mgH|bc$|9Wlwz-SB`Hi-e zq%C8~PVmH0&h-?5Vj*z$4-f@MTh&9ZMCz#&IlxVZX#?&%R5ajm%;P93WkoB)j0D`0 zfd$hjuRrHuR@Rci{p0@Iy8jK-yw$vT&8OS;{nzmu**AMT8-{;}jl;j&_WADVFSC8} zQ>^a4mgk@HskYCzPkxerJNCi$Q6$6qlHtKZnKyW9lJhj+p(HR)MFVa!&Qic_OQu^9i0m`hnij2L5&Y&pF!oF;}f`PvaZWIJfUQBLP&G4_e@OkwaPcY!87k*l2@yPfevUB<`ODl}Fgtk=?ny4!a$>CE%ruej5b4UH z?Zr)|*%k0a!vp>S!MWxfyUt#8CC}FF*5}oVn~j^$hww`(DqwfonK#MY~++ zgB)!<#KF1maK_N}EURRvm>qvM+|AyZuP|DB8KbqAmVWP{xjXsc;a@HH=9aXWoo#7F zv3=(ZuhI-(GQgdXzgBRK(d*n7mn0FL3P!CHb-Dc1&+*(9zugn)ckFs0FBtt3P8)i4 zPuri!MtY3&yZe8sEgLnmksPyA8CUR+JEwT}k^!zIC5ZWmki5$PZge_VIV>`}WUSEM z|Ju{O#@WMfSQMYzc5dP&Yd_1{fvXnX_CzRD2ZE$kXJBi<|(f0olTgI>Wh*~w3?{$M3Sde_TN{S41r`TL7vbmvo7vT@`FHVnUQ z(QQw3gTwRR<$H&&Yaf;?$v%s{H$^ce902#0#Y4o4It}s<;(v6Q*HI zB9Tj#(*}Cu#%+xBJvYJVSmROl&HMuc{;90$e+kPf&&jZR;OP&bki2-!%_oZIqWkTb z{O|l^{6Du%)3bY|acJ3PFzN4agj_#X=O@Q)3-#>SPKi&|p;`}l0M)u?CzrxoKc~zR z7Q3Vdzu#ZO+czDe8Bg)x;VnFR^s_*e9oKUPsd=YRbyg6_38ZT9#*O<*2QU^zvxg17 zv-br|1rN6aUX(?n<)*g^rVmc>qNb$Td*ahWYVSd1Zl1qFaaA_BS{OMgYlNb_80Kpr zFI@Fu9v=H7jrd6EAVDTy>Fm6#)_<9^hkv67_>OOrBlYid?}3*s45V1)=f&o?E5SWu zb>0)vawxr}_USCyY_zAOc;yQ!L7f|7#fLk|h5deU6vzgztS+7Fx+U{i^yf8ilYxARv+TSKKsZ5oXe@$cP$F&15<5$kO3(x8A1<$VA=q&X9r+<^Z zGhZ!T6rtE-OUfE@I^wG7CI?&ydM?jqfTshGq>_X$q<%Z&@cO8ZL(zbj8(NuxZsrk!ur8i9oG=v zBja0m^w`H10ADO=E6mIV#;0bvuIV$QnuJM}(4L#pX%Ja|V>Sq}3DIeqgs&Oyv{)Xs zGR{9NUV+f{8cDmjZ?mcxsESulbedCANJtz}Wp)3htmyk?`n*;2xhv2CQIFnFG#_EC z{v&GcDlS^}2~HdOH4e|;$N$@RWqY7386>wG-1LT6@fU}txka}jppr>gP2JoVe zn=2m7L?C}It&2m&cUd-H=WZ0kofz3B8yy&wb>YJN?wsa#x0#cS`+GXCZ0k~5fux7X>>#Y=`vU%C9p52x?8W2kCVRnuRVz_y{$roMG0(-te zctTU%Y#lF~%&8}IY8~%W_{ya=U*}e(IL8LPtpU;zprXI+1ahu%%BG}Qpk&PJqQAxS zDGTt$?_A{Ec8)jMEMn>nL8t-O6FHA-GG|f8i}MT3bmd?!SslXHIxc+tIOIi9#21r= zXWD~G&fD5{uk5+apt9_=EO3^2`CeQ{uisz%O^!e{6*o)3yrSQ#KVuIb9Q zjvITJUE*Dskgr+p=^;0gYwG=GlaENno6HX_wQ|LZThaP0<`5Q{j9KcCN`i4Q`O1K| z4v_1umK#bj`s&dpH|bG%t=&<|?h~GnuMfJ|B`2EU$-gST)^effZ#4LlQVZ8>=DK9b zQXPpDbkOD;lgq|W(+x@%A;{H2>{TnuVn{KIEcM;_3#uMFs(71I<$~3&g zq|%~Hbqes=xuj2u4oOd82}0h|hB!_sV`kR_~bLCkV8ZC99;08p&gn4Y2^JFOsOYjH2GD(hvfa|@e- zKWH?$UxQ3Q7*+}NsC>Umc*2(r<^WF@qsd+NZCw~!i|{nC4TWE;;s-JbpcSe3l{n_6 zY&D>iDz1pDqrMGQP$D(X5jkh(rIGEA`TgEXTIo9Mmu1`>L2=*P;%{7hbj8&wxCy>pksoc zwTx=lQi0WjijG7$$Vl?>nI_*z=9yShQqxyCctj_C>36}ckdrc|6@zWJ@^8n6DmaTWImwN_muInIEZH&(-xe{Eb|oqx zl=`uMK}wcnaf70?bX&edGdha#47;U|zMME=dL!hLSg)mG1yT$9w%U2lwOCSQ)?&zM zwPA4C;$R($W5p>BZ7yX2_}M`6p&;f*n%Np`CnPc~_uSU=C0o9u$a0f?nuW!R3)FJhEy?Lo#D7zY^NO_)}KmO@p0BXIc3K+@1MV!#dpA{``~ zE|I5oyF#?&OE8tPJY5gGY>_d)54Q-qj9c=eB%W|_!-xyxh!3JT+XkvFSaq0Ro&aMT zLh+<}}}pm$nEFOKoNDz0XF zA}@7(t?5$XNr~sU=sP)7qXuu1ink$HUX}qC8>3hnEy_q+piS*$&Tkh>3oWpxq~uF= z!BWLQ0}t6qF*jaq;h3lhZ!Y!LqB^`Rd{KZ1S@t^@N5<^{|nI4A`B^zCI_!44(Z9!sR2l&FCg zvh`28EufRS@(m?C?(O`Q> z4YU^%hZ5<##4;k*4WL=w7ZMu@ahu4W`GW0>f}Y;hr0tdjeK>P9+yM`#9;Bd0xXQx` zJlv{_6YAFyj_qnh-=)dA3LOK`JjpCtP)dD_NsH&H&jI1=1!?*>w z?-4g+WF;aN5mI_Buxl0Kxd=H>C!TB|e{OC`&=qvcr|VnE6mPnr**;XknQ!7sA4juY zxi}i|K+8&q4^2jFx#uN*d0q$q);^ttZsk^=~R%72q~&a&1g45CO{9i!2Y?u ztxOr{Nigm4#z_WvRl$*UoXT>9Y~X0ddk#W3f(BcI9%|5=h)9Q1odTw8H|OA|?Dixo zuA=-DYz?{wH`0$W(&0*M-~Ap?C!ssQN?CQMiVE^iHHckh$E`CZLJ zR6WGJi>SH?-2e>@{v4v2f~^~(Oj0zk`u(Z~c>vWXQ5xW8jOy2q5vm@c{zKgSt{dn% znJL^1uiNb%HS_26Ju_EAb*j|}37{PS*TCw}6L6QKI0^&9D9z;mu(x+yjP3UQj(>3j z)3ScL1n-sJ(A3mp^o^!}af{w1K)K`)oq%t<%l9vCLcO#NPzJpDhF{!feQB{SJzBR0 zNCK|5nEFrOR5|^#o+j_)RxM0lbi0SW-e<9!8$FXhz0_tslV7;lu@`HE#r7|L{<8$P b>|FmpMnghXpGokM00000NkvXXu0mjfCLIkn diff --git a/public/react/src/modules/user/img/gouxuan.png b/public/react/src/modules/user/img/gouxuan.png deleted file mode 100644 index 7d8b0ab6503313d05ee5ad54b177fb324c1972e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 462 zcmV;<0WtoGP)F%_i z*V066;@oFD8rAIB=2p#Ocv}@C^rb)zB9+b zfe7=VBvqbhaXMJCC)NMofKJuS3s(s1jhs-@QHQOv+Hb)AokMc72+9SFaQ7m07*qoM6N<$ Ef`N(BO8@`> diff --git a/public/react/src/modules/user/img/hdkf.png b/public/react/src/modules/user/img/hdkf.png deleted file mode 100755 index a1dd25d53703fbeba60e69460ee528f05ac5d31d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2940 zcmV-?3xo8DP)20rPXU=WD*Sz0l=9@XQ%PdZsNcJ>M zPiMaQX6E_c_j#W8{f>jhPbvb=A};9&ECMq}WGn)+2+YDrV=-d>mxvj9jQZS8@2w*RbsYM8cKp=pE%YR*fAto&B_`(+P{f#Doi2j3shB{i!C)cf8F_UGYOc67Dp!U7m zbmPZp(npCT1Spk&j*^2$lhADP%>l<*`0*?cnZp<&fwvLRru9Es`bd`fG66HRd**M= znz$MQ5Cn8~0yo~!iB(q>@zy_E_}!^Gd><&6vmdY50S>fF_2Gqspuexbd+9Y<9>4=UaH0W&h`5fCBm03AgKrILeYlh9}}!|{C; z?-=fBG!-GM;}Ivx1)ycGUSzeVN!|{KTCom7}oblkOh~W?Cs}Q6J*9Bb1F`^`o zb5ywwb4c`7@;CuZE2-SV0BRiDUQ?fo9go&RVjn)3R7Wk5_62H?zy9u}`9;h_CmJ4z z%KQWjh9olmSA8dth@MR$7mXu%5#$*2Jvy(hjm^XV=RZ6rIUq*V%pa%)G4q*w$F5gI z8$PSNr@DuK|4%Q=513uQZFvw>4sV_Sr40oAqFM>&ei8lf2ozvyJOgMzQQsp_^$W`} z(Spe9G+_2|^;{P4g8TA zKsFHSo^h~2$QPKMW6gLfv7gag60WiVB@AN~zRW+8I|4#0FdM*(n{0}RiE z52Bc^)g<^0K(v%yE_XO^9YW9oyc+*YlBD^#0cqCP$9a60BgvY9o1G;&kKws6BIXAo zmU0|14{pp8m|r(kD)A}?KxdKgiK_~@`f?Y=6!$7&Az*5jaPrLt-Z?8!>2`4Ijh*N% z12Z1s=x^${I4RIyaj@odUFhw0P@N?__o|Nz;{yFl9Nc+xH+p*<%v1#qzu;qHGC+Zm zG~8ivQX3B?Q&wH$Z`iydKaNqVq#}l+ps&lpZL5n|-Z#I=s5c3(ztO}W{~DmL41E3O zF7%ciR6T)xFV=AGqQHu!F1~qdSpqXNOW6DDEY4mK80dHLtvkEX*Xv4P_8h26z)A(J zQlZLO3dGT4^NLYRon{;{8;0`)=D3a+Qfbgxgp8PLRyrv1gU(?6 zH+7&-190TEx-27>RUF*@`6yxzAM-J;Bj%1<%IND+z&!K3hlxp{BPOOaN|tRBP7<%h zF+*E&1ZKx^<`|Nx#Omn~w;Bi?vfIEMW97c(Rk*II)tN*|R^H{3s=!46c$!N%=DIuO zEb{oQ$7IY#kWl91JietkhL1a18RwGaHZ`(54M)t-);xiEwXVol6CEoOKV++Ae1c`@ z68X<$Yx17~;+N+Szc`;__2GGB3b2ZCe@7cv23Gcd7!X-mFj+hLI+AH^0AiOdZ)KUw zwkRUEQ%QR9b6E8@*_p88gx+L<(;FJ zX*-ct4<)Xx*9oW2G;sRQ4R{`*e~F8=w{@eJNq9!!sl!#AKQFMn-^E>Pd(qeDV0v2M z;DIV8#)I&AV&=}`m`&UB1m>l>mTN+@1ysro)_kUf6_p%IU#sBz%UewxJ?3L_QefaR z7vKIyFDiX5re_3p@0rHC?+UCOaPi&mR8Xn75}1c~P2v2x0HvZ*t;l#Ru!;n&{ZlCR<|kglp#v&vbx?N{Qh(UXWnSQpA}fP)WzD{d(hXX zBIe0MRh&PkBj&3;5}2tefrI;JFflGrVC!sZHKSCK1NJvRlqWF1sws|PU|5xe<`~10 zcI7N9<3x_j%2*SnRoIzQK{;o=(t_Z7Dl)l@kQ`HH2dqfAT4e%P$J;q3Qmr-}uE0ZJpJ8B$9sH~af zy>u@}U*BqqFlCe~*)55b_5{Hn-jyRT+m6<>^VPJ~&r?m*em$rK_ z{9PBMtWxZ}<+!v(F-^2Y#cdUy{_rC?0yFYUju-_Ddj&2DR$o`dsw)d9hRbNl$^r@3 zP`37hc0)2${Hdt`$4~h9$J?#2d6nvN?fR&#lL&vyqj>`J9FwnVZ8lp1m9mRFKHDJ+ zz)SUMGzep3K2Dyjp-~gk0na1L@m6WrjwOG~?v?qG@78B)TCSraa`nfGxb{N@6lG^A z>SD+I+MLF3eua(BB8<{9P~q2yZEOC^Wo z_KD(!NQ$${a(In(z1<^@8#Hcr2nJ{Ih988 z1ZMatzl~!)b$t=neYhC5HW$Jz;n*Yx&2>VpMXFl0kv|JWlW^u#9b+%g!kbmiE!~&) zM;^Z-Kk^+u$PuGbiPNXjl-CfH}rhKN4b7Hs?l{EDWQ1Mz5MxTiGRr2F|XxBoH>aCpgFE86(TO zMOyO-jhZT3lslJG`P-hzF=96DQ^17##JW~u7aVS>8h~QEf7Ui?a!b`xskF|1s9MIo zCbvusDB;5BdufG|s-%liYxmUO_KQ4$dBO`hCT*kZy{hGyKgqhK8ZZ7Lmut5z6EYp! zjI)6=;|Tufz8rxW+FSJ@&}BeL1;X+WM!ws6uQ7j;*jt{zi9J`ftXmj~9m;f2IHdg1 zeS`U_(#FSU#z{EKV*Vrzh_s(`ENpMNeSat=a^jJZ{K<(Xl&}=g+MrZvVs!ste-?$y z)U@63SoH+}UxJ`g7zMWDwMv4purr%p3)@?MkHRn=gouw4plHR@9;QhGuWUa!_~jgd znY{&pxK9v1?hrcK%78TDwZSqQa%sP7NwfFK$V=<9B+|t+t3q24@e1c`gUET49Os@L z`>%K@H(>6)mpV#=(_e5!;rk?ln~2ZrnEwJLe)Zj+g~_-80000Pe!t(38Mdy)VzEhMnpGXf@VlxS&!lykS-gU| zs+JXS_n|fIXJjQ1voHP)cy`G{;Hh$|t?VXKI_|y}k&&uS+W^gM=F4@tEP)>1m-9ZqbMBo?hDkD$1QnUvjx%KLoO|y% z-~0W2f6F<*^Qs0yuI2ho&%`JFNtdtqsGnIefZ;r0JkEq+{Bs3X}wWNSd8Y4Vj%6 zVdFo~o6254RzXq#M-Jd|56JNJPZLC-q z#w%Oe;nSHAr?$;8dT24m4lRYlkI*9t01w!}PcN9v8jlr_9QWXO@-6-lfPVu(gSL46 z6Zn-UCV_$O;MLrct%f_HmKc7G^06cBVaJWBqIhFV?u2y05x@tv=(1>b2hK$ew3rX=Wz{=uRO|^ z09a&G$ch2ehX5nXC5w0)MMDV~Q)_|R^4tf6^v5e(+wsKfVZ=-ahAO-Iq+z8PUR4a! z&eHW9kK4cv7ffN>azE11+p_=;V3F6o1d1X9IHd-t3<8O?gd2&=vLG;h7*HO}eLyI9 z_S~j6{AEKcIOk9p;L}y1M=DDL+4M*f91lXpe=n$G4Y?nw|M&b@fa5c_*M~~mtIS6i zvt<8YV%IHt%#pbVfnrDzaLQ1?r$IzP$z7#zIRR++0HCfK@awssZ6t2vnGLOYep4HC zm5ES%MX@1367(5I>Jgv?z}@iSt_9;*Tkc2dzdb)kBD$QnV(^m zl+-H&W2(?OX-PdYcL%tQTN-RUc=Zfs=6am|*e{RE>W{;9ZsY7*+p7bLIu#5_#=)Ve zQR7wZwMQTQaNN7@z>(4%4nT5YdNnYjOqv>RBSs16z_ek&;GBIL`RfB=6U$z0#@l;h z!c8WVGhQV1N?_ScfG=a);xOFsFO%4c{vV0#EqJb~Yx3nWCf~ zh2klxmnDcsjsMf;_}&Fm*sA=Fl>gozDLCf+g8K$q)+rW461LMEDK_>zef5V|6Oj)% zysnK~KurlSYbao-fayrrm-GlR$*4in+)&;npKa5=n23?ow^*Xxl3>?KJ-6MbYzyDJ zU^?5J&vEkE_ag-do#<6palLsmeB~Mv4_^J@+SJ~FgU(sRKpbE~B`|SNhX$eVNT-k) znp`7=YrflSJKC}QwPv)$9B2whbwyB=2V_m^0i;2GW10BT7iO>n`5vpM{XcSW^mKwp z^ZVX{!#gJef~Ei`R|6-McGe?g5=sKn^&Jq(?<%M);Kj`mJh?86xXA?zjjk@n*qYL8 zMMl(k8#wMsSh(||8H~J~e%T7(NQ-mywnqsFrGBYL%F^@*2`BoFf@hP50s$kxBgB&q zR=(Yem2bDfb{qr@RV4Ll24+p_kp^lwd>G@doXf)b9Vz?X1#t8OIH+qqAPg%dCgIRj zma6UW%n*g)$5sJq*EzhbqtqI+@${Q5f=$SeDGBMIqUYj(KjmK24{0!$zm3stpZwv7g~whCW9`m%p@2U%u?poy zfmB10B=Fc~)ID(-+mwInNB*L~9R0)`nO#d>jG=Jh)sT0SNXw;=sToiNOs|!?B;Rdc zQ&J@M4zzHbJ!P;kUBpK3GyhmMiXvQIYMWeQdaoM_5KuaW&U?7Tori$+du2?eB@R5d z6EIi-9DPRyvV((k!D*v_i9>0w3h=^KU~|0;llOHaJ>qZ&lPevJ8>EV~y%!4hGQ#Bg zRu=bsq^5S@rR@^9J{5RoJ3s+CZWqAObMNJ_M>gj0z%hP^ysLdWa5w_|Z4=NM1B`w! zHKa%Uij7%AIfj&|LXUXjk3#X)rLuk`nBn@;`7}oXVvIe_GD1snmMw>Xw;KUnDS#t~ zVb5)sp1|Q{VW~CBd%U$5cxAgB5G7A{G}{>^ERM>6h1sBk_K&HNdc?u#G7D3y zY1BK)2uZZk_rxlhT7IT$t2koBx-Gj0hS0-PK;90lGuAVp|qg0BFM+{V7gy?O(V^hU|mUAG%pvr`UI zK1DxWom|oZiZr066bR{3R}dhgCeRcE4#$9)>6(#jWvB%~+T*zAv_oIPK`bJsMB2dL z-vM?v^^d8clP4x26Xtm{1U$<2_T=gom?Nj5?|G-bf+OA3kgH1`#Ix_nWLv)V96g_H zZhI8Kky}6YxL1FH!#j}hAXMPh_kcIZgV1`u(|bJ0Ja;I7BhL=&YWMyIhj1mi6sY8O zl3+d1l3$g2UoWiyj=uJw`}?B-j!ve=0N!hqt}l5W`OKQ@)g_Ya>l7lSz3RKnA016_ zq?;OYK`D6l_P(QJYP?_w2NH4A{h^Su?>jy|3~+d+hV(~k9Qf--83ONb!78%J3h>zp zsJmc7A!XlZbbMIgNS!DLLVn;cZv(py_d{I7^>aPqxOBFNiPX&xEfj{?+`0jH1cTja}Yz1)i3pBc~1p6q> ziU*DbQ-HWTuii`Q^#s@gIF3VbpPQOd(Zl+MzjeJzRk~ za_y#jz>&rMp+C{Yri)INMMK^umb-+^r?kX? ztp@-C28GU3^Hxx(=ja!7q`<*|*80QP_}B&*w89GK@EnpOxWh$=aBWQo`o*L0(1IGY zxP#c0t1H$GgRCY`CEmKZ3fi9*#ii5nrX(axAQG2=q0a=g%z3=L0FHja2EP25wM60S zBGt$7>V2z389A+Z=?!E$Fev7cv=!(IJvKw`#T*Bb(PjAKt)3Qqm@TqI%&C?7-1H_-A5aw?$9j&g>{I67GsSEH96b$tZr?9j z*0AKzy7;2zmv7(FzOcuegS&!9DQ!|f_=c(@v+#T@!23uq>z z00rrT&(#4#Xtm=kERr%S^(-|*?ub}Po@|l2S^}hny5AIB+1voo-CmbJ)vzR>4qCMO z`oGCr-JPFW8gj7omR;~Wlwav8%Eb{1IXGYy;fLWXQS5pWw0A5Cj2$dlgz7IyuXq6P zn4`n2bhO`-o=6A55!dAv0TsZ}cVJKpmp|FCB%lpi^!Dwm(E8qCD7uPLzlmi(-wPJ& zc?n_-HvW;Af~TF+A(qnc1_%@^lhYSJTL;vXOBNx7keB?5t2sJ*8WJQ~p_tAjJ(-mP zIQj`3E9#eO$*P5lmc*uq-a`2GeVA}TE&k_U)&fcCwRE=?A&Q$~ixB2Rg}!kAFMr~C z85Dz{r#+oHL7E*hE2KHLH)Js@E=vgp$=9@az@&-P1+&sOfDqGPv7&y7o~&9Z@)AM7 zj9Fm1hBEU2{>!%%F?7GmJ+qS7u$STC!Pg>abMfQ@feY~_10tfX(={ufISCk91w8*Q z!;Z#|`cT?S0I}mgomr$iw#XEu1#t8Y81B%qD_1lw(UO%5Gh2&r;Aa1CQPSNS{fY|n zgWd489l$+h3uNLMDt zV-A|}R$z|a1H^sCAG`92`X!oKb#Z!2)W?3b;Aa2BNW$pSv~bHpV)F(#6+@sI2EMC* z8!Gn+_K<-qFPzpHAc9XA6J8Cy(@T(s$cv=wj!Y*w!_;^n$p8!I1#t8p8M2SX{n`~c zN?0={tJ`q4x()`jU_$K#5_(j*wQDPq?d{+Lhe3gZ{iwoi>?<&6u@2Rf4Bp5|R`9?; z>xn4@4A8QZf;QamJVWFO)6Q&?(lXxFXJL^7IQj$)F>n;QW?y}D&l1jSFUlr7O`$Ji zxWxDeW~rNDLWc0k~Q6t40}onH?o#TCQ_v(guQym!@Er6a0O)32zx=x(KW{J&<)%zL6T z%7F^jgfp~vFiPEruw8^lqGzC44dAxK&!D-5rbRIEqnZDOW>XjFYknmH$L20$(CUM7 zaaz(F^hk3>C2xg6RTT*uF@Z@65WyxXw>HDPWCKWg_?!}N1nkZqrcNT0Yg;;AUrc8Oi(9*+J$+^W>zSCUI0h$ z!Lj~{tIi)iZ}HlupLZ3me#ehsN{Gr+Qw;^1m)8p> zBF4~k6^5=tH{5q!g{mnon@F=mrbVzwC-&&Vv}EyE3gGB9EINMp$j?SSc=3O}{Z)mcce*4I=-4AasTI4B5K z07u`zv2A|&%-};0zf@CoeySiV{Q3(>)bD{&F$g8I&IVHyT>0n+2peT62?t;~HZ0wN zeIkcyGyHN^02O}V$8X2+W|PygNUe;VOVgq;to_|y!3-W_1OmDMhu)X|n)C#5oG!=o>g_+`@kMo~t5)T)qq^Un(z~LOzD-7H?!!OeE_iT*g zxerWP>`NYv?FfxR?4buVyuYdm2e(Gx^OHHz5eRqyNn;P!gCXxl#6*Ny@w}Jxs7FV} zw^PK_%dJqHqre=!2MB2nav-k%<@#l+Z=C^zq-P%#uVZfV1=e>TG(a?OdK z0HPz{mmm=$Rrhp<>)NJ)!-Gajb#&v-3UB3W1y{D$=tzO%f%VJ6WmD#p7cyRX4_`G_ z3aOwm8xiiq+56^U*vPW9Y^$i+K-A*6b#^JH4^qW5PrmX(EB3eBN7Reb2`1wS#F~LE zD;p6g)`b}fxZv>n@gUxL(glam92$be90934r0$T+p{c4XN;A!h3yvcdZfi4jZl~L1VAdW~$0!pevOPU-i0bDf3k4wk;aVX~C3r`rw$5m7y=xcV2xnF5aN_X zY6m#dm_y`OJTE1q##GddqzcYbpM@)10LPKw7`NcHySU1(;l|JnpUF$cM`ejULefx}}CDM~3ACN)PkZzYRa>8hTi z0FKV!m~iGlZ-Row6x!sf0skjZMVTqUnu|cdo4qH_*pez8*ZwN+lWO=bjtXZaw_HY!@)^?#G{KZ9xx7yhL z_b~iL8hpA2e}FWHApt^Wg+wWt74lfpU0IJg#HFS&M|a)|xv~Xtbbw>@#5Lms#mSAF zQ4JOiJAuO10 z5PQ^@91_l>Fzp-|JurZ~=2fEH0K#z_*Z;L1Z|)AuL8S>Pv?5T_0=I3Efz<;+p&8l^ znArPzL@)-qt)w}EK?9+nAs9q@ES|R_lYdf>rn|4{Nw~Cn(#(|o@d6IMX@ZexN!F?g zJCSka1P*o*V;IJP8U+{(&8&R-)oH=++;%OBL+&cB-tDC@vG|IkDd0v2gYbZY!>j_I z9lsiP&$$r;TAQ#W`b{iJ+>9b83Cq83w_0Z7hmk)(wMuYUZ$?y$ zrG~?DIHuMV2$!6KU>`T;m~#I5GQG_7zy7DG6WLTIysSn=fb zxck;C@ycs;2>22LAmqV#IwU1l4FxgHFWUM1+_hMydrC6=qq^UnNv|5h{GWrLLqL_ zA}&z4?s_(wf`p}_yv{*v#t=AhTAly^LCiq_A+th)RMeDup>r=A>te1`kzl%6Ne7DiSv=$Is+!d?>T=ZG!6o8u?S}6m+bR;H?D#H)Y zs>I-+3XK8bB=G3Q7Tor?46V__MecjW6y}9Y2eE_zN0Co}gII+ACQM3Nj3ZTj?wPl) zaw_S^c7Qe;6P8`aHup!rXPeKHce|WJJ+1u7J*uiyHw`Su55DsdE~;Av?$GVlj~fTV zs)M;_{SlJ_>in;lJAZkI&4By7g&a>b%Wi!F2VV}=t{HO) zD@p#~wmZ%m^U#uM&?_|<;|5~wo!3E&2712^be5AFwa?+|+0TJnVp)^EZ;WHzjw&p?;u@3~ zt#FuJ`A-l4<7i_6tX_EsD&?fHBR5LP2NL+l8>4Z}e_V|+tvwAEw7dHwQCTc!Hd760 zBx+*Rj0z07q7HxG-V8svE8gzi(gz1q86tat#6hYbRfSg~^@cAM;}DV2w6M7+LTTA4 z4}_gACxb=2=hZHn4=^7vW6vA}oMv%~obwF;`-VPe%j(_?K;GaGLNht`7RK=H^p(F4 z#5K&Cdo_v;8%jk0$rGya`hDL*NzzsHy*axy+H^`|`1HK%&~}jSaH4%_28eYJCPH}d z&L?o*Y3~Cj1)fMp(2IJQ7V2{3XN7|q7S?Yaj4Lj^3TUU_t5BE*CSFv^B_^#(aENyW zRP1s1OT(d7`Q>689ydrQsmo2#fbeDoiYccfghYIUSVP7)L=~9p!pg#8>AV^`Ftmzc z%T6HREfJE1En;zCL@n^SGvvaxmI9o-w*wsV#5g6I@6e2`KgieAamg4095h8y!L?soi?cqv4ed=uXm9r;+7cA6wr~*Pa1mPCLI}r# zh_naL77ZY2YG^$WK(tL4-j47@X?B}17X%7X?2cW~cUgtD zcXeSlIDaUa4_Kbl&L&~&&IO$RElZ*K+me^8G4rZO}& z6(Q2(N3_*IB1wfb4g#9#x)kn`Oq@c@4&t_ssH4lfT|6|0Lj_fAaj2Z83~=$cj)hd* zW(W{;ZxO2qQR=aUWR8v{1Z9zpl5}wBg29N53PPb=y^9bj3)27V3S5UFzRfRcHb`rP zNNc3>DKfSp=FL)_NLr;iF~}9?%c3Hm0Yut?<~AUi1cH8`tON-7fkfKU*K~AJpmn?E zV1O#kN|tS%$|I+H{SZl^U0I+MiYP8u>F#Yta5df_cPi5K~lz~C8k%REW z%{O9{|1g-&v2@v4xaW5l!j3T{5;|;=W9QIe!C+M0Z;64G5l_jb-g;XyJDJjvu8Nm~ zA}%D2aKVvUU9yW?huIDi zC-|}d3xnlZq-NHqVTH`q;Q;)JAc7%XXpD5%RcH-iN~pRlZGH-9LN)N!i-2gX`{%h( zSNMIvp=MykN}x3f+&*g#s`c)`0d6yEqVJR)@Ad?coS4I2Gj1^lZtAYFR$IY2r~L## z3!2d=E}GU=bc+3$cTNDeEQ}&<8*UQ;F8`MNrAixJ)PRaD~G-ScZ`9ml;?$he81_U4+URQ~`{% zQb3mjNneZ@2233fl$T14K`i1BT{q$nPCaz3SLVROx6qWgr?W%f+)T zNC^d%HVkMPC|y=j@s;kK(7GJnqAeM#__*Cb0P!?NMHw)lT`uEF_lc?dJ6dfqT3VC{$X==##e>mBrPzNW6k>Uc=(U!!jGh=!63gw zE|9|Dc%NlKhM-YVry(#Q!^rZz<2T-Ky?1XP*`CaproMCAk*oc6RCuMgElI2MZ*<*; z?z0gJ#Zg`y!QcVSIPrvfRFBz@6Gk+mrm_W0vA_=nfQSvWawygz-2cHh@JRS3R0mDy z?u2QIXUJt1JP#!U7@3{i%}qe(N^b1zX~4`W5RVj_xi1HB*!)cWw5>1n3pl6|Yt6V9 z0erfr2F0Zs?vwFM72K`Alp{<}qp`q3l+ny2t&CpqzV7troQO^wr(@5IhBDSNmtIc# zKJMrA<1!A1%%E3EWU4??1L*p^BY9$(Vjxk-WLbSlH3D_!7_x>D|E8Uuvm$cbi&d6yT zbJg@in8z+g$x$FjVK#_;I_B5D6SeQ1PiPScJ!$@tf$4_=o*X@q~rcRD&!d zKoQc*FO=*-f>SVww|FW8lEf0OWYbhBMwdMe9Et#UoYJK$yI+NU7Ms02=X8Ev;Gj#2 zzBIDd@afCIG5fe3{9G>FGc!ro%(OaCVr^IzKN}Au9zakj=`sROp!mW(pmKm@h9hJM zr!~f;i~H_&;KkMQGsWb{l|3TP!LTNoFfR^%`n|omoVvG9-rx`nvK*>YJN9~j{eS}{ z`5f@L+m}FMrJI>J8WLr=CH^?t`B>vy=1d8e^VA@2WYEXyvAO@k}7#W83n}GJH z46)M|u{wi;o@)s3Ta>+9@9a(LzE|Mz1~|HU%us`~#ZcI#Ko5@?IPOr9cEO&Ri90|< zYLR3jiu+@CW1aOSgt{075}hPUDddPWF#M!-Ie=QR-bY@W3yxOJ+W#&8w`QI4)&JR-*YCU8Ip0&s`MCVm zQ4=gj`J%#<^Eu;_!9{UIVH2Xwb$7{|p_oX_M8x8_v-x+}nVgG2cRiJvi=vAAVkA{7 zcKVX91=sdx2Ol+Xq@N`J=ctj6qMq$=_IbvHmouP0FXEVOi`1oH5gUk6vDzX0Dg13b z6aE2;GpBcDOHfK+n0kE27ytP0qo3;Ue)v$p(FrIo4EMvYPj zG|uls2S?^bh}m$TA3fZ*l{&_ilR5Zg0OJ4*qhR~dxaf~rn@Mo&fsUe;PJs&wZy1KB| z7sd?q`!GULFoHR30%sTl#)dJDp`7z7FsijaMmEk9jIjpJ@BujA!#K8ag}>`K*cne? zXUW`chrBCs9~49opo*8os?)wy{Nk*y&kdK>j^W&4!S+MjPg(u&^Yd3d&{JN%&zh&fJ-YYHuNu2|5x363OG zB;poJ_*o(bs4-|eV)>T(=X2h!%;+>e9|j;Y0GRJ77xq71df*e!9LLK*9*yfPfa7TN z>L;Yl0ysV)19>zqqX3Sh(W{@3HVfeRgbd`-xQqfgjz+J3LfR~V;}bHFN8>X74>n`- UmOTL-4FCWD07*qoM6N<$g3c#}kN^Mx diff --git a/public/react/src/modules/user/img/qdkf.png b/public/react/src/modules/user/img/qdkf.png deleted file mode 100755 index ef214dcddfb186427adb02307c6e5728f5520663..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2840 zcmV+z3+MESP)op3}K^_ul>PYae$D_78WM z*}M0C_q*TsyXW;g=fL3B#}WZ{3m0nyk_M)&H*^C4rs<|50FqBo_(1-Oen-xsdM^4q zJdS|WYiPKJ6rNJP9``sh56a`i_d)o0sA^+QcCrHC02t{K0L|wgq;8N0C49^QB`?zA zx3&RgBODMBz`~$~Hy!I(215Zt1v&x{5L~XR$hm70fC-)lV2iZ}83E9w#UMTE2G#4a zq{ARZ3MeXYNdiPfz2c@BOC}tcL%pF+22i3rNK>1L=o(Z=r&6kTE2&It$RP>)mw zj9UK}9>~`4T6!Q}Jdyg}7o=#Eo!%Tbq}AV5TmtE=)ZOgJ#!b5z7A zbXke$EW8pS?U9I`QWg?amlHYQzqD)oxbU(5w%GSlkRAbGPgun;@{0-L`24+M!TS>q z%<*?AYj_|uWC=>x_-%juTj@2)F2w2ho%{W@fauoTydlVQ!Hg_XWFyJWpLFCaKcMxE z;0;2UrbMJh$pLnteA$%pWEbLe{LcD;!-Vjt78|K?kPHyOjT$j`x|6w`0rUF!B_fy~ z7T+ibitw6_b<5LNJ6VjAd&IhdSAl4SN*Qzj5xcZ|SMJ?T=5+*&_qFl!0I*n#P*o13 zyd^rfZu!)&I$4a9d&Ip1ZxPb{Ry+z3&ezuDec8#pj(|DXJ=O`pN}>|Oc_4uI)~!gt z$GDh=Q=@kZA?a>Oz7UFBRllX^DfL=NxfU{wm6Qq8IYL0-dX5lgDc;J&qo}jCc4pFa zK%U+aFy8KQFA=QK-jbde`qzDX>TM=qP7XiDh_zYrp*SSb(tgB?e8W+6sh8%SQPH)xS8rQULanAy=a3KnW8=+uVyje}lARPhI}5 zNdxAouJJMk)Ec!h(V$IMFGQO6L`lZq`2{t-F#e?w1>e-MWjn&?1Rz5mMt%+wmDSbd zCrt+&tI~n4u@WNa)NG6~r2w>W{i@90^1ygr7@aF2UI~-E*imaF^JYy9HOgQ}PbgVF z{oIJKs;*(?%abNC2Ywk`M1Z|ksY&@9L$-4LLsQT23u-(`8PfR3h(1l3U|64s1etO< z04T9V`x^7!oHSs(uLO!DfnC<#yh;r;qKBm$zLV8%Tu|MKp+|r~0NJxdyo)5iY2{c_ z{^Xy^Zv@ahka8WPza#e`(Q-g~*e>lE0;#B>q2S7-0aO2L%1RH74cVm)h@fiY>Wpe9 z3rgmmZB-xF5|Ue&hv9NE*N1{x?d^q0(*egeM!vD-m4HGEbn2w)IKaV;t1}-@W|L0F zZr#>@n20^9#W4Eppuf(OZwea{eU76zMxMO+Odw1PjEQU6#t?LD_+I9O(}JyAuf0l0 zD=a-7!Nq+|`JYY{2;(@%z%-o+^Z?QlYxfI172nVNiql0UdY{|f{}vG3Zw9`CylG>)Puxs|5dX@BJWa0H<#!NEaMG}{XI=KiZd@X2UR zDH>=3LC3z9S&pUFIWVV3y@aqvGki`ehQ^@G#w`QF4|eUyeNHb)#N3r12MB43R*>Ti zF8~~@e`=OvJLeb}&#BQJL?9+oCDe^cBzJ2Bh=k%AG3P7~jN9$cqtJN22^1}wW>pQ| ze8-;AF))oC!)0>KMpqo;YtRV4LL%97X)y~C+(r^D3&$O5ojN}6VG`V1U7h0wclM4Gjf-{H8Wn^na6xy3K|+OlBpCR(aYA9MOT4;uz1#kwu8mYsY(l*viTu zXX$8xc!Z{=-SCfERw*g^+j;pDL z80ehmnK>y{Djd6OdEs?OhED;}gQh%gSgkH@E1&L|#Ki+<)7ridh^UaSkE^+7BI;;5 zJjXE|NLiKk9=_oPwOYV61xAeV7!fou61ws;rd=p4Wqh?d-o7obmzQ5mPp9l91VS+* zs34>?s}c?n9Pk_|NU0i{lEmyiJX}Q*?zAhYM|)Oih)8%HLg))glCNg_%)cgzOvSnn zKgV3IVun;qNM9pjnRe9)EuI0`-h8AWrTTelz&tZtN{EN-3hJtg>6&`N$*ij&k&mIP zOAto7MX|771!~Kd|IEgauoRHVKok=}p#}t>>^8QW@V|i`Yd%`|bfVx}jY|ob+BW|x zAa*+Go)tYwL_&IpBzl_wz6i+f1tO-4bGSYmO)89SYmv4#R((2YA)34Y`NDrBD<%B+lq9C2{==-CjLacx-eZ$mh}V&+_5oWE zL!AfW`}w#&9T})WS0Ll)(RqQJ28{gR-7S7UB4x+w+%`#&Rim>OxpFP?ruNrpeca@x zqYX@hEzi!$Nd=UYRY{(p=D_tkr7^aQ0mvTY0Yb>NlOWzmn^Faa77n%PF-j6SP&k_t zQ6<@{b)&?(BuVmlU%dV5O$UZwfGCmx8P~pmC=?6GiVJZ?Y?@to+xf1WGRkS?v%XAcC28sYycU0|Flq z^I>4@tmpV0A0+#{RK`y#Fh;c-8SK9gh!qo|oFKmsh<-;1J^@%)y*K~ec&Ud}HXiTZ qn+8n0h28Ayw}7#E1Gj*&0p`E8aGvZg<&7Tz0000icLNOfHMC$Pgkhus1CO zkO`D?U0*|NIJR@)lF)z|xT0+#!VW@EEFf%92#k~Fz}SGnnX=J&8`rOAn%_;g4klHF zA_<2H=B6#6-3&2VBeMq}zU%S82OoGL-&B9%{u+ox&fB2qKb#>iolq_dYKIe+y|(-_Z9`-U*Ltk7pO2&qFpDX3d3|vlW~~g4GMp+Mwm|Hv)f-U z`qc}Z*5gSPn3AwG#ZO;!7G^QEy1gL)(|>uYijeh4pxCBkYK(41F4i~ti7R(|0NTH6XoYGsQL?85B`t^!J)4%stj4w+a?jRk4&C zoYsM)N(yI;%iClz8@ImjweQ!J1h$C43;TXf-z22PJ|4&sTT^rF8y5sLh1$v;>mMC* z1JgW^R25*hDH$f?;g%)Q6|S4?YN!tbm_#Z~2$8HFNCZVN1xug-*>l@A%>T&?7={Kg zwwQZpNiJ93&=3MJM-r(i&}gphflRk7x@`NTEq5)rZv7g7x_v|8r3_$tlPY5zm`qdB zy`01zQD0+EjXGC8-vH|-Ar zn0TC&C)BB5fMB)TRHPHOSY(~F4j3Ct5iGCWT=+kdRP03H z&21q8ql0rX^}GUjo{%1s5=NH?(ob6h1frcaZx$cOmi2OA0E}E|x*o_w;Hjm(ObIQ! z=3m_P)%~RrghPn*vX=)k*hJR=Bh}H(^S{k?vn}1@6{%GE4?>!kkztF$p6K;NQRd9m zV5p_DY-O(R^1J?@Ov(MB?dQf;MOb7VYP5%o;lSOs z2&|fr3fz$|_d1+RpqaTCFJKS?+FlE81F&8DJ4&xU6u<<%iHC9BtTN_d++fgq$^+wr zTppO&2IlbD$>kc;8i81;U5qltj|X_D3!~+34PkU#FT2l>4(+U7@VOt=_txEA%NXe5 z%L63i^Blni4RrxFUNd7T{&j|Tx~-)myE^(q5Z|uz6Tbn$3elbF-GFK3GkgbZYKldk zj&I3qsl?;ADkw6?<*r>V6psMXDN*Rii%+~EX32>3!k+C5 zzjL!D7Q3U8!jnh`XuI|zmN2ZsyHvNai|}-?ul&IWc%5e_$TKp{(j1dZ2gI$RG8SE! z5%BGf-BA@VawVxWDpu^I8jo35cGZ{<_Lm3N(7+2jKf6b^+1NMfZAyNnNrWuGP-YS- znu>iWek~dTXdegxn2t{^V62{x7bs3b=M~zM29>c|560}~NhAkGFeP`Fz|yXVOpuIk7Y8Zwsu5S$Y{8^ zy^>fRlzQXh0D;;3>-;DLU|LU%(TrwRJey-az(hw>g||-xQ#Anc84_@rkkz^9JP`&k z$Hyd7a>poA1ne%1+ihBZV3^Q}w0l)vlN0W#3hOxmbe#+Vm;=W+Fxkg5a+M|lv9i9t zG$X*PjgF{*EFq;BIXsZXC~?T3>*I>R&L!}|{YOWAO(`pTgj9h6c>}X`LeoE zwgsX!;>HX0VF1(8$AR&RQKr`%Gn;UgjXuC2nGH94j!zI?dA3iV+_JnEPe?8C?LHL( zW14$L|0bgH+!3zFq@}SjLZTH-O{Le|*>$w~#xe!w3=tBO=K5^Y5{4gbu{BM~d=3P| z-JeuE_~FFnp5$86pofsk-8C5RNhql~wy&uy=2xhC_nn({gb*bJXPnj71IeHe z!LUN~cGu}AeG6f^YQcfUH`fRM->>I^neCeI|D6%J?my3%JY#ZkM82M9Or9}$#>@-> bpLhQYN+hYy{R8in00000NkvXXu0mjfR?_1E diff --git a/public/react/src/modules/user/img/qq.png b/public/react/src/modules/user/img/qq.png deleted file mode 100644 index 1f4a09bdc7a202ebea5861bc75744533ecc85dce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2702 zcmV;93UT#`P)-fFwxLHZk#n zelbV_^@0+JX=^ZP2-Os?1VR9pTN_GiSp>WEvbXNe&dj;IuX)dzGkfOj%M8wSHceDLwP7mv}NEYbUt;pWJ2pizoKH@dU4=308 z%ZPz4>BF!CR;|Kp-kjXCuXk(6Ndr#-$6)&q3-l-`e-RSSN5Tl6@5X>xfp-EtG>GFa!dpBqy53c4lZd%Q86zTsrLbMJ z2^!UWg1sj9#fX?^Bg2FLI_~^F9L8U~l;~s)m=SmidgDgavD=WhU%{Cy;w*Dn=V0zt zV$QPwTi{|~?ZDITv&O{t5`w=Th33weC!IY#4Wi{25G}bMvwb^yHvV@7-U7V?Woa?w z;dnmtdR_fvC32I*9!|ZOUJc56ofN#F?E9?OGyk#RMTyaxhmMS^?+$rPEcO%cZ{IL8 z_>REyppR5>7nWFBD6m6BUlc#k0!TqLKez6uo=-iSexLh&>iKv#l=|n$q-+=%W$^S0 z;cVci0ndXTghHjj8I{oN7RB_txl#6NCUPWsr4_7@}~t6!Rj*zZLoF(o_c%NQXI=`pr==xrxl!Q zr78AQmb>Zp$GVls+wxwx<5J<$<@Wc9PX%1;)AM&=9|~Noq|WLDuW>Q?lNE`vjg_rqmOg1N5SR!{ zwJMvUGPT8r2sT2vWs7KugK{IP{}Z^DCMPuIvcn$1e7KwD=I{UN8d$SzcHq|Fs~*)< z{cQDUdkR5yDb9?@t1li^>v|P7IvT70K^P~bmYP&4D4${kJ*Hvyimh&(*mH7LPsFkY3q^?sx=LA8_^Az~&OYu~dk~UP7 z%Rv$2bxI7`2El&+osZ2eFjIpDCk$WOF}>NCD#|itLY$q&-+M%zqlBuiP(N?58K4&U zM{mI$yqH1?TwGof%)+crw`b2}t1Z`eeHqSOG&h>0;BWkc=Di*FAzNc0AcL$JaFT(TR~sCP|}S|PZ%~^KKZqi18vv(MZe}3v7UFxm~9Cze)7Kk z$JEswfyWx2p^A36PhqZYtEXchH$BpP;D$c%fq6 zdq=9|gELgzEU-1tyS&QWy%s+C0a#Fk(<*Z_;OVyv=bs8!KANM&wB(k6_aoW-)~Nbr z$KZ^MtBf2r>U>BHPd3+Ts|vH=Z@mcqJOJPP2yE<|9r%QAxbhLh-Iobl{@y+LWO#1I z>gtM7c&(!x<`WPe6~|{MusW$)ZF)~U5N~59Sy)5PJ_R1XLGYZJ#qj>;lM*+tOj)jH z9b-iL4@}B>e5%tDP^Xk{0xBkCy}(aWC@t{$0;#zz-}|`re0Q%~8T`U_@S_>#F1dQ8 zuGJlfYwVN))oCd|Eo-wymKJ)VI=u*wTZc}8pQ^{RvUSg8aPthH)BnFYW>~+|5a`bJ zch>U=Z@f9GKIfD;p$wB9i>x&5+mr9ey}TUZU(48!%=LEGxD7RaU}K2Ms6$repAEnL?|0!`UyDn|G|hV@zY zCdp@ttF2}u)%tF8mlhS;JE64oOJ_A&%g({7+#`xAidxr3BBe{Vb+c8X^|}gKi11rr zRXg}p&YHp6rJl~u5R)b%8{lcsC#wsx_jp5YtQ$sBZ+C6oQs8zpkv7Y2MA1Z)>j6EE z%bB8i2w2e(e0~&{pIqgQYVAla2_XX`q1;rh^Pf_INpYx!4viU`<*e7!@kF6U385@S z%2B{F5q=KzWx*%IOIr?PsMDMXv?Z(zeWta5asSW0F<)*Egu|vm4MQy`Q=fG_k@b3Z zAT&YT%9Vk#RxA+BT?p5u0UPr>qx0FBVy8xAT8%Gammjbs}8>n`?Y==W7C`>l+R6r?^SoQ4mq>RH=#;{S~f|wm`!_Ib)Q_5o- zUGqw0Wc#G%k0ziNL8D-3=mPbgB7Pl$lOB3@0&j<(C6~gakLMKed@I=zUL+J8p@88m ztywD$7m8tp5>8i`O0ok~5snB92)r1;Gm+-sks)vlLFC|j(1;rNJsy5NBzRY2<}~m+ z4fd;(xMiVG_wfpfLTG_Ucv|DS3P&p(W7RG~jMY5Le~rPh1532hM4={9iqHaf4MCs@ zN*;dA5L9{y|EIzJH1N5jl%57|O;HF!T(5{5MYxf|@d6xeP!_y#n!uwbXhHi0B1aQB z4x!&5EVzVaO)yy`e9w+j^5E0s!T4BZ5T{nbnP0^5U7XOt32QjzGAgQ~EO<)I73y)B zpq&c3RztgGA~z!PLZa~oQMpR=o*!Oi^?Ih`!e9w%L4?vpB(&Fh?wqrPaUHa3V8$GD z;TZb=eq5NZu-|tFwA~D__um&s;&}t|vC!@N^!~{neRo^$ze1c>W~;D56aWAK07*qo IM6N<$g623)Bme*a diff --git a/public/react/src/modules/user/img/qq@2x.png b/public/react/src/modules/user/img/qq@2x.png deleted file mode 100644 index f6937c2baef3a1737d65941801afb13762d7c6a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7663 zcmVwuODtbct!fH}B#A6^giwtMQIUvqdpz(?FuJl}5+9?t=ITmY{Fx);DXsK*0y_m=@) z+*}X%_yJ|Wrw)b2t#+9CU913V1)DIg1J8xdSYi2GqlW_^|@qbc)^IRR%p= zU4R|V755waL*pL6560AH=sNK0n7=21-y?umfv#h73FOrf9$*4DB~aG^Y8ON{3$fpR zKswi7&%-I`En9$KCA6eL*aXmE_(7ln7~f?FgoEFY^?L&NkpeypqqnVrAgLfG$9qF~ zfYqc0cb^G}Yz$)G2964qI#LT95(sgK01gtsN}=@%5r`Fnu+w55z`T%{g;Eb`h>ZX? zW`W$WsfC{fZRi~>Xfp^4(0%|KJE4jBBt2`k*+KBY?`g)54Dep8_R^69?bvL9o`gsq zf+Ucq_QC;;7_SzAK3*!kL<_Y_2;pe0LH7X-dWP=WFK*31vFvN$_e3eI|etptUT( zB=9Vl+5qjqboU8p^J02zZs{)FXP}z_GvF%)eTx9D*@EEu#a(Dmhfu`&u@LI<1b(*w z?+3Qm=tak94zvz2wK~FEA@q3ydOwd>&Qu0sX#gCZ`RmM69C#19^P=|u`+=eRa*I;> z@-6f7Ulvo$)dKGVY%iJF9kwqUa1OQ)idFfT=|GZn#4#i>dR`#TV#k5~&E3x>Czl}mHb!+Ic0%DZ56{Sd$}|!JzR`dpsae&8 z8YDBz1$|k7_X4|))qC#?*-0QLGaTCpahZlXJeLQ@Mk^0RI^{tji8g=|VE#S>mZU}+ zsC6zcUeh`2z229Zp3BiaNhZ(#bsM)eBdDF*p-M8-hwaM&eaV0i0=vp;rO{k5t}c;6 zo-3eoRn9@J20bPPIpAzSieOm;&m2%s_kIK5<;9;(bSs5c3Rga`LtZEaI$dlZA?Qm2 zyeHVs>Jiwa)ky}q*WQp}f`ca-_#(7A%7a(yD7-9K(m9#n646IaoV4V@lRvHrv^-uE z&c}_i6hB*t<=KzMcyM|rR1{dYbBU?b^`$U zv3b=&D1aV{+0L7n;)D;lK91yPma&_0C(-ZR*b2TemLemGndl%J1?U3-9|U&mAV}{* z2<(*tXA6PL1hg!J(e0!2;Aw1N!CVT2++kGNU6LiP`QEK?Eq6h+^jSSEqjyRsys8v9 z|K1t-MGrc;n2Cp=c8BRh1J11l? zGXZjc$d%g=5VM=WOCyP|O063fy8;voybpYwMa66KplV*~z<2k&?sBGA_1$`Odlu!c zB_Bllj0N9iu)YM4mkf#lEuTRmZY%lvU(MlWV*2bFWMhxHK+4<;ufg;Ky(i!U!FBlw?ybHLkU^Z@Y#tw@Qk_;a7YcumhUQm*N4V0~KefVFX<{GI#& zb`1izjFteiGg_XoX%-I}&|M%k?q!Lf4+NY`$%DHfz4aqELSSo&u}OvX0{S`m7q4WD zeh}z@?P+f%#4xVJNN)*y>AjP77f21G9cno%yEMHhbk(~RpRJY)VSaG@F=;LCx_e%} zLMXJWpdY*%s_I;NvAh=WT6U9eZ-ZR8?dcpbZ|QqqbMwgj5{G;yGuJ8O zLMiahqk*%I^Z+H?L6AnM$!JcS&OBuXf3! zTN*P}X&Dqidjf8>+p&9g69Vr_Itju_iFXU=kC@Zf`&kdBw`^=0EU#ztdPnI#y-y)Y zQfU0$$pSB4*V9DRqOP>YrMGFUf1rpbU7GHbpi2GR4oGE6FAw;YX*>W)CNBQPwES!{ zLh4=1%5})<0w`yBenkDWo7g?kK}fEo*~DZZaEB0B>m`7`tT}yMzmpvZUim8u|6J>B zX4hTMe&34(-f+ay!1g1MWEy|5UgPfVmcd2RRf!`x!`&QcR{~@YfV-)(i;`P^vnY<4 zp2h;XmR1v~51{?DybJKEc6)YHpo~eoGrV4CeR(yK7rMwDLE)=yRgh2q*4ML-IRLog z)a8NgL4R~ktk56{HwYtwhu=!KVej9v!E)i$qyt^0VR~w||E`SbVc~8K- zGbyoq9HG#-R%m^E$-23BDIJ`vz7<8O?viPpZ@%hPz_Zux9^eG?4GCloAm-@QNNIT}?!+nL( z=yj?~v5tdT!{0VD}N{J?_zT%wVXV_BF&>Wf=dEho_JN#%O7J;Mp`9SsCNg~({{ zjzdYg{@xwpYy-GL;#2;8Vq^mWf8Ez0srdJXA1*AwS>rw5vq_I9uc@1}y1Xx*b;Xksvt4#tnm={ND8fs>N*JYrE!HNlKI1Jdpfy=1fur|)|5 zmlPHg3$_0)-Oh9JVQoFz zPuTL3W+gqY%RuSC|MG>vTaOw&;AehQ;o+I?1jx>TddtY>J$=g0&OWEV&JGp{kWa0( z#`o^o8l01ch{+yKv}_g8Btcaj_Y60HuYuUK0Rhcbl727DAc`cSSRx7qz7OD8d1_v1 zxGdGPeZb+}td%*%LYnMBzvl(OIeP%`v%jsdaVLu-eSA3&oYtHaK0TMA{5dusE9AYu z*e*_PC?ttOGPw$gw}zJf}yqi6WV|D|vP6|U^hyEbeSM>QhEg92w4;FR#t zM8o_d!Zr{^EktpIMx<~*0Mi1ITf@BVpu6JMoArfX_u&5Nvw;sBJ9@C`{WGQUn(Kh= z3%;Jsk{2#7r2-e9^Yk9PQUJ3vZr1%s8UK8zIJA)xKC@{$a}J@^=vl9#S@#V6UZGxUfdG6^(>8jC-w~B^!Z=8TjB42TsW12 zFqQ5AAMD+iuA8bWbs6|MQGxj9TjevO5OLN(%$-V4!0Rj_Wtf!G6X0QhpIS*NJZo(| zn*o`>HkX@%-G1WY;JtwFoVn+~rjKqV8Yf=uYVWK~!%JZIbX?Io;g_@IIYZs?YwY^P zcKJL4oFv6(oORYPXSfG^cBP%&A%>fjK1CxHh(d|~2C&ZRU16iVZ_Qnb`+MFZ!5ebe z$^_5!KRX6E@0dLcIDO-{{=3FK+l%05HJSPIp7LUk*JqpF$@um>I}mcyhHc^xLXE^& zL!RQ#BBRQo_u@kV9*!f5JGemzJktlkUMtK>bCZ4wju-NIz!C!AIz!```|NqZzqCQ) zAAV9ajr!!pXUwGmU}t1ehwJXx^;l>v?|X1TyfR%JE#RLQ0wlEnfw*$x4tdG4B*oA2cn$YKQ%F!~yTlW`&V5v$^V-*Ioh2nZr#xfN%ZbPF zk{@V%>wYIIUBSITyStuWE^d{RD4>(c3m@2pYnBu={Y($}@H$&4fupp*H@oY`#bmGn z*3aay6u4@oynDIjER6%F9zVdZzfa>6KeRzGZ|}$hXHjh9XK{%{eEkudm{>@H*FHRp z|5=hP-r^>)ju#YAIk3pi-i=)vEx zMdSC^T8Z1RRU5Zr8~D9NbwQ^_xAQ_9mFay4Kwg;hG9+g2pB2wnKxbKr4^2MQrS>vH zLnZiU4V+lO(z|ER+d^Kq;MVHkRT|%WlYOW6->7l=vw#;KIC{W8b-TuM_XA$`bb)OP z8mF2G2@iH<(%Z3?JC;(rT&elfo+%pgrU&Q6J5+*rS*bk%URS&dGBi@)94K6v2fnU; zkAB{^d>S9JTHuB^0$=|n@WGpbGY-@E_)A9%I3;GMUIWa=z_q6VD;mH_SM!w;)v_!f zfMQU(XZwpzfJDoW|8^EvWdY)$i&q5Tpz>^xqLG9+5DK@Do8q8*M(_w;?G@xJgGs|z zGz30&g2n|m0dWSb8UucGwm>5oool&ki^f|>LIC{kN@4mGFTIV;G_ig`@5}Q5&#IvO z_{#b&)b?1MFh7S!vJmmm<=GtY>I5>MfUwC=6TlZVa4d(VG&{omDocZV%20lmX#CZS z12JOKWl4gEQisMiZUfgAY3aK_%LL zQ*5S0o1vj3UZXR7vKtmwtT%t;{n`FY)~zlsPUER2aKo7b`%UgX=r{jH<9wPjDSek7 z`>lAVQt3gdotytfKTw`{OBv)XjIvhj=% zc>VzzfBlEpt@_IP2Q)tUBbdqKYD+|Z(5#+ap3Nzi7W&uLxtdhV&-`{4S4IJ1((fiU zVGZcM>gv4e*9b%zC#Cqr@+`wD5#ak;W3MjISuLetH!F8m7O8r2tsc|(+Y<#&diwI2 z&HraR)wtqL;HtaIOHbaCEQVnMCVMq|iNKRSaigv4&rZ_n`KzUnL@qEao%ijWw~Vq6E{kUE&U0uGy+ z>#iJHU4Pa-0_#=+E1MdP!1iIM3g$P?1QrsF>9znh-A^`vRZW;%vXZp?CkpKJV><5$VR#y7gvn$P>W~oUzIkJOg2S7t^e58%jwL+WZgxpDUe6XCj_b4{jtkT)z^<3kZTiW8yae~DXyC;hFwmewYtW2(50pS4~ z$nr(&SVAW)L5Qa*g|7fu(U0l18;MoyB5$^-wng{d&8H@LsSA|(bNqApS-=uDPXeVd z-%7+AcD3;v0y|Zf;iTQeu-ogmB^ GC7*Hb@qc97{-6kz!S1ZjTijmunyz1bW#O zxYL-Gc=NNsRE@f~&MURmd7xQ+x?Jz@Gd#R!z0!B$98A&L#v6Z-v{G^2TnD#h5t0x{ zQjNqrlVvX(tm-&D=F3k?3u9Be1jXpMK$OMyRtdaPYkYzix9Y&J*L2rZQ_A}6sou5U z3e~fjZOiRkUdQp4u6yaCXLz;#Q}4y4YG?T1%pz`}y$yqgF-V5p}=yYA0&;Gj3J3SNRt(|hj6!+esjQi0Il2HAkGjr#u3JCL{S5wcP&|h zNC$WY6#k~4yp(D#Uffu3NF4)f`?E_c&wA9eyW&Jqa;U3xLW?8;K0LjE^+ANh1D?c4 z8)Hb~MWl_OSexm$+FRD<2DL1A8>;)s3BP?uOja>NNZvdo&|^elh>$>6Azp+GpXwDz z{p1QSot87fLTAfOH>}`PSI=hqRt?;`scw%%jrq0~@1I}9?F4q3A`Kfz(ikau?oNQT zPD<)_1{!Mnj$SP1(!w{WNkasr=UIl35~55YGIetv43|<8S*zt;cF{iJHNNbP z{X3LpsEGXK8KtgG%UlN-uV;6iMMB)WsBppJA|8?wsnKn^RY-yWDd~2YntcpMyFtyM z0O~h{qy@8afS{QmB(`(VJ=4<&%^<`18aSg@M#^W3xW1PcGZkLB2)eAY$J-v<2jydA5@EklE@5GsiPDUKGv2Q=`E zD%+Vc=_;rC!EjzSpZTZ9UHgZ7pq*av{u2B8;*$$06AvUAJ~^jxr&P!YWRj6#!5-Nr zV?%+?w$Y<)J;nkAp6R6NBro(EI?yv|R#Kd)HO|(w-m~&k6uek!-?J>>+Aexl_A0yl zRJvv%#EjDT;&g^<0)?2sPNfCffF2_y86jr3Gi15n-c#G?<%-ExDSL0;Yoo}jyhH(l z9CV3*be-592&_;Vr)l7g(AdX+mLXuN;h$SX-`7%CfO2(_>RNfePhlP}#15tL0xC@~oB-vV<5;AS+}fA>>9HlQuvO!)zC02445AR7Ir1w98_~9vL}4Q_JN=?%g8UZL7TS| z+cO1eKyM?+#voM(L8A$oC015w07zyc%W#_IlA3^~`+)`Ce1~c+(ygN>phX4^x+UO= z(E)VgneF5xh>*n{DA`07w4uT=3w9u(Jgc8Hmn0Y#bbcurf6OJBFL*GH4?sj@_}p-+>B*1$t4MYxyYB z>L`SIQeJdp5a{%Ge^sjL1vrT9Dg6?t3UYiBl9*4wIy6@|GT=8!Ru=7Z#BQYSmHdVY4%PAZo5<)nVln+LE0pmzmRCoy#wP9oq{ z6N13^fKNsc9{6m5ft^4Y;1dh<*jPEVx7+ryh%C^cTL*M73FU!aND9CSWZ8lCKzCiS z>dAQFq+vkkY_9{JE^?PGSm0>@4B!!j>Ohd}U=q+V1pTVeb%{CP{pSOL>c#Ik_|(sp?t;WhK(`@i5a_dLAnL3u z0c%*EK#MVG%$iF(Dog_$Kl*X^^YsVhxxvP24R@@;IDZi d!L9qQ{|nemI9(X_Q*HnN002ovPDHLkV1jDpySo4Y diff --git a/public/react/src/modules/user/img/rgzn.png b/public/react/src/modules/user/img/rgzn.png deleted file mode 100755 index 7f1616f4a78d980145c107e5c98a495f0e8b2db5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2275 zcmV<92pso`P)Hr2TH(prHh;1g&uN(+A3;{xh;@!6& zccD3eg7;^^k>?!GJa+HW|1|SW9Nw1kw~YizEK-UhH%i>C;J{p3TJypc4V zSYXDEmhL5n-A<$k#S!6OzV^1pyb7c)+D*h|&=MdgKS_YVF~c~!z3Y+YcanrtGnm{s zu1=>)?*Vj?F2n9ND(4klmYv+9$+AI>f&kP!Btzq%uhO%r8@sxe{y!-=HG>&DRy+bu zzg8g3Bg>H$NGO=2PKJc6D3*8}FF&=uWzB+u$sH}-nF3x7K+$B`s5F`yxiVdjAcI6Z z?;!!wpYKaQz>BmZ^JL3^lYmoG#Ecy)j>Dpr$`%sa$ICJ1`b3uEP+1m$Wheru1kqEx zGB_gIwc&}D`xgYv=+U#kWR(609L!IwS~+hh+T_w-S&&G|6%@#;b4)TWzs{nm$#17S z1_ysS8y8O15i|N`v6C1E{7SV9MV4hnf#f8tCf+Cs*4s+LM+wVds%_k8`t7C-%MLXj z%y{t?0Cx!^SW$sY#xSA+sg}Sb+vU1Qk!~W!Y0JjUvd0?_=FP$<09}=UG4ztE=e9!> zNJ_Bf*QiEQi9F!&=FIX{4F{7yQv4pkB_eU^?pg6Vx&mpcKGEN|C|uz(xn~r zLHDNR*EJkW?u~*)L@C)Vd$JtE7%H+XZ#SV#UXq>{(DCl><<~C+7}U=gO1VU@jsw!| z15#Cv4)^pdz*fq=Ua$b9r~9&(Zf-o7L&Z+O8j$-e)wU+9Fos^;BKL_+j$3l>6BjILy*86!c5zVit!hiK z#fJLBkldQgiTFg`VX9LYf3Hp0-Tz{24yDa9K{&QZBKL0x598vpJdu)jYXM( zeEX(q;nW1i{*Z0|n9URL=fHSXG>vpwR_YdcagqX=>Xy)^xKuy}T)f|NCa`z2xwe}d z24-mA%oUWPk6}@hYzF5whI+N?CDRHCRvW?@6TIis9OyZK{f8|6;pgAK_3r-tf3W>s zRkxZW#{QJSeKP~Z(HY1!`fNz9bBwLYd5vMPDK0y4847p-Q?x9*x8qDzB(x{T0@Jte zyXGI2nkEQznUG82WAx6OQp_2mCeY-TTb?>t34~JLxUYFTyQBTKI8f}@#sXu%!Pb|i zRs-n+-rU(V98-Q5(%uZ~$tXSHVAsyCz`a@3;6SdubHTybUtnPG^j>b!8fEV*$2rWB z8`T&ZkB0;mNE{(~U|_Uk^qc_G|KikY;;94X;aJGPEQ)iM8{nqHEl ze~gWNdA7uE+P=H(>vIFl&gm1d_|KwD41-PY$i~n+)TkU{^taPzbA=0U8QGJ}A;#Dd zGd%oB(`-}68E~ZKGcEcd!^jFGX5V3l74>sB{@K1W&AZw!&e$Wj1a7gx^ya6oNr5Kh z{37>iqO>M;h>9^a$g?85Y$tbgQSEoQF(2A|kwbkXg>U@zE8%)pe!;#-2=cW4I@~y?t$zMbzUtvA}H1PTrAXc+Hq# z^@*X$_h`kOe6X27k7jqYZ>`6oqr7JZFMWSkEOVFy;Qntt&+NhS|X4x5Kux+353L4 zNeJO$5Nl9`>b6^vTIoU;g{@Xwz**p^S%E*=bSlb&Y8^6B-nBHd6?(n z$uM(fzWILVz5L(z{REwTL?s~3a*0mhESMOUaTd&H1x8h&WMA8V0eifYS;`9qiSq$u z6Vo^XQo&*@03R`p0D}P0PvCyA=p;rv1I>`ihhTYBKslmm%Av)xMjRs&_}t4`}%d}H2|F?N&6*eFEMs4 znLYYXpEjgV4NSv}-PtUBKOl&^!MMPJU;>B&Mc-*?!#W`AI&b0_ zi*iA+tSkhGSoDIiF(}1Kb>W!-IwLTf_G|YDLJdG;t-C(}O2}o**UdW|2IRH`!zw}+ zW&^NX&aj%W`x%zve9dWnOzkA`gM$2&XNGG%!v@oEK(`WBEeo+WZg0-A91BFOSYo+a zq}!YZP&BJ?xtr;_x<}>}E=gH495}-Qv*~}en+4slG3=|{qMgoYIfntHPgL&B1oPnDezhC*2v@7BR zW?x_)Al3{jEn9ccEzqLt5?2PY#hj^CP8&-ipg64t^!=49(jJWunBVrE2l7@BaI2AC zqhugwT6U`3NRy9D(JobN>ywa}bHox`@HtX=nH3eldYdJR+?i5NLm>xHzpSUSPU|jHz>{`d+Eu z6Pzj}D!}+hr{xT~28t12Z7YjR%csvkx{JO9NsEe#(hfZMVCyu&w0%`cMn+t~Y}gwB zfjU6q&L2)o_?2D~ulu$9CPB^xFrApZmdcGV~4BZ@?~ly??}p@17DE$aX!wF0zPFzxKnx_()ue!g8_fAQkhY@b(@GU&Sm z5@70F{cxPXtpD$T?!{&mYzE&hFg8h0-MkwUk6L#JfT;P;u1g5sDbR2!h$ez@J~534 z(>Zpl!C?vE*NoZ-%s2_gM_@V%&=G<-$id)i>Vs)-IeRio)wYYhQp^P-2f#>&wRNs8 z%ZQJ~tpAN}F*X#tFeF{)u{gk*d`5UZJ0JMgh&N-Iu=*$x$9j8G0s+q$hD;)mLct(; zyk6O_aqkEyojt9s9jba>U##yaSkXR7fNms++gb8uriBdX>vWb>#0$*sz#%Xu#SF0F z%+$FtiA@BBqozZ@8f&)3voL}zc;7a7`x1ey##M?K-2+AK`{CZ zx0I9!kWVm;Wl$=Zvxq5;8A?QRDr&#R*_sGlUs+n6@gH#kQ}Z0g_`JajS>vY}G-1fC zNtY;d*Fa%m=%}V6x_2%WZ1s5Dg`?FSd?(niTwl2^?Sr_0se8Wv-{wvq@zlC!J5rcN zmJ?$Z0L2P;F7viiuv_B0?tWzV&Y6}Ybc+ooQUwp}>l}op+{7YyZF$YOZSeuKtN*RU zfba7AZWgEX1#5p1xEw535$Fam^b{HH)(yCmj=Cm>Zi#9&pk7G4XEeeYk|lgZLeD;< zSaPx;p}TbwnED}U&54e#!tAk0V}mUAmepon6dy3p^??}s5D4Cyd)t^cYtfpYbx&c? z1H{TqW*+5ib`QMM5rtu7$Ih;k@H{iEeBUf_szRkF}xF($>*ha>7KR;d7*TvsjZU zfEWcJfi%(p?g4pD_9%hJAI{G>wOnm4VaC4zlmtno#l>kGt?yp4uyty`^c||I8f%mU z>de=D-TsU}fa&6pD(|dVA1^RJ?|loP3tbw<)nU^WFuwsPdr0G#6vk_(j*osvRmG58 z!YBrpwM-Nq&kK^Z96EE7ujEAZkvR;l0nChpyuUPQy%3etYb!^vtu9G zWU|HFP+F6qokeQuO$GVwli0(D!hIboSzVUC)CmTl&E}2a9uZWoDch9!M-P&z+s zy{77s%zg0zv%UM71>Z@&O<$~HTi2yR6I+<^mB9?h2G^Q2hW5`Ftw{T3etz>LkK#35 z$*kzhSC?nlF0(kdB?r32gr^1X68MUWjoHRhkKT4zmUl<;Dt*D3 z+u^youjl(x;z44Z8?B)oP0F8cKo6$fD_5r7V1Oa-Axj>BQC(V@nP&eT%FT*Ge)IIPf9qqc6nPwAX8kmgWJc!{K z12m6Vd;)B(j_eqQq=#p5{?J_W&>9$w?0?F0i@787os>D@oD_+Is6{;hGdn98l)W>?c5 zgc*R|Cx{J!{=n8{xhd~Ce~cakl`$tT5mH=EP$n_UFA<9g08Id6bjZz)DdPA=kxeWe zj8HtG;A>dT=F*zX`&?ic;TYqZaiKRTacy1W_}7LCXIK_f(b%n78phd+37I=H==TER zIY`=@sEvC0$3GUmv3}T0^>yDR^!ZUlV*;uwx|S?yz04!TdS((NjhXmJfG!SC6YxaY zTK{)#FmqaR7#zwjyY6!Hkpj>+@Aq)h$O!a z;3zcl5lPt`NRTIe!Jf{@zV6aRZDmBfFzV<9^i*I} zqsNTo30+Sy)9v9PJhtqmRU|cb<=X;vt8P>55XPFRwE?J|0F00M>?V{Y42MERiNb4xb?uw268=PQ_ zk|1>I0&svK?Ffiou6-i=sAXQ{9m`h+}mW91a|PH!!?bj#XtuGYFztd_V+#`FyUp@@=wwg zmj6l+Gng@z80oepxehuHJPB^QW4QnOi}E`EE$Zy!NvDMJJAl4Sp#7Db#$DqC!x0u! zyEOy`y2XgOYoE+o_nCun{{V<(MQva5LYX3&E+y7eJkEnLyGE)#QjL0!#&8`;z^w9m zf8(M#EfXd4D+D@H`N+5{t##(z+ms`0FuLx+;o7a^O^bncP-^{OT({%A=Ko`0V*i|( zGhg>zaKRVGYFh6(iY9$RdK0ArDM;yOP3ucQ(kJhHNE!?g7zS z0y>H4RUs1c*ED9lb*78{zXNlo8y@WE&w`0T>MWSEUDsUXcVD%!$8500000 LNkvXXu0mjf?-~tV diff --git a/public/react/src/modules/user/img/skzbdx.png b/public/react/src/modules/user/img/skzbdx.png deleted file mode 100755 index 7aadff97ccc0b7acc430ae1621634d8984f3b121..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11933 zcmV;OE@IJ%P)A%%$Yy~gi$fqGK)4bD z0g~m~Krn#-1`+}oY(v1eu`FAMEn9~z>$0vH&Cy-;J#Y2YXe4AT*^^i!sr~2~c{Cbz zSN-OF|L;-N3}eUG2pnbv*k~M?7t4a@Mg;HDL%|)FF3IW`jbkvFYaV@Y2*F<55xT&# z03jf_&T0+j+;!<(79Pxiji%R(YB*@3Eqk^jg1IXHZ60bEV`4M`@LAV721j&sOpqlJ z-He$#u2|q}8Uq9vgCh68Hv*hlC{HN?y~GX z>jl%{{;&U-$Ljh_;xWP@Er|t77pQ*!fNS^4OIe(a8Ckd_H5`@A!SfAGTczNj1chk< z^_>C-x&bZ_5WwBukn`?K)h9gxa9B}!Y63kD<|_ZrDQy49!ot3qq=uuSDfmwgU3()Q z4*5L2!X7+W+?=8mgw%3VgbtXCz1&4}!gg^wAtMcYElRp)o)Ns_a zgk}oHb{+{1+tmOO6WH4hH2S5h@f#X@KGi8!K@+wyh-OF!3}ugCIr@af7Qlq)j#%y; zE6!y}n~EP*a43kn!oZ$3pd&<6${QTI_JqeRHYE}cB~U{qZ_=IJJ60rNDt=VLK~{u7 zY4!{3IRpevKx1s9%MibH7-&d@EM3kJ-AW%gqOAd(ArxV*T|YlNIa2YX9uDPd$a?H<1DXS5Ram>B zi)T|@_^T!$5(P)hA_>tE(A{PCpEtZy@goL~?hxQK0G-)+j!%nJ+m$GBs`4TIpKA{S zRjoj`-50jo?O=~P9iluDmLuL>5pX8A_VYkW`Tds;&s6+~fupIL$%w?I3wWJ&Ggn^_ z1_y`KBOKV@ZHrb)#S37a*AP$Y25UZCo}+)XGLT#84~LY)7OXH2@7^EsRS&mReA2=3 z=z8&OM;Omsbqec>4`me`Tu|DVBgFx@4LgMG14%TjJ)Gr;yb;|b$X-vG7 z>eBuwxR7>5HFEQVFM_h0r8Z9nv z{lZl1W8G;d!Q$Z%LVyb)T}-MIaOiQ63;_-W3RQcnS_E3{RD83pizj^!ZEYgqknmVQ z#IoALmRa`LrN=)NpPX=T0ZRxNOjMjuC}w1O28M&6Axq-a1$-_Bjr7P-z+poo&=LSD zTYx}>tP|Vea^P{Nfjx<^910F%B+MZ+h`L78yL08G$FD0sso~(|moB8@PC@6Sm0J z01aKzW%+f6Kcu>}*8~$5wG9kbklI$qvX@9ie=i0{RM?nI>(-ci$DG5z-B*G!!&;XyC$;Tr{HJ^q$IKrB`_3j-jFa5`K#g8~R$chjoX)d5RM?;F!hJ>tybU9Ht?EHq15e-42G4;BE zLf*r}p};!OW$O`Y4FJR@x1l}Za-d{)Oz(uAK`jrI0zC;P;NxX{D=jZ zI$p0>vdv@{Vu8D5K?OhM5rh-035bprJ|a^ zlq?MsGwhg_+={Xswt%(4q1;GDiguXnYG2I}pAYFTT&W9fS2NJqEurerboNY&OOvVi z!{s@K3Wv(rT0-lHIKpKsFHKK)SA0^#p`sNf8p0A1+pXBv#D;?&>HjHCpd{BoR#cDJ zQB5x#WH@qs#}0>bHEjW)ycwYGc!2G8XyOUCq3!r|0`0Q}X&<+ubZcB8P^RJq_Tykm z`N|s;mx><|a45Gz7J@(sSp&nNpqZMjV|uO;4SD~5aHzTsg}%F5fRIJ`3#@ZG#gh(A zw^Q+hh*kyzhs4i>6=BwHxDu0!A5n0q$v2olgbRetzLrD%-0NgGd8+dt14lG{PvLDv ztDTOQsdx=9c^r6&K?@xzlpQP_s#(btqQ^8@`KwnQTPi*o;V9=^%%Tjbax2Pmkf0#_ zp&%ejvb0b~S5RP2i-pzzkGdCzQ-%nKO9$Kzz#kR}(&8yqvl*grrRs566Ezyi_h>eB zJn40awMVNt;$2k#PPPcM+FT)D*~+WgQEgC@bZ|WIk;vD%^>Yqf&Ml$!>I*y1p~2Q2 zq(Aag8A7H&L7M$o-D06D$YpptR5&Q)bvx|JuW1Q%hX}-hawLNjt_QmXb~G{hK7xsI zmyXBXI@{exk3|17RLh~KlMW6QtlhUJyiC*BuPiQ>_77$0 zGf7s3(&dIm(TW|hP}kSKHgiyL(7+G~^gHwz4+lL#&xIla{*WLs7?(&J92`mvQ`k#- z#Nyx#css?VJ;NB6pL7XDT+_44yeccxr*ppFYe~z*wgw=GnO^zoRql$R1iMKK2VG=k zOK8^q4pzSXfPg=2TaNfV2LUoATa&Bc$PJOzXzZ}y8HD9XaWFV^hM*}B2n)F4EQf+a z2~PTXAfh6l!NZ}Vnve;UH`z-kAedic;tyUYTP1X1CJGL45q{;Hsec)p>IhFo60)COnQKyA=rs)n8-|#7?L&%A(pe zyqM-t-xHMGQjZKB4h0FV&f9(vvib{w2B(4FdJJql7Plf{h=#qZ{?q%~uz}-@S?);= z;l4!IS)M#c&Rau*z3|?y_Ps+nN%h)CKDHjUIIb2#yc>aa{Y53TmzTY6h59+@(_7Wd zaj@GKo+{5l^%l3Gp(n!8*<;D_{b|#kv1n#yo*^f;snbHH*Uodq!$E(aYB0J+;i!<7 zND0yyDAALo2#G8dWo{4OWc1k?*ZNMN>|nGtfMJu%fhSx#8ji)S5MaXwj*};OuGJ0g zeh3(bPU&l%;GiMoLWrk%r0a(F_M&|#kSI9hqywf)w_aI3g?*WtdE%RW+5#NAnk;no z@IFZ}<#y8D3>VFJ!yo48=n*(+iYq2G+X5Ead&GcnP)mRkq~vZ$kMxH_xf%kI#3rTG z`}e7;{*ccq_|bb)L65$OM-BY-6o>wtrbScn{gPmE9Q!TGiq{;&29DX;j%6M<`%u@I zKG5V-xEZ#@z79uZR((ANz0XA-IHLN3T*k~?YUUx|5v`xl&xAmIJ4aQsC52 zVjKsGa~*OLNq`wTLqI~qV-u?^hk`?T7D`r_kWrADWc&GEi$O3_=o<({^+=zV#lg9s zKp6O>QP`~kTy*FWsmuQxgvPY}v3Y&ACI@ ztS)ERcdT%z^tjs)n3k;}!$Ug3&UMg4sStKwn_4#Bl;2<`jV@md7NwU{g$T@Njp*meM* z?sy2X$LU}XJ9SnSH5m3EPX^0z{w!~U&R9WLh)lF42ahJvVdyBz%f#}9B{+NWOwrA? zS*Kk8$e_ckfh&_D7Qk_DfLM7IR%I8M2mvj8Pg+2hU45>Zj>E} z;84IqXV89qbsMntfPA~4+h8}i3^c^tM>4>1Zi%PU<R(A{r4w_8*H!)qq)X$9u){)&pJPV8U0b1ZJaw8&_H(Go zq(=pZ9iG?`3uy=fAojXAI22S7llBI&wMKt9l-8iomta*nl*0+vG!KKvU^sc23x6r^ zk?%{^=aWXecSO_JpL{O-E~(&HHqlj~X(%x?+nro^>SBET{LjOg;+1fyLkRKhj0lDJ;u4a6ie%NLovOK3wb;(nrXoO%I2o8FhzQ`r2Pk+4S zP;jVL0Ma7_(&3^Sa&P2n2ozZvK5RN3vL}UH;lxY>f87-XrQrWuB{kAJX&&}qlELBp zJsA7ff}9Mrbadn2&N>laK79$?zKlLbLRdIABP&5*>A&eT3*w2*3 zp!1ycu*LMqr)o8}_@%#1kk_?a^8H@jMV15a_*_W_#|aaRV0@3% zV_2L0Rn)lW$a=~^aLCY?3*@J1vY&&NO~yC-^oQdBZ$+842Q!UAOxDK9zY!0II$wHE z0)!$GwYR0z7fO>vAI+$%p@yVh3lkUR2x>1BGW3@9noljn>a{@hGumh5m1Kp324`8J z>(RTe{>s&}CKsTpt`Q}LJ>^7k~LoR3J!8N6m^_F-6bbm)i>hdcw@almJj&c9H2t%Lz8s~rA9HbbzjVK z^!i2nJNopKXeC!N5FFBK2-_tQ1Zw$2Ot?m^1wHQ%aal!{`H`5b8DVgI9x#j<=^sAy z-OCndrFo^f&>c=VJ>Fi+!EjI77jOCgVBmN`2>paV-o4%xY+V%p`gTViUdg*wiaRpn zYIZ1uB{*n^37B|`vb@A8!|Q?IAf2?ST3}NZ$C(Q?6c&WB*{p&N4U3%9;by&&P0S2L zEd-^`DL>N3LMSs51HcxwlzUNHqmRp>UQ`(&*%nDzxOi(qEd#46lGLrJ$y++ndGXJ` z^_3T9Po5x?VdPTCwW#B_AJn{g<8zy@MeW8tM*?KQIhQ>6q_j}iV~zt3n^u8`~9;0X6*UTgoD;l%FSqjx3_Y%bO0ADV}P#{Tg+-q z&~h-#D6*p)a#%p}iqEE90~ah_%I>)3 zMmQp(zS22=Vnk?t(&O|oqp1y9c9>X_O9?ngIHUNI=&R5Wad@Tzd!Viz%Cnq@7*P9&ce+{uuzv>=~6D;xh4YCddN&Is$j}&c$Zt13k zB9QcO{ASe$H+^w#{=HcHm`o_eAGfV(!EgSyUv5ree|&;KPy5BFFMIh@faI6_27-SR z&J<}!0sJ3ow@Oj^-fsWWwt!=Ob!${t^b2M4QfWO3llcoupOf*TevYBQ!44gQv1JoP zPA>S|xu_J4sIeMR>X?R%a5}ba5b&e`Gv+ZEv<~+$2h~^T(@*6C`{*03&@%)#RhDHN zVxJ_M?N&(89_->t49CRJdEnwd{?f%?{oZ3gzJZD6YGCtAVE)$Fu-(452)}-LH4vhO z9kePb0`zpek9}J{-)C&|W}XC?>tHw;jHnRg_!{cB{+?c^`Z=inu(?6tKv!SkNfu>X z8bh0(BhAfZK7qbJbA}TnJO>n{q&dtWG>2P8CsjK*CQoN@AFPGGs~py>*$5UEU`wPL zVPRs4qZolE7b?m)il%CqIOXtw(BxAjBI_jsz@c0drQ*pA_J*}K9OM!kIw+N%jGCix z(Us7|-7s9a&b-O^^Kb6L?CFyr=&I_rfYp2q9IAu$r8{uWH*Us`T@|*~AV31`6u_T> zhHa~3faDi%1K50WC()g_!+x$GZ1%Ais~PcGt4S~w;y zm;ha)eZ^0P!%ZUb~hJdygl&1&L#_=9I#cs z(joDo?7uE@%VuHvgp#RWQrMdz-6{52D!3Br{IGjBfX_UWkK%TY2{LvDHx zm_GoKog+iigIY6on6)x#R>bo0%10c5kR9cud;3BXFI?$&srQ5);~0tMH|Tj1w8;xc z;o@mv{C(O10S=c91|1F$;7Oz65PrSlCY*Qj5;zSFmw)qGe6)T8Zu#+@_~Ctz0pUQ@ zt#kqrYVBZUh-ha(beBWZb0lmrH!c1Jb=&^X->vUz7Cwgv|3ENyJr{7%=ZwVN=6Va& zExlb~D#TTADAO+cIigy?(jwSuRZFwK$T1z>u2$$xW#C!U5lNeZitPdcKQMPOgU7@0 z_@6muP6SSz4U}7Z(ZoBj*fAa9&Q!eqvA~2J;EaWu++8Rh0QDcjf-D5NyIA%#8l}jt zGO{j7YdI#Bu7nVm*g!E*$8nY8TTGF@M1YzfifF=5CIU_nA`2 z9S#oa=a3UezZ5N?bcimQ{L0rdF<;MRC1hI zYA4M$MeL;65=RLtYjwQ8o#W)$8s<;!=W622$iYraictlS%BUtY92$yB!+_AG=_hMJ zSEcGFZXe_X1Mqs>c;qMljhR!6aN6gW%jYI8JO$O&)loPCw(c+-_Wx<`0&*$6#|qSL z{qfNw(Qtt!w~KPx|(euD8!{N6`_E7O|7X)hz96M>|1I}5*(A)s*tL7-4qrsB_yuMz@kow}2wLUkyp-d==)R6D@`k2GzfUK>!_foLWulvc8QzM#eCS&?ON(bNT7s%Jw@kk;Db`Rrg`si>hrbJ$wUD7b1dPjK za<@Zuj6^to0KxB&7wGi%S`4xTN|@5m$mMv_W6yo%ywmZ#3TY3a zy)i?kQlqZOE}fzhb>VqH`7zyVerIE7p2@|7La^n%MXXQ5QEfF~f|iTD^$x7r&T-;Q z4W&g97~8gj^#l-Ev;;NXUc9xLWBz0fCzWvM<=eqpTVa(hmTpz2q*-n*BD3b=!wQBS z`vlHgq9Hd0DBmhTwa3||)WABD;V4{q2N>*r3|DGzHw@)2$i=Ac80l_Iz~z;?gqA7H z%l9A{3}Rd|1ac4OSZWO>RT!_@kSq5BkS)8ho36K!2<_(ymO-4o}8*gs3Kjs99udP8^2tKh8 z!LYzzHw$zIfb*9zWCxpJY~2E0SOjavObLj-X(Oyfi*Z0?NX=1{2b?wHEytwNKSGF$ z<;0U!P)D%ab|os>Al;!yn|!3ubU{z?A;&y~gJIgN%L2l|r%<)_%0z?kS?{;GSri}` zzRTmlWfRg3W{cF`!xR?EtQvHPZk(XcLfauH{=89OdI50iTus(&9DCn~nKu{Bkt{j! z`I*333z@A|_UwkW^aKc(3&!S6QstTp7on`ti5U}_y-YKDj6BUzRQfg`&a^?WLsomS zNVomHay7KJi7bgaC`@&yB1HtzW6|jkM z-;XU7X(*Y);O%LFzHM{Vs>~YUnqyMwI+-#j%b=`;v;xul*vLvMr3M*f_Ea5mL5T^6 zClv-bdO}i={t#8`?mQlF*h~wysWx(j%OQT2m#UBVMpw|OMjV<+&3_QircYp|PllCM zj2dwObygEf9mU89h9o4GHy`2b*;u#JuCJu$cEjaQl|t0(gM`FUw+DRkWFT%q;7GI_ z9|K~U)D|kuO;$ms!Q*lt^7}Y}O8@63bY}{@4xp0?5oYjvs9g7p;{}KMyX$r}`y4Lc z57ON1`usG*CEE#YlNhs%Mq3q(&RT@?=A+x2hOJf=+;CxmF%9nadKj&hh~&-&Pn(GK z=1$Nq*pyQ5YIMpfZ_%`9^>#!@D@BVw0rw3mEMdaHzk(u{Jo(68J^7N4qdLRgdNMdR=1}&V$>)%n(B37NOY@h95nc zD)J>rj+Qd8oq-8{yH)q|%)bVy3hTDw|1REaf@q zAm2^8gN}Gnsz#VVQV~rgbRDYJ+6lE`bgbJGJlmzS`}2HkPNqliUAq!JM=jU^XX6%d zcc#=MdUrRR8$Lp0eknvoDjbcQAq*EH`3td+wV~3g!)#+R3iaF(uQ_TU#N<8&Hwt58 z>%VEgB!Yuh1ZnZOw-p^EvF-UWK7gg&X8b(~iPG$9KVK@tWu1Rs}E5@g5S+vt} z%p*j<(Yxy5Y$-=1s{~d`0bJX+fdzXIDO~~vKO6_Q!AzfoP}Vf;wD!qbjS;u{Z{%r? zNu>uNM4nwerPX1ABh(!ipv6Zl1HeJzl>i~D6YjYI)gL@C9N|#s^!CoqY?srxJu}7l z=J+(tpoP_aI?x4&vvnu*?t=&xo&qfpglp?22uhmGnGe0Q21a`g!ubopz4`X%BD#`p zEr5NFF$y-IS0{4YcBi(>N|tGVYdOV_am}!F?d#XAFI>YX>V6S9cpT4faGrW zDO`9b7;fz&NW(p^fSVT{77nr&q(P`^D;qtj9Yk)RwF1>2CKViXjjLDJxUGV5H>SJU zEfX{J)D+r4J?@~C&VhXb^)&*MXE5Yv)XJte000hHNklou7*=?S@%|4S#Z-Nl__Q`WZdUnAwXMW19$XYpBh-jUKG>UR71c<}40=wQz zIylsIzO~C=pfl~RY_E3N#0;HDJrcLc3rVXzI|aHs1xn^K_|oiqyr@ILp^|Q-MJSzb zZ!49I4aSofeHENP-zR+@35H-rdc_5WvXu9rfuPPX)eNKxaWrbSCP`{I)Fl74JaD3> z%^TOYPc>y@4)^S&rD!NI|;^+WU#6k=LfZPWmlP023=y zUHFw?n!WUHSncdHY0)eQUfw64K_F26LLQXo@Y>4{D5N#%wu-Db)vnqBWv)Yv2sos* z5Q4q6D|m(5fu9v+7~?Zj`nj5Z+Jx)}t!8WNviE3E{U!tlH6GJ5v{e;>L^~a-bt?jR z^0li{zy6h{0!5n6XKI|e;&1wMymu31C|W4D*p3z1;xnXFJD|P{Y5}C$O00<|I#}|x z5&LHxKSSl}TZfC-OvHJtE)%Ii*7JjOk9Nc4EZwE_NPpo*H#bgrLYEsWfTa0yIv3e%wV-`@K8>?T-L+6;)CSSJ`+1F{r!kVT*`dd`z(yARSG zD)~c^3h52$ZXyq0=X*CKVp4|Nd%V28eVUUwe=#mizi?8f4n4j+W<$h&CE9SD0@ zynUAC=>LKE%I~^zLjrS|rllUg?X8PS?*hbs_vt>TNvDJKhRT4F1(ACvMO_N1tDcT% ze`y+t);m$L=7+=WQ=jPbS+RPxu^{J!YkUs2Vp@)oMfa4W&r5$e`ZPjEqm`k+VTVeB zo&UcbQ*>^Wa4^R|etYXli@yzFJsj)lh&B5}TL;xbAr-=^(I#m8ZMHb2ua?^HqIvhQ ztgR#(5PH9tKJLtBPW|>ApLTUomZ8_RSvb&X_1!Q1Fxx&2q&Yt89KZ5{aE3ZNi(dWD z^y;Bp%dy{5WAfse;MUGQ5lgTu+9nw74x=-Y%|3B|j&ukuMet?--ECB|zW^=!ULVTI zkA&C0u(5ldZfFk(AV5T-NR$>7j7L}V zess|$6R~x!1EkI=8La6EVO3SsfvXoup; z#tvkpI8k!bbA8W~A{Dt8NA#fby(`7egP4(B*uP^|A}?$tyw@}911D(^4*_Cv(rS*@ zXIG>Jd7$2%lH%*J7@k^Nf!kl+j1X;~BNtOgw}}qO4S8%~N)d{*8nn$)=ymMhdBI4S z&_rJYrQ)CZTi1W+hW0ZE5)jk_qE^X;gTF-MuImy#up{aHUMLf(-JSkBbPd;bg`m?uq=Jb%U;7W=-z_(k z5Vs;HA#eJMITJE&yXN!7ID38(E_!?u%3Gpc=p;O;zCw@EaL`gQcP|{lz)fhXyl*5; z=HKgD9)7=TR)n)F-r2*}ympoM&A->*iQ4xBy?tKsj{tFdZ1O23PPq-LrI6MjF{&0j z5gf{`$O@DHpV3}?V>0*SL6`6ahN@Sn!upyU>bPPNF1TuN*`OLP|?5~LKx z_yhBBXm?qHu4(LT5;OvdgyRMXZo3Au476bjrOZ_czq^ftn|5JEEwZK(zGVtDw0nX2 zLEi{4LDxR^Hb)qN1i~@nDhTU|*yIx&6sFpXoCLaBIv}{c|C3sHO|Hd^G-Cgb-fs1= zDH}E;kVrVb1Yy~_fhJ$UK{|t52hiC}x2>~phautc+KoVFcn$WKpFV6xWb8y@Bak>a z#+57u=j-jskM09T%N1xl1}@g1tBG!_bX5!v>MbR~YKEW0{_?Mn&B^c^fyBX)J}(ol zo;G=j1clrrPFH(%Jb}(8sdW!tyhCvzm1ItME2SmHnpv5;X6z zZxB0n466}H92|MY-vh)wv1lbV+g?G>Bk!QIv{p6@t5F#{ z8T)gbuyM#Qej7rZX$#J%uQs3kLtb3>&`z4OO!_kgFqTpc2 zn;zYGgEq-e0aDUc|HcjIY^Iev_BN7giDV3p?TI>vqaA~>-#g3*BxYhJOrMAd>SBL` zvY(V5m#K4H27gOt?A9CcaByLvVS8K`^4L5Lrx8dD9OGus0T1`~W6+{$%4N{9NFmOH zzqJsYKR$rv2%~;`zm39%)9{S$bNM^K!GM%BwL>7l_+oS(DuJ->2@IO59n5{?XYkNQ^BZq0$OAO|{{ z`@kW$fD(I9zkS+h9sJ>b-HC*Q@*G;MMUcAAxw#v)Tc-oaM*8@c*yb&iBy*;K33IP# zD4#Oi2WhmPU*h1%FAhNnXRJk#_WI)1M$~Ry>TX4xx~9RW^YD-E zcyz_*PCsYu2~+U_vv2q}b_|mdNFW^3{j?*Z-6EJ}M=IQU3w7JhH4M+mrr8s_!()0z zCLB%=ys6p9%E@cLAC@Lst-<=2cDF40;Kb%AKkll?t^g+i59{j#In{|%* z**VSwkT^KE8YRl4@}6~Eh~YjA$FdS%|q-`+8AZ}s+Exv3xobGqE{ zcv2)FDc&^mt5}Gq*8KdJPk!Xk zHQJN2+VbL|8ELHL_zltM{mTi2WBOwNzM=X@S*RP=Tzlv0<)>fJ*dGr1e^*D7M?Zw_q)jtP#3-Vn4A`xgy{3*P?YT{B*J z;+7NXE&&dQQ@V+HC!Sk<&8<&tI1(Jn-N@HPT@S&bX`tWz{nUJRaA=n`_Uc58z)`{> z*xjpeiq7y=4ahQd;G?&mnDBr1ed9DwiWeD~d2qQY8gcpW{N4IjhYE+GVUMBV*%<|6 zVQnHN`Dou`$Z-7R1u;W+;WC|Jn*5a0t=n|q{XhL;(u3a6~i>uV-3#rMQ?y_lio`HIBW} zQI5cn;J9t2c*cm{5u!gFovr&^zr6X}(;Mq5vYk#Bys7Cj3wq*Nmu$Q8JNK3!4i3Y> zdN=TYi;9_Dm>WBW%?Jz$juk7#4|N^0`)G)$s-EExcMLzO3mu)6n2JoaJ!p5KO}c!@_eHo;a4TNG9lp zY&rU0-2E?$49$&`3>|Zw28uL>4ALHkj&{aS>2TsNmo8;?i{RLiR3mWAa3s~$j-Bj~ jMqmt%Ar05)dh!1UaZxyT5l~G(00000NkvXXu0mjfT$j)u diff --git a/public/react/src/modules/user/img/ydkf.png b/public/react/src/modules/user/img/ydkf.png deleted file mode 100755 index f770ed94002a023674148098ce687adc1c4f76e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2523 zcmV<12_*K3P)XB~_)WRnms0B{YQa zGA~1UHUScXO(7HvsS1?Pv`R?(t=|$7FweT;v0m?bchY&UjU`52 z?fCA_dhgHw^FQ}-M&RyIk$||%r80rLV5%r%Ou_7WPd=lFo)!X4mHr+PEFr*uQvo2Q zUVc%~zj$&&+gPf9Ou_7U*SR1BW&yhM z<%fU*Aq_$n0u3O9i6}!#^pa8v3WBL9?zjs@!(s-KEK*blC2C3WxeG^XaHOQ_e(ndg z_xcvh&i5P}K%~kS%n)cB6ix$J1z-+HyeUYv5rxu94p@WN4Vbe$3&{orA;J>!dywL3 zQZzw>kp$9Un4HKx_rrM9&tS3us(ryUkyuMoo$(+ zHP37{3=N{(bd~WL@G~ogeaDds137Lpzq4X~_2XLqD~7*+BnZrzF3=D)3_LiRnA_l~ zNk4mUDtRVNv*cPA@Xdt6KmL`6ZIcGgih2Gg;{c3QKs*dAm?bc+)_Ce5oKYBoaMgG1 zKN4@9wUO>8@TZf6{p+9B`Cl=^z=#sB86z+!-nNlWDFa3c`!_!uM_}g95}00Vjfq-3 zo~)XyJrXC*lz<_!m;HRw_)ttN1kC@8K+~rI=HC*>PuobRSuxtI?H8UM4`3t^3lZku zYmEwwWdW=Zow7NTakgW{T$kuNl{KNnuPd^b|FYiaiXlWD3B)}xb^m`TW~efP0iZXj@cRBVdU_<9 zn*;dncWNMllb~4xnjb^-!v& zj0tgpTelVV>`md;ErrHL3r~K(4h;ESO1H5d+=N@iLuWJUt!$dP`e zlHNE5_Np~L2J^c!28=e}umRItZy^u_5{Z$AOf@hK^%i)Hbm?*dM-G>RS-sBBU`{ib zVkj+|Qv}o7JMxgZBbZACym^ShNWHoaMfU3Tjs6X#t)~V|C~;N_0*k&JLUV&r%$S2Y zm@W&YH5+{lX3NQeEXiUhwU&UX7D_j6Rt~XB?d(Z9l)4Kz+{s|vbWLQh-8|L5irMlf zRt$#{dyK#%_qmF>gZT~};d-V#Y~(x1jAJfcEZ|UQ3aQ?r`L5gIV=(Qjz7h}&H--52sW^m+)L2+N&jk}0J(!s@gIMB$`7n>pJ;hK0gW2O_Fl`+rU?Kub=G9=vbYs4} z^_m|b6!hNoCsT|Lr65ofF`;zvqdYoa=|i$4D{b1_-+PKNS!we=KZALV!KkQ{H|D!!egrK|pMuAHkVnVvJ|q(k0(yi8 zd-H2P2D5f=rc5#4dT8vxlzGetc^ufqig5YGxAuZ zYo0;~_LvVDOcF_V9K-3l{f%b-dd%wG{YEjIt|Jy6TV%j^MKGf!Qj4UYBgaq#UQV5gl-B5CCcuT9N%(+{8S6Vs6 zRhe35Ug=eNea(#?2j|XYkm+})1bzqeQagiDQC&Bu2tlq^;C`1@S$d_Yx}A#=2|Vf4 z^>qrm5J)reYVO>@p)Q1W>-dyI7|5AgJ$Gv1Z^f+Gl+udfN=k;K95q-}$kmvY0C8ty zQGrN}KsKY$pHdo%t`c{Pp*0YFUQ`%or;_=W&%ta+WtCD<{omGQrb7#ri*UH&l0i*t z45D>O49zV;T)*PrR96N)*9vY`XR(alD8?QDQZI&kP)z5GkOoyC3A~sU z3IPwyi(=uUam3>SnGE4CCo(v9Hlstu6a~2<GNIyL*BfqcD8pm`S*UMJFVZ2r`Jcg l@;aWnG&bM$E|@AD{|jaJ@1b0oE-?TA002ovPDHLkV1iQ?u>t@9 diff --git a/public/react/src/modules/user/img/ysj.png b/public/react/src/modules/user/img/ysj.png deleted file mode 100755 index 17c08446a634da35dae89ac02c7800735d1aa0c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4031 zcmV;w4?ysVP)pib^h*Kx@X_D%t)i1K^lz&LP$a;Hjp^+lKe=Ov51|el9+PH`Xh-eE)qLK8KZ(= zh!!xy4tCirvVannu_7;6lm%#Igf+WgIputX+ z=l$vFo_??2`R;eV@0@cV!_-j_0XBt8VFadt8G{*9z)S%%G0~V}%>M_*JiMK1OqOmk zm{>(btA$`~446xTs)<;P1Z7BIh!OP&ffE1@2u_DaGyH7(oz<5ow&qv&?OzLH9@$M5 zG@NJwvu-D%PlISC36z6SLPQn`00ih)lCPYIB_TvY5Z(u2mvD_|lZj+!`#;qWU0ulI zJNrWg=Cj+#{Ah(U&k*z%0Q(aXm<6J8A^<{SK;CNv6p0NWNWDt1NFV{C^APmB`~0|n501hu~ETA z2LTVHdoTUGy?uV_gN1$Nvpy7H9@=)M)UKTV8AH(BL}&rQl!2;%qbU;s#Rn|-ZkScs zzvY#>iQ|4dRk`&`Ut*(I4s+t)m~>z^?xeV3WY#e*+6kBs0ah?&Lg^INnBcp4spbKz zQ%lmPM+kPG+duMTdwWx2;-MEmV^V?HwvEi*O6Ly^Vh<2eiv}f|GC_(2py-tGg*OUd z4iH+DqiILzM%w*%H&OR|dpmO{6P!r|hS=sE=~h_y79(0i0!AJvUT`@Ml&>)%;SGZs zaxLG%h&T=t!xz8$uhks@laNo!F=@a&`r<&XFiP%Wggc2)>bp+Xfuc_1+49)J>$55% z*g1l%(<%+nlSw!A<@I+r_Du>Z044<(B4Us1bUqH?+aSy-lrj+@ILWW%yN(Lfb0AM+ zBF>cSQl8!r(RuFjzklna z%4rt@k>?OZ*u^uMzrOFj8NF94!dDHQM85&zV^_s;14jRUjcMW@XW;>RR>H@b2U6clt51)^vQ62S4EAl&}-uh;MUjRUiB zNAeaX@H7#c!j#v2Q8-1eP~{eMDes(O4i*AS2DT*X1RGhz!nT4ZfB*`-XwKsQ9iFp%PzMUGn>U{5=Y;s6@lDOAB0x8e{J$8a!J3NTJY10;}C^^{*1$v0})#oiKv zcDv;MEa9T(@yEyR%EthP*f(EFHVN1M93%1Pg3}xZR1(4T?NJ3TfQBldZ5}YIfq^mL z{6)giZo>IK89{MjQ97}@tc_S5uI0{agl`UHq-vJAW$C_uPj|<3K1vNR{=L%!?3W)fN5rdkv}AXNTvyIb_pEr6c`wk zOz_gGfIH>QW(xL6#WX4>ojhO_ARMqQpsvBd4Xfi=zQRUL9fKV+;ARN@mjn*&O%J^O zTJoNLp4sy7!_7$B|U234QUNT2tLJF@s zbatrsnGE4?^Q^C%;I6JZ_=YbL`4dmhpm()E}Rxz};*;u(I zh8c|}N=psZR1FUabiL_f-yR32Pq`vFLi-tT=ccC`-;4nB$gb2sFtBzKR3Cui_aa`7 z${(z&B;2%wVctwb>B&fvkVpZgaScWy38Y;@eKkW_iPoO}K|;rIj?ONDkx?y1hF=*6 zle*k}rg6-I!x|$=>FJ0Bt+dR*-1&w|n|TW?R8$)J{zeJs&T{PE@fJj}bE+?#QWmwQ?z&14~9d8r5&k9tOXka7= zl00pT474sXP+2bJ4j4%g-Z>?3=%|Z}7fGd~x`ALzWjw;0GguF4kxUzTO*_UgZMvZt zvUHh^>S_klGLTLST)HUm#=bN<4yJMWqEM+M?@gvY5gZU+-0=Oz+oO#6-&7|EEhL3I zB$Nsi4pfv7Zfs##+-x8o1CkDK0E@Hqt8=h=joCAzApaxB$T|!As2~4R?xM2}P>pVlHjFSdB-xb(* zTwr*Vly2yav@HGQ3d)e~q;u_=Y zhzzW(jA7w57H+&LhUPh@dM~Mv7$KZ~*HvlL^|p)AVWG6mP=c5RMTw%0VQ}MK&ijwp?;VHaf{G4U)yqdi7xrO&Is&1CNMCpsi-?ce+Bh>Dbn(M306fJ!?MLD zu3KWFx{ARtpjg&*ievvl7Z-YkVw!&~dGjhYJPlD{czu|EP5J*=jA3S@fmLf_Xjx*R zvP$co;}H6KmD}Lh;WP&NIYdU1M5lG&xWT;#TgJ(aPc@ZAfZ6n7YJ>@ttF}T}GL(*7 z+YFULGB}x1r_Kqyazx$?FXc5Kg?2!NI)_-oL<+ zcJzHpPy&hY(nl|7b{`#t8(0f_a zKDh9e_kJKtae0H&>I|$}VWMTBiSlx$m@qgm6w%6NG6E2AUcT)n@d)FL3sZ zz|f!;zw!zL*Dkhj<0>07o232fYm5vFoa&ZolSa?4e2}Hvcy)xYn-MTVpy+zDfAiB# zby3FrFm)J2*Kw{(lDX4?k1S=Vt5jO7`kz-0bDWc#6KaO(J)%)$z#YtHyk1GTdetTS zmM%7N!}S*G>X__XRBD|*!_nU_uu$4-g>FjIX+qaY7q9L~D-c%S6vM)WmMZIIN+y$p z-tz(n_B!Z1mQg}0(@dTlPC;KHBBhAZmOvK?#7=D5+PEwN%;p!8-{S(e%U#6T4ZzK< z4AW{f+I{_`(x>OV?wIpH$r0XS!|QN0+C1C9+SN9imDA}|km)MZ%s*s+a*WZ}Clte~ zs&yL5;<5iS;b=z&uOD!5xlgFiq>5-;&FWIY6bfmLZsjP&h&{jQnWjIB0Q2zk$-guR z>!;Vy%$wU}RjY;S(h%XbqXMVileXxAG65i>qO1j43%kDgx>|-+D{U-owN&7qI|RU} zoAhv!J((;RW!jv4o8#cC4$hwDNF{aAsC6V;4`nqZ1e8w_&oKN-o#c~Spf7KJX4ZEi zzxs3k#z$s1Feb%saD`U|oqDE+lFNOq7*C@lq+ zw%WMuwwMAZ7;=T+QEBDqs`cRBG~VgVU}RXQjke!xYmhe)@GF9RvDMfK$R6kyAnR{7 z{Xp+91f2c$uEDySTkU%m%rL)bnTQQ12!}caPIQx2cDWb@_m0QE*R0O>_oV&d5hrBQ zgxVSd>+UE)bF-NTjMNgDPOtvb!R!0eDuuW!wEc!$C8*c~01Bm)@BN`v1I`2VFUQU| zJ^S*@`f-u~nBBX{TD#i$G_%+P2?q<0oD|m4E}^Sa^^0Cm#T+Q;d#J#Z!L5=1wmOskO0VPjty;yt@0mvt^z9mxP z-bc32z7%L%IGKs4^kTpBy9eGBf7|^YZgo;rUeJN^G$!2eO>E0UNrG1hHqF ze}RcuTx*=Pd1=`{-Ra=1;~7<7sVSt-l<>ZHp;Ylc(^?WLG4xuGG8o&_L|=JqYva3N zETR)U0P?A*i-t3Ictrf8X^1<(F+(og*weM~ZMsK#Ag_T8r=~wcuB&HQzTC#V`6euz z;leqNqlYu-`IQS-j{I{RC;VhZL9q?W{SYY1gdn$Ze~=+(!(&_LM?i_BQp5%TtbdAX z?M(8Mg2Wdfs0{*Daz{WlnPY9gdQV!0pQOqc;gDE+%=7CVS>wp>+qSlBX}g)UoUqBx zS&vA)or!D}8>Et7#TIrT5^~6d6oCyv;5cXEe~6Xu`sUL${kgFh1xEgJ%NDXPo6cN= z(jOJXe$OCWM}lTafFNYW8SamCgXZ@)x~bH diff --git a/public/react/src/modules/user/img/yunwei.png b/public/react/src/modules/user/img/yunwei.png deleted file mode 100755 index 4e0265efec6ced2c56da29ff513ccc23b0967c23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3512 zcmV;p4M*~cP)AOpmJmv4^YlRz;KATxEISF(=*fE@0)s$?sMf3;-)hX^;x8Mgd3addETKXpBQl( zAmTgvZ~T-DW_^p>4ua9*m+J>smNMv?Zw=f60_%_m51{zg;e*JB#qafDiPzBs1kM86 zjc4PGHZevj0OJo%N5$bqiwM8td;gRUrqxXWNb2t5yHBBOfh%ZGd?31Y$ZG}Q33pQ0 zJ!yH2u>%Hi7WCNhOr^orF-9H+^;$v5?+)#){$%rJ;(cE-R|bY5DPa`Wm5|Q(hw`nU zfOSZXQC6gb@L};|`j4gc955Vbft`q@%?w*h7#bNRpd6UTe(w#8*tKX8ala3o(!sR2 zDaN?PNOuk(_#&AnzJpxGx110#4T=sZ|8Wk`fvoE+KsJ^(V{9!b8X1EHk5R^O6dqgD zSy8iX%@ZVZrEp3H^ZdWKD>2QLd^lPJ^0i0lOW-m?X-uIA#NW%)T#Pa#p5y%H5G(`!o z28eMm)LD?}k7tqzZyk@4jKXBXqJ(=hO7Rt=bd_tzUtO}Ks-sjmrGwe)C|4>FmGlUt zh3RjNKzgp?!&MeCD2L(ZAO(283-{4Xf6PwCJsy=7g2Li71Q!K}QPN2n)@25=FEllc zYcB;($zay)krq>O1kyA}99V_lkf>?`J1C#gU~!S9hV}EVlV5k$P8fBcLCkr8SH?V0 zF630gCXBI|0kpeW^3NqpMz%x?X1DH2%J=<@_evsAF|qX%zTn%}+=}8j9QMeQzpeTA z`t>Y!`qHKHWP%V}4j(<8CWMfF!*Q&1Q`5MCXu<6AUFkbO$&WyKSk}XDC={#Et%qpc zJ>ke_2EUlXoEtn6o zGAb3QfkI)q5D2{<@-;(&qzZs(FvKkaCqt3RYDHurK;I_PnsqV?XX&!Kc(h>N&&sHz zesQke(X!WKS#F_fS!oQn5{m#gPPTCK^)Z||@1k{o7U{IKp1}GBg>bDB=a37*Vz8Gk zuPcuf%-Z*|DbQR=pcjUI`=D5U5*$u15><$I9g51Nf%$V2xORetwssG1yq!YNWeUq6 zp!~qfN<|ho6d>O^rOVn&n?^?rW@k3Vs4NLWP}E`b3q#5?RelKBM*-n~^n%gj;Z@!< zuFk;12g*=UZs7A%4&L3B#y~$67UTae&sF-PvTK>MaCpe#W!Z%zW!CR-RtF>HP(h4UA$O{VZ=r64tU5Y- zC_Xyk;KW%EuEW1*`FdYe8z!1~WL{FZ%l<=I>~2jXZSztYh?@jcr&ySCM;Yqs4EcVY z6fG?_jvjTC4oUqA6`g+R!C)_66E&D^nG|Czm&d3?O+cXxm1P7oCYhMtV4*Te#I^Hn z6#EWmap4;Zk86Y0=;k2fCUEC1aq-V_8Mf|BI*xFLq?CUBu7urmxN z&bs*In1ik!3f^VomJ&<_JSIR?mK&HquM7>>Sm?gwVPkU&U7enAM?Wl6PriOst%2Eh zCNOPU92FIYaHUfxve>!9M%&k}utEVRJb|#A)io5!31(4wS!^hv~;2E=N_BffJ`3ytCa#f4|frz4{hb$w5{SOrI9V z?Ac`)InogBbL>bKTi)zPUoVBpf$C!!#_Xo&#zw0#&%B+M37+~9(OR1lA+j7%Jh)V4`~u$+LRc6a(5Ys0qki>nN^K z)l~#@=9FRfoFozng3b;P>(^dJcc%->lv)$CHyG@vpN|^M-_v;-!{E6xPxF*MX0 z!j?O_xvn@keclVwdXd;E&ESAsm!d3gVD4QB+%z>Na-28+krGiy&vW#AhZmXLVrJaL zEhZUQ%+bSHY}w2$#)D~)(4Y<+%=(DIta^)Uj1*u08xa}MMlPB=m+`HvWhsXEJX7-}jFJU+i1S+OB%Fk86BsLWRzf^pa4fJRmUw@!^=$~6{}34%2L z;AdTYc+f#d7tjBtTlv-W)e}rKKA1$ZjNrhb4Bq=7gH(zN7n6yiY=#>qaP?Id?!C7R zlP1Lwvj}?oC_devM(Z9M-CeSD@P*g!F#37Sia(8uR%2E+OIH%D$-FF+AC~7O6$yeH zud^_7Y78SPiO7P_U!-W+pTW8Fp3n(?SjzziJ-cljJ(R^jp9exz4d&0s{V|UGoc78Wq6YIO2Sa5ZQ(#cW zzhQo$n8`4y-o&h1;uu?JfDquqMT+LFvSQ|7%gYJo-(QZ&4Kegw_OS7d0bKmXgDE0d zF8P}{(Za%o6&N+j6adehcJTfV8)r{DaI#c`lA9<5qhjgu_R1F{2D4(bEnF!)84Qc6 zEFPKA6CR3Z-IBnBaRxfOD7L(7i;{pRd3B>q{GzcOH6u)%{KCOoZx5iim%<{lj`A(0 zzTQM*Vb@_HVd(s$PxATXKDw5ENEA*yVICse{4lvlOA_w!jvKYM)6g<}IC#{nvdbq+hWI4c}CldzlyE}oIH^pJ| zF#WdyoIc|Q>mz!#%(Gt(h`)!>AE75&Gd_RMCR9+$M%Aj9#z!l@O`Gf#sMMIy>?brm z)C)}2ZPQwzPL`pnf}ru?a$MIC!^JiiuWjl__a)w~lWvjU1q{ZtYMCH6#M1%gvTJ?C zgy%7u82k*LUa zRlbhoH{yK_RAJkG=9P%SEPpMf#wTjzkv|YC*trjHGf0;LEQ@#NfQ-$+lRZDTDYRxb zcz-4@0;%yyZUse-Q`GbS0hm{~#c1KW*u=09pgfW0mLnkf8L?k7Xl>6yE>mPa9#rfB zjGT*cS9<2vh%IK>%L6i8`#DUpiJ^Z04UpK&^Ign8e4&V@H_Lr(@>fa*h2{J(9o8A& zl~%tNHJFzqn9$CORv7wKcW&cAne$M9imjRD@8u1SIQcDxV3|oGnK!fxX-t0ZqCMAiMFA3pmw z(1k5SMIc|dRJSmwuo>E)-Bdp|(h=<+*Z02y#^%Fg)uD8JC{fMdyv!ez`K81l;T_`6Ux9Yck^Y*snLFCS(Pl`U{zMxMj;pSjxr;I8 zt$wuyfSwxv|M+pmpNs!Jc73AXQaKlY4gF0=>|ODH$Nv_4SEAo)pG!2Sx_+a3rs2osjgRSUa|M>n}`3U=SSqH4~Lp}G#VV2T=HlL3~FNsQZG&{z+wQa4OT|xRuh2X*|TqPGq6w>A02Si(6~OX$5Qi7C-yA`>P2<*T;Xdb+LuoQ;xnjA@`_F#YAkeHv5Rb zCmDI_V`B-<@khtcGx{$2YUt~!UQ=jGK6+G1_V#4w8x4+OBgXp-J>sSZITU&S_to{a z$Fsy_qpa_IJzpO`l}N-SdUrCelSg=+wtYPZIDFqmxjeSj% zfg|WE$E}y0kBHU|j>ZzDA@@t7fMx62FgQ|C?i;eO$?j>c_a+-xO#P-WToeQ>|EUBk zHg3sG&N23?^AT?69I4Q>$*&>K@x}MW`0~fCkfaO~E1^I+9=?OXVK({1+aH*G1tgK- z!!Jv)XxSFXat4B9%9!&JinN0xIVqd|3R$wjv1IucNErtXe>tYyksde%q3IW?H9gTx z<2#cihD8L9ueW5NSVv)&esJoX!?sq6v1IwyOtewiA~#fLY8HyiUJC6`+XreT`Ck=f~IRY_lyB}Z1P>u8Z2UJk276+CT`po zAg95|G8-IeiWN%C`L(3HEHaEOd>Ajk_BI5Eih|C$7WF|-FT#;9KAbTdqTotMwN&{+Q-~INSC2!|6)UYoAtgV@juJqW znqnzac!p)5ue=hl;@q-C0hfZ?pLiQDzWo_`cJyM}bJGDN$Y@L96-{{wVYi@l_&F%q zCp{+^P2Qx`kAxpbUEgRjo)Yh2;Kp*4UUpV*PRVkx+Ps!x7Aw11(T^@Jr7 zI8xCUQXOY1*VWDmB=0e0Ri_5I%+@*51qUgldLqYh%moy`D)qUQ5+z#3>kM|HrpZL) zZC?S=+CLd7V3_!1^(LHq;=$O{;RHaak8|u##JX!B>LP4i&xl=bpO>O(+o`~#+LX;m zKS!G2h>4Y7%YANG0(weok{3Z-5aA zf@xu3;2&T(@_9f|j{yEE3(b{~L}JC8o36FeO8guRq-~>aqXm~00SdEVZ2T7CRiA)4 zJsb>XC;-pkKOrb*fr$dverI6X%Q~Ei{b4mM%y{&rH$A;*i0+M*-gKBGwSzwSxB zqA`O_S<*Qw(n|Je6qOrzvm!A(_V63H?Y7G(eIMGkO^B@d1V&XQl!K3iQKcn}-XXCI#&xYI86{cxH zuj#o<7pry4m|9P2FgP+ZpCkS3^Tw@g;=5IeArubdv(LW88*ePY>ecIE7zVsqZn&i^ zl$TfHjoJ60OGg*>l&r^|NzZXtZO4l)K&Oj_LJ%z6cIO-T@rM$GLS+a9N@1EhJf6298WEO$d}>%9!SJf)VjPS@1b-89fCZ zxblfGzdwkpZ@2_kUp0uI+qQHuwm}!z35?t!*zfok&Rm0#^nR6dlk|JM`q`cHnT!Xy2ih5 zc?3)6e+i|d?YrRFW|qmpp-N6T9d3kzVO%)k9E`s8VosS~-kgE*86O~j$T=wZ+h6!^ zAAkA-#{K&>Xu<6;jR+Wv=70zc5uYEj?83#DzXC0yrH}Cx%vgG8y5MN{kk&&A0>{W< zqfzqnHi&KoOr}ygjt=mlPCM%)jKB9v{F3Do*h(|| zIUK5pvroJdp+Fc+Vi267EmnwraRngWtd2PRm_sr3@te5k;>Y{$gZ5J~1h)%EJ@qID z$4jp+#j7tbfYaqbpt2N!s$HCW5C_u2Vdz>AmyCP~l9X%1HJM&fTQN;`eSv6H9PKi*RkN1Ey)h>+JwRkkF%NH$4CH9iT+3?{B{Y z=B_eM_@iI^F9cb}qmO@p_uu&fszXKT_O;dEGBgdQt|Jt##6=^Xg3Hx&-vCl^eAUG< zVo!+!O}d;T!`G1CVQ8dd*s?>9DxjJc zz= z79bj2m*5r)EJ%`yoV*?|Oam{y{vTu;<=8O#Zb&W{EW<$Fz|&B0%~klnTVKRCUoD5P zd@BTQ#u5u))!Fi-=;n1e6hkh!AK_3OIFk7{V#;g0c#NOo=1cnVF%!7C^#}SWS?HeTT`wlf#c7^$6(Wj&DFs$ z$``ey@IEt^TeTJx#RZ3}BOZJDHgxlE#g>PjvcbWXSO<>!?_>DK4UglC#YGS)xWW&M za}5@sn9LYPjGV#U>H8h^StThds|^K5X7&V2!IW)EK*T?b3Z;h(xCT`f{_3Ae53$4` z%$Tnudd9R2xINu5<%!YgRrw3HKRX?Q%idss%+zCFei~O_Js#gK{{}*|CzWaG@MIkX zU&VH?Xx^Z%g>dN=uR;)P>!?nEq&w;Ad=3k@+?j4BSf(nZ%_vr65jf+RKh_|F;!t3U zK}5Lu87CdM&qKju&)tjO+gD-FoP}V~hW@(GkE5TQf`5*C4$D6M$_57jO$*}G)5qfD z#S@@9?5$$XT{=iI?mU*8#fg1w=s^t%8!ShorI${eT9n8zvVfjbm$e8_|3#ZjCnGg0R|ut2;ug-{{~S3CKf&cx68TjgJz6}?Qg#4R{U<& zB1B5dtIt`wj!r|)!R(L+Pe1Ss91gp-MRnw0_=p$qJemlZRK$9o(jD7)&nq^fh#W?T@4zWZ!iQyVO)8` zUvP0(KYVX31&fL!t+En*?z_?syPxkBf5-m!}ghy5vcG_1TN~am^fvlEQ;} zx%s_u-mpnEeI50IBo(d^y+2)Wv~!LG3r`NPXC9x0=cm2_hr@P&3FI+dJsq2iw_)g6 zf2)qS*hwA?k%)$iF24}}9(M)SKlcpuCEvi%BIs2(26@LEhb2qD!Hw744Ufmgbq=q$ z2hJP%5H@XCijNlG4^_?L?@`rk48QETx_upKfT8x(8U~JHWM*fdX3{yx$1!g7R4gj` ztl9w<3Wc%Y%NOy(n)Uem-|ptR2v-H7;Gj~2LFfGrlPBMZpccUT$ETuT(D}$c`WQ~5 z?|&@8$cslsy{#6!*#}|hum|w*qN&)l@k1WjC2^DG?T%r?A4RCPmy{k-J9biA7fF)z zlP)+i+kM_lrYwQu+AHqH53AQ#H)e4-ReZGa6-=D)0%p%Bf=vA-nVsebCcw}Q3>f%Z zOnq#WZKaqRq`00Od&&YhZ_ststr)UA-EiSW4`Rl&YY`0W;rCDguUq$%Fz}o^>i3e? z#XagWeWSoi7aW-_R+`C_Rb>H}47v$Bx0hCPX4R?S4GD(IY%>z6^9~X(8+&Az!wXx16_M`#;ddM$C;;I2~|~Wucjc_0Eu#Z zk(tQNwIINOtQ^WM4MEop4xH~+u7%s1jhy^0obZz5#HszS!Mn3>hr^j;!+;66?2oTQ zqs@nS3Skr-wX?nwfhGlqS-RlJ?0k-90*4|q3_RwKyc&%TO6KW*`tca~*Yk1ppZ|@# z4!L}52A(9$#fpuNs*1fR-MR%QoN_dleY%SGCZ(fuw|s;{8hn8u3Jy7($4&?wopX-G zhIJo65GC089M_=F;TLi+)i_d#%*Jl0hm$l69GSY`N;84Oh=lRG6aHfB6`b8iaNW(9 zL3D_C_NkdrT~3>G#DEbcOjX$)?A@^)$DDWswr<`5iMKVhkk>H>#T&LF7!0DIPhTFg zr)DqV@=BP7oo%k^Azc2a889vBfK|Pv3yyZNl7K~5?k&gQ{#V28wjEuS6+TRQY!v=C zb3RH+c0@&rojq<>zu6L?a_=rg{63z{!&3|Sd4ZQX>Y8C^k2zd$dAyt(h0DtMv#5sU z&^|-(+X2@@i$p8l($FPRQB7U}2#0W-Q@frjno9nj; zlRQ(=JCdNJVc^KrsBANVPX7pf9X zDP#{5g2#`43RGrxJrN7=)W||1;LF--J7FyAO=~7o=$Fb}6H%IHFbaHSJGo zHz~*t4j>K}E`q4Effw7t>2l$JZ@!FRFiFFf1B-z=pH43SuYM@TvY#?=kGFuY45Kd_ zipa0Lm%V8U$jRLSmxCb?@F5)TiBMSJrH+?fbW!zUk|jdK7bJ40OSN`SV9>*UNUEK` zVe^t$g+A52kSGx_{f$?kYxPvtHxn?p&LId`_ERxdY}`uG>EZ`(9?+|?!)dhi95eOv zkZGDKagH$~n`kflXuE^>9Wm;fsKppOp|xNR1EwUPBGMZ&qZ-pNE**9W-?ob%1P)2% z;1EQ)x|I{96cU%<;83XPXf5LNf+(Ovejc8G@gY=IHFAroB%%6-5|p|nezmp)%QkF* zlxg7bRh1(csIu3#7UcG=huxnmu|gMTCB$w>2;F@iCi<%?Vqx@YD*EMUu(S}~-vrFu zySV?dYcsw0Cq1Q?Mp+_P$#$T=M zM(?YhYYM)MI(s+Nx;K6~$V;<7fB{KX;LXX0EGtBU%;6lCWvLXP+OL6HB2QtADXqWItTd zxJAjX1I{RLP{v$C*fOb`PsY9E}D?Bi^0%ts^i(6fW%g&)iO3x`?89h^ZSr!Pwe8RU1#3GVBed@Wo@EMT&xhml{j!j!U2RhILMhQa5I-QRciI5I!JNlzK>}O z7f$+f3#WD3!*5aG7;(x7XTX_V!2p@W09g)_EW_#XAS)*as?&vF#K)D(Yi(%rlB zOLy%?MR^5GkT$PE;W~$>nsbn)67ui07fulEvI7nd398crNut^nbIgYeCOw$;>bCG3 zS}Zu?*F6RlvMyYnEM({Bb1|W75m3toL)Wlz!xmVU5LHM?tVle=D-x>W)(ZC>2(~Fm z;Gk!zjx3%(Y8d8uixy3q*TQL?_V8N;IBElhbO~3ET^h;le^Eqn@eY`#$hih7rJ^8n z;6wry93XTLqMlQ_Pn2ai9Ja}8nR=gv3m;sc_Ug9q8(JMWqKJSq+ivB=2`vgJ{$(dj z5IC~n!g43V(kHf7_$At{Q@IYhO}>s_BaYu2pHjJO>@0Ja@)6z_xu8LBfI zit6U#!!UJ({R9pl&kp03N;Cn8d>pDux{30|{P`2@Ef(6?(PqF=QoIWmlcBnDcwaCA z0kxl`rZc3Jl30m>gB)NA_i<#Af8^N(^X|L8jp4#(z%6Og@zzSc<7R9>u~Jg98x~XG zaAx!V8Uz4RR7n}N!C^bu2sBjk=x}92mYnqawe#nXf4(KHQ&Ww#Rf2<*P)9cTC+uY+ zorAyuL51q{^3FUQ99jgSpbZZGrBI%SKza#v9L(iX*}oWlkOMPwNdx`l$3(82@`iV%@0D{-zt$|!>n4hE64bZKFzB@wl$#@Z^u zVRMds)(SOq*|N3F1_xOnGDT!5`zye^0&0;!wHK8ATc)FZD!MjAaBSON1tvN;;dxsI3!{Vn((5Dsias{yPkRU zNunTL#YADGJKLRO7$%D~lG|Mxf+$D9AqZO*%%50rYX561BEfPmRlQLPp~IEKbq+B0 z@A*aJCnkGeYd_!OIY%M_jX3iLPf5kD3pCC6AKzU`B>#qsJHUu@0OH(0pyFES!Of9S zg+M_!Dt2>7UTZ(!M!;d4u%uH+RFWWAmxlxX zNs{c7znNIbt*3y$9&JNyFEvN;Fo6BLc5 zf4r8|Vh=~c{>56T;{6a$E(T=P16NiD$g*?Qym|K?*EZo$bJndE9EWs2`-0s3ocG8r z&XrAP4v(ww(gVwUDiR5ogadmgg@YB`(pN)U000J{Nkl+&Puj zI@X=HKXlIQnG4^|&Clcd1evMabxtjyEH*Oi-@7{;uJ|w#@^f&gu59iA69l>4Qi-m9 zDqrCN`-q4ul$MryOw)83hO;{L-|zP`x7)oB1XO}zXYxf4AF8SVua_~)a$Ead4<8MB090G^x;*nNawH;tug!R_6@?Md^-bK{3h4MHYZt`*DL14 zK@V$+jozUPH!-#q@E zw-&t>;~XSbY;XuBES4Mc?>;T)ulPXMf;?QWdh+0O{0js2Kqc zn%9ygOQf8f&IdDQd30USleNOobwe;s%O}guDj?EB)0h^!hdMLOd2`-Tvt}%KJtsGh z2h>Qc@Z3>B+*vfYu*<;HZX6y8l)q)@A>J#D9AHj&PTBl<_tD0&?MEh-CVcYA*9RGf z-kVxyh@xm2hQR?G|96aXjLD2K(k6(Dl7JA5HLhy}WRmbPguS=+-TJ@!&y+ zUGeZkZ(k&sfu{|V!u56$lf#w!>Vo+buWScLhJzzUpeLW4d8lQDFJw%JSS-=bDA9?K zKSU5Um}S!$%js17^R|Dy|IR13d9u8`aGE%WVKMaW+xdm#j_JH|){IX&lg2478bsgBT3=QA)q_6tU3#f7_*o~`~}ui@67(FzZN#; zO4M4?;o+Qtw!%2^q%IHTW-Gf_fBVbeAHVzQY}(OUknLh8MfKjeXwl@S+QHF+z!4+X zm@!i>1dO2;LnXEFs*8x!c;%yo%Rh{S^&;vwYI6>XtH|1M$7MYNK`?*%Vavecjhj!Q zEHP3@$wR8Do{@_dJ@iI9I9eb$XvjC+G`@E@5*b6uUJ#g;z`f2}l?VL6{O`Zn^n2Ci z=2dPy@TMwT3VPxlSWNtR!|u~}Z`*k!)y(n~L8k|*>KwFa(W4)>gQJClgN8k9*mW+K z$9vVvXM>hnmLDO(BoK?JG*I;TWM>!gbBOBgq<3mXfhXuxh0e>WK^M>tbi8AB) z9*UX`rTs-#FzB@eP(-Jyt%vG0C1`ugJ%1fU=u+A-1gWDN9#A{N)*E{Bf`zF`f+V z6%VDBl8WR;ma7Y7$rFfJ=D`a-zkOF*Abzqrws>&Z6D$;tJK>u8`Hn@K1;0G+%YXls?l|_?3%XlOnl6X322%4lmm{D569wh1_ddP#l4J|l z7S6X4aM+~!&2I*sYM9om3}Q~ca!_7&Rsj^5`fSia;D{_L`r^)W_7V0>>4d|(&lDgG zmqaHVYA&2=4ov9h&Hv)AHrHCRHsD(oIB0SQ9duf*ZsLg^*@s=>adw8yIVd&IKt%K3 zw_sV}xY~=*?>AT6%mnH00+YL`vioaAbzin<+5LOk0(Yoyj;#(HvB@5B$nS5+b$6Mf z$X{ - if(prevState.departmentName != this.props.departmentName){ - this.setValue(this.props.departmentName) - } - } - componentDidMount=()=>{ - if(this.props.departmentName){ - this.setValue(this.props.departmentName) - } - } - - setValue=(name)=>{ - this.props.form.setFieldsValue({ - depart:name - }) - } - - setVisible = (visible) => { - this.refs.modalWrapper.setVisible(visible) - } - - onSendOk = () => { - this.props.form.validateFieldsAndScroll((err, values) => { - console.log(values); - if(!err){ - let{schoolId,departmentName}=this.props - let url=`/add_department_applies.json`; - axios.post(url,{ - name: values.depart, - school_id: schoolId, - remarks: values.desc - }).then((result)=>{ - if(result){ - this.props.showNotification("新增院系/部门成功!"); - this.props.addChildOrgSuccess(values.depart) - - this.setVisible(false); - } - }).catch((error)=>{ - console.log(error); - }) - } - }) - } - - onOk = () => { - const { course_lists, checkBoxValues } = this.state - this.onSendOk() - } - - render(){ - const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state - const { moduleName } = this.props - const { getFieldDecorator } = this.props.form; - return( - - -
    - - {this.props.schoolName} - - - - {getFieldDecorator('depart', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: '请输入部门名称', - }], - })( - - )} - - - - {getFieldDecorator('desc', { - })( - - )} - - -
    - - -
    - ) - } -} -const WrappedApplyForAddChildOrgModal = Form.create({ name: 'ApplyForAddChildOrgModal' })(ApplyForAddChildOrgModal); - -export default WrappedApplyForAddChildOrgModal; - - diff --git a/public/react/src/modules/user/modal/ApplyForAddOrgModal.js b/public/react/src/modules/user/modal/ApplyForAddOrgModal.js deleted file mode 100644 index dfda79651..000000000 --- a/public/react/src/modules/user/modal/ApplyForAddOrgModal.js +++ /dev/null @@ -1,177 +0,0 @@ -import React, { Component } from "react"; -import { Modal, Button, Input, Form, } from "antd"; -import axios from 'axios' -import ModalWrapper from "../../courses/common/ModalWrapper" -import { City } from 'educoder' -import '../account/common.css' - -const { TextArea } = Input; -const Search = Input.Search -class ApplyForAddOrgModal extends Component{ - constructor(props){ - super(props); - this.state={ - - } - } - - componentDidUpdate=(prevState)=>{ - if(this.props.schoolName && prevState.schoolName != this.props.schoolName){ - this.props.form.setFieldsValue({ - schoolName:this.props.schoolName - }) - } - } - componentDidMount=()=>{ - if(this.props.schoolName){ - this.props.form.setFieldsValue({ - schoolName:this.props.schoolName - }) - } - } - - setVisible = (visible) => { - this.refs.modalWrapper.setVisible(visible) - } - - onSendOk = () => { - this.props.form.validateFieldsAndScroll((err, values) => { - console.log(values); - if(!err){ - let url=`/add_school_applies.json`; - axios.post(url,{ - name:values.schoolName, - province:values.city && values.city[0], - city:values.city && values.city[1], - address:values.address, - remarks:values.remarks - }).then((result)=>{ - if(result){ - this.props.showNotification("新增学校/单位成功!"); - this.setVisible(false); - this.props.addOrgSuccess(values.schoolName) - - } - }).catch((error)=>{ - console.log(error); - }) - } - }) - } - - onOk = () => { - this.onSendOk() - } - - render(){ - const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state - const { moduleName } = this.props - const { getFieldDecorator } = this.props.form; - return( - - -
    - - {getFieldDecorator('schoolName', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: '请输入学校或工作单位', - }], - })( - - )} -
    -
  • 示例:
  • -
      -
    • - - 国防科学技术大学 -
    • -
    • - - 国防科学技术大学开福校区 -
    • -
    -
    -
    - - - {getFieldDecorator('city', { - rules: [], - })( - - )} - - - - {getFieldDecorator('address', { - rules: [], - })( - - )} - - - - {getFieldDecorator('remarks', { - })( - - )} - - -
    - - -
    - ) - } -} -const WrappedApplyForAddOrgModal = Form.create({ name: 'ApplyForAddOrgModal' })(ApplyForAddOrgModal); - -export default WrappedApplyForAddOrgModal; - - diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js deleted file mode 100644 index b24a743a9..000000000 --- a/public/react/src/modules/user/modal/RealNameCertificationModal.js +++ /dev/null @@ -1,816 +0,0 @@ -import React, { Component } from "react"; -import { message, Icon, Input, Form, Upload,Radio ,Tooltip} from "antd"; -import axios from 'axios' -import ModalWrapper from "../../courses/common/ModalWrapper" -import { getUploadActionUrl, ImageLayer2 ,ConditionToolTip } from 'educoder' -import '../account/common.css' -import AccountBasicEditItem from '../account/AccountBasicEditItem' -import ApplyForAddOrgModal from './ApplyForAddOrgModal' -import ApplyForAddChildOrgModal from './ApplyForAddChildOrgModal' - -import authImg from '../../../images/account/auth.png' -import jobImg from '../../../images/account/job.png' - -const RadioGroup = Radio.Group; -const Dragger = Upload.Dragger; -const MAX_NAME_LENGTH = 10 -function getBase64(img, callback) { - const reader = new FileReader(); - reader.addEventListener('load', () => callback(reader.result)); - reader.readAsDataURL(img); -} -function beforeUpload(file) { - const isJPG = file.type === 'image/jpeg'; - if (!isJPG) { - message.error('You can only upload JPG file!'); - } - const isLt2M = file.size / 1024 / 1024 < 2; - if (!isLt2M) { - message.error('Image must smaller than 2MB!'); - } - return isJPG && isLt2M; -} -export function getHiddenName(name) { - if (!name) return '' - let len=parseInt(name.length)-1; - let str=""; - for(var i = 0; i < len; i++){ str += "*"; } - const newName = name.substr(0,1)+str; - return newName -} -class RealNameCertificationModal extends Component{ - constructor(props){ - super(props); - this.state={ - identity:"teacher", - departmentsName:undefined, - fileID:undefined, - filterSchoolList:undefined, - filterDepartments :undefined, - school:undefined, - school_id:undefined, - department_id:undefined, - schoolList:undefined, - departments:undefined, - showRealName:true, - realName:undefined, - imageUrl2:undefined - } - } - -// 弹框出现(visible==true)时给formitem赋值 - setVisible = (visible) => { - this.refs.modalWrapper.setVisible(visible); - this.setState({ - imageUrl2:undefined - }) - if(visible && this.props.basicInfo){ - this.setValue(this.props.basicInfo); - this.getSchoolList(this.props.basicInfo); - } - } - - - setValue=(basicInfo)=>{ - // debugger; - if(basicInfo){ - this.props.form.setFieldsValue({ - nickname:basicInfo.nickname, - name:!basicInfo.show_realname ? this.hideRealName(basicInfo.name) : basicInfo.name, - job:basicInfo.identity, - org:basicInfo.school_name - }) - setTimeout(() => { - // 等显示后再set - this.props.form.setFieldsValue({ - job:basicInfo.identity, - sex:String(basicInfo.gender), - student_No:basicInfo.student_id, - org2:basicInfo.department_name, - job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", - job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", - }) - }, 100) - this.setState({ - forDisable: true, - nameLength:basicInfo.nickname?basicInfo.nickname.length:0, - showRealName:basicInfo.show_realname, - realName: basicInfo.name, - identity:basicInfo.identity, - school_id:basicInfo.school_id, - department_id:basicInfo.department_id - }) - } - } - - getSchoolList=(basicInfo, selectedName)=>{ - let url=`/schools/for_option.json`; - axios.get(url).then((result)=>{ - if(result){ - this.setState({ - schoolList:result.data.schools - }) - if (selectedName) { - let school_id - result.data.schools.reverse().some( item => { - if (item.name == selectedName) { - school_id = item.id - return true; - } - }) - this.props.form.setFieldsValue({ - org: selectedName - }) - this.setState({ - school_id, - school: selectedName - }, () => { - this.filterList(selectedName) - }) - } else if(basicInfo && basicInfo.school_name){ - this.setState({ - school:basicInfo.school_name, - filterSchoolList:this.state.schoolList.filter(function(item){ - return item.name.indexOf(basicInfo.school_name)>-1; - }) - }) - this.getDepartments(basicInfo.school_name,false); - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - - - getDepartments=(e,flag)=>{ - let arr=this.state.schoolList.filter(function(item){ - if(item.name.indexOf(e) > -1){ - return item.name; - } - }); - if (!arr[0]) { - if (!e) { - this.setState({ - filterSchoolList: [] - }) - } - // 没找到学校,清空部门 - this.setState({ - departments: [], - filterDepartments: [], - departmentsName: '', - school_id: '', - department_id: '', - }) - this.this_school_id = '' - this.props.form.setFieldsValue({ - org2: '' - }) - return; - } - this.props.form.setFieldsValue({ - org: arr[0].name - }) - this.filterList(e) - // 保存选择的学校id - this.this_school_id = arr[0].id - this.setState({ - school_id: arr[0].id, - school:e, - }) - this._getDepartments(arr[0].id, flag) - } - _getDepartments = (schoolId, flag, selectedName) => { - let url=`/schools/${schoolId || this.state.school_id}/departments/for_option.json`; - axios.get(url).then((result)=>{ - if(result){ - this.setState({ - departments:result.data.departments, - filterDepartments:result.data.departments - }) - if (selectedName) { - let department_id - result.data.departments.reverse().some( item => { - if (item.name == selectedName) { - department_id = item.id - return true; - } - }) - this.props.form.setFieldsValue({ - org2: selectedName - }) - this.setState({ - department_id, - // school: selectedName - }) - } else if(result.data.departments && result.data.departments.length>0 && flag==true){ - // 切换学校后,部门默认选择第一个 - this.props.form.setFieldsValue({ - org2:result.data.departments[0].name - }) - this.setState({ - department_id: result.data.departments[0].id - }) - }else if(result.data.departments && result.data.departments.length == 0 && flag==true){ - this.props.form.setFieldsValue({ - org2:'' - }) - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - filterList =(e)=>{ - const inputVal = e.trim() - let arr=[]; - if(inputVal){ - arr= this.state.schoolList.filter(function(item){ - return item.name.indexOf(inputVal)>-1; - }); - this.props.form.setFieldsValue({ - org: inputVal - }) - this.setState({ - school: inputVal, - filterSchoolList: arr - }) - } else { - this.setState({ - school: '', - }) - } - // else{ - // let {school}=this.state; - // arr= this.state.schoolList.filter(function(item){ - // return item.name.indexOf(school)>-1; - // }); - // } - } - - onSendOk = () => { - this.props.form.validateFieldsAndScroll((err, values) => { - console.log(values); - console.log(this.state.showRealName ? values.name : this.state.realName); - // return; - if(!err){ - let{ imageUrl2 , showRealName , realName }=this.state; - let{ current_user , basicInfo }=this.props; - if(imageUrl2){ - let { certification } = this.props; - if(certification == 1){ - // 实名认证 - let url=""; - if( basicInfo===undefined){ - url = `/users/accounts/${current_user && current_user.login}/authentication_apply.json`; - - }else { - url = `/users/accounts/${basicInfo && basicInfo.id}/authentication_apply.json`; - } - - axios.post((url),{ - name:this.state.showRealName ? values.name : realName, - gender:parseInt(values.sex), - id_number:values.credentials, - show_realname:showRealName, - attachment_ids:[this.state.fileID] - }).then((result)=>{ - if(result){ - this.props.showNotification("申请已提交,请等待审核!"); - try { - this.props.getBasicInfo(); - } catch (e) { - } - try { - this.props.Getdata(this.props.userdata.id); - } catch (e) { - - } - this.setVisible(false); - } - }).catch((error)=>{ - console.log(error); - }) - }else{ - // 职业认证 - // console.log(values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2); - let url=""; - if( basicInfo===undefined){ - url = `/users/accounts/${current_user && current_user.login}/professional_auth_apply.json`; - }else { - url = `/users/accounts/${basicInfo && basicInfo.id}/professional_auth_apply.json`; - - } - axios.post((url),{ - school_id:this.state.school_id, - department_id:this.state.department_id, - identity:this.state.identity, - extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2, - attachment_ids:[this.state.fileID] - }).then((result)=>{ - if(result){ - this.props.showNotification("申请已提交,请等待审核!"); - try { - this.props.getBasicInfo(); - } catch (e) { - - } - try { - this.props.Getdata(this.props.userdata.id); - } catch (e) { - - } - this.setVisible(false); - - } - }).catch((error)=>{ - console.log(error); - }) - } - }else{ - this.props.showNotification("请先上传照片!"); - } - } - }) - } - - onOk = () => { - const { course_lists, checkBoxValues } = this.state - this.onSendOk() - } - - handleChange2 = (info) => { - if (info.file.status === 'uploading') { - this.setState({ loading: true }); - return; - } - if (info.file.status === 'done') { - // Get this url from response in real world. - console.log(info.file.response); - getBase64(info.file.originFileObj, imageUrl2 => this.setState({ - imageUrl2, - loading: false, - fileID:info.file.response && info.file.response.id - })); - } - } - // 切换职称 - changeJob=(e)=>{ - this.setState({ - identity:e - }) - let {basicInfo}=this.props; - if(basicInfo){ - this.props.form.setFieldsValue({ - job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", - job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", - }) - } - } - // 选择学校(获取对应学校的学院、部门) - changeList=(e)=>{ - this.getDepartments(e.trim(),true); - } - - showApplyForAddOrgModal = () => { - this.applyForAddOrgForm.setVisible(true) - } - showApplyForAddChildOrgModal = () => { - let{school,schoolList}=this.state; - let arr=schoolList.filter(function(item){ - return item.name == school; - }); - if(arr.length > 0){ - this.applyForAddChildOrgForm.setVisible(true) - }else{ - this.props.showNotification("请先选择正确的单位或者学校!"); - } - } - addOrgSuccess = (name) => { - // const schoolList = this.state.schoolList.slice(0) - // schoolList.push({ id: schoolList.length + 2000, name: name}) - // this.setState({ schoolList }) - - this.getSchoolList(this.props.basicInfo, name); - this.props.form.setFieldsValue({ - org: name - }) - } - - addChildOrgSuccess = (deptName) => { - - this._getDepartments(this.state.school_id, false, deptName); - - } - - // 隐藏或显示真实姓名 - showOrHide=(flag)=>{ - const name = this.props.form.getFieldsValue().name || this.props.basicInfo.name - this.setState({ - showRealName:flag==true?false:true - }) - if(flag==true){ // 隐藏真实姓名 - this.hideRealName(name); - }else{ // 显示 - this.props.form.setFieldsValue({ - name: this.state.realName - }) - } - } - // 将名字隐藏起来 - hideRealName=(name)=>{ - this.setState({ realName: name }) - const newName = getHiddenName(name) - - this.props.form.setFieldsValue({ - name: newName - }) - return newName - } - // 选择部门、学院 - changeDepartment=(e)=>{ - let arr = this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){ - return item.name == e; - }) : []; - if (!arr[0]) { - this.setState({ - department_id: '', - departmentsName: e, - filterDepartments: [], - }) - this.this_department_id = '' - return; - } - this.this_department_id = arr[0].id - this.setState({ - departmentsName:e, - department_id: arr[0].id, - }) - } - // 姓名 - handleSubmitNames(rule, value, callback){ - if (value) { - let iconRule1 = /[`~!@#$%^&()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&()——\-+={}|《》?:“”【】、;‘’,。、]/im; -// 判断是否含有emoji表情 - let iconRule2 = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig; -// 如果为true,字符串含有emoji表情 ,false不含 - const iconRule2s =iconRule2.test(value); -// 如果为true,字符串含有特殊符号 ,false不 - const iconRule1s =iconRule1.test(value); - - if (iconRule2s===true|| iconRule1s===true) { - callback('2-10位中英文、数字'); - } - else if(value.length<2){ - callback('2-10位中英文、数字'); - }else if(value.length>=11){ - callback('2-10位中英文、数字'); - } - } - callback(); - } - - render(){ - const { course_lists, checkBoxValues, searchValue, loading, imageUrl, imageUrl2, - identity, - departmentsName , - filterSchoolList , - filterDepartments , - school, - department_id, - departments, - school_id, - - showRealName - } = this.state - const { moduleName } = this.props - const { getFieldDecorator } = this.props.form; - let {certification}=this.props; - // /api/users/accounts/${this.props.current_user.login}/auth_attachment.json - - // 已职业认证的账户不能修改职业,学校/单位,院系/部门(true为disable) - // const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ; - - let{ basicInfo }=this.props - let common={ - changeJob:this.changeJob, - filterList:this.filterList, - changeList:this.changeList, - changeDepartment:this.changeDepartment, - showApplyForAddOrgModal:this.showApplyForAddOrgModal, - showApplyForAddChildOrgModal:this.showApplyForAddChildOrgModal - } - const uploadProps2 = { - // name: 'image', - data: {type: certification == 1 ? "real_name" : "professional"}, - multiple: true, - showUploadList: false, - // https://newweb.educoder.net - action: this.props.current_user ? `${getUploadActionUrl()}` : '', - className: 'idPic-uploader', - onChange: this.handleChange2, - beforeUpload: (file) => { - const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/jpg' || file.type === 'image/bmp'; - if (!isJpgOrPng) { - this.props.showNotification('请上传正确文件格式'); - } - return isJpgOrPng; - }, - }; - - // form合并了 - const propsWithoutForm = Object.assign({}, this.props) - delete propsWithoutForm.form - return( -
    - this.applyForAddOrgForm = form} schoolName={school} - {...propsWithoutForm} addOrgSuccess={this.addOrgSuccess} - > - this.applyForAddChildOrgForm = form} - addChildOrgSuccess={this.addChildOrgSuccess} - > - 实名认证: - 职业认证 - } - {...this.props } - {...this.state} - onOk={this.onOk} - okText="保存" - className="applyForModal certificationModal courseNormalForm autoModal" - width="660px" - bottomRender={ - certification && certification == 1? -
    -

    认证须知:

    -

    - 1.你需要准备有效的身份证正面(人像面)的证件照照片,请确保证件照片清晰可见,严禁PS; -

    - 2.我们将在你提交认证信息后的24小时(不包含节假日)内完成审核,审核结果将会以系统消息的形式发送给你; -

    - 3.实名认证审核完成后,无法删除,请谨慎填写; -

    - 4.实名认证审核完成后,系统将自动发放500个金币作为奖励; -

    - 5.我们会确保你所提供的信息均处于严格的保密状态,不会泄露; -

    - 6.如存在恶意乱填写姓名,证件号,及上传与实名认证证件无关图片者,一经发现将冻结EduCoder账号。 -

    - 7.提交实名认证后系统会自动将状态改为已认证,你将可以体验平台需要实名认证的功能;如果在认证后的使用过程中未通过审核,你将不能继续体验需要认证的功能。 -

    -
    : -
    -

    认证须知:

    -

    - 1.根据职业上传相应的证件照:教师(教师证),专业人士(员工证)、学生(学生证),请确保证件照内容完整并且清晰可见,严禁PS; -

    - 2.我们将在你提交职业证信息后的24小时(不包含节假日)内完成审核,审核结果将会以系统消息的形式发送给你; -

    - 3.职业认证审核完成后,无法删除,请谨慎填写;职业变更请选择重新认证; -

    - 4.职业认证审核完成后,系统将自动发放500个金币作为奖励; -

    - 5.我们会确保你所提供的信息均处于严格的保密状态,不会泄露; -

    - 6.如存在恶意乱填写姓名,学号,及上传与职业证件无关图片者,一经发现将冻结EduCoder账号。 -

    -

    - 7.非老师身份提交职业认证后系统会自动将状态改为已认证,你将可以体验平台需要职业认证的功能;如果在认证后的使用过程中未通过审核,你将不能继续体验需要认证的功能。 -

    -
    - } - > - - -
    - {certification && certification == 1 ? -
    - - {getFieldDecorator('name', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: `请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`, - - }, - { validator: this.handleSubmitNames }, - ], - })( - this.showOrHide(showRealName)}> - }> - )} - { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } - - {/* //
    - // - // {showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)} - // - // this.showOrHide(showRealName)}> - // { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } - //
    */} - -
    - - - {getFieldDecorator('sex', { - rules: [{ - required: true, - message: '请选择性别', - }], - })( - - - - - )} - - - {getFieldDecorator('credentials', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: '请输入证件号', - }], - })( - - )} - -
    - : - - } -
    -
    - { certification && certification == 1 ? "身份证上传:":"职业证上传:" } -
    - - avatar - - - {imageUrl2 ? - // - avatar - : - -

    - -

    -

    点击或拖拽上传图片

    - {/*

    Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files

    */} -
    - } - -
    -
    -
    - -

    示例图片

    -

    (png/jpg/bmp格式,不超过2MB)

    -
    - - - 查看大图 - -
    -
    -
    - - - - -
    - ) - } -} -const WrappedRealNameCertificationModal = Form.create({ name: 'RealNameCertificationModal' })(RealNameCertificationModal); - -export default WrappedRealNameCertificationModal; - - diff --git a/public/react/src/modules/user/secureCode.css b/public/react/src/modules/user/secureCode.css deleted file mode 100644 index e7f171711..000000000 --- a/public/react/src/modules/user/secureCode.css +++ /dev/null @@ -1,42 +0,0 @@ -#drag{ - position: relative; - background-color: #e8e8e8; - min-width: 300px; - height: 38px; - line-height: 38px; - text-align: center; -} -#drag .handler{ - position: absolute; - top: 0px; - left: 0px; - width: 40px; - height: 38px; - border: 1px solid #ccc; - cursor: move; -} -.handler_bg{ background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NTEyNTVEMURGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NTEyNTVEMUNGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2MTc5NzNmZS02OTQxLTQyOTYtYTIwNi02NDI2YTNkOWU5YmUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+YiRG4AAAALFJREFUeNpi/P//PwMlgImBQkA9A+bOnfsIiBOxKcInh+yCaCDuByoswaIOpxwjciACFegBqZ1AvBSIS5OTk/8TkmNEjwWgQiUgtQuIjwAxUF3yX3xyGIEIFLwHpKyAWB+I1xGSwxULIGf9A7mQkBwTlhBXAFLHgPgqEAcTkmNCU6AL9d8WII4HOvk3ITkWJAXWUMlOoGQHmsE45ViQ2KuBuASoYC4Wf+OUYxz6mQkgwAAN9mIrUReCXgAAAABJRU5ErkJggg==") no-repeat center;} - -.handler_ok_bg{ background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDlBRDI3NjVGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDlBRDI3NjRGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphNWEzMWNhMC1hYmViLTQxNWEtYTEwZS04Y2U5NzRlN2Q4YTEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+k+sHwwAAASZJREFUeNpi/P//PwMyKD8uZw+kUoDYEYgloMIvgHg/EM/ptHx0EFk9I8wAoEZ+IDUPiIMY8IN1QJwENOgj3ACo5gNAbMBAHLgAxA4gQ5igAnNJ0MwAVTsX7IKyY7L2UNuJAf+AmAmJ78AEDTBiwGYg5gbifCSxFCZoaBMCy4A4GOjnH0D6DpK4IxNSVIHAfSDOAeLraJrjgJp/AwPbHMhejiQnwYRmUzNQ4VQgDQqXK0ia/0I17wJiPmQNTNBEAgMlQIWiQA2vgWw7QppBekGxsAjIiEUSBNnsBDWEAY9mEFgMMgBk00E0iZtA7AHEctDQ58MRuA6wlLgGFMoMpIG1QFeGwAIxGZo8GUhIysmwQGSAZgwHaEZhICIzOaBkJkqyM0CAAQDGx279Jf50AAAAAABJRU5ErkJggg==") no-repeat center;} - -#drag .drag_bg{ - background-color: #7ac23c; - height: 38px; - width: 0px; -} -#drag .drag_text{ - position: absolute; - top: 0px; - font-size: 14px; - width: 100%; - -moz-user-select: none; - -webkit-user-select: none; - color: #fff; - user-select: none; - -o-user-select:none; - -ms-user-select:none; -} - -/* }*/ -/*//.handler_bg{ background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NTEyNTVEMURGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NTEyNTVEMUNGMkVFMTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2MTc5NzNmZS02OTQxLTQyOTYtYTIwNi02NDI2YTNkOWU5YmUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+YiRG4AAAALFJREFUeNpi/P//PwMlgImBQkA9A+bOnfsIiBOxKcInh+yCaCDuByoswaIOpxwjciACFegBqZ1AvBSIS5OTk/8TkmNEjwWgQiUgtQuIjwAxUF3yX3xyGIEIFLwHpKyAWB+I1xGSwxULIGf9A7mQkBwTlhBXAFLHgPgqEAcTkmNCU6AL9d8WII4HOvk3ITkWJAXWUMlOoGQHmsE45ViQ2KuBuASoYC4Wf+OUYxz6mQkgwAAN9mIrUReCXgAAAABJRU5ErkJggg==") no-repeat center;}*/ -/*//.handler_ok_bg{ background: #fff url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0ZDhlNWY5My05NmI0LTRlNWQtOGFjYi03ZTY4OGYyMTU2ZTYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDlBRDI3NjVGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDlBRDI3NjRGMkQ2MTFFNEI5NDBCMjQ2M0ExMDQ1OUYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphNWEzMWNhMC1hYmViLTQxNWEtYTEwZS04Y2U5NzRlN2Q4YTEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NGQ4ZTVmOTMtOTZiNC00ZTVkLThhY2ItN2U2ODhmMjE1NmU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+k+sHwwAAASZJREFUeNpi/P//PwMyKD8uZw+kUoDYEYgloMIvgHg/EM/ptHx0EFk9I8wAoEZ+IDUPiIMY8IN1QJwENOgj3ACo5gNAbMBAHLgAxA4gQ5igAnNJ0MwAVTsX7IKyY7L2UNuJAf+AmAmJ78AEDTBiwGYg5gbifCSxFCZoaBMCy4A4GOjnH0D6DpK4IxNSVIHAfSDOAeLraJrjgJp/AwPbHMhejiQnwYRmUzNQ4VQgDQqXK0ia/0I17wJiPmQNTNBEAgMlQIWiQA2vgWw7QppBekGxsAjIiEUSBNnsBDWEAY9mEFgMMgBk00E0iZtA7AHEctDQ58MRuA6wlLgGFMoMpIG1QFeGwAIxGZo8GUhIysmwQGSAZgwHaEZhICIzOaBkJkqyM0CAAQDGx279Jf50AAAAAABJRU5ErkJggg==") no-repeat center;}*/ diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js deleted file mode 100644 index 488668421..000000000 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ /dev/null @@ -1,332 +0,0 @@ -import React, { Component } from 'react'; - -import {Link} from 'react-router-dom'; -import {Tooltip,Menu} from 'antd'; -import Loadable from 'react-loadable'; -import Loading from '../../../Loading'; -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; -import UpgradeModals from '../../modals/UpgradeModals'; -import axios from 'axios'; -import {getImageUrl} from 'educoder'; -import InfosBanner from './InfosBanner' - -import "./usersInfo.css" -import "../../courses/css/members.css" -import "../../courses/css/Courses.css" - - -import Trialapplication from '../../login/Trialapplication' - - -const InfosPackage = Loadable({ - loader: () => import('./InfosPackage'), - loading:Loading, -}) - -const InfosCourse = Loadable({ - loader: () => import('./InfosCourse'), - loading:Loading, -}) -const InfosShixun = Loadable({ - loader: () => import('./InfosShixun'), - loading:Loading, -}) -const InfosPath = Loadable({ - loader: () => import('./InfosPath'), - loading:Loading, -}) -const InfosProject = Loadable({ - loader: () => import('./InfosProject'), - loading:Loading, -}) -const InfosVideo = Loadable({ - loader: () => import('./video/InfosVideo'), - loading:Loading, -}) -const InfosTopics=Loadable({ - loader: () => import('./InfosTopics'), - loading:Loading, -}) - -const $ = window.$; -class Infos extends Component{ - constructor(props){ - super(props); - this.state={ - data:undefined, - is_current:undefined, - is_edit:false, - sign:undefined, - type:0, - login:undefined, - isRenders:false, - moduleName:"courses", - next_gold:undefined - } - } - componentDidMount =()=>{ - let upsystem=`/users/system_update.json`; - axios.get(upsystem).then((response)=>{ - let updata=response.data; - this.setState({ - updata:updata - }) - }).catch((error)=>{ - console.log(error); - }) - - this.getInfo(this.props.match.params.username); - } - - - //判断是否看的是当前用户的个人主页 - componentDidUpdate =(prevProps)=> { - if(this.props.current_user && prevProps.current_user != this.props.current_user){ - if(this.props.current_user.login != this.props.match.params.username){ - this.setState({ - is_current:false, - login:this.props.current_user.login - }) - } - } else { - if (prevProps.match.params.username != this.props.match.params.username) { - this.getInfo(this.props.match.params.username); - } - } - } - - - - //获取个人主页信息 - getInfo = (user_login) =>{ - let url =`/users/${user_login}/homepage_info.json`; - axios.get(url).then((result)=>{ - if(result){ - if (result.data.status === 403||result.data.status === 401||result.data.status === 500||result.data.status === 404) { - - }else{ - this.setState({ - data:result.data, - followed:result.data.followed, - sign:result.data.brief_introduction, - id:result.data.id, - next_gold:result.data.tomorrow_attendance_gold - }) - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - // 编辑签名 - editmysign=()=>{ - this.setState({ - is_edit:true - },()=>{ - $("#mysign").focus(); - }) - } - // 输入签名 - inputSign=(e)=>{ - this.setState({ - sign:e.target.value - }) - } - //取消编辑签名 - savemysign=()=>{ - let { sign } =this.state; - let url=`/users/brief_introduction.json`; - axios.post((url),{ - content:sign - }).then((result)=>{ - if(result){ - this.setState({ - is_edit:false - }) - } - }).catch((error)=>{ - console.log(error) - }) - - } - changeType=(e)=>{ - this.setState({ - type:e.key - }) - } - turnTo=(url)=>{ - this.props.history.push(url); - } - - //签到 - signFor=()=>{ - let url=`/users/attendance.json` - axios.post(url).then((result)=>{ - if(result){ - // this.setState( - // (prevState) => ({ - // data : update(prevState.data, {attendance_signed: {$set: true} }) - // }) - // ) - // this.setState({ - // next_gold:result.data.next_gold - // }) - this.getInfo(this.props.match.params.username); - } - }).catch((error)=>{ - console.log(error); - }) - } - - // 关注 - followPerson=()=>{ - let{followed,id}=this.state; - let url=`/users/${id}/watch.json`; - // 取消关注 - if(followed){ - axios.delete(url).then((result)=>{ - if(result){ - this.setState({ - followed:false - }) - } - }).catch((error)=>{ - console.log(error) - }) - }else{ - // 关注 - axios.post(url).then((result)=>{ - if(result){ - this.setState({ - followed:true - }) - } - }).catch((error)=>{ - console.log(error); - }) - } - } - - // 试用申请 - // trialapplications =()=>{ - // this.setState({ - // isRenders: true, - // showTrial:true - // }) - // } - cancelModulationModels=()=>{ - this.setState({ - isRenders: false - }) - } - ToBank=(url)=>{ - window.location.href=url; - } - - render(){ - let { - data , - is_edit, - sign, - type, - followed, - id, - isRenders, - moduleName, - next_gold - }=this.state; - let isCurrent = true; - let currentLogin; - if(this.props.current_user && this.props.current_user.login != this.props.match.params.username){ - isCurrent=false; - currentLogin = this.props.current_user.login; - } - const _commonProps = { - is_current: isCurrent, - login: currentLogin - } - return( -
    - {this.state.updata===undefined?"":} - { - isRenders && this.cancelModulationModels()}/> - } - - - - - {/* --------------------------------------------------------------------- */} - {/* 题库 */} - () - } - > - - {/* 课堂 */} - {/* http://localhost:3007/courses/1309/homework/9300/setting */} - () - } - > - - {/* 实训项目 */} - () - } - > - - {/* 实践课程 */} - () - } - > - - {/* 开发项目 */} - () - } - > - - {/* 众包 */} - {/* http://localhost:3007/courses/1309/homework/9300/setting */} - () - } - > - - {/* 视频 */} - () - } - > - - - () - } - > - - -
    - ) - } -} -// CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC)) -export default (Infos) ; diff --git a/public/react/src/modules/user/usersInfo/InfosBank.js b/public/react/src/modules/user/usersInfo/InfosBank.js deleted file mode 100644 index f776b75e1..000000000 --- a/public/react/src/modules/user/usersInfo/InfosBank.js +++ /dev/null @@ -1,249 +0,0 @@ -import React, { Component } from 'react'; -import {Pagination,Spin,Checkbox,Modal} from 'antd'; -import moment from 'moment'; -import axios from 'axios'; -import NoneData from '../../courses/coursesPublic/NoneData' -import {getImageUrl} from 'educoder'; -import "./usersInfo.css" -import Modals from '../../modals/Modals' - -const dateFormat ="YYYY-MM-DD HH:mm" -class InfosBank extends Component{ - constructor(props){ - super(props); - this.state={ - category:"common", - type:"publicly", - page:1, - per_page:16, - sort_by:"updated_at", - CoursesId:undefined, - - totalCount:undefined, - data:undefined, - isSpin:false, - - dialogOpen:false, - modalsTopval:undefined, - modalsBottomval:undefined, - modalSave:undefined - } - } - - componentDidMount=()=>{ - this.setState({ - isSpin:true - }) - let{category,type,page,sort_by,CoursesId}=this.state; - this.getCourses(category,type,page,sort_by,CoursesId); - } - - getCourses=(category,type,page,sort_by,CoursesId)=>{ - let url=`/users/${this.props.match.params.username}/question_banks.json`; - axios.get((url),{params:{ - category, - type, - page, - sort_by, - per_page:category && page ==1?17:16, - course_list_id:CoursesId - }}).then((result)=>{ - if(result){ - this.setState({ - totalCount:result.data.count, - data:result.data, - isSpin:false - }) - } - }).catch((error)=>{ - console.log(error); - }) - } - - //切换种类 - changeCategory=(cate)=>{ - this.setState({ - category:cate, - page:1, - isSpin:true - }) - let{type,sort_by,CoursesId}=this.state; - this.getCourses(cate,type,1,sort_by,CoursesId); - } - //切换状态 - changeType=(type)=>{ - this.setState({ - type:type, - page:1, - isSpin:true - }) - let{category,sort_by,CoursesId}=this.state; - this.getCourses(category,type,1,sort_by,CoursesId); - } - //切换页数 - changePage=(page)=>{ - this.setState({ - page, - isSpin:true - }) - let{category,type,sort_by,CoursesId}=this.state; - this.getCourses(category,type,page,sort_by,CoursesId); - } - - // 进入课堂 - turnToCourses=(url)=>{ - this.props.history.push(url); - } - - // 切换排序方式 - changeOrder= (sort)=>{ - this.setState({ - sort_by:sort, - isSpin:true - }) - let{category,type,page,CoursesId}=this.state; - this.getCourses(category,type,page,sort,CoursesId); - } - - changeCourseListId =(CoursesId)=>{ - this.setState({ - CoursesId, - isSpin:true - }) - let{category,type,sort,page}=this.state; - this.getCourses(category,type,page,sort,CoursesId); - } - - //设为公开/删除 - setPublic=(index)=>{ - this.setState({ - dialogOpen:true, - modalsTopval:index==1?"您确定要公开吗?":"确定要删除该题吗?", - modalsBottomval:index==1?"公开后不能重设为私有":"", - modalSave:()=>this.sureOperation(index) - }) - } - // 确定--设为公开/删除 - sureOperation=()=>{ - - } - - //弹框隐藏 - handleDialogClose=()=>{ - this.setState({ - dialogOpen:false - }) - } - - render(){ - let{ - category, - type, - page, - data, - totalCount, - sort_by, - isSpin, - CoursesId, - dialogOpen, - modalsTopval, - modalsBottomval,modalSave - } = this.state; - let isStudent = this.props.isStudent(); - let is_current=this.props.is_current; - return( -
    - - - -
    - -
    -
      -
    • this.changeCourseListId()}> - 全部 -
    • - { - data && data.course_list && data.course_list.map((item,key)=>{ - return( -
    • this.changeCourseListId(`${item.id}`)}> - {item.name} -
    • - ) - }) - } -
    -
    -
    -

    - 共参与{totalCount}个题库 -

    -
  • - {sort_by=="updated_at"?"时间最新":sort_by=="name"?"作业名称":"贡献者"} -
      -
    • this.changeOrder("updated_at")}>时间最新
    • -
    • this.changeOrder("name")}>作业名称
    • -
    • this.changeOrder("contributor")}>贡献者
    • -
    -
  • -
    -

    -
    - { - !data || data.question_banks.length==0 && - } - { - data && data.question_banks && data.question_banks.map((item,key)=>{ - return( -
    -
    - -
    -
    -

    - {item.name} - 发送 - { - item.is_public ==false ? - this.setPublic(1)} className="bank_public color-blue_4C fr mr60">设为公开:"" - } -

    -

    - {item.quotes_count}次引用 - {item.solve_count}次答题 - {moment(item.updated_at).format('YYYY-MM-DD HH:mm')} - this.setPublic(2)}>删除 - {item.course_list_name} -

    -
    -
    - ) - }) - } -
    - { - totalCount > 15 && -
    - -
    - } -
    -
    - ) - } -} -export default InfosBank; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/InfosBanner.js b/public/react/src/modules/user/usersInfo/InfosBanner.js deleted file mode 100644 index 16b70895f..000000000 --- a/public/react/src/modules/user/usersInfo/InfosBanner.js +++ /dev/null @@ -1,166 +0,0 @@ -import React, { Component } from 'react'; - -import {Link} from 'react-router-dom'; -import {Tooltip,Menu} from 'antd'; -import {getImageUrl} from 'educoder'; - -import "./usersInfo.css" -import "../../courses/css/members.css" -import "../../courses/css/Courses.css" - -import { LinkAfterLogin } from 'educoder' - -class InfosBanner extends Component{ - constructor(props){ - super(props); - } - render(){ - let { - data , - id, - login, - moduleName, - current_user, - }=this.props; - let is_current=this.props.is_current; - let {username}= this.props.match.params; - let {pathname}=this.props.location; - moduleName=pathname.split("/")[3]; - - let user_id=this.props.current_user&&this.props.current_user.user_id; - let user_type=this.props.current_user&&this.props.current_user.user_identity; - let targetuserid=this.props.data&&this.props.data.id; - - // console.log(is_current) - // console.log(current_user) - // console.log(current_user.is_teacher) - let shixuntype=false; - let pathstype=false; - let coursestypes=false; - if(this.props&&this.props.mygetHelmetapi!=null){ - let shixun="/shixuns"; - let paths="/paths"; - let courses="/courses"; - this.props.mygetHelmetapi.navbar.map((item,key)=>{ - var reg = RegExp(item.link); - if(shixun.match(reg)){ - if(item.hidden===true){ - shixuntype=true - } - } - if(paths.match(reg)){ - if(item.hidden===true){ - pathstype=true - } - } - if(courses.match(reg)){ - if(item.hidden===true){ - coursestypes=true - } - } - }) - } - - return( -
    -
    -
    -

    头像

    -
    -

    - {data && data.name} - {/*{*/} - {/*data && is_current == false && data.identity =="学生" ? "" : */} - {/**/} - {/*}*/} -

    -

    - - - - - - -

    -
    -
    -
    - {is_current ? "我":"TA"}的经验值 - {data && data.experience} -
    -
    - {is_current ? "我":"TA"}的金币 - {data && data.grade} -
    - { - is_current ? - - { - data && data.attendance_signed ? - 已签到 - : - 签到 - } - - : - - - 私信 - - - } -
    -
    -
    - {coursestypes===true?"":
  • - this.setState({moduleName: 'courses'})} - to={`/users/${username}/courses`}>翻转课堂 -
  • } - {shixuntype===true?"":
  • - this.setState({moduleName: 'shixuns'})} - to={`/users/${username}/shixuns`}>实训项目 -
  • } - {pathstype===true?"":
  • - this.setState({moduleName: 'paths'})} - to={`/users/${username}/paths`}>实践课程 -
  • } - {this.props.user&&this.props.user.main_site===true?
  • - this.setState({moduleName: 'projects'})} - to={`/users/${username}/projects`}>开发项目 -
  • :""} - {/*
  • */} - {/* this.setState({moduleName: 'package'})}*/} - {/* to={`/users/${username}/package`}>众包*/} - {/*
  • */} - {this.props.user&&this.props.user.main_site===true?((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin) - &&
  • - this.setState({moduleName: 'videos'})} - to={`/users/${username}/videos`}>视频 -
  • :""} - - {/*自己的主页且不是学生显示题库按钮*/} - {this.props.user&&this.props.user.main_site===true?(is_current && current_user&& current_user.is_teacher ) - &&
  • - this.setState({moduleName: 'topics'})} - to={`/users/${username}/topics/personal`}>题库 -
  • :""} - -
    -
    -
    - ) - } -} -export default InfosBanner; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js deleted file mode 100644 index 50d9e7300..000000000 --- a/public/react/src/modules/user/usersInfo/InfosCourse.js +++ /dev/null @@ -1,398 +0,0 @@ -import React, { Component } from 'react'; -import { SnackbarHOC } from 'educoder'; -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; -import {Tooltip, Menu, Pagination, Spin, Dropdown} from 'antd'; -import Loadable from 'react-loadable'; -import Loading from '../../../Loading'; -import axios from 'axios'; -import NoneData from '../../courses/coursesPublic/NoneData' -import {getImageUrl} from 'educoder'; -import { TPMIndexHOC } from '../../tpm/TPMIndexHOC'; -import { CNotificationHOC } from '../../courses/common/CNotificationHOC' -import "./usersInfo.css" -import Create from './publicCreatNew' - -class InfosCourse extends Component{ - constructor(props){ - super(props); - this.state={ - category:undefined, - status:undefined, - page:1, - per_page:16, - sort_by: "updated_at", - sort_direction: "desc", - totalCount:undefined, - data:undefined, - isSpin:false - } - } - - componentDidMount=()=>{ - this.setState({ - isSpin:true - }) - let {category, status, page, sort_by, sort_direction} = this.state; - this.getCourses(category, status, page, sort_by, sort_direction); - } - - getCourses = (category, status, page, sort_by, sort_direction) => { - let url=`/users/${this.props.match.params.username}/courses.json`; - axios.get((url),{params:{ - category, - status, - page, - sort_by, - sort_direction, - per_page: this.props.is_current && category && page ==1?17:16 - }}).then((result)=>{ - if(result){ - console.log("请求成功"); - this.setState({ - totalCount:result.data.count, - data:result.data, - sort_direction: sort_direction, - sort_by: sort_by, - isSpin:false - }) - } - }).catch((error)=>{ - console.log(error); - this.setState({ - isSpin: false - }) - }) - } - - //切换种类 - changeCategory=(cate)=>{ - this.setState({ - category:cate, - page:1, - isSpin:true - }) - let {status, sort_by, sort_direction} = this.state; - this.getCourses(cate, status, 1, sort_by, sort_direction); - } - //切换状态 - changeStatus=(status)=>{ - this.setState({ - status:status, - page:1, - isSpin:true - }) - let {category, sort_by, sort_direction} = this.state; - this.getCourses(category, status, 1, sort_by, sort_direction); - } - //切换页数 - changePage=(page)=>{ - this.setState({ - page, - isSpin:true - }) - let {category, status, sort_by, sort_direction} = this.state; - this.getCourses(category, status, page, sort_by, sort_direction); - } - - // 进入课堂 - turnToCourses=(url,flag)=>{ - if(flag){ - this.props.history.push(url); - } - } - - updatedlist(sort_by) { - //按照什么样子排序 - this.setState({ - isSpin: true - }); - let {category, status, page, sort_direction} = this.state; - this.getCourses(category, status, 1, sort_by, "desc"); - } - - updatedlists(sort_directions, i) { - // console.log("updatedlistssort_direction"); - // console.log(sort_direction); - // console.log(i); - //是否是倒序 - this.setState({ - isSpin: true - }); - - let {category, status, page, sort_by, sort_direction} = this.state; - let sort_directiony = sort_directions; - if (sort_directions === "asc") { - if (sort_directions === sort_direction) { - sort_directiony = "desc" - } - } else if (sort_directions === "desc") { - if (sort_directions === sort_direction) { - sort_directiony = "asc" - } - } - - this.getCourses(category, status, page, sort_by, sort_directiony); - } - - render(){ - let{ - category, - status, - page, - data, - totalCount, - isSpin, - sort_by, - sort_direction - } = this.state; - let is_current=this.props.is_current; - - // console.log(this.props.current_user&&this.props.current_user.user_identity==="学生") - const menu = ( - - this.updatedlist("updated_at")}> - 最新动态 - - this.updatedlist("created_at")}> - 最新创建 - - - - ); - console.log("InfosCourse"); - console.log(status); - return( -
    - - - - - - { - is_current && - - } -

    - 共参与{totalCount}个{category?category=="manage"?"发布":"学习":"课堂"} - - - this.updatedlists("asc", 1)}> - - - - - this.updatedlists("desc", 2)}> - - - - - {sort_by === "updated_at" ? '最新动态' : sort_by === "created_at" ? '最新创建' : ""} - - - - -

    - -
    - {/* 289 */} - { - page == 1 && is_current && !category && - this.props.current_user && this.props.current_user.user_identity != "学生" ? - : "" - } - { - (!data || (data && data.courses.length === 0)) && (category || (!category && this.props.current_user && this.props.current_user.user_identity == "学生")) && - } - { - data && data.courses && data.courses.map((item,key)=>{ - return( -
    this.turnToCourses(`${item.first_category_url}`,item.can_visited)} style={{"cursor": "pointer",height:"289px"}}> - { - item.is_public == 1 && - -
    - - 公开 -
    - } - { - item.can_visited ==false? -
    - -

    非成员不能访问

    -
    :"" - } - -
    -

    - {item.name} -

    - 用户 -

    {item.teacher && item.teacher.real_name}

    -

    {item&&item.school}

    -
    -
    -
    - {item.visits>0? - - {item.visits} - - - :""} - - { - item.members_count > 0 && - - - {item.members_count} - - } - { - item.homework_commons_count > 0 && - - - {item.homework_commons_count} - - } - {/*{*/} - {/*item.attachments_count > 0 && */} - {/**/} - {/**/} - {/*{item.attachments_count}*/} - {/**/} - {/*}*/} -
    -
    -
    - ) - }) - } -
    - { - totalCount > 15 && -
    - -
    - } -
    -
    - ) - } -} -export default InfosCourse; diff --git a/public/react/src/modules/user/usersInfo/InfosIndex.js b/public/react/src/modules/user/usersInfo/InfosIndex.js deleted file mode 100644 index 89d69ab5d..000000000 --- a/public/react/src/modules/user/usersInfo/InfosIndex.js +++ /dev/null @@ -1,90 +0,0 @@ -import React, { Component } from 'react'; -import {Link} from 'react-router-dom'; -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; - -import { SnackbarHOC } from 'educoder'; -import { TPMIndexHOC } from '../../tpm/TPMIndexHOC'; -import { CNotificationHOC } from '../../courses/common/CNotificationHOC' - -import Loadable from 'react-loadable'; -import Loading from '../../../Loading'; - - -const UsersInfo = Loadable({ - loader: () => import('./Infos'), - loading: Loading, -}) - -const VideoUploadList = Loadable({ - loader: () => import('./video/VideoUploadList'), - loading: Loading, -}) -const VideoPublishSuccess = Loadable({ - loader: () => import('./video/VideoPublishSuccess'), - loading: Loading, -}) -const VideoProtocol = Loadable({ - loader: () => import('./video/VideoProtocol'), - loading: Loading, -}) - -const $ = window.$; -class InfosIndex extends Component{ - constructor(props){ - super(props); - this.state={ - data:undefined, - } - } - componentDidMount =()=>{ - - } - - - //判断是否看的是当前用户的个人主页 - componentDidUpdate =(prevProps)=> { - - } - render(){ - let { - data , - }=this.state; - return( - - - {/* --------------------------------------------------------------------- */} - - - {/* 视频发布 */} - () - } - > - () - } - > - () - } - > - - - - - - - () - } - > - - - ) - } -} -export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(InfosIndex) )); \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/InfosPackage.js b/public/react/src/modules/user/usersInfo/InfosPackage.js deleted file mode 100644 index bb2637158..000000000 --- a/public/react/src/modules/user/usersInfo/InfosPackage.js +++ /dev/null @@ -1,351 +0,0 @@ -import React, { Component } from 'react'; -import { SnackbarHOC } from 'educoder'; -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; -import {Tooltip,Menu,Pagination,Spin} from 'antd'; -import axios from 'axios'; -import {getImageUrl} from 'educoder'; -import Modals from '../../modals/Modals'; -import NoneData from '../../courses/coursesPublic/NoneData'; -import "./usersInfo.css" -import moment from 'moment'; -let categorylist=[ - {name:"全部",value:undefined}, - {name:"前端开发",value:"front"}, - {name:"后端开发",value:"backend"}, - {name:"移动开发",value:"mobile"}, - {name:"数据库",value:"database"}, - {name:"云计算和大数据",value:"cloud_compute_and_big_data"}, - {name:"人工智能",value:"ai"}, - {name:"运维与测试",value:"devops_and_test"}, - {name:"其他",value:"other"}, -] -// -function setcategorylist(val){ - let vals="" - categorylist.some((item,key)=> { - if (item.name === val) { - vals=item.value - return true - } - } - ) - - return vals -} -class InfosPackage extends Component{ - constructor(props){ - super(props); - this.state={ - category:undefined, - status:undefined, - page:1, - per_page:20, - sort_direction:'desc', - totalCount:undefined, - data:undefined, - isSpin:false - } - } - - componentDidMount=()=>{ - this.setState({ - isSpin:true - }) - let{category,status,page}=this.state; - this.getCourses(category,status,page); - } - - getCourses=(category,status,page)=>{ - let url=`/users/${this.props.match.params.username}/project_packages.json`; - axios.get((url),{params:{ - category, - status, - page, - sort_by:"published_at", - sort_direction:'desc', - per_page:20 - }}).then((result)=>{ - if(result){ - this.setState({ - totalCount:result.data.count, - data:result.data, - isSpin:false - }) - } - }).catch((error)=>{ - console.log(error); - }) - } - - //切换种类 - changeCategory=(cate)=>{ - this.setState({ - category:cate, - page:1, - isSpin:true - }) - let{status}=this.state; - this.getCourses(cate,status,1); - } - //切换状态 - changeStatus=(status)=>{ - this.setState({ - status:status, - page:1, - isSpin:true - }) - let{category}=this.state; - this.getCourses(category,status,1); - } - //切换页数 - changePage=(page)=>{ - this.setState({ - page, - isSpin:true - }) - let{category,status}=this.state; - this.getCourses(category,status,page); - } - - // 进入课堂 - turnToCourses=(url,flag)=>{ - if(flag){ - this.props.history.push(url); - } - } - - - delectprojectModal=(id)=>{ - this.setState({ - Modalstype: true, - Modalstopval: '是否确认删除?', - ModalSave: () => this.delectproject(id), - ModalCancel: this.cancelProject - }) - } - - cancelProject=()=>{ - this.setState({ - Modalstype: false, - }) - } - - delectproject=(id)=>{ - - let {category,status}=this.state; - debugger - let url=`/project_packages/${id}.json` - - axios.delete(url).then((response) => { - if (response.data.status == 0) { - this.getCourses(category,status,1); - } - }) - .catch(function (error) { - console.log(error); - }); - this.cancelProject(); - } - render(){ - let{ - category, - status, - page, - data, - totalCount, - isSpin - } = this.state; - let is_current=this.props.is_current; - - // console.log(data) - return( -
    - {/*提示*/} - - - - - - { - category=="manage"? - : category=="bidden"? - :"" - } -

    - 共{totalCount}个 - 发布时间 -

    - - {/*bidden_status: "pending"*/} - - {/*category_id: 2*/} - - {/*status: "published"*/} - - {/*type: "bidden"*/} - - {data===undefined?:data.project_packages.length===0?:data.project_packages.map((item,key)=>{ - return( -
    -
    - -
    - 图片 -
    - -
    -
    - - -
    - {item.bidden_status==="pending"?竞标中:""} - {item.bidden_status==="bidding_won"?已中标:""} - {item.bidden_status==="bidding_lost"?未中标:""} -
    - -
    -
    - {item.min_price===null?"":¥{item.min_price}} - {item.max_price===null||item.min_price===null?"":~} - {item.max_price===null?"":¥{item.max_price}} - {item.min_price===null&&item.max_price===null?可议价:""} -
    -
    -
    -
    {item.category_name}
    -
    -
    -
    - - {item.visit_count}人浏览 -
    -
    - - {moment(item.deadline_at).format("YYYY-MM-DD HH:mm")}竞标截止 -
    -
    - - {item.bidding_users_count}人竞标 -
    -
    - {item.published_at===null?更新于:{moment(item.updated_at).format("YYYY-MM-DD HH:mm")} : - 发布于:{moment(item.published_at).format("YYYY-MM-DD HH:mm")} } -
    -
    -
    - - {category=="manage"?item.operation.can_edit===true&&item.operation.can_delete===true? - :"":""} - - {category=="manage"?item.operation.can_edit===true&&item.operation.can_delete===false? -
    - - - -
    :"":""} - - -
    -
    - )})} - - { - totalCount >20 && -
    - -
    - } - -
    -
    - ) - } -} -export default InfosPackage; diff --git a/public/react/src/modules/user/usersInfo/InfosPath.js b/public/react/src/modules/user/usersInfo/InfosPath.js deleted file mode 100644 index c3a1aaa23..000000000 --- a/public/react/src/modules/user/usersInfo/InfosPath.js +++ /dev/null @@ -1,387 +0,0 @@ -import React, { Component } from 'react'; -import { SnackbarHOC } from 'educoder'; -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; -import {Tooltip, Menu, Pagination, Spin, Dropdown} from 'antd'; -import Loadable from 'react-loadable'; -import Loading from '../../../Loading'; -import NoneData from '../../courses/coursesPublic/NoneData' -import axios from 'axios'; -import {getImageUrl,setImagesUrl} from 'educoder'; -import { TPMIndexHOC } from '../../tpm/TPMIndexHOC'; -import { CNotificationHOC } from '../../courses/common/CNotificationHOC' -import "./usersInfo.css" - -import Create from './publicCreatNew' - -class InfosPath extends Component{ - constructor(props){ - super(props); - this.state={ - category:undefined, - page:1, - status:undefined, - per_page:16, - isSpin:false, - sort_by: "updated_at", - sort_direction: "desc", - totalCount:undefined, - data:undefined - } - } - - componentDidMount=()=>{ - this.setState({ - isSpin:true - }) - let {category, status, sort_by, page, per_page, sort_direction} = this.state; - this.getCourses(category, status, sort_by, page, sort_direction); - } - - getCourses = (category, status, sort_by, page, sort_direction) => { - let url=`/users/${this.props.match.params.username}/subjects.json`; - axios.get((url),{params:{ - category, - status, - sort_by, - page, - sort_direction, - per_page:this.props.is_current && category && page ==1?17:16 - }}).then((result)=>{ - if(result){ - this.setState({ - totalCount:result.data.count, - data:result.data, - sort_by: sort_by, - sort_direction: sort_direction, - isSpin:false - }) - } - }).catch((error)=>{ - console.log(error); - this.setState({ - isSpin: false - }) - }) - } - - //切换种类 - changeCategory=(cate)=>{ - this.setState({ - category:cate, - status:undefined, - page:1, - isSpin:true - }) - let {sort_by, sort_direction} = this.state; - this.getCourses(cate, undefined, sort_by, 1, sort_direction); - } - // 切换状态 - changeStatus=(status)=>{ - let {category, sort_by, sort_direction} = this.state; - this.setState({ - status, - page:1, - isSpin:true - }) - this.getCourses(category, status, sort_by, 1, sort_direction); - } - //切换页数 - changePage=(page)=>{ - this.setState({ - page, - isSpin:true - }) - let {category, sort_by, status, sort_direction} = this.state; - this.getCourses(category, status, sort_by, page, sort_direction); - } - - // 进入课堂 - turnToCourses=(url)=>{ - this.props.history.push(url); - } - - - // 切换排序方式 - changeOrder= (sort)=>{ - this.setState({ - sort_by:sort, - isSpin:true - }) - let {category, status, page, sort_direction} = this.state; - this.getCourses(category, status, sort, page, sort_direction); - } - - - //切换种类 - updatedlist(sort_by) { - //按照什么样子排序 - this.setState({ - isSpin: true - }); - let {category, status, page, sort_direction} = this.state; - this.getCourses(category, status, sort_by, 1, "desc"); - } - - //排序 - updatedlists(sort_directions) { - //是否是倒序 - this.setState({ - isSpin: true - }); - let {category, status, page, sort_by, sort_direction} = this.state; - let sort_directiony = sort_directions; - if (sort_directions === "asc") { - if (sort_directions === sort_direction) { - sort_directiony = "desc" - } - } else if (sort_directions === "desc") { - if (sort_directions === sort_direction) { - sort_directiony = "asc" - } - } - - this.getCourses(category, status, sort_by, page, sort_directiony); - } - - - render(){ - let{ - category, - status, - sort_by, - sort_direction, - page, - data, - totalCount, - isSpin - } = this.state; - let isStudent = this.props.isStudent(); - let is_current=this.props.is_current; - const menu = ( - - this.updatedlist("updated_at")}> - 最近更新 - - this.updatedlist("created_at")}> - 最新创建 - - - - ); - - // console.log(this.props.user&&this.props.user.main_site) - return( -
    - - - - - - { - category && category == "manage" && is_current && - - } - { - category && category == "study" && is_current && - - } -
    - 共参与{totalCount}个{category?category=="manage"?"发布":"学习":"实践课程"} - - - this.updatedlists("asc")}> - - - - - this.updatedlists("desc")}> - - - - - {sort_by === "updated_at" ? '最近更新' : sort_by === "created_at" ? '最新创建' : ""} - - - -
    - -
    - {/* 295 */} - { - this.props.user&&this.props.user.main_site===true?page == 1 && is_current && !category ? :"":"" - } - { - this.props.user&&this.props.user.main_site===false?this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?page == 1 && is_current && !category ? :"":"":"" - } - { - (!data || (data && data.subjects.length==0)) && category && - } - { - data && data.subjects && data.subjects.map((item,key)=>{ - return( -
    this.turnToCourses(`/paths/${item.id}`)}> - { - item.tag &&
    {item.tag} - {/**/} -
    - } - Subject12 - -
    - ) - }) - } -
    - { - totalCount > 15 && -
    - -
    - } -
    -
    - ) - } -} -export default InfosPath; diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js deleted file mode 100644 index 9dccd1c3d..000000000 --- a/public/react/src/modules/user/usersInfo/InfosProject.js +++ /dev/null @@ -1,390 +0,0 @@ -import React, { Component } from 'react'; -import { SnackbarHOC } from 'educoder'; -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; -import {Tooltip, Pagination, Spin, Dropdown, Menu} from 'antd'; -import axios from 'axios'; -import NoneData from '../../courses/coursesPublic/NoneData' -import {getImageUrl} from 'educoder'; -import "./usersInfo.css" -import Create from './publicCreatNew' - -class InfosProject extends Component{ - constructor(props){ - super(props); - this.state={ - category:undefined, - status:undefined, - page:1, - per_page:16, - sort_by: "updated_on", - sort_direction: "desc", - totalCount:undefined, - data:undefined, - isSpin:false - } - } - - componentDidMount=()=>{ - this.setState({ - isSpin:true - }) - let {category, status, page, sort_by, sort_direction} = this.state; - this.getCourses(category, status, page, sort_by, sort_direction); - } - - getCourses = (category, status, page, sort_by, sort_direction) => { - let url=`/users/${this.props.match.params.username}/projects.json`; - axios.get((url),{params:{ - category, - status, - page, - sort_by, - sort_direction, - per_page:this.props.is_current && category && page ==1?17:16 - }}).then((result)=>{ - if(result){ - if (result.data.status === 403||result.data.status === 401||result.data.status === 500||result.data.status === 404) { - this.setState({ - isSpin:false, - totalCount:0 - }) - }else{ - this.setState({ - totalCount:result.data.count, - data:result.data, - sort_by: sort_by, - sort_direction: sort_direction, - isSpin:false - }) - } - - } - }).catch((error)=>{ - console.log(error); - this.setState({ - isSpin: false - }) - }) - } - - //切换种类 - changeCategory=(cate)=>{ - this.setState({ - category:cate, - page:1, - isSpin:true - }) - let {status, sort_by, sort_direction} = this.state; - this.getCourses(cate, status, 1, sort_by, - sort_direction); - } - //切换状态 - changeStatus=(status)=>{ - this.setState({ - status:status, - page:1, - isSpin:true - }) - let { - category, sort_by, - sort_direction - } = this.state; - this.getCourses(category, status, 1, sort_by, - sort_direction); - } - //切换页数 - changePage=(page)=>{ - this.setState({ - page, - isSpin:true - }) - let { - category, status, sort_by, - sort_direction - } = this.state; - this.getCourses(category, status, page, sort_by, - sort_direction); - } - - // 进入项目 - turnToCourses=(url,flag)=>{ - if(flag){ - window.location.href=url; - } - } - - - //切换种类 - updatedlist(sort_by) { - //按照什么样子排序 - this.setState({ - isSpin: true - }); - let {category, status, page, sort_direction} = this.state; - this.getCourses(category, status, 1, sort_by, "desc"); - } - - //排序 - updatedlists(sort_directions) { - //是否是倒序 - this.setState({ - isSpin: true - }); - let {category, status, page, sort_by, sort_direction} = this.state; - let sort_directiony = sort_directions; - if (sort_directions === "asc") { - if (sort_directions === sort_direction) { - sort_directiony = "desc" - } - } else if (sort_directions === "desc") { - if (sort_directions === sort_direction) { - sort_directiony = "asc" - } - } - this.getCourses(category, status, page, sort_by, sort_directiony); - } - - render(){ - let{ - category, - status, - page, - data, - totalCount, - isSpin, - sort_by, - sort_direction - } = this.state; - let isStudent = this.props.isStudent(); - let is_current=this.props.is_current; - - const menu = ( - - this.updatedlist("updated_on")}> - 最新动态 - - this.updatedlist("created_on")}> - 最新创建 - - - - ); - return( -
    - - - - - { - is_current && - - } -

    - 共参与{totalCount}个{category?category=="manage"?"发布":"学习":"项目"} - - - this.updatedlists("asc")}> - - - - - this.updatedlists("desc")}> - - - - - {sort_by === "updated_on" ? '最近更新' : sort_by === "created_on" ? '最新创建' : ""} - - - -

    - -
    - {/* 289 */} - { - page == 1 && is_current ? - :"" - } - { - (!data || (data && data.projects.length==0)) && category && - - } - { - data===undefined||data.projects.length===0?category=="manage"||category=="study"?""::"" - } - { - data && data.projects && data.projects.map((item,key)=>{ - return( -
    this.turnToCourses(`/projects/${item.id}`,item.can_visited)} style={{"cursor": "pointer","height":"289px"}}> - { - item.is_public==1 && - -
    - - 公开 -
    - } - { - item.can_visited ==false? -
    - -

    非成员不能访问

    -
    :"" - } -
    -

    - {item.name} -

    - 用户 -

    {item.owner.real_name}

    -

    {item.owner.school_name}

    -
    -
    -
    - { - item.members_count > 0 && - - {item.members_count} - } - { - item.issues_count > 0 && - - {item.issues_count} - } - { - item.changesets_count > 0 && - - {item.changesets_count} - } -
    -
    -
    - ) - }) - } -
    - { - totalCount > 15 && -
    - -
    - } -
    -
    - ) - } -} -export default InfosProject; diff --git a/public/react/src/modules/user/usersInfo/InfosShixun.js b/public/react/src/modules/user/usersInfo/InfosShixun.js deleted file mode 100644 index 80a19baa7..000000000 --- a/public/react/src/modules/user/usersInfo/InfosShixun.js +++ /dev/null @@ -1,440 +0,0 @@ -import React, { Component } from 'react'; - -import {Pagination, Spin, Dropdown, Menu} from 'antd'; - -import NoneData from '../../courses/coursesPublic/NoneData' -import axios from 'axios'; -import { setImagesUrl } from 'educoder'; - -import "./usersInfo.css" - -import Create from './publicCreatNew' -import GotoQQgroup from "../../../modal/GotoQQgroup"; - -class InfosShixun extends Component{ - constructor(props){ - super(props); - this.state={ - category:undefined, - page:1, - status:undefined, - per_page:16, - isSpin:false, - sort_by: "updated_at", - sort_direction: "desc", - totalCount:undefined, - data:undefined, - goshowqqgtounp:false, - } - } - - componentDidMount=()=>{ - this.setState({ - isSpin:true - }) - let {category, status, sort_by, page, sort_direction} = this.state; - this.getCourses(category, status, sort_by, page, sort_direction); - } - - getCourses = (category, status, sort_by, page, sort_direction) => { - // console.log("请求数据成功"); - // console.log("getCourses"); - // console.log(sort_by); - // console.log(sort_direction); - let url=`/users/${this.props.match.params.username}/shixuns.json`; - axios.get((url),{params:{ - category, - status, - sort_by, - page, - sort_direction, - per_page:this.props.is_current && category && page ==1?17:16 - }}).then((result)=>{ - if(result){ - console.log("请求数据成功"); - console.log(sort_by); - this.setState({ - totalCount:result.data.count, - data:result.data, - sort_by: sort_by, - sort_direction: sort_direction, - isSpin:false - }) - } - }).catch((error)=>{ - console.log(error); - this.setState({ - isSpin: false - }) - }) - } - - //切换种类 - changeCategory=(cate)=>{ - this.setState({ - category:cate, - status:undefined, - page:1, - isSpin:true - }) - let {sort_by, sort_direction} = this.state; - this.getCourses(cate, undefined, sort_by, 1, sort_direction); - } - // 切换状态 - changeStatus=(status)=>{ - this.setState({ - status, - page:1, - isSpin:true - }) - let {category, sort_by, sort_direction} = this.state; - this.getCourses(category, status, sort_by, 1, sort_direction); - } - //切换页数 - changePage=(page)=>{ - this.setState({ - page, - isSpin:true - }) - let {category, sort_by, status, sort_direction} = this.state; - this.getCourses(category, status, sort_by, page, sort_direction); - } - - // 进入课堂 - turnToCourses=(url)=>{ - this.props.history.push(url); - } - - - // 切换排序方式 - changeOrder= (sort)=>{ - this.setState({ - sort_by:sort, - isSpin:true - }) - let {category, status, page, sort_direction} = this.state; - this.getCourses(category, status, sort, page, sort_direction); - } - - //切换种类 - updatedlist(sort_by) { - //按照什么样子排序 - this.setState({ - isSpin: true - }); - let {category, status, page, sort_direction} = this.state; - this.getCourses(category, status, sort_by, 1, "desc"); - } - - //排序 - updatedlists(sort_directions) { - //是否是倒序 - this.setState({ - isSpin: true - }); - let {category, status, page, sort_by, sort_direction} = this.state; - let sort_directiony = sort_directions; - if (sort_directions === "asc") { - if (sort_directions === sort_direction) { - sort_directiony = "desc" - } - } else if (sort_directions === "desc") { - if (sort_directions === sort_direction) { - sort_directiony = "asc" - } - } - - this.getCourses(category, status, sort_by, page, sort_directiony); - } - // 处理弹框 - setgoshowqqgtounp=(bool)=>{ - this.setState({ - goshowqqgtounp:bool - }) - } - - - render(){ - let{ - category, - status, - sort_by, - page, - data, - totalCount, - sort_direction, - isSpin, - goshowqqgtounp - } = this.state; - - let is_current=this.props.is_current; - const menu = ( - - this.updatedlist("updated_at")}> - 最新动态 - - this.updatedlist("created_at")}> - 语言类别 - - - - ); - return( -
    - { - goshowqqgtounp===true? - this.setgoshowqqgtounp(bool)}> - : - "" - } - - - - - - { - category && category == "manage" && is_current && - - } - { - category && category == "study" && is_current && - - } -
    - 共参与{totalCount}个{category?category=="manage"?"发布":"学习":"实训"} - - - this.updatedlists("asc")}> - - - - - this.updatedlists("desc")}> - - - - - {sort_by === "updated_at" ? '最新动态' : sort_by === "created_at" ? '语言类别' : ""} - - - -
    - -
    - {/* 298 */} - { - page == 1 && is_current && !category ? - this.setgoshowqqgtounp(bool)}>:"" - } - { - (!data || (data && data.shixuns.length==0)) && category && - } - { - data && data.shixuns && data.shixuns.map((item,key)=>{ - return( -
    this.turnToCourses(`/shixuns/${item.identifier}/challenges`)}> - { - item.tag &&
    {item.tag} - {/**/} -
    - } - { - item.is_jupyter===true? -
    -

    Jupyter

    - {/**/} -
    - :""} - - - - - -
    -

    - {item.name} -

    -
    -

    -
    -

    - 已完成 {item.finished_challenges_count} / {item.challenges_count} -

    -
    -
    - ) - }) - } -
    - { - totalCount > 15 && -
    - -
    - } -
    -
    - ) - } -} -export default InfosShixun; diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js deleted file mode 100644 index cd05d51ce..000000000 --- a/public/react/src/modules/user/usersInfo/InfosTopics.js +++ /dev/null @@ -1,594 +0,0 @@ -import React, { Component } from 'react'; -import { SnackbarHOC } from 'educoder'; -import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom'; -import {Tooltip,Menu,Pagination,Spin, Dropdown,Checkbox} from 'antd'; -import axios from 'axios'; -import {getImageUrl,WordsBtn} from 'educoder'; -import moment from 'moment'; -import Modals from '../../modals/Modals'; -import SendTopics from '../../modals/SendTopics' -import NoneData from '../../courses/coursesPublic/NoneData'; -import "./usersInfo.css"; -import Withoutpermission from './Withoutpermission.png'; - - - -class InfosTopics extends Component{ - constructor(props){ - super(props); - this.state={ - isSpin:false, - category:"normal", - course_list_id:undefined, - sort_by:"updated_at", - sort_direction:"desc", - page:1, - data:undefined, - checkBoxValues:[], - per_page:15, - isshowprofes:false - } - } - - componentDidMount(){ - // let types=this.props.match.params.topicstype; - // let professional_certification=this.props.current_user&&this.props.current_user.professional_certification; - // - // if(professional_certification===false&&types==="publicly"){ - // this.setState({ - // isshowprofes:true - // }) - // }else{ - // this.updataslist() - // } - this.updataslist() - } - // componentDidUpdate(prevProps) { - // - // if(prevProps.current_user!=this.props.current_user){ - // let types=this.props.match.params.topicstype; - // let professional_certification=this.props.current_user&&this.props.current_user.professional_certification; - // - // console.log(professional_certification) - // if(professional_certification===false&&types==="publicly"){ - // this.setState({ - // isshowprofes:true - // }) - // }else{ - // this.updataslist() - // } - // } - // } - updataslist=()=>{ - let types=this.props.match.params.topicstype; - let { category,course_list_id,sort_by,sort_direction,page}=this.state; - this.searchAlldata(types,category,course_list_id,sort_by,sort_direction,page) - } - searchAlldata=(type,category,course_list_id,sort_by,sort_direction,page)=>{ - - this.setState({ - isSpin:true - }) - - let {per_page}=this.state; - let url=`/users/question_banks.json`; - - axios.get(encodeURI(url),{params:{ - type, - object_type:category, - course_list_id, - sort_by, - sort_direction, - page, - per_page - } - }).then((response) => { - if(response){ - if(response.status){ - if(response.data.status == -2){ - this.setState({ - isshowprofes:true, - isSpin:false - }) - }else if(response.data.status === 403||response.data.status === 401||response.data.status === 500){ - this.setState({ - isSpin:false - }) - }else{ - this.setState({ - data:response.data, - checkBoxValues:[], - isSpin:false - }) - } - } - } - - }).catch((error) => { - this.setState({ - isSpin:false - }) - }); - - } - - searchCategory=(type)=>{ - this.setState({ - category:type, - course_list_id:undefined, - }) - - let types=this.props.match.params.topicstype; - let { category,course_list_id,sort_by,sort_direction,page}=this.state; - this.searchAlldata(types,type,undefined,sort_by,sort_direction,page) - } - - searchCourselistid=(id)=>{ - this.setState({ - course_list_id:id - }) - - let types=this.props.match.params.topicstype; - let { category,course_list_id,sort_by,sort_direction,page}=this.state; - this.searchAlldata(types,category,id,sort_by,sort_direction,page) - } - - onCheckBoxChange=(checkedValues)=>{ - if(checkedValues.length>15){ - this.props.showNotification("选择条数不能大于15条") - }else{ - this.setState({ - checkBoxValues:checkedValues - }) - } - - } - - updatedlist=(updatedtype)=>{ - let types=this.props.match.params.topicstype; - let { category,course_list_id,sort_by,sort_direction,page}=this.state; - if(updatedtype===sort_by){ - if(sort_direction==="desc"){ - this.setState({ - sort_direction:"asc", - sort_by:updatedtype - }) - this.searchAlldata(types,category,course_list_id,updatedtype,"asc",page) - }else{ - this.setState({ - sort_direction:"desc", - sort_by:updatedtype - }) - this.searchAlldata(types,category,course_list_id,updatedtype,"desc",page) - } - }else{ - this.setState({ - sort_direction:"desc", - sort_by:updatedtype - }) - this.searchAlldata(types,category,course_list_id,updatedtype,"desc",page) - } - } - - - changePage=(pageNumber)=>{ - let types=this.props.match.params.topicstype; - let { category,course_list_id,sort_by,sort_direction,page}=this.state; - this.searchAlldata(types,category,course_list_id,sort_by,sort_direction,pageNumber) - this.setState({ - page:pageNumber, - checkBoxValues:[] - }) - } - - deletecheckBoxValues=()=>{ - let {checkBoxValues}=this.state; - - if(checkBoxValues.length===0){ - this.props.showNotification("请选择题库") - }else{ - this.setState({ - Modalstype:true, - Modalstopval:"是否确认删除?", - ModalCancel:this.topicscancelmodel, - ModalSave:this.topicssavedelete, - }) - } - } - - topicssavedelete=()=>{ - let {checkBoxValues,category}=this.state; - const url = `/question_banks/multi_delete.json`; - axios.delete(url, { data: { - object_id: checkBoxValues, - object_type:category - }}) - .then((response) => { - if(response.data.status===0){ - this.updataslist() - this.props.showNotification(response.data.message) - }else{ - this.props.showNotification(response.data.message) - } - }) - .catch(function (error) { - console.log(error); - }); - - this.topicscancelmodel() - } - - - topicscancelmodel=()=>{ - this.setState({ - Modalstype:false, - Loadtype:false, - visible:false, - Modalstopval:"", - ModalCancel:"", - ModalSave:"", - checkBoxValues:[], - checkedtype:false - }) - - } - openTopics=(id)=>{ - this.setState({ - Modalstype:true, - Modalstopval:"公开后不能重设为私有", - ModalsBottomval:"是否确认设为公开?", - ModalCancel:this.topicscancelmodel, - ModalSave:()=>this.topicssaveonOpen(id), - }) - } - - topicssaveonOpen=(id)=>{ - - let {category}=this.state; - const url = `/question_banks/multi_public.json`; - axios.post(url,{ - object_id:[id], - object_type:category - }).then((response) => { - if(response.data.status===0){ - this.updataslist() - this.props.showNotification(response.data.message) - }else{ - this.props.showNotification(response.data.message) - } - }).catch(function (error) { - console.log(error); - }); - - this.topicscancelmodel() - } - - - sendTopics=()=>{ - let {checkBoxValues}=this.state; - if(checkBoxValues.length===0){ - this.props.showNotification("请选择题库") - }else{ - this.setState({ - visible:true - }) - } - - } - render(){ - let{ - category, - course_list_id, - isSpin, - data, - page, - sort_direction, - sort_by, - checkBoxValues, - Modalstype, - visible, - isshowprofes - } = this.state; - let { - is_current, - current_user, - }=this.props; - - let categorylist=[ - {val:"普通作业",type:"normal"}, - {val:"分组作业",type:"group"}, - // {val:"毕设选题",type:"gtopic"}, - // {val:"毕设任务",type:"gtask"}, - {val:"试卷",type:"exercise"}, - {val:"问卷",type:"poll"}, - ] - - let types=this.props.match.params.topicstype; - let username=this.props.match.params.username; - - - //types===publicly 公共 - //types===personal 私有 - let user_id=this.props.current_user&&this.props.current_user.user_id; - let user_type=this.props.current_user&&this.props.current_user.user_identity; - let targetuserid=this.props.data&&this.props.data.id; - - - - // console.log(is_current) - // console.log(current_user) - // console.log(current_user.is_teacher) - // console.log(current_user.admin) - const menu = ( - - this.updatedlist("updated_at")}> - 最近更新 - - this.updatedlist("name")}> - 题目名称 - - {types==="publicly"?this.updatedlist("contributor")}> - 贡献者 - :""} - - ); - - // console.log(this.props) - return( -
    - {/*提示*/} - - {Modalstype&&Modalstype===true?:""} - - {/*发送至弹窗*/} - { - visible&&visible===true? - this.updataslist()} - topicscancelmodel={()=>this.topicscancelmodel()} - />:"" - } - - - -
    - {types==="publicly"?
    - 我的题库 -
    公共题库
    -
    :
    -
    我的题库
    - 公共题库 -
    } - - {isshowprofes===false? -
    - -
    - {categorylist.map((item,key)=>{ - return( - this.searchCategory(item.type)}>{item.val} - ) - })} - -
    - - {data&&data.count===undefined?"":data&&data.count===0?"":
    -
  • this.searchCourselistid(undefined)}>全部
  • -
    - {data===undefined?"":data.course_list===undefined||data.course_list.length===0?"":data.course_list.map((item,key)=>{ - return( -
  • this.searchCourselistid(item.id)}>{item.name}
  • - ) - })} -
    -
    } - -
    :
    -

    -

    -
    -
    通过职业认证的教师才能访问公共题库
    - -
    -

    -
    } - - - - -
    - - {isshowprofes===false?data&&data.count===undefined?"":data&&data.count===0?"":
    -

    - {data&&data.count===undefined?0:data&&data.count} - 已选择 {checkBoxValues.length} 个 (不支持跨页勾选) -

    -

    - - - - {sort_by==="updated_at"?'最近更新':sort_by==="name"?'题目名称':sort_by==="contributor"?"贡献者":""} - this.updatedlist(sort_by)}> - - - - - - {user_type!="学生"?this.sendTopics()}>发送:""} - {types==="personal"?((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin) - &&this.deletecheckBoxValues()}>删除:""} -

    -
    :""} - - - {isshowprofes===true?"":data===undefined?:data.question_banks===undefined||data.question_banks.length===0?: - - {data.question_banks.map((item,key)=>{ - return( -
    -
    -
    - -
    - {user_type!="学生"?:""} - - - 55?item.name:""} className="ml10 fl mt3 font-16 color-dark maxwidth900" href={ - category==="normal"?`/banks/normal/${item.id}/${types}?tab=0`: - category==="group"?`/banks/group/${item.id}/${types}?tab=0`: - category==="poll"?`/banks/poll/${item.id}/${types}`: - category==="exercise"?`/banks/exercise/${item.id}/${types}`: - category==="gtask"?`/banks/gtask/${item.id}/${types}?tab=0`: - category==="gtopic"?`/banks/gtopic/${item.id}/${types}?tab=0`:"" - } - > - {item.name} - - - {item.is_public===true?types==="publicly"?"":公开:""} - - - -
    - -

    - - {types==="publicly"?{item.creator_name}:""} - {item.quotes_count} 次引用 - {item.solve_count} 次答题 - {moment(item.updated_at).fromNow()} - - {item.course_list_name===null?"": -

    {item.course_list_name}
    - } -

    - -
    - {types==="personal"?((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin) - &&编辑 - :""} - {types==="personal"&&item.is_public===false?((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin) - &&this.openTopics(item.id)}>设为公开:""} - -
    -
    -
    - -
    -
    - )})} -
    - } - - { - isshowprofes===true?"":data&&data.count >15 && -
    - -
    - } - -
    -
    - ) - } -} -export default InfosTopics; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/Withoutpermission.png b/public/react/src/modules/user/usersInfo/Withoutpermission.png deleted file mode 100755 index 791a0bc6e942946539c66d2bcfe8d09abd7e3680..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8051 zcmdscRa6{7v@Nbd1{s1AWY7S?J;>lNXt3Y}x50xG7~I|6B|vbOAy^3R5Fi5~Xdt)* z!kt`McdhsF*86@R-CbS1tE+o;*E##_9jysbB*3G>LqS0yP*wtKBah#Z+X4<2a({!X zevE=bFQyEZ(S2|F%LH4WTDh(73*`%DJ}gD2k)2PrwwtTX-A}=rtAXN!R{l;_=vY=@ z&8g~gpFWa!Osoave9u#E^sK}BlZM0jk6qOgVT0zi0xX% zFPBG6@G!&DAT0LW*=6Pf4F{(4o&Zvp9EJ4(pI@Hcmo7eqhw(pW`hT2hN&w4;J!AN) z4bQ|U+HrUh@AdX&i&hVDRx?B-#<$E_L>@*j?ElyOWgICV#PA4zb8~f`(Ub3vSVD30P$c}PMLY{lR*)_ zl+2J(-c^#3v{SmxTs&J*QpmwGgm)$} zTN-D}6N@U&S?IvDP$6XY3%tjYlUeD;&tLHylVon$r2kR9Vm9vH{fmNQe8w+7CdOCg zqbQ<$Y^{?s_V{DOT)f0WJvUr5j6Hmu4QIU|&Yxi(hhwY9ofC^xzvyYrh>6_NiI$ex zs0iZ&wL9=lgICCB*%MD)XN=u#js+pk1OExX>`a7A?O&W7@U~3s6vww(8+|Dom2$r3 z(kLWM96P<4y7b-|$(qLAX?*z5)JFF|oX?3|{1! zBp86HDqdPF?Ky5(%$`{q}aB&ZTbl!T8I*V$(yAn#e@t_j7as zqn9GYfWoLzHp;|VHAaP5=t|UjLhtA%0zg~1D=%&*YS+CEHZ`(T zzT56rU%uPRf?8F6{XuPxo57jErq71!EX09x8Lz;Y*+M>st_~7d^IgLi$e($yU0B4f z&}vz_TIOBpf6zDMm)&Uyn14=)$$FmxrDrI^SFSeT09npb|B<8oo$1<+n-gg5Rv@I8 z0lIgx*~-JU720Nc94sr4oYZRF?6}o0Yx)Wzv7}E``wYfKXTs2;-Q{Sp$yZsd;T@Vl zLt}6y=xbCSue}l1brksgM`Fv*v-T%kig5LZ0oBuklcRRxyYawmC}=2QV53oVBoGMm~`q8_3YI`NdM5@Kh?MFU^kIPQ=b3 z;CF{Ia>*wk-|}y!6+jMW(A~|~!gK+3@O%buknfV&tnBz;b-0Pt$j-`Z92y^4wh&fI z+ST56tP&QLa%Kf*mr=H*4lo*ekFv*$0hCLl9g|Mo?`hY{v^q`WB$HpjDWFJE`z((a zPY#5XZcez|Sisfag9#HgaLo)n*@hR7de;po$y&tURPpSORUiU_sa-3wr;%`}$D3 z95fc89IMIlnM_Pjir5e}it58_VtOFM#<5xeT9x|f%WNoCB0t{Gb`nA{h3j0TG=KAjB^c}L8^g+KeG)GtG0 zDZsZXkQa808z?G84tcaqq>uV0o{@{3*glK)@o$K!b1-uf%HYUbq7#RXiCfk00*Y&d z0TxCV+uyNaM8x(YP*V-rA8O7?e^!6Wo%{VFX%vcXU-Z!c>j4355*@GYyM zD@{2uPZN=l>SU9NbWEy2b7$SwDwZ!AE_$PIfgp~-{DuAN?MFdyC)&HniBQL-3?PB< zVNv4itw7?z>EF|X(9iCY$mEpHk8ZTrkmwIrI)D5b7^CP4snGRx4FnfQV($Sz5YTUlO-VKimEvZkPt5A?^c!T^i ztEK5u4|dmyWW$QSvuhi~5!r&ALlXJYuXZl3l2Q>*=$Ddt2UQK3|9IsNrpXco_;t?u%X z{yo*>U`WEWJ0k)1A6c$9ZbcD*=!TW`5**@ZV#kF$Eah{ezRuzpj8E4;d#k9=e+-(a zP$p%^D-)5(c`!2E&Te=O-GmAE3gG-j%%i@Tp~}H2Hc|kOl4;Rd?4>GIJ+9A>CX6S{ z2#V?&f2D%FFmQiCbFAK|ILo((lV4fJ;Tc3Vf zenSiLk|c$oHqE&7_xth$m{y6Ew@+a;;X>Roi!tfy8jOOd*o=vg%j#N)ai1z8N0{C_ z9P>(X$vxBNIdU9=xGr|L5J3K6w=33QWH8v4!qK$ah*VVuP}ABbJ8`iyk-CLNi-Wyw zksV|1lJNpft>YCxDhqZ{;FTV8>Y<>|#O@Yvb+S%dR(A8E1Z*k%dN^`0^$&H|GxnxG z7|OM;CD*lo%{7wqVo5zCb$OP>#uP~v-KYk~DSBhx=^xGKmh$e%Dw~)(`nj^mV&QAw zs# z_?cv1d+|>6v73FLL|s<~#DOT;ioj>W0PdNv%N(G;@(?MgC!;`y#X)3MeQkM^EMhk_ z6N_Nz-3 zQK49@&okHq*PDeNT5UN>Fle>umH6?)5qZp|*+9u^jq=0aA>*sy<2gLlN$u4+mfaKO zj$v9d_#llb*F1*drrNoZ}l^ke}T`e!WhI`xx z2i-z+oR~sWidlYJoVQnM(CCB7pFdpx%s23r7I(yTANhOp^!GtkWHIVop(s2qvP8@HA{I18&@=|u+h^sAjgliYU?SNPDHGVt#MTay1C z;(vI-Xl2gF0)jd5&fbqpb*0U9(KHWzPRktj%UEiv@M%JPK2u0F+YAH_4m_L zmo>cYb|F1xkt)#p%y*7}>yz@=n`QA|UqTGUCHwk|4~$Xl9MfoLsEaMJ=f(j{Y^)y^ zVMa3Q88_X3x?0NCq~cv(FT&)KbFeQ`S!f_fb;7xqP8X=duA-^;6(1(aCm6S!Qsg7z z3Uq}xG`LA%0ljJ}kJxWNZWigUi<8BI_aj-?9M;?E ziVz86suHWB?hyxilAIE&ZD}h z7b!G{i)YLZUQEAlDQwVYq$%6Gi5s`~q(x}%-b|da7x##K>G{+_gv#8+=pSJ1W~w{9 z#MIyOq$bmlx%9KX!PU>8N~dzGGFWOUShM`-8md?+3Xd+}n*V^}u+D%_%lgrQoS6Ij z)l7cp5z)T1{fJAjxhwnyIqe?WSG5kZJGQZ^{3tmTz@^m?AXzAR6GV)=y7)i<~yiK%A&Vd}z7phd1aak-? zc;Sbd&C!%9_H3S3OCIj8?*Ri^BNx?_DUKh%ve@D*F19GuYge{MisIe&wxq>(FN&nu1d>GsNtWKt3$cY2&nt<&d3^7aU5N2Hvk2} zT&?kRH=i{}FymQ;u_@vcu=72u^)k*PN1cuUl-Ipi?zlB&2hYY#bAd1BIy?AuXA0+T z6jUWV8yc_rUPk?rWiKsckP3pUa$?Wl3KQql1CP72pgoN{eOp-(=rjZ6r2wEBxz#K* zV@tmXgtLgVb|+e~22%w5WZAvn42GE5^(o_!x{y?@-4y7kcGSvQrl+Ui+M2nmZI5R` z_p101pjW-O1^P(7_zICl4q_aDb*~Ho@__*RZE{7_T$Y|P0epM^%OMywWu#5FoK#_E zC}@O_4{-& zqnZ=go}py@Yrh*X95Q^?F}%T#;G#oWf&z&`#*u9`tUSU0E4(`cYMWl6B1h=W(FnN>^iP^XeJIsjZIC-bAw&DdjRuRLl?k&)%6CZT98r2queH3CK3(JH`T}sBgVy4 z_Nn%eZ~hEZfC%IaT$(xi*gHC#0%W1X0b&x`3)d%WG0=l5axPah`aEq8l9twq0cF@k zW-Yv=KS_lTu>etGS}$B$Yw1kUdw1_D@b=QdKk^=L;){Q;so(W2s{D|}V&b#R!N?u7 zmm_jD4T48#tN?C(Gz7CzmK8i(@O9q-Hh_6W$Hwl!DV$T7TOLWh zHdXQWy)kpg-Z51&9Ht{k9_M;o#=>IBq~Y+=&(BuI4P)HZbu-ziQ9Fk2nMtsJ&95R^ za9Ph?fP!kH(b|m6C`?BTAG9!~3=8w7e&5ql4DWnIreHE2R_mxwbq{|oDsuplI^Xsv zSF|Tq)1e|?6) z`Q~#!e85Jwd9@Zplf+O{JR*EQ{j5H{w zCwAG20V5HCl%QKk&m00S8o<*ggd1so2*41D?4eul#5q>!IBK*(&PQ2wVIH|KiB;Z4EgBA8Rf#Qd<_gdO z%1pjxQnPzvQ)TUhmrnrsJz73BaY4BGR5a@mi+|Z)PFF3DDM$`^{S#V9OfYY}@eqWn z1owA?F`>d;y~;=__E&G1YP`_tM;*VVTZyix6Pnqzx=wbv9TayG1jiL<5SjuRS+(PH zF^~T%F7Pe!X2FoH!5@ns7a3MwIf{gV(B85WplKgCXF*kxyL$6e1-|X)@*?6WgNJ<( zEajF}F3w{xek{dFAGa@bQ#hr#(tM7};|ipcI_GQnhC`IGdn?@sUif3QS@I&@_;Iw_ zZwRuWHQ(p93=((zTYQ>vMiX2gt)~1%tX}DQwYwBnRlaCBa$vOq5Eh$^MdLr;Thj?& zR*z3VMl=mm<)=BoU`9#;WW=pj89Huq1u_%r21E8T>Z5`<#*)=FM5b*qP$(|fDx^kb`co)WX$q*G{cdu8d~`>b&7@Xga- zX7_ueH$rwUdWKg#EDgUtW9V`*y|%g7zFOiNcWvVP4T+j20Wip;y&woqhx z2G&cVrD!FmiE$_i$&kmpZEs9c2qlEnbr_qkChWbj9mO}4?orGdf%SzE8%jmLyIy2nZV#;N z^^*_~CZ%ve;}6HR1+7`#Z!<-v6OD+#5s)jJKSu2+V-fTIR)7m4PUN%FTg@9WmKH73 zN3lgirQdorxDnyczkbGS(Z76cJ7{vlt%4JIRPPZm%4jh!nEODe*5SrKU(#l<*iyyQdXc`0NNmLEh)Xuqn>v|uIxH&9vQ)kLJs1N~ zBbsP_sfPoedP5Cs?%A_^v96HBMoS3F(=I~>V|Er`OOKQ#Pj?vVqPV1k7c<}>;mf3f zi{)qMVQq94}&|RC_ z{~<;zGM_PJe-wtH(qjgi;^E7ZtnxEz|6xX|g`-nRoR#6wh>+b-WK`gy10%T`y1Dy} znn)^Y{~GN-3dh^&56T-4LDDv?Z`&u?NaBX#C=!c3@B`Tfp-)jwSq{AX#{$n#8YBLf z5!U_x0S~D|oHT5`AXBw=<3VHdiwz@V`A6+9;@{5(Kiqx=@EqqfWBzvqA-U2aC*l}C z+=~O2l~EZfU2tkWNNiu<9{X9?7rY%s;Z1{T8)`s0bqqOq}Qqt;2L{WGVAZo6#dhZ%JrOm#6)nWveqWXeA1_Jk(Lag8M zey;=z$ZnWsHre`$NlnC3_}}kKu~=#;_LMo|V7DYfJUpSEYUnh=L)(5B(3FGwFC-ti z-qBpt*E7;+HVEc;db%rI*`yl%O0dETrPmcjLue*hCgXhMn$nS=(h4djFzQNx3Js*u ze*knKok$uD!vE88j0=fI+JP5hoG26dFnnF$7?lycZYBlmT1R*IsrVDBc^Zr6(2~?M?Wv8Z}rk8jup`b-Nc+0 zTx_YsY&p6t;glj@*&ODNZj@7)lkF3>Scnhvj3KIVn4;Ds_dRsycRjGLj)l{TL1!C| z41V)&oS?iBx07q;!)rh0zA$s`;6uJi8Kord?-yDFi9G$cQ||moIXk==eXV-&Af^G* zF6{L~8zFjKaI2*6?6`3ev9zd7iIZLE>U_93y)pq$&_}#WEa`0K%|MN#h d`q%?c=$q_@K=qa3aHN@zqAU*q*UOrR{s;GxSB(Gw diff --git a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js deleted file mode 100644 index 121119a0d..000000000 --- a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js +++ /dev/null @@ -1,258 +0,0 @@ -import React, { Component } from 'react'; - -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; - -import { Breadcrumb } from 'antd'; -import { SnackbarHOC } from 'educoder'; -import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC'; -import { CNotificationHOC } from '../../../courses/common/CNotificationHOC' - -import "../usersInfo.css" -import "../../../courses/css/members.css" -import "../../../courses/css/Courses.css" - -import Loadable from 'react-loadable'; -import Loading from '../../../../Loading'; - -// 毕设选题 -const GtopicBanks = Loadable({ - loader: () => import('./GtopicBanks'), - loading: Loading, -}) - -const BanksTabIndex = Loadable({ - loader: () => import('./BanksTabIndex'), - loading: Loading, -}) -const GtopicBanksEdit = Loadable({ - loader: () => import('./GtopicBanksEdit'), - loading: Loading, -}) -const HomeworkBanksEdit = Loadable({ - loader: () => import('./HomeworkBanksEdit'), - loading: Loading, -}); -const ExerciseBanksEdit = Loadable({ - loader: () => import('./ExerciseBanksEdit'), - loading: Loading, -}); - -//普通作业题库详情 -const Generaljobbankdetails =Loadable({ - loader: () => import('../../../courses/questionbank/Generaljobbankdetails'), - loading: Loading, -}); -//分组作业题库详情 -const GroupjobbankPage =Loadable({ - loader: () => import('../../../courses/groupjobbank/GroupjobbankPage'), - loading: Loading, -}); -//毕设选题详情 -const CompletetopicdePage =Loadable({ - loader: () => import('../../../courses/comtopicdetails/CompletetopicdePage'), - loading: Loading, -}); -//毕设任务详情 -const Completetaskpage =Loadable({ - loader: () => import('../../../courses/completetaskdetails/Completetaskpage'), - loading: Loading, -}); -//问卷编辑 -const PollNewQuestbank =Loadable({ - loader: () => import('../../../courses/poll/PollNewQuestbank'), - loading: Loading, -}); - -const GtaskBanksEdit = Loadable({ - loader: () => import('./GtaskBanksEdit'), - loading: Loading, -}) - -class BanksIndex extends Component{ - constructor(props){ - super(props); - this.state={ - crumbData:undefined, - publicly:undefined - } - } - - componentDidMount = () =>{ - // let pathname = this.props.location.pathname; - // this.setState({ - // publicly:pathname.indexOf("/publicly") > -1 - // }) - - } - - initPublic = (crumbData,data) =>{ - if(data && data.status && data.status == -2){ - this.props.history.push(`/topicbank/publicly`); - } - this.setState({ - crumbData - }) - } - - componentDidUpdate(prevProps) { - // if(prevProps.current_user!=this.props.current_user){ - // let { publicly }=this.state; - // if( this.props.checkIfLogin()) { - // if (this.props.current_user && this.props.current_user.professional_certification == false && publicly){ - // this.props.history.push(`/topicbank/${this.props.current_user.login}/publicly`); - // } - // } else { - // this.props.showLoginDialog() - // } - // } - // let { publicly }=this.state; - // if(this.props.current_user && this.props.current_user.professional_certification == false && publicly){ - // if( this.props.checkIfLogin()) { - // this.props.history.push(`/topicbank/${this.props.current_user.login}/publicly`); - // } else { - // this.props.showLoginDialog() - // } - // // console.log(`/topicbank/${this.props.current_user.login}/publicly`); - // } - } - - render(){ - let { crumbData }=this.state - const common = { - initPublic:this.initPublic - } - return( -
    -
    - { - crumbData && - - { crumbData && crumbData.is_public == true ? '公共' : '我的' }题库 - { - crumbData.crumbArray && crumbData.crumbArray.map((item,key)=>{ - return( - {item.content} - ) - }) - } - - } - - { - crumbData &&

    - {crumbData && crumbData.title} - { crumbData.is_public == true ? - 公开 - : - 私有 - } - -

    } - - - {/*毕设任务编辑*/} - { - return () - } - }> - - { - return () - } - }> - - { - return () - } - }> - - { - return () - } - }> - - - { - return () - } - }> - - - {/*题库问卷编辑详情*/} - () - } - > - - - { - return () - } - }> - { - return () - } - }> - {/*毕设任务题库详情*/} - () - } - > - {/*毕设内容题库详情*/} - () - } - > - {/*分组作业题库详情*/} - () - } - > - {/* 普通作业题库详情*/} - () - } - > - - - -
    -
    - ) - } -} -export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(BanksIndex) )); - - - -// { -// return () -// } -// }> \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/banks/BanksTabIndex.js b/public/react/src/modules/user/usersInfo/banks/BanksTabIndex.js deleted file mode 100644 index e38bb5de8..000000000 --- a/public/react/src/modules/user/usersInfo/banks/BanksTabIndex.js +++ /dev/null @@ -1,90 +0,0 @@ -import React, { Component } from 'react'; - -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; - - -import Loadable from 'react-loadable'; -import Loading from '../../../../Loading'; - -import BanksMenu from './banksMenu' -// 毕设选题 -const GtopicBanks = Loadable({ - loader: () => import('./GtopicBanks'), - loading: Loading, -}) -// 问卷内容 -const PollBanks = Loadable({ - loader: () => import('./PollBanksContent'), - loading: Loading, -}) -// 试卷详情 -const ExerciseBanksDetail = Loadable({ - loader: () => import('./ExerciseBanksDetail'), - loading: Loading, -}); - -class BanksTabIndex extends Component{ - constructor(props){ - super(props); - this.state={ - banksMenu:undefined - } - } - - initPublic = (crumbData,menuData,data) =>{ - this.setState({ - banksMenu:menuData - }) - this.props.initPublic(crumbData,data); - } - - render(){ - let{ - banksMenu - }=this.state - - const common={ - initPublic:this.initPublic, - }; - console.log("BanksTabIndex"); - console.log(banksMenu); - console.log(this.props); - return( - - { - banksMenu && - - } - - { - return () - } - }> - - { - return () - } - }> - { - return () - } - }> - - - - ) - } -} -export default (BanksTabIndex); \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/banks/ExerciseBanksDetail.js b/public/react/src/modules/user/usersInfo/banks/ExerciseBanksDetail.js deleted file mode 100644 index 00fb830db..000000000 --- a/public/react/src/modules/user/usersInfo/banks/ExerciseBanksDetail.js +++ /dev/null @@ -1,56 +0,0 @@ -import React, { Component } from 'react'; -import axios from 'axios' - -import ExerciseDisplay from '../../../courses/exercise/ExerciseDisplay' - -class ExerciseBanksDetail extends Component{ - constructor(props){ - super(props); - this.state={ - - } - } - - componentDidMount = () =>{ - - } - detailFetchCallback = (result) => { - let Id=this.props.match.params.Id; - - const crumbData={ - title: result.data.exercise && result.data.exercise.name, - is_public: result.data.exercise && result.data.exercise.is_public, - crumbArray:[ - {content:'详情'}, - ] - } - const menuData={ - tab:'0',//tab选中的index - menuArray:[//tab以及tab路由 - {to:`/banks/exercise/${Id}/${this.props.match.params.type}?tab=0`,content:'内容详情'} - ], - category:'exercise',// - tos: `/banks/exercise/${Id}/edit/${this.props.match.params.type}`, - id: Id, - is_public: result.data.exercise && result.data.exercise.is_public, - type:this.props.match.params.type, - authorize:result && result.data && result.data.authorize, - } - this.props.initPublic(crumbData,menuData,result.data); - } - - render(){ - let { pollDetail } = this.state - - return( -
    - - -
    - ) - } -} -export default ExerciseBanksDetail diff --git a/public/react/src/modules/user/usersInfo/banks/ExerciseBanksEdit.js b/public/react/src/modules/user/usersInfo/banks/ExerciseBanksEdit.js deleted file mode 100644 index 94d093454..000000000 --- a/public/react/src/modules/user/usersInfo/banks/ExerciseBanksEdit.js +++ /dev/null @@ -1,71 +0,0 @@ -import React, { Component } from 'react'; -import axios from 'axios' -import { ActionBtn } from 'educoder' - - -import ExerciseNewCommon from '../../../courses/exercise/ExerciseNewCommon' - -class ExerciseBanksEdit extends Component { - constructor(props){ - super(props); - this.state = { - isPublic: undefined, - // isGroup: false - } - } - componentDidMount = () =>{ - - - } - - initData = (responseData) =>{ - const Id = this.props.match.params.Id; - - const crumbData={ - title:'编辑', - is_public: responseData && responseData.data && responseData.data.exercise.is_public, - crumbArray:[ - {to:`/banks/exercise/${Id}/${this.props.match.params.type}`,content:'详情'}, - {content:'编辑'} - ] - } - this.props.initPublic(crumbData,responseData.data); - } - - render(){ - let { Id, type } = this.props.match.params - const common = { - // onCancel:this.onCancel, - // isGroup: this.isGroup, - // doNew: this.doNew, - // doEdit: this.doEdit, - initData: this.initData - } - return( -
    - - this.exerciseNewCommonRef = ref} - isEdit={true} - shixunsUrl={`/exercise_banks/choose_shixun.json`} - exercise_url={'exercise_banks'} - exercise_url_questions={'exercise_bank_questions'} - bottomSection={ - 完成 - } - > -
    - ) - } -} -export default ExerciseBanksEdit; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/banks/GtaskBanksEdit.js b/public/react/src/modules/user/usersInfo/banks/GtaskBanksEdit.js deleted file mode 100644 index 8209effa4..000000000 --- a/public/react/src/modules/user/usersInfo/banks/GtaskBanksEdit.js +++ /dev/null @@ -1,99 +0,0 @@ -import React, { Component } from 'react'; -import axios from 'axios' -import NewGtaskForm from './NewGtaskForm'; -import NewWorkForm from "./HomeworkBanksEdit"; - -class GtaskBanksEdit extends Component { - constructor(props){ - super(props); - this.state = { - isPublic: undefined, - isGroup: false - } - } - componentDidMount = () =>{ - let workId = this.props.match.params.workId; - this.initData(workId); - } - - initData = (workId) =>{ - - let url = `/task_banks/${workId}.json`; - axios.get(url).then((result)=>{ - if(result){ - const crumbData={ - title:'编辑', - is_public:result && result.data && result.data.is_public, - crumbArray:[ - {to:`/banks/gtask/${workId}/${this.props.match.params.type}?tab=0`,content:'详情'}, - {content:'编辑'} - ] - } - this.props.initPublic(crumbData,result.data); - result.data.isEdit = true; - this.setState({ data:result.data}) - this.newWorkFormRef.initValue(result.data); - } - }).catch((error)=>{ - console.log(error) - }) - } - - - doNew = () => { - } - doEdit = (params) => { - const workId = this.props.match.params.workId - const newUrl = `/homework_banks/${workId}.json` - - // const isGroup = this.props.isGroup() - axios.put(newUrl, params) - .then((response) => { - if (response.data.status == 0) { - this.props.showNotification('保存成功') - this.toWorkDetail() - } - }) - .catch(function (error) { - console.log(error); - }); - } - toWorkDetail = () => { - window.location.href=`/banks/gtask/${this.props.match.params.workId}/${this.props.match.params.type}?tab=0`; - this.props.initPublic(undefined); - } - onCancel = () => { - this.toWorkDetail() - } - isGroup = () => { - return this.state.isGroup; - } - render(){ - - const common = { - onCancel:this.onCancel, - isGroup: this.isGroup, - doNew: this.doNew, - doEdit: this.doEdit, - } - return( -
    - - this.newWorkFormRef = ref} - topicId={this.props.match.params.workId} - > -
    - ) - } -} -export default GtaskBanksEdit; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/banks/GtopicBanks.js b/public/react/src/modules/user/usersInfo/banks/GtopicBanks.js deleted file mode 100644 index be7922d90..000000000 --- a/public/react/src/modules/user/usersInfo/banks/GtopicBanks.js +++ /dev/null @@ -1,37 +0,0 @@ -import React, { Component } from 'react'; - - -class GtopicBanks extends Component{ - constructor(props){ - super(props); - } - componentDidMount = () =>{ - let bankId = this.props.match.params.bankId - const crumbData={ - title:'MySQL数据库编程开发实训(基础篇)111', - is_public:true, - crumbArray:[ - {content:'详情'}, - ] - } - const menuData={ - tab:'0',//tab选中的index - menuArray:[//tab以及tab路由 - {to:'/banks/gtopic/1',content:'内容详情'}, - // {to:'/banks/gtopic/1/answer',content:'参考答案'}, - ], - category:'topic',//毕设选题 - id:bankId, - is_public:true, - } - this.props.initPublic(crumbData,menuData); - } - render(){ - return( -
    - -
    - ) - } -} -export default GtopicBanks; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/banks/GtopicBanksEdit.js b/public/react/src/modules/user/usersInfo/banks/GtopicBanksEdit.js deleted file mode 100644 index a03a5b533..000000000 --- a/public/react/src/modules/user/usersInfo/banks/GtopicBanksEdit.js +++ /dev/null @@ -1,88 +0,0 @@ -import React, { Component } from 'react'; -import axios from 'axios' - -import GraduateTopicNewFrom from '../../../courses/graduation/topics/GraduateTopicNewFrom' - -class GtopicBanksEdit extends Component{ - constructor(props){ - super(props); - this.state = { - isPublic:undefined - } - } - componentDidMount = () =>{ - let bankId = this.props.match.params.bankId; - this.initData(bankId); - } - - initData = (bankId) =>{ - let url = `/gtopic_banks/${bankId}/edit.json`; - axios.get(url).then((result)=>{ - if(result){ - const crumbData={ - title:'编辑', - is_public:result && result.data.selected_data && result.data.selected_data.is_public, - crumbArray:[ - {to:`/banks/gtopic/${bankId}/${this.props.match.params.type}?tab=0`,content:'详情'}, - {content:'编辑'} - ] - } - this.props.initPublic(crumbData,result.data); - - this.GraduateTopicNewFromRef.initValue(result); - } - }).catch((error)=>{ - console.log(error) - }) - } - - // 编辑保存 - editSave = (param,attachments,bankId) =>{ - const url = `/gtopic_banks/${bankId}.json`; - let params = { - gtopic_bank:param, - attachment_ids:attachments - } - axios.put(url,params).then((result)=>{ - if(result){ - this.props.showNotification('保存成功!'); - this.props.history.push(`/banks/gtopic/${bankId}/${this.props.match.params.type}?tab=0`); - } - }).catch((error)=>{ - console.log(error); - }) - } - - // 取消 - editCancel = () =>{ - this.props.history.push(`/banks/gtopic/${this.props.match.params.bankId}/${this.props.match.params.type}?tab=0`); - this.props.initPublic(undefined); - } - - render(){ - let { bankId } = this.props.match.params - const common = { - editSave:this.editSave, - editCancel:this.editCancel - } - return( -
    - - this.GraduateTopicNewFromRef = ref} - topicId={bankId} - > -
    - ) - } -} -export default GtopicBanksEdit; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/banks/HomeworkBanksEdit.js b/public/react/src/modules/user/usersInfo/banks/HomeworkBanksEdit.js deleted file mode 100644 index 33a981141..000000000 --- a/public/react/src/modules/user/usersInfo/banks/HomeworkBanksEdit.js +++ /dev/null @@ -1,103 +0,0 @@ -import React, { Component } from 'react'; -import axios from 'axios' - - -import NewWorkForm from '../../../courses/busyWork/NewWorkForm' - -class HomeworkBanksEdit extends Component { - constructor(props){ - super(props); - this.state = { - isPublic: undefined, - // isGroup: false - } - } - componentDidMount = () =>{ - let workId = this.props.match.params.workId; - - this.initData(workId); - } - - initData = (workId) =>{ - let url = `/homework_banks/${workId}.json`; - axios.get(url).then((result)=>{ - if(result){ - const crumbData={ - title:'编辑', - is_public:result && result.data && result.data.is_public, - crumbArray:[ - {to:`/banks/${this.getModuleName()}/${workId}/${this.props.match.params.type}?tab=0`,content:'详情'}, - {content:'编辑'} - ] - } - this.props.initPublic(crumbData,result.data); - result.data.isEdit = true; - result.data.ref_attachments = result.data.reference_attachments - // this.setState({ isGroup: result.data.min_num || result.data.max_num }) - this.newWorkFormRef.initValue(result.data); - } - }).catch((error)=>{ - console.log(error) - }) - } - - - doNew = () => { - } - doEdit = (params) => { - const workId = this.props.match.params.workId - const newUrl = `/homework_banks/${workId}.json` - - // const isGroup = this.props.isGroup() - axios.put(newUrl, params) - .then((response) => { - if (response.data.status == 0) { - this.props.showNotification('保存成功') - this.toWorkDetail() - } - }) - .catch(function (error) { - console.log(error); - }); - } - getModuleName = () => { - return this.props.isGroup ? 'group' : 'normal' - } - toWorkDetail = () => { - this.props.history.push(`/banks/${this.getModuleName()}/${this.props.match.params.workId}/${this.props.match.params.type}?tab=0`) - this.props.initPublic(undefined); - } - onCancel = () => { - this.toWorkDetail() - } - isGroup = () => { - return this.props.isGroup; - } - render(){ - let { bankId } = this.props.match.params - const common = { - onCancel:this.onCancel, - isGroup: this.isGroup, - doNew: this.doNew, - doEdit: this.doEdit, - } - return( -
    - - this.newWorkFormRef = ref} - > -
    - ) - } -} -export default HomeworkBanksEdit; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/banks/NewGtaskForm.js b/public/react/src/modules/user/usersInfo/banks/NewGtaskForm.js deleted file mode 100644 index 70994e42d..000000000 --- a/public/react/src/modules/user/usersInfo/banks/NewGtaskForm.js +++ /dev/null @@ -1,358 +0,0 @@ -import React,{ Component } from "react"; -import { Input, InputNumber, Form, Button, Checkbox, Upload, Icon, message, Modal } from "antd"; -import axios from 'axios' -import { getUploadActionUrl, getUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder' -import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; -const $ = window.$; -const MAX_TITLE_LENGTH = 60; -class NewGtaskForms extends Component{ - constructor(props){ - super(props); - this.contentMdRef = React.createRef(); - this.state={ - title_num:0, - description:"", - contentFileList: [], - } - } - - - initValue = (data) => { - - if (data.isEdit===true) { - const contentFileList = data.attachments.map(item => { - return { - id: item.id, - uid: item.id, - name: appendFileSizeToUploadFile(item), - url: item.url, - filesize: item.filesize, - status: 'done' - } - }) - this.setState({ - ...data, - base_on_project: data.task_type===2?data.group_info.base_on_project:undefined, - title_num: parseInt(data.name.length), - min_num: data.task_type===2?data.group_info.min_number:undefined, - max_num: data.task_type===2?data.group_info.max_number:undefined, - contentFileList, - }, () => { - setTimeout(() => { - this.contentMdRef.current.setValue(data.description || '') - }, 2000) - - this.props.form.setFieldsValue({ - title: data.name, - description: data.description || '', - }); - - }) - } - - - } - - - // 输入title - changeTitle=(e)=>{ - console.log(e.target.value.length); - this.setState({ - title_num: parseInt(e.target.value.length) - }) - } - handleContentUploadChange = (info) => { - let contentFileList = info.fileList; - this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) }); - } - deleteAttachment = (file, stateName) => { - // 初次上传不能直接取uid - const url = `/attachments/${file.response ? file.response.id : file.uid}.json` - axios.delete(url, { - }) - .then((response) => { - if (response.data) { - const { status } = response.data; - if (status == 0) { - console.log('--- success') - - this.setState((state) => { - const index = state[stateName].indexOf(file); - const newFileList = state[stateName].slice(); - newFileList.splice(index, 1); - return { - [stateName]: newFileList, - }; - }); - } - } - }) - .catch(function (error) { - console.log(error); - }); - } - - onAttachmentRemove = (file, stateName) => { - if(file.response!=undefined){ - this.props.confirm({ - content: '是否确认删除?', - - onOk: () => { - this.deleteAttachment(file, stateName) - }, - onCancel() { - console.log('Cancel'); - }, - }); - return false; - } - - } - - handleSubmit = () => { - - let {contentFileList,min_num,max_num,base_on_project}=this.state; - let {data}=this.props; - let task_type=data.task_type - let topicId=this.props.topicId - let attachment_ids = contentFileList.map(item => { - return item.response ? item.response.id : item.id - }) - this.props.form.validateFields((err, values) => { - - const mdContnet = this.contentMdRef.current.getValue().trim(); - - values.description = mdContnet; - - if (!err) { - if (this.props.data.isEdit===true) { - let url="/task_banks/"+topicId+".json"; - axios.put(url, { - gtask_bank: { - name: values.title, - description: values.description, - min_num:task_type===1?undefined:min_num, - max_num:task_type===1?undefined:max_num, - base_on_project: task_type===1?task_type:base_on_project===true?1:0 - }, - attachment_ids:attachment_ids - } - ).then((response) => { - if(response.data.status===0){ - this.props.showNotification(response.data.message) - this.props.onCancel() - }else{ - this.props.showNotification(response.data.message) - } - }).catch((error) => { - console.log(error) - }) - } - } else { - $("html").animate({ scrollTop: $('html').scrollTop() - 100 }) - } - }) - } - - max_num_change = (val) => { - if (val < 2) { - this.setState({ - max_num: 2, - }) - return; - } - const { min_num } = this.state; - this.setState({ - max_num: val, - min_num: val <= min_num ? val - 1 : min_num - }) - } - - min_num_change = (val) => { - this.setState({ min_num: val }) - } - - base_on_project_change = () => { - this.setState({ base_on_project: !this.state.base_on_project }) - } - - render(){ - const { getFieldDecorator } = this.props.form; - let{ - title_value, contentFileList, answerFileList, max_num, min_num, base_on_project, - init_max_num, init_min_num, - title_num, course_name, category, has_commit, has_project, - isEdit - }=this.state - const uploadProps = { - width: 600, - fileList: contentFileList, - multiple: true, - // https://github.com/ant-design/ant-design/issues/15505 - // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 - // showUploadList: false, - action: `${getUploadActionUrl()}`, - onChange: this.handleContentUploadChange, - onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'), - beforeUpload: (file) => { - console.log('beforeUpload', file.name); - const isLt150M = file.size / 1024 / 1024 < 150; - if (!isLt150M) { - message.error('文件大小必须小于150MB!'); - } - return isLt150M; - }, - }; - - - return( -
    - -
    -
    -
    - {this.props.data&&this.props.data.task_type===1?"普通作业":this.props.data&&this.props.data.task_type===2?"分组作业":""} -
    -
    - - {getFieldDecorator('title', { - rules: [{ - required: true, message: '请输入标题' - }], - })( - - )} - - - - - - { - {getFieldDecorator('description', { - rules: [{ - required: true, message: '请输入任务内容说明' - }], - })( - - )} - } - - - (单个文件150M以内) - - {this.props.data&&this.props.data.task_type===2? - - {getFieldDecorator('personNum', { - rules: [{ - required: false - // required: true, message: '请输入最小人数和最大人数' - }], - })( -
    -

    - - {/* max={has_commit ? init_min_num : null } */} - 每组最小人数: 人 - - - - {/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} - - 每组最大人数: 人 - -

    学生提交作品时需要关联同组成员,组内成员作品共享
    -

    -

    - - 基于项目(选中,则必须在本平台创建项目,项目管理员可以提交作品;不选中,无需在平台创建项目,任意小组成员均可以提交作品) - -

    -
    - )} -
    :"" - } - -
    - {/* htmlType="submit" */} - - this.props.onCancel()}>取消 -
    -
    - -
    - ) - } -} - - -const NewGtaskForm = Form.create({ name: 'NewGtaskForm' })(NewGtaskForms); -export default NewGtaskForm; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/banks/PollBanksContent.js b/public/react/src/modules/user/usersInfo/banks/PollBanksContent.js deleted file mode 100644 index 5c08b1249..000000000 --- a/public/react/src/modules/user/usersInfo/banks/PollBanksContent.js +++ /dev/null @@ -1,78 +0,0 @@ -import React, { Component } from 'react'; -import axios from 'axios' - -import PollDetailTabThirdInfo from '../../../courses/poll/PollDetailTabThirdInfo' - -class PollBanksContent extends Component{ - constructor(props){ - super(props); - this.state={ - pollDetail:undefined - } - } - - componentDidMount = () =>{ - console.log("PollBanksContent"); - console.log(this.props) - let bankId=this.props.match.params.bankId; - let url = `/exercise_banks/${bankId}.json` - axios.get(url).then((result)=>{ - if(result){ - if (result.status == 200) { - let pollDetail = { - poll:{ - id: result.data.poll && result.data.poll.id , - polls_description: result.data.poll && result.data.poll.description, - polls_name: result.data.poll && result.data.poll.name, - is_public:result.data.poll && result.data.poll.is_public - }, - question_types:result.data.question_types, - questions:result.data.questions, - } - const crumbData={ - title:result.data.poll && result.data.poll.name, - is_public:result.data.poll && result.data.poll.is_public, - crumbArray:[ - {content:'详情'}, - ] - } - const menuData={ - tab:'0',//tab选中的index - menuArray:[//tab以及tab路由 - {to:`/banks/poll/${bankId}/${this.props.match.params.type}`,content:'内容详情'} - ], - category:'poll',//毕设选题 - tos:`/banks/poll/${bankId}/edit/${this.props.match.params.type}`, - id:bankId, - is_public:result.data.poll && result.data.poll.is_public, - type:this.props.match.params.type, - authorize:result && result.data && result.data.authorize, - } - this.props.initPublic(crumbData,menuData,result.data); - if (result.data.status === 401) { - //未登入 - this.setState({ - pollDetail: undefined - }) - return - } - this.setState({ - pollDetail - }) - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - render(){ - let { pollDetail } = this.state - return( -
    - -
    - ) - } -} -export default PollBanksContent diff --git a/public/react/src/modules/user/usersInfo/banks/banksMenu.js b/public/react/src/modules/user/usersInfo/banks/banksMenu.js deleted file mode 100644 index 571af8b64..000000000 --- a/public/react/src/modules/user/usersInfo/banks/banksMenu.js +++ /dev/null @@ -1,201 +0,0 @@ -import React, { Component } from 'react'; - -import { Menu } from 'antd' -import { Link } from 'react-router-dom' -import { WordsBtn } from 'educoder' -import "../usersInfo.css" -import "../../../courses/css/Courses.css" -import "../../../courses/css/busyWork.css" -import SendTopics from '../../../modals/SendTopics'; -import Modals from '../../../modals/Modals'; -import axios from 'axios'; -class BanksMenu extends Component{ - constructor(props){ - super(props); - this.state={ - visible:false, - tab:['0'], - } - } - - //发送至相关 - sendTopics=()=>{ - this.setState({ - visible:true - }) - } - componentDidMount() { - // var thestring=this.props; - // var yslarr=thestring.split("/"); - // console.log(yslarr); - - try { - const query = this.props.location.search; - const type = query.split('?tab='); - if(type[1]===undefined){ - this.setState({ - tab:['0'], - }); - }else{ - if(type[1]==="0"){ - this.setState({ - tab:['0'], - }); - }else if(type[1]==="1"){ - this.setState({ - tab:['1'], - }); - } - } - - }catch (e) { - this.setState({ - tab:['0'], - }); - } - - } - - topicscancelmodel=()=>{ - this.setState({ - Modalstype:false, - Loadtype:false, - visible:false, - Modalstopval:"", - ModalCancel:"", - ModalSave:"", - checkBoxValues:[], - checkedtype:false - }) - } - - //删除相关 - - deletecheckBoxValues=(id,type)=>{ - - this.setState({ - Modalstype:true, - Modalstopval:"是否确认删除?", - ModalCancel:this.topicscancelmodel, - ModalSave:()=>this.topicssavedelete(id,type), - }) - - } - - topicssavedelete=(id,type)=>{ - // console.log("删除了"); - // console.log(id); - // console.log(type); - const url = `/question_banks/multi_delete.json`; - axios.delete(url, { data: { - object_id: [id], - object_type:type - }}) - .then((response) => { - - if(response){ - if(response.data){ - if(response.data.status===0){ - this.props.showNotification(response.data.message) - window.location.href=`/users/${this.props.current_user.login}/topics/personal`; - }else{ - this.props.showNotification(response.data.message) - } - } - } - - }) - .catch(function (error) { - console.log(error); - }); - this.topicscancelmodel() - } - changeTab=(e)=>{ - this.setState({ - tab:e.key - }) - console.log(e.key); - // if(e.key === 0){ - // - // }else{ - // - // - // } - } - render(){ - let { banksMenu} = this.props; - let {visible,tab}=this.state; - // console.log("问卷预览"); - // console.log(visible); - let user_id=this.props.current_user&&this.props.current_user.user_id; - let user_type=this.props.current_user&&this.props.current_user.user_identity; - let targetuserid=this.props.data&&this.props.data.id; - // console.log("_____________________________"); - // console.log(this.props); - // console.log("++++++++++++++++="); - // console.log("banksMenubanksMenubanksMenubanksMenu"); - // console.log(banksMenu); - return( -
    - {this.state.Modalstype&&this.state.Modalstype===true?:""} - {/*发送至弹窗*/} - { - visible&&visible===true? - this.topicscancelmodel()} - />:"" - } - { - banksMenu && -
    - - { - banksMenu.menuArray && banksMenu.menuArray.map((item,key)=>{ - // console.log("BanksMenussss"); - // console.log(this.props); - // console.log(this.props.content); - return( - {item.content} - ) - }) - } - -
    - } - - { - banksMenu===undefined? - - this.deletecheckBoxValues(banksMenu&&banksMenu.id,banksMenu&&banksMenu.category)}style="blue" className="ml20 font-16">删除 - 编辑 - this.sendTopics()} style="blue" className="ml20 font-16">发送 - - :banksMenu.authorize===true? - - this.deletecheckBoxValues(banksMenu&&banksMenu.id,banksMenu&&banksMenu.category)}style="blue" className="ml20 font-16">删除 - 编辑 - this.sendTopics()} style="blue" className="ml20 font-16">发送 - - : - - this.sendTopics()} style="blue" className="ml20 font-16">发送 - - } -
    - ) - } -} -export default BanksMenu; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/banner_out.js b/public/react/src/modules/user/usersInfo/banner_out.js deleted file mode 100644 index 986a66cd3..000000000 --- a/public/react/src/modules/user/usersInfo/banner_out.js +++ /dev/null @@ -1,190 +0,0 @@ -import React, { Component } from 'react'; - -import {Link} from 'react-router-dom'; -import {Tooltip,Menu} from 'antd'; -import {getImageUrl} from 'educoder'; - -import "./usersInfo.css" -import "../../courses/css/members.css" -import "../../courses/css/Courses.css" -class banner_out extends Component{ - constructor(props){ - super(props); - } - render(){ - let { - data , - is_current, - is_edit, - sign, - type, - followed, - id, - login, - moduleName, - next_gold - }=this.props; - let {username}= this.props.match.params; - return( -
    -
    -
    -
    -
    -
    - - -
    - {is_current ? "我":"TA"}的金币 - {data && data.grade} -
    -
    - 头像 -
    -
    - {is_current ? "我":"TA"}的粉丝 - {data && data.fan_count} -
    - -
    - {is_current ? "我":"TA"}的关注 - {data && data.follow_count} -
    - - {data && data.name} -
    -
    -
    -
    - { - data && is_current == false && data.identity =="学生" ? "" : {data && data.identity} - } - - - - - - - - - - - - - - - - - - - - - {/* */} - { - data && data.college_identifier && - - - - - - } -
    -
    -
    -

    - { - is_edit && is_current ? - - : - is_current ? - {sign || "这家伙很懒,什么都没留下~"} - : - {sign || "这家伙很懒,什么都没留下~"} - } -

    - { - is_current ? -
    - { - data && data.attendance_signed ? - - 已签到 -

    明日签到 +{next_gold} 金币

    -
    - : - 签到 - // 试用申请 - } -
    - : - - } -
    -
    -
    -
  • - this.setState({moduleName: 'courses'})} - to={`/users/${username}/courses`}>课堂 -
  • -
  • - this.setState({moduleName: 'shixuns'})} - to={`/users/${username}/shixuns`}>实训 -
  • -
  • - this.setState({moduleName: 'paths'})} - to={`/users/${username}/paths`}>实践课程 -
  • -
  • - this.setState({moduleName: 'projects'})} - to={`/users/${username}/projects`}>开发项目 -
  • - -
  • - this.setState({moduleName: 'package'})} - to={`/users/${username}/package`}>众包 -
  • - - {/*{ data && data.identity!="学生" &&
  • 题库
  • }*/} - -
    -
    -
    -
    -
    - ) - } -} -export default banner_out; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/common/CRoundSelect.js b/public/react/src/modules/user/usersInfo/common/CRoundSelect.js deleted file mode 100644 index 4b353be99..000000000 --- a/public/react/src/modules/user/usersInfo/common/CRoundSelect.js +++ /dev/null @@ -1,96 +0,0 @@ -import React, { useState, useEffect, useContext, useRef, memo } from 'react'; -import {Link} from 'react-router-dom'; -import { Icon } from 'antd' -import { getUrl2, isDev, ThemeContext } from 'educoder' -import axios from 'axios' - - -function CRoundSelect (props) { - const [open, setOpen] = useState(false) - const theme = useContext(ThemeContext); - const { category, changeCategory, categories, right, width, items, - sortKey, onSortChange } = props; - const username = props.match.params.username - - useEffect(() => { - - }, []) - function onToggleOpen(over) { - if (over) { - console.log('over') - setOpen(true) - - } else { - console.log('out') - setOpen(false) - - } - } - function findIndexByKey(key) { - let _index = -1 - items && items.some((item, index) => { - if (item.key == key) { - _index = index - return true; - } - }) - return _index - } - function _onSortChange(key, index) { - if (index == 0) { - return; - } - setOpen(false) - onSortChange(key, index) - } - let index = findIndexByKey(sortKey) - return ( - -
    - - {/* onMouseOut={onToggleOpen} */} -
    onToggleOpen(true)} > - -
    - {items[index].name} -
    -
    - {true &&
      onToggleOpen(false)} - style={{display: open ? 'block' : 'none'}} - > - {items.map((item, index) => -
    • _onSortChange(item.key, index)}>{item.name}
    • - )} - {/*
    • AAAAAAAA
    • -
    • BBBBBBB
    • -
    • CCCCCCC
    • */} -
    } -
    -
    - ) -} - -export default CRoundSelect diff --git a/public/react/src/modules/user/usersInfo/common/HeadlessModal.js b/public/react/src/modules/user/usersInfo/common/HeadlessModal.js deleted file mode 100644 index b208cb951..000000000 --- a/public/react/src/modules/user/usersInfo/common/HeadlessModal.js +++ /dev/null @@ -1,57 +0,0 @@ -import React, { useState, useEffect, useContext, useRef, memo } from 'react'; -import {Link} from 'react-router-dom'; - -import { getUrl2, isDev, ThemeContext } from 'educoder' -import { Modal } from 'antd' - - -function HeadlessModal (props) { - // const [ visible, setVisible ] = useState(false) - const theme = useContext(ThemeContext); - const { category, visible, setVisible, className, width } = props; - - - useEffect(() => { - - }, []) - - return ( - - - setVisible(false) }> - {props.children} - - ) -} - -export default HeadlessModal diff --git a/public/react/src/modules/user/usersInfo/common/InfoTab.js b/public/react/src/modules/user/usersInfo/common/InfoTab.js deleted file mode 100644 index bb0761440..000000000 --- a/public/react/src/modules/user/usersInfo/common/InfoTab.js +++ /dev/null @@ -1,44 +0,0 @@ -import React, { useState, useEffect, useContext, useRef, memo } from 'react'; -import {Link} from 'react-router-dom'; - -import { getUrl2, isDev, ThemeContext } from 'educoder' -import axios from 'axios' - - -function InfoTab(props) { - - const theme = useContext(ThemeContext); - const { category, changeCategory, categories, right } = props; - const username = props.match.params.username - - useEffect(() => { - - }, []) - - return ( - - ) -} - -export default InfoTab diff --git a/public/react/src/modules/user/usersInfo/publicCreatNew.js b/public/react/src/modules/user/usersInfo/publicCreatNew.js deleted file mode 100644 index da89143df..000000000 --- a/public/react/src/modules/user/usersInfo/publicCreatNew.js +++ /dev/null @@ -1,86 +0,0 @@ -import React, { Component } from 'react'; -import { SnackbarHOC } from 'educoder'; -import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; -import {Tooltip,Menu,Pagination} from 'antd'; -import Loadable from 'react-loadable'; -import Loading from '../../../Loading'; -import axios from 'axios'; -import {getImageUrl} from 'educoder'; -import { TPMIndexHOC } from '../../tpm/TPMIndexHOC'; -import { CNotificationHOC } from '../../courses/common/CNotificationHOC'; -import GotoQQgroup from '../../../modal/GotoQQgroup'; - -import "./usersInfo.css" - -class publicCreateNew extends Component{ - constructor(props){ - super(props); - this.state={ - } - } - - //头部获取是否已经登录了 - getUser=(url,name)=> { - if (this.props.user&&this.props.user.email===undefined||this.props.user&&this.props.user.email===null||this.props.user&&this.props.user.email==="") { - this.props.showNotification("请先绑定邮箱,谢谢"); - return - } - if(name==="新建实训"){ - if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){ - this.props.setgoshowqqgtounp(true); - return; - } - } - - - if(url !== undefined || url!==""){ - window.location.href = url; - } - } - - getUsers=(url,name)=> { - - if(name==="新建实训"){ - if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){ - this.props.setgoshowqqgtounp(true); - return; - } - } - if(url !== undefined || url!==""){ - window.location.href = url; - } - } - - - - render() { - let {href,name,index}=this.props; - - return ( -
    - - -
    -
    - - {name} - -
    -
    -
    - ) - } -} -export default publicCreateNew; diff --git a/public/react/src/modules/user/usersInfo/usersInfo.css b/public/react/src/modules/user/usersInfo/usersInfo.css deleted file mode 100644 index fc45a4480..000000000 --- a/public/react/src/modules/user/usersInfo/usersInfo.css +++ /dev/null @@ -1,459 +0,0 @@ -.navInfo{ - border:none!important; - position: absolute; - width: 100%; - bottom: -8px; -} -.navInfo li { - float: left; - margin: 0px 40px; - padding:0px; - height: 45px; - line-height: 40px; - font-size: 16px; - position: relative; -} -.navInfo li.active::after{ - position: absolute; - left: 0px; - height: 2px; - width: 100%; - content: ''; - bottom: 0px; - background: #05101A!important; - color: #666!important; -} -.navInfo li,.navInfo li.ant-menu-item-active{ - border-bottom: none!important; - color: #666!important; -} -.navInfo li.ant-menu-item-selected{ - border-bottom: 2px solid #05101A!important; - color: #05101A!important; -} -.navInfo ul.ant-menu{float: left!important;border:none!important;} - -.substancenenew{ - width: 236px; - height: 206px; - background: rgba(248,248,248,1); - border: 2px dotted rgba(225,225,225,1); - opacity: 1; - border-radius: 4px; - padding-top: 50px; - position: inherit; -} - -.substancepad{ - padding: 20px 20px 0px 20px; - border-bottom: 1px solid transparent; -} -.substancefont{ - height:24px; - font-size:18px; - font-family:Microsoft YaHei; - font-weight:400; - line-height:21px; - color:rgba(153,153,153,1); - opacity:1; - margin-top: -8px; -} -.topten{ - width: 1px; - height: 100px; - border: 2px soild rgba(225,225,225,1); - background: rgba(225,225,225,1); - border: 1px solid rgba(225,225,225,1); - margin: 0 auto; -} -.leftten{ - width: 100px; - height: 1px; - background: rgba(225,225,225,1); - border: 1px solid rgba(225,225,225,1); - margin: 0px auto; - position: absolute; - top: 120px; - left: 88px; -} -.squarebox{ - position: absolute; - top: 0px; - left: 0px; -} - -/*题库的标签--和资源标签样式相似*/ -.bankTag{max-height: 82px;overflow-y: auto} -.bankTag #sourceTag li{margin-left: 0px;margin-right: 5px;} -.bank_list_Tag{cursor: default} -/*资源标签*/ -#sourceTag li,.bank_list_Tag{font-size: 12px;color: #4E7A9B;background-color: #E5F3FF;padding: 0px 4px;height: 20px;line-height: 20px; margin-left: 5px;display: inline-block;cursor: pointer;margin-bottom: 5px;} -#sourceTag li a{color: #4e7a9b!important;} -#sourceTag li.active{background-color: #4CACFF;color: #fff;} -#sourceTag li.active a{background-color: #4CACFF;color: #fff!important;} - -.mtf15{ - margin-top:-15px; -} - -.project-package-item.with-operator .item-operator { - width: 0; - transition: width .2s; - -moz-transition: width .2s; /* Firefox 4 */ - -webkit-transition: width .2s; /* Safari 和 Chrome */ - -o-transition: width .2s; /* Opera */ -} -.project-package-item.with-operator:hover .item-operator { - margin: -20px -20px -20px 20px; - padding: 20px 0; - width: 100px; - display: flex; - justify-content: space-around; - flex-direction: column; - align-items: center; - background: #f0f0f0; -} -.project-package-item.with-operator .item-operator a { - display: none; -} -.project-package-item.with-operator:hover .item-operator a { - display: block; - font-size: 20px; -} - -/* 个人主页头部改版 */ -.bannerPanel{ - width:100%; - top:0px; - left:0px; - height:186px; - padding-top:25px; - box-sizing: border-box; - background: url('../../../images/account/infobanner.png') no-repeat top center; - background-color: #0d4473 - -} -.username{ - font-size:26px; - margin-right:15px; - height: 30px; - line-height: 30px; - float: left; - color:#fff; -} -.myPhoto img{ - border-radius: 50%; - width:100%; - height:100% -} -.myPhoto{ - border-radius: 50%; - border:2px solid #fff; - width:110px; - height:110px; -} -.userpost{ - padding:0px 10px; - border:1px solid #fff; - border-radius: 2px; - color:#fff!important; - display: inline; - margin-top: 6px; - float:left; -} -.userpost label{ - display: block; - height: 18px; - line-height:18px; -} -.user-colorgrey-B8{color:#B8B8B8} -.user-colorgrey-green{color:#7ED321} -.user-colorgrey-blue{color:#98EBFF} -.user_yellow_btn { - color: #fff!important; - background-color: #FF8E02; -} -.headtab span { - color: #e8e8e8; - font-size: 14px; -} -.headtab span, .headtab a { - display: block; - width: 100%; - text-align: center; -} -.headtab { - width: 140px; - height: 70px; - text-align: center; -} -.leftTransform:before{ - position: absolute; - content:''; - left:0px; - top:6px; - width:1px; - height:84%; - background: #fff; - transform: rotate(18deg); -} -.userNav{ - height: 54px; - line-height: 54px; - background: #fff; - box-shadow:0px 9px 16px -1px #e6e6e6; - border-radius:7px; - padding:0px 10px; -} -.userNav li{ - display: inline-block; - padding:0px 30px; - box-sizing: border-box -} -.userNav li a{ - color:#333333; - font-size: 16px; - display: block -} -.userNav li.active a{ - position: relative; - color:#4CACFF; -} -.userNav li.active a:after{ - position: absolute; - bottom: 0px; - height: 4px; - width:100%; - content: ''; - left:0px; - background: #4CACFF; -} -/* 题库相关 */ -.breadcrumb{ - height: 18px; - line-height: 18px; - margin:10px 0px 0px; -} -.breadcrumb .ant-breadcrumb a:hover{ - color: #459BE5 !important; -} -.breadcrumb .ant-breadcrumb-separator{ - margin:0px 2px!important; -} -.breadcrumb span.ant-breadcrumb-link{ - cursor: default; -} -.bank_is_public{ - background: #84B6EB; - float: left; - height: 24px; - line-height: 24px; - padding:0px 20px; - color: #fff; - font-size: 16px; - margin-left: 10px; - border-radius:20px; - margin-top:3px; -} -.breadcrumb.ant-breadcrumb > span:last-child a{ - color: #05101A -} -.breadcrumb.ant-breadcrumb a{ - color:#999; -} -.bank_is_private{ - background: #56B998; - float: left; - height: 24px; - line-height: 24px; - padding:0px 20px; - color: #fff; - font-size: 16px; - margin-left: 10px; - border-radius:20px; - margin-top:3px; -} -.topicsbox{ - width: 1200px; - /*min-height: 216px;*/ - background: rgba(255,255,255,1); - padding: 0px 30px 0px 40px; -} - -.topicstopfont{ - width:64px; - height:16px; - font-size:16px; - font-weight:400; - color: #666 !important; -} - -.topcschild{ - width:1128px; - height:55px; - line-height: 54px; - border-bottom:1px solid rgba(235,235,235,1); -} - -.topcsmid{ - width:1128px; - height:55px; - line-height: 55px; -} - -.topcsactive{ - color: #4CACFF !important; - cursor: pointer; -} - -.topicsmidfont{ - max-width: 56px; - height: 55px; - font-size: 14px; - font-weight: 400; - cursor: pointer; - line-height: 55px; - color: #666; -} - -.alltopisc{ - width:230px; - height:20px; - font-size:14px; - font-weight:400; - color:rgba(153,153,153,1); - line-height:20px; -} - -.alltopiscright{ - /* width: 141px; */ - height: 20px; - font-size: 14px; - font-weight: 400; - color: rgba(153,153,153,1); - line-height: 20px; -} - -.topicsbtn{ - padding: 0px 15px; - border-radius: 2px; - /*color: #4C4C4C;*/ - cursor: pointer; - display: inline-block; - /*background-color: #4CACFF!important;*/ - /*color: #fff!important;*/ - border-radius: 11px; - border: 1px solid rgba(76,172,255,1); - color: rgba(76,172,255,1); -} - -.pd1323{ - padding: 10px 6px 25px 40px; - /*cursor: pointer;*/ -} -.pd1323:hover { - box-shadow: 0px 2px 6px rgba(51,51,51,0.09); - opacity: 1; - border-radius: 2px; -} -.topicswidth600{ - mac-width: 600px; - display: inline-block; -} -.topicswidth300{ - width: 300px; - display: inline-block; -} -.topiscfilterbtn{ - font-size: 14px; - color: #4CACFF !important; - border-radius: 5px; - border: 1px solid #4CACFF !important; - line-height: 23px !important; -} - -.topscisright{ - right: 0px; - top: 45px; - display: block; - position: absolute; -} - -.topsics135{ - max-width: 135px; - display: inline-block; -} - -.professional_certificationbox{ - height:431px; - background:rgba(255,255,255,1); -} - -.pd115200{ - padding: 55px 200px 0px 200px; -} - -.topicsItemimg{ - width:150px; -} - -.topicsItemfont{ - font-size: 18px; - font-family: PingFang-SC; - font-weight: 400; - color: rgba(51,51,51,1); - line-height: 35px; -} - -.topicsItem{ - max-width: 1068px; - max-height: 115px; - overflow-y: auto; -} - -.mb45{ - margin-bottom: 45px!important; -} - -.topsicsmax550{ - max-width: 550px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - position: absolute; - top: -16px; -} - -.topsicrelative{ - position: relative; -} - -.topsicinline{ - display: inline-block; -} -/* 防抖 */ -.educontent .square-list { - min-height: 400px; - flex-wrap:wrap; - display:flex; -} - -.h10 { - height: 10px; -} - -.w32 { - width: 32px !important; -} - -.w66 { - width: 66px !important; -} - -.w60 { - width: 60px !important; -} - -.w80 { - width: 80px !important; -} diff --git a/public/react/src/modules/user/usersInfo/video/AliyunUploaderManager.js b/public/react/src/modules/user/usersInfo/video/AliyunUploaderManager.js deleted file mode 100644 index 3312473c4..000000000 --- a/public/react/src/modules/user/usersInfo/video/AliyunUploaderManager.js +++ /dev/null @@ -1,188 +0,0 @@ -import { getUrl2, isDev } from 'educoder' -import axios from 'axios' - -let _url_origin = getUrl2() -let _path = isDev() ? 'public' : 'build' - -let _testHost = '' ; // 'http://192.168.2.63:3001/api' ; // '' ; -let login = 'innov' -// 工单注释 -// https://workorder.console.aliyun.com/console.htm#/ticket/detail/?ticketId=FLASELR -// https://workorder.console.aliyun.com/console.htm#/ticket/detail/?ticketId=1FB4APN -// https://help.aliyun.com/document_detail/52204.html?spm=5176.2020520165.120.d52204.19a47029YWhro7#%E4%B8%8A%E4%BC%A0%E5%9C%B0%E5%9D%80%E5%92%8C%E5%87%AD%E8%AF%81%E6%96%B9%E5%BC%8F(%E6%8E%A8%E8%8D%90%E4%BD%BF%E7%94%A8) -let uploader; -let $ = window.$ -function loadLib(callback) { - $.getScript( - `${_url_origin}/react/${_path}/js/aliyun-upload/lib/es6-promise.min.js`, - (data, textStatus, jqxhr) => { - $.getScript( - `${_url_origin}/react/${_path}/js/aliyun-upload/lib/aliyun-oss-sdk-5.3.1.min.js`, - (data, textStatus, jqxhr) => { - $.getScript( - `${_url_origin}/react/${_path}/js/aliyun-upload/aliyun-upload-sdk-1.5.0.min.js`, - (data, textStatus, jqxhr) => { - callback && callback() - }); - }); - }); -} -function createUploader(options) { - if (window.AliyunUpload && window.AliyunUpload.Vod) { - doCreateUploader(options) - } else { - loadLib(() => { - doCreateUploader(options) - }) - } -} -function doCreateUploader (options) { - uploader = new window.AliyunUpload.Vod({ - timeout: $('#timeout').val() || 60000, - partSize: $('#partSize').val() || 1048576, - parallel: $('#parallel').val() || 5, - retryCount: $('#retryCount').val() || 3, - retryDuration: $('#retryDuration').val() || 2, - region: $('#region').val() || 'ap-southeast-1', - userId: $('#userId').val() || 1829848226361863, // 1303984639806000, - // 解决取消上传后无法继续上传同文件的问题 - // https://workorder.console.aliyun.com/console.htm#/ticket/detail/?ticketId=FLASELR - enableUploadProgress: false, - // 添加文件成功 - addFileSuccess: function (uploadInfo) { - - console.log("addFileSuccess: " + uploadInfo.file.name) - options.addFileSuccess && options.addFileSuccess(uploadInfo) - uploader.startUpload() - }, - // 开始上传 - onUploadstarted: function (uploadInfo) { - // 如果是 UploadAuth 上传方式, 需要调用 uploader.setUploadAuthAndAddress 方法 - // 如果是 UploadAuth 上传方式, 需要根据 uploadInfo.videoId是否有值,调用点播的不同接口获取uploadauth和uploadAddress - // 如果 uploadInfo.videoId 有值,调用刷新视频上传凭证接口,否则调用创建视频上传凭证接口 - // 注意: 这里是测试 demo 所以直接调用了获取 UploadAuth 的测试接口, 用户在使用时需要判断 uploadInfo.videoId 存在与否从而调用 openApi - // 如果 uploadInfo.videoId 存在, 调用 刷新视频上传凭证接口(https://help.aliyun.com/document_detail/55408.html) - // 如果 uploadInfo.videoId 不存在,调用 获取视频上传地址和凭证接口(https://help.aliyun.com/document_detail/55407.html) - - const fileName = uploadInfo.file.name - - - if (!uploadInfo.videoId) { - - var createUrl = `${_testHost}/users/${login}/video_auths.json` - const _random = '' // Math.random().toString().substring(3, 6)+'-' - axios.post(createUrl, { - title: _random+fileName, - file_name: _random+fileName - }).then((response) => { - // if (response.data.status == ) - if(response){ - const data = response.data.data - var uploadAuth = data.UploadAuth - var uploadAddress = data.UploadAddress - var videoId = data.VideoId - uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId) - - } - }).catch((error) => { - // 删除当前出错的,并执行下一个任务 - uploader.deleteFile(uploader._curIndex) - uploader.nextUpload() - console.log(error) - }) - - - $('#status').text('文件开始上传...') - console.log("onUploadStarted:" + uploadInfo.file.name + ", endpoint:" + uploadInfo.endpoint + ", bucket:" + uploadInfo.bucket + ", object:" + uploadInfo.object) - } else { - // 如果videoId有值,根据videoId刷新上传凭证 - var refreshUrl = `${_testHost}/users/${login}/video_auths.json` - - axios.put(refreshUrl, { - video_id: uploadInfo.videoId, - title: fileName, - file_name: fileName - }).then((response) => { - if (response.data.status == -1) { - options.onUploadError && options.onUploadError(uploadInfo) - return; - } - const data = response.data.data - var uploadAuth = data.UploadAuth - var uploadAddress = data.UploadAddress - var videoId = data.VideoId - uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress) - // , videoId - - - }).catch((error) => { - uploader.deleteFile(uploader._curIndex) - uploader.nextUpload() - console.log(error) - }) - } - }, - // 文件上传成功 - onUploadSucceed: function (uploadInfo) { - options.onUploadSucceed && options.onUploadSucceed(uploadInfo) - - console.log("onUploadSucceed: " + uploadInfo.file.name + ", endpoint:" + uploadInfo.endpoint + ", bucket:" + uploadInfo.bucket + ", object:" + uploadInfo.object) - $('#status').text('文件上传成功!') - }, - // 文件上传失败 - onUploadFailed: function (uploadInfo, code, message) { - options.onUploadFailed && options.onUploadFailed(uploadInfo) - - console.log("onUploadFailed: file:" + uploadInfo.file.name + ",code:" + code + ", message:" + message) - $('#status').text('文件上传失败!') - }, - // 取消文件上传 - onUploadCanceled: function (uploadInfo, code, message) { - console.log("Canceled file: " + uploadInfo.file.name + ", code: " + code + ", message:" + message) - $('#status').text('文件上传已暂停!') - }, - // 文件上传进度,单位:字节, 可以在这个函数中拿到上传进度并显示在页面上 - onUploadProgress: function (uploadInfo, totalSize, progress) { - options.onUploadProgress && options.onUploadProgress(uploadInfo, totalSize, progress) - console.log("onUploadProgress:file:" + uploadInfo.file.name + ", fileSize:" + totalSize + ", percent:" + Math.ceil(progress * 100) + "%") - var progressPercent = Math.ceil(progress * 100) - $('#auth-progress').text(progressPercent) - $('#status').text('文件上传中...') - }, - // 上传凭证超时 - onUploadTokenExpired: function (uploadInfo) { - // 上传大文件超时, 如果是上传方式一即根据 UploadAuth 上传时 - // 需要根据 uploadInfo.videoId 调用刷新视频上传凭证接口(https://help.aliyun.com/document_detail/55408.html)重新获取 UploadAuth - // 然后调用 resumeUploadWithAuth 方法, 这里是测试接口, 所以我直接获取了 UploadAuth - $('#status').text('文件上传超时!') - var refreshUrl = `${_testHost}/users/${login}/video_auths.json` - - - axios.put(refreshUrl, { - video_id: uploadInfo.videoId, - }).then((response) => { - const data = response.data.data - var uploadAuth = data.UploadAuth - uploader.resumeUploadWithAuth(uploadAuth) - }).catch((error) => { - console.log(error) - }) - }, - // 全部文件上传结束 - onUploadEnd: function (uploadInfo) { - options.onUploadEnd && options.onUploadEnd(uploadInfo) - - $('#status').text('文件上传完毕!') - console.log("onUploadEnd: uploaded all the files") - } - }) - if (options.gotUploader) { - options.gotUploader(uploader) - } -} -export function getUploader (_login, options) { - _login && (login = _login) - if (!uploader || options.create == true) { - createUploader(options) - } -} \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/video/EditVideoModal.js b/public/react/src/modules/user/usersInfo/video/EditVideoModal.js deleted file mode 100644 index 25aadd119..000000000 --- a/public/react/src/modules/user/usersInfo/video/EditVideoModal.js +++ /dev/null @@ -1,101 +0,0 @@ -import React, { useState, useEffect, useContext, useRef, memo } from 'react'; -import { Progress, Input, Tooltip, Form } from 'antd' -import { getUrl2, isDev, CBreadcrumb, ActionBtn, ThemeContext, ModalWrapper } from 'educoder' -import axios from 'axios' -const MAX_LENGTH = 30 - -function EditVideoModal (props) { - const modalEl = useRef(null); - const theme = useContext(ThemeContext); - const { history, videoId, cover_url, title, created_at, isReview, onEditVideo, visible, setVisible, - form, editSuccess } = props; - const getFieldDecorator = form.getFieldDecorator - let username = props.match.params.username - const _title = form.getFieldsValue().title; - - if(props.CourseUser){ - username = props.CourseUser; - } - - function toList() { - history.push(`/users/${username}/videos`) - } - function toUpload() { - history.push(`/users/${username}/videos/upload`) - } - function onOk() { - form.validateFieldsAndScroll((err, values) => { - - if (!err) { - const url = `/users/${username}/videos/${videoId}.json` - axios.put(url, { - title: _title - }).then((response) => { - if (response.data) { - onCancel() - editSuccess() - } - }).catch((e) => { - - }) - } else { - // $("html").animate({ scrollTop: $('html').scrollTop() - 100 }) - } - }) - - // setVisible(false) - - } - function onCancel() { - setVisible(false) - } - useEffect(() => { - modalEl.current.setVisible(visible) - }, [visible]) - useEffect(() => { - visible && form.setFieldsValue({ - title, - }) - }, [visible]) - return ( - - - - {getFieldDecorator('title', { - rules: [{ - required: true, message: '请输入标题', - }, { - max: MAX_LENGTH, message: '最大限制为30个字符', - }], - })( - - )} - - - ) -} -const WrappedEditVideoModal = Form.create({ name: 'editVideoModal' })(EditVideoModal); -export default WrappedEditVideoModal diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.css b/public/react/src/modules/user/usersInfo/video/InfosVideo.css deleted file mode 100644 index fd17ac49c..000000000 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.css +++ /dev/null @@ -1,145 +0,0 @@ -/* 撑开滚动条,防抖 */ -.educontent > .itemWrap { - min-height: 400px; -} -.itemWrap { - display: flex; - flex-wrap: wrap; -} - - -/* item */ -.videoItem { - width: 280px; - margin-right: 26px; - margin-bottom: 26px; - position: relative; -} -.videoItem:nth-child(4n+0) { - margin-right: 0px; -} -.videoItem img.cover { - width: 100%; - border-radius: 12px 12px 0px 0px; - height: 158px; -} -.nItem.videoItem:hover .mask { - display: block; - top: 0px; - width: 100%; - height: 158px; - cursor: pointer; -} -.nItem.videoItem:hover .playWrap { - display: inline-block; -} -.nItem .mask { - border-radius: 12px 12px 0px 0px; - display: none; - text-align: center; - position: absolute; - background:rgba(0,0,0,0.39); - /*opacity: 0.5;*/ -} -.videoItem .playWrap { - display: none; - width: 100%; - text-align: center; - height: 70px; - position: absolute; - top: 0px; - left: 0px; - cursor: pointer; -} -.videoItem img.play { - margin-top: 20%; - position: relative; - z-index: 99; -} -.videoItem .square-main { - padding: 15px 10px; - - background: #fff; - border-radius:12px; -} -.videoItem .square-main .title{ - max-width: 256px; - line-height: 18px; - -} - -.videoInReviewItem .square-main { - background: #EAEAEA; -} -.videoItem .time { - color: #C0C4CC; -} -.videoItem .square-main .buttonRow .dianjilianicon{ - color: #606266 !important; - font-size: 14px !important; -} - -.videoItem .square-main .buttonRow { - justify-content: space-between; - line-height: 15px; -} - -.nItem.videoItem:hover .square-main { - /*color: #fff;*/ - background: #fff; -} - -/* 预览弹框 */ -.showVideoModal .ant-modal-body { - display: flex; - flex-direction: column; -} -.showVideoModal video{ - width: 800px; - height: 450px; -} -.showVideoModal .copyLine { - justify-content: space-between; - padding: 9px; - background: #000000; - width: 800px; -} -.showVideoModal .copyLine input { - color: #707070; - background-color: #000 !important; - border-color: #707070; - margin-right: 12px; -} -.showVideoModal .copyLine a { - flex: 0 0 106px; -} -.toolbarRow { - justify-content: space-between; - padding: 0 8px; - margin-bottom: 6px; -} -/* 跳转按钮 */ -.infoVideo .toUploadBtn { - height: 48px; - margin-right: 20px; -} - -.play_duration{ - width: 100%; - height:30px; - background:rgba(0,0,0,0.39); - /*opacity:0.39;*/ - color:#fff; - font-size:12px; - line-height:30px; - text-align: right; - padding-right: 10px; -} -.mp23{ - margin-bottom: 23px; -} - -.videoItem:hover{ - box-shadow:0px 4px 10px 0px rgba(3,7,45,0.1); - border-radius:12px; -} \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.js b/public/react/src/modules/user/usersInfo/video/InfosVideo.js deleted file mode 100644 index a3678e56e..000000000 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.js +++ /dev/null @@ -1,455 +0,0 @@ -import React, { useState, useEffect, useContext, useRef, memo } from 'react'; -import {Link} from 'react-router-dom'; -import {Pagination, Input, Button} from 'antd' -import { getUrl2, isDev, ThemeContext, ActionBtn, NoneData } from 'educoder' -import axios from 'axios' -import VideoInReviewItem from './VideoInReviewItem' -import EditVideoModal from './EditVideoModal' -import './InfosVideo.css' -import InfoTab from '../common/InfoTab' -import HeadlessModal from '../common/HeadlessModal' -import CRoundSelect from '../common/CRoundSelect' - -import ClipboardJS from 'clipboard' - -function useModal(initValue) { - const [visible, setVisible] = useState(initValue) - - return { - visible, - setVisible - } -} -function useCategory(initValue) { - const [category, setCategory] = useState(initValue) - function changeCategory(key) { - setCategory(key) - } - return { - category, - changeCategory - } -} -function usePagination() { - const [page, setPage] = useState(1) - function onPageChange(page) { - setPage(page) - } - return { - current: page, - onChange: onPageChange - } -} -const PAGE_SIZE = 16 -const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400 -const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400 -let videoId = {}; -let _clipboard = null; -const _items=[ - {key: 'published_at-desc', name: '最新上传'}, - {key: 'published_at-asc', name: '最早上传'}, -] -function InfoVideo (props) { - const [videos, setvideos] = useState(undefined) - const [reviewvideos, setReviewvideos] = useState(undefined) - const [count, setCount] = useState(0) - const [loading, setLoading] = useState(true) - const [sortKey, setSortKey] = useState(_items[0].key) - - const editModalObj = useModal(false) - const videoModalObj = useModal(false) - const categoryObj = useCategory('all') - const pageObj = usePagination() - - const theme = useContext(ThemeContext); - const editModalEl = useRef(null); - const videoEl = useRef(null); - - const { showNotification, history } = props; - const username = props.match.params.username - - function toUpload() { - if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) { - history.push(`/users/${username}/videos/upload`) - } else { - props.showProfessionalCertificationDialog() - } - - } - function fetchvideos() { - const fetchUrl = `/users/${username}/videos.json` - const sorts = sortKey.split('-') - setLoading(true) - axios.get(fetchUrl, { - params: { - page: pageObj.current, - per_page: PAGE_SIZE, - sort_by: sorts[0], - sort_direction: sorts[1], - // - } - }) - .then((response) => { - setLoading(false) - if (response.data.videos) { - setvideos(response.data.videos) - setCount(response.data.count) - } - }).catch(() => { - setLoading(false) - }) - } - function fetchReviewvideos() { - const fetchUrl = `/users/${username}/videos/review.json` - const sorts = sortKey.split('-') - setLoading(true) - axios.get(fetchUrl, { - params: { - page: pageObj.current, - per_page: PAGE_SIZE, - sort_by: sorts[0], - sort_direction: sorts[1], - } - }) - .then((response) => { - setLoading(false) - if (response.data.videos) { - setReviewvideos(response.data.videos) - setCount(response.data.count) - } - }).catch(() => { - - }) - } - - useEffect(() => { - if (pageObj.current == 1) { - if (categoryObj.category == 'all') { - fetchvideos() - } else { - fetchReviewvideos() - } - } else { - pageObj.onChange(1) - } - }, [categoryObj.category]) - - useEffect(() => { - if (categoryObj.category == 'all') { - fetchvideos() - } else { - fetchReviewvideos() - } - }, [ pageObj.current, sortKey ]) - - useEffect(() => { - if (videoModalObj.visible == false) { - // 关闭视频 - videoEl.current && videoEl.current.pause() - if (_clipboard) { - _clipboard.destroy(); - _clipboard = null; - } - } else { - videoEl.current && videoEl.current.play() - - setTimeout(() => { - if (!_clipboard) { - _clipboard = new ClipboardJS('.copybtn'); - _clipboard.on('success', (e) => { - showNotification('复制成功') - }); - } - }, 200) - } - }, [videoModalObj.visible]) - - useEffect(() => { - - }, []) - - function editSuccess() { - fetchvideos() - } - - function onEditVideo(item) { - videoId = { - videoId: item.id, - title: item.title - } - editModalObj.setVisible(true) - // editModalEl.current.toList(true, video); - // this.refs['editVideoModal'].setVisible(true, video); - } - function onMaskClick(item) { - videoId = { - videoId: item.id, - title: item.title, - file_url: item.file_url, - cover_url: item.cover_url - - } - videoModalObj.setVisible(true) - } - // TODO use封装 - function onSortChange(key, index) { - - try { - const _item = _items[index]; - _items.splice(index, 1); - _items.unshift(_item); - const keys = key.split('-'); - const sorts = sortKey.split('-'); - if (key === "published_at-desc") { - if (keys[1] === sorts[1]) { - setSortKey("published_at-asc") - } else { - setSortKey(key) - } - } else if (key === "published_at-asc") { - if (keys[1] === sorts[1]) { - setSortKey("published_at-desc") - } else { - setSortKey(key) - } - } - } catch (e) { - - } - - - } - function getCopyText (file_url, cover_url) { - return `` - } - - const _inputValue = getCopyText(videoId.file_url, videoId.cover_url); - const sorts = sortKey.split('-') - - return ( -
    - - - - -
    - - 复制视频地址 -
    -
    - - - { toUpload() }} - className="toUploadBtn" - - > - 上传视频 - - } - > - -
    - - 共 - {count} - 个视频 - - - {/*{categoryObj.category == 'all' && }*/} - - {categoryObj.category == 'all' &&
    -
  • - {"最新上传"} - - - - onSortChange("published_at-asc", 0)}> - - - - - onSortChange("published_at-desc", 0)}> - - -
  • -
    } -
    - - - {categoryObj.category == 'all' ? -
    - { - videos == undefined ? '' : - videos.length ? - videos.map((item, index) => { - return ( - ) - }) - : - } -
    - : -
    - { - reviewvideos == undefined ? '' : - reviewvideos.length ? - reviewvideos.map((item, index) => { - return ( - ) - }) - : - } -
    - } - - - {/* categoryObj.category == 'all' && */} - { - count > PAGE_SIZE && -
    - -
    - } - -
    - ) -} - -export default InfoVideo - -/** - - - */ diff --git a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js deleted file mode 100644 index 5c0647ea1..000000000 --- a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js +++ /dev/null @@ -1,103 +0,0 @@ -import React, { useState, useEffect, useContext, memo } from 'react'; -import { Progress, Input, Tooltip } from 'antd' -import { getUrl2, isDev, CBreadcrumb, ActionBtn, ThemeContext } from 'educoder' -import axios from 'axios' -import moment from 'moment' -import playIcon from './images/play.png' -import ClipboardJS from 'clipboard' - -/** -cover_url: "http://video.educoder.net/f6ba49c3944b43ee98736898e31b7d88/snapshots/12da3f7df07c499b8f0fc6dc410094e9-00005.jpg" -created_at: "2019-08-12 13:48:26" -file_url: "http://video.educoder.net/sv/4c7eb4-16c845ee09c/4c7eb4-16c845ee09c.mp4" -id: 1 -published_at: "2019-08-12 15:38:00" -title: "测试标题" -updated_at: "2019-08-12 17:17:09" - */ -let _clipboard = null; -const clipboardMap = {} -function VideoInReviewItem (props) { - const theme = useContext(ThemeContext); - const { history, file_url, cover_url, title, created_at, published_at, isReview, id - , onEditVideo, onMaskClick, getCopyText, showNotification,vv,play_duration,operation , deleteVideo} = props; - useEffect(()=> { - if (!isReview) { - _clipboard = new ClipboardJS(`.copybtn_item_${id}`); - _clipboard.on('success', (e) => { - showNotification('复制成功') - }); - clipboardMap[id] = _clipboard - } - return () => { - if (clipboardMap[id]) { - clipboardMap[id].destroy(); - clipboardMap[id] = null; - } - } - }, []) - const username = props.match.params.username - function toList() { - history.push(`/users/${username}/videos`) - } - function toUpload() { - history.push(`/users/${username}/videos/upload`) - } - return ( -
    - - - {!isReview &&
    onMaskClick(props)}> - -
    } - {!isReview && -
    onMaskClick(props)}> - - {play_duration===0?"":
    累计学习时长:{play_duration} h
    } -
    - } -
    -
    20 ? title : ''} - >{title}
    -
    - - {moment(published_at || created_at).format('YYYY-MM-DD HH:mm:ss')} -
    -
    - {/* 2019-09-01 10:00:22 */} - - {vv===0?"": - - } {vv===0?"":vv} - - { isReview != true &&
    - { - deleteVideo && - - deleteVideo(props)} - style={{ marginTop: '1px', display: 'inline-block'}} - > - - } - - { - operation && - - onEditVideo(props)} - style={{ marginTop: '1px', display: 'inline-block'}} - > - - } - - - -
    } -
    -
    -
    - ) -} - -export default VideoInReviewItem diff --git a/public/react/src/modules/user/usersInfo/video/VideoItem.js b/public/react/src/modules/user/usersInfo/video/VideoItem.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/react/src/modules/user/usersInfo/video/VideoProtocol.js b/public/react/src/modules/user/usersInfo/video/VideoProtocol.js deleted file mode 100644 index a3b9ed2be..000000000 --- a/public/react/src/modules/user/usersInfo/video/VideoProtocol.js +++ /dev/null @@ -1,185 +0,0 @@ -import React, { useState, useEffect, useContext, memo } from 'react'; -import { Progress, Input } from 'antd' -import { getUrl2, isDev, CBreadcrumb, ActionBtn, ThemeContext } from 'educoder' -import axios from 'axios' -import okIcon from './images/ok_border.png' - -function VideoProtocol (props) { - const username = props.match.params.username - const { search } = props.history.location; - const courseId = search && search.split("=")[1]; - return ( -
    - - -
    内容上传协议
    -
    -
    - 一、总则 -
    -

    - 1.1 用户同意本协议的条款并按照页面上的提示完成视频上传流程。用户在点击视频上传的图标时即表示已阅读“内容上传协议”与湖南智擎科技有限公司(以下简称EduCoder平台)达成协议,完全接受本协议项下全部条款。 -

    -

    - 1.2 用户在EduCoder平台上(www.educoder.net)上传视频,应当使用已注册的有效用户名和密码。该用户帐号和密码由用户负责保管,用户不得将帐号和密码转让给任何第三人;用户应当对以其用户帐号进行的所有活动和事件负法律责任。 -

    -

    - 1.3 EduCoder平台用户在上传视频时,除遵守本协议的规定,还同时应当遵守EduCoder平台的其他协议和规定,以及遵守中华人民共和国的法律法规。EduCoder平台上传用户协议及EduCoder平台的其他协议,可由EduCoder平台随时更新,且无需另行通知。用户在使用相关服务时,应关注并遵守其所适用的相关条款。 -

    - -
    - 二、合法使用视频上传服务 -
    -

    - 2.1 用户在使用视频上传服务时,必须遵守中华人民共和国相关法律法规的规定,用户同意将不会利用本服务进行任何违法或不正当的活动,包括但不限于上传包含有下列内容之一的视频内容: -

    -

    - 1)反对宪法确定的基本原则;2)危害国家统一、主权和领土完整的;3)泄露国家秘密、危害国家安全或者损害国家荣誉和利益的;4)煽动民族仇恨、民族歧视,破坏民族团结,或者侵害民族风俗、习惯的;5)宣扬邪教、迷信的; 6)扰乱社会秩序,破坏社会稳定的; 7)诱导未成年人违法犯罪和渲染暴力、色情、赌博、恐怖活动的; 8)侮辱或者诽谤他人,侵害公民个人隐私等他人合法权益的;9)危害社会公德,损害民族优秀文化传统的;10)非法的广播电视频道、视听节目网站提供的非法视频内容;11)有关法律、行政法规和国家规定禁止的其他内容。 -

    -

    - 2.2 用户不得对本服务任何部分或本服务之使用或获得,进行复制、拷贝、出售、转售或用于任何其它商业目的。 -

    -

    - 2.3 用户须对自己在使用EduCoder平台服务过程中的行为承担法律责任。用户承担法律责任的形式包括但不限于:对受到侵害者进行赔偿,以及在EduCoder平台首先承担了因用户行为导致的行政处罚或侵权损害赔偿责任后,用户应给予EduCoder平台等额的赔偿。 -

    - -
    - 三、知识产权及其他合法权益保护 -
    -

    - 3.1 EduCoder平台提供视频上传功能专为用户自己创作或享有合法来源的作品提供服务。EduCoder平台尊重他人知识产权和合法权益,请用户在上传视频前确保拥有上传的视频内容的著作权及信息网络传播权或者已经取得上述全部权利人的许可; -

    -

    - 3.2 用户应确保上传的视频内容,已经获得被拍摄人(如有)的许可,并确保视频内容没有侵犯他人的人身权,包括但不限于名誉权、肖像权、隐私权、姓名权,不存在任何著作权纠纷。 -

    - -
    - 四、服务风险及免费声明 -
    -

    - 4.1 用户完全理解并同意,本服务涉及到互联网及移动通讯等服务,可能会受到各个环节不稳定因素的影响。因此服务存在因上述不可抗力、计算机病毒或黑客攻击、系统不稳定、用户所在位置、用户关机、GSM网络、互联网络、通信线路原因等造成的服务中断或不能满足用户要求的风险。使用本服务的用户须承担以上风险,EduCoder平台对服务之及时性、安全性、准确性不作担保,对因此导致用户不能发送和接受阅读消息、或传递错误,个人设定之时效、未予储存或其他问题不承担任何责任。对于不可抗力或非EduCoder平台过错原因导致的用户数据损失、丢失或服务停止,EduCoder平台将不承担任何责任。 -

    -

    - 4.2 对于系统发生故障影响到本服务的正常运行,EduCoder平台承诺及时处理进行修复。但用户因此而产生的经济和精神损失,EduCoder平台不承担责任。此外,EduCoder平台保留不经事先通知为维修保养、升级或其他目的暂停本服务任何部分的权利。 -

    -

    - 4.3 EduCoder平台郑重提请您注意,任何经由本服务上传的视频内容,均由内容提供者承担责任。EduCoder平台无法控制经由本服务上载之内容,也无法对用户的使用行为进行全面控制,因此不保证内容的合法性、正确性、完整性、真实性或品质;您已预知使用本服务时,可能会接触到令人不快、不适当或令人厌恶之内容,并同意将自行加以判断并承担所有风险,而不依赖于EduCoder平台。但在任何情况下,EduCoder平台有权依法停止传输任何前述内容并采取相应行动,包括但不限于暂停用户使用本服务的全部或部分,保存有关记录,并向有关机关报告。EduCoder平台有权(但无义务)依其自行之考量,拒绝和删除可经由本服务提供之违反本条款的或其他引起EduCoder平台或其他用户反感的任何内容。 -

    -

    - 4.4 用户完全理解并同意,若第三方在您不知情或未经您同意的前提下,将您的视频作品上传于EduCoder平台及由此所产生的任何可能侵害您权益的行为,EduCoder平台均不对任何人承担任何责任。 -

    -

    - 4.5 用户完全理解并同意,第三方可以通过访问EduCoder平台网站而获得educoder平台中的相关信息,并可对信息进行使用行为。对用户或第三方以任何方式进行的使用可能侵害您权益的行为,EduCoder平台均不对任何人承担任何责任。 -

    -

    - 4.6 如发生下列任何一种情形,EduCoder平台有权随时中断或终止向用户提供服务而无需通知该用户: -

    -

    - 4.6.1 用户提供的个人资料不真实; -

    -

    - 4.6.2 用户违反本服务条款的规定; -

    -

    - 4.6.3 按照主管部门的要求; -

    -

    - 4.6.4 EduCoder平台收到第三方投诉且该第三方出具相应证据的; -

    -

    - 4.6.5 其他EduCoder平台认为是符合整体服务需求的特殊情形。 -

    - -
    - 五、违约视频的处理原则    -
    -

    - 5.1 如用户在使用视频上传服务时违反任何上述规定,EduCoder平台或其授权的人有权要求用户改正或不经通知直接采取一切必要的措施(包括但不限于删除上传的视频内容)以减轻和消除用户不当行为造成的影响。 -

    -

    - 5.2 如EduCoder平台认为用户的视频上传行为严重违反了本协议,并给EduCoder平台造成了损害,EduCoder平台无需进行事先通知即可终止用户的密码、帐号或本服务之使用,且EduCoder平台对用户或任何第三人均不承担任何责任。 -

    -

    - 5.3 EduCoder平台有权启动必要的刑事及民事法律程序,维护EduCoder平台的合法权益,追究违法用户的法律责任。 -

    - -
    - 六、协议修改    -
    -

    - 6.1 EduCoder平台有权随时修改本协议的任何条款,一旦本协议的内容发生变动,EduCoder平台将会通过适当方式向用户提示修改内容。 -

    -

    - 6.2 如果不同意EduCoder平台对本协议相关条款所做的修改,用户有权停止使用网络服务。如果用户继续使用网络服务,则视为用户接受EduCoder平台对本协议相关条款所做的修改。 -

    - -
    - 七、通知送达   -
    -

    - 7.1 本协议项下EduCoder平台对于用户所有的通知均可通过公告、电子邮件、或常规的信件传送等方式进行;该等通知于发送之日视为已送达收件人。 -

    -

    - 7.2 用户对于EduCoder平台的通知应当通过EduCoder平台网站公布的通信地址、传真号码、电子邮件地址等联系信息进行送达。 -

    - -
    - 八、其他   -
    -

    - 8.1 本协议的订立、执行和解释及争议的解决均应适用中华人民共和国法律。 -

    -

    - 8.2 如双方就本协议内容或其执行发生任何争议,双方应尽量友好协商解决;协商不成时,任何一方均可向EduCoder平台所在地的人民法院提起诉讼。 -

    -

    - 8.3 EduCoder平台未行使或执行本服务协议任何权利或规定,不构成对前述权利或权利之放弃。 -

    -

    - 8.4 如本协议中的任何条款无论因何种原因完全或部分无效或不具有执行力,本协议的其余条款仍应有效并且有约束力。 -

    -
    -
    - ) -} - -export default VideoProtocol diff --git a/public/react/src/modules/user/usersInfo/video/VideoPublishSuccess.js b/public/react/src/modules/user/usersInfo/video/VideoPublishSuccess.js deleted file mode 100644 index 1ee558247..000000000 --- a/public/react/src/modules/user/usersInfo/video/VideoPublishSuccess.js +++ /dev/null @@ -1,73 +0,0 @@ -import React, { useState, useEffect, useContext, memo } from 'react'; -import { Progress, Input } from 'antd' -import { getUrl2, isDev, CBreadcrumb, ActionBtn, ThemeContext } from 'educoder' -import axios from 'axios' -import okIcon from './images/ok_border.png' - -function VideoUpload (props) { - const theme = useContext(ThemeContext); - const { history } = props; - - const username = props.match.params.username - function toList() { - history.push(`/users/${username}/videos`) - } - function toUpload() { - history.push(`/users/${username}/videos/upload`) - - } - return ( -
    - - - - -
    -
    - - {/* */} -
    -
    恭喜!
    -
    提交成功
    -
    平台正在审核您的申请,审核结果将以平台消息的形式通知您
    -
    - 查看已上传视频 - 继续上传 -
    -
    -
    - ) -} - -export default VideoUpload diff --git a/public/react/src/modules/user/usersInfo/video/VideoReducer.js b/public/react/src/modules/user/usersInfo/video/VideoReducer.js deleted file mode 100644 index 6765e0468..000000000 --- a/public/react/src/modules/user/usersInfo/video/VideoReducer.js +++ /dev/null @@ -1,68 +0,0 @@ -import update from 'immutability-helper' - -function find(state, action) { - let _index = -1 - state.videos.some((item, index) => { - // 同文件不同名字 fileHash也是一样的 - if (item.loaded != 100 && ((!item.fileHash || action.uploadInfo.fileHash == item.fileHash) && action.uploadInfo.file.name == item.name)) { - _index = index - return true; - } - }) - return _index; -} -export function reducer(state, action) { - switch (action.type) { - case 'addVideo': - const uploadInfo = action.uploadInfo - return {videos: [...state.videos, { - name: uploadInfo.file.name, - size: uploadInfo.file.size, - type: uploadInfo.file.type, - - fileHash: uploadInfo.fileHash, // "ba1bbc53fdecd9eaaae479fbd9518442" - state: uploadInfo.state, // "Uploading" "Ready" "Success" - videoId: uploadInfo.videoId, // "719b82c875c34ac39f94feb145d25ad2" - loaded: 0, - - title: '' - }]}; - case 'removeVideo': - return { - videos: update(state.videos, {$splice: [[action.index, 1]]}) - } - case 'removeAll': - return { - videos: [] - } - case 'updateProgress': - let _index = find(state, action) - let newvideos = state.videos - // 删除先执行 - if (_index != -1) { - newvideos = update(state.videos, {[_index]: { - loaded: {$set: action.progressPercent}, - - videoId: {$set: action.uploadInfo.videoId}, - // addFileSuccess的时候没有fileHash - fileHash: {$set: action.uploadInfo.fileHash} - }}) - } - return {videos: newvideos}; - case 'updateTitle': - let _upadteIndex = action.index - - let newvideos2 = state.videos - - if (_upadteIndex != -1) { - newvideos2 = update(state.videos, {[_upadteIndex]: { - title: {$set: action.title}, - }}) - } - return {videos: newvideos2}; - default: - throw new Error(); - } -} - -export const initialState = {videos: []}; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/video/VideoUpload.js b/public/react/src/modules/user/usersInfo/video/VideoUpload.js deleted file mode 100644 index cd4a1d36d..000000000 --- a/public/react/src/modules/user/usersInfo/video/VideoUpload.js +++ /dev/null @@ -1,62 +0,0 @@ -import React, { useState, useEffect, memo } from 'react'; -import { Progress, Input } from 'antd' -import { getUrl2, isDev, CBreadcrumb, ActionBtn } from 'educoder' -import axios from 'axios' - - -const MAX_LENGTH = 30 - -/** -name: file.name, -size: file.size, -type: file.type, - -fileHash: uploadInfo.fileHash, // "ba1bbc53fdecd9eaaae479fbd9518442" -state: uploadInfo.state, // "Uploading" -videoId: uploadInfo.videoId, // "719b82c875c34ac39f94feb145d25ad2" -loaded: 0 - - */ -function VideoUpload (props) { - const { className, index, name, loaded, state, cancelUpload, onTitleChange, title } = props; - // const [title, setTitle] = useState('') - const username = props.match.params.username - - function titleChange (e) { - onTitleChange(e.target.value, index) - } - return ( -
    -
    {index+1}. {name}
    -
    - -
    - cancelUpload(index, loaded == '100' )}>{loaded == '100' ? "删除" : "取消上传"} -
    -
    - -
    - 标题: - {String(title.length)}/{MAX_LENGTH} - } - className="titleInput titleInputysl" - > -
    -
    - ) -} - -export default VideoUpload diff --git a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js b/public/react/src/modules/user/usersInfo/video/VideoUploadList.js deleted file mode 100644 index ecea2a07d..000000000 --- a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js +++ /dev/null @@ -1,497 +0,0 @@ -import React, { useState, useEffect, useReducer, useContext, memo } from 'react'; -import { Link, Prompt } from "react-router-dom"; -import { getUrl2, isDev, CBreadcrumb, ActionBtn, ThemeContext } from 'educoder' -import axios from 'axios' - -import VideoUpload from './VideoUpload' -import { Button, Spin } from 'antd' - -import { getUploader } from './AliyunUploaderManager' -import { reducer, initialState } from './VideoReducer' -import { deleteVideoInCloud } from './VideoUtil' -import uploadIcon from './images/upload.png' -import uploadHoverIcon from './images/upload_hover.png' - -let uploader -const files = [] -const MAX_FILE_COUNT = 3 -const MAX_FILE_SIZE = 500 -let noUploads = true - -function VideoUploadList (props) { - - // const [videos, setvideos] = useState([]); - const [state, dispatch] = useReducer(reducer, initialState); - const theme = useContext(ThemeContext) - const [couldRouteNav, setCouldRouteNav] = useState(false); - const [loading,setLoading] = useState(false); - - useEffect(() => { - setCouldRouteNav(false); - // Chrome removed support for custom message in ver 51 - // https://stackoverflow.com/questions/38879742/is-it-possible-to-display-a-custom-message-in-the-beforeunload-popup - window.addEventListener("beforeunload", beforeunload); - // window.onbeforeunload = beforeunload - return () => { - uploader = null; - // window.onbeforeunload = null; - window.removeEventListener("beforeunload", beforeunload); - } - }, []) - // TODO 闭包! - noUploads = (!state.videos || state.videos.length == 0); - function beforeunload(e) { - if (noUploads) { - return true; - } - var confirmationMessage = "确认要离开当前页面,当前数据不可恢复"; - - (e || window.event).returnValue = confirmationMessage; //Gecko + IE - return confirmationMessage; //Webkit, Safari, Chrome etc. - } - const _beforeunload = beforeunload // .bind(this, noUploads, state) - - const username = props.match.params.username || props.CourseUser; - const { showNotification, history } = props; - const uploaderOptions = { - - } - function onUploadChange (e) { - var file = e.target.files[0] - if (!file) { - // alert("请先选择需要上传的文件!") - return - } - // avi、flv、f4v、m4v、mov、mp4、rmvb、swf、webm - if (file.name - && file.name.indexOf('.avi') == -1 && file.name.indexOf('.flv') == -1 - && file.name.indexOf('.f4v') == -1 && file.name.indexOf('.m4v') == -1 - && file.name.indexOf('.mov') == -1 && file.name.indexOf('.mp4') == -1 - && file.name.indexOf('.rmvb') == -1 && file.name.indexOf('.swf') == -1 - && file.name.indexOf('.webm') == -1 - ) { - showNotification(`不支持的视频格式`) - clearInput() - return; - } - if (file.size >(parseInt(MAX_FILE_SIZE) * 1024 * 1024)) { - // 超过500m TODO - clearInput() - showNotification(`视频大小超过${MAX_FILE_SIZE}M`) - return; - } - let gotTheSameFileName = false; - state.videos.some((item) => { - if (item.name == file.name) { - gotTheSameFileName = true; - return true; - } - }) - if (gotTheSameFileName) { - clearInput() - showNotification(`你不能上传同一个视频文件名称,请重新选择。`) - return; - } - - var Title = file.name - var userData = '{"Vod":{}}' - - if (!uploader) { - - getUploader(username, - { - // 重新创建 才会用最新的 dispatch - create: !uploader, - addFileSuccess: (uploadInfo) => { - setLoading(true); - const file = uploadInfo.file; - console.log('addFileSuccess', uploadInfo) - // const newvideos = [...videos, { - // name: file.name, - // size: file.size, - // type: file.type, - - // fileHash: uploadInfo.fileHash, // "ba1bbc53fdecd9eaaae479fbd9518442" - // state: uploadInfo.state, // "Uploading" "Ready" - // videoId: uploadInfo.videoId, // "719b82c875c34ac39f94feb145d25ad2" - // loaded: 0 - // }] - // setvideos(newvideos) - - // files.push(file) - clearInput() - dispatch({type: 'addVideo', uploadInfo}) - }, - onUploadProgress: (uploadInfo, totalSize, progress) => { - setLoading(false); - console.log("upload",uploadInfo); - var progressPercent = Math.ceil(progress * 100) - - // let _index = -1; - // videos.some((item, index) => { - // // addFileSuccess的时候没有fileHash - // // if (uploadInfo.fileHash == item.fileHash) { - // if (uploadInfo.file.name == item.name) { - // _index = index - // return true; - // } - // }) - - // TODO 这里不用reducer,会出现state被重置的问题 - - // if (_index == -1) { - // const newvideos = [...videos, { - // name: file.name, - // size: file.size, - // type: file.type, - - // fileHash: uploadInfo.fileHash, // "ba1bbc53fdecd9eaaae479fbd9518442" - // state: uploadInfo.state, // "Uploading" "Ready" - // videoId: uploadInfo.videoId, // "719b82c875c34ac39f94feb145d25ad2" - // loaded: progressPercent - // }] - // setvideos(newvideos) - // return; - // } - - // // exercise_questions : update(prevState.exercise_questions, {[index]: { isNew: {$set: false}}}) - // setvideos(update(videos, {[_index]: { loaded: {$set: progressPercent}}})) - - dispatch({type: 'updateProgress', uploadInfo, progressPercent}) - }, - - onUploadFailed: (uploadInfo) => { - console.log('onUploadFailed', uploadInfo) - props.showNotification('视频云服务出现异常,请重新上传。') - }, - onUploadEnd: (uploadInfo) => { - console.log('onUploadEnd', uploadInfo) - - }, - - onUploadSucceed: (uploadInfo) => { - console.log('onUploadSucceed', uploadInfo) - - }, - onUploadError: (uploadInfo) => { - - }, - // 可能需要等lib加载完毕才能执行 - gotUploader: (_uploader) => { - // 首先调用 uploader.addFile(event.target.files[i], null, null, null, userData) - console.log(_uploader) - let result = _uploader.addFile(file, null, null, null, userData) - uploader = _uploader; - - window.uploader = uploader; - } - } - // ) - ) - } else { - let result = uploader.addFile(file, null, null, null, userData) - } - } - function clearInput() { - const _input = document.getElementById('fileUpload') - _input.value = '' - } - function doDelete(index, isSuccess) { - uploader.deleteFile(index) - if (isSuccess) { - // uploader.deleteFile(index) - // deleteVideoInCloud(username, state.videos[index].videoId) - } else { - // uploader.cancelFile(index) - } - - clearInput() - dispatch({type: 'removeVideo', index}) - // setvideos([...videos.splice(index, 1)]) - } - // uploader.deleteFile(index); - function cancelUpload(index, isSuccess) { - props.confirm({ - content:
    -
    您确认要{isSuccess ? '删除' : '取消上传'}该视频吗?
    -
    , - onOk: () => { - doDelete(index, isSuccess) - } - }) - - } - function onPublish() { - // 下列这些参数只有是课堂里面上传视频才会有 - const { CourseId , CourseUser ,flag , successFunc } = props; - if (state.videos.length == 0) { - showNotification('请先上传视频') - return; - } - const publishUrl = `/users/${ flag ? CourseUser : username }/videos/batch_publish.json` - axios.post(publishUrl, { - videos: state.videos.map(item => { - return { - video_id: item.videoId, - // todo - title: item.title, - course_id:CourseId - } - }) - }).then((response) => { - // to success page - if(response){ - if (response.data.status == 0) { - dispatch({type: 'removeAll'}) - if(flag){ - successFunc(false) - }else{ - history.push(`/users/${username}/videos/success`) - } - } - } - }).catch((error) => { - console.log(error) - }) - } - function onTitleChange(title, index) { - dispatch({type: 'updateTitle', title, index}) - } - // login - const { flag , CourseId } = props; - const urls = - flag ? - 上传内容协议 - : - 上传内容协议 - const protocolLine =
    上传视频,即表示您已同意{urls},不得上传未经他人授权的作品
    - - return ( -
    - - - { - !flag && - - - -
    -

    上传视频

    - {/* 单次最多支持{MAX_FILE_COUNT}个视频文件上传,不支持断点续传,单个视频文件最大{MAX_FILE_SIZE}M */} -
    -
    - } - -
    - {/* noUploads */} - {noUploads &&
    -
    document.getElementById('fileUpload').click()}> - - -
    - - -
    选择您要上传的视频
    - {protocolLine} -
    } - -
    - {state.videos.map((item, vIndex) => { - return ( - - ) - })} -
    -
    - {state.videos && state.videos.length === MAX_FILE_COUNT && -
    - {/* */} - 提示:单次最多支持3个视频文件上传 -
    } - - {(!noUploads && state.videos.length < MAX_FILE_COUNT) && document.getElementById('fileUpload').click()} - >继续添加} - -
    -
    视频大小:不支持断点续传,单个视频文件最大500M;单次最多支持3个视频文件上传
    -
    视频规格:avi、flv、f4v、m4v、mov、mp4、rmvb、swf、webm
    -
    温馨提示:请勿上传违法视频。平台将为每一个视频分配一个地址,您可以通过引用该地址将视频使用在实训项目等模块
    -
    - - {!noUploads && - - {/* {(state.videos.length < MAX_FILE_COUNT) && } */} - -
    - onPublish()} - >立即发布 - - {protocolLine} -
    - -
    } -
    - {/* windows video/* 不管用 TODO */} - -
    - ) -} - -export default VideoUploadList - - - -/** - -bucket: "outin-396971199eed11e991a100163e1c7426" -checkpoint: {file: File, name: "sv/2d0fd065-16c7a62fcc5/2d0fd065-16c7a62fcc5.mp4", fileSize: 491511493, partSize: 1048576, uploadId: "A8DB0663F44C44F58F3F7F45892ED08B", …} -endpoint: "https://oss-cn-shanghai.aliyuncs.com" -file: File {name: "[阳光电影-www.ygdy8.com]金秘书为何这样-02.mp4", lastModified: 1532441562000, lastModifiedDate: Tue Jul 24 2018 22:12:42 GMT+0800 (China Standard Time), webkitRelativePath: "", size: 491511493, …} -fileHash: "ba1bbc53fdecd9eaaae479fbd9518442" -isImage: false -loaded: 0.5927505330490405 -object: "sv/2d0fd065-16c7a62fcc5/2d0fd065-16c7a62fcc5.mp4" -region: "cn-shanghai" -retry: false -ri: "F0FDC11A-9A92-4A50-882A-423C3EA499F3" -state: "Uploading" -userData: "eyJWb2QiOnt9fQ==" -videoId: "719b82c875c34ac39f94feb145d25ad2" - - file - lastModified: 1532441562000 - lastModifiedDate: Tue Jul 24 2018 22:12:42 GMT+0800 (China Standard Time) {} - name: "[阳光电影-www.ygdy8.com]金秘书为何这样-02.mp4" - size: 491511493 - type: "video/mp4" - webkitRelativePath: "" - - - */ \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/video/VideoUtil.js b/public/react/src/modules/user/usersInfo/video/VideoUtil.js deleted file mode 100644 index 327a691ee..000000000 --- a/public/react/src/modules/user/usersInfo/video/VideoUtil.js +++ /dev/null @@ -1,13 +0,0 @@ -import axios from 'axios' - -export function deleteVideoInCloud(login, video_id) { - const url = `/users/${login}/videos/cancel.json` - axios.post(url, { - video_id - }).then((response) => { - - - }).catch((error) => { - console.log(error) - }) -} \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/video/images/ok_border.png b/public/react/src/modules/user/usersInfo/video/images/ok_border.png deleted file mode 100644 index bd0c7dce04fb793d22cec05205ddbffa52d48050..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 491 zcmVW(^85}@J_0_kF7wl2^$@tjO|GAgOIY)S_2rs00uCC0&x7s z07VsEAV3{25dcuc3up@f>hUgD1Cjt@kOY7|7zH+ZKoU4NYCuL{IUpmj7?2ZK49E#E zfb~zeK!5?%;nKQ?MYA2c-F}6$SEuyJ-;T1@eG2Ki?D>fjr5L`z=;CV ziR2{#3E(6F@l5oBfCv~AKClVp@nln)0SsV(e+7V}FgT2Z<3Ko&gd4%P)oTzmyk5kR*P$GMGS;(MAD@YyMV<> zx>Nxh3yXAVt_s*)5eQgW7|0)xJ2BDsqnr&Xyv@vRo4odY2RF;^5K;Vm1u?hNlx&`$ zrepgWJh@}=-~(SobzuEQVn!J-rXh+kDXAM=(+j>yjV&`wbkM+>4CXp$qM$xf9mFUJ zAWyhGH1K#D0C{=u2Y@T~fGhTaBLq+t5~v6fplk;Kena3h1TF*MCh>z_;-BJwFM&!g zfNJjo=bg8VnhZa@hA`9m3-AJq z49eFNF@rt|o?zkIv|T$&uJ@bm5wwif7rPUPmhwNG+3)`VTIh4InayK=00000NkvXX Hu0mjflIydb diff --git a/public/react/src/modules/user/usersInfo/video/images/upload.png b/public/react/src/modules/user/usersInfo/video/images/upload.png deleted file mode 100644 index 9424371926f4a4e0e732b1b4af22ca062888aa10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 337 zcmeAS@N?(olHy`uVBq!ia0vp^4nSnkI&lw0qg$<@Awa7 z_^t(!K5PE_uKVw|4#cPtdOjbhn5!hnFPPzuDtGvd1D~7RAK9Kx1Bzbtba4!^IQ{hM zTE0UDBCHQ)|K*U8JSntHY90eiW z<)ZD@%D3hT&UxLdp>?1qa0`>Q@vhGc7IXKB%rTW(wSlKuLYMJKkL_PK0Zm2`S^l5} zDUEDdd`t4|RhhRimr5-8+jUyuLPp{q4*44mmS^fD9y0T8Zt!dql-s}<$>MDG$dIe- z8?SYO^0LJV%{?+31eXU+c(RIpat!PGU%WeF|8RD!cB{C0{;+<{p7{EYV`njxgN@xNAGk%99 diff --git a/public/react/src/modules/user/usersInfo/video/images/upload_hover.png b/public/react/src/modules/user/usersInfo/video/images/upload_hover.png deleted file mode 100644 index 6fd27af9f3e0db6fed8de83332c8a4ebd4bb6950..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 486 zcmV@P)C3-Sac2lxvCbGI`9=xU>lOb6c>S7ktee5DXCMO^I5nUi zJdCw(sx$CSl|P4$LM>3gZ1OLb3}oO)K!M%=53{rq11fwV36DhKp)5QW#s|~zXdE8S cgMSZv166bhua{^I3;+NC07*qoM6N<$f<}JB`v3p{ diff --git a/public/react/src/modules/wxcode/index.js b/public/react/src/modules/wxcode/index.js deleted file mode 100644 index 0059fa4aa..000000000 --- a/public/react/src/modules/wxcode/index.js +++ /dev/null @@ -1,381 +0,0 @@ -/* - * @Description: 微信端代码编辑器 - * @Author: tangjiang - * @Github: - * @Date: 2020-01-15 09:56:34 - * @LastEditors : tangjiang - * @LastEditTime : 2020-01-18 15:07:09 - */ -import './index.scss'; -import React, {useState, useEffect, useRef} from 'react'; -import MonacoEditor from '@monaco-editor/react'; -import { Input, Icon } from 'antd'; -import { connect } from 'react-redux'; -import actions from '../../redux/actions'; - import cookie from 'react-cookies'; - -const { TextArea } = Input; -const App = (props) => { - - const { - isShow, - wxCode, - path, - showLoading, - showDialog, - gold, - experience, - next_game, - // userCode, - testCase = [], - getWXCode, - last_compile_output, - test_sets_count, - sets_error_count, - getWXCodeTestCase, - restoreWXCode, - updateWXCodeForEditor, - updateWXCodeForInterval, - evaluateWxCode, - showWXCodeTextCase, - changeWXCodeEvaluateLoading, - changeWXCodeEvaluateDialog - } = props; - - const {identifier} = props.match.params; - // 获取路径参数 - const setCookier = () => { - // const _params = window.location.search; - // if (_params) { - // let _search = _params.split('?')[1]; - // _search.split('&').forEach(item => { - // // console.log(item); - // const _arr = item.split('='); - // cookie.remove(_arr[0], { - // path: '/', - // domain: '.educoder.net' - // }); - // cookie.save(_arr[0], _arr[1], { - // path: '/', - // domain: '.educoder.net' - // }); - // }); - // } - } - setCookier(); - const [isActive, setIsActive] = useState(-1); - const [tip, setTip] = useState(''); - const [codes, setCodes] = useState(wxCode); - // const [showInfo, setShowInfo] = useState(false); - // const [isVisible, setIsVisible] = useState(false); - - useEffect(() => { - if (codes !== props.wxCode) { - setCodes(props.wxCode); - } - }, [props]); - const editorRef = useRef(null); - let timer = null; - - const loadResult = (identifier) => { - // 加载代码块内容 - getWXCode(identifier); - // 加载测试集 - const params = { - path, - status: 0, - retry: 1 - }; - getWXCodeTestCase(identifier, params); - } - useEffect(() => { - setTimeout(() => { - setCookier(); - loadResult(identifier); - }, 0); - }, []); - // 关闭 - const handleCloseTestCase = () => { - // setIsVisible(false); - showWXCodeTextCase(false) - } - // 测试集 - const handleClickTestCase = () => { - // setIsVisible(true); - showWXCodeTextCase(true) - } - // 编辑器代码 - const handleEditorChange = (origin, monaco) => { - editorRef.current = monaco; // 获取当前monaco实例 - // setEditCode(origin); // 保存编辑器初始值 - editorRef.current.onDidChangeModelContent(e => { // 监听编辑器内容的变化 - // TODO 需要优化 节流 - const val = editorRef.current.getValue(); - // console.log('编辑器代码====>>>>', val); - // updateWXCodeForEditor(val); - codeChange(val); - }); - }; - - const codeChange = (code) => { - // console.log(code); - updateWXCodeForEditor(code); - if (!timer) { - timer = setInterval(function () { - clearInterval(timer); - timer = null; - // 调用更新代码 - updateWXCodeForInterval(identifier, path); - }, 5000); - } - } - - // 关闭单个测试集 - const handleCloseItem = (i, flag) => { - if (!flag) return; - setIsActive(isActive === i ? -1 : i); - } - // 初始化 - const handleResetCode = () => { - clearInterval(timer); - timer = null; - const result = window.confirm('你在本文件中修改的内容将丢失, 是否确定重新加载初始代码?'); - if (result) { - setTip('初始化中...'); - changeWXCodeEvaluateLoading(true); - identifier && restoreWXCode(identifier, { path }); - } - } - // 评测 - const handleEvalateCode = () => { - changeWXCodeEvaluateLoading(true); - evaluateWxCode(identifier, path); - setTip('评测中...'); - } - - // 关闭弹框 - const handleCloseDialog = () => { - changeWXCodeEvaluateDialog(false); - } - - // 查看测试集 - const handleClickShowResult = () => { - showWXCodeTextCase(true); - changeWXCodeEvaluateDialog(false); - } - - // 下一关 - const handleClickNext = () => { - changeWXCodeEvaluateDialog(false); - loadResult(next_game); - } - - const tcclasses = isShow ? `wx-code-test-case active` : 'wx-code-test-case'; - const loading = showLoading ? 'code-evaluate-loading active' : 'code-evaluate-loading'; - const dialog = showDialog ? 'pass-dialog active' : 'pass-dialog'; - const _val = +sets_error_count === 0; - let resultTxt = (_val) ? '全部通过' : `${sets_error_count}组测试结果不匹配`; - const iclasses = _val ? 'iconfont icon-wancheng icon success' : 'iconfont icon-tishi1 icon fail'; - const tclasses = _val ? 'result-txt success' : 'result-txt fail'; - const ulClasses = !!last_compile_output ? 'case-list hasResult' : 'case-list'; - const resultFlag = !!last_compile_output ? 'wxcode-test-result active' : 'wxcode-test-result'; - // console.log('==========>>>>>>>> 评测结果样式', last_compile_output, resultFlag); - return ( -
    -
    -
    - -
    -
    -
    - - - 初始化 - - - - 测试集 - -
    - {/* */} - -
    -
    - {/* 测试集 */} -
    -
    -
    - 共{testCase.length}个测试用例 - 关闭 -
    -
    - - {test_sets_count - sets_error_count}/{test_sets_count} - {resultTxt} -
    -
      - { - testCase.map((item, i) => { - const {input, output, actual_output, is_public, result, compile_success} = item; - const _classes = isActive === i ? 'case-item-desc active' : 'case-item-desc'; - const iconclasses = isActive === i ? 'iconfont icon-sanjiaoxing-down icon active' : 'iconfont icon-triangle icon'; - const headerClasses = is_public ? 'item-header-desc active' : 'item-header-desc'; - // console.log(_classes); - return ( -
    • -
      handleCloseItem(i, is_public)}> -

      - - 测试集{i + 1} -

      - { - is_public - ? compile_success > 0 - ? result ? - : - : '' - : - 隐藏测试集,暂不支持解锁和查看 - // is_public - // ? result ? - // : ) - // : ( - // 隐藏测试集,暂不支持解锁和查看 - // {/* {result - // ? - // : - // } */} - // ) - } -
      - -
      - 测试输入 - {input || '-'} - 预期输出 - {/* */} - */} - 实际输出 -