Show original script as well, still need to add revert/switch version functionality

This commit is contained in:
Peter Stockings
2024-05-18 22:46:44 +10:00
parent 2b4ca571ca
commit bc4a1ae9a6
4 changed files with 59 additions and 9 deletions

View File

@@ -123,6 +123,18 @@ show_edit_form=True) }}
</div>
<!-- End Right Content -->
</div>
<div id="diff_1_editor" class="relative rounded-lg shadow-lg p-4 text-opacity-0">{{ original_script }}</div>
<script>
var editor = ace.edit("diff_1_editor");
editor.setOptions({
maxLines: 100
});
editor.setTheme("ace/theme/github_dark");
editor.session.setMode("ace/mode/javascript");
editor.session.$worker.send("changeOptions", [{ asi: true }]);
</script>
<!-- End Item -->
{% else %}
@@ -159,7 +171,23 @@ show_edit_form=True) }}
</button>
</div>
<!-- End Right Content -->
</div>
<div id="diff_1_editor" class="relative rounded-lg shadow-lg p-4 text-opacity-0">{{ original_script }}</div>
<script>
var editor = ace.edit("diff_1_editor");
editor.setOptions({
maxLines: 100,
readOnly: true, // Disable editing
highlightActiveLine: false, // Optionally, disable highlighting the active line
highlightGutterLine: false // Optionally, disable highlighting the gutter line
});
editor.setTheme("ace/theme/github_dark");
editor.session.setMode("ace/mode/javascript");
</script>
<!-- End Item -->
{% endif %}