Commit 5f6e3b99d7f82f709cf0e599d60d719be3bef8b8

Authored by ykxie
1 parent dac234f8

fix style bug

src/css/ide.css
... ... @@ -284,7 +284,7 @@ html, body {
284 284  
285 285 #resultoutput {
286 286 height: 164px;
287   - overflow-y: scroll; }
  287 + overflow-y: auto; }
288 288  
289 289 .fb {
290 290 float: right;
... ... @@ -380,12 +380,15 @@ html, body {
380 380 left: 50%;
381 381 transform: translate(-50%, -50%); }
382 382  
  383 +.play-page .record-wrap {
  384 + padding-top: 0; }
  385 +
383 386 #playFooter {
384   - height: 60px;
  387 + height: 46px;
385 388 width: 100%;
386 389 z-index: 999;
387 390 background-color: #23383f;
388   - padding: 10px 24px; }
  391 + padding: 4px 24px; }
389 392 #playFooter #componentWrapper {
390 393 width: 100%; }
391 394  
... ... @@ -421,10 +424,8 @@ html, body {
421 424 border: none;
422 425 width: 40px;
423 426 height: 40px;
424   - margin-left: 48px; }
425   -
426   -.play-code img {
427   - width: 100%; }
  427 + margin-left: 48px;
  428 + outline: none; }
428 429  
429 430 .confirm-tip {
430 431 position: absolute;
... ...
src/css/main.css
... ... @@ -156,7 +156,7 @@ html, body {
156 156  
157 157 #resultoutput {
158 158 height: 164px;
159   - overflow-y: scroll; }
  159 + overflow-y: auto; }
160 160  
161 161 .fb {
162 162 float: right;
... ... @@ -252,12 +252,15 @@ html, body {
252 252 left: 50%;
253 253 transform: translate(-50%, -50%); }
254 254  
  255 +.play-page .record-wrap {
  256 + padding-top: 0; }
  257 +
255 258 #playFooter {
256   - height: 60px;
  259 + height: 46px;
257 260 width: 100%;
258 261 z-index: 999;
259 262 background-color: #23383f;
260   - padding: 10px 24px; }
  263 + padding: 4px 24px; }
261 264 #playFooter #componentWrapper {
262 265 width: 100%; }
263 266  
... ... @@ -293,10 +296,8 @@ html, body {
293 296 border: none;
294 297 width: 40px;
295 298 height: 40px;
296   - margin-left: 48px; }
297   -
298   -.play-code img {
299   - width: 100%; }
  299 + margin-left: 48px;
  300 + outline: none; }
