compare build script updates
diff --git a/bundles/org.eclipse.orion.client.ui/web/compare/builder/AlmondBuilder/compareBuild.bat b/bundles/org.eclipse.orion.client.ui/web/compare/builder/AlmondBuilder/compareBuild.bat
index e43f209..05bf4b4 100644
--- a/bundles/org.eclipse.orion.client.ui/web/compare/builder/AlmondBuilder/compareBuild.bat
+++ b/bundles/org.eclipse.orion.client.ui/web/compare/builder/AlmondBuilder/compareBuild.bat
@@ -2,8 +2,8 @@
 node ./copy/copy.js "D:/JazzIntegration/OrionSource/org.eclipse.orion.client/bundles"

 xcopy /y .\temp\compare\builder\i18n.js .\temp\orion

 node ./node_modules/requirejs/bin/r.js -o temp/compare/builder/compare.css.build.json cssIn=temp/compare/builder/compareBuilder.css out=output/built-compare.css

-node ./node_modules/requirejs/bin/r.js -o temp/compare/builder/compare.build.json name=temp/compare/builder/compare out=output/built-compare.js baseUrl=temp  optimize="none"

-node ./node_modules/requirejs/bin/r.js -o temp/compare/builder/compare.build.json name=temp/compare/builder/compare out=output/built-compare.min.js baseUrl=temp

 cd temp

+node ../node_modules/requirejs/bin/r.js -o compare/builder/compare.build.json name=compare/builder/compare out=../output/built-compare.js baseUrl=.  optimize="none"

+node ../node_modules/requirejs/bin/r.js -o compare/builder/compare.build.json name=compare/builder/compare out=../output/built-compare.min.js baseUrl=.

 java -classpath ../builderLibs/js.jar;../builderLibs/compiler.jar org.mozilla.javascript.tools.shell.Main ../builderLibs/r.js -o compare/builder/compare.build.almond-js.js optimize="none" out="../output/built-compare-amd.js" dir=

 java -classpath ../builderLibs/js.jar;../builderLibs/compiler.jar org.mozilla.javascript.tools.shell.Main ../builderLibs/r.js -o compare/builder/compare.build.almond-js.js optimize="closure" out="../output/built-compare-amd.min.js" dir=

