This commit is contained in:
yumoqing 2024-03-01 15:33:39 +08:00
parent 1dfd882950
commit 6776dbde79
10 changed files with 2205 additions and 11 deletions

6
3parties/README.md Normal file
View File

@ -0,0 +1,6 @@
https://cdn.jsdelivr.net/npm/xterm@4.19.0/css/xterm.css
https://vjs.zencdn.net/8.10.0/video-js.css
https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js
https://cdn.jsdelivr.net/npm/xterm@4.19.0/lib/xterm.js
https://vjs.zencdn.net/8.10.0/video.min.js

6
3parties/recorder.wav.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1930
3parties/video-js.css Normal file

File diff suppressed because one or more lines are too long

46
3parties/video.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
3parties/videojs-ie8.min.js vendored Normal file

File diff suppressed because one or more lines are too long

190
3parties/xterm.css Normal file
View File

@ -0,0 +1,190 @@
/**
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
* https://github.com/chjj/term.js
* @license MIT
*
* 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.
*
* Originally forked from (with the author's permission):
* Fabrice Bellard's javascript vt100 for jslinux:
* http://bellard.org/jslinux/
* Copyright (c) 2011 Fabrice Bellard
* The original design remains. The terminal itself
* has been extended to include xterm CSI codes, among
* other features.
*/
/**
* Default styles for xterm.js
*/
.xterm {
cursor: text;
position: relative;
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
}
.xterm.focus,
.xterm:focus {
outline: none;
}
.xterm .xterm-helpers {
position: absolute;
top: 0;
/**
* The z-index of the helpers must be higher than the canvases in order for
* IMEs to appear on top.
*/
z-index: 5;
}
.xterm .xterm-helper-textarea {
padding: 0;
border: 0;
margin: 0;
/* Move textarea out of the screen to the far left, so that the cursor is not visible */
position: absolute;
opacity: 0;
left: -9999em;
top: 0;
width: 0;
height: 0;
z-index: -5;
/** Prevent wrapping so the IME appears against the textarea at the correct position */
white-space: nowrap;
overflow: hidden;
resize: none;
}
.xterm .composition-view {
/* TODO: Composition position got messed up somewhere */
background: #000;
color: #FFF;
display: none;
position: absolute;
white-space: nowrap;
z-index: 1;
}
.xterm .composition-view.active {
display: block;
}
.xterm .xterm-viewport {
/* On OS X this is required in order for the scroll bar to appear fully opaque */
background-color: #000;
overflow-y: scroll;
cursor: default;
position: absolute;
right: 0;
left: 0;
top: 0;
bottom: 0;
}
.xterm .xterm-screen {
position: relative;
}
.xterm .xterm-screen canvas {
position: absolute;
left: 0;
top: 0;
}
.xterm .xterm-scroll-area {
visibility: hidden;
}
.xterm-char-measure-element {
display: inline-block;
visibility: hidden;
position: absolute;
top: 0;
left: -9999em;
line-height: normal;
}
.xterm.enable-mouse-events {
/* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
cursor: default;
}
.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
cursor: pointer;
}
.xterm.column-select.focus {
/* Column selection mode */
cursor: crosshair;
}
.xterm .xterm-accessibility,
.xterm .xterm-message {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
z-index: 10;
color: transparent;
}
.xterm .live-region {
position: absolute;
left: -9999px;
width: 1px;
height: 1px;
overflow: hidden;
}
.xterm-dim {
opacity: 0.5;
}
.xterm-underline {
text-decoration: underline;
}
.xterm-strikethrough {
text-decoration: line-through;
}
.xterm-screen .xterm-decoration-container .xterm-decoration {
z-index: 6;
position: absolute;
}
.xterm-decoration-overview-ruler {
z-index: 7;
position: absolute;
top: 0;
right: 0;
pointer-events: none;
}
.xterm-decoration-top {
z-index: 2;
position: relative;
}

2
3parties/xterm.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -13,6 +13,11 @@ if [ ! -d ../dist/css ];then
rm -rf ../dist/css
mkdir ../dist/css
fi
if [ ! -d ../dist/3parties ];then
rm -rf ../dist/3parties
mkdir ../dist/3parties
fi
if [ ! -d ../dist/docs ];then
if [ ! -d ../dist/examples ];then
rm -rf ../dist/examples
mkdir ../dist/examples
@ -29,5 +34,6 @@ fi
cp -a css/* ../dist/css
cp -a imgs/* ../dist/imgs
cp -a ../examples/* ../dist/examples
cp -a ../3parties/* ../dist/3parties
cp -a ../docs/* ../dist/docs
cp *.tmpl ../dist

View File

@ -4,19 +4,18 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm@4.19.0/css/xterm.css" />
<link href="https://vjs.zencdn.net/8.10.0/video-js.css" rel="stylesheet" />
<link rel="stylesheet" href="{{entire_url('3parties/xterm.css')}}" />
<link href="{{entire_url('3parties/video-js.css')}}" rel="stylesheet" />
<link rel="stylesheet" href="{{entire_url('/bricks/css/bricks.css')}}">
<link rel="stylesheet" href="{{entire_url('/bricks/css/bricks.css')}}">
<!-- support IE8 (for Video.js versions prior to v7) -->
<script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>
<!-- support IE8 (for Video.js versions prior to v7) -->
<script src="{{entire_url('3parties/videojs-ie8.min.js')}}"></script>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/xterm@4.19.0/lib/xterm.js"></script>
<!--- <script src="https://vjs.zencdn.net/7.14.3/video.js"></script> --->
<script src="https://vjs.zencdn.net/8.10.0/video.min.js"></script>
<script src="{{entire_url('/3parties/recorder.wav.min.js')}}"></script>
<!--- <script src="{{entire_url('/3parties/videojs-contrib-hls.min.js')}}"></script> --->
<script src="{{entire_url('3parties/lib/xterm.js')}}"></script>
<script src="{{entire_url('3parties/video.min.js')}}"></script>
<script src="{{entire_url('3parties/recorder.wav.min.js')}}"></script>
<!--- <script src="{{entire_url('3parties/videojs-contrib-hls.min.js')}}"></script> --->
<script src="{{entire_url('/bricks/bricks.js')}}"></script>
<script>
const opts = {

View File

@ -1,5 +1,8 @@
var bricks = window.bricks || {};
bricks.Modal = class extends bricks.Layout {
min_zindex = 5000;
last_zindex = 5000;
constructor(options){
/*
{
@ -40,11 +43,16 @@ bricks.Modal = class extends bricks.Layout {
this.title_box.add_widget(this.title);
this.title_box.add_widget(icon);
}
get_zindex(){
var idx = bricks.last_zindex;
bricks.last_zindex += 1;
return idx;
}
create(){
var e = document.createElement('div');
e.style.display = "none"; /* Hidden by default */
e.style.position = "fixed"; /* Stay in place */
e.style.zIndex = objget(this.opts, 'org_index', 0) + 5000; /* Sit on top */
e.style.zIndex = this.get_zindex();
e.style.paddingTop = "100px"; /* Location of the box */
e.style.left = 0;
e.style.top = 0;