Commit ce5502a33aecaea7ada8141991c5f0e90453b23c

Authored by ykxie
1 parent f1455930

fix bug

example/disable.html 0 → 100644
src/css/ide.css
@@ -178,15 +178,16 @@ html, body { @@ -178,15 +178,16 @@ html, body {
178 .record-toolbox #resultoutput { 178 .record-toolbox #resultoutput {
179 height: 164px; 179 height: 164px;
180 overflow-y: scroll; } 180 overflow-y: scroll; }
181 - .record-toolbox #CompileBtn {  
182 - background-image: -webkit-linear-gradient(left, #1FB6FF 0%, #62DCF5 100%);  
183 - background-image: linear-gradient(to right, #1FB6FF 0%, #62DCF5 100%);  
184 - -webkit-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;  
185 - transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important; 181 + .record-toolbox .btn {
186 border: none; 182 border: none;
187 color: #fff; 183 color: #fff;
188 padding-top: 5px; 184 padding-top: 5px;
189 padding-bottom: 5px; } 185 padding-bottom: 5px; }
  186 + .record-toolbox .compile-btn {
  187 + background-image: -webkit-linear-gradient(left, #1FB6FF 0%, #62DCF5 100%);
  188 + background-image: linear-gradient(to right, #1FB6FF 0%, #62DCF5 100%);
  189 + -webkit-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
  190 + transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important; }
190 .record-toolbox .record-ctrl { 191 .record-toolbox .record-ctrl {
191 height: 60px; 192 height: 60px;
192 width: 100%; 193 width: 100%;
src/css/main.css
@@ -100,15 +100,16 @@ html, body { @@ -100,15 +100,16 @@ html, body {
100 .record-toolbox #resultoutput { 100 .record-toolbox #resultoutput {
101 height: 164px; 101 height: 164px;
102 overflow-y: scroll; } 102 overflow-y: scroll; }
103 - .record-toolbox #CompileBtn {  
104 - background-image: -webkit-linear-gradient(left, #1FB6FF 0%, #62DCF5 100%);  
105 - background-image: linear-gradient(to right, #1FB6FF 0%, #62DCF5 100%);  
106 - -webkit-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;  
107 - transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important; 103 + .record-toolbox .btn {
108 border: none; 104 border: none;
109 color: #fff; 105 color: #fff;
110 padding-top: 5px; 106 padding-top: 5px;
111 padding-bottom: 5px; } 107 padding-bottom: 5px; }
  108 + .record-toolbox .compile-btn {
  109 + background-image: -webkit-linear-gradient(left, #1FB6FF 0%, #62DCF5 100%);
  110 + background-image: linear-gradient(to right, #1FB6FF 0%, #62DCF5 100%);
  111 + -webkit-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
  112 + transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important; }
112 .record-toolbox .record-ctrl { 113 .record-toolbox .record-ctrl {
113 height: 60px; 114 height: 60px;
114 width: 100%; 115 width: 100%;
src/gxb-ide/CodingEditer.js
@@ -451,16 +451,11 @@ @@ -451,16 +451,11 @@
451 if (CodingEditer.triggertotal === CodingEditer.records.length && !replay_type) { 451 if (CodingEditer.triggertotal === CodingEditer.records.length && !replay_type) {
452 CodingEditer.editable(0); 452 CodingEditer.editable(0);
453 CodingEditer.flag = true 453 CodingEditer.flag = true
454 - if (CodingEditer.isRecordPage) {  
455 - $('#recordertab a:first').tab('show');  
456 - }  
457 454
458 for (var i = 0; i < CodingEditer.records.length; i++) { 455 for (var i = 0; i < CodingEditer.records.length; i++) {
459 CodingEditer.records[i].trigger = 0; 456 CodingEditer.records[i].trigger = 0;
460 } 457 }
461 458
462 - Hourglass.stopTimer();  
463 -  
464 CodingEditer.triggertotal = 0; 459 CodingEditer.triggertotal = 0;
465 } 460 }
466 461
src/gxb-ide/Iterm.js
@@ -4,6 +4,8 @@ @@ -4,6 +4,8 @@
4 this.initIterm.apply(this, arguments); 4 this.initIterm.apply(this, arguments);
5 } 5 }
6 6
  7 + var isCompile = false;
  8 +
7 Iterm.prototype = { 9 Iterm.prototype = {
8 constructor: Iterm, 10 constructor: Iterm,
9 compileStatus: true, 11 compileStatus: true,
@@ -34,11 +36,16 @@ @@ -34,11 +36,16 @@
34 // var languageId = _this.options.languageId; 36 // var languageId = _this.options.languageId;
35 var languageId = _this.options.languageId || Dir.languageid; 37 var languageId = _this.options.languageId || Dir.languageid;
36 var role = getQuery('role'); 38 var role = getQuery('role');
  39 +
  40 +
  41 +
37 // 判断是否录制走不同的逻辑 42 // 判断是否录制走不同的逻辑
38 if (!CodingEditer.isRcording) { 43 if (!CodingEditer.isRcording) {
39 compileMode(el, userId, languageId) 44 compileMode(el, userId, languageId)
40 }else{ 45 }else{
41 - if (_this.compileStatus) { 46 +
  47 + if (_this.compileStatus && !_this.isCompile) {
  48 + $('#CompileBtn').removeClass('compile-btn');
42 Hourglass.pauseTimer(); // 暂停计时器 49 Hourglass.pauseTimer(); // 暂停计时器
43 if (role == 0) { 50 if (role == 0) {
44 recorder.pause(); // 音频暂停 51 recorder.pause(); // 音频暂停
@@ -53,10 +60,13 @@ @@ -53,10 +60,13 @@
53 CodingEditer.addRecord(treeNode, check_tree_time); 60 CodingEditer.addRecord(treeNode, check_tree_time);
54 61
55 _this.compileStatus = false; 62 _this.compileStatus = false;
  63 + isCompile = true;
  64 +
  65 + compileMode(el, userId, languageId)
  66 + $('.contrl-shodow').show();
56 } 67 }
57 console.log('******************************' + languageId) 68 console.log('******************************' + languageId)
58 - compileMode(el, userId, languageId)  
59 - $('.contrl-shodow').show(); 69 +
60 } 70 }
61 }, 71 },
62 compileResult: function(data, value){ 72 compileResult: function(data, value){
@@ -121,6 +131,9 @@ @@ -121,6 +131,9 @@
121 recorder.pause(); 131 recorder.pause();
122 } 132 }
123 CodingEditer.record_startime = new Date().getTime(); 133 CodingEditer.record_startime = new Date().getTime();
  134 +
  135 + $('#CompileBtn').addClass('compile-btn');
  136 + isCompile = false;
124 } 137 }
125 138
126 // 编译 139 // 编译
src/gxb-ide/ToolBox.js
@@ -173,6 +173,14 @@ @@ -173,6 +173,14 @@
173 $('#audio')[0].play(); 173 $('#audio')[0].play();
174 Hourglass.init() 174 Hourglass.init()
175 CodingEditer.playCoding() 175 CodingEditer.playCoding()
  176 + $('#audio')[0].addEventListener('ended', function () {
  177 + console.log('over');
  178 + if (CodingEditer.isRecordPage) {
  179 + $('#recordertab a:first').tab('show');
  180 + }
  181 + Hourglass.stopTimer();
  182 +
  183 + }, false);
176 }else{ 184 }else{
177 console.log('播放代码=-------------------------'); 185 console.log('播放代码=-------------------------');
178 return false; 186 return false;
src/scss/main.scss
@@ -135,17 +135,19 @@ html, body{ @@ -135,17 +135,19 @@ html, body{
135 height: 164px; 135 height: 164px;
136 overflow-y: scroll; 136 overflow-y: scroll;
137 } 137 }
138 -  
139 - #CompileBtn{  
140 - background-image: -webkit-linear-gradient(left, #1FB6FF 0%, #62DCF5 100%);  
141 - background-image: linear-gradient(to right, #1FB6FF 0%, #62DCF5 100%);  
142 - -webkit-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;  
143 - transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important; 138 +
  139 + .btn{
144 border: none; 140 border: none;
145 color: #fff; 141 color: #fff;
146 padding-top: 5px; 142 padding-top: 5px;
147 padding-bottom: 5px; 143 padding-bottom: 5px;
148 } 144 }
  145 + .compile-btn{
  146 + background-image: -webkit-linear-gradient(left, #1FB6FF 0%, #62DCF5 100%);
  147 + background-image: linear-gradient(to right, #1FB6FF 0%, #62DCF5 100%);
  148 + -webkit-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
  149 + transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) all !important;
  150 + }
149 151
150 .record-ctrl{ 152 .record-ctrl{
151 height: 60px; 153 height: 60px;
src/v1.1/index.html
@@ -102,9 +102,9 @@ @@ -102,9 +102,9 @@
102 <li><a href="#output" role="tab" data-toggle="tab" class="text">结果</a></li> 102 <li><a href="#output" role="tab" data-toggle="tab" class="text">结果</a></li>
103 </ul> 103 </ul>
104 <div class="pull-right func"> 104 <div class="pull-right func">
105 - <a class="btn btn-success" id="CompileBtn"> 105 + <button class="btn compile-btn" id="CompileBtn">
106 <span class="ladda-label">编译运行</span> 106 <span class="ladda-label">编译运行</span>
107 - </a> 107 + </button>
108 <a id="full-screen" class=""><i class="icon iconfont icon-quanping1"></i></a> 108 <a id="full-screen" class=""><i class="icon iconfont icon-quanping1"></i></a>
109 <a id="back-screen" class="" style="display: none;"><i class="icon iconfont icon-quanping1"></i></a> 109 <a id="back-screen" class="" style="display: none;"><i class="icon iconfont icon-quanping1"></i></a>
110 </div> 110 </div>
src/v1.1/player.html
@@ -104,7 +104,7 @@ @@ -104,7 +104,7 @@
104 <li><a href="#output" role="tab" data-toggle="tab" class="text">结果</a></li> 104 <li><a href="#output" role="tab" data-toggle="tab" class="text">结果</a></li>
105 </ul> 105 </ul>
106 <div class="pull-right func"> 106 <div class="pull-right func">
107 - <a class="btn btn-success" id="CompileBtn"> 107 + <a class="btn btn-success compile-btn" id="CompileBtn">
108 <span class="ladda-label">编译运行</span> 108 <span class="ladda-label">编译运行</span>
109 </a> 109 </a>
110 <a id="full-screen" class=""><i class="icon iconfont icon-quanping1"></i></a> 110 <a id="full-screen" class=""><i class="icon iconfont icon-quanping1"></i></a>