Commit f1b28a3b4a599ed2a55c06946c224685ae2cb22e

Authored by ykxie
1 parent 07f513d4

fix bug

Showing 1 changed file with 11 additions and 15 deletions
src/js/gbreplayer.js
@@ -10,6 +10,7 @@ $(function(){ @@ -10,6 +10,7 @@ $(function(){
10 _source = getQuery('source'); 10 _source = getQuery('source');
11 var $recording_time = $('.recording-time'); 11 var $recording_time = $('.recording-time');
12 var tag = 1; // 标记第一次暂停 12 var tag = 1; // 标记第一次暂停
  13 + var player = $.AudioPlayer;
13 14
14 // 根据不同的角色渲染页面 15 // 根据不同的角色渲染页面
15 if(_role == 1){ 16 if(_role == 1){
@@ -379,8 +380,6 @@ $(function(){ @@ -379,8 +380,6 @@ $(function(){
379 compileMode(langid); 380 compileMode(langid);
380 381
381 $("#play_audio").attr('src', "http://gxb-file.oss-cn-beijing.aliyuncs.com/" + coderecords.audioUrl); 382 $("#play_audio").attr('src', "http://gxb-file.oss-cn-beijing.aliyuncs.com/" + coderecords.audioUrl);
382 -  
383 - var player = $.AudioPlayer;  
384 player.init({ 383 player.init({
385 container: '#audioWrap' 384 container: '#audioWrap'
386 ,source: "http://gxb-file.oss-cn-beijing.aliyuncs.com/" + coderecords.audioUrl 385 ,source: "http://gxb-file.oss-cn-beijing.aliyuncs.com/" + coderecords.audioUrl
@@ -1133,16 +1132,15 @@ $(function(){ @@ -1133,16 +1132,15 @@ $(function(){
1133 1132
1134 this.resizeWindow($('#ifrcontainer').find('#resultiframe')); 1133 this.resizeWindow($('#ifrcontainer').find('#resultiframe'));
1135 1134
1136 - // $(window).bind('beforeunload', function(){  
1137 -  
1138 - // return '确认立刻退出? 请确保已录制的代码回放以保存,以防回放数据丢失';  
1139 -  
1140 - // }); 1135 + if (document.URL.indexOf('index.htm')>=0) {
  1136 + $(window).bind('beforeunload', function(){
  1137 + return '确认立刻退出? 请确保已录制的代码回放以保存,以防回放数据丢失';
  1138 + });
  1139 + }
1141 1140
1142 /* 解决Chrome浏览器非激活标签页下错乱问题 */ 1141 /* 解决Chrome浏览器非激活标签页下错乱问题 */
1143 (function() { 1142 (function() {
1144 - var hidden = "hidden";  
1145 - 1143 + var hidden = "hidden";
1146 // Standards: 1144 // Standards:
1147 if (hidden in document) 1145 if (hidden in document)
1148 document.addEventListener("visibilitychange", onchange); 1146 document.addEventListener("visibilitychange", onchange);
@@ -1171,14 +1169,11 @@ $(function(){ @@ -1171,14 +1169,11 @@ $(function(){
1171 }else{ 1169 }else{
1172 document.body.className = this[hidden] ? "hidden" : "visible"; 1170 document.body.className = this[hidden] ? "hidden" : "visible";
1173 } 1171 }
1174 -  
1175 /* Bugfix: Mobile Firefox has a bug here, when loading page it shows blur */ 1172 /* Bugfix: Mobile Firefox has a bug here, when loading page it shows blur */
1176 -  
1177 if(document.body.className==='hidden'){ 1173 if(document.body.className==='hidden'){
1178 - if($('#play').data('status')==1){  
1179 - $('#play').trigger('click');  
1180 - }  
1181 - player.pauseCallback(); 1174 + // player.pauseCallback();
  1175 + // pauseCode()
  1176 +
1182 } 1177 }
1183 } 1178 }
1184 // set the initial state 1179 // set the initial state
@@ -1438,6 +1433,7 @@ $(function(){ @@ -1438,6 +1433,7 @@ $(function(){
1438 }) 1433 })
1439 }else{ 1434 }else{
1440 GBCodePlayBack.isRcording = 0; 1435 GBCodePlayBack.isRcording = 0;
  1436 + GBCodePlayBack.htmleditor.setOption('readOnly', true);
1441 $("#countdown").hide(); 1437 $("#countdown").hide();
1442 $("#re-recoding").show(); 1438 $("#re-recoding").show();
1443 $("#start-recording").hide(); 1439 $("#start-recording").hide();