Commit b13b4f7d79862a28b8b9bdd87170c0c3507aaa76

Authored by 张光辉
1 parent 31bdb910

修正一些问题

.idea/workspace.xml
... ... @@ -20,40 +20,7 @@
20 20 <favorites_list name="programming" />
21 21 </component>
22 22 <component name="FileEditorManager">
23   - <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
24   - <file leaf-file-name="Dir.js" pinned="false" current-in-tab="false">
25   - <entry file="file://$PROJECT_DIR$/src/gxb-ide/Dir.js">
26   - <provider selected="true" editor-type-id="text-editor">
27   - <state relative-caret-position="0">
28   - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
29   - <folding>
30   - <element signature="n#!!doc" expanded="true" />
31   - </folding>
32   - </state>
33   - </provider>
34   - </entry>
35   - </file>
36   - <file leaf-file-name="Ide.js" pinned="false" current-in-tab="false">
37   - <entry file="file://$PROJECT_DIR$/src/gxb-ide/Ide.js">
38   - <provider selected="true" editor-type-id="text-editor">
39   - <state relative-caret-position="323">
40   - <caret line="19" column="29" selection-start-line="19" selection-start-column="29" selection-end-line="19" selection-end-column="29" />
41   - <folding />
42   - </state>
43   - </provider>
44   - </entry>
45   - </file>
46   - <file leaf-file-name="README.md" pinned="false" current-in-tab="true">
47   - <entry file="file://$PROJECT_DIR$/README.md">
48   - <provider selected="true" editor-type-id="text-editor">
49   - <state relative-caret-position="170">
50   - <caret line="14" column="3" selection-start-line="14" selection-start-column="3" selection-end-line="14" selection-end-column="3" />
51   - <folding />
52   - </state>
53   - </provider>
54   - </entry>
55   - </file>
56   - </leaf>
  23 + <leaf SIDE_TABS_SIZE_LIMIT_KEY="300" />
57 24 </component>
58 25 <component name="Git.Settings">
59 26 <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
... ... @@ -73,7 +40,8 @@
73 40 <handled-path value="$PROJECT_DIR$/node_modules" />
74 41 </component>
75 42 <component name="ProjectFrameBounds">
76   - <option name="y" value="23" />
  43 + <option name="x" value="-1" />
  44 + <option name="y" value="28" />
77 45 <option name="width" value="1232" />
78 46 <option name="height" value="730" />
79 47 </component>
... ... @@ -103,6 +71,8 @@
103 71 </navigator>
104 72 <panes>
105 73 <pane id="Scratches" />
  74 + <pane id="PackagesPane" />
  75 + <pane id="Scope" />
106 76 <pane id="ProjectPane">
107 77 <subPane>
108 78 <PATH>
... ... @@ -173,8 +143,6 @@
173 143 </PATH>
174 144 </subPane>
175 145 </pane>
176   - <pane id="PackagesPane" />
177   - <pane id="Scope" />
178 146 </panes>
179 147 </component>
180 148 <component name="PropertiesComponent">
... ... @@ -616,15 +584,16 @@
616 584 <updated>1521082406200</updated>
617 585 <workItem from="1521082408104" duration="1336000" />
618 586 <workItem from="1521277481140" duration="4000" />
  587 + <workItem from="1521536715500" duration="9000" />
619 588 </task>
620 589 <servers />
621 590 </component>
622 591 <component name="TimeTrackingManager">
623   - <option name="totallyTimeSpent" value="1340000" />
  592 + <option name="totallyTimeSpent" value="1349000" />
624 593 </component>
625 594 <component name="ToolWindowManager">
626   - <frame x="0" y="23" width="1232" height="730" extended-state="0" />
627   - <editor active="true" />
  595 + <frame x="-1" y="28" width="1232" height="730" extended-state="0" />
  596 + <editor active="false" />
628 597 <layout>
629 598 <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
630 599 <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
... ... @@ -637,7 +606,7 @@
637 606 <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32843137" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
638 607 <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
639 608 <window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
640   - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24537815" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
  609 + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2184874" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
