index.html
9.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>互动编程</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/responsive/css/bootstrap.min.css">
<link href="css/validationEngine.jquery.css" rel="stylesheet">
<link href="css/codemirror.css" rel="stylesheet">
<link href="css/cm-theme/gbtags.css" rel="stylesheet">
<link href="css/cm-theme/eclipse.css" rel="stylesheet">
<link href="css/cm-theme/gbtags-dark.css" rel="stylesheet">
<link href="css/font/iconfont.css" rel="stylesheet">
<link href="css/font_all/iconfont.css" rel="stylesheet">
<link href="css/layout.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<link href="css/recording.css" rel="stylesheet">
<link rel="stylesheet" href="js/zTree_v3-3.5.27/css/zTreeStyle/zTreeStyle.css">
<script>
var gxb_api = "https://restful1.gaoxiaobang.com";
// var gxb_api = "http://192.168.80.236:8080"
</script>
<script src="js/jquery-1.7.1.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/humps-2.0.0/humps.js"></script>
<script src="js/util/util.js"></script>
<script src="js/util/Hourglass.js"></script>
<script src="js/spin.js"></script>
<script src="js/ladda.js"></script>
<script src="js/jquery-ui-1.8.20.custom.js"></script>
<script src="js/codemirror.js"></script>
<!-- <script src="js/handlebars-1.3.js"></script> -->
<script src="js/emmet.js"></script>
<script src="js/jshint-2.6.min.js"></script>
<script src="js/jstorage.js"></script>
<script src="js/jquery.validationEngine.js"></script>
<script src="js/jquery.validationEngine-zh.js"></script>
<script src="js/jquery.isotope.js"></script>
<link rel="stylesheet" href="css/demo.css">
<script type="text/javascript" src="js/zTree_v3-3.5.27/js/jquery.ztree.core.js"></script>
<!-- resize dom js -->
<script type="text/javascript">
$(function() {
var app = $('#app')
var appLeft = $('#appLeft');
var appRight = $('#appRight');
var handleLM = $('#handleLM');
var handleMR = $('#handleMR');
var appContainer = $('#appContainer');
var appMian = $('#appMian');
var appFooter = $('#appFooter');
var appMianHeader = $('#appMianHeader')
var winWidth = $(window).width();
var winHeight = $(window).height();
var isLeftResizing = false;
var isRightResizing = false;
var _width = 0;
var _tempWidth = 0;
var appLeftRatio = 140 / winWidth;
var appRightRatio = 320 / winWidth;
appContainer.height(winHeight - appFooter.height());
appLeft.width($(window).width() * appLeftRatio);
appRight.width($(window).width() * appRightRatio);
appMian.width($(window).width() - appLeft.width() - appRight.width());
appMianHeader.css('margin-left', -appLeft.width());
$(window).resize(function(event) {
/* Act on the event */
appContainer.height(winHeight - appFooter.height());
appLeft.width($(window).width() * appLeftRatio);
appRight.width($(window).width() * appRightRatio);
appMian.width($(window).width() - appLeft.width() - appRight.width());
appMianHeader.css('margin-left', -appLeft.width());
});
// handleLM.on('mousedown', function (e) {
// isLeftResizing = true;
// });
// handleMR.on('mousedown', function (e) {
// isRightResizing = true;
// });
// $(document).on('mousemove', function (e) {
// if (!isLeftResizing && !isRightResizing){
// return;
// }
// if(isLeftResizing){
// _tempWidth = e.clientX;
// }else if(isRightResizing){
// _tempWidth = app.width() - e.clientX;
// }
// if(_tempWidth <= 80){
// _width = 80;
// }else if(_tempWidth >= 230){
// _width = 230;
// }else{
// _width = _tempWidth;
// }
// if(isLeftResizing){
// appLeft.width(_width);
// appMian.width($(window).width() - appRight.width() - _width);
// }
// if(isRightResizing){
// appRight.width(_width);
// appMian.width($(window).width() - appLeft.width() - _width);
// }
// }).on('mouseup', function (e) {
// // stop resizing
// isLeftResizing = false;
// isRightResizing = false;
// });
});
</script>
<script src="js/gb.js"></script>
<!-- <script src="js/gbreplayer.js"></script> -->
<script src="js/gbdebug/mode/xml/xml.js"></script>
<script src="js/gbdebug/mode/javascript/javascript.js"></script>
<script src="js/gbdebug/mode/css/css.js"></script>
<script src="js/gbdebug/mode/htmlmixed/htmlmixed.js"></script>
<script src="js/gbdebug/mode/clike/clike.js"></script>
<script src="js/gbdebug/mode/php/php.js"></script>
<script src="js/gbdebug/mode/python/python.js"></script>
<style type="text/css">
#recordzone,
#replayzone{
display: none;
}
#recordzone.active,
#replayzone.active{
display: block;
}
</style>
</head>
<body>
<div id="app" class="wrapper">
<div id="appContainer">
<div id="appLeft">
<ul id="folder" class="ztree"></ul>
<div id="handleLM"></div>
</div>
<div id="appMian">
<div id="appMianHeader">
<ul class="nav nav-tabs pull-left" id="recordertab">
<li class="active"><a href="#recordzone" data-toggle="tab"><i class="icon iconfont icon-suspend"></i>课程录制区</a></li>
<li><a href="#replayzone" data-toggle="tab"><i class="icon iconfont icon-yulan"></i>课程预览区</a></li>
</ul>
</div>
<div id="textarea">
<div id="recordzone" class="active">
</div>
<div id="replayzone">
</div>
</div>
<div id="handleMR"></div>
</div>
<div id="appRight">
</div>
</div>
<div id="appFooter">
<!-- 录音控制条 -->
<div class="recording-ctrl-bar">
<button id="start-recording" class="btn new-recording" type="button" data="1" title="开始录制"></button>
<button id="re-recoding" class="btn new-recording" type="button" data="1" title="重新录制" style="display: none;"></button>
<button class="btn pause-recording hidden" id="pause" data-status='0' title="录制暂停中">
<img src="img/pause.svg" alt="">
</button>
<button class="audio-play hidden" title="播放预览" data="1">
<i class="icon iconfont icon-play"></i>
</button>
<div class="recording-time" id="timer" value="">00:00:00</div>
<div class="audio-view" style="display: none;">
<audio id="audio" autoplay></audio>
</div>
<div class="save-wrap">
<input type="button" id="upload" class="upload-teach" disabled="disabled" value="保存">
<input type="button" id="savecorde" class="upload-stud" style="display: none;" disabled="disabled" value="保存">
<input type="button" id="cancel" value="关闭">
</div>
</div>
</div>
</div>
<!-- -->
<div class="upload-tip" style="display: none;">
<img src="img/upload_tip.png" alt="">
</div>
<!-- 准备开始 -->
<div id="countdown" style="display: none;">
<img src="" alt="">
</div>
<!-- 重新开始 -->
<div class="re-tips" style="display: none;">
<div class="re-reslut">
<div class="tip-header">
<span>提示</span>
</div>
<div class="tip-content">
<p>你确定要重新录制吗?</p>
</div>
<div class="tip-footer">
<button class="btn btn-success btn-sm" id="re-sure">确定</button>
<button class="btn btn-danger btn-sm" id="re-cancel">取消</button>
</div>
</div>
</div>
<script src="js/recorder/Myna.js"></script>
<script src="js/recording/recording.js"></script>
<script>
var recorder;
var _role = getQuery('role');
var _chapterId = getQuery('chapterId');
var userId = getQuery('userId');
var audio = document.querySelector('audio');
var saveAudio = document.getElementById("save");
// 结束播放事件
audio.addEventListener("ended", function() {
console.log('结束播放事件');
Hourglass.stopTimer();
$('.audio-play').attr('data', '1')
$('.audio-play').prop('disabled', false);
}, false);
$('#upload').click(function(){
uploadAudio()
})
function uploadAudio(ob) {
$('.upload-tip').show();
recorder.upload();
}
</script>
</body>
</html>