修改cloudcloudIDE加载时的logo,升级插件版本

This commit is contained in:
何童崇 2022-08-17 15:40:39 +08:00
parent d4adba77a8
commit 00b84650fd
5 changed files with 73 additions and 16 deletions

View File

@ -10,7 +10,7 @@
<meta name="theme-color" content="#000000">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link href="https://gw.alipayobjects.com/os/lib/alipay/alex-acr/2.0.7/bundle/acr.global.min.css" rel="stylesheet"/>
<link href="https://gw.alipayobjects.com/os/lib/alipay/alex/2.0.13/bundle/alex.all.global.min.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="%PUBLIC_URL%css/iconfont.css">
<link rel="stylesheet" type="text/css" href="%PUBLIC_URL%css/edu-purge.css">
<link rel="stylesheet" type="text/css" href="%PUBLIC_URL%css/editormd.min.css">
@ -31,7 +31,7 @@
<script src="%PUBLIC_URL%js/editormd/editormd.min.js"></script>
<script src="%PUBLIC_URL%js/codemirror/merge/merge.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/moment/2.29.4/moment.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/alipay/alex/2.0.13-0/bundle/alex.all.global.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/alipay/alex/2.0.13/bundle/alex.all.global.min.js"></script>
<%= htmlWebpackPlugin.tags.bodyTags %>
</body>

View File

@ -25,4 +25,18 @@ export function IEVersion(){
}else{
return -1;//不是ie浏览器
}
}
}
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';
}
}

View File

@ -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'

View File

@ -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 <div className='ide-logo'>
<img className='ide-logo-img' src={ideLogo} />
<div>
<div className='ide-logo-text'>IDE代码体验高效的代码编辑</div>
<div className='ide-logo-text'>标记文件为已查看</div>
<div className='ide-logo-text'>快速打开变更文件</div>
<div className='ide-logo-text'>切换变更文件</div>
{/* <span className='ide-btn'>⇧</span> */}
<div className='ide-logo-text'>标记文件为已查看 <span className='ide-btn'>{system==='mac'?'⌥':'Alt'}</span> <span className='ide-btn'>C</span> </div>
<div className='ide-logo-text'>快速打开变更文件 <span className='ide-btn'>^</span> <span className='ide-btn'>{system==='mac'?'⌥':'Alt'}</span> <span className='ide-btn'>P</span></div>
<div className='ide-logo-text'>切换变更文件 <span className='ide-btn'>{system==='mac'?'⌥':'Alt'}</span> <span className='ide-btn'></span> / <span className='ide-btn'></span></div>
</div>
</div>
}
@ -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 (
<div style={{ height: '100%', lineHeight: '1.4' }}>
{/* <EditorEmpty></EditorEmpty> */}
{/* <div className="controller">
{!IDEMode && (
<>

View File

@ -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;
}
}