Commit f94f0a7a3afeb882f575980400e78da54f179436

Authored by ykxie
1 parent 59a12be0

修改播放

Showing 1 changed file with 17 additions and 26 deletions
src/js/gbreplayer.js
@@ -388,35 +388,12 @@ $(function(){ @@ -388,35 +388,12 @@ $(function(){
388 ,allowSeek: false 388 ,allowSeek: false
389 ,playCallback: function(){ // 播放 389 ,playCallback: function(){ // 播放
390 playCode(); 390 playCode();
391 -  
392 - // if (GBCodePlayBack.firstPlay == 0) {  
393 - // $('#readonly').trigger('click');  
394 - // GBCodePlayBack.htmlplayereditor.setValue(GBCodePlayBack.pauseValue)  
395 - // }else{  
396 - // GBCodePlayBack.htmlplayereditor.setValue('')  
397 - // var resultData = {  
398 - // output: '',  
399 - // stderr: '',  
400 - // cmpinfo: '',  
401 - // result: 1  
402 - // };  
403 - // compileResult(resultData);  
404 - // }  
405 -  
406 - // playCoder();  
407 - // $('#play').trigger('click');  
408 } 391 }
409 ,pauseCallback: function(){ // 暂停 392 ,pauseCallback: function(){ // 暂停
410 -  
411 - $('#readonly').trigger('click');  
412 - 393 + pauseCode();
413 GBCodePlayBack.firstPlay = 0; 394 GBCodePlayBack.firstPlay = 0;
414 -  
415 GBCodePlayBack.pauseValue = GBCodePlayBack.htmlplayereditor.getValue(); 395 GBCodePlayBack.pauseValue = GBCodePlayBack.htmlplayereditor.getValue();
416 -  
417 - // $('#play').trigger('click');  
418 - // playCoder();  
419 - pauseCode(); 396 + $('#readonly').trigger('click');
420 } 397 }
421 ,seekedCallback: function(){} // 拖拽 398 ,seekedCallback: function(){} // 拖拽
422 ,endedCallback: function(){ // 结束播放 399 ,endedCallback: function(){ // 结束播放
@@ -993,8 +970,8 @@ $(function(){ @@ -993,8 +970,8 @@ $(function(){
993 var l = Ladda.create(this); 970 var l = Ladda.create(this);
994 $('#comprun').find('ladda-spinner').remove(); 971 $('#comprun').find('ladda-spinner').remove();
995 l.start(); 972 l.start();
  973 +
996 var runStatus = $("#comprun").data('run'); 974 var runStatus = $("#comprun").data('run');
997 -  
998 if(runStatus == 1){ 975 if(runStatus == 1){
999 Hourglass.pauseTimer(); // 暂停计时器 976 Hourglass.pauseTimer(); // 暂停计时器
1000 recorder.pause(); // 音频暂停 977 recorder.pause(); // 音频暂停
@@ -1822,6 +1799,20 @@ $(function(){ @@ -1822,6 +1799,20 @@ $(function(){
1822 1799
1823 function playCode(){ 1800 function playCode(){
1824 // GBCodePlayBack.htmlplayereditor.setValue('') 1801 // GBCodePlayBack.htmlplayereditor.setValue('')
  1802 + if (GBCodePlayBack.firstPlay == 0) {
  1803 + $('#readonly').trigger('click');
  1804 + GBCodePlayBack.htmlplayereditor.setValue(GBCodePlayBack.pauseValue)
  1805 + }else{
  1806 + GBCodePlayBack.htmlplayereditor.setValue('')
  1807 + var resultData = {
  1808 + output: '',
  1809 + stderr: '',
  1810 + cmpinfo: '',
  1811 + result: 1
  1812 + };
  1813 + compileResult(resultData);
  1814 + }
  1815 +
1825 var playbackrecord = GBCodePlayBack.records; 1816 var playbackrecord = GBCodePlayBack.records;
1826 var starttime = 0; 1817 var starttime = 0;
1827 var stopIntervalTime; 1818 var stopIntervalTime;