Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'rhbz756264'

Conflicts:
	server/zanata-war/src/main/java/org/zanata/webtrans/client/presenter/TransMemoryPresenter.java
	server/zanata-war/src/main/java/org/zanata/webtrans/client/view/TransMemoryView.java
	server/zanata-war/src/main/resources/org/zanata/webtrans/public/Application.css
  • Loading branch information...
commit 47fbc1d181848431064cb4f12427619faf1745d9 2 parents 9873fa5 + a72c8b5
Alex Eng authored

Showing 17 changed files with 4,037 additions and 89 deletions. Show diff stats Hide diff stats

  1. 6  server/zanata-war/src/main/java/org/zanata/webtrans/client/presenter/TransMemoryPresenter.java
  2. 71  server/zanata-war/src/main/java/org/zanata/webtrans/client/ui/CodeMirror.java
  3. 55  server/zanata-war/src/main/java/org/zanata/webtrans/client/ui/DiffMatchPatchLabel.java
  4. 116  server/zanata-war/src/main/java/org/zanata/webtrans/client/ui/Highlighting.java
  5. 4  server/zanata-war/src/main/java/org/zanata/webtrans/client/ui/HighlightingLabel.java
  6. 6  server/zanata-war/src/main/java/org/zanata/webtrans/client/view/TransMemoryView.java
  7. 36  server/zanata-war/src/main/resources/org/zanata/webtrans/public/Application.css
  8. 2  server/zanata-war/src/main/resources/org/zanata/webtrans/public/Application.html
  9. 177  server/zanata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/COPYING
  10. 39  server/zanata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/README.txt
  11. 87  server/zanata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/demos/demo_diff.html
  12. 92  server/zanata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/demos/demo_match.html
  13. 121  server/zanata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/demos/demo_patch.html
  14. 49  ...er/zanata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/javascript/diff_match_patch.js
  15. 146  ...ta-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/javascript/diff_match_patch_test.html
  16. 932  ...nata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/javascript/diff_match_patch_test.js
  17. 2,187  .../src/main/resources/org/zanata/webtrans/public/diff_match_patch/javascript/diff_match_patch_uncompressed.js
6  server/zanata-war/src/main/java/org/zanata/webtrans/client/presenter/TransMemoryPresenter.java
@@ -38,7 +38,7 @@
38 38
 
39 39
       HasText getTmTextBox();
40 40
 
41  
-      void createTable(ArrayList<TranslationMemoryGlossaryItem> memories);
  41
+      void createTable(String query, ArrayList<TranslationMemoryGlossaryItem> memories);
42 42
       
43 43
       void startProcessing();
44 44
       
@@ -88,7 +88,7 @@ public void showResultsFor(TransUnit transUnit)
88 88
       showResults(query, searchType);
89 89
    }
90 90
 
91  
-   private void showResults(String query, GetTranslationMemory.SearchType searchType)
  91
+   private void showResults(final String query, GetTranslationMemory.SearchType searchType)
92 92
    {
93 93
       display.startProcessing();
94 94
       final GetTranslationMemory action = new GetTranslationMemory(query, workspaceContext.getWorkspaceId().getLocaleId(), searchType);
@@ -104,7 +104,7 @@ public void onFailure(Throwable caught)
104 104
          public void onSuccess(GetTranslationMemoryResult result)
105 105
          {
106 106
             ArrayList<TranslationMemoryGlossaryItem> memories = result.getMemories();
107  
-            display.createTable(memories);
  107
+            display.createTable(query, memories);
108 108
          }
109 109
       });
110 110
    }
71  server/zanata-war/src/main/java/org/zanata/webtrans/client/ui/CodeMirror.java
... ...
@@ -1,71 +0,0 @@
1  
-/*
2  
- * Copyright 2010, Red Hat, Inc. and individual contributors as indicated by the
3  
- * @author tags. See the copyright.txt file in the distribution for a full
4  
- * listing of individual contributors.
5  
- * 
6  
- * This is free software; you can redistribute it and/or modify it under the
7  
- * terms of the GNU Lesser General Public License as published by the Free
8  
- * Software Foundation; either version 2.1 of the License, or (at your option)
9  
- * any later version.
10  
- * 
11  
- * This software is distributed in the hope that it will be useful, but WITHOUT
12  
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14  
- * details.
15  
- * 
16  
- * You should have received a copy of the GNU Lesser General Public License
17  
- * along with this software; if not, write to the Free Software Foundation,
18  
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
19  
- * site: http://www.fsf.org.
20  
- */
21  
-package org.zanata.webtrans.client.ui;
22  
-
23  
-import com.google.gwt.user.client.Element;
24  
-
25  
-public class CodeMirror
26  
-{
27  
-
28  
-   public static native void doHighlight(String text, Element elem)/*-{
29  
-      elem.innerHTML = '';
30  
-      $wnd.highlightText(text, elem);
31  
-   }-*/;
32  
-
33  
-   public static native void highlightSearch(String searchTerm, Element elem)/*-{
34  
-      // the highlightStartTag and highlightEndTag parameters are optional
35  
-      var bodyText = elem.innerHTML;
36  
-
37  
-      var highlightStartTag = "<font style='color:blue; background-color:yellow;'>";
38  
-      var highlightEndTag = "</font>";
39  
-
40  
-      // find all occurences of the search term in the given text,
41  
-      // and add some "highlight" tags to them (we're not using a
42  
-      // regular expression search, because we want to filter out
43  
-      // matches that occur within HTML tags and script blocks, so
44  
-      // we have to do a little extra validation)
45  
-      var newText = "";
46  
-      var i = -1;
47  
-      var lcSearchTerm = searchTerm.toLowerCase();
48  
-      var lcBodyText = bodyText.toLowerCase();
49  
-
50  
-      while (bodyText.length > 0) {
51  
-      i = lcBodyText.indexOf(lcSearchTerm, i+1);
52  
-      if (i < 0) {
53  
-      newText += bodyText;
54  
-      bodyText = "";
55  
-      } else {
56  
-      // skip anything inside an HTML tag
57  
-      if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
58  
-      // skip anything inside a <script> block
59  
-      if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
60  
-      newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;
61  
-      bodyText = bodyText.substr(i + searchTerm.length);
62  
-      lcBodyText = bodyText.toLowerCase();
63  
-      i = -1;
64  
-      }
65  
-      }
66  
-      }
67  
-      elem.innerHTML = newText;
68  
-      }
69  
-   }-*/;
70  
-
71  
-}
55  server/zanata-war/src/main/java/org/zanata/webtrans/client/ui/DiffMatchPatchLabel.java
... ...
@@ -0,0 +1,55 @@
  1
