作者 anyv
1 个管道 的构建 通过 耗费 0 秒

添加分类缩略图

... ... @@ -11,10 +11,10 @@
<div class="col-md-9">
<table class="table table-bordered">
<tr>
<th>标题<span class="form-required">*</span></th>
<th>分类名称<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="post[post_title]"
id="title" required value="" placeholder="请输入标题"/>
<input class="form-control" type="text" name="name"
id="title" required value="" placeholder="请输入分类名称"/>
</td>
</tr>
</table>
... ... @@ -32,7 +32,7 @@
<tr>
<td>
<div style="text-align: center;">
<input type="hidden" name="post[more][thumbnail]" id="thumbnail" value="">
<input type="hidden" name="thumbnail" id="thumbnail" value="">
<a href="javascript:uploadOneImage('图片上传','#thumbnail');">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
... ... @@ -47,5 +47,22 @@
</div>
</form>
</div>
<script>
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
});
</script>
</body>
</html>
\ No newline at end of file
... ...