-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
265 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,224 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Python编程 - <%= process.env.siteneme %> | ||
</title> | ||
<link rel="shortcut icon" href='<%= process.env.staticurl %>/img/siteicon.png'> | ||
<link rel="stylesheet" href="<%= process.env.staticurl %>/pythonstatic/bootstrap/css/bootstrap.min.css" /> | ||
<link rel="stylesheet" href="<%= process.env.staticurl %>/layui/css/layui.css"> | ||
<link rel="stylesheet" href="<%= process.env.staticurl %>/pythonstatic/css/CodeMirror.css" /> | ||
<link rel="stylesheet" href='<%= process.env.staticurl %>/pythonstatic/css/style.css' /> | ||
<link rel="stylesheet" href="<%= process.env.staticurl %>/pythonstatic/css/solarized.css" /> | ||
<link type="text/css" rel="stylesheet" href="<%= process.env.staticurl %>/pythonstatic/showWorks.css" /> | ||
<% include ../linkfile.ejs %> | ||
<%- process.env.includecode %></head> | ||
|
||
<body class="mdui-theme-accent-blue"> | ||
<script> | ||
if (localStorage.darkTheme) | ||
document.body.classList.add("mdui-theme-layout-dark"); | ||
document.getElementById("switch-theme").addEventListener( | ||
"click", | ||
() => document.body.classList.toggle("mdui-theme-layout-dark") ? | ||
(localStorage.darkTheme = true) : | ||
(delete localStorage.darkTheme) | ||
); | ||
</script> | ||
|
||
<div> | ||
<div class="mdui-toolbar"> | ||
<a class="mdui-btn mdui-btn-icon" id="toggle" href="/"><i class="mdui-icon material-icons">home</i></a> | ||
<a href="/"><span class="mdui-typo-title"> | ||
<%= process.env.siteneme %> Python编辑器 | ||
</span></a> | ||
<div class="mdui-toolbar-spacer"></div> | ||
<a href="javascript:;" onclick="javascript:location.reload();" class="mdui-btn mdui-btn-icon mdui-ripple"><i | ||
class="mdui-icon material-icons">refresh</i></a> | ||
<% if (login==false) { %> | ||
<a href="/user/login" class="mdui-btn mdui-ripple" style="border-radius: 12px;">登录/注册</a> | ||
<% } else { %> | ||
<button class="mdui-btn mdui-btn-icon mdui-ripple" mdui-dialog="{target: '#user'}"><i | ||
class="mdui-icon material-icons">account_circle</i></button> | ||
<% } %> | ||
</div> | ||
<div class="mdui-tab"> | ||
<a class="mdui-ripple " style="border-radius: 20px;" mdui-dialog="{target: '#file'}"><i | ||
class="mdui-icon material-icons">insert_drive_file</i>文件</a> | ||
|
||
<div id="save_work"> | ||
<% if (login) { %> | ||
<a class="mdui-ripple" onclick="save_work()" style="border-radius: 20px;"><i | ||
class="mdui-icon material-icons">cloud_upload</i>保存到云端</a> | ||
<% } else { %> | ||
<% } %> | ||
</div> <a class="mdui-ripple" id="revise_work" onclick="revise_work()" style="border-radius: 20px;"><i | ||
class="mdui-icon material-icons">call_split</i>改编此作品</a> | ||
|
||
<div style="margin: auto 0;" mdui-dialog="{target: '#info'}"> | ||
<a class="mdui-ripple" style="border-radius: 20px;"> | ||
<i class="mdui-icon material-icons">info</i> | ||
<span>项目信息</span> | ||
</a> | ||
</div> | ||
|
||
<div class="mdui-toolbar-spacer"></div> | ||
<a class="mdui-ripple" onclick="open_YX()" style="border-radius: 20px;"><i | ||
class="mdui-icon material-icons">thumb_up</i>优秀作品</a> | ||
<% if (login) { %> | ||
<a class="mdui-ripple" onclick="open_MY()" style="border-radius: 20px;"><i | ||
class="mdui-icon material-icons">inbox</i>我的作品</a> | ||
<% } else { %> | ||
<% } %> | ||
<% if (login==false) { %> | ||
<a class="mdui-ripple" href="/user/login" style="border-radius: 20px;"> | ||
<i class="mdui-icon material-icons">account_circle</i>登录|注册 </a> | ||
<% } else { %> | ||
<a class="mdui-ripple" mdui-dialog="{target: '#user'}" style="border-radius: 20px;"> | ||
<i class="mdui-icon material-icons">account_circle</i> | ||
登录为 | ||
<%= nickname %> | ||
</a> | ||
<% } %> | ||
</div> | ||
</div> | ||
<div class="mdui-dialog" id="user" style="border-radius: 20px;"> | ||
<div class="mdui-dialog-title">登录为 <%= nickname %> | ||
</div> | ||
<div class="mdui-dialog-content"> 选择操作前请保存作品</div> | ||
<div class="mdui-dialog-actions"> | ||
<div class="mdui-tab"> | ||
<a href="/my/scratch" class="mdui-ripple" style="border-radius: 20px;"> | ||
<i class="mdui-icon material-icons">insert_drive_file</i> | ||
<label>Scratch作品</label> | ||
</a> | ||
<a href="/my/python" class="mdui-ripple" style="border-radius: 20px;"> | ||
<i class="mdui-icon material-icons">insert_drive_file</i> | ||
<label>Python作品</label> | ||
</a> | ||
<a href="/my/info" class="mdui-ripple" style="border-radius: 20px;"> | ||
<i class="mdui-icon material-icons">remove_red_eye</i> | ||
<label>个人信息</label> | ||
</a> | ||
<a href="/user/logout" class="mdui-ripple" style="border-radius: 20px;"> | ||
<i class="mdui-icon material-icons">close</i> | ||
<label>退出</label> | ||
</a> | ||
</div> | ||
<button class="mdui-btn mdui-ripple mdui-text-color-theme-text" mdui-dialog-close | ||
style="border-radius: 10px;">关闭</button> | ||
</div> | ||
</div> | ||
<div class="layui-fluid" style="padding: 0;"> | ||
<!-- 编程区 --> | ||
<div class="layui-row"> | ||
<div class="layui-col-md8 layui-col-sm12 layui-col-xs12" style="padding: 0; background-color: aqua;" | ||
id='python_edit_box'> | ||
<div class="python-editor-code"> | ||
<textarea id="code_textarea"></textarea> | ||
</div> | ||
</div> | ||
<div style="display: flex; position: absolute; top:8px; right:0; z-index: 99999;"> | ||
<div style="margin:auto 10px;"> | ||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent" id="run-code" onclick="run_it()" | ||
style="border-radius: 10px;">运行</button> | ||
</div> | ||
<div style="margin:auto 10px auto 0;"> | ||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-red-accent" onclick="run_clear()" | ||
style="border-radius: 10px;">清除</button> | ||
</div> | ||
<div style="margin:auto 10px auto 0;"> | ||
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-cyan-700" onclick="all_Screen(this)" | ||
style="border-radius: 10px;">全屏运行</button> | ||
</div> | ||
</div> | ||
<!-- 运行结果区 --> | ||
<div id='main_edit_box'> | ||
<div class="layui-col-md4 layui-col-sm12 layui-col-xs12" style="padding: 0;"> | ||
<div class="layui-row"> | ||
<div class="layui-col-md12 layui-col-sm6 layui-col-xs12" style="padding: 0;"> | ||
<div id="canvas_box" | ||
style="height:calc(50vh); background:url(/*<%= process.env.staticurl %>/pythonstatic/img/welcome_python_editor.png*/) no-repeat center;background-size: contain;background-size:auto 100%;"> | ||
<div id="mycanvas"></div> | ||
</div> | ||
</div> | ||
<div class="layui-col-md12 layui-col-sm6 layui-col-xs12" | ||
style="padding: 0; margin:0;background-color: rgba(0, 0, 0, 0);height:calc(50vh - 52px);"> | ||
<textarea id="output" style="height: 100%;width: 100%;" disabled>终端打印输出区</textarea> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
|
||
|
||
|
||
<div class="mdui-dialog" id="info" style="border-radius: 20px;"> | ||
<div class="mdui-dialog-title">项目信息 | ||
</div> | ||
<div class="mdui-dialog-content">修改内容请手动保存到云端 | ||
<br/> | ||
分享 | ||
<label class="mdui-switch"> | ||
<input type="checkbox" id="publish-work-box" onclick="publish_work()"/> | ||
<i class="mdui-switch-icon"></i> | ||
</label> | ||
<div class="mdui-textfield"> | ||
<input class="mdui-textfield-input" type="text" placeholder="请输入作品名称" maxlength="20" id='work_title_input' | ||
autocomplete="off" onkeypress="work_title_changed()" /> | ||
</div> | ||
<div class="mdui-textfield"> | ||
<textarea class="mdui-textfield-input" rows="4" placeholder="简介" maxlength="1000" id='work_info_input' | ||
onkeypress="work_title_changed()"></textarea> | ||
</div> | ||
</div> | ||
<div class="mdui-dialog-actions"> | ||
|
||
<button class="mdui-btn mdui-ripple mdui-text-color-theme-text" mdui-dialog-close | ||
style="border-radius: 10px;">关闭</button> | ||
</div> | ||
</div> | ||
|
||
<div class="mdui-dialog" id="file" style="border-radius: 20px;"> | ||
<div class="mdui-dialog-title">文件操作 | ||
</div> | ||
<div class="mdui-dialog-content"> 选择操作前请保存作品</div> | ||
<div class="mdui-dialog-actions"> | ||
<div class="mdui-tab"> | ||
<a class="mdui-ripple " onclick="new_file()" style="border-radius: 20px;"><i | ||
class="mdui-icon material-icons">add</i>新建一个作品</a> | ||
<a class="mdui-ripple" onclick="open_file()" style="border-radius: 20px;"><i | ||
class="mdui-icon material-icons">file_upload</i>从电脑中上传</a> <input type="file" id="files" | ||
style="display: none"> | ||
<a class="mdui-ripple" onclick="save_file()" style="border-radius: 20px;"><i | ||
class="mdui-icon material-icons">cloud_download</i>保存到电脑</a> | ||
</div> | ||
<button class="mdui-btn mdui-ripple mdui-text-color-theme-text" mdui-dialog-close | ||
style="border-radius: 10px;">关闭</button> | ||
</div> | ||
</div> | ||
|
||
<script type="text/javascript" src="<%= process.env.staticurl %>/js/jquery.min.js"></script> | ||
<script type="text/javascript" src="<%= process.env.staticurl %>/pythonstatic/CodeMirror.js"></script> | ||
<script type="text/javascript" src="<%= process.env.staticurl %>/pythonstatic/js/file-saver.js"></script> | ||
<script type="text/javascript" src="<%= process.env.staticurl %>/pythonstatic/skulpt.min.js"></script> | ||
<script type="text/javascript" src="<%= process.env.staticurl %>/pythonstatic/skulpt-stdlib.js"></script> | ||
<script type="text/javascript" src="<%= process.env.staticurl %>/pythonstatic/mode/python.js"></script> | ||
<script type="text/javascript" src="<%= process.env.staticurl %>/pythonstatic/js/show-hint.js"></script> | ||
<script type="text/javascript" src="<%= process.env.staticurl %>/layui/layui.all.js"></script> | ||
<script type="text/javascript" src="<%= process.env.staticurl %>/pythonstatic/public.js"></script> | ||
<script type="text/javascript"> | ||
var isLogin = `<%= login %>`; | ||
var _userid = `<%= userid %>`; | ||
</script> | ||
<script type="text/javascript" src="<%= process.env.staticurl %>/pythonstatic/python_edit.js"></script> | ||
</body> | ||
|
||
</html> | ||
<script>qiniuurl = '<%= process.env.qiniuurl %>'</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters