Skip to content

Commit

Permalink
Adding in the file for the diff editor
Browse files Browse the repository at this point in the history
I forgot to actually the HTML file to display the diff editor. This commit adds it in. All the code to support the diff editor has already been pushed, so we just need this file.
  • Loading branch information
cgillis-aras committed Apr 22, 2019
1 parent ac5842e commit a0adf1a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 40 deletions.
62 changes: 62 additions & 0 deletions Innovator/Client/scripts/CodeEditor_Monaco/MonacoDiffEditor.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var topWnd = window.parent.parent;
var aras = topWnd.aras;
</script>
<script type="text/javascript" src="javascript/monaco-editor/min/vs/loader.js"></script>
<style type="text/css" media="screen">
#editor {

}
</style>
<style type="text/css">
html, body {
overflow: hidden;
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
}

li {
list-style-type: none !important;
}
</style>
<link rel="stylesheet" href="css/methodeditor.css" />
<script type="text/javascript">
window.onload = function() {
// initialize diff editor
initDiffEditor();
}

// Initialize the diff editor
function initDiffEditor() {
require.config({ paths: { 'vs': 'javascript/monaco-editor/min/vs' }});
require(['vs/editor/editor.main'], function() {
var oldMethodCode = parent.methodEditorHelper.getComparisonMethodCode();
var currentMethodCode = aras.getItemProperty(parent.parent.document.item, "method_code") || "";

var originalModel = monaco.editor.createModel(oldMethodCode, "javascript");
var currentModel = monaco.editor.createModel(currentMethodCode, "javascript");

var diffEditor = monaco.editor.createDiffEditor(document.getElementById("diffeditormain"));
diffEditor.setModel({
original: originalModel,
modified: currentModel
})

parent.editor = diffEditor;
parent.monacoEditor = monaco.editor;
// var codeLang = aras.getItemProperty(parent.parent.document.item, "method_type");
// parent.methodEditorHelper.setLanguage(codeLang);
parent.methodEditorHelper.setEditorChangeEvent();
});
}
</script>
</head>
<body>
<div id="diffeditormain" style="height:100%; width:100%; overflow: hidden;"></div>
</body>
</html>
40 changes: 0 additions & 40 deletions Innovator/Client/scripts/CodeEditor_Monaco/xml.ja/toolbar.xml

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Aras 11.0 SP15
#### History:
Release | Notes
--------|--------
[v2.3](https://github.com/ArasLabs/alternate-method-editor/releases/tag/v2.3) | Bug fixes
[v2.2](https://github.com/ArasLabs/alternate-method-editor/releases/tag/v2.2) | Add JS messages back to compile button
[v2.1](https://github.com/ArasLabs/alternate-method-editor/releases/tag/v2.1) | Bug fixes.
[v2.0](https://github.com/ArasLabs/alternate-method-editor/releases/tag/v2.0) | Introducing diff editor. Misc bug fixes.
Expand All @@ -24,6 +25,7 @@ Release | Notes
#### Supported Aras Versions
Project | Notes
--------|--------
[v2.1](https://github.com/ArasLabs/alternate-method-editor/releases/tag/v2.3) | 11.0 SP15
[v2.1](https://github.com/ArasLabs/alternate-method-editor/releases/tag/v2.2) | 11.0 SP15
[v2.1](https://github.com/ArasLabs/alternate-method-editor/releases/tag/v2.1) | 11.0 SP15
[v2.0](https://github.com/ArasLabs/alternate-method-editor/releases/tag/v2.0) | 11.0 SP15
Expand Down

0 comments on commit a0adf1a

Please sign in to comment.