641 610 <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
642 611 <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
643 612 <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
... ... @@ -674,6 +643,10 @@
674 643 <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
675 644 <folding>
676 645 <element signature="n#!!doc" expanded="true" />
  646 + <marker date="1521536646000" expanded="true" signature="1723:2457" ph="{...}" />
  647 + <marker date="1521536646000" expanded="true" signature="2057:2457" ph="{...}" />
  648 + <marker date="1521536646000" expanded="true" signature="2082:2457" ph="{&quot;type&quot;: &quot;GET&quot;...}" />
  649 + <marker date="1521536646000" expanded="true" signature="2282:2457" ph="{...}" />
677 650 </folding>
678 651 </state>
679 652 </provider>
... ... @@ -700,6 +673,10 @@
700 673 <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
701 674 <folding>
702 675 <element signature="n#!!doc" expanded="true" />
  676 + <marker date="1521536646000" expanded="true" signature="1723:2457" ph="{...}" />
  677 + <marker date="1521536646000" expanded="true" signature="2057:2457" ph="{...}" />
  678 + <marker date="1521536646000" expanded="true" signature="2082:2457" ph="{&quot;type&quot;: &quot;GET&quot;...}" />
  679 + <marker date="1521536646000" expanded="true" signature="2282:2457" ph="{...}" />
703 680 </folding>
704 681 </state>
705 682 </provider>
... ... @@ -714,11 +691,41 @@
714 691 </entry>
715 692 <entry file="file://$PROJECT_DIR$/README.md">
716 693 <provider selected="true" editor-type-id="text-editor">
  694 + <state relative-caret-position="0">
  695 + <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  696 + <folding />
  697 + </state>
  698 + </provider>
  699 + </entry>
  700 + <entry file="file://$PROJECT_DIR$/README.md">
  701 + <provider selected="true" editor-type-id="text-editor">
717 702 <state relative-caret-position="170">
718 703 <caret line="14" column="3" selection-start-line="14" selection-start-column="3" selection-end-line="14" selection-end-column="3" />
719 704 <folding />
720 705 </state>
721 706 </provider>
722 707 </entry>
  708 + <entry file="file://$PROJECT_DIR$/src/gxb-ide/Ide.js">
  709 + <provider selected="true" editor-type-id="text-editor">
  710 + <state relative-caret-position="170">
  711 + <caret line="10" column="26" selection-start-line="10" selection-start-column="26" selection-end-line="10" selection-end-column="26" />
  712 + <folding />
  713 + </state>
  714 + </provider>
  715 + </entry>
  716 + <entry file="file://$PROJECT_DIR$/src/gxb-ide/Dir.js">
  717 + <provider selected="true" editor-type-id="text-editor">
  718 + <state relative-caret-position="17">
  719 + <caret line="5" column="0" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
  720 + <folding>
  721 + <element signature="n#!!doc" expanded="true" />
  722 + <marker date="1521536646000" expanded="true" signature="1723:2457" ph="{...}" />
  723 + <marker date="1521536646000" expanded="true" signature="2057:2457" ph="{...}" />
  724 + <marker date="1521536646000" expanded="true" signature="2082:2457" ph="{&quot;type&quot;: &quot;GET&quot;...}" />
  725 + <marker date="1521536646000" expanded="true" signature="2282:2457" ph="{...}" />
  726 + </folding>
  727 + </state>
  728 + </provider>
  729 + </entry>