+/*
  2
+ * Copyright 2010, Red Hat, Inc. and individual contributors as indicated by the
  3
+ * @author tags. See the copyright.txt file in the distribution for a full
  4
+ * listing of individual contributors.
  5
+ * 
  6
+ * This is free software; you can redistribute it and/or modify it under the
  7
+ * terms of the GNU Lesser General Public License as published by the Free
  8
+ * Software Foundation; either version 2.1 of the License, or (at your option)
  9
+ * any later version.
  10
+ * 
  11
+ * This software is distributed in the hope that it will be useful, but WITHOUT
  12
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  14
+ * details.
  15
+ * 
  16
+ * You should have received a copy of the GNU Lesser General Public License
  17
+ * along with this software; if not, write to the Free Software Foundation,
  18
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
  19
+ * site: http://www.fsf.org.
  20
+ */
  21
+package org.zanata.webtrans.client.ui;
  22
+
  23
+import com.google.gwt.user.client.ui.HTML;
  24
+
  25
+public class DiffMatchPatchLabel extends HTML
  26
+{
  27
+   private String original;
  28
+   private String plainText;
  29
+
  30
+   public DiffMatchPatchLabel()
  31
+   {
  32
+   }
  33
+
  34
+   public DiffMatchPatchLabel(String orig, String text)
  35
+   {
  36
+      super();
  37
+      this.original = orig;
  38
+      setText(text);
  39
+   }
  40
+
  41
+   @Override
  42
+   public String getText()
  43
+   {
  44
+      return plainText;
  45
+   }
  46
+
  47
+   @Override
  48
+   public void setText(String text)
  49
+   {
  50
+      this.plainText = text;
  51
+      String diff = Highlighting.diffAsHtml(original, plainText);
  52
+      setHTML(diff);
  53
+   }
  54
+
  55
+}
116  server/zanata-war/src/main/java/org/zanata/webtrans/client/ui/Highlighting.java
... ...
@@ -0,0 +1,116 @@
  1
+/*
  2
+ * Copyright 2010, Red Hat, Inc. and individual contributors as indicated by the
  3
+ * @author tags. See the copyright.txt file in the distribution for a full
  4
+ * listing of individual contributors.
  5
+ * 
  6
+ * This is free software; you can redistribute it and/or modify it under the
  7
+ * terms of the GNU Lesser General Public License as published by the Free
  8
+ * Software Foundation; either version 2.1 of the License, or (at your option)
  9
+ * any later version.
  10
+ * 
  11
+ * This software is distributed in the hope that it will be useful, but WITHOUT
  12
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  14
+ * details.
  15
+ * 
  16
+ * You should have received a copy of the GNU Lesser General Public License
  17
+ * along with this software; if not, write to the Free Software Foundation,
  18
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
  19
+ * site: http://www.fsf.org.
  20
+ */
  21
+package org.zanata.webtrans.client.ui;
  22
+
  23
+import com.google.gwt.user.client.Element;
  24
+
  25
+public class Highlighting
  26
+{
  27
+
  28
+   public static native void syntaxHighlight(String text, Element elem)/*-{
  29
+		elem.innerHTML = '';
  30
+		$wnd.highlightText(text, elem);
  31
+   }-*/;
  32
+
  33
+   public static native void searchHighlight(String searchTerm, Element elem)/*-{
  34
+		// the highlightStartTag and highlightEndTag parameters are optional
  35
+		var bodyText = elem.innerHTML;
  36
+
  37
+		var highlightStartTag = "<font style='color:blue; background-color:yellow;'>";
  38
+		var highlightEndTag = "</font>";
  39
+
  40
+		// find all occurences of the search term in the given text,
  41
+		// and add some "highlight" tags to them (we're not using a
  42
+		// regular expression search, because we want to filter out
  43
+		// matches that occur within HTML tags and script blocks, so
  44
+		// we have to do a little extra validation)
  45
+		var newText = "";
  46
+		var i = -1;
  47
+		var lcSearchTerm = searchTerm.toLowerCase();
  48
+		var lcBodyText = bodyText.toLowerCase();
  49
+
  50
+		while (bodyText.length > 0) {
  51
+			i = lcBodyText.indexOf(lcSearchTerm, i + 1);
  52
+			if (i < 0) {
  53
+				newText += bodyText;
  54
+				bodyText = "";
  55
+			} else {
  56
+				// skip anything inside an HTML tag
  57
+				if (bodyText.lastIndexOf(">", i) >= bodyText
  58
+						.lastIndexOf("<", i)) {
  59
+					// skip anything inside a <script> block
  60
+					if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText
  61
+							.lastIndexOf("<script", i)) {
  62
+						newText += bodyText.substring(0, i) + highlightStartTag
  63
+								+ bodyText.substr(i, searchTerm.length)
  64
+								+ highlightEndTag;
  65
+						bodyText = bodyText.substr(i + searchTerm.length);
  66
+						lcBodyText = bodyText.toLowerCase();
  67
+						i = -1;
  68
+					}
  69
+				}
  70
+			}
  71
+			elem.innerHTML = newText;
  72
+		}
  73
+   }-*/;
  74
+
  75
+   public static native String diffAsHtml(String text1, String text2)/*-{
  76
+		if (!$wnd.diffMatchPatch) {
  77
+			$wnd.diffMatchPatch = new $wnd.diff_match_patch();
  78
+			$wnd.diffMatchPatch.Diff_Timeout = 0.2;
  79
+
  80
+			//			// modified diff_prettyHtml() from diff_match_patch.js
  81
+			//			$wnd.diffMatchPatch.prototype.diff_prettyHtml = function(diffs) {
  82
+			//				var html = [];
  83
+			//				var pattern_amp = /&/g;
  84
+			//				var pattern_lt = /</g;
  85
+			//				var pattern_gt = />/g;
  86
+			//				var pattern_para = /\n/g;
  87
+			//				for ( var x = 0; x < diffs.length; x++) {
  88
+			//					var op = diffs[x][0]; // Operation (insert, delete, equal)
  89
+			//					var data = diffs[x][1]; // Text of change.
  90
+			//					var text = data.replace(pattern_amp, '&amp;').replace(
  91
+			//							pattern_lt, '&lt;').replace(pattern_gt, '&gt;')
  92
+			//							.replace(pattern_para, '&para;<br>');
  93
+			//					switch (op) {
  94
+			//					case DIFF_INSERT:
  95
+			//						html[x] = '<ins class="diff-insert">' + text + '</ins>';
  96
+			//						break;
  97
+			//					case DIFF_DELETE:
  98
+			//						html[x] = '<del class="diff-delete">' + text + '</del>';
  99
+			//						break;
  100
+			//					case DIFF_EQUAL:
  101
+			//						html[x] = '<span class="diff-equal">' + text
  102
+			//								+ '</span>';
  103
+			//						break;
  104
+			//					}
  105
+			//				}
  106
+			//				return html.join('');
  107
+			//			};
  108
+		}
  109
+
  110
+		var dmp = $wnd.diffMatchPatch;
  111
+		var d = dmp.diff_main(text1, text2);
  112
+		dmp.diff_cleanupSemantic(d);
  113
+		return dmp.diff_prettyHtml(d);
  114
+   }-*/;
  115
+
  116
+}
4  server/zanata-war/src/main/java/org/zanata/webtrans/client/ui/HighlightingLabel.java
@@ -56,13 +56,13 @@ private void highlight()
56 56
    {
57 57
       Element element = getElement();
58 58
       String text = plainText == null ? "" : plainText.replaceAll("\n", "¶\n");
59  
-      CodeMirror.doHighlight(text, element);
  59
+      Highlighting.syntaxHighlight(text, element);
60 60
    }
