Commit c2885599a71c0f433d34c161cbd26056cdc246ee

Authored by ykxie
1 parent fd401e75

fix play and pause

src/gxb-ide/CodingEditer.js
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 isRcording: false, 12 isRcording: false,
13 firstPlay: 1, // 第一次播放 13 firstPlay: 1, // 第一次播放
14 pauseValue: [], 14 pauseValue: [],
  15 + isRecordPage: 1,
15 init: function(){ 16 init: function(){
16 console.log('CodingEditer'); 17 console.log('CodingEditer');
17 }, 18 },
@@ -93,19 +94,20 @@ @@ -93,19 +94,20 @@
93 * Created by Kira on 2017-02-08 94 * Created by Kira on 2017-02-08
94 */ 95 */
95 playCoding: function(){ 96 playCoding: function(){
  97 + CodingEditer.editable(1);
96 98
97 - // if (CodingEditer.firstPlay == 0) {  
98 - // CodingEditer.setCodeMirrorValue();  
99 - // Dir.showEdite({'treeNode': CodingEditer.treeSelectNode});  
100 - // }else{  
101 - // CodingEditer.resetCodeMirrorValue(1);  
102 - // var iterm = new Iterm();  
103 - // iterm.compileResult()  
104 - // } 99 + if (CodingEditer.firstPlay == 0) {
  100 + CodingEditer.setCodeMirrorValue();
  101 + Dir.showEdite({'treeNode': CodingEditer.treeSelectNode});
  102 + }else{
  103 + CodingEditer.resetCodeMirrorValue(1);
  104 + var iterm = new Iterm();
  105 + iterm.compileResult()
  106 + }
105 107
106 - CodingEditer.resetCodeMirrorValue(1);  
107 - var iterm = new Iterm();  
108 - iterm.compileResult() 108 + // CodingEditer.resetCodeMirrorValue(1);
  109 + // var iterm = new Iterm();
  110 + // iterm.compileResult()
109 111
110 var playbackrecord = CodingEditer.records; 112 var playbackrecord = CodingEditer.records;
111 var starttime = 0; 113 var starttime = 0;
@@ -113,13 +115,6 @@ @@ -113,13 +115,6 @@
113 115
114 $('#recordertab a:eq(1)').tab('show'); 116 $('#recordertab a:eq(1)').tab('show');
115 117
116 - // if (playerpage) {  
117 - // $('#recordertab a:eq(0)').tab('show');  
118 - // }else{  
119 - // $('#recordertab a:eq(1)').tab('show');  
120 - // }  
121 -  
122 -  
123 for (var i = 0; i < playbackrecord.length; i++) { 118 for (var i = 0; i < playbackrecord.length; i++) {
124 if (playbackrecord[i].trigger === 1) { 119 if (playbackrecord[i].trigger === 1) {
125 playTotalTime += parseInt(playbackrecord[i].intervaltime); 120 playTotalTime += parseInt(playbackrecord[i].intervaltime);
@@ -406,8 +401,10 @@ @@ -406,8 +401,10 @@
406 CodingEditer.triggertotal += 1; 401 CodingEditer.triggertotal += 1;
407 402
408 if (CodingEditer.triggertotal === CodingEditer.records.length && !replay_type) { 403 if (CodingEditer.triggertotal === CodingEditer.records.length && !replay_type) {
409 -  
410 - $('#recordertab a:first').tab('show'); 404 + CodingEditer.editable(0);
  405 + if (CodingEditer.isRecordPage) {
  406 + $('#recordertab a:first').tab('show');
  407 + }
411 408
412 for (var i = 0; i < CodingEditer.records.length; i++) { 409 for (var i = 0; i < CodingEditer.records.length; i++) {
413 CodingEditer.records[i].trigger = 0; 410 CodingEditer.records[i].trigger = 0;
src/js/player.js
@@ -28,9 +28,8 @@ $(function(){ @@ -28,9 +28,8 @@ $(function(){
28 playUrl = gxb_api + "/programming/student/studentReplay/" + _codeReplayId + "/api"; 28 playUrl = gxb_api + "/programming/student/studentReplay/" + _codeReplayId + "/api";
29 getCodeData(playUrl) 29 getCodeData(playUrl)
30 } 30 }
31 -  
32 -  
33 - 31 +
  32 + CodingEditer.isRecordPage = 0;
34 33
35 // 获取code 34 // 获取code
36 function getCodeData(url){ 35 function getCodeData(url){
src/v1.1/player1.html
@@ -75,14 +75,14 @@ @@ -75,14 +75,14 @@
75 <!-- 控制条 --> 75 <!-- 控制条 -->
76 <div class="record-title"> 76 <div class="record-title">
77 <ul id="recordertab" class="nav nav-tabs pull-left"> 77 <ul id="recordertab" class="nav nav-tabs pull-left">
78 - <li class="active"> 78 + <li class="active" style="display: none;">
79 <a href="#recordzone" data-toggle="tab"> 79 <a href="#recordzone" data-toggle="tab">
80 <i class="icon iconfont icon-suspend"></i>课程录制区 80 <i class="icon iconfont icon-suspend"></i>课程录制区
81 </a> 81 </a>
82 </li> 82 </li>
83 <li> 83 <li>
84 <a href="#replayzone" data-toggle="tab"> 84 <a href="#replayzone" data-toggle="tab">
85 - <i class="icon iconfont icon-yulan"></i>课程预览 85 + <i class="icon iconfont icon-yulan"></i>课程预览
86 </a> 86 </a>
87 </li> 87 </li>
88 </ul> 88 </ul>