You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
920 B
31 lines
920 B
<% this.adminPage = 'raw'; %> |
|
<% include admin_header %> |
|
<form method="post"> |
|
|
|
<% include monaco-editor %> |
|
<div id="editor" class="editor" style="border: 1px solid #D4D4D5; height: 500px; margin-bottom: 20px; "> |
|
<%- this.showLoadingEditor(); %> |
|
</div> |
|
<input type="hidden" name="data"> |
|
|
|
<script type="text/javascript"> |
|
var originalData = <%- serializejs(data) %>; |
|
var input = $('[name="data"]'); |
|
input.val(originalData); |
|
|
|
window.onEditorLoaded(function () { |
|
var editor; |
|
window.editor = editor = window.createCodeEditor(document.getElementById("editor"), "json", originalData); |
|
$('form').on('submit', function () { |
|
input.val(editor.getValue()); |
|
}); |
|
|
|
$('#submit_button').removeClass('disabled'); |
|
}); |
|
</script> |
|
|
|
<div style="text-align: center; "> |
|
<button id="submit_button" class="ui disabled blue labeled icon button"><i class="ui edit icon"></i>提交</button> |
|
</div> |
|
</form> |
|
<% include admin_footer %>
|
|
|