61 61
 
62 62
    public void highlightSearch(String search)
63 63
    {
64 64
       Element element = getElement();
65  
-      CodeMirror.highlightSearch(search, element);
  65
+      Highlighting.searchHighlight(search, element);
66 66
    }
67 67
 
68 68
 }
6  server/zanata-war/src/main/java/org/zanata/webtrans/client/view/TransMemoryView.java
@@ -5,6 +5,7 @@
5 5
 import net.customware.gwt.presenter.client.EventBus;
6 6
 
7 7
 import org.zanata.webtrans.client.events.TransMemoryCopyEvent;
  8
+import org.zanata.webtrans.client.ui.DiffMatchPatchLabel;
8 9
 import org.zanata.webtrans.client.presenter.TransMemoryDetailsPresenter;
9 10
 import org.zanata.webtrans.client.presenter.TransMemoryPresenter;
10 11
 import org.zanata.webtrans.client.resources.Resources;
@@ -152,7 +153,7 @@ public void stopProcessing()
152 153
    }
153 154
 
154 155
    @Override
155  
-   public void createTable(ArrayList<TranslationMemoryGlossaryItem> memories)
  156
+   public void createTable(String query, ArrayList<TranslationMemoryGlossaryItem> memories)
156 157
    {
157 158
       // TODO most of this should be in TransMemoryPresenter
158 159
       clearResults();
@@ -168,7 +169,7 @@ public void createTable(ArrayList<TranslationMemoryGlossaryItem> memories)
168 169
          final String targetMessage = memory.getTarget();
169 170
          final int similarity = memory.getSimilarityPercent();
170 171
 
171  
-         resultTable.setWidget(row, SOURCE_COL, new HighlightingLabel(sourceMessage));
  172
+         resultTable.setWidget(row, SOURCE_COL, new DiffMatchPatchLabel(query, sourceMessage));
172 173
          resultTable.setWidget(row, TARGET_COL, new HighlightingLabel(targetMessage));
173 174
          resultTable.setText(row, SIMILARITY_COL, similarity + "%");
174 175
 
@@ -214,6 +215,7 @@ public void clearResults()
214 215
       resultTable.removeAllRows();
215 216
    }
216 217
 
  218
+
217 219
    @Override
218 220
    public boolean isFocused()
219 221
    {
36  server/zanata-war/src/main/resources/org/zanata/webtrans/public/Application.css
@@ -155,9 +155,9 @@ Removes some of the styling on the page-level splitters
155 155
 }
156 156
 
157 157
 .gwt-TabLayoutPanel .gwt-TabLayoutPanelTab {
158  
-	cursor:pointer;
159  
-	border-top-left-radius:5px;
160  
-	border-top-right-radius:5px;
  158
+    cursor:pointer;
  159
+    border-top-left-radius:5px;
  160
+    border-top-right-radius:5px;
161 161
 }
162 162
 
163 163
 .gwt-TabLayoutPanel .gwt-TabLayoutPanelTab-selected {
@@ -167,9 +167,9 @@ Removes some of the styling on the page-level splitters
167 167
 }
168 168
 
169 169
 .gwt-TabLayoutPanel .gwt-TabLayoutPanelContent {
170  
-	border: 2px solid #e0e8ee; 
171  
-	background:#FFFFFF;
172  
-	border-radius:5px;
  170
+    border: 2px solid #e0e8ee; 
  171
+    background:#FFFFFF;
  172
+    border-radius:5px;
173 173
 }
174 174
 
