Commit e45405a1c08985a4b10c53afcb6b5f3751151525

Authored by ykxie
2 parents 7ee30be4 16b43d0c

Merge branch 'dev' into kira

src/css/main.css
1 1
2 .real-program-content{ 2 .real-program-content{
3 padding: 0 16px; 3 padding: 0 16px;
4 - padding-top: 16px;  
5 } 4 }
6 .recording{ 5 .recording{
7 background-color: #FFF; 6 background-color: #FFF;
@@ -31,16 +30,7 @@ @@ -31,16 +30,7 @@
31 border: none; 30 border: none;
32 border-bottom: 1px solid #ddd; 31 border-bottom: 1px solid #ddd;
33 } 32 }
34 -// input[type="button"]{  
35 -// min-width: 6em;  
36 -// background-image: none;  
37 -// background-color: #1FB6FF;  
38 -// border: none;  
39 -// padding: 1em .8em;  
40 -// color: #fff;  
41 -// outline: none;  
42 -// line-height: 1.428571429;  
43 -// } 33 +
44 input[disabled]{ 34 input[disabled]{
45 color: rgb(84, 84, 84); 35 color: rgb(84, 84, 84);
46 background-color: #a8b8bf; 36 background-color: #a8b8bf;
src/css/recording.css
@@ -31,10 +31,12 @@ button { @@ -31,10 +31,12 @@ button {
31 31
32 .player .col-md-8 { 32 .player .col-md-8 {
33 padding-right: 0; 33 padding-right: 0;
34 - overflow: hidden; } 34 + overflow: hidden;
  35 + padding-left: 0; }
35 36
36 .player .col-md-4 { 37 .player .col-md-4 {
37 - padding-left: 0; } 38 + padding-left: 0;
  39 + padding-right: 0; }
38 40
39 .upload-tip { 41 .upload-tip {
40 position: absolute; 42 position: absolute;
@@ -299,8 +301,8 @@ button { @@ -299,8 +301,8 @@ button {
299 margin-right: 0; 301 margin-right: 0;
300 line-height: 1.428571429; 302 line-height: 1.428571429;
301 border: none !important; 303 border: none !important;
302 - height: 42px;  
303 - line-height: 42px; 304 + height: 34px;
  305 + line-height: 34px;
304 padding: 0; 306 padding: 0;
305 border-radius: 21px; } 307 border-radius: 21px; }
306 308
src/index.html
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 <link href="css/recording.css" rel="stylesheet"> 16 <link href="css/recording.css" rel="stylesheet">
17 17
18 <script> 18 <script>
19 - var gxb_api = "https://restful1.gaoxiaobang.com"; 19 + var gxb_api = "https://restful.gaoxiaobang.com";
20 // var gxb_api = "https://restful.gaoxiaobang.cn" 20 // var gxb_api = "https://restful.gaoxiaobang.cn"
21 21
22 </script> 22 </script>
@@ -106,13 +106,13 @@ @@ -106,13 +106,13 @@
106 <div class="btn-group pull-right" id="comprunbtngrp"></div> 106 <div class="btn-group pull-right" id="comprunbtngrp"></div>
107 </div> 107 </div>
108 <div class="panel-body hidden" id="cmprun-output"> 108 <div class="panel-body hidden" id="cmprun-output">
109 - <div id="resultoutput" style="overflow:auto;"> 109 + <div id="resultoutput">
110 <!-- Nav tabs --> 110 <!-- Nav tabs -->
111 <ul class="nav nav-tabs" role="tablist" id="cmprun-tabs"> 111 <ul class="nav nav-tabs" role="tablist" id="cmprun-tabs">
112 - <li class="active"><a href="#stdin" role="tab" data-toggle="tab" class="text-warning">标准输入</a></li>  
113 - <li><a href="#cmpinfo" role="tab" data-toggle="tab" class="text-warning">编译信息</a></li>  
114 - <li><a href="#stderr" role="tab" data-toggle="tab" class="text-danger">错误输出</a></li>  
115 - <li><a href="#output" role="tab" data-toggle="tab" class="text-success">运行结果</a></li> 112 + <li class="active"><a href="#stdin" role="tab" data-toggle="tab" class="text-warning">标准</a></li>
  113 + <li><a href="#cmpinfo" role="tab" data-toggle="tab" class="text-warning">编译</a></li>
  114 + <li><a href="#stderr" role="tab" data-toggle="tab" class="text-danger">错误</a></li>
  115 + <li><a href="#output" role="tab" data-toggle="tab" class="text-success">结果</a></li>
116 </ul> 116 </ul>
117 <!-- Tab panes --> 117 <!-- Tab panes -->
118 <div class="tab-content"> 118 <div class="tab-content">
@@ -194,7 +194,7 @@ @@ -194,7 +194,7 @@
194 194
195 $('#upload').removeClass('upload-teach').addClass('recording-finish').removeAttr('disabled').prop("disabled",false); 195 $('#upload').removeClass('upload-teach').addClass('recording-finish').removeAttr('disabled').prop("disabled",false);
196 $('#savecorde').removeClass('upload-teach').addClass('recording-finish').removeAttr('disabled').prop("disabled",false); 196 $('#savecorde').removeClass('upload-teach').addClass('recording-finish').removeAttr('disabled').prop("disabled",false);
197 - $('#cancel').attr('disabled', 'disabled').prop("disabled", true); 197 + // $('#cancel').attr('disabled', 'disabled').prop("disabled", true);
198 198
199 // $('.recording').hide(); 199 // $('.recording').hide();
200 $('.new-recording').show(); 200 $('.new-recording').show();
src/js/gbreplayer.js
@@ -471,7 +471,6 @@ $(function(){ @@ -471,7 +471,6 @@ $(function(){
471 if(document.URL.indexOf('player.html')>=0){ 471 if(document.URL.indexOf('player.html')>=0){
472 if(playstatus){ 472 if(playstatus){
473 GBCodePlayBack.pauseData = new Date().getTime(); // 暂停的时间 473 GBCodePlayBack.pauseData = new Date().getTime(); // 暂停的时间
474 - console.log(GBCodePlayBack.pauseData)  
475 myAudio[0].pause(); 474 myAudio[0].pause();
476 $('#play').find('i').removeClass('icon-playcopy').addClass('icon-play').attr('data-original-title', '播放'); 475 $('#play').find('i').removeClass('icon-playcopy').addClass('icon-play').attr('data-original-title', '播放');
477 }else{ 476 }else{
@@ -500,32 +499,21 @@ $(function(){ @@ -500,32 +499,21 @@ $(function(){
500 if (tag === 1) { 499 if (tag === 1) {
501 GBCodePlayBack.stopIntervalTime = playbackrecord[0].intervaltime - (GBCodePlayBack.pauseData - GBCodePlayBack.playRecordStart); 500 GBCodePlayBack.stopIntervalTime = playbackrecord[0].intervaltime - (GBCodePlayBack.pauseData - GBCodePlayBack.playRecordStart);
502 starttime = GBCodePlayBack.stopIntervalTime 501 starttime = GBCodePlayBack.stopIntervalTime
503 - console.log(starttime)  
504 tag++; 502 tag++;
505 }else{ 503 }else{
506 GBCodePlayBack.stopIntervalTime = GBCodePlayBack.stopIntervalTime - (GBCodePlayBack.pauseData - GBCodePlayBack.playRecordStart); 504 GBCodePlayBack.stopIntervalTime = GBCodePlayBack.stopIntervalTime - (GBCodePlayBack.pauseData - GBCodePlayBack.playRecordStart);
507 starttime = GBCodePlayBack.stopIntervalTime; 505 starttime = GBCodePlayBack.stopIntervalTime;
508 - console.log('------------------------------')  
509 - console.log(tag)  
510 - console.log(starttime)  
511 - console.log('------------------------------')  
512 } 506 }
513 - console.log(starttime)  
514 } 507 }
515 508
516 - console.log(starttime)  
517 509
518 }else{ 510 }else{
519 starttime = parseInt(starttime) + parseInt(replayinterval); 511 starttime = parseInt(starttime) + parseInt(replayinterval);
520 512
521 if (GBCodePlayBack.pauseData && GBCodePlayBack.pauseData - playbackrecord[i-1].playTime > 0) { 513 if (GBCodePlayBack.pauseData && GBCodePlayBack.pauseData - playbackrecord[i-1].playTime > 0) {
522 - console.log('+++++++++++++++++++++++++++++++++++++++')  
523 GBCodePlayBack.stopIntervalTime = GBCodePlayBack.pauseData - playbackrecord[i-1].playTime; 514 GBCodePlayBack.stopIntervalTime = GBCodePlayBack.pauseData - playbackrecord[i-1].playTime;
524 starttime = GBCodePlayBack.stopIntervalTime + parseInt(replayinterval); 515 starttime = GBCodePlayBack.stopIntervalTime + parseInt(replayinterval);
525 - console.log(starttime)  
526 } 516 }
527 -  
528 - console.log(starttime)  
529 } 517 }
530 518
531 timeoutcontroller = setTimeout( GBCodePlayBack.changeValueCallback(playbackrecord[i]), starttime/GBCodePlayBack.speed ); 519 timeoutcontroller = setTimeout( GBCodePlayBack.changeValueCallback(playbackrecord[i]), starttime/GBCodePlayBack.speed );
@@ -538,7 +526,6 @@ $(function(){ @@ -538,7 +526,6 @@ $(function(){
538 } 526 }
539 // 记录播放的时间 527 // 记录播放的时间
540 GBCodePlayBack.playRecordStart = new Date().getTime(); 528 GBCodePlayBack.playRecordStart = new Date().getTime();
541 - console.log(GBCodePlayBack.playRecordStart);  
542 }else{ 529 }else{
543 var recordtimeoutcontrolls = GBCodePlayBack.recordtimeoutcontrolls; 530 var recordtimeoutcontrolls = GBCodePlayBack.recordtimeoutcontrolls;
544 531
@@ -548,8 +535,6 @@ $(function(){ @@ -548,8 +535,6 @@ $(function(){
548 535
549 GBCodePlayBack.recordtimeouts = []; 536 GBCodePlayBack.recordtimeouts = [];
550 // GBCodePlayBack.playRecordStart = new Date().getTime(); // 再次开始播放的时间 537 // GBCodePlayBack.playRecordStart = new Date().getTime(); // 再次开始播放的时间
551 -  
552 - console.log(GBCodePlayBack);  
553 } 538 }
554 $(this).data('status', !playstatus); 539 $(this).data('status', !playstatus);
555 }); 540 });
@@ -653,7 +638,6 @@ $(function(){ @@ -653,7 +638,6 @@ $(function(){
653 //播放代码回放 638 //播放代码回放
654 $('#playrecord').click(function(){ 639 $('#playrecord').click(function(){
655 // GBCodePlayBack.playRecordStart = new Date().getTime(); // 开始播放的时间 640 // GBCodePlayBack.playRecordStart = new Date().getTime(); // 开始播放的时间
656 - // console.log(GBCodePlayBack.playRecordStart);  
657 if($(window).width()>992){ 641 if($(window).width()>992){
658 var $tutorial = $('#tutorialinfopanel'), 642 var $tutorial = $('#tutorialinfopanel'),
659 $editorpanel = $('#editorpanel'), 643 $editorpanel = $('#editorpanel'),
@@ -669,7 +653,7 @@ $(function(){ @@ -669,7 +653,7 @@ $(function(){
669 653
670 $sliderpropress.slider( "option", "disabled", false ); 654 $sliderpropress.slider( "option", "disabled", false );
671 655
672 - $(this).popover('destroy'); 656 + // $(this).popover('destroy');
673 657
674 $(this).find('span').toggleClass('glyphicon-cloud-download').toggleClass('glyphicon-play'); 658 $(this).find('span').toggleClass('glyphicon-cloud-download').toggleClass('glyphicon-play');
675 659
@@ -945,7 +929,9 @@ $(function(){ @@ -945,7 +929,9 @@ $(function(){
945 }); 929 });
946 930
947 $('#cancel').click(function(){ 931 $('#cancel').click(function(){
948 - $(window).unbind('beforeunload'); 932 + $(window).unbind('beforeunload', function(){
  933 + return '确认退出? 将不保存你的代码';
  934 + });
949 window.close(); 935 window.close();
950 }) 936 })
951 // 保存代码 937 // 保存代码
@@ -1025,7 +1011,6 @@ $(function(){ @@ -1025,7 +1011,6 @@ $(function(){
1025 dataType: "json", 1011 dataType: "json",
1026 contentType: "application/json", 1012 contentType: "application/json",
1027 success: function(data){ 1013 success: function(data){
1028 - console.log(data)  
1029 $(window).unbind('beforeunload'); 1014 $(window).unbind('beforeunload');
1030 var _data = { 1015 var _data = {
1031 "programId": data.codeReplayId, 1016 "programId": data.codeReplayId,
@@ -1053,7 +1038,6 @@ $(function(){ @@ -1053,7 +1038,6 @@ $(function(){
1053 dataType: "json", 1038 dataType: "json",
1054 contentType: "application/json", 1039 contentType: "application/json",
1055 success: function(data) { 1040 success: function(data) {
1056 - console.log(data)  
1057 $(window).unbind('beforeunload'); 1041 $(window).unbind('beforeunload');
1058 var _data = { 1042 var _data = {
1059 "programId": data.studentReplayId, 1043 "programId": data.studentReplayId,
@@ -1419,6 +1403,7 @@ $(function(){ @@ -1419,6 +1403,7 @@ $(function(){
1419 var calcHeight = function() { 1403 var calcHeight = function() {
1420 var $resultpanel = $("#resultpanel").offset(); 1404 var $resultpanel = $("#resultpanel").offset();
1421 var $recordpanel = $("#recordpanel").offset(); 1405 var $recordpanel = $("#recordpanel").offset();
  1406 + var $resultoutput = $('#resultoutput').offset();
1422 1407
1423 if (document.URL.indexOf('index.htm') >= 0) { 1408 if (document.URL.indexOf('index.htm') >= 0) {
1424 $("#recordpanel").height($(window).height() - $recordpanel.top - 16 - 70); 1409 $("#recordpanel").height($(window).height() - $recordpanel.top - 16 - 70);
@@ -1429,6 +1414,8 @@ $(function(){ @@ -1429,6 +1414,8 @@ $(function(){
1429 $("#resultpanel").height($(window).height() - $resultpanel.top - 16 - 34); 1414 $("#resultpanel").height($(window).height() - $resultpanel.top - 16 - 34);
1430 $(".CodeMirror").height($(window).height() - $recordpanel.top - 16 - 34); 1415 $(".CodeMirror").height($(window).height() - $recordpanel.top - 16 - 34);
1431 } 1416 }
  1417 + $('#resultoutput').find('.tab-content').height($(window).height() - $resultoutput.top - 164).css({'overflow-y': "scroll"})
  1418 +
1432 /*保证编辑器都尺寸自动变化(包括滚动条)*/ 1419 /*保证编辑器都尺寸自动变化(包括滚动条)*/
1433 if(typeof GBCodePlayBack.htmleditor !=='undefined'&&typeof GBCodePlayBack.csseditor!=='undefined'&&typeof GBCodePlayBack.jseditor!=='undefined'){ 1420 if(typeof GBCodePlayBack.htmleditor !=='undefined'&&typeof GBCodePlayBack.csseditor!=='undefined'&&typeof GBCodePlayBack.jseditor!=='undefined'){
1434 GBCodePlayBack.htmleditor.refresh(); 1421 GBCodePlayBack.htmleditor.refresh();
@@ -1441,7 +1428,7 @@ $(function(){ @@ -1441,7 +1428,7 @@ $(function(){
1441 // $('#editorwrapper').find('button').removeClass('btn-primary').find('#allbutton').addClass('btn-primary'); 1428 // $('#editorwrapper').find('button').removeClass('btn-primary').find('#allbutton').addClass('btn-primary');
1442 calcHeight(); 1429 calcHeight();
1443 //窗口变化则隐藏popover 1430 //窗口变化则隐藏popover
1444 - $('#playrecord').popover('hide'); 1431 + // $('#playrecord').popover('hide');
1445 }).load(function() { 1432 }).load(function() {
1446 calcHeight(); 1433 calcHeight();
1447 }); 1434 });
@@ -1487,7 +1474,6 @@ $(function(){ @@ -1487,7 +1474,6 @@ $(function(){
1487 1474
1488 record.trigger = 1; //标记已运行 1475 record.trigger = 1; //标记已运行
1489 record.playTime = new Date().getTime(); // 播放开始时间 1476 record.playTime = new Date().getTime(); // 播放开始时间
1490 - console.log(record)  
1491 1477
1492 if(replay_type){ 1478 if(replay_type){
1493 GBCodePlayBack.excercise_triggertotal += 1; 1479 GBCodePlayBack.excercise_triggertotal += 1;
src/player.html
@@ -76,13 +76,11 @@ @@ -76,13 +76,11 @@
76 <div class="recording-header"> 76 <div class="recording-header">
77 <ul class="nav nav-tabs pull-left" id="recordertab"> 77 <ul class="nav nav-tabs pull-left" id="recordertab">
78 <li style="margin-left: 34px;"> 78 <li style="margin-left: 34px;">
79 - <a href="#replayzone" data-toggle="tab">  
80 - <span class="glyphicon glyphicon-play"></span><p class="hidden-xs hidden-sm pull-right">&nbsp;课程预览区</p>  
81 - </a> 79 + <a href="#replayzone" data-toggle="tab"></a>
82 </li> 80 </li>
83 </ul> 81 </ul>
84 <div id="editorwrapper"> 82 <div id="editorwrapper">
85 - <button type="button" class="lang btn btn-default btn-primary pull-right" id="htmlbutton" title="" data-editorname="html"></button> 83 + <button type="button" class="lang btn btn-default btn-primary pull-right" id="htmlbutton" title="" data-editorname="html">HTML/CSS/JS</button>
86 </div> 84 </div>
87 </div> 85 </div>
88 </div> 86 </div>
@@ -113,10 +111,10 @@ @@ -113,10 +111,10 @@
113 <div id="resultoutput" style="overflow:auto;"> 111 <div id="resultoutput" style="overflow:auto;">
114 <!-- Nav tabs --> 112 <!-- Nav tabs -->
115 <ul class="nav nav-tabs" role="tablist" id="cmprun-tabs"> 113 <ul class="nav nav-tabs" role="tablist" id="cmprun-tabs">
116 - <li class="active"><a href="#stdin" role="tab" data-toggle="tab" class="text-warning">标准输入</a></li>  
117 - <li><a href="#cmpinfo" role="tab" data-toggle="tab" class="text-warning">编译信息</a></li>  
118 - <li><a href="#stderr" role="tab" data-toggle="tab" class="text-danger">错误输出</a></li>  
119 - <li><a href="#output" role="tab" data-toggle="tab" class="text-success">运行结果</a></li> 114 + <li class="active"><a href="#stdin" role="tab" data-toggle="tab" class="text-warning">标准</a></li>
  115 + <li><a href="#cmpinfo" role="tab" data-toggle="tab" class="text-warning">编译</a></li>
  116 + <li><a href="#stderr" role="tab" data-toggle="tab" class="text-danger">错误</a></li>
  117 + <li><a href="#output" role="tab" data-toggle="tab" class="text-success">结果</a></li>
120 </ul> 118 </ul>
121 <!-- Tab panes --> 119 <!-- Tab panes -->
122 <div class="tab-content"> 120 <div class="tab-content">
@@ -138,7 +136,7 @@ @@ -138,7 +136,7 @@
138 </div> 136 </div>
139 137
140 <div class="play-bar"> 138 <div class="play-bar">
141 - <button id="playrecord" data-status='0' title="播放"> 139 + <button id="playrecord" data-status='0' title="播adasdas放">
142 <i class="icon iconfont icon-play"></i> 140 <i class="icon iconfont icon-play"></i>
143 </button> 141 </button>
144 <button id="play" class="" style="display: none;" data-status='0' title="暂停"> 142 <button id="play" class="" style="display: none;" data-status='0' title="暂停">
src/scss/recording.scss
@@ -29,11 +29,36 @@ button{ @@ -29,11 +29,36 @@ button{
29 .player{ 29 .player{
30 .col-md-8{ 30 .col-md-8{
31 padding-right: 0; 31 padding-right: 0;
32 - overflow: hidden 32 + overflow: hidden;
  33 + padding-left: 0;
33 } 34 }
34 .col-md-4{ 35 .col-md-4{
35 padding-left: 0; 36 padding-left: 0;
  37 + padding-right: 0;
36 } 38 }
  39 +
  40 + // .recording-wrap{
  41 +
  42 + // .recording-header{
  43 + // height: 36px;
  44 + // }
  45 + // .lang{
  46 + // padding: 4px 24px;
  47 + // margin: 3px 16px;
  48 + // }
  49 + // }
  50 + // .nav-tabs > li > a{
  51 + // height: 36px;
  52 + // line-height: 1px;
  53 + // }
  54 + // .panel-default > .panel-heading{
  55 + // height: 36px;
  56 + // line-height: 18px;
  57 +
  58 + // }
  59 + // .panel-heading{
  60 + // padding: 8px 16px;
  61 + // }
37 } 62 }
38 63
39 .upload-tip{ 64 .upload-tip{
@@ -371,8 +396,8 @@ button{ @@ -371,8 +396,8 @@ button{
371 margin-right: 0; 396 margin-right: 0;
372 line-height: 1.428571429; 397 line-height: 1.428571429;
373 border: none !important; 398 border: none !important;
374 - height: 42px;  
375 - line-height: 42px; 399 + height: 34px;
  400 + line-height: 34px;
376 padding: 0; 401 padding: 0;
377 border-radius: 21px; 402 border-radius: 21px;
378 } 403 }