|
|
@ -12,7 +12,6 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="row">
|
|
|
|
<div class="row">
|
|
|
|
<div class="preview_box" id="iframe_box" ></div>
|
|
|
|
<div class="preview_box" id="iframe_box" ></div>
|
|
|
@ -20,7 +19,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr/>
|
|
|
|
<hr/>
|
|
|
|
<form name="form_amp_code" id="form_amp_code" method="post" action="<?php echo site_url('amp/edit_save') ?>">
|
|
|
|
<form name="form_amp_code" id="form_amp_code" method="post" action="<?php echo site_url('amp/edit_save') ?>">
|
|
|
|
<textarea id="textarea_htmlcode" name="textarea_htmlcode" style="display: none;"><?php echo get_meta($information->ic_id, 'AMP'); ?></textarea>
|
|
|
|
<textarea id="textarea_htmlcode" name="textarea_htmlcode" style="display: none;"></textarea>
|
|
|
|
<input type="hidden" name="ic_id" value="<?php echo $information->ic_id; ?>" />
|
|
|
|
<input type="hidden" name="ic_id" value="<?php echo $information->ic_id; ?>" />
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="row">
|
|
|
@ -48,10 +47,9 @@
|
|
|
|
<hr/>
|
|
|
|
<hr/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/x-template" id="amp_html">
|
|
|
|
|
|
|
|
<?php echo htmlentities(get_meta($information->ic_id, 'AMP')); ?>
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js" type="text/javascript" charset="utf-8"></script>
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js" type="text/javascript" charset="utf-8"></script>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
var editor = ace.edit("editor");
|
|
|
|
var editor = ace.edit("editor");
|
|
|
@ -65,7 +63,10 @@
|
|
|
|
editor.getSession().on('change', function (e) {
|
|
|
|
editor.getSession().on('change', function (e) {
|
|
|
|
update_preview();
|
|
|
|
update_preview();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
editor.session.setValue($('#textarea_htmlcode').html($('#textarea_htmlcode').html()).text());
|
|
|
|
|
|
|
|
|
|
|
|
var temp_div = document.createElement("div");
|
|
|
|
|
|
|
|
temp_div.innerHTML = $('#amp_html').html();
|
|
|
|
|
|
|
|
editor.session.setValue(temp_div.textContent);
|
|
|
|
|
|
|
|
|
|
|
|
function update_preview() {
|
|
|
|
function update_preview() {
|
|
|
|
//考虑做成异步操作,降低页面卡顿
|
|
|
|
//考虑做成异步操作,降低页面卡顿
|
|
|
|