175 175
 .WebTransEditor-Outer tr.middle td.middleCenter {
@@ -304,7 +304,8 @@ td.TableEditorCell-Source {
304 304
 }
305 305
 
306 306
 td.TableEditorCell-Target {
307  
-    height:20px;
  307
+	/*TODO: put this back on when middle colmun is removed.
  308
+/*     padding-left:20px; */
308 309
 }
309 310
 
310 311
 tr.TableEditorRow.highlighted td.TableEditorCell {
@@ -459,6 +460,21 @@ tr.ApprovedStateDecoration td.TableEditorCell-Target .TableEditorContent-Edit {
459 460
 	font-weight: bold
460 461
 }
461 462
 
  463
+.TransMemoryTableSourceColumn span {
  464
+	background:#FF0;
  465
+}
  466
+
  467
+.TransMemoryTableSourceColumn ins {
  468
+	background:#e6ffe6;
  469
+	text-decoration: none;
  470
+}
  471
+
  472
+.TransMemoryTableSourceColumn del {
  473
+	background:#ffe6e6;
  474
+	text-decoration: none;
  475
+}
  476
+
  477
+
462 478
 .DocumentListTable {
463 479
 	width: 100%;
464 480
 	font-size:16px;
@@ -483,8 +499,7 @@ tr.ApprovedStateDecoration td.TableEditorCell-Target .TableEditorContent-Edit {
483 499
 	text-align: center;
484 500
 	border: 1px outset #999966;
485 501
 	height: 65px;
486  
-	-moz-border-radius:8px;
487  
-	-webkit-border-radius: 8px;
  502
+	border-radius:8px;
488 503
 }
489 504
 
490 505
 .transUnitCountTooltipTable {
@@ -495,8 +510,7 @@ tr.ApprovedStateDecoration td.TableEditorCell-Target .TableEditorContent-Edit {
495 510
 .transUnitCountTooltipTable TD {
496 511
 	border: 1px solid #999966;
497 512
 	width:75px;
498  
-	-moz-border-radius:4px;
499  
-    -webkit-border-radius: 4px;
  513
+	border-radius:4px;
500 514
 }
501 515
 
502 516
 .pointer{
2  server/zanata-war/src/main/resources/org/zanata/webtrans/public/Application.html
@@ -12,6 +12,8 @@
12 12
     <script src="CodeMirror-0.67/js/tokenize.js" type="text/javascript"></script> 
13 13
     <script src="CodeMirror-0.67/js/parsexml.js" type="text/javascript"></script> 
14 14
     <link rel="stylesheet" type="text/css" href="CodeMirror-0.67/css/xmlcolors.css"/> 
  15
+
  16
+    <script src="diff_match_patch/javascript/diff_match_patch.js" type="text/javascript"></script>
15 17
      
16 18
     <!--                                           -->
17 19
     <!-- This script loads your compiled module.   -->
177  server/zanata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/COPYING
... ...
@@ -0,0 +1,177 @@
  1
+
  2
+                                 Apache License
  3
+                           Version 2.0, January 2004
  4
+                        http://www.apache.org/licenses/
  5
+
  6
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
  7
+
  8
+   1. Definitions.
  9
+
  10
+      "License" shall mean the terms and conditions for use, reproduction,
  11
+      and distribution as defined by Sections 1 through 9 of this document.
  12
+
  13
+      "Licensor" shall mean the copyright owner or entity authorized by
  14
+      the copyright owner that is granting the License.
  15
+
  16
+      "Legal Entity" shall mean the union of the acting entity and all
  17
+      other entities that control, are controlled by, or are under common
  18
+      control with that entity. For the purposes of this definition,
  19
+      "control" means (i) the power, direct or indirect, to cause the
  20
+      direction or management of such entity, whether by contract or
  21
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
  22
+      outstanding shares, or (iii) beneficial ownership of such entity.
  23
+
  24
+      "You" (or "Your") shall mean an individual or Legal Entity
  25
+      exercising permissions granted by this License.
  26
+
  27
+      "Source" form shall mean the preferred form for making modifications,
  28
+      including but not limited to software source code, documentation
  29
+      source, and configuration files.
  30
+
  31
+      "Object" form shall mean any form resulting from mechanical
  32
+      transformation or translation of a Source form, including but
  33
+      not limited to compiled object code, generated documentation,
  34
+      and conversions to other media types.
  35
+
  36
+      "Work" shall mean the work of authorship, whether in Source or
  37
+      Object form, made available under the License, as indicated by a
  38
+      copyright notice that is included in or attached to the work
  39
+      (an example is provided in the Appendix below).
  40
+
  41
+      "Derivative Works" shall mean any work, whether in Source or Object
  42
+      form, that is based on (or derived from) the Work and for which the
  43
+      editorial revisions, annotations, elaborations, or other modifications
  44
+      represent, as a whole, an original work of authorship. For the purposes
  45
+      of this License, Derivative Works shall not include works that remain
  46
+      separable from, or merely link (or bind by name) to the interfaces of,
  47
+      the Work and Derivative Works thereof.
  48
+
  49
+      "Contribution" shall mean any work of authorship, including
  50
+      the original version of the Work and any modifications or additions
  51
+      to that Work or Derivative Works thereof, that is intentionally
  52
+      submitted to Licensor for inclusion in the Work by the copyright owner
  53
+      or by an individual or Legal Entity authorized to submit on behalf of
  54
+      the copyright owner. For the purposes of this definition, "submitted"
  55
+      means any form of electronic, verbal, or written communication sent
  56
+      to the Licensor or its representatives, including but not limited to
  57
+      communication on electronic mailing lists, source code control systems,
  58
+      and issue tracking systems that are managed by, or on behalf of, the
  59
+      Licensor for the purpose of discussing and improving the Work, but
  60
+      excluding communication that is conspicuously marked or otherwise
  61
+      designated in writing by the copyright owner as "Not a Contribution."
  62
+
  63
+      "Contributor" shall mean Licensor and any individual or Legal Entity
  64
+      on behalf of whom a Contribution has been received by Licensor and
  65
+      subsequently incorporated within the Work.
  66
+
  67
+   2. Grant of Copyright License. Subject to the terms and conditions of
  68
+      this License, each Contributor hereby grants to You a perpetual,
  69
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  70
+      copyright license to reproduce, prepare Derivative Works of,
  71
+      publicly display, publicly perform, sublicense, and distribute the
  72
+      Work and such Derivative Works in Source or Object form.
  73
+
  74
+   3. Grant of Patent License. Subject to the terms and conditions of
  75
+      this License, each Contributor hereby grants to You a perpetual,
  76
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  77
+      (except as stated in this section) patent license to make, have made,
  78
+      use, offer to sell, sell, import, and otherwise transfer the Work,
  79
+      where such license applies only to those patent claims licensable
  80
+      by such Contributor that are necessarily infringed by their
  81
+      Contribution(s) alone or by combination of their Contribution(s)
  82
+      with the Work to which such Contribution(s) was submitted. If You
  83
+      institute patent litigation against any entity (including a
  84
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
  85
+      or a Contribution incorporated within the Work constitutes direct
  86
+      or contributory patent infringement, then any patent licenses
  87
+      granted to You under this License for that Work shall terminate
  88
+      as of the date such litigation is filed.
  89
+
  90
+   4. Redistribution. You may reproduce and distribute copies of the
  91
+      Work or Derivative Works thereof in any medium, with or without
  92
+      modifications, and in Source or Object form, provided that You
  93
+      meet the following conditions:
  94
+
  95
+      (a) You must give any other recipients of the Work or
  96
+          Derivative Works a copy of this License; and
  97
+
  98
+      (b) You must cause any modified files to carry prominent notices
  99
+          stating that You changed the files; and
  100
+
  101
+      (c) You must retain, in the Source form of any Derivative Works
  102
+          that You distribute, all copyright, patent, trademark, and
  103
+          attribution notices from the Source form of the Work,
  104
+          excluding those notices that do not pertain to any part of
  105
+          the Derivative Works; and
  106
+
  107
+      (d) If the Work includes a "NOTICE" text file as part of its
  108
+          distribution, then any Derivative Works that You distribute must
  109
+          include a readable copy of the attribution notices contained
  110
+          within such NOTICE file, excluding those notices that do not
  111
+          pertain to any part of the Derivative Works, in at least one
  112
+          of the following places: within a NOTICE text file distributed
  113
+          as part of the Derivative Works; within the Source form or
  114
+          documentation, if provided along with the Derivative Works; or,
  115
+          within a display generated by the Derivative Works, if and
  116
+          wherever such third-party notices normally appear. The contents
  117
+          of the NOTICE file are for informational purposes only and
  118
+          do not modify the License. You may add Your own attribution
  119
+          notices within Derivative Works that You distribute, alongside
  120
+          or as an addendum to the NOTICE text from the Work, provided
  121
+          that such additional attribution notices cannot be construed
  122
+          as modifying the License.
  123
+
  124
+      You may add Your own copyright statement to Your modifications and
  125
+      may provide additional or different license terms and conditions
  126
+      for use, reproduction, or distribution of Your modifications, or
  127
+      for any such Derivative Works as a whole, provided Your use,
  128
+      reproduction, and distribution of the Work otherwise complies with
  129
+      the conditions stated in this License.
  130
+
  131
+   5. Submission of Contributions. Unless You explicitly state otherwise,
  132
+      any Contribution intentionally submitted for inclusion in the Work
  133
+      by You to the Licensor shall be under the terms and conditions of
  134
+      this License, without any additional terms or conditions.
  135
+      Notwithstanding the above, nothing herein shall supersede or modify
  136
+      the terms of any separate license agreement you may have executed
  137
+      with Licensor regarding such Contributions.
  138
+
  139
+   6. Trademarks. This License does not grant permission to use the trade
  140
+      names, trademarks, service marks, or product names of the Licensor,
  141
+      except as required for reasonable and customary use in describing the
  142
+      origin of the Work and reproducing the content of the NOTICE file.
  143
+
  144
+   7. Disclaimer of Warranty. Unless required by applicable law or
  145
+      agreed to in writing, Licensor provides the Work (and each
  146
+      Contributor provides its Contributions) on an "AS IS" BASIS,
  147
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  148
+      implied, including, without limitation, any warranties or conditions
  149
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
  150
+      PARTICULAR PURPOSE. You are solely responsible for determining the
  151
+      appropriateness of using or redistributing the Work and assume any
  152
+      risks associated with Your exercise of permissions under this License.
  153
+
  154
+   8. Limitation of Liability. In no event and under no legal theory,
  155
+      whether in tort (including negligence), contract, or otherwise,
  156
+      unless required by applicable law (such as deliberate and grossly
  157
+      negligent acts) or agreed to in writing, shall any Contributor be
  158
+      liable to You for damages, including any direct, indirect, special,
  159
+      incidental, or consequential damages of any character arising as a
  160
+      result of this License or out of the use or inability to use the
  161
+      Work (including but not limited to damages for loss of goodwill,
  162
+      work stoppage, computer failure or malfunction, or any and all
  163
+      other commercial damages or losses), even if such Contributor
  164
+      has been advised of the possibility of such damages.
  165
+
  166
+   9. Accepting Warranty or Additional Liability. While redistributing
  167
+      the Work or Derivative Works thereof, You may choose to offer,
  168
+      and charge a fee for, acceptance of support, warranty, indemnity,
  169
+      or other liability obligations and/or rights consistent with this
  170
+      License. However, in accepting such obligations, You may act only
  171
+      on Your own behalf and on Your sole responsibility, not on behalf
  172
+      of any other Contributor, and only if You agree to indemnify,
  173
+      defend, and hold each Contributor harmless for any liability
  174
+      incurred by, or claims asserted against, such Contributor by reason
  175
+      of your accepting any such warranty or additional liability.
  176
+
  177
+   END OF TERMS AND CONDITIONS
39  server/zanata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/README.txt
... ...
@@ -0,0 +1,39 @@
  1
+Diff, Match and Patch Library
  2
+http://code.google.com/p/google-diff-match-patch/
  3
+Neil Fraser
  4
+
  5
+This library is currently available in seven different ports, all using the same API.
  6
+Every version includes a full set of unit tests.
  7
+
  8
+C++:
  9
+* Ported by Mike Slemmer.
  10
+* Currently requires the Qt library.
  11
+
  12
+C#:
  13
+* Ported by Matthaeus G. Chajdas.
  14
+
  15
+Java:
  16
+* Included is both the source and a Maven package.
  17
+
  18
+JavaScript:
  19
+* diff_match_patch_uncompressed.js is the human-readable version.
  20
+  Users of node.js should 'require' this uncompressed version since the
  21
+  compressed version is not guaranteed to work outside of a web browser.
  22
+* diff_match_patch.js has been compressed using Google's internal JavaScript compressor.
  23
+  Non-Google hackers who wish to recompress the source can use:
  24
+  http://dean.edwards.name/packer/
  25
+
  26
+Lua:
  27
+* Ported by Duncan Cross.
  28
+* Does not support line-mode speedup.
  29
+
  30
+Objective C:
  31
+* Ported by Jan Weiss.
  32
+* Includes speed test (this is a separate bundle for other languages).
  33
+
  34
+Python:
  35
+* Two versions, one for Python 2.x, the other for Python 3.x.
  36
+* Runs 10x faster under PyPy than CPython.
  37
+
  38
+Demos:
  39
+* Separate demos for Diff, Match and Patch in JavaScript.
87  server/zanata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/demos/demo_diff.html
... ...
@@ -0,0 +1,87 @@
  1
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2
+<HTML>
  3
+<HEAD>
  4
+  <TITLE>Diff, Match and Patch: Demo of Diff</TITLE>
  5
+  <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="../javascript/diff_match_patch.js"></SCRIPT>
  6
+</HEAD>
  7
+
  8
+<BODY>
  9
+<H1>Diff, Match and Patch</H1>
  10
+<H2>Demo of Diff</H2>
  11
+
  12
+<P>Diff takes two texts and finds the differences.  This implementation works on a character by character basis.
  13
+The result of any diff may contain 'chaff', irrelevant small commonalities which complicate the output.
  14
+A post-diff cleanup algorithm factors out these trivial commonalities.</P>
  15
+
  16
+<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
  17
+var dmp = new diff_match_patch();
  18
+
  19
+function launch() {
  20
+  var text1 = document.getElementById('text1').value;
  21
+  var text2 = document.getElementById('text2').value;
  22
+  dmp.Diff_Timeout = parseFloat(document.getElementById('timeout').value);
  23
+  dmp.Diff_EditCost = parseFloat(document.getElementById('editcost').value);
  24
+
  25
+  var ms_start = (new Date()).getTime();
  26
+  var d = dmp.diff_main(text1, text2);
  27
+  var ms_end = (new Date()).getTime();
  28
+
  29
+  if (document.getElementById('semantic').checked) {
  30
+    dmp.diff_cleanupSemantic(d);
  31
+  }
  32
+  if (document.getElementById('efficiency').checked) {
  33
+    dmp.diff_cleanupEfficiency(d);
  34
+  }
  35
+  var ds = dmp.diff_prettyHtml(d);
  36
+  document.getElementById('outputdiv').innerHTML = ds + '<BR>Time: ' + (ms_end - ms_start) / 1000 + 's';
  37
+}
  38
+</SCRIPT>
  39
+
  40
+<FORM action="#" onsubmit="return false">
  41
+<TABLE WIDTH="100%"><TR>
  42
+  <TD WIDTH="50%">
  43
+<H3>Text Version 1:</H3>
  44
+<TEXTAREA ID="text1" STYLE="width: 100%" ROWS=10>I am the very model of a modern Major-General,
  45
+I've information vegetable, animal, and mineral,
  46
+I know the kings of England, and I quote the fights historical,
  47
+From Marathon to Waterloo, in order categorical.</TEXTAREA></TD>
  48
+  <TD WIDTH="50%">
  49
+<H3>Text Version 2:</H3>
  50
+<TEXTAREA ID="text2" STYLE="width: 100%" ROWS=10>I am the very model of a cartoon individual,
  51
+My animation's comical, unusual, and whimsical,
  52
+I'm quite adept at funny gags, comedic theory I have read,
  53
+From wicked puns and stupid jokes to anvils that drop on your head.</TEXTAREA></TD>
  54
+</TR></TABLE>
  55
+
  56
+<H3>Diff timeout:</H3>
  57
+<P><INPUT TYPE="text" SIZE=3 MAXLENGTH=5 VALUE="1" ID="timeout"> seconds<BR>
  58
+If the mapping phase of the diff computation takes longer than this, then the computation
  59
+is truncated and the best solution to date is returned.  While guaranteed to be correct,
  60
+it may not be optimal.  A timeout of '0' allows for unlimited computation.</P>
  61
+
  62
+<H3>Post-diff cleanup:</H3>
  63
+<DL>
  64
+<DT><INPUT TYPE="radio" NAME="cleanup" ID="semantic" CHECKED>
  65
+<LABEL FOR="semantic">Semantic Cleanup</LABEL></DT>
  66
+<DD>Increase human readability by factoring out commonalities which are likely to be
  67
+coincidental.</DD>
  68
+<DT><INPUT TYPE="radio" NAME="cleanup" ID="efficiency">
  69
+<LABEL FOR="efficiency">Efficiency Cleanup</LABEL>,
  70
+edit cost: <INPUT TYPE="text" SIZE=3 MAXLENGTH=5 VALUE="4" ID="editcost">
  71
+<DD>Increase computational efficiency by factoring out short commonalities which are
  72
+not worth the overhead.  The larger the edit cost, the more agressive the cleanup.</DD>
  73
+<DT><INPUT TYPE="radio" NAME="cleanup" ID="raw">
  74
+<LABEL FOR="raw">No Cleanup</LABEL></DT>
  75
+<DD>Raw output.</DD>
  76
+</DL>
  77
+
  78
+<P><INPUT TYPE="button" onClick="launch()" VALUE="Compute Diff"></P>
  79
+</FORM>
  80
+
  81
+<DIV ID="outputdiv"></DIV>
  82
+
  83
+<HR>
  84
+Back to <A HREF="http://code.google.com/p/google-diff-match-patch/">Diff, Match and Patch</A>
  85
+
  86
+</BODY>
  87
+</HTML>
92  server/zanata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/demos/demo_match.html
... ...
@@ -0,0 +1,92 @@
  1
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2
+<HTML>
  3
+<HEAD>
  4
+  <TITLE>Diff, Match and Patch: Demo of Match</TITLE>
  5
+  <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="../javascript/diff_match_patch.js"></SCRIPT>
  6
+</HEAD>
  7
+
  8
+<BODY>
  9
+<H1>Diff, Match and Patch</H1>
  10
+<H2>Demo of Match</H2>
  11
+
  12
+<P>Match looks for a pattern within a larger text.
  13
+This implementation of match is fuzzy, meaning it can find a match even if the
  14
+pattern contains errors and doesn't exactly match what is found in the text.
  15
+This implementation also accepts an expected location, near which the match should be found.
  16
+The candidate matches are scored based on a) the number of spelling differences between the 
  17
+pattern and the text and b) the distance between the candidate match and the expected location.
  18
+The match distance parameter sets the relative importance of these two metrics.</P>
  19
+
  20
+<FORM action="#" onsubmit="return false">
  21
+<H3>Text:</H3>
  22
+<TEXTAREA ID="text" STYLE="width: 100%" ROWS=10 onChange="textchange()">'Twas brillig, and the slithy toves
  23
+Did gyre and gimble in the wabe.
  24
+All mimsy were the borogroves,
  25
+And the mome raths outgrabe.</TEXTAREA>
  26
+
  27
+<H3>Fuzzy pattern:</H3>
  28
+<P><INPUT ID="pattern" SIZE=32 VALUE="slimy tools"> <SPAN ID="maxlengthspan"></SPAN><BR>
  29
+Aproximate pattern to search for in the text.  Due to limitations of the Bitap algorithm, the pattern has a limited length.</P>
  30
+
  31
+<H3>Fuzzy location:</H3>
  32
+<P><INPUT ID="loc" SIZE=4 MAXLENGTH=10 VALUE="30"> <SPAN ID="maxtextspan"></SPAN><BR>
  33
+Aproximately where in the text is the pattern expected to be found?</P>
  34
+
  35
+<H3>Match distance:</H3>
  36
+<P><INPUT TYPE="text" SIZE=3 MAXLENGTH=8 VALUE="1000" ID="distance"><BR>
  37
+Determines how close the match must be to the fuzzy location (specified above).  An exact letter match which is 'distance' characters away from the fuzzy location would
  38
+score as a complete mismatch.  A distance of '0' requires the match be at the exact location specified, a threshold of '1000'
  39
+would require a perfect match to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.</P>
  40
+
  41
+<H3>Match threshold:</H3>
  42
+<P><INPUT TYPE="text" SIZE=3 MAXLENGTH=5 VALUE="0.8" ID="threshold"><BR>
  43
+At what point does the match algorithm give up.  A threshold of '0.0' requires a perfect match (of both letters and location), a threshold of '1.0' would match anything.</P>
  44
+
  45
+<INPUT TYPE="button" onClick="launch()" VALUE="Compute Match">
  46
+</FORM>
  47
+
  48
+<DIV ID="outputdiv"></DIV>
  49
+
  50
+<DIV ID="datediv"></DIV>
  51
+
  52
+<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
  53
+var dmp = new diff_match_patch();
  54
+
  55
+function launch() {
  56
+  var text = document.getElementById('text').value;
  57
+  var pattern = document.getElementById('pattern').value;
  58
+  var loc = parseInt(document.getElementById('loc').value, 10);
  59
+
  60
+  dmp.Match_Distance = parseFloat(document.getElementById('distance').value);
  61
+  dmp.Match_Threshold = parseFloat(document.getElementById('threshold').value);
  62
+
  63
+  var ms_start = (new Date()).getTime();
  64
+  var match = dmp.match_main(text, pattern, loc);
  65
+  var ms_end = (new Date()).getTime();
  66
+
  67
+  document.getElementById('datediv').innerHTML = 'Time: ' + (ms_end - ms_start) / 1000  + 's';
  68
+  if (match == -1) {
  69
+    document.getElementById('outputdiv').innerHTML = 'No match found.';
  70
+  } else {
  71
+    var quote = text.substring(match, match + pattern.length);
  72
+    quote = quote.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
  73
+    quote = quote.replace(/\n/g, '&para;');
  74
+    document.getElementById('outputdiv').innerHTML = 'Match found at character ' + match +
  75
+        ': &nbsp; <CODE>' + quote + '</' + 'CODE>';
  76
+  }
  77
+}
  78
+
  79
+function textchange() {
  80
+  document.getElementById('maxtextspan').innerHTML = '(text is currently ' + document.getElementById('text').value.length + ' characters long)';
  81
+}
  82
+
  83
+textchange();
  84
+document.getElementById('pattern').maxLength = dmp.Match_MaxBits;
  85
+document.getElementById('maxlengthspan').innerHTML = '(maxlength in this browser: ' + dmp.Match_MaxBits + ')';
  86
+</SCRIPT>
  87
+
  88
+<HR>
  89
+Back to <A HREF="http://code.google.com/p/google-diff-match-patch/">Diff, Match and Patch</A>
  90
+
  91
+</BODY>
  92
+</HTML>
121  server/zanata-war/src/main/resources/org/zanata/webtrans/public/diff_match_patch/demos/demo_patch.html
... ...
@@ -0,0 +1,121 @@
  1
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2
+<HTML>
  3
+<HEAD>
  4
+  <TITLE>Diff, Match and Patch: Demo of Patch</TITLE>
  5
+  <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="../javascript/diff_match_patch.js"></SCRIPT>
  6
+</HEAD>
  7
+
  8
+<BODY>
  9
+<H1>Diff, Match and Patch</H1>
  10
+<H2>Demo of Patch</H2>
  11
+
  12
+<P>Two texts can be diffed against each other, generating a list of patches.
  13
+These patches can then be applied against a third text.  If the third text has edits of its own, this version of patch
  14
+will apply its changes on a best-effort basis, reporting which patches succeeded and which failed.</P>
  15
+
  16
+<P>In this scenario Shakespeare wrote Hamlet in old English, the source document.  Then two derivative
  17
+works were created.  One is Hamlet updated to modern English.  The other is a Star Trek parody in old English.
  18
+This demonstrantion creates a list of patches between the source and the modern English version.  Then it
  19
+applies those patches onto the Star Trek parody, thus creating a Star Trek parody in
  20
+modern English.</P>
  21
+
  22
+<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
  23
+var dmp = new diff_match_patch();
  24
+
  25
+var patch_text = '';
  26
+
  27
+function diff_launch() {
  28
+  var text1 = document.getElementById('text1a').value;
  29
+  var text2 = document.getElementById('text2a').value;
  30
+
  31
+  var ms_start = (new Date).getTime();
  32
+  var diff = dmp.diff_main(text1, text2, true);
  33
+  var ms_end = (new Date).getTime();
  34
+
  35
+  if (diff.length > 2) {
  36
+    dmp.diff_cleanupSemantic(diff);
  37
+  }
  38
+
  39
+  var patch_list = dmp.patch_make(text1, text2, diff);
  40
+  patch_text = dmp.patch_toText(patch_list);
  41
+
  42
+  document.getElementById('diffdatediv').innerHTML =
  43
+      'Time: ' + (ms_end - ms_start) / 1000 + 's';
  44
+  document.getElementById('diffoutputdiv').innerHTML =
  45
+      '<FIELDSET><LEGEND>Patch:</' + 'LEGEND><PRE>' + patch_text +
  46
+      '</' + 'PRE></' + 'FIELDSET>';
  47
+  //document.getElementById('diffoutputdiv').innerHTML = dmp.diff_prettyHtml(diff);
  48
+  document.getElementById('patchbutton').disabled = false;
  49
+}
  50
+
  51
+
  52
+function patch_launch() {
  53
+  var text1 = document.getElementById('text1b').value;
  54
+  var patches = dmp.patch_fromText(patch_text);
  55
+
  56
+  var ms_start = (new Date).getTime();
  57
+  var results = dmp.patch_apply(patches, text1);
  58
+  var ms_end = (new Date).getTime();
  59
+
  60
+  document.getElementById('patchdatediv').innerHTML =
  61
+      'Time: ' + (ms_end - ms_start) / 1000 + 's';
  62
+  document.getElementById('text2b').value = results[0];
  63
+  results = results[1];
  64
+  var html = '';
  65
+  for (var x = 0; x < results.length; x++) {
  66
+    if (results[x]) {
  67
+      html += '<LI><FONT COLOR="#009900">Ok</' + 'FONT>';
  68
+    } else {
  69
+      html += '<LI><FONT COLOR="#990000">Fail</' + 'FONT>';
  70
+    }
  71
+  }
  72
+  document.getElementById('passfaildiv').innerHTML = html;
  73
+}
  74
+</SCRIPT>
  75
+
  76
+<FORM action="#" onsubmit="return false">
  77
+<H3>Shakespeare's copy:</H3>
  78
+<TABLE WIDTH="100%"><TR>
  79
+  <TD WIDTH="50%">Old Version:<BR><TEXTAREA ID="text1a" STYLE="width: 100%" ROWS=10>Hamlet: Do you see yonder cloud that's almost in shape of a camel?
  80
+Polonius: By the mass, and 'tis like a camel, indeed.
  81
+Hamlet: Methinks it is like a weasel.
  82
+Polonius: It is backed like a weasel.
  83
+Hamlet: Or like a whale?
  84
+Polonius: Very like a whale.
  85
+-- Shakespeare</TEXTAREA></TD>
  86
+  <TD WIDTH="50%">New Version:<BR><TEXTAREA ID="text2a" STYLE="width: 100%" ROWS=10>Hamlet: Do you see the cloud over there that's almost the shape of a camel?
  87
+Polonius: By golly, it is like a camel, indeed.
  88
+Hamlet: I think it looks like a weasel.
  89
+Polonius: It is shaped like a weasel.
  90
+Hamlet: Or like a whale?
  91
+Polonius: It's totally like a whale.
  92
+-- Shakespeare</TEXTAREA></TD>
  93
+</TR></TABLE>
  94
+<P><INPUT TYPE="button" onClick="diff_launch()" VALUE="Compute Patch"></P>
  95
+<BLOCKQUOTE><DIV ID="diffoutputdiv"></DIV></BLOCKQUOTE>
  96
+
  97
+<DIV ID="diffdatediv"></DIV>
  98
+
  99
+<H3>Trekkie's copy:</H3>
  100
+<TABLE WIDTH="100%"><TR>
  101
+  <TD WIDTH="50%">Old Version:<BR><TEXTAREA ID="text1b" STYLE="width: 100%" ROWS=10>Kirk: Do you see yonder cloud that's almost in shape of a Klingon?
  102
+Spock: By the mass, and 'tis like a Klingon, indeed.
  103
+Kirk: Methinks it is like a Vulcan.
  104
+Spock: It is backed like a Vulcan.
  105
+Kirk: Or like a Romulan?
  106
+Spock: Very like a Romulan.
  107
+-- Trekkie</TEXTAREA></TD>
  108
+  <TD WIDTH="50%">New Version:<BR><TEXTAREA READONLY ID="text2b" STYLE="width: 100%" ROWS=10></TEXTAREA></TD>
  109
+</TR></TABLE>
  110
+<INPUT TYPE="button" ID="patchbutton" onClick="patch_launch()" VALUE="Apply Patch" DISABLED>
  111
+</FORM>
  112
+
  113
+<OL ID="passfaildiv"></OL>
  114
+<DIV ID="patchdatediv"></DIV>
  115
+
  116
+<HR>
  117
+Back to <A HREF="http://code.google.com/p/google-diff-match-patch/">Diff, Match and Patch</A>
  118
+
  119
+</BODY>