Update 20260123
This commit is contained in:
65
API_DocGen_Tester/Default.aspx
Normal file
65
API_DocGen_Tester/Default.aspx
Normal file
@@ -0,0 +1,65 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="API_DocGen_Tester.Default" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title>Text/JSON Editor</title>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.23.1/ace.js"></script>
|
||||
|
||||
<style>
|
||||
#editor {
|
||||
height: 400px;
|
||||
width: 800px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form id="form1" runat="server">
|
||||
|
||||
<h2>Text / JSON Editor</h2>
|
||||
|
||||
Dateiname:<br />
|
||||
<asp:TextBox ID="txtFileName" runat="server" Width="400" /><br /><br />
|
||||
|
||||
<!-- Ace Editor -->
|
||||
<div id="editor"></div>
|
||||
|
||||
<!-- HiddenField für Postback -->
|
||||
<asp:HiddenField ID="hfContent" runat="server" />
|
||||
|
||||
<br />
|
||||
<asp:Button ID="btnSave" runat="server" Text="Speichern"
|
||||
OnClientClick="syncEditorContent();" />
|
||||
|
||||
<asp:Button ID="btnLoad" runat="server" Text="Laden"
|
||||
OnClick="btnLoad_Click" />
|
||||
|
||||
<br /><br />
|
||||
<asp:Label ID="lblStatus" runat="server" ForeColor="Green" />
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/chrome");
|
||||
editor.session.setMode("ace/mode/json");
|
||||
editor.setOptions({
|
||||
fontSize: "14px",
|
||||
showPrintMargin: false
|
||||
});
|
||||
|
||||
function syncEditorContent() {
|
||||
document.getElementById('<%= hfContent.ClientID %>').value = editor.getValue();
|
||||
}
|
||||
|
||||
// Inhalt aus HiddenField nach Postback setzen
|
||||
function setEditorContent(content) {
|
||||
editor.setValue(content, -1);
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user