Commit dece7d58bcd0779603f2e82fbe907e1f2fd30a35
1 parent
c8a16bf6
fixbug
Showing
1 changed file
with
39 additions
and
2 deletions
dist/gxb-ide/CodingEditer.js
| ... | ... | @@ -34,6 +34,22 @@ |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /* 判断用户输入HTML片段还是完成的HTML文档 */ |
| 37 | + // var completedflag = 0, | |
| 38 | + // lowhtml = html.toLowerCase(); | |
| 39 | + // if(lowhtml.toLowerCase().indexOf('</body>') >= 0 && lowhtml.toLowerCase().indexOf('<body>') >= 0){ | |
| 40 | + // completedflag = 1; | |
| 41 | + // } | |
| 42 | + | |
| 43 | + // if(completedflag){ | |
| 44 | + // html = html.replace(/\<link href="style.css" rel="stylesheet"\/>/g,'<style>' + css + '</style>'); | |
| 45 | + // html = html.replace(/\<link rel="stylesheet" href="style.css"\/>/g,'<style>' + css + '</style>'); | |
| 46 | + // html = html.replace(/\<script src="script.js"\>\<\/script\>/g,'<script>' + js + '<\/script>'); | |
| 47 | + // result = html; | |
| 48 | + // }else{ | |
| 49 | + // result = '<!DOCTYPE HTML><html><head><style>' + css + '</style></head><body>' + html + '<script type="text/javascript">' + js + '<\/script></body></html>'; | |
| 50 | + // } | |
| 51 | + | |
| 52 | + /* 判断用户输入HTML片段还是完成的HTML文档 */ | |
| 37 | 53 | // var completedflag = 0, |
| 38 | 54 | // lowhtml = html.toLowerCase(); |
| 39 | 55 | // if (lowhtml.toLowerCase().indexOf('</body>') >= 0 && lowhtml.toLowerCase().indexOf('<body>') >= 0) { |
| ... | ... | @@ -43,7 +59,7 @@ |
| 43 | 59 | var _css = "<style>" + css + "</style>"; |
| 44 | 60 | var _script = '<script type="text/javascript">' + js + "</script>"; |
| 45 | 61 | |
| 46 | - var result = '<!DOCTYPE HTML><html><head>' + _css + _script + '</head><body>' + html + '</body></html>'; | |
| 62 | + var result = '<!DOCTYPE HTML><html><head>' + _css + '</head><body>' + html + _script + '</body></html>'; | |
| 47 | 63 | |
| 48 | 64 | // result = result + _script; |
| 49 | 65 | |
| ... | ... | @@ -71,6 +87,15 @@ |
| 71 | 87 | console.log(pauseValue); |
| 72 | 88 | return pauseValue; |
| 73 | 89 | }, |
| 90 | + getPlayerActionValue: function(){ | |
| 91 | + var actionValue = []; | |
| 92 | + var treeLinkEditor = Dir.treeLinkEditor; | |
| 93 | + for (var i = 0; i < treeLinkEditor.length; i++) { | |
| 94 | + actionValue.push(treeLinkEditor[i].CodeMirrorReplay.getValue()); | |
| 95 | + } | |
| 96 | + console.log(actionValue); | |
| 97 | + return actionValue; | |
| 98 | + }, | |
| 74 | 99 | getPlayCodeMirrorValue: function(){ |
| 75 | 100 | CodingEditer.pauseValue = []; |
| 76 | 101 | var treeLinkEditor = Dir.treeLinkEditor; |
| ... | ... | @@ -110,6 +135,12 @@ |
| 110 | 135 | // iterm.compileResult() |
| 111 | 136 | } |
| 112 | 137 | |
| 138 | + if (CodingEditer.isWeb) { | |
| 139 | + console.log('CodingEditer.isWeb=============') | |
| 140 | + CodingEditer.webResult('', '', '') | |
| 141 | + } | |
| 142 | + | |
| 143 | + | |
| 113 | 144 | // CodingEditer.resetCodeMirrorValue(1); |
| 114 | 145 | // var iterm = new Iterm(); |
| 115 | 146 | // iterm.compileResult() |
| ... | ... | @@ -314,7 +345,7 @@ |
| 314 | 345 | buildRecords(Dir.getCurrentEditor(em.getWrapperElement().getAttribute('id')), changeobj); |
| 315 | 346 | } |
| 316 | 347 | if (CodingEditer.isWeb && CodingEditer.isHanld === 1) { |
| 317 | - console.log(_pauseValue[2]) | |
| 348 | + console.log(_pauseValue) | |
| 318 | 349 | CodingEditer.webResult(_pauseValue[0], _pauseValue[1], _pauseValue[2]) |
| 319 | 350 | } |
| 320 | 351 | }, |
| ... | ... | @@ -333,6 +364,12 @@ |
| 333 | 364 | lineNumbers: true, |
| 334 | 365 | smartIndent: false, |
| 335 | 366 | onChange: function(em, changeobj) { |
| 367 | + var _pauseValue = CodingEditer.getPlayerActionValue(); | |
| 368 | + console.log('CodeMirrorReplay-----------------', _pauseValue) | |
| 369 | + | |
| 370 | + if (CodingEditer.isWeb) { | |
| 371 | + CodingEditer.webResult(_pauseValue[0], _pauseValue[1], _pauseValue[2]) | |
| 372 | + } | |
| 336 | 373 | }, |
| 337 | 374 | onFocus: function(em) { |
| 338 | 375 | }, | ... | ... |