diff --git a/public/index.html b/public/index.html index d8767a819..ca4b20249 100755 --- a/public/index.html +++ b/public/index.html @@ -10,7 +10,7 @@ - + @@ -31,7 +31,7 @@ - + <%= htmlWebpackPlugin.tags.bodyTags %> diff --git a/src/common/IEVersion.js b/src/common/IEVersion.js index 046344381..2a4143226 100644 --- a/src/common/IEVersion.js +++ b/src/common/IEVersion.js @@ -25,4 +25,18 @@ export function IEVersion(){ }else{ return -1;//不是ie浏览器 } -} \ No newline at end of file +} + +export function windowsOrMac(){ + let agent = navigator.userAgent.toLowerCase(); + let isMac = /macintosh|mac os x/i.test(navigator.userAgent); + if(agent.indexOf("win32") >= 0 || agent.indexOf("wow32") >= 0){ + return 'win32'; + } + if(agent.indexOf("win64") >= 0 || agent.indexOf("wow64") >= 0){ + return 'win64'; + } + if(isMac){ + return 'mac'; + } + } \ No newline at end of file diff --git a/src/common/educoder.js b/src/common/educoder.js index 91de34319..85b9282d6 100644 --- a/src/common/educoder.js +++ b/src/common/educoder.js @@ -78,3 +78,5 @@ export { default as ImageLayer2 } from './hooks/ImageLayer2' // 外部 export { CNotificationHOC as CNotificationHOC } from '../modules/courses/common/CNotificationHOC' + +export { IEVersion as IEVersion , windowsOrMac as windowsOrMac} from './IEVersion' diff --git a/src/forge/Newfile/codeReview/index.jsx b/src/forge/Newfile/codeReview/index.jsx index e5ebc7bf2..403491242 100644 --- a/src/forge/Newfile/codeReview/index.jsx +++ b/src/forge/Newfile/codeReview/index.jsx @@ -6,6 +6,9 @@ import { Button, Switch, Spin, Icon } from 'antd'; import CodeBlame from './extensions/alex-ext-public.editor-plugin-blame.js'; // 通过在plugin内调用扩展中的命令来进行外部交互 import CodeBlamePlugin, { ExtensionCommand } from './plugins/code-blame.plugin'; +import { usePersistFn } from "ahooks"; +import {windowsOrMac} from 'educoder'; + import { Provider, useGlobal, @@ -47,8 +50,8 @@ const CodeReview = (props) => { readMarks, } = useReadMark(); // todo - // const getFileReadStatus = usePersistFn(_getFileReadStatus); - const getFileReadStatus = _getFileReadStatus; + const getFileReadStatus = usePersistFn(_getFileReadStatus); + // const getFileReadStatus = _getFileReadStatus; const { diffsPack, getDiffById, @@ -105,13 +108,16 @@ const CodeReview = (props) => { } function EditorEmpty() { + const system=windowsOrMac(); + console.log(system); return
IDE代码体验、高效的代码编辑
-
标记文件为已查看
-
快速打开变更文件
-
切换变更文件
+ {/* */} +
标记文件为已查看 {system==='mac'?'⌥':'Alt'} C
+
快速打开变更文件 ^ {system==='mac'?'⌥':'Alt'} P
+
切换变更文件 {system==='mac'?'⌥':'Alt'} /
} @@ -237,7 +243,7 @@ const CodeReview = (props) => { top: 0, width: '100%', height: isFullscreen ? '100vh' : 'calc(100vh - 72px)', - zIndex: 1100, + zIndex: 1002, }; console.log('propsIDE:'); @@ -245,6 +251,7 @@ const CodeReview = (props) => { return (
+ {/* */} {/*
{!IDEMode && ( <> diff --git a/src/forge/Newfile/codeReview/style.less b/src/forge/Newfile/codeReview/style.less index 955d89810..d185bf225 100755 --- a/src/forge/Newfile/codeReview/style.less +++ b/src/forge/Newfile/codeReview/style.less @@ -48,28 +48,62 @@ body, } } -.ide-logo{ +.ide-logo { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; + + .ide-btn { + margin: 4px; + display: inline-block; + } + + .ide-btn { + display: inline-flex; + box-shadow: inset 0 0 35px 5px rgba(0, 0, 0, 0.05), + inset 0 2px 1px 1px rgba(255, 255, 255, 0.9), + inset 0 -2px 1px 0 rgba(0, 0, 0, 0.05); + border-radius: 8px; + background: #fefefe; + position: relative; + height: 40px; + width: 40px; + justify-content: center; + align-items: center; + font-size: 20px; + } + // .ide-btn:before { + // box-shadow: 0 0 17.5px 8.75px white; + // border-radius: 118.3px; + // background: white; + // position: absolute; + // margin-left: -50.4px; + // margin-top: -50.4px; + // opacity: 0.2; + // content: ""; + // height: 100.8px; + // width: 100.8px; + // left: 50%; + // top: 50%; + // } } -.ide-logo-img{ +.ide-logo-img { width: 150px; } -.ide-logo-text{ +.ide-logo-text { color: #aaa; - margin-top: .5em; + margin-top: 0.5em; font-size: 14px; - &:nth-child(2){ + &:nth-child(2) { margin-left: 2em; } - &:nth-child(3){ + &:nth-child(3) { margin-left: 2em; } - &:nth-child(4){ + &:nth-child(4) { margin-left: 4em; } }