c.js
1.56 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
$(function(){
var languageid = 11;
var _languageid = getQuery('languageid');
$("title").html("C 语言");
var userId = 826920;
console.log(languageid);
console.log(_languageid);
var ide = new GxbIde({
el: '#folder',
languageid: parseInt(_languageid)
});
console.log(ide);
$('.getValue').click(function(){
// var treeLinkEditor = Dir.treeLinkEditor;
console.log(CodingEditer.records);
CodingEditer.getCodeMirrorValue();
CodingEditer.playCoding();
})
// $('#compileBtn').click(function(){
// ToolBox.compileMode(userId, languageid);
// })
// 录制代码
$('#start-recording').click(function() {
var _recording = $(this).attr('data');
if (_recording == 1) {
console.log('==========');
HZRecorder.get(function(rec) {
console.log(rec);
recorder = rec;
recorder.start();
$('#start-recording').removeClass('new-recording').addClass('recording').attr('data', '0').attr('data-original-title', '结束录制');
CodingEditer.initRecodesValue();
});
}else{
console.log('-------------');
recorder.stop();
recorder.getBlobData();
$('#start-recording').removeClass('new-recording').addClass('recording').attr('data', '1').attr('data-original-title', '结束录制');
}
})
// 播放代码
$('.audio-play').click(function() {
$('#audio')[0].play();
})
})