300 301  
301 302 .confirm-tip {
302 303 position: absolute;
... ...
src/css/mian.css deleted 100644 → 0
src/css/recording.css
... ... @@ -62,6 +62,21 @@ a:hover, a:focus {
62 62 button {
63 63 cursor: pointer; }
64 64  
  65 +.CodeMirror {
  66 + width: 100%; }
  67 +
  68 +.CodeMirror,
  69 +.CodeMirror * {
  70 + font-family: monospace !important;
  71 + font-size: 16px; }
  72 +
  73 +.row {
  74 + margin-right: 0px !important;
  75 + margin-left: 0px !important; }
  76 +
  77 +.col-md-8 {
  78 + padding-left: 0 !important; }
  79 +
65 80 #player {
66 81 width: 100%;
67 82 height: 100%; }
... ... @@ -75,7 +90,7 @@ button {
75 90 padding-left: 0;
76 91 padding-right: 0; }
77 92  
78   -.play-code {
  93 +.play-code, .play-pause-code {
79 94 background: transparent;
80 95 color: #fff;
81 96 border: none;
... ... @@ -95,13 +110,12 @@ button {
95 110 left: 50%;
96 111 transform: translate(-50%, -50%); }
97 112  
98   -.recording-page {
99   - padding-top: 16px; }
100   - .recording-page .col-md-8 {
101   - padding-right: 0;
102   - overflow: hidden; }
103   - .recording-page .col-md-4 {
104   - padding-left: 0; }
  113 +.recording-page .col-md-8 {
  114 + padding-right: 0;
  115 + overflow: hidden; }
  116 +
  117 +.recording-page .col-md-4 {
  118 + padding-left: 0; }
105 119  
106 120 .real-program-title {
107 121 width: 100%;
... ... @@ -378,7 +392,7 @@ button {
378 392 text-align: center; }
379 393  
380 394 #previewpanel .tab-content {
381   - margin: 16px; }
  395 + overflow: auto !important; }
382 396 #previewpanel .tab-content .form-control {
383 397 border: none;
384 398 border-bottom: 1px solid #999;
... ...
src/gxb-ide/CodingEditer.js
... ... @@ -299,6 +299,7 @@
299 299 treeLinkEditor[i].CodeMirrorRecord = CodeMirror.fromTextArea($('#' + treeLinkEditor[i].record)[0], {
300 300 value: '',
301 301 mode: modeNameItem,
  302 + styleActiveLine: true,
302 303 lineNumbers: true,
303 304 smartIndent: false,
304 305 // theme: "erlang-dark",
... ... @@ -463,6 +464,9 @@
463 464 }
464 465  
465 466 CodingEditer.triggertotal = 0;
  467 +
  468 + $('.play-code').show();
  469 + $('.pause-play-code').hide();
466 470 }
467 471  
468 472 }
... ...
src/gxb-ide/Dir.js
... ... @@ -610,8 +610,13 @@
610 610  
611 611 AudioPlayer(audioUrl)
612 612  
613   - // 请求玩立刻执行
614   - $.AudioPlayer.play()
  613 + var role = getQuery('role');
  614 + if (role == 0) {
  615 + // 请求玩立刻执行
  616 + $.AudioPlayer.play()
  617 + }else{
  618 + CodingEditer.playCoding();
  619 + }
615 620  
616 621 },
617 622 error: function(error) {
... ... @@ -641,7 +646,7 @@
641 646 source: "https://gxb-file.oss-cn-beijing.aliyuncs.com" + audioUrl,
642 647 imagePath: '../js/audioPlayer/image',
643 648 debuggers: false,
644   - allowSeek: false,
  649 + // allowSeek: false,
645 650 playCallback: function() { // 播放
646 651 console.log('++++++++');
647 652 CodingEditer.playCoding();
... ...
src/gxb-ide/ToolBox.js
... ... @@ -290,6 +290,8 @@
290 290 });
291 291 },
292 292 playerPage: function(){
  293 + $('.play-code').hide();
  294 + // $('.pause-play-code').show();
293 295 CodingEditer.playCoding();
294 296 CodingEditer.editable(0)
295 297 },
... ...
src/index.html
... ... @@ -14,7 +14,7 @@
14 14 <link href="css/font/iconfont.css" rel="stylesheet">
15 15 <link href="css/font_all/iconfont.css" rel="stylesheet">
16 16 <link href="css/layout.css" rel="stylesheet">
17   - <link href="css/main.css" rel="stylesheet">
  17 + <!-- <link href="css/main.css" rel="stylesheet"> -->
18 18 <link href="css/recording.css" rel="stylesheet">
19 19  
20 20 <style>
... ...
src/js/audioPlayer/theme.default.css
... ... @@ -23,7 +23,7 @@
23 23 position: relative;
24 24 width: 40px;
25 25 height: 40px;
26   - background: #333;
  26 + // background: #333;
27 27 border-right: 1px solid #555;
28 28 border-right-color: rgba( 255, 255, 255, .1);
29 29 background-repeat: repeat-x;
... ... @@ -70,9 +70,9 @@
70 70  
71 71 #componentWrapper .progress_bg {
72 72 position: absolute;
73   - height: 10px;
74   - background: #222;
75   - top: 15px;
  73 + height: 6px;
  74 + background: rgba(255, 255, 255, 0.2);
  75 + top: 18px;
76 76 left: 10px;
77 77 right: 10px;
78 78 -webkit-box-shadow: -1px -1px 0 rgba( 0, 0, 0, .5), 1px 1px 0 rgba( 255, 255, 255, .1);
... ... @@ -83,9 +83,9 @@
83 83  
84 84 #componentWrapper .load_progress {
85 85 position: absolute;
86   - height: 10px;
  86 + height: 6px;
