Commit ee3eb1fffd62ce91f2fc632e4e5993f055a4fa42
1 parent
1f68350e
fix bug
Showing
1 changed file
with
16 additions
and
7 deletions
src/js/gbreplayer.js
| ... | ... | @@ -1005,25 +1005,26 @@ $(function(){ |
| 1005 | 1005 | }); |
| 1006 | 1006 | |
| 1007 | 1007 | // 使用服务端编译语言 |
| 1008 | - $('#comprunbtngrp').on('click', '#comprun', function(){ | |
| 1008 | + $('#comprunbtngrp').unbind("click").on('click', '#comprun', function(event){ | |
| 1009 | + event.preventDefault(); | |
| 1009 | 1010 | var l = Ladda.create(this); |
| 1011 | + $('#comprun').find('ladda-spinner').remove() | |
| 1010 | 1012 | l.start(); |
| 1011 | 1013 | |
| 1012 | 1014 | // 暂停录制 |
| 1013 | 1015 | var pauseState = $('#pause').data('pause'); |
| 1014 | - | |
| 1015 | 1016 | console.log('------------' + pauseState + '----------------'); |
| 1016 | 1017 | if(pauseState == 1 && _role == 0){ |
| 1017 | 1018 | GBCodePlayBack.record_pause_time = new Date().getTime(); // 暂停的时间 |
| 1018 | 1019 | |
| 1019 | 1020 | Hourglass.pauseTimer(); // 暂停计时器 |
| 1020 | - console.log('-------------暂停计时器---------------'); | |
| 1021 | + recorder.pause(); // 音频暂停 | |
| 1021 | 1022 | |
| 1022 | 1023 | $('#pause').data('status', '1'); |
| 1023 | 1024 | $('#pause').data('pause', '0'); |
| 1024 | 1025 | $('#pause').removeClass('hidden').addClass('show'); |
| 1025 | 1026 | $('#start-recording').hide(); |
| 1026 | - recorder.pause(); | |
| 1027 | + | |
| 1027 | 1028 | $('.pause-shodow').removeClass('hidden').addClass('show'); |
| 1028 | 1029 | } |
| 1029 | 1030 | |
| ... | ... | @@ -1065,9 +1066,9 @@ $(function(){ |
| 1065 | 1066 | |
| 1066 | 1067 | |
| 1067 | 1068 | // 保存编译结果 |
| 1068 | - $('#save_compile').click(function(){ | |
| 1069 | + $('#save_compile').unbind("click").click(function(){ | |
| 1069 | 1070 | var length = GBCodePlayBack.records.length - 1; |
| 1070 | - | |
| 1071 | + Hourglass.pauseTimer(); | |
| 1071 | 1072 | GBCodePlayBack.records[length].compile = GBCodePlayBack.compileResultData; |
| 1072 | 1073 | |
| 1073 | 1074 | GBCodePlayBack.records[length].output = GBCodePlayBack.compileResultData.output; |
| ... | ... | @@ -1084,6 +1085,7 @@ $(function(){ |
| 1084 | 1085 | |
| 1085 | 1086 | // 不保存编译结果 |
| 1086 | 1087 | $('#cancel_compile').click(function(){ |
| 1088 | + Hourglass.pauseTimer(); | |
| 1087 | 1089 | contrlPause() |
| 1088 | 1090 | GBCodePlayBack.record_continue_time = new Date().getTime(); |
| 1089 | 1091 | }) |
| ... | ... | @@ -1591,6 +1593,13 @@ $(function(){ |
| 1591 | 1593 | $('.recording-time').html('00:00:00'); |
| 1592 | 1594 | $('#upload').removeClass('recording-finish').addClass('upload-teach').attr("disabled", true); |
| 1593 | 1595 | GBCodePlayBack.htmleditor.setValue(''); |
| 1596 | + var resultData = { | |
| 1597 | + output: '', | |
| 1598 | + stderr: '', | |
| 1599 | + cmpinfo: '', | |
| 1600 | + result: 1 | |
| 1601 | + }; | |
| 1602 | + compileResult(resultData); | |
| 1594 | 1603 | } |
| 1595 | 1604 | |
| 1596 | 1605 | // 编译结果 |
| ... | ... | @@ -1929,7 +1938,7 @@ $(function(){ |
| 1929 | 1938 | $('.pause-shodow').removeClass('show').addClass('hidden'); |
| 1930 | 1939 | |
| 1931 | 1940 | $('#pause').data('pause', '1'); |
| 1932 | - Hourglass.pauseTimer(); | |
| 1941 | + | |
| 1933 | 1942 | recorder.pause(); // 继续录制 |
| 1934 | 1943 | } |
| 1935 | 1944 | ... | ... |