Commit bed99520499fafda78919021383aeac2b0791010
1 parent
f2f16e22
fixbug src
Showing
1 changed file
with
39 additions
and
2 deletions
src/gxb-ide/CodingEditer.js
| @@ -34,6 +34,22 @@ | @@ -34,6 +34,22 @@ | ||
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | /* 判断用户输入HTML片段还是完成的HTML文档 */ | 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 | // var completedflag = 0, | 53 | // var completedflag = 0, |
| 38 | // lowhtml = html.toLowerCase(); | 54 | // lowhtml = html.toLowerCase(); |
| 39 | // if (lowhtml.toLowerCase().indexOf('</body>') >= 0 && lowhtml.toLowerCase().indexOf('<body>') >= 0) { | 55 | // if (lowhtml.toLowerCase().indexOf('</body>') >= 0 && lowhtml.toLowerCase().indexOf('<body>') >= 0) { |
| @@ -43,7 +59,7 @@ | @@ -43,7 +59,7 @@ | ||
| 43 | var _css = "<style>" + css + "</style>"; | 59 | var _css = "<style>" + css + "</style>"; |
| 44 | var _script = '<script type="text/javascript">' + js + "</script>"; | 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 | // result = result + _script; | 64 | // result = result + _script; |
| 49 | 65 | ||
| @@ -71,6 +87,15 @@ | @@ -71,6 +87,15 @@ | ||
| 71 | console.log(pauseValue); | 87 | console.log(pauseValue); |
| 72 | return pauseValue; | 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 | getPlayCodeMirrorValue: function(){ | 99 | getPlayCodeMirrorValue: function(){ |
| 75 | CodingEditer.pauseValue = []; | 100 | CodingEditer.pauseValue = []; |
| 76 | var treeLinkEditor = Dir.treeLinkEditor; | 101 | var treeLinkEditor = Dir.treeLinkEditor; |
| @@ -110,6 +135,12 @@ | @@ -110,6 +135,12 @@ | ||
| 110 | // iterm.compileResult() | 135 | // iterm.compileResult() |
| 111 | } | 136 | } |
| 112 | 137 | ||
| 138 | + if (CodingEditer.isWeb) { | ||
| 139 | + console.log('CodingEditer.isWeb=============') | ||
| 140 | + CodingEditer.webResult('', '', '') | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + | ||
| 113 | // CodingEditer.resetCodeMirrorValue(1); | 144 | // CodingEditer.resetCodeMirrorValue(1); |
| 114 | // var iterm = new Iterm(); | 145 | // var iterm = new Iterm(); |
| 115 | // iterm.compileResult() | 146 | // iterm.compileResult() |
| @@ -314,7 +345,7 @@ | @@ -314,7 +345,7 @@ | ||
| 314 | buildRecords(Dir.getCurrentEditor(em.getWrapperElement().getAttribute('id')), changeobj); | 345 | buildRecords(Dir.getCurrentEditor(em.getWrapperElement().getAttribute('id')), changeobj); |
| 315 | } | 346 | } |
| 316 | if (CodingEditer.isWeb && CodingEditer.isHanld === 1) { | 347 | if (CodingEditer.isWeb && CodingEditer.isHanld === 1) { |
| 317 | - console.log(_pauseValue[2]) | 348 | + console.log(_pauseValue) |
| 318 | CodingEditer.webResult(_pauseValue[0], _pauseValue[1], _pauseValue[2]) | 349 | CodingEditer.webResult(_pauseValue[0], _pauseValue[1], _pauseValue[2]) |
| 319 | } | 350 | } |
| 320 | }, | 351 | }, |
| @@ -333,6 +364,12 @@ | @@ -333,6 +364,12 @@ | ||
| 333 | lineNumbers: true, | 364 | lineNumbers: true, |
| 334 | smartIndent: false, | 365 | smartIndent: false, |
| 335 | onChange: function(em, changeobj) { | 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 | onFocus: function(em) { | 374 | onFocus: function(em) { |
| 338 | }, | 375 | }, |