87 87 background: #444;
88   - top: 15px;
  88 + top: 18px;
89 89 left: 10px;
90 90 right: 10px;
91 91 width: 0px;
... ... @@ -95,9 +95,9 @@
95 95  
96 96 #componentWrapper .play_progress {
97 97 position: absolute;
98   - height: 10px;
99   - background: #fff;
100   - top: 15px;
  98 + height: 6px;
  99 + background: #1FB6FF;
  100 + top: 18px;
101 101 left: 10px;
102 102 right: 10px;
103 103 width: 0px;
... ... @@ -175,8 +175,8 @@
175 175 position: relative;
176 176 width: 80px;
177 177 height: 40px;
178   - background-image: url(./image/player_bg2_vol.png);
179   - background-repeat: repeat-x;
  178 + // background-image: url(./image/player_bg2_vol.png);
  179 + // background-repeat: repeat-x;
180 180 behavior: url(PIE.htc);
181 181 /*display: none;*/
182 182 cursor: pointer;
... ... @@ -185,9 +185,9 @@
185 185 #componentWrapper .volume_bg {
186 186 position: absolute;
187 187 width: 60px;
188   - height: 10px;
189   - background: #222;
190   - bottom: 15px;
  188 + height: 6px;
  189 + background: #6B777F;
  190 + bottom: 16px;
191 191 left: 10px;
192 192 -webkit-box-shadow: -1px -1px 0 rgba( 0, 0, 0, .5), 1px 1px 0 rgba( 255, 255, 255, .1);
193 193 box-shadow: -1px -1px 0 rgba( 0, 0, 0, .5), 1px 1px 0 rgba( 255, 255, 255, .1);
... ... @@ -198,9 +198,9 @@
198 198 #componentWrapper .volume_level {
199 199 position: absolute;
200 200 width: 30px;
201   - height: 10px;
202   - background: #fff;
203   - bottom: 15px;
  201 + height: 6px;
  202 + background: #1FB6FF;
  203 + bottom: 16px;
