默认不再自动开启预览
This commit is contained in:
@@ -40,6 +40,11 @@ include_once("kindeditor.php") ;
|
||||
$row = $result[0];
|
||||
?>
|
||||
|
||||
<div class="ui toggle checkbox">
|
||||
<input type="checkbox" id="preview-toggle">
|
||||
<label for="preview-toggle">题目预览</label>
|
||||
</div>
|
||||
|
||||
<input type=hidden name=problem_id value='<?php echo $row['problem_id']?>'>
|
||||
<p align=left>
|
||||
<center>
|
||||
@@ -93,7 +98,7 @@ include_once("kindeditor.php") ;
|
||||
</p>
|
||||
|
||||
<p align=left>
|
||||
<?php echo "<h4>".$MSG_SOURCE."</h4>"?>
|
||||
<?php echo "<h4>".$MSG_SOURCE." 用空格分隔"."</h4>"?>
|
||||
<textarea name=source style="width:100%;" rows=1><?php echo htmlentities($row['source'],ENT_QUOTES,"UTF-8")?></textarea><br>
|
||||
|
||||
<?php echo "<h4>".$MSG_REMOTE_OJ."</h4>"?>
|
||||
@@ -179,10 +184,20 @@ include_once("kindeditor.php") ;
|
||||
});
|
||||
if($("#previewFrame")[0] != undefined) $("#previewFrame")[0].contentWindow.MathJax.typeset();
|
||||
}
|
||||
$(document).ready(function(){
|
||||
<?php if (!(isset($OJ_OLD_FASHINED) && $OJ_OLD_FASHINED ) ) echo " transform();" ?>
|
||||
|
||||
});
|
||||
$(document).ready(function(){
|
||||
// 默认开启预览功能
|
||||
// <?php if (!(isset($OJ_OLD_FASHINED) && $OJ_OLD_FASHINED )) echo " transform();" ?>
|
||||
|
||||
// 监听checkbox的点击事件
|
||||
$('#preview-toggle').change(function() {
|
||||
if(this.checked) {
|
||||
transform();
|
||||
} else {
|
||||
// 假设这里是关闭预览的函数
|
||||
untransform();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user