Commit 69ae38c8743e0e23346c81a133114860874e12aa

Authored by ykxie
1 parent 84b67ac0

delete some code

src/js/gbreplayer.js
@@ -225,21 +225,6 @@ $(function(){ @@ -225,21 +225,6 @@ $(function(){
225 $linechardisplay.val(pos.line + ',' + pos.ch); 225 $linechardisplay.val(pos.line + ',' + pos.ch);
226 } 226 }
227 }); 227 });
228 -  
229 - // if(preload){  
230 - // identityService.findTutorialReplayByCRPID(global_tutorialid, {  
231 - // callback:function(gbdata){  
232 - // //重置代码为播放完成状态  
233 - // GBCodePlayBack.jseditor.setValue(gbdata.javascript);  
234 - // GBCodePlayBack.csseditor.setValue(gbdata.css);  
235 - // GBCodePlayBack.htmleditor.setValue(gbdata.html);  
236 -  
237 - // GBCodePlayBack.jseditor.refresh();  
238 - // GBCodePlayBack.csseditor.refresh();  
239 - // GBCodePlayBack.htmleditor.refresh();  
240 - // }  
241 - // });  
242 - // }  
243 228
244 /* 判断使用的代码模式 */ 229 /* 判断使用的代码模式 */
245 var whichmode = $('#htmlbutton').data('languageid'); 230 var whichmode = $('#htmlbutton').data('languageid');
@@ -855,53 +840,6 @@ $(function(){ @@ -855,53 +840,6 @@ $(function(){
855 $this.addClass('btn-primary').siblings().removeClass('btn-primary'); 840 $this.addClass('btn-primary').siblings().removeClass('btn-primary');
856 841
857 var whicheditor = $this.data('editorname'); 842 var whicheditor = $this.data('editorname');
858 -  
859 - // if(whicheditor === 'html'){  
860 - // $('#recordertab a#relatedcode').trigger('click');  
861 -  
862 - // var cm = $('#HTMLeditor').next('.CodeMirror');  
863 - // cm.find('.CodeMirror-gutter-text').addClass('cmgutter');  
864 - // cm.height(GBCodePlayBack.codemirrorheight).siblings().height(0);  
865 -  
866 - // var cm = $('#HTMLplayer').next('.CodeMirror');  
867 - // cm.height(GBCodePlayBack.codemirrorheight).siblings().height(0);  
868 -  
869 - // $('#transcript_editor').text('编辑器:' + whicheditor).data('editor',whicheditor);  
870 - // }else if(whicheditor === 'css'){  
871 - // $('#recordertab a#relatedcode').trigger('click');  
872 -  
873 - // var cm = $('#CSSeditor').next('.CodeMirror');  
874 - // cm.find('.CodeMirror-gutter-text').addClass('cmgutter');  
875 -  
876 - // cm.height(GBCodePlayBack.codemirrorheight).siblings().height(0);  
877 -  
878 - // var cm = $('#CSSplayer').next('.CodeMirror');  
879 - // cm.height(GBCodePlayBack.codemirrorheight).siblings().height(0);  
880 -  
881 - // $('#transcript_editor').text('编辑器:' + whicheditor).data('editor',whicheditor);  
882 - // }else if(whicheditor === 'js'){  
883 - // $('#recordertab a#relatedcode').trigger('click');  
884 -  
885 - // var cm = $('#JSeditor').next('.CodeMirror');  
886 - // cm.find('.CodeMirror-gutter-text').addClass('cmgutter');  
887 - // cm.height(GBCodePlayBack.codemirrorheight).siblings().height(0);  
888 -  
889 -  
890 - // var cm = $('#JSplayer').next('.CodeMirror');  
891 - // cm.height(GBCodePlayBack.codemirrorheight).siblings().height(0);  
892 -  
893 - // $('#transcript_editor').text('编辑器:' + whicheditor).data('editor',whicheditor);  
894 - // }else{  
895 - // $('#recordertab a#relatedcode').trigger('click');  
896 -  
897 - // if($(window).width()>992){  
898 - // $('#recordzone').find('.CodeMirror').height(GBCodePlayBack.codemirrorheight/3).find('.CodeMirror-gutter-text').removeClass('cmgutter');  
899 - // $('#replayzone').find('.CodeMirror').height(GBCodePlayBack.codemirrorheight/3).find('.CodeMirror-gutter-text').removeClass('cmgutter');  
900 - // }else{  
901 - // $('#recordzone').find('.CodeMirror').height(GBCodePlayBack.codemirrorheight).find('.CodeMirror-gutter-text').removeClass('cmgutter');  
902 - // $('#replayzone').find('.CodeMirror').height(GBCodePlayBack.codemirrorheight).find('.CodeMirror-gutter-text').removeClass('cmgutter');  
903 - // }  
904 - // }  
905 843
906 /*保证编辑器都尺寸自动变化(包括滚动条)*/ 844 /*保证编辑器都尺寸自动变化(包括滚动条)*/
907 if(typeof GBCodePlayBack.htmleditor !=='undefined'&&typeof GBCodePlayBack.csseditor!=='undefined'&&typeof GBCodePlayBack.jseditor!=='undefined'){ 845 if(typeof GBCodePlayBack.htmleditor !=='undefined'&&typeof GBCodePlayBack.csseditor!=='undefined'&&typeof GBCodePlayBack.jseditor!=='undefined'){
@@ -1545,35 +1483,6 @@ $(function(){ @@ -1545,35 +1483,6 @@ $(function(){
1545 setTimeout(function(){$('#readonly').trigger('click');},1500); 1483 setTimeout(function(){$('#readonly').trigger('click');},1500);
1546 setTimeout(function(){$('#readonly').popover('destroy');}, 5000); 1484 setTimeout(function(){$('#readonly').popover('destroy');}, 5000);
1547 } 1485 }
1548 -  
1549 - if(GBCodePlayBack.continue_recording){  
1550 - var continue_js = GBCodePlayBack.jsplayereditor.getValue(),  
1551 - continue_css = GBCodePlayBack.cssplayereditor.getValue(),  
1552 - continue_html = GBCodePlayBack.htmlplayereditor.getValue();  
1553 -  
1554 - GBCodePlayBack.recording_status = 0; //禁用录制  
1555 - GBCodePlayBack.htmleditor.setValue(continue_html);  
1556 - GBCodePlayBack.csseditor.setValue(continue_css);  
1557 - GBCodePlayBack.jseditor.setValue(continue_js);  
1558 -  
1559 - GBCodePlayBack.jseditor.refresh();  
1560 - GBCodePlayBack.csseditor.refresh();  
1561 - GBCodePlayBack.htmleditor.refresh();  
1562 -  
1563 - GBCodePlayBack.recording_status = 1; //启用录制  
1564 -  
1565 - GBCodePlayBack.continue_recording = 0;  
1566 -  
1567 - GBCodePlayBack.speed = 1;  
1568 -  
1569 - $('#gbloading').addClass('hidden');  
1570 -  
1571 - if(!$('#autorun').data("autorun")){  
1572 - $('#autorun').trigger('click');  
1573 - }  
1574 -  
1575 - setInterval(function(){autoSaveRecording(GBCodePlayBack.records)}, 5000);  
1576 - }  
1577 } 1486 }
1578 1487
1579 if(GBCodePlayBack.excercise_triggertotal === GBCodePlayBack.excercise_records.length){ 1488 if(GBCodePlayBack.excercise_triggertotal === GBCodePlayBack.excercise_records.length){
@@ -1647,7 +1556,6 @@ $(function(){ @@ -1647,7 +1556,6 @@ $(function(){
1647 recorder = rec; 1556 recorder = rec;
1648 recorder.start(); 1557 recorder.start();
1649 GBCodePlayBack.recordinit(); 1558 GBCodePlayBack.recordinit();
1650 - getAutoSaveRecording();  
1651 timer.init($recording_time); 1559 timer.init($recording_time);
1652 } 1560 }
1653 },1000); 1561 },1000);
@@ -1657,11 +1565,10 @@ $(function(){ @@ -1657,11 +1565,10 @@ $(function(){
1657 }else{ 1565 }else{
1658 $('.record-before').hide(); 1566 $('.record-before').hide();
1659 GBCodePlayBack.recordinit(); 1567 GBCodePlayBack.recordinit();
1660 - getAutoSaveRecording();  
1661 timer.init($recording_time); 1568 timer.init($recording_time);
1662 } 1569 }
1663 1570
1664 - /* 判断是否启动record */ 1571 +
1665 1572
1666 1573
1667 var htmlhlLine = null, 1574 var htmlhlLine = null,
@@ -1670,7 +1577,6 @@ $(function(){ @@ -1670,7 +1577,6 @@ $(function(){
1670 1577
1671 function processChangeObject(playbackcm, obj){ 1578 function processChangeObject(playbackcm, obj){
1672 for(var i=0;i<obj.text.length;i++){ 1579 for(var i=0;i<obj.text.length;i++){
1673 -  
1674 /* 设置鼠标行标示 */ 1580 /* 设置鼠标行标示 */
1675 if(playbackcm.getTextArea().id==="HTMLplayer"){ 1581 if(playbackcm.getTextArea().id==="HTMLplayer"){
1676 if(htmlhlLine!==null){ 1582 if(htmlhlLine!==null){
@@ -1729,107 +1635,7 @@ $(function(){ @@ -1729,107 +1635,7 @@ $(function(){
1729 ); 1635 );
1730 } 1636 }
1731 } 1637 }
1732 -  
1733 - //计算TTS阅读时间  
1734 - function calculateReading(transcripts){  
1735 - var len = transcripts.length, time = (Math.ceil(len/5))*1500;  
1736 - if(time<3000) time = 3000;  
1737 - return time;  
1738 - }  
1739 -  
1740 - /* 自动保存jstorage */  
1741 - function autoSaveRecording(records){  
1742 - $.jStorage.set("gb_autosave_recording", records);  
1743 - }  
1744 -  
1745 - function getAutoSaveRecording(){  
1746 - var recordmodal = $('#startRecordModal');  
1747 - if(recordmodal.length){  
1748 - var _recordarray = $.jStorage.get("gb_autosave_recording") || [];  
1749 - if(_recordarray.length){  
1750 - recordmodal.find('.modal-footer').append('<button id="continue_recording" class="btn btn-success"><span class="glyphicon glyphicon-exclamation-sign"></span>&nbsp;继续录制</button>');  
1751 - recordmodal.find('#startrecord_desc').html('<small class="text-primary"><i class="glyphicon glyphicon-exclamation-sign"></i>&nbsp;发现尚未保存的代码录制,需继续录制请点击“继续录制”按钮</div>');  
1752 - }  
1753 - }  
1754 -  
1755 - $('#continue_recording').click(function(){  
1756 - var _langid = $.jStorage.get("gb_autosave_langid") || 0;  
1757 -  
1758 - if(_langid!==35){  
1759 - if(_langid === 10){  
1760 - $('#htmlbutton').data('languageid',10).html("JAVA").trigger('click');  
1761 - GBCodePlayBack.htmleditor.setOption('mode','text/x-java');  
1762 - GBCodePlayBack.htmlplayereditor.setOption('mode','text/x-java');  
1763 - }else if(_langid === 43){  
1764 - $('#htmlbutton').data('languageid',43).html("Objective-c").trigger('click');  
1765 - GBCodePlayBack.htmleditor.setOption('mode','text/x-csrc');  
1766 - GBCodePlayBack.htmlplayereditor.setOption('mode','text/x-csrc');  
1767 - }else if(_langid === 11){  
1768 - $('#htmlbutton').data('languageid',11).html("C").trigger('click');  
1769 - GBCodePlayBack.htmleditor.setOption('mode','text/x-csrc');  
1770 - GBCodePlayBack.htmlplayereditor.setOption('mode','text/x-csrc');  
1771 - }else if(_langid === 82){  
1772 - $('#htmlbutton').data('languageid',82).html("C++").trigger('click');  
1773 - GBCodePlayBack.htmleditor.setOption('mode','text/x-c++src');  
1774 - GBCodePlayBack.htmlplayereditor.setOption('mode','text/x-c++src');  
1775 - }else if(_langid === 29){  
1776 - $('#htmlbutton').data('languageid',29).html("PHP").trigger('click');  
1777 - GBCodePlayBack.htmleditor.setOption('mode','application/x-httpd-php');  
1778 - GBCodePlayBack.htmlplayereditor.setOption('mode','application/x-httpd-php');  
1779 - }  
1780 -  
1781 -  
1782 - $('#fontendrun').addClass('hidden');  
1783 - $('#comprunbtngrp').html('<button id="comprun" type="button" data-style="expand-right" class="btn btn-primary ladda-button" title="编译并运行代码"><span class="glyphicon glyphicon-cog"></span>&nbsp;编译&运行</button>');  
1784 -  
1785 - $('#ifrcontainer').addClass('hidden');  
1786 - $('#cmprun-output').removeClass('hidden');  
1787 -  
1788 - $('#frontenttools').remove();  
1789 - $('#allbutton').remove();  
1790 - $('#cssbutton').remove();  
1791 - $('#jsbutton').remove();  
1792 -  
1793 - GBCodePlayBack.autorun=0;  
1794 - }  
1795 -  
1796 - var _recordarray = $.jStorage.get("gb_autosave_recording") || [];  
1797 - GBCodePlayBack.records = _recordarray;  
1798 - GBCodePlayBack.continue_recording=1;  
1799 - GBCodePlayBack.speed=8;  
1800 - if($('#autorun').data("autorun")){  
1801 - $('#autorun').trigger('click');  
1802 - }  
1803 - $('#gbloading').removeClass('hidden');  
1804 - $('#startRecordModal').modal('hide');  
1805 - $("#replay").trigger('click');  
1806 - });  
1807 -  
1808 - $('#select_type_btn').click(function(){  
1809 1638
1810 -  
1811 - $.jStorage.deleteKey("gb_autosave_recording");  
1812 - setInterval(function(){autoSaveRecording(GBCodePlayBack.records)}, 5000);  
1813 - });  
1814 - }  
1815 -  
1816 -  
1817 - $('.record-back').click(function(){  
1818 - $(window).unbind('beforeunload');  
1819 - window.close();  
1820 - })  
1821 -  
1822 -  
1823 - $('#coverpreview').on('click','.removeimg',function(){  
1824 - $(this).hide().next().remove();  
1825 - });  
1826 -  
1827 - if(document.URL.indexOf('index.htm')>=0||document.URL.indexOf('rtrecordtutorial.htm')>=0){  
1828 - }else{  
1829 -  
1830 - $(window).unbind('beforeunload');  
1831 - }  
1832 -  
1833 1639
1834 function selectLang(langid){ 1640 function selectLang(langid){
1835 switch (langid) { 1641 switch (langid) {
src/player.html
@@ -59,12 +59,6 @@ @@ -59,12 +59,6 @@
59 59
60 </head> 60 </head>
61 <body> 61 <body>
62 -<!-- <div class="real-program-title">  
63 - <div class="back">  
64 - <i class="gxbrecording record-back" style="color: #1FB6FF"> 返回课程</i>  
65 - <span>| 我的课程</span>  
66 - </div>  
67 - </div> -->  
68 <div id="player"> 62 <div id="player">
69 <div class="real-program-content player"> 63 <div class="real-program-content player">
70 <div class="row"> 64 <div class="row">