60 lines
1.8 KiB
Plaintext
60 lines
1.8 KiB
Plaintext
@*
|
|
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
|
*@
|
|
@{
|
|
}
|
|
|
|
<script src="/Contents/jquery.min.js"></script>
|
|
<script src="/Contents/b_ckeditor/ckeditor.js" type="text/javascript"></script>
|
|
<h1 class="title">@ViewBag.Title</h1>
|
|
<div class="document-editor">
|
|
<div class="toolbar-container"></div>
|
|
<div class="content-container">
|
|
<div id="editor">
|
|
<textarea name="TxtContent" id="TxtContent" rows="10" cols="80">@Html.Raw(ViewBag.Detail)</textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
// Replace the <textarea id="editor1"> with a CKEditor
|
|
// instance, using default configuration.
|
|
var editor = CKEDITOR.replace('TxtContent', {
|
|
customConfig: '/Contents/b_ckeditor/config/ContentConfig.js'
|
|
});
|
|
//editor.resize('100%', '650', true);
|
|
editor.on('change', function (event) {
|
|
//var data = CKEDITOR.instances.TxtContent.getData();
|
|
//$("#hidcontent").val(data);
|
|
setCKEditorFitHeight(event.editor);
|
|
});
|
|
editor.on('loaded', function (evt) {
|
|
|
|
});
|
|
editor.on('instanceReady', function (event) {
|
|
setCKEditorFitHeight(event.editor);
|
|
CKEDITOR.tools.callFunction(37, this);
|
|
});
|
|
function setCKEditorFitHeight(editor) {
|
|
//var height = editor.window.$.document.body.clientHeight + 60;
|
|
var height = $(window).height() - 200;
|
|
var content = $('#' + editor.container.$.id).find('.cke_contents');
|
|
content.css({ height: height });
|
|
}
|
|
</script>
|
|
<style>
|
|
.document-editor {
|
|
width: 736px;
|
|
margin: 0 auto;
|
|
padding: 10px 0;
|
|
}
|
|
|
|
.ck-editor__editable_inline {
|
|
height: 700px !important;
|
|
}
|
|
|
|
.title {
|
|
width: 736px;
|
|
margin: 0 auto;
|
|
font-size: 20px;
|
|
}
|
|
</style> |