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 10 _source = getQuery('source');
11 11 var $recording_time = $('.recording-time');
12 12 var tag = 1; // 标记第一次暂停
  13 + var player = $.AudioPlayer;
13 14  
14 15 // 根据不同的角色渲染页面
15 16 if(_role == 1){
... ... @@ -379,8 +380,6 @@ $(function(){
379 380 compileMode(langid);
380 381  
381 382 $("#play_audio").attr('src', "http://gxb-file.oss-cn-beijing.aliyuncs.com/" + coderecords.audioUrl);
382   -
383   - var player = $.AudioPlayer;
384 383 player.init({
385 384 container: '#audioWrap'
386 385 ,source: "http://gxb-file.oss-cn-beijing.aliyuncs.com/" + coderecords.audioUrl
... ... @@ -1133,16 +1132,15 @@ $(function(){
1133 1132  
1134 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 1141 /* 解决Chrome浏览器非激活标签页下错乱问题 */
1143 1142 (function() {
1144   - var hidden = "hidden";
1145   -
  1143 + var hidden = "hidden";
1146 1144 // Standards:
1147 1145 if (hidden in document)
1148 1146 document.addEventListener("visibilitychange", onchange);
... ... @@ -1171,14 +1169,11 @@ $(function(){
1171 1169 }else{
1172 1170 document.body.className = this[hidden] ? "hidden" : "visible";
1173 1171 }
1174   -
1175 1172 /* Bugfix: Mobile Firefox has a bug here, when loading page it shows blur */
1176   -
1177 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 1179 // set the initial state
... ... @@ -1438,6 +1433,7 @@ $(function(){
1438 1433 })
1439 1434 }else{
1440 1435 GBCodePlayBack.isRcording = 0;
  1436 + GBCodePlayBack.htmleditor.setOption('readOnly', true);
1441 1437 $("#countdown").hide();
1442 1438 $("#re-recoding").show();
1443 1439 $("#start-recording").hide();
... ...