xkos / micolog

Automatically exported from code.google.com/p/micolog
MIT License
0 stars 0 forks source link

js & canvas related problems of text editor. #129

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I found something really annoyed me.
When I write something like this in a post using default HTML editor:

<script language="javascript">
   function f(){
        var canvas = document.getElementById("canvas");
        if (canvas.getContext) {
        var ctx = canvas.getContext("2d");
        ctx.fillStyle = "rgb(200,0,0)";
        ctx.fillRect (10, 10, 55, 50);
        ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
        ctx.fillRect (30, 30, 55, 50);
      }
   document.getElementById('bt').value="ok";
  }
</script>
<p><input onclick="f()" type="button" id="bt" value="Run"></input></p>
<p><canvas id="canvas" width="150" height="150"></canvas></p> 

These worked at the first time. But when I try to edit them using either the 
Visual editor or HTML editor, the text showed in these editor have some kind of 
problem:
switch between these two editors will mass all of the js code, and both editors 
will discard the canvas label.
Using the xheditor plugin also have this problem.

It will be appreciated if someone can solve this~

P.S. Micolog is the best blog for GAE I have found, wish it can keep going.

Original issue reported on code.google.com by ylqelgoo...@gmail.com on 13 Sep 2011 at 5:12

GoogleCodeExporter commented 8 years ago
yes, this also pissed me off, so I switched to Windows Live Writer when mod the 
post

Original comment by fdrex1...@gmail.com on 28 Nov 2011 at 8:14