723 730 </component>
724 731 </project>
725 732 \ No newline at end of file
... ...
dist/css/ide.css
... ... @@ -407,7 +407,7 @@ html, body {
407 407 .pause-shodow .compile-reslut .btn {
408 408 margin-right: 8px; }
409 409  
410   -.compile-reslut, .re-reslut {
  410 +.compile-reslut, .re-reslut, .mustrecord-reslut {
411 411 position: absolute;
412 412 height: 200px;
413 413 width: 400px;
... ... @@ -415,14 +415,14 @@ html, body {
415 415 top: 15%;
416 416 left: 50%;
417 417 transform: translate(-50%); }
418   - .compile-reslut .tip-header, .compile-reslut .tip-footer, .re-reslut .tip-header, .re-reslut .tip-footer {
  418 + .compile-reslut .tip-header, .compile-reslut .tip-footer, .re-reslut .tip-header, .re-reslut .tip-footer, .mustrecord-reslut .tip-header, .mustrecord-reslut .tip-footer {
419 419 width: 100%;
420 420 padding: 8px 8px;
421 421 background-color: #F5F6FA; }
422   - .compile-reslut .tip-content, .re-reslut .tip-content {
  422 + .compile-reslut .tip-content, .re-reslut .tip-content, .mustrecord-reslut .tip-content {
423 423 padding: 40px;
424 424 line-height: 1.7; }
425   - .compile-reslut .tip-footer, .re-reslut .tip-footer {
  425 + .compile-reslut .tip-footer, .re-reslut .tip-footer, .mustrecord-reslut .tip-footer {
426 426 position: absolute;
427 427 bottom: 0;
428 428 text-align: right; }
... ... @@ -505,7 +505,7 @@ html, body {
505 505 margin-left: 48px;
506 506 outline: none; }
507 507  
508   -.confirm-tip {
  508 +.confirm-tip, .mustrecord-tip {
509 509 position: absolute;
510 510 width: 100%;
511 511 height: 100%;
... ...
dist/css/main.css
... ... @@ -279,7 +279,7 @@ html, body {
279 279 .pause-shodow .compile-reslut .btn {
280 280 margin-right: 8px; }
281 281  
282   -.compile-reslut, .re-reslut {
  282 +.compile-reslut, .re-reslut, .mustrecord-reslut {
283 283 position: absolute;
284 284 height: 200px;
285 285 width: 400px;
... ... @@ -287,14 +287,14 @@ html, body {
287 287 top: 15%;
288 288 left: 50%;
289 289 transform: translate(-50%); }
290   - .compile-reslut .tip-header, .compile-reslut .tip-footer, .re-reslut .tip-header, .re-reslut .tip-footer {
  290 + .compile-reslut .tip-header, .compile-reslut .tip-footer, .re-reslut .tip-header, .re-reslut .tip-footer, .mustrecord-reslut .tip-header, .mustrecord-reslut .tip-footer {
291 291 width: 100%;
292 292 padding: 8px 8px;
293 293 background-color: #F5F6FA; }
294   - .compile-reslut .tip-content, .re-reslut .tip-content {
  294 + .compile-reslut .tip-content, .re-reslut .tip-content, .mustrecord-reslut .tip-content {
295 295 padding: 40px;
296 296 line-height: 1.7; }
297   - .compile-reslut .tip-footer, .re-reslut .tip-footer {
  297 + .compile-reslut .tip-footer, .re-reslut .tip-footer, .mustrecord-reslut .tip-footer {
298 298 position: absolute;
299 299 bottom: 0;
300 300 text-align: right; }
... ... @@ -377,7 +377,7 @@ html, body {
377 377 margin-left: 48px;
378 378 outline: none; }
379 379  
380   -.confirm-tip {
  380 +.confirm-tip, .mustrecord-tip {
381 381 position: absolute;
382 382 width: 100%;
383 383 height: 100%;
... ...
dist/gxb-ide/Iterm.js
... ... @@ -27,6 +27,14 @@
27 27 $(document).on('focus', '#runtimeArgus', function(){ })
28 28 },
29 29 compile: function(){
  30 +
  31 + if(autoScore && !window.recordStartedOnce) {
  32 + $('.mustrecord-tip').show().find('.btn-success').off('click').on('click', function(){
  33 + $(this).parents('.mustrecord-tip').hide();
  34 + });
  35 + return;
  36 + }
  37 +
30 38 console.log('compile====')
31 39 if (_languageid == 35) {
32 40 if (CodingEditer.isHanld == 0) {
... ...
dist/gxb-ide/ToolBox.js
... ... @@ -4,8 +4,7 @@
4 4 '<audio id="audio"></audio>'+
5 5 '</div>'+
6 6 '<div class="ctrl-wrap">'+
7   - '<div class="tool-item" id="prepare-recording" data-toggle="tooltip" data-placement="top" title="点此开始录制"><img src="" alt="" /></div>'+
8   - '<div class="tool-item" id="start-recording" data="1" data-toggle="tooltip" data-placement="top" title="<span class=\'tooltip-content-large\'>点此开始录制</span>"><img src="" alt="" /></div>'+
  7 + '<div class="tool-item" id="start-recording" data="1"><span class="start-recording-tips">点此开始录制</span><img src="" alt="" /></div>'+
9 8 '<div class="tool-item" id="stop-recording" data="1" data-toggle="tooltip" data-placement="top" title="结束录制"><img src="" alt="" /></div>'+
10 9 '<div class="tool-item" id="re-recoding" data="1" data-toggle="tooltip" data-placement="top" title="重新录制"><img src="" alt="" /></div>'+
11 10 '</div>'+
... ... @@ -90,6 +89,9 @@
90 89 $('#re-sure').on('click', function(){ _this.reSure(); })
91 90 $('#re-cancel').on('click', function(){ _this.reCancel(); })
92 91 $('.play-code').on('click', function(){ _this.playerPage(); })
  92 + window.onbeforeunload = function() {
  93 + return '尚未保存,关闭将丢失本次操作内容,确定关闭?'
  94 + };
93 95 },
94 96 startRecording: function(callback){
95 97 console.log(this.options.userId);
... ... @@ -294,6 +296,7 @@
294 296 $('#cancel').prop("disabled", false);
295 297  
296 298 window.opener.postMessage(_data, _source);
  299 + window.onbeforeunload = null;
297 300 window.close();
298 301 },
299 302 error: function() {
... ... @@ -312,9 +315,6 @@
312 315 },
313 316 cancel: function(){
314 317 console.log('cancel');
315   - $(window).unbind('beforeunload', function() {
316   - return '确认退出? 将不保存你的代码';
317   - });
318 318 window.close();
319 319 },
320 320 /*
... ...
dist/gxb-ide/toolBox.css
... ... @@ -22,6 +22,53 @@
22 22 .tool-item img{
23 23 width: 48px;
24 24 }
  25 +@keyframes jump {
  26 + from {
  27 + transform: translateY(-50%);
  28 + -webkit-transform: translateY(-50%);
  29 + }
  30 + to {
  31 + transform: translateY(0);
  32 + -webkit-transform: translateY(0);
  33 + }
  34 +}
  35 +#start-recording {
  36 + position: relative;
  37 +}
  38 +#start-recording .start-recording-tips {
  39 + position: absolute;
  40 + background: #fff;
  41 + border: 1px solid #1FB6FF;
  42 + color: #1FB6FF;
  43 + bottom: 100%;
  44 + left: 50%;
  45 + margin-left: -100px;
  46 + width: 200px;
  47 + line-height: 50px;
  48 + font-size: 18px;
  49 + /*font-weight: bold;*/
  50 + text-align: center;
  51 + border-radius: 6px;
  52 + animation: jump ease 1s infinite;
  53 + -webkit-animation: jump ease 1s infinite;
  54 + pointer-events: none;
  55 +}
  56 +#start-recording .start-recording-tips:before, #start-recording .start-recording-tips:after {
  57 + position: absolute;
  58 + left: 50%;
  59 + top: 100%;
  60 + margin-left: -10px;
  61 + content: "";
  62 + border: 10px solid transparent;
  63 + border-bottom: 0;
  64 + border-top: 10px solid #1FB6FF;
  65 +}
  66 +#start-recording .start-recording-tips:after {
  67 + margin-top: -1px;
  68 + border-top-color: #fff;
  69 +}
  70 +
  71 +
25 72 .recording-time{
26 73 float: left;
27 74 height: 60px;
... ...
dist/js/c.js
... ... @@ -59,6 +59,7 @@ $(function(){
59 59 questionId: _questionId,
60 60 autoScore: _autoScore,
61 61 startCallback: function(){
  62 + window.recordStartedOnce = true;
62 63 // 禁止重命名
63 64 setTimeout(function(){
64 65 DirSetting.edit.showRenameBtn = false;
... ...
dist/scss/main.scss
... ... @@ -329,7 +329,7 @@ html, body{
329 329 }
330 330 }
331 331  
332   -.compile-reslut, .re-reslut{
  332 +.compile-reslut, .re-reslut , .mustrecord-reslut{
333 333 position: absolute;
334 334 height: 200px;
335 335 width: 400px;
... ... @@ -453,7 +453,7 @@ html, body{
453 453 .play-code img{
454 454 }
455 455  
456   -.confirm-tip{
  456 +.confirm-tip, .mustrecord-tip {
457 457 position: absolute;
458 458 width: 100%;
459 459 height: 100%;
... ...
dist/v1.1/index.html
... ... @@ -237,6 +237,20 @@
237 237 </div>
238 238 </div>
239 239 </div>
  240 + <div class="mustrecord-tip" style="display: none;">
  241 + <div class="mustrecord-reslut">
  242 + <div class="tip-header">
  243 + <span>提示</span>
  244 + </div>
  245 +
  246 + <div class="tip-content">
  247 + <p>请先点击开始录制按钮录制代码!</p>
  248 + </div>
  249 + <div class="tip-footer">
  250 + <button class="btn btn-success btn-sm">确定</button>
  251 + </div>
  252 + </div>
  253 + </div>
240 254 </div>
241 255  
242 256 <script src="../js/jquery-1.7.1.js"></script>
... ...
src/css/ide.css
... ... @@ -407,7 +407,7 @@ html, body {
407 407 .pause-shodow .compile-reslut .btn {
408 408 margin-right: 8px; }
409 409  
410   -.compile-reslut, .re-reslut {
  410 +.compile-reslut, .re-reslut, .mustrecord-reslut {
411 411 position: absolute;
412 412 height: 200px;
413 413 width: 400px;
... ... @@ -415,14 +415,14 @@ html, body {
415 415 top: 15%;
416 416 left: 50%;
417 417 transform: translate(-50%); }
418   - .compile-reslut .tip-header, .compile-reslut .tip-footer, .re-reslut .tip-header, .re-reslut .tip-footer {
  418 + .compile-reslut .tip-header, .compile-reslut .tip-footer, .re-reslut .tip-header, .re-reslut .tip-footer, .mustrecord-reslut .tip-header, .mustrecord-reslut .tip-footer {
419 419 width: 100%;
420 420 padding: 8px 8px;
421 421 background-color: #F5F6FA; }
422   - .compile-reslut .tip-content, .re-reslut .tip-content {
  422 + .compile-reslut .tip-content, .re-reslut .tip-content, .mustrecord-reslut .tip-content {
423 423 padding: 40px;
424 424 line-height: 1.7; }
425   - .compile-reslut .tip-footer, .re-reslut .tip-footer {
  425 + .compile-reslut .tip-footer, .re-reslut .tip-footer, .mustrecord-reslut .tip-footer {
426 426 position: absolute;
427 427 bottom: 0;
428 428 text-align: right; }
... ... @@ -505,7 +505,7 @@ html, body {
505 505 margin-left: 48px;
506 506 outline: none; }
507 507  
508   -.confirm-tip {
  508 +.confirm-tip, .mustrecord-tip {
509 509 position: absolute;
510 510 width: 100%;
511 511 height: 100%;
... ...
src/css/main.css
... ... @@ -279,7 +279,7 @@ html, body {
279 279 .pause-shodow .compile-reslut .btn {
280 280 margin-right: 8px; }
281 281  
282   -.compile-reslut, .re-reslut {
  282 +.compile-reslut, .re-reslut, .mustrecord-reslut {
283 283 position: absolute;
284 284 height: 200px;
285 285 width: 400px;
... ... @@ -287,14 +287,14 @@ html, body {
287 287 top: 15%;
288 288 left: 50%;
289 289 transform: translate(-50%); }
290   - .compile-reslut .tip-header, .compile-reslut .tip-footer, .re-reslut .tip-header, .re-reslut .tip-footer {
  290 + .compile-reslut .tip-header, .compile-reslut .tip-footer, .re-reslut .tip-header, .re-reslut .tip-footer, .mustrecord-reslut .tip-header, .mustrecord-reslut .tip-footer {
291 291 width: 100%;
292 292 padding: 8px 8px;
293 293 background-color: #F5F6FA; }
294   - .compile-reslut .tip-content, .re-reslut .tip-content {
  294 + .compile-reslut .tip-content, .re-reslut .tip-content, .mustrecord-reslut .tip-content {
295 295 padding: 40px;
296 296 line-height: 1.7; }
297   - .compile-reslut .tip-footer, .re-reslut .tip-footer {
  297 + .compile-reslut .tip-footer, .re-reslut .tip-footer, .mustrecord-reslut .tip-footer {
298 298 position: absolute;
299 299 bottom: 0;
300 300 text-align: right; }
... ... @@ -377,7 +377,7 @@ html, body {
377 377 margin-left: 48px;
378 378 outline: none; }
379 379  
380   -.confirm-tip {
  380 +.confirm-tip, .mustrecord-tip {
381 381 position: absolute;
382 382 width: 100%;
383 383 height: 100%;
... ...
src/gxb-ide/Iterm.js
... ... @@ -27,6 +27,14 @@
27 27 $(document).on('focus', '#runtimeArgus', function(){ })
28 28 },
29 29 compile: function(){
  30 +
  31 + if(autoScore && !window.recordStartedOnce) {
  32 + $('.mustrecord-tip').show().find('.btn-success').off('click').on('click', function(){
  33 + $(this).parents('.mustrecord-tip').hide();
  34 + });
  35 + return;
  36 + }
  37 +
30 38 console.log('compile====')
31 39 if (_languageid == 35) {
32 40 if (CodingEditer.isHanld == 0) {
... ...
src/gxb-ide/ToolBox.js
... ... @@ -4,8 +4,7 @@
4 4 '<audio id="audio"></audio>'+
5 5 '</div>'+
6 6 '<div class="ctrl-wrap">'+
7   - '<div class="tool-item" id="prepare-recording" data-toggle="tooltip" data-placement="top" title="点此开始录制"><img src="" alt="" /></div>'+
8   - '<div class="tool-item" id="start-recording" data="1" data-toggle="tooltip" data-placement="top" title="<span class=\'tooltip-content-large\'>点此开始录制</span>"><img src="" alt="" /></div>'+
  7 + '<div class="tool-item" id="start-recording" data="1"><span class="start-recording-tips">点此开始录制</span><img src="" alt="" /></div>'+
9 8 '<div class="tool-item" id="stop-recording" data="1" data-toggle="tooltip" data-placement="top" title="结束录制"><img src="" alt="" /></div>'+
10 9 '<div class="tool-item" id="re-recoding" data="1" data-toggle="tooltip" data-placement="top" title="重新录制"><img src="" alt="" /></div>'+
11 10 '</div>'+
... ... @@ -90,6 +89,9 @@
90 89 $('#re-sure').on('click', function(){ _this.reSure(); })
91 90 $('#re-cancel').on('click', function(){ _this.reCancel(); })
92 91 $('.play-code').on('click', function(){ _this.playerPage(); })
  92 + window.onbeforeunload = function() {
  93 + return '尚未保存,关闭将丢失本次操作内容,确定关闭?'
  94 + };
93 95 },
94 96 startRecording: function(callback){
95 97 console.log(this.options.userId);
... ... @@ -294,6 +296,7 @@
294 296 $('#cancel').prop("disabled", false);
295 297  
296 298 window.opener.postMessage(_data, _source);
  299 + window.onbeforeunload = null;
297 300 window.close();
298 301 },
299 302 error: function() {
... ... @@ -312,9 +315,6 @@
312 315 },
313 316 cancel: function(){
314 317 console.log('cancel');
315   - $(window).unbind('beforeunload', function() {
316   - return '确认退出? 将不保存你的代码';
317   - });
318 318 window.close();
319 319 },
320 320 /*
... ...
src/gxb-ide/toolBox.css
... ... @@ -22,6 +22,53 @@
22 22 .tool-item img{
23 23 width: 48px;
24 24 }
  25 +@keyframes jump {
  26 + from {
  27 + transform: translateY(-50%);
  28 + -webkit-transform: translateY(-50%);
  29 + }
  30 + to {
  31 + transform: translateY(0);
  32 + -webkit-transform: translateY(0);
  33 + }
  34 +}
  35 +#start-recording {
  36 + position: relative;
  37 +}
  38 +#start-recording .start-recording-tips {
  39 + position: absolute;
  40 + background: #fff;
  41 + border: 1px solid #1FB6FF;
  42 + color: #1FB6FF;
  43 + bottom: 100%;
  44 + left: 50%;
  45 + margin-left: -100px;
  46 + width: 200px;
  47 + line-height: 50px;
  48 + font-size: 18px;
  49 + /*font-weight: bold;*/
  50 + text-align: center;
  51 + border-radius: 6px;
  52 + animation: jump ease 1s infinite;
  53 + -webkit-animation: jump ease 1s infinite;
  54 + pointer-events: none;
  55 +}
  56 +#start-recording .start-recording-tips:before, #start-recording .start-recording-tips:after {
  57 + position: absolute;
  58 + left: 50%;
  59 + top: 100%;
  60 + margin-left: -10px;
  61 + content: "";
  62 + border: 10px solid transparent;
  63 + border-bottom: 0;
  64 + border-top: 10px solid #1FB6FF;
  65 +}
  66 +#start-recording .start-recording-tips:after {
  67 + margin-top: -1px;
  68 + border-top-color: #fff;
  69 +}
  70 +
  71 +
25 72 .recording-time{
26 73 float: left;
27 74 height: 60px;
... ...
src/js/c.js
... ... @@ -59,6 +59,7 @@ $(function(){
59 59 questionId: _questionId,
60 60 autoScore: _autoScore,
61 61 startCallback: function(){
  62 + window.recordStartedOnce = true;
62 63 // 禁止重命名
63 64 setTimeout(function(){
64 65 DirSetting.edit.showRenameBtn = false;
... ...
src/scss/main.scss
... ... @@ -329,7 +329,7 @@ html, body{
329 329 }
330 330 }
331 331  
332   -.compile-reslut, .re-reslut{
  332 +.compile-reslut, .re-reslut , .mustrecord-reslut{
333 333 position: absolute;
334 334 height: 200px;
335 335 width: 400px;
... ... @@ -453,7 +453,7 @@ html, body{
453 453 .play-code img{
454 454 }
455 455  
456   -.confirm-tip{
  456 +.confirm-tip, .mustrecord-tip {
457 457 position: absolute;
458 458 width: 100%;
459 459 height: 100%;
... ...
src/v1.1/index.html
... ... @@ -237,6 +237,20 @@
237 237 </div>
238 238 </div>
239 239 </div>
  240 + <div class="mustrecord-tip" style="display: none;">
  241 + <div class="mustrecord-reslut">
  242 + <div class="tip-header">
  243 + <span>提示</span>
  244 + </div>
  245 +
  246 + <div class="tip-content">
  247 + <p>请先点击开始录制按钮录制代码!</p>
  248 + </div>
  249 + <div class="tip-footer">
  250 + <button class="btn btn-success btn-sm">确定</button>
  251 + </div>
  252 + </div>
  253 + </div>
240 254 </div>
241 255  
242 256 <script src="../js/jquery-1.7.1.js"></script>
... ...