Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

eliminate demo page from master branch

  • Loading branch information...
commit c1b4ec347f5aef6c7dc5d336eb577f3049919b76 1 parent d402498
@cemerick authored
Showing with 0 additions and 80 deletions.
  1. +0 −80 demo.html
View
80 demo.html
@@ -1,80 +0,0 @@
-<html>
-<head>
-
-<script type="text/javascript" src="/files/js/dojo/dojo.js"></script>
-<script type="text/javascript" src="diffview.js"></script>
-<link rel="stylesheet" type="text/css" href="diffview.css"/>
-<script type="text/javascript" src="difflib.js"></script>
-
-
-<script language="javascript">
-var $ = dojo.byId;
-dojo.require("dojo.io");
-var url = window.location.toString().split("#")[0];
-
-function diffUsingJS () {
- var base = difflib.stringAsLines($("baseText").value);
- var newtxt = difflib.stringAsLines($("newText").value);
- var sm = new difflib.SequenceMatcher(base, newtxt);
- var opcodes = sm.get_opcodes();
- var diffoutputdiv = $("diffoutput");
- while (diffoutputdiv.firstChild) diffoutputdiv.removeChild(diffoutputdiv.firstChild);
- var contextSize = $("contextSize").value;
- contextSize = contextSize ? contextSize : null;
- diffoutputdiv.appendChild(diffview.buildView({ baseTextLines:base,
- newTextLines:newtxt,
- opcodes:opcodes,
- baseTextName:"Base Text",
- newTextName:"New Text",
- contextSize:contextSize,
- viewType: $("inline").checked ? 1 : 0 }));
- window.location = url + "#diff";
-}
-
-function diffUsingPython () {
- dojo.io.bind({
- url: "/diff/postYieldDiffData",
- method: "POST",
- content: {
- baseText: $("baseText").value,
- newText: $("newText").value,
- ignoreWhitespace: "Y"
- },
- load: function (type, data, evt) {
- try {
- data = eval('(' + data + ')');
- while (diffoutputdiv.firstChild) diffoutputdiv.removeChild(diffoutputdiv.firstChild);
- $("output").appendChild(diffview.buildView({ baseTextLines:data.baseTextLines,
- newTextLines:data.newTextLines,
- opcodes:data.opcodes,
- baseTextName:data.baseTextName,
- newTextName:data.newTextName,
- contextSize:contextSize }));
- } catch (ex) {
- alert("An error occurred updating the diff view:\n" + ex.toString());
- }
- },
- error: function(type, evt) {
- alert('Error occurred getting diff data. Check the server logs.');
- },
- type:'text/javascript'
- });
-}
-</script>
-</head>
-<body>
- <h1><a href="/jsdifflib">jsdifflib</a> demo</h1>
- <strong>Context size (optional):</strong> <input type="text" id="contextSize" value=""></input><br/>
- <strong>Diff View Type:</strong>
- <input type="radio" name="_viewtype" checked="checked" id="sidebyside"/> Side by Side
- &#160;&#160;
- <input type="radio" name="_viewtype" id="inline"/> Inline
- <h2>Base Text</h2>
- <textarea id="baseText" style="width:600px;height:300px"></textarea><br/>
- <h2>New Text</h2>
- <textarea id="newText" style="width:600px;height:300px"></textarea><br/><br/>
- <input type="button" value="Diff" onclick="javascript:diffUsingJS();"/><br/><br/>
- <a name="diff"> </a>
- <div id="diffoutput" style="width:100%"> </div>
-</body>
-</html>
Please sign in to comment.
Something went wrong with that request. Please try again.