diff --git a/bundles/org.eclipse.orion.client.ui/web/compare/builder/compare.build.json b/bundles/org.eclipse.orion.client.ui/web/compare/builder/compare.build.json
index a4314b3..11a7978 100644
--- a/bundles/org.eclipse.orion.client.ui/web/compare/builder/compare.build.json
+++ b/bundles/org.eclipse.orion.client.ui/web/compare/builder/compare.build.json
@@ -1,5 +1,5 @@
 ({

-    baseUrl: '.',

+    baseUrl: '../../',

 	closure: {

 		CompilerOptions: {},

 		CompilationLevel: 'SIMPLE_OPTIMIZATIONS',

diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/compare.build.json b/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/compare.build.json
deleted file mode 100644
index 3920ad2..0000000
--- a/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/compare.build.json
+++ /dev/null
@@ -1,22 +0,0 @@
-({

-    baseUrl: '.',

-	closure: {

-		CompilerOptions: {},

-		CompilationLevel: 'SIMPLE_OPTIMIZATIONS',

-		loggingLevel: 'WARNING'

-	},

-	paths: {

-        text: 'requirejs/text',

-        i18n: 'requirejs/i18n',

-	    domReady: 'requirejs/domReady'

-	},

-	name: "orion/compare/builder/compare",

-	preserveLicenseComments: false,

-	uglify: {

-		ascii_only: true

-	},

-	wrap: {

-		start: "/* orion compare */ ", //start cannot be empty

-		end: " define(['orion/compare/builder/compare'], function(compare) {return compare;});"

-	}

-})
\ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/compare.css.build.json b/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/compare.css.build.json
deleted file mode 100644
index b192512..0000000
--- a/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/compare.css.build.json
+++ /dev/null
@@ -1,26 +0,0 @@
-({

-    optimizeCss: "standard.keepLines",

-

-    closure: {

-        CompilerOptions: {},

-        CompilationLevel: 'SIMPLE_OPTIMIZATIONS',

-        loggingLevel: 'WARNING'

-    },

-

-    pragmas: {

-        asynchLoader: true

-    },

-

-    locale: 'en-us',

-    inlineText: true,

-

-    baseUrl: '.',

-

-    // set the paths to our library packages

-    packages: [],

-    paths: {

-        text: 'requirejs/text',

-        i18n: 'requirejs/i18n',

-	    domReady: 'requirejs/domReady'

-    }

-})
\ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/compare.js b/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/compare.js
deleted file mode 100644
index f7cfd38..0000000
--- a/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/compare.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * @license
- * Copyright (c) 2011, 2012 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html),
- * and the Eclipse Distribution License v1.0
- * (http://www.eclipse.org/org/documents/edl-v10.html).
- * 
- * Contributors: IBM Corporation - initial API and implementation
- ******************************************************************************/
-/*global define require document console prompt XMLHttpRequest window*/
-
-define(['orion/commandRegistry',
-		'orion/Deferred',
-		'orion/compare/compareView',
-		'orion/compare/compareCommands',
-		'orion/compare/compareHighlighter'],
-function(mCommandRegistry, Deferred, mCompareView, mCompareCommands, mCompareHighlighter) {
-	var commandService = new mCommandRegistry.CommandRegistry({
-	});
-
-	function _fileExt(fName){
-		var splitName = fName.split("."); //$NON-NLS-0$
-		var ext = "js"; //$NON-NLS-0$
-		if(splitName.length > 1){
-			ext = splitName[splitName.length - 1];
-		}
-		return ext;
-	}
-	
-	function _contentType(fName){
-		var ext = _fileExt(fName);
-		var cType = {id: "application/javascript"}; //$NON-NLS-0$
-		switch (ext) {
-			case "java": //$NON-NLS-0$
-				cType.id = "text/x-java-source"; //$NON-NLS-0$
-				break;
-			case "css": //$NON-NLS-0$
-				cType.id = "text/css"; //$NON-NLS-0$
-				break;
-		}
-		return cType;
-	}
-	
-	function _getFile(fileURL){
-		var d = new Deferred(); // create a promise
-		var xhr = new XMLHttpRequest();
-		xhr.open('GET', fileURL, true); //$NON-NLS-0$
-		xhr.onreadystatechange = function() {
-			if (xhr.readyState === 4) {
-				var response = typeof xhr.response !== 'undefined' ? xhr.response : xhr.responseText; //$NON-NLS-0$
-				var responseText = typeof response === 'string' ? response : null; //$NON-NLS-0$
-				var statusCode = xhr.status;
-				if (200 <= statusCode && statusCode < 400) {
-					d.resolve(responseText);
-				} else {
-					d.reject(responseText);
-				}
-			}
-		};
-		xhr.send();	
-		return d;
-	}
-	
-	/**
-	 * @class This object describes options of a file. Two instances of this object construct the core parameters of a compare view. 
-	 * @name orion.compare.FileOptions
-	 *
-	 * @property {String} Content the text contents of the file unit. Requied.
-	 * @property {String} Name the file name. Required for syntax highlight.
-	 * @property {Boolean} [readonly=true] whether or not the file is in readonly mode. Optional.
-	 */
-	/**
-	 * @class This object describes the options for <code>compare</code>.
-	 * @name orion.compare.CompareOptions
-	 *
-	 * @property {String} parentDivID Required. the parent element id for the compare view. Required. The parentDivID is required to prefix the ids of sub components in case of side by side view.
-	 * @property {orion.compare.FileOptions} [oldFile] Required. the options of the file that is original. Required. In the two way compare case, this file is dispalyed on the left hand side.
-	 * @property {orion.compare.FileOptions} [newFile] Required. the options of the file that is compared against the original. Required. In the two way compare case, this file is dispalyed on the right hand side.
-	 * @property {Boolean} [showTitle=false] Optional. whether or not to show the two file names on each side of the compare view.
-	 * @property {Boolean} [showLineStatus=false] Optional. whether or not to show the current line and column number fo the caret on each side of the view. Not avaible for inline/unified compare view.
-	 */
-	/**
-	 * Creates a compare view instance by given view options and othe parameters.
-	 * 
-	 * @param {orion.compare.CompareOptions} viewOptions Required. The comapre view option.
-	 * @param {String} commandSpanId Optional. The dom element id to render all the commands that toggles compare view and navigates diffs. If not defined, no command is rendered.
-	 * @param {String} [viewType="twoWay"] optional. The type of the compare view. Can be either "twoWay" or "inline". Id not defined default is "twoWay".
-	 * "twoWay" represents a side by side comapre editor while "inline" represents a unified comapre view.
-	 * @param {Boolean} [toggleable=false] optional. Weather or not the compare view is toggleable. A toggleable comapre view provides a toggle button which toggles between the "twoWay" and "inline" view.
-	 */
-    function compare(viewOptions, commandSpanId, viewType, toggleable){
-		var vOptions = viewOptions;
-		if(!vOptions.highlighters && vOptions.oldFile && vOptions.oldFile.Name && vOptions.newFile && vOptions.newFile.Name){
-			vOptions.highlighters = [new mCompareHighlighter.DefaultHighlighter(), new mCompareHighlighter.DefaultHighlighter()];
-		}
-		if(vOptions.oldFile && vOptions.oldFile.Name){
-			vOptions.oldFile.Type = _contentType(vOptions.oldFile.Name);
-		}
-		if(vOptions.newFile && vOptions.newFile.Name){
-			vOptions.newFile.Type = _contentType(vOptions.newFile.Name);
-		}
-		if(commandSpanId) {
-			var cmdProvider = new mCompareCommands.CompareCommandFactory({commandService: commandService, commandSpanId: commandSpanId});
-			vOptions.commandProvider = cmdProvider;
-		}
-		var vType = (viewType === "inline") ? "inline" : "twoWay"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
-		if(toggleable) {
-			this.compareView = new mCompareView.toggleableCompareView(vType, vOptions);
-		} else if(vType === "inline") { //$NON-NLS-0$
-			this.compareView = new mCompareView.inlineCompareView(vOptions);
-		} else {
-			this.compareView = new mCompareView.TwoWayCompareView(vOptions);
-		}
-		this.compareView.startup();
-    }
-	compare.prototype = {
-		getCompareView: function(){
-			return this.compareView;
-		},
-		refresh: function(){
-			var options = this.getCompareView().getWidget().options;
-			if(options.oldFile.URL && options.newFile.URL){
-				var promises = [];
-				promises.push( _getFile(options.oldFile.URL));
-				promises.push( _getFile(options.newFile.URL));
-				Deferred.all(promises, function(error) { return {_error: error}; }).then(function(results){
-					this.getCompareView().getWidget().options.oldFile.Content = results[0];
-					this.getCompareView().getWidget().options.newFile.Content = results[1];
-					this.getCompareView().getWidget().refresh(true);
-				}.bind(this));
-			} else {
-				this.getCompareView().getWidget().refresh(true);
-			}
-		}
-	};
-    return compare;
-});
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/i18n.js b/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/i18n.js
deleted file mode 100644
index b6f0572..0000000
--- a/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/i18n.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * @license
- * Copyright (c) 2010, 2012 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials are made 
- * available under the terms of the Eclipse Public License v1.0 
- * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
- * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
- * 
- * Contributors: IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-/*global define */
-define({
-	load: function(name, parentRequire, onLoad, config) {
-		if (parentRequire.specified && parentRequire.specified("orion/bootstrap")) { //$NON-NLS-0$
-			parentRequire(["orion/i18n!" + name], function(languages) { //$NON-NLS-0$
-				onLoad(languages);
-			});
-		} else {
-			onLoad({});
-		}
-	}
-});
\ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/imageText.css b/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/imageText.css
deleted file mode 100644
index 5093dbe..0000000
--- a/bundles/org.eclipse.orion.client.ui/web/orion/compare/builder/imageText.css
+++ /dev/null
@@ -1,20 +0,0 @@
-.commandSprite {

-	width: 16px;

-	height: 16px;

-	display: inline-block;

-	vertical-align: middle;

-	background-position: center;

-	background-repeat: no-repeat;

-}

-.core-sprite-leftarrow {

-	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo5M0JBQTM5NjI5QjdFMTExOEY5OUQ3RjZDMjA5NUU0MyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1RkZFN0QyQkI3MzMxMUUxQTlEMUU3MTBEQTc4OEQxOCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1RkZFN0QyQUI3MzMxMUUxQTlEMUU3MTBEQTc4OEQxOCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjg2QjE1NUZBMkVCN0UxMTFCNEY2RUZCRkU2REFGRjFCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjkzQkFBMzk2MjlCN0UxMTE4Rjk5RDdGNkMyMDk1RTQzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Mp+eDQAAAAZQTFRFMzMzMzMzTgAGOgAAAAJ0Uk5T/wDltzBKAAAAN0lEQVR42oSPMQoAIAzE4v8/LQgqJoNZCqG0dwzBnrwCCSS4LIEEEvDb6I1+aY4mbZe2PUwBBgBOlwCZG5rAGwAAAABJRU5ErkJggg==);

-}

-.core-sprite-move-down { 

-	background-image: url(data:image/gif;base64,R0lGODlhEAAQALMAAAAAAP////8A/7+/v56enn19fW5ubjMzM////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAgALAAAAAAQABAAAAQkEMlJqz04Hzt15pKHgYi4gSaZVqbYtRoFj2yLumpMhvQe+sAIADs=);

-}

-.core-sprite-move-up {

-	background-image: url(data:image/gif;base64,R0lGODlhEAAQALMAAAAAAP////8A/7+/v56enn19fW5ubjMzM////wAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAgALAAAAAAQABAAAAQiEMlJq53n3sM15aCHgKRGntapfuoqtS6LmnFaV62X07OoRQA7); 

-}

-.core-sprite-rightarrow {

-	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo5M0JBQTM5NjI5QjdFMTExOEY5OUQ3RjZDMjA5NUU0MyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpCQTE3MDhGQUI3MzIxMUUxQUFDQUM5QjFCREQ4RkJBOSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCQTE3MDhGOUI3MzIxMUUxQUFDQUM5QjFCREQ4RkJBOSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjg0QjE1NUZBMkVCN0UxMTFCNEY2RUZCRkU2REFGRjFCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjkzQkFBMzk2MjlCN0UxMTE4Rjk5RDdGNkMyMDk1RTQzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+qJz3hQAAAAZQTFRFMzMzMzMzTgAGOgAAAAJ0Uk5T/wDltzBKAAAANUlEQVR42mJgRAMMMJoBQ4ABQ4ABKsCAABgCDBgCDBgCDIRUYLcFwx04XYrmFwzfwgFAgAEATiEAmfafHIEAAAAASUVORK5CYII=);

-}

diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/compare/examples/standalone/demo.html b/bundles/org.eclipse.orion.client.ui/web/orion/compare/examples/standalone/demo.html
index df25790..8f6b2ec 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/compare/examples/standalone/demo.html
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/compare/examples/standalone/demo.html
@@ -25,11 +25,11 @@
 	<script>
     require(["built-compare.min.js"], function(Compare) {
 	-->
-    <link rel="stylesheet" type="text/css" href="http://eclipse.org/orion/compare/releases/4.0/built-compare.css"/>
+    <link rel="stylesheet" type="text/css" href="http://eclipse.org/orion/compare/releases/5.0/built-compare.css"/>
 	<script src="http://requirejs.org/docs/release/2.1.4/minified/require.js"></script>
 	<script>
 	/*global require window */
-    require(["http://eclipse.org/orion/compare/releases/4.0/built-compare.min.js"], function(Compare) {
+    require(["http://eclipse.org/orion/compare/releases/5.0/built-compare.min.js"], function(Compare) {
 	var document = window.document;
 
 	/** Buttons */	
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/compare/examples/standalone/demoAlmond.html b/bundles/org.eclipse.orion.client.ui/web/orion/compare/examples/standalone/demoAlmond.html
new file mode 100644
index 0000000..42e3da1
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/compare/examples/standalone/demoAlmond.html
@@ -0,0 +1,508 @@
+<!doctype html>
+<html>
+<head>
+	<title>Orion Compare Editor Sample</title>
+	<style type="text/css">
+		body {
+			margin: 0;
+			padding: 0;
+			overflow: hidden;
+			background-color: #ededed;
+		}
+		.compareContainer {
+			position: absolute;
+			top: 80px;  /* $ToolbarHeight + 1 */
+			bottom: 0;
+			width: 99%;
+			overflow-y: auto;
+			margin-left:5px;
+			border:1px solid #bebebe;
+		}
+	</style>
+    <link rel="stylesheet" type="text/css" href="http://eclipse.org/orion/compare/releases/5.0/built-compare.css"/>
+	<script src="http://eclipse.org/orion/compare/releases/5.0/built-compare-amd.min.js"></script>
+	<script>
+	/*global orion window */
+ window.onload=function(){
+ 	var document = window.document;
+
+	/** Buttons */	
+	var bCompare = document.getElementById("doCompare"); //$NON-NLS-0$
+	var bLoadSample = document.getElementById("loadSample"); //$NON-NLS-0$
+	var bAnimateDiffs = document.getElementById("animateDiffs"); //$NON-NLS-0$
+	
+	var bCompareType = document.getElementById("compareTypeSelect"); //$NON-NLS-0$
+	var bContentTypeTD = document.getElementById("contentTypes"); //$NON-NLS-0$
+	var bContentType = document.getElementById("contentTypeSelect"); //$NON-NLS-0$
+	var bAnimateInterval = document.getElementById("animateInterval"); //$NON-NLS-0$
+	
+	var compareType = "byTwoContents"; //$NON-NLS-0$
+	var contentType = "js"; //$NON-NLS-0$
+	
+	
+	var contentOnLeft = "Sample Orion compare contents on left side\n\nYou can replace the contents here and and click on [Compare Again] to see the new result\n"; //$NON-NLS-0$
+	var	contentOnRight = "Sample Orion compare contents on right side\n\nYou can replace the contents here and and click on [Compare Again] to see the new result\n"; //$NON-NLS-0$
+	var contentOnLeftURL = "Put file URL here\n"; //$NON-NLS-0$
+	var	contentOnRightURL = "Put file URL here\n"; //$NON-NLS-0$
+	
+    var options = {
+        parentDivId: "compareParentDiv", //$NON-NLS-0$
+        newFile: {
+            Name: "left." + contentType, //$NON-NLS-0$
+            readonly: false,
+            Content: contentOnLeft
+        },
+        oldFile: {
+            Name: "right." + contentType, //$NON-NLS-0$
+            readonly: false,
+            Content: contentOnRight
+        }
+    };
+	
+	var compare = new orion.compare.comparer(options, "compareCmdDiv", "twoWay", true/*toggleable*/); //$NON-NLS-1$ //$NON-NLS-0$
+	
+	function getFile(file) {
+		try {
+			var objXml = new XMLHttpRequest();
+			objXml.open("GET",file,false); //$NON-NLS-0$
+			objXml.send(null);
+			return objXml.responseText;
+		} catch (e) {
+			return null;
+		}
+	}
+
+	function onLoadSample() {
+		if(sampleLeft && sampleRight) {
+			bCompareType.selectedIndex = 0;
+			compareType = bCompareType.options[bCompareType.selectedIndex].value;
+			bContentType.selectedIndex = 0;
+			contentType = bContentType.options[bContentType.selectedIndex].value;
+			bContentTypeTD.style.display = "block"; //$NON-NLS-0$
+			
+			var widget = compare.getCompareView().getWidget();
+			widget.options.oldFile.Content = sampleRight;
+			widget.options.newFile.Content = sampleLeft;
+			widget.options.oldFile.URL = null;
+			widget.options.newFile.URL = null;
+			widget.options.oldFile.Name = "sampleRight.js"; //$NON-NLS-0$
+			widget.options.newFile.Name = "sampleLeft.js"; //$NON-NLS-0$
+			widget.options.mapper = null;
+			compare.refresh(true);
+		}
+	}
+	function animateDiffs() {
+		var widget = compare.getCompareView().getWidget();
+		if(widget.nextChange()){
+			var interval = parseInt(bAnimateInterval.options[bAnimateInterval.selectedIndex].value, 10);
+			window.setTimeout(animateDiffs, interval);
+		}
+	}
+	function onAnimateDiffs() {
+		var widget = compare.getCompareView().getWidget();
+		widget.initDiffNav();
+		var interval = parseInt(bAnimateInterval.options[bAnimateInterval.selectedIndex].value, 10);
+		window.setTimeout(animateDiffs, interval);
+	}
+	function doCompare() {
+		var widget = compare.getCompareView().getWidget();
+		if(widget.type === "twoWay"){ //$NON-NLS-0$
+			var editors = widget.getEditors();
+			var oldContents = editors[0].getTextView().getText();
+			var newContents = editors[1].getTextView().getText();
+			if(compareType === "byTwoContents"){ //$NON-NLS-0$
+				widget.options.oldFile.Content = oldContents;
+				widget.options.newFile.Content = newContents;
+				widget.options.oldFile.URL = null;
+				widget.options.newFile.URL = null;
+			} else {
+				widget.options.oldFile.URL = oldContents;
+				widget.options.newFile.URL = newContents;
+				bCompareType.selectedIndex = 0;
+				compareType = bCompareType.options[bCompareType.selectedIndex].value;
+				bContentTypeTD.style.display = "block"; //$NON-NLS-0$
+			}
+			widget.options.mapper = null;
+			compare.refresh(true);
+			//widget.refresh();
+		}
+	}
+	function onCompareType(evt) {
+		compareType = bCompareType.options[bCompareType.selectedIndex].value;
+		var widget = compare.getCompareView().getWidget();
+		if(compareType === "byTwoContents"){ //$NON-NLS-0$
+			widget.options.oldFile.Content = contentOnRight;
+			widget.options.newFile.Content = contentOnLeft;
+			widget.options.oldFile.URL = null;
+			widget.options.newFile.URL = null;
+			bContentTypeTD.style.display = "block"; //$NON-NLS-0$
+		} else {
+			widget.options.oldFile.Content = contentOnRightURL;
+			widget.options.newFile.Content = contentOnLeftURL;
+			widget.options.oldFile.URL = null;
+			widget.options.newFile.URL = null;
+			bContentTypeTD.style.display = "none"; //$NON-NLS-0$
+		}
+		widget.options.mapper = null;
+		widget.refresh(true);
+	}
+	
+	function onContentType(evt) {
+		contentType = bContentType.options[bContentType.selectedIndex].value;
+		var widget = compare.getCompareView().getWidget();
+		widget.options.oldFile.Name = "right." + contentType; //$NON-NLS-0$
+		widget.options.newFile.Name = "left." + contentType; //$NON-NLS-0$
+	}
+	
+	/* Adding events */
+	bCompare.onclick = doCompare;
+	bLoadSample.onclick = onLoadSample;
+	bAnimateDiffs.onclick = onAnimateDiffs;
+	bCompareType.onchange = onCompareType;
+	bContentType.onchange = onContentType;
+	
+		var sampleLeft = "/*******************************************************************************\n" + 
+				" * @license\n" + 
+				" * Copyright (c) 2012, 2013 IBM Corporation and others.\n" + 
+				" * All rights reserved. This program and the accompanying materials are made \n" + 
+				" * available under the terms of the Eclipse Public License v3.0 \n" + 
+				" * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution \n" + 
+				" * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). \n" + 
+				" *\n" + 
+				" * Contributors:\n" + 
+				" *     IBM Corporation - initial API and implementation\n" + 
+				" *******************************************************************************/\n" + 
+				" \n" + 
+				"/*globals define XMLHttpRequest window */\n" + 
+				"\n" + 
+				"define(['orion/compare/builder/compare'],   \n" + 
+				" \n" + 
+				"function(Compare) {\n" + 
+				"	var document = window.document;\n" + 
+				"\n" + 
+				"	/** Buttons */	\n" + 
+				"	var bCompare = document.getElementById(\"doCompare\"); //$NON-NLS-0$\n" + 
+				"	var bLoadSampleNew = document.getElementById(\"loadSample\"); //$NON-NLS-0$\n" + 
+				"	var bCompareTypeNew = document.getElementById(\"compareTypeSelect\"); //$NON-NLS-0$\n" + 
+				"	var bContentTypeTD = document.getElementById(\"contentTypes\"); //$NON-NLS-0$\n" + 
+				"	var bContentType = document.getElementById(\"contentTypeSelect\"); //$NON-NLS-0$\n" + 
+				"	\n" + 
+				"	var compareType = \"byTwoContents\"; //$NON-NLS-0$\n" + 
+				"	var contentType = \"js\"; //$NON-NLS-0$\n" + 
+				"	\n" + 
+				"	\n" + 
+				"	var contentOnLeft = \"Sample Orion compare contents on left side\\n\\nYou can replace the contents here and and click on [Refresh Compare] to see the new result\\n\"; //$NON-NLS-0$\n" + 
+				"	var	contentOnRight = \"Sample Orion compare contents on right side\\n\\nYou can replace the contents here and and click on [Refresh Compare] to see the new result\\n\"; //$NON-NLS-0$\n" + 
+				"	\n" + 
+				"    var options = {\n" + 
+				"        parentDivId: \"compareParentDiv\", //$NON-NLS-0$\n" + 
+				"        commandSpanId: \"compareCmdDiv\", //$NON-NLS-0$\n" + 
+				"        newFile: {\n" + 
+				"            Name: \"left.\" + contentType, //$NON-NLS-0$\n" + 
+				"            readonly: false,\n" + 
+				"            Content: contentOnLeft\n" + 
+				"        },\n" + 
+				"        oldFile: {\n" + 
+				"            Name: \"right.\" + contentType, //$NON-NLS-0$\n" + 
+				"            readonly: false,\n" + 
+				"            Content: contentOnRight\n" + 
+				"        }\n" + 
+				"    };\n" + 
+				"	\n" + 
+				"	var compare = new Compare(options);\n" + 
+				"	\n" + 
+				"	function getFile(file) {\n" + 
+				"		try {\n" + 
+				"			var objXml = new XMLHttpRequest();\n" + 
+				"			objXml.open(\"GET\",file,false); //$NON-NLS-0$\n" + 
+				"			objXml.send(null);\n" + 
+				"			return objXml.responseText;\n" + 
+				"		} catch (e) {\n" + 
+				"			return null;\n" + 
+				"		}\n" + 
+				"	}\n" + 
+				"\n" + 
+				"	function onLoadSample() {\n" + 
+				"		var sampleLeft = getFile(\"./standalone/sampleLeft.js\");\n" + 
+				"		var sampleRight = getFile(\"./standalone/sampleRight.js\");\n" + 
+				"		if(sampleLeft && sampleRight) {\n" + 
+				"			bCompareType.selectedIndex = 0;\n" + 
+				"			compareType = bCompareType.options[bCompareType.selectedIndex].value;\n" + 
+				"			bContentType.selectedIndex = 0;\n" + 
+				"			contentType = bContentType.options[bContentType.selectedIndex].value;\n" + 
+				"			bContentTypeTD.style.display = \"block\"; //$NON-NLS-0$\n" + 
+				"			\n" + 
+				"			var widget = compare.getCompareView().getWidget();\n" + 
+				"			widget.options.oldFile.Content = sampleRight;\n" + 
+				"			widget.options.newFile.Content = sampleLeft;\n" + 
+				"			widget.options.oldFile.URL = null;\n" + 
+				"			widget.options.newFile.URL = null;\n" + 
+				"			widget.options.oldFile.Name = \"sampRight.js\";\n" + 
+				"			widget.options.newFile.Name = \"sampleLeft.js\";\n" + 
+				"			widget.options.mapper = null;\n" + 
+				"			compare.refresh();\n" + 
+				"		}\n" + 
+				"	}\n" + 
+				"	function doCompare() {\n" + 
+				"		var widget = compare.getCompareView().getWidget();\n" + 
+				"		if(widget.type === \"twoWay\"){ //$NON-NLS-0$\n" + 
+				"			var editors = widget._editors;\n" + 
+				"			var oldContents = editors[0].getTextView().getText();\n" + 
+				"			var newContents = editors[1].getTextView().getText();\n" + 
+				"			if(compareType === \"byTwoContents\"){ //$NON-NLS-0$\n" + 
+				"				widget.options.oldFile.Content = oldContents;\n" + 
+				"				widget.options.newFile.Content = newContents;\n" + 
+				"				widget.options.oldFile.URL = null;\n" + 
+				"				widget.options.newFile.URL = null;\n" + 
+				"			} else {\n" + 
+				"				widget.options.oldFile.URL = oldContents;\n" + 
+				"				widget.options.newFile.URL = newContents;\n" + 
+				"				bCompareType.selectedIndex = 0;\n" + 
+				"				compareType = bCompareType.options[bCompareType.selectedIndex].value;\n" + 
+				"				bContentTypeTD.style.display = \"block\"; //$NON-NLS-0$\n" + 
+				"			}\n" + 
+				"			widget.options.mapper = null;\n" + 
+				"			compare.refresh();\n" + 
+				"			//widget.refresh();\n" + 
+				"		}\n" + 
+				"	}\n" + 
+				"	function onCompareType(evt) {\n" + 
+				"		compareType = bCompareType.options[bCompareType.selectedIndex].value;\n" + 
+				"		var widget = compare.getCompareView().getWidget();\n" + 
+				"		if(compareType === \"byTwoContents\"){ //$NON-NLS-0$\n" + 
+				"			widget.options.oldFile.Content = contentOnRight;\n" + 
+				"			widget.options123.newFile.Content = contentOnLeft123;\n" + 
+				"			widget.opzzzns.oldFile.URL = null;\n" + 
+				"			widget.options.newFile.URL = null;\n" + 
+				"			bContentTypeTD.style.display = \"block\"; //$NON-NLS-0$\n" + 
+				"		} else {\n" + 
+				"			widget.options.oldFile.Content = contentOnRightURL;\n" + 
+				"			widget.options.newFile.Content = contentOnLeftURL;\n" + 
+				"			widget.options.oldFile.URL = null;\n" + 
+				"			widget.options.newFile.URL = null;\n" + 
+				"			bContentTypeTD.style.display = \"none\"; //$NON-NLS-0$\n" + 
+				"		}\n" + 
+				"		widget.options.mapper = null;\n" + 
+				"		widget.refresh();\n" + 
+				"	}\n" + 
+				"	\n" + 
+				"	function onContentType(evt) {\n" + 
+				"		contentTypeNew = bContentType.options[bContentType.selectedIndex].valueNew;\n" + 
+				"		var widget = compare.getCompareView().getWidget();\n" + 
+				"		widget.options.oldFile.Name = \"right.\" + contentType;\n" + 
+				"		widget.options.newFile.Name = \"left.\" + contentType;\n" + 
+				"		\n" + 
+				"		//Added some new stuff here\n" + 
+				"	}\n" + 
+				"	\n" + 
+				"	/* Adding events */\n" + 
+				"	bCompare.onclick = doCompare;\n" + 
+				"	bLoadSample.onclick = onLoadSample;\n" + 
+				"	bCompareType.onchange = onCompareType //something new;\n" + 
+				"	bContentType.onchange = onContentType;\n" + 
+				" });\n" + 
+				"";
+				
+	var sampleRight = "/*******************************************************************************\n" + 
+			" * @license\n" + 
+			" * Copyright (c) 2011, 2012 IBM Corporation and others.\n" + 
+			" * All rights reserved. This program and the accompanying materials are made \n" + 
+			" * available under the terms of the Eclipse Public License v1.0 \n" + 
+			" * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution \n" + 
+			" * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). \n" + 
+			" *\n" + 
+			" * Contributors:\n" + 
+			" *     IBM Corporation - initial API and implementation\n" + 
+			" *******************************************************************************/\n" + 
+			" \n" + 
+			"/*globals define XMLHttpRequest window */\n" + 
+			"\n" + 
+			"define(['orion/compare/builder/compare'],   \n" + 
+			" \n" + 
+			"function(Compare) {\n" + 
+			"	var document = window.document;\n" + 
+			"\n" + 
+			"	/** Buttons */	\n" + 
+			"	var bCompare = document.getElementById(\"doCompare\"); //$NON-NLS-0$\n" + 
+			"	var bLoadSample = document.getElementById(\"loadSample\"); //$NON-NLS-0$\n" + 
+			"	var bCompareType = document.getElementById(\"compareTypeSelect\"); //$NON-NLS-0$\n" + 
+			"	var bContentTypeTD = document.getElementById(\"contentTypes\"); //$NON-NLS-0$\n" + 
+			"	var bContentType = document.getElementById(\"contentTypeSelect\"); //$NON-NLS-0$\n" + 
+			"	\n" + 
+			"	var compareType = \"byTwoContents\"; //$NON-NLS-0$\n" + 
+			"	var contentType = \"js\"; //$NON-NLS-0$\n" + 
+			"	\n" + 
+			"	\n" + 
+			"	var contentOnLeft = \"Sample Orion compare contents on left side\\n\\nYou can replace the contents here and and click on [Refresh Compare] to see the new result\\n\"; //$NON-NLS-0$\n" + 
+			"	var	contentOnRight = \"Sample Orion compare contents on right side\\n\\nYou can replace the contents here and and click on [Refresh Compare] to see the new result\\n\"; //$NON-NLS-0$\n" + 
+			"	var contentOnLeftURL = \"Put file URL here\\n\"; //$NON-NLS-0$\n" + 
+			"	var	contentOnRightURL = \"Put file URL here\\n\"; //$NON-NLS-0$\n" + 
+			"	\n" + 
+			"    var options = {\n" + 
+			"        parentDivId: \"compareParentDiv\", //$NON-NLS-0$\n" + 
+			"        commandSpanId: \"compareCmdDiv\", //$NON-NLS-0$\n" + 
+			"        newFile: {\n" + 
+			"            Name: \"left.\" + contentType, //$NON-NLS-0$\n" + 
+			"            readonly: false,\n" + 
+			"            Content: contentOnLeft\n" + 
+			"        },\n" + 
+			"        oldFile: {\n" + 
+			"            Name: \"right.\" + contentType, //$NON-NLS-0$\n" + 
+			"            readonly: false,\n" + 
+			"            Content: contentOnRight\n" + 
+			"        }\n" + 
+			"    };\n" + 
+			"	\n" + 
+			"	var compare = new Compare(options);\n" + 
+			"	\n" + 
+			"	function getFile(file) {\n" + 
+			"		try {\n" + 
+			"			var objXml = new XMLHttpRequest();\n" + 
+			"			objXml.open(\"GET\",file,false); //$NON-NLS-0$\n" + 
+			"			objXml.send(null);\n" + 
+			"			return objXml.responseText;\n" + 
+			"		} catch (e) {\n" + 
+			"			return null;\n" + 
+			"		}\n" + 
+			"	}\n" + 
+			"\n" + 
+			"	function onLoadSample() {\n" + 
+			"		var sampleLeft = getFile(\"./standalone/sampleLeft.js\");\n" + 
+			"		var sampleRight = getFile(\"./standalone/sampleRight.js\");\n" + 
+			"		if(sampleLeft && sampleRight) {\n" + 
+			"			bCompareType.selectedIndex = 0;\n" + 
+			"			compareType = bCompareType.options[bCompareType.selectedIndex].value;\n" + 
+			"			bContentType.selectedIndex = 0;\n" + 
+			"			contentType = bContentType.options[bContentType.selectedIndex].value;\n" + 
+			"			bContentTypeTD.style.display = \"block\"; //$NON-NLS-0$\n" + 
+			"			\n" + 
+			"			var widget = compare.getCompareView().getWidget();\n" + 
+			"			widget.options.oldFile.Content = sampleRight;\n" + 
+			"			widget.options.newFile.Content = sampleLeft;\n" + 
+			"			widget.options.oldFile.URL = null;\n" + 
+			"			widget.options.newFile.URL = null;\n" + 
+			"			widget.options.oldFile.Name = \"sampRight.js\";\n" + 
+			"			widget.options.newFile.Name = \"sampleLeft.js\";\n" + 
+			"			widget.options.mapper = null;\n" + 
+			"			compare.refresh();\n" + 
+			"		}\n" + 
+			"	}\n" + 
+			"	function doCompare() {\n" + 
+			"		var widget = compare.getCompareView().getWidget();\n" + 
+			"		if(widget.type === \"twoWay\"){ //$NON-NLS-0$\n" + 
+			"			var editors = widget._editors;\n" + 
+			"			var oldContents = editors[0].getTextView().getText();\n" + 
+			"			var newContents = editors[1].getTextView().getText();\n" + 
+			"			if(compareType === \"byTwoContents\"){ //$NON-NLS-0$\n" + 
+			"				widget.options.oldFile.Content = oldContents;\n" + 
+			"				widget.options.newFile.Content = newContents;\n" + 
+			"				widget.options.oldFile.URL = null;\n" + 
+			"				widget.options.newFile.URL = null;\n" + 
+			"			} else {\n" + 
+			"				widget.options.oldFile.URL = oldContents;\n" + 
+			"				widget.options.newFile.URL = newContents;\n" + 
+			"				bCompareType.selectedIndex = 0;\n" + 
+			"				compareType = bCompareType.options[bCompareType.selectedIndex].value;\n" + 
+			"				bContentTypeTD.style.display = \"block\"; //$NON-NLS-0$\n" + 
+			"			}\n" + 
+			"			widget.options.mapper = null;\n" + 
+			"			compare.refresh();\n" + 
+			"			//widget.refresh();\n" + 
+			"		}\n" + 
+			"	}\n" + 
+			"	function onCompareType(evt) {\n" + 
+			"		compareType = bCompareType.options[bCompareType.selectedIndex].value;\n" + 
+			"		var widget = compare.getCompareView().getWidget();\n" + 
+			"		if(compareType === \"byTwoContents\"){ //$NON-NLS-0$\n" + 
+			"			widget.options.oldFile.Content = contentOnRight;\n" + 
+			"			widget.options.newFile.Content = contentOnLeft;\n" + 
+			"			widget.options.oldFile.URL = null;\n" + 
+			"			widget.options.newFile.URL = null;\n" + 
+			"			bContentTypeTD.style.display = \"block\"; //$NON-NLS-0$\n" + 
+			"		} else {\n" + 
+			"			widget.options.oldFile.Content = contentOnRightURL;\n" + 
+			"			widget.options.newFile.Content = contentOnLeftURL;\n" + 
+			"			widget.options.oldFile.URL = null;\n" + 
+			"			widget.options.newFile.URL = null;\n" + 
+			"			bContentTypeTD.style.display = \"none\"; //$NON-NLS-0$\n" + 
+			"		}\n" + 
+			"		widget.options.mapper = null;\n" + 
+			"		widget.refresh();\n" + 
+			"	}\n" + 
+			"	\n" + 
+			"	function onContentType(evt) {\n" + 
+			"		contentType = bContentType.options[bContentType.selectedIndex].value;\n" + 
+			"		var widget = compare.getCompareView().getWidget();\n" + 
+			"		widget.options.oldFile.Name = \"right.\" + contentType;\n" + 
+			"		widget.options.newFile.Name = \"left.\" + contentType;\n" + 
+			"	}\n" + 
+			"	\n" + 
+			"	/* Adding events */\n" + 
+			"	bCompare.onclick = doCompare;\n" + 
+			"	bLoadSample.onclick = onLoadSample;\n" + 
+			"	bCompareType.onchange = onCompareType;\n" + 
+			"	bContentType.onchange = onContentType;\n" + 
+			" });\n" + 
+			"";
+	};
+</script>
+</head>
+
+<body>
+    <div style="height:30px;width:99%;">
+	<table>
+	<tr>
+	<td>
+		<label style="padding-left:5px;margin-top:1px;" for="compareTypeSelect">Compare with</label>
+		<select id="compareTypeSelect" style="margin-top:5px;">
+			<option value="byTwoContents">Two text contents</option>
+			<option value="byFileURLs">Two file URLs</option>
+			<!-- <option value="byDiff">Base contents + unified diff</option> -->
+		</select>
+	</td>
+	<td id="contentTypes">
+		<label style="padding-left:5px;margin-top:1px;" for="fileTypeSelect">Content type</label>
+		<select id="contentTypeSelect" style="margin-top:5px;">
+			<option value="js">JavaScript</option>
+			<option value="html">HTML</option>
+			<option value="css">Css</option>
+			<option value="java">Java</option>
+			<option value="txt">Plain</option>
+		</select>
+	</td>
+	</tr>
+	</table>
+    </div>
+    <hr>
+    <div style="height:28px;width:99%;">
+	<table style="float:left;">
+	<tr>
+	<td>
+		<button id="loadSample" type="button">Load sample</button>
+    </td>
+	<td>
+		<button id="doCompare" type="button">Compare Again</button>
+    </td>
+	<td>
+		<button id="animateDiffs" type="button">Walk all diffs</button>
+    </td>
+	<td>
+		<label for="animateInterval">With</label>
+		<select id="animateInterval">
+			<option value="500">500ms</option>
+			<option value="1000">1000ms</option>
+			<option value="1500">1500ms</option>
+			<option value="2000">2000ms</option>
+			<option value="3000">3000ms</option>
+		</select>
+	</td>
+	</tr>
+	</table>
+        <span id="compareCmdDiv" style="float:right;"></span> 
+    </div>
+    <hr>
+    <div>
+        <div id="compareParentDiv" class="compareContainer"></div>
+    </div>
+</body>
+</html>
\ No newline at end of file