204 204 left: 10px;
205 205 -webkit-border-radius: 4px;
206 206 border-radius: 4px;
... ...
src/js/gbreplayer.js
... ... @@ -43,6 +43,9 @@ $(function(){
43 43 isPause: 1, // 是否暂停 1:不暂停,0:暂停
44 44 isRcording: 0, // 是否录制 1:录制中,0:暂停中
45 45 recordinit: function(codereplaytype, preload) {
  46 + var modeName = getMode(_languageid);
  47 + var modeNameItem = modeName[0];
  48 +
46 49 /* #STRAT:生成CodeMirror Editor for JS/CSS/HTML */
47 50 var htmlid = document.getElementById('HTMLeditor'),
48 51 cssid = document.getElementById('CSSeditor'),
... ... @@ -55,7 +58,7 @@ $(function(){
55 58 if(htmlid&&cssid&&jsid){
56 59 this.htmleditor = CodeMirror.fromTextArea(htmlid, {
57 60 value: '输入HTML代码',
58   - mode: "text/html",
  61 + mode: modeNameItem,
59 62 lineNumbers: true,
60 63 smartIndent: false,
61 64 onChange: function(em, changeobj){
... ... @@ -258,10 +261,9 @@ $(function(){
258 261 jsplayerid = document.getElementById('JSplayer');
259 262  
260 263 var trigger_readonly_popover = 1;
261   -
262 264 if(htmlplayerid&&cssplayerid&&jsplayerid){
263 265 this.htmlplayereditor = CodeMirror.fromTextArea(htmlplayerid, {
264   - mode: "text/html",
  266 + mode: modeNameItem,
265 267 lineNumbers: true,
266 268 readOnly: true,
267 269 onChange: function(em, changeobj){
... ... @@ -360,7 +362,7 @@ $(function(){
360 362 if (_role == 0) {
361 363 console.log('----========')
362 364 var apiUrl = gxb_api + "/programming/codeReplay/" + _codeReplayId + "/api";
363   - initPlayerPage(apiUrl)
  365 + initPlayerPage(apiUrl);
364 366  
365 367 } else if (_role == 1) {
366 368 var apiUrl = gxb_api + "/programming/student/studentReplay/" + _codeReplayId + "/api";
... ... @@ -405,6 +407,7 @@ $(function(){
405 407 }
406 408 });
407 409 var coderecords = coderecords.codeRecordList;
  410 +
408 411 }else{
409 412 $('.play-code').show();
410 413 var coderecords = coderecords.studentRecordList;
... ... @@ -1229,7 +1232,7 @@ $(function(){
1229 1232 /* #END: 编辑器自适应窗口 */
1230 1233 },
1231 1234 onChange: function(editor, changeobj) { // 监听输入事件 editor: 输入语言;changeobj:输入内容{from,text,to}
1232   - var intervaltime = 50,
  1235 + var intervaltime = 100,
1233 1236 currenttime = new Date().getTime();
1234 1237 // if(!GBCodePlayBack.record_startime) GBCodePlayBack.record_startime = currenttime;
1235 1238 //根据不同的身份设置录制代码的时间间隔,当学生端输入的时候,重置间隔为100毫秒
... ... @@ -1301,6 +1304,9 @@ $(function(){
1301 1304 Hourglass.stopTimer();
1302 1305 }
1303 1306 GBCodePlayBack.triggertotal = 0;
  1307 +
  1308 + $('.play-code').show();
  1309 + $('.play-pause-code').hide();
1304 1310 }
1305 1311 }
1306 1312 },
... ... @@ -1491,7 +1497,8 @@ $(function(){
1491 1497 })
1492 1498  
1493 1499 $('.play-code').click(function(){
1494   - $('.play-code').attr('disabled', true);
  1500 + $('.play-code').hide();
  1501 + $('.play-pause-code').show();
1495 1502 playCode();
1496 1503 GBCodePlayBack.editable(0)
1497 1504 });
... ... @@ -1935,6 +1942,45 @@ $(function(){
1935 1942 }
1936 1943 }
1937 1944  
  1945 + function getMode(langid){
  1946 + var langid = parseInt(langid);
  1947 + var mode = [];
  1948 + switch (langid) {
  1949 + case 4:
  1950 + mode = ["text/x-python"];
  1951 + break;
  1952 + case 10:
  1953 + mode = ["text/x-java"];
  1954 + break;
  1955 + case 11:
  1956 + mode = ["text/x-csrc"];
  1957 + break;
  1958 + case 29:
  1959 + mode = ["application/x-httpd-php"];
  1960 + break;
  1961 + case 35:
  1962 + mode = ["text/html", "text/css", "text/javascript"];
  1963 + break;
  1964 + case 40:
  1965 + mode = ["text/x-sql"];
  1966 + break;
  1967 + case 43:
  1968 + mode = ["text/x-objectivec"];
  1969 + break;
  1970 + case 82:
  1971 + mode = ["text/x-c++src"];
  1972 + break;
  1973 +
  1974 + case 117:
  1975 + mode = ["text/x-rsrc"];
  1976 + break;
  1977 + default:
  1978 + break;
  1979 + }
  1980 +
  1981 + return mode;
  1982 + }
  1983 +
1938 1984 // 只读和可编辑状态
1939 1985 function readStatus(roflag) {
1940 1986 if (roflag == 1) {
... ...
src/player.html
... ... @@ -12,7 +12,7 @@
12 12 <link href="css/font/iconfont.css" rel="stylesheet">
13 13 <link href="css/font_all/iconfont.css" rel="stylesheet">
14 14 <link href="css/layout.css" rel="stylesheet">
15   - <link href="css/main.css" rel="stylesheet">
  15 + <!-- <link href="css/main.css" rel="stylesheet"> -->
16 16 <link href="css/recording.css" rel="stylesheet">
17 17 <link rel="stylesheet" href="js/audioPlayer/theme.default.css">
18 18  
... ... @@ -50,7 +50,7 @@
50 50  
51 51 <script src="js/gbreplayer.js"></script>
52 52 <script src="js/recording/recording.js"></script>
53   - <script src="js/player.js"></script>
  53 + <script src="js/player1.js"></script>
54 54  
55 55 </head>
56 56 <body>
... ... @@ -128,6 +128,9 @@
128 128 <button class="play-code" style="display: none;">
129 129 <i class="icon iconfont icon-play"></i>
130 130 </button>
  131 + <button class="play-pause-code" style="display: none;">
  132 + <i class="icon iconfont icon-playcopy"></i>
  133 + </button>
131 134 <button id="full-screen">
132 135 <i class="icon iconfont icon-fangda"></i>
133 136 </button>
... ...
src/scss/main.scss
... ... @@ -203,7 +203,7 @@ html, body{
203 203  
204 204 #resultoutput{
205 205 height: 164px;
206   - overflow-y: scroll;
  206 + overflow-y: auto;
207 207 }
208 208  
209 209 .fb{
... ... @@ -330,12 +330,17 @@ html, body{
330 330 }
331 331  
332 332 // player
  333 +.play-page{
  334 + .record-wrap{
  335 + padding-top: 0;
  336 + }
  337 +}
333 338 #playFooter{
334   - height: 60px;
  339 + height: 46px;
335 340 width: 100%;
336 341 z-index: 999;
337 342 background-color: #23383f;
338   - padding: 10px 24px;
  343 + padding: 4px 24px;
339 344  
340 345 #componentWrapper{
341 346 width: 100%;
... ... @@ -381,9 +386,9 @@ html, body{
381 386 width: 40px;
382 387 height: 40px;
383 388 margin-left: 48px;
  389 + outline: none;
384 390 }
385 391 .play-code img{
386   - width: 100%;
387 392 }
388 393  
389 394 .confirm-tip{
... ...
src/scss/recording.scss
... ... @@ -21,6 +21,21 @@ button{
21 21 cursor: pointer;
22 22 }
23 23  
  24 +.CodeMirror{
  25 + width: 100%;
  26 +}
  27 +.CodeMirror,
  28 +.CodeMirror * {
  29 + font-family: monospace !important;
  30 + font-size: 16px;
  31 +}
  32 +.row {
  33 + margin-right: 0px !important;
  34 + margin-left: 0px !important;
  35 +}
  36 +.col-md-8{
  37 + padding-left: 0 !important;
  38 +}
24 39  
25 40 #player{
26 41 width: 100%;
... ... @@ -61,7 +76,7 @@ button{
61 76 // }
62 77 }
63 78  
64   -.play-code{
  79 +.play-code, .play-pause-code{
65 80 background: transparent;
66 81 color: #fff;
67 82 border: none;
... ... @@ -86,8 +101,7 @@ button{
86 101 }
87 102  
88 103 .recording-page{
89   - padding-top:16px;
90   -
  104 +
91 105 .col-md-8{
92 106 padding-right: 0;
93 107 overflow: hidden
... ... @@ -438,7 +452,7 @@ button{
438 452 }
439 453 }
440 454 .tab-content{
441   - margin: 16px;
  455 + overflow: auto !important;
442 456  
443 457 .form-control{
444 458 border: none;
... ...
src/v1.1/player.html
... ... @@ -39,9 +39,9 @@
39 39  
40 40 </head>
41 41 <body>
42   - <div class="programing">
  42 + <div class="programing play-page">
43 43 <!-- 控制条 -->
44   - <div class="record-title">
  44 + <div class="record-title" style="display: none;">
45 45 <ul id="recordertab" class="nav nav-tabs pull-left">
46 46 <li class="active" style="display: none;">
47 47 <a href="#recordzone" data-toggle="tab">
... ... @@ -139,9 +139,12 @@
139 139 <div id="playFooter">
140 140 <div class="" id="audioWrap">
141 141 <button class="play-code" style="display: none;">
142   - <img src="../img/ideicon/play.svg" alt="">
  142 + <img src="../img/play.svg" alt="">
143 143 <!-- <i class="icon iconfont icon-play"></i> -->
144 144 </button>
  145 + <button class="pause-play-code" style="display: none;">
  146 + <img src="../img/pause.svg" alt="">
  147 + </button>
145 148 </div>
146 149 </div>
147 150 </div>
... ...