Commit f8296751436092f4bd4695e04319d3904944b507
1 parent
6bd2092e
add web multifile
Showing
7 changed files
with
81 additions
and
41 deletions
src/gxb-ide/CodingEditer.js
| ... | ... | @@ -39,11 +39,11 @@ |
| 39 | 39 | // } |
| 40 | 40 | |
| 41 | 41 | var _css = "<style>" + css + "</style>"; |
| 42 | - var _script = "<script>" + js + "</script>"; | |
| 42 | + var _script = '<script type="text/javascript">' + js + "</script>"; | |
| 43 | 43 | |
| 44 | - var result = '<!DOCTYPE HTML><html><head>' + _css + '</head><body>' + html + '</body></html>'; | |
| 44 | + var result = '<!DOCTYPE HTML><html><head>' + _css + _script + '</head><body>' + html + '</body></html>'; | |
| 45 | 45 | |
| 46 | - result = result + _script; | |
| 46 | + // result = result + _script; | |
| 47 | 47 | |
| 48 | 48 | doc.open(); |
| 49 | 49 | doc.writeln(result); |
| ... | ... | @@ -312,7 +312,8 @@ |
| 312 | 312 | buildRecords(Dir.getCurrentEditor(em.getWrapperElement().getAttribute('id')), changeobj); |
| 313 | 313 | } |
| 314 | 314 | if (CodingEditer.isWeb) { |
| 315 | - CodingEditer.webResult(_pauseValue[0], _pauseValue[1], _pauseValue[2]) | |
| 315 | + console.log(_pauseValue[2]) | |
| 316 | + // CodingEditer.webResult(_pauseValue[0], _pauseValue[1], _pauseValue[2]) | |
| 316 | 317 | } |
| 317 | 318 | }, |
| 318 | 319 | onFocus: function(em) { | ... | ... |
src/gxb-ide/Iterm.js
| ... | ... | @@ -25,43 +25,46 @@ |
| 25 | 25 | $(document).on('focus', '#runtimeArgus', function(){ }) |
| 26 | 26 | }, |
| 27 | 27 | compile: function(){ |
| 28 | - var _this = this; | |
| 29 | - var el = document.querySelector('#CompileBtn'); | |
| 30 | - var userId = _this.options.userId; | |
| 31 | - // var languageId = _this.options.languageId; | |
| 32 | - var languageId = _this.options.languageId || Dir.languageid; | |
| 33 | - var role = getQuery('role'); | |
| 34 | - // alert("HHHHHHH") | |
| 35 | - | |
| 36 | - | |
| 37 | - // 判断是否录制走不同的逻辑 | |
| 38 | - if (!CodingEditer.isRcording) { | |
| 39 | - compileMode(el, userId, languageId) | |
| 28 | + if (_languageid == 35) { | |
| 29 | + var _pauseValue = CodingEditer.getCodeMirrorValue(); | |
| 30 | + CodingEditer.webResult(_pauseValue[0], _pauseValue[1], _pauseValue[2]) | |
| 40 | 31 | }else{ |
| 41 | - | |
| 42 | - if (_this.compileStatus && !_this.isCompile) { | |
| 43 | - $('#CompileBtn').removeClass('compile-btn').addClass('static-btn'); | |
| 44 | - Hourglass.pauseTimer(); // 暂停计时器 | |
| 45 | - if (role == 0) { | |
| 46 | - recorder.pause(); // 音频暂停 | |
| 47 | - } | |
| 48 | - | |
| 49 | - $('.compile-loading').show(); | |
| 50 | - $('.pause-shodow').show() | |
| 51 | - | |
| 52 | - // 编译时插入操作 | |
| 53 | - var treeNode = null; | |
| 54 | - var check_tree_time = new Date().getTime(); | |
| 55 | - CodingEditer.addRecord(treeNode, check_tree_time); | |
| 56 | - | |
| 57 | - _this.compileStatus = false; | |
| 58 | - isCompile = true; | |
| 59 | - | |
| 32 | + var _this = this; | |
| 33 | + var el = document.querySelector('#CompileBtn'); | |
| 34 | + var userId = _this.options.userId; | |
| 35 | + // var languageId = _this.options.languageId; | |
| 36 | + var languageId = _this.options.languageId || Dir.languageid; | |
| 37 | + var role = getQuery('role'); | |
| 38 | + | |
| 39 | + // 判断是否录制走不同的逻辑 | |
| 40 | + if (!CodingEditer.isRcording) { | |
| 60 | 41 | compileMode(el, userId, languageId) |
| 61 | - $('.contrl-shodow').show(); | |
| 42 | + }else{ | |
| 43 | + | |
| 44 | + if (_this.compileStatus && !_this.isCompile) { | |
| 45 | + $('#CompileBtn').removeClass('compile-btn').addClass('static-btn'); | |
| 46 | + Hourglass.pauseTimer(); // 暂停计时器 | |
| 47 | + if (role == 0) { | |
| 48 | + recorder.pause(); // 音频暂停 | |
| 49 | + } | |
| 50 | + | |
| 51 | + $('.compile-loading').show(); | |
| 52 | + $('.pause-shodow').show() | |
| 53 | + | |
| 54 | + // 编译时插入操作 | |
| 55 | + var treeNode = null; | |
| 56 | + var check_tree_time = new Date().getTime(); | |
| 57 | + CodingEditer.addRecord(treeNode, check_tree_time); | |
| 58 | + | |
| 59 | + _this.compileStatus = false; | |
| 60 | + isCompile = true; | |
| 61 | + | |
| 62 | + compileMode(el, userId, languageId) | |
| 63 | + $('.contrl-shodow').show(); | |
| 64 | + } | |
| 65 | + console.log('******************************' + languageId) | |
| 66 | + | |
| 62 | 67 | } |
| 63 | - console.log('******************************' + languageId) | |
| 64 | - | |
| 65 | 68 | } |
| 66 | 69 | }, |
| 67 | 70 | compileResult: function(data, value){ | ... | ... |
src/img/switch.png
0 → 100644
6.65 KB
src/js/c.js
| ... | ... | @@ -5,6 +5,24 @@ $(function(){ |
| 5 | 5 | var _languageid = getQuery('languageid'); |
| 6 | 6 | var _userId = getQuery('userId'); |
| 7 | 7 | var _role = getQuery('role'); |
| 8 | + var flag = true; | |
| 9 | + | |
| 10 | + if(_languageid == 35){ | |
| 11 | + $('.switch').show(); | |
| 12 | + $("#CompileBtn .ladda-label").html("手动运行") | |
| 13 | + }else{ | |
| 14 | + $("#CompileBtn .ladda-label").html("编译运行") | |
| 15 | + } | |
| 16 | + | |
| 17 | + $('.switch').on('click', function(){ | |
| 18 | + if(flag){ | |
| 19 | + $("#CompileBtn .ladda-label").html("自动运行") | |
| 20 | + flag = false; | |
| 21 | + }else{ | |
| 22 | + $("#CompileBtn .ladda-label").html("手动运行") | |
| 23 | + flag = true; | |
| 24 | + } | |
| 25 | + }) | |
| 8 | 26 | |
| 9 | 27 | // new一个基本IDE结构 |
| 10 | 28 | var ide = new GxbIde({ | ... | ... |
src/player.html
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | <meta charset="UTF-8"> |
| 5 | 5 | <!-- <meta name="renderer" content="webkit"> --> |
| 6 | 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui"> |
| 7 | - <title>互动编程</title> | |
| 7 | + <title>实景编程</title> | |
| 8 | 8 | <link rel="stylesheet" href="css/responsive/css/bootstrap.min.css"> |
| 9 | 9 | <link href="css/validationEngine.jquery.css" rel="stylesheet"> |
| 10 | 10 | <link href="css/codemirror.css" rel="stylesheet"> | ... | ... |
src/v1.1/index.html
| ... | ... | @@ -33,6 +33,21 @@ |
| 33 | 33 | .ladda-button .ladda-spinner{ |
| 34 | 34 | top: 0; |
| 35 | 35 | } |
| 36 | + .switch{ | |
| 37 | + padding: 3px 4px; | |
| 38 | + background: #FFF; | |
| 39 | + border: 1px solid #3ad5f5; | |
| 40 | + border-radius: 16px; | |
| 41 | + position: relative; | |
| 42 | + left: 22px; | |
| 43 | + color: #1FB6FF; | |
| 44 | + display: none; | |
| 45 | + } | |
| 46 | + .switch img{ | |
| 47 | + width: 16px; | |
| 48 | + vertical-align: middle; | |
| 49 | + padding-right: 2px; | |
| 50 | + } | |
| 36 | 51 | </style> |
| 37 | 52 | |
| 38 | 53 | |
| ... | ... | @@ -83,8 +98,11 @@ |
| 83 | 98 | <li><a href="#output" role="tab" data-toggle="tab" class="text">结果</a></li> |
| 84 | 99 | </ul> |
| 85 | 100 | <div class="pull-right func"> |
| 101 | + <button class="btn switch"> | |
| 102 | + <img src="../img/switch.png" alt=""> | |
| 103 | + </button> | |
| 86 | 104 | <button class="btn compile-btn" id="CompileBtn"> |
| 87 | - <span class="ladda-label">编译运行</span> | |
| 105 | + <span class="ladda-label"></span> | |
| 88 | 106 | </button> |
| 89 | 107 | <!-- <img src="../img/full-screen-icon.svg" alt=""> --> |
| 90 | 108 | <a id="full-screen" class="fb"> | ... | ... |
src/v1.1/player.html
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | <head> |
| 4 | 4 | <meta charset="UTF-8"> |
| 5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui"> |
| 6 | - <title></title> | |
| 6 | + <title>实景编程</title> | |
| 7 | 7 | <link rel="stylesheet" href="../css/responsive/css/bootstrap.min.css"> |
| 8 | 8 | <!-- <link href="../css/codemirror.css" rel="stylesheet"> --> |
| 9 | 9 | <link href="../css/reset.css" rel="stylesheet"> | ... | ... |