<commit_before><!doctype html>
<title>Our Awesome Code Editor</title>
<meta charset=utf-8/>

<style>
  html body { margin: 0px; padding: 0px; }
  iframe body { margin: 0px; padding: 0px; }
  iframe { height: 100%; width: 49%; border: none; }
  .right { float: right; }
</style>

<body>

  <iframe id=preview class=right></iframe>
  
  <script src=js/sclib.js></script>
  <script src=js/codemirror.js></script>
  <script src=js/diff_match_patch.js></script>
  <script>
  
    var editor = new CodeMirror(document.body, {
      content: "<!doctype html>\n<title></title>",
      height: "100%",
      width: "50%",
      parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"],
      stylesheet: ["css/xmlcolors.css", "css/jscolors.css", "css/csscolors.css"],
      path: "js/"
    });
	
	setInterval(function() { preview.document.open(); preview.document.write(editor.editor.getCode()); preview.document.close(); },500);
  
    /*setInterval(Scout.send(function(xhr, params){
      params.data = {
        file: 'foo.js',
        diff: [[0,0,'a'], [0,1,'b'], [1,1], [0,1,'c']],
        revn: 1,
        user: 'foo',
        pass: '<PASSWORD>'
      };
      params.open.url = 'http://scoutcamp.sourceforge.net/Editor/XHRtest/getmodif.py';
      params.resp = function(xhr, resp) {
        alert(JSON.stringify(resp));
      };
    }), timeout);*/
	
  </script>
  
</body>
<commit_msg>editable canvas example<commit_after><!doctype html>
<title>Our Awesome Code Editor</title>
<meta charset=utf-8/>

<style>
  html body { margin: 0px; padding: 0px; }
  iframe body { margin: 0px; padding: 0px; }
  iframe { height: 100%; width: 49%; border: none; }
  .right { float: right; }
</style>

<body>

  <iframe id=preview class=right></iframe>
  
  <script src=js/sclib.js></script>
  <script src=js/codemirror.js></script>
  <script src=js/diff_match_patch.js></script>
  <script>
  
    var editor = new CodeMirror(document.body, {
      content: "<!doctype html>\n<title><\/title>\n\n<canvas id=tutorial width=150 height=150><\/canvas>\n\n<script>\n  var canvas = document.getElementById('tutorial');\n  var context = canvas.getContext('2d');\n\n  context.fillStyle = 'rgb(250,0,0)';\n  context.fillRect(10, 10, 55, 50);\n\n  context.fillStyle = 'rgba(0, 0, 250, 0.5)';\n  context.fillRect(30, 30, 55, 50);\n<\/script>",
      height: "100%",
      width: "50%",
      parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"],
      stylesheet: ["css/xmlcolors.css", "css/jscolors.css", "css/csscolors.css"],
      path: "js/"
    });
	
	setInterval(function() { preview.document.open(); preview.document.write(editor.editor.getCode()); preview.document.close(); },500);
  
    /*setInterval(Scout.send(function(xhr, params){
      params.data = {
        file: 'foo.js',
        diff: [[0,0,'a'], [0,1,'b'], [1,1], [0,1,'c']],
        revn: 1,
        user: 'foo',
        pass: '<PASSWORD>'
      };
      params.open.url = 'http://scoutcamp.sourceforge.net/Editor/XHRtest/getmodif.py';
      params.resp = function(xhr, resp) {
        alert(JSON.stringify(resp));
      };
    }), timeout);*/
	
  </script>
  
</body>

{'fraction_non_alphanumeric': 0.20124031007751939, 'fraction_numerical': 0.027596899224806203, 'mean_word_length': 3.3128342245989306, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3576336', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1152, 'n_words': 218}