Commit 93541dffa9f088a0b8899068e9aca05267817a23

Authored by ykxie
1 parent bcd4c7d8

add utile

src/js/gbreplayer.js
... ... @@ -53,7 +53,7 @@ $(function(){
53 53 coderecordsData = coderecords;
54 54 }else{
55 55 // TODO 提示错误信息
56   - alert('错误')
  56 + alert('错误')
57 57 }
58 58 },
59 59 error: function(){
... ... @@ -422,7 +422,7 @@ $(function(){
422 422 selectLang(langid);
423 423 compileMode(langid);
424 424 console.log(coderecords);
425   - $("#play_audio").attr('src', "http://gxb-file.oss-cn-beijing.aliyuncs.com" + coderecords.audioUrl);
  425 + // $("#play_audio").attr('src', "http://gxb-file.oss-cn-beijing.aliyuncs.com" + coderecords.audioUrl);
426 426 if (_languageid != 35) {
427 427 $('#cmprun-tabs').show();
428 428 }
... ...
src/player.html
... ... @@ -319,6 +319,7 @@
319 319 <div class="tab-pane active padall15" id="stdin">
320 320 <input type="text" class="effect-2" id="input" placeholder="标准输入">
321 321 <span class="focus-border"></span>
  322 + <button class="btn playAudio">播放</button>
322 323 </div>
323 324 <div class="tab-pane padall15" id="cmpinfo"></div>
324 325 <div class="tab-pane padall15" id="stderr"></div>
... ... @@ -357,6 +358,13 @@
357 358 <script src="js/gbdebug/mode/clike/clike.js"></script>
358 359 <script src="js/gbdebug/mode/php/php.js"></script>
359 360 <script src="js/gbdebug/mode/python/python.js"></script>
  361 +<script>
  362 + $(function(){
  363 + $('.playAudio').click(function(){
  364 + $('#audio-element')[0].play();
  365 + })
  366 + })
  367 +</script>
360 368  
361 369 </body>
362 370 </html>
... ...