CodeMirror to merge view curved arch in middle of page with difference highlighting - Javascript CodeMirror

Javascript examples for CodeMirror:Highlight

Description

CodeMirror to merge view curved arch in middle of page with difference highlighting

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>jQuery addClass example</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script> 
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.38.0/codemirror.min.js"></script> 
      <script type="text/javascript">
    window.onload=function(){//www.jav a  2s .co  m
    var original = 'test';
    var historic = 'test test';
    var target = document.getElementById("editor");
    diff = CodeMirror.MergeView(
        target, {
            value: original,
            origLeft: null,
            orig: historic ,
            lineNumbers: true,
            mode: "text/html",
            highlightDifferences: true,
            showDifferences: true,
            lineWrapping : true,
            revertButtons : true,
        }
    );
    }

      </script> 
   </head> 
   <body> 
      <link href="https://it-app-files.s3.amazonaws.com/static/home/scripts/codemirror/codemirror.css" rel="stylesheet"> 
      <link href="https://it-app-files.s3.amazonaws.com/static/home/scripts/codemirror/addons/merge.css" rel="stylesheet"> 
      <div class="col-lg-12"> 
         <div id="editor"></div> 
      </div> 
      <script src="https://it-app-files.s3.amazonaws.com/static/home/scripts/codemirror/codemirror.js"></script> 
      <script src="https://it-app-files.s3.amazonaws.com/static/home/scripts/codemirror/addons/search.js"></script> 
      <script src="https://it-app-files.s3.amazonaws.com/static/home/scripts/codemirror/addons/searchcursor.js"></script> 
      <script src="https://it-app-files.s3.amazonaws.com/static/home/scripts/codemirror/addons/jump-to-line.js"></script> 
      <script src="https://it-app-files.s3.amazonaws.com/static/home/scripts/codemirror/addons/dialog.js"></script> 
      <script src="https://it-app-files.s3.amazonaws.com/static/home/scripts/codemirror/addons/diff_match_patch.js"></script> 
      <script src="https://it-app-files.s3.amazonaws.com/static/home/scripts/codemirror/addons/merge.js"></script>  
   </body>
</html>

Related Tutorials