mirror of
https://github.com/typecho/typecho.git
synced 2025-03-20 01:49:40 +01:00
预留编辑器
添加附件上传
This commit is contained in:
parent
8b5dfb9fba
commit
b3b1e63a1a
@ -38,6 +38,8 @@ code, pre, .mono {
|
||||
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
||||
}
|
||||
|
||||
.p { margin: 1em 0; }
|
||||
|
||||
a.balloon-button {
|
||||
display: inline-block;
|
||||
padding: 0 6px;
|
||||
@ -1712,7 +1714,6 @@ ul.typecho-post-option li:last-child {
|
||||
}
|
||||
|
||||
#advance-panel li, #upload-panel li {
|
||||
border: none;
|
||||
}
|
||||
|
||||
ul.typecho-post-option li ul {
|
||||
@ -1974,9 +1975,100 @@ ul.autocompleter-choices span.autocompleter-queried {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hide from both screenreaders and browsers: h5bp.com/u
|
||||
*/
|
||||
|
||||
/* Jquery Timepicker */
|
||||
.hidden {
|
||||
display: none !important;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hide only visually, but have it available for screenreaders: h5bp.com/v
|
||||
*/
|
||||
|
||||
.visuallyhidden {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Extends the .visuallyhidden class to allow the element to be focusable
|
||||
* when navigated to via the keyboard: h5bp.com/p
|
||||
*/
|
||||
|
||||
.visuallyhidden.focusable:active,
|
||||
.visuallyhidden.focusable:focus {
|
||||
clip: auto;
|
||||
height: auto;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
position: static;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hide visually and from screenreaders, but maintain layout
|
||||
*/
|
||||
|
||||
.invisible {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/*
|
||||
* Editor
|
||||
*/
|
||||
.editor {
|
||||
margin-bottom: -0.5em;
|
||||
font-size: .92857em;
|
||||
}
|
||||
.editor span {
|
||||
display: inline-block;
|
||||
padding: 0 12px;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.editor span:hover { background-color: #E9E9E6; }
|
||||
.editor span:active { background-color: #467B96; color: #FFF; }
|
||||
.btnBold { font-weight: bold; }
|
||||
.btnItalic { font-style: italic; }
|
||||
.btnLink { text-decoration: underline; }
|
||||
.btnDel { text-decoration: line-through; }
|
||||
|
||||
|
||||
/*
|
||||
* Upload
|
||||
*/
|
||||
#upload-panel {
|
||||
padding: 10px 15px;
|
||||
border: 1px dashed #CCC;
|
||||
background-color: #FFF;
|
||||
color: #999;
|
||||
font-size: .92857em;
|
||||
}
|
||||
#file-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#file-list li { padding-top: 5px; }
|
||||
#file-list .loading { padding-left: 20px; }
|
||||
#file-list .delete { margin-left: 5px; color: #B94A48; }
|
||||
|
||||
|
||||
/*
|
||||
* Jquery Timepicker
|
||||
*/
|
||||
#ui-datepicker-div {
|
||||
display: none;
|
||||
padding: 10px;
|
||||
border: 1px solid #CCC;
|
||||
background: #FFF;
|
||||
@ -2039,7 +2131,10 @@ ul.autocompleter-choices span.autocompleter-queried {
|
||||
}
|
||||
#ui-datepicker-div .ui-datepicker-close { float: right; }
|
||||
|
||||
/* Jquery Tokeninput */
|
||||
|
||||
/*
|
||||
* Jquery Tokeninput
|
||||
*/
|
||||
ul.token-input-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
|
@ -6,6 +6,20 @@ if (isset($post) && $post instanceof Typecho_Widget && $post->have()) {
|
||||
$fileParentContent = $page;
|
||||
}
|
||||
?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// 文件上传控件
|
||||
$(".upload-file").click(function() {
|
||||
if($('input[type=file]').val()) {
|
||||
return true;
|
||||
}
|
||||
$("input[type=file]").click();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="<?php $options->adminUrl('javascript/swfupload/swfupload.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script type="text/javascript" src="<?php $options->adminUrl('javascript/swfupload/swfupload.queue.js?v=' . $suffixVersion); ?>"></script>
|
||||
<script type="text/javascript" src="<?php $options->adminUrl('javascript/swfupload/swfupload.cookies.js?v=' . $suffixVersion); ?>"></script>
|
||||
|
@ -12,7 +12,7 @@ if (isset($post) || isset($page)) {
|
||||
}
|
||||
?>
|
||||
|
||||
<style>
|
||||
<!--<style>
|
||||
.upload-progress {
|
||||
font-size: 12px;
|
||||
}
|
||||
@ -94,4 +94,14 @@ if (isset($post) || isset($page)) {
|
||||
</small>
|
||||
</li>
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
</ul>-->
|
||||
|
||||
<div id="upload-panel" class="p">
|
||||
将要上传的文件拖放到这里 或者 <a href="" class="upload-file">选择文件上传</a><input type="file" class="visuallyhidden">
|
||||
<ul id="file-list">
|
||||
<li class="loading">widescreen.jpg</li>
|
||||
<li><a href="###">Sample.zip</a> 100KB <a href="###" class="delete">×</a></li>
|
||||
<li><a href="###">segmentfault.profile.png</a> 60KB <a href="###" class="delete">×</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 847 B |
@ -7,20 +7,39 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
|
||||
<div class="main">
|
||||
<div class="body container">
|
||||
<?php include 'page-title.php'; ?>
|
||||
<div class="col-group typecho-page-main typecho-post-option typecho-post-area">
|
||||
<div class="col-group typecho-page-main typecho-post-area">
|
||||
<form action="<?php $options->index('/action/contents-post-edit'); ?>" method="post" name="write_post">
|
||||
<div class="col-mb-12 col-tb-9" id="test">
|
||||
<div class="col-mb-12 col-tb-9">
|
||||
<div>
|
||||
<label for="title" class="typecho-label"><?php _e('标题'); ?>
|
||||
<?php if ($post->draft && $post->draft['cid'] != $post->cid): ?>
|
||||
<?php $postModifyDate = new Typecho_Date($post->draft['modified']); ?>
|
||||
<cite><?php _e('当前正在编辑的是保存于%s的草稿, 你可以<a href="%s">删除它</a>', $postModifyDate->word(),
|
||||
Typecho_Common::url('/action/contents-post-edit?do=deleteDraft&cid=' . $post->cid, $options->index)); ?></cite>
|
||||
<?php endif; ?>
|
||||
<?php if ($post->draft && $post->draft['cid'] != $post->cid): ?>
|
||||
<?php $postModifyDate = new Typecho_Date($post->draft['modified']); ?>
|
||||
<cite><?php _e('当前正在编辑的是保存于%s的草稿, 你可以<a href="%s">删除它</a>', $postModifyDate->word(),
|
||||
Typecho_Common::url('/action/contents-post-edit?do=deleteDraft&cid=' . $post->cid, $options->index)); ?></cite>
|
||||
<?php endif; ?>
|
||||
</label>
|
||||
<p class="title"><input type="text" id="title" name="title" value="<?php echo htmlspecialchars($post->title); ?>" class="w-100 text title" /></p>
|
||||
<label for="text" class="typecho-label"><?php _e('内容'); ?><cite id="auto-save-message"></cite></label>
|
||||
<p><textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text" name="text" class="w-100"><?php echo htmlspecialchars($post->text); ?></textarea></p>
|
||||
|
||||
<p class="editor">
|
||||
<span class="btnBold">bold</span><!--
|
||||
--><span class="btnItalic">italic</span><!--
|
||||
--><span class="btnLink">link</span><!--
|
||||
--><span class="btnQuote">quote</span><!--
|
||||
--><span class="btnDel">del</span><!--
|
||||
--><span class="btnImg">img</span><!--
|
||||
--><span class="btnUl">ul</span><!--
|
||||
--><span class="btnOl">ol</span><!--
|
||||
--><span class="btnHeading">title</span><!--
|
||||
--><span class="btnCode">code</span><!--
|
||||
--><span class="btnPre">pre</span><!--
|
||||
--><span class="btnMore">more</span><!--
|
||||
--><span class="btnHr">hr</span>
|
||||
</p>
|
||||
<p>
|
||||
<textarea style="height: <?php $options->editorSize(); ?>px" autocomplete="off" id="text" name="text" class="w-100"><?php echo htmlspecialchars($post->text); ?></textarea>
|
||||
</p>
|
||||
<?php include 'file-upload.php'; ?>
|
||||
<label for="tags" class="typecho-label"><?php _e('标签'); ?></label>
|
||||
<p><input id="tags" name="tags" type="text" value="<?php $post->tags(',', false); ?>" class="w-100 text" /></p>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->content($post); ?>
|
||||
@ -38,83 +57,74 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<ul id="advance-panel" class="typecho-post-option clearfix">
|
||||
<li>
|
||||
<div>
|
||||
<?php if($user->pass('editor', true)): ?>
|
||||
<label class="typecho-label"><?php _e('公开度'); ?></label>
|
||||
<ul>
|
||||
<li><input id="publish" value="publish" name="visibility" type="radio"<?php if (($post->status == 'publish' && !$post->password) || !$post->status) { ?> checked="true"<?php } ?> /> <label for="publish"><?php _e('公开'); ?></label></li>
|
||||
<li><input id="password" value="password"name="visibility" type="radio"<?php if ($post->password) { ?> checked="true"<?php } ?> /> <label for="password">密码保护 <input type="text" id="password" name="password" value="<?php $post->password(); ?>" class="mini" /></label></li>
|
||||
<li><input id="private" value="private" name="visibility" type="radio"<?php if ($post->status == 'private') { ?> checked="true"<?php } ?> /> <label for="private">私密</label></li>
|
||||
<li><input id="waiting" value="waiting" name="visibility" type="radio"<?php if ($post->status == 'waiting') { ?> checked="true"<?php } ?> /> <label for="waiting">待审核</label></li>
|
||||
</ul>
|
||||
<br />
|
||||
<?php endif; ?>
|
||||
<label for="trackback" class="typecho-label"><?php _e('引用通告'); ?></label>
|
||||
<textarea id="trackback" name="trackback"></textarea>
|
||||
<p class="description"><?php _e('每一行一个引用地址, 用回车隔开'); ?></p>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->advanceOptionLeft($post); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label class="typecho-label"><?php _e('权限控制'); ?></label>
|
||||
<ul>
|
||||
<li><input id="allowComment" name="allowComment" type="checkbox" value="1" <?php if($post->allow('comment')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
|
||||
<li><input id="allowPing" name="allowPing" type="checkbox" value="1" <?php if($post->allow('ping')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
|
||||
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1" <?php if($post->allow('feed')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->advanceOptionRight($post); ?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- <ul id="upload-panel">
|
||||
<li>
|
||||
<?php include 'file-upload.php'; ?>
|
||||
</li>
|
||||
</ul> -->
|
||||
<div id="typecho-preview-box"></div>
|
||||
</div>
|
||||
<div class="col-mb-12 col-tb-3">
|
||||
<div class="typecho-post-option">
|
||||
<div id="advance-panel" class="typecho-post-option clearfix">
|
||||
<section>
|
||||
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
|
||||
<p><input class="typecho-date w-100" type="text" name="date" id="date" value="<?php $post->date(); ?>" /></p>
|
||||
<?php if($user->pass('editor', true)): ?>
|
||||
<label class="typecho-label"><?php _e('公开度'); ?></label>
|
||||
<ul>
|
||||
<li><input id="publish" value="publish" name="visibility" type="radio"<?php if (($post->status == 'publish' && !$post->password) || !$post->status) { ?> checked="true"<?php } ?> /> <label for="publish"><?php _e('公开'); ?></label></li>
|
||||
<li><input id="password" value="password"name="visibility" type="radio"<?php if ($post->password) { ?> checked="true"<?php } ?> /> <label for="password">密码保护 <input type="text" id="password" name="password" value="<?php $post->password(); ?>" class="mini" /></label></li>
|
||||
<li><input id="private" value="private" name="visibility" type="radio"<?php if ($post->status == 'private') { ?> checked="true"<?php } ?> /> <label for="private">私密</label></li>
|
||||
<li><input id="waiting" value="waiting" name="visibility" type="radio"<?php if ($post->status == 'waiting') { ?> checked="true"<?php } ?> /> <label for="waiting">待审核</label></li>
|
||||
</ul>
|
||||
<br />
|
||||
<?php endif; ?>
|
||||
<label for="trackback" class="typecho-label"><?php _e('引用通告'); ?></label>
|
||||
<textarea id="trackback" name="trackback"></textarea>
|
||||
<p class="description"><?php _e('每一行一个引用地址, 用回车隔开'); ?></p>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->advanceOptionLeft($post); ?>
|
||||
</section>
|
||||
<section>
|
||||
<label class="typecho-label"><?php _e('分类'); ?></label>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($category); ?>
|
||||
<ul<?php if ($category->length > 8): ?> style="height: 264px"<?php endif; ?>>
|
||||
<?php
|
||||
if ($post->have()) {
|
||||
$categories = Typecho_Common::arrayFlatten($post->categories, 'mid');
|
||||
} else {
|
||||
$categories = array();
|
||||
}
|
||||
?>
|
||||
<?php while($category->next()): ?>
|
||||
<li><input type="checkbox" id="category-<?php $category->mid(); ?>" value="<?php $category->mid(); ?>" name="category[]" <?php if(in_array($category->mid, $categories)): ?>checked="true"<?php endif; ?>/>
|
||||
<label for="category-<?php $category->mid(); ?>"><?php $category->name(); ?></label></li>
|
||||
<?php endwhile; ?>
|
||||
<label class="typecho-label"><?php _e('权限控制'); ?></label>
|
||||
<ul>
|
||||
<li><input id="allowComment" name="allowComment" type="checkbox" value="1" <?php if($post->allow('comment')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowComment"><?php _e('允许评论'); ?></label></li>
|
||||
<li><input id="allowPing" name="allowPing" type="checkbox" value="1" <?php if($post->allow('ping')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowPing"><?php _e('允许被引用'); ?></label></li>
|
||||
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1" <?php if($post->allow('feed')): ?>checked="true"<?php endif; ?> />
|
||||
<label for="allowFeed"><?php _e('允许在聚合中出现'); ?></label></li>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->advanceOptionRight($post); ?>
|
||||
</ul>
|
||||
</section>
|
||||
<section>
|
||||
<label for="slug" class="typecho-label"><?php _e('缩略名'); ?></label>
|
||||
<p><input type="text" id="slug" name="slug" value="<?php $post->slug(); ?>" class="mini w-100" /></p>
|
||||
<p class="description"><?php _e('为这篇日志自定义链接地址, 有利于搜索引擎收录'); ?></p>
|
||||
</section>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->option($post); ?>
|
||||
<?php if($post->have()): ?>
|
||||
<?php $modified = new Typecho_Date($post->modified); ?>
|
||||
<section>
|
||||
<label class="typecho-label"><?php _e('本文由 <a href="%s">%s</a> 撰写',
|
||||
Typecho_Common::url('manage-posts.php?uid=' . $post->author->uid, $options->adminUrl), $post->author->screenName); ?></label>
|
||||
<p class="description"><?php _e('最后修改于 %s', $modified->word()); ?></p>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div id="typecho-preview-box">预览</div>
|
||||
</div>
|
||||
<div class="col-mb-12 col-tb-3">
|
||||
<section class="typecho-post-option">
|
||||
<label for="date" class="typecho-label"><?php _e('发布日期'); ?></label>
|
||||
<p><input class="typecho-date w-100" type="text" name="date" id="date" value="<?php $post->date(); ?>" /></p>
|
||||
</section>
|
||||
<section class="typecho-post-option">
|
||||
<label class="typecho-label"><?php _e('分类'); ?></label>
|
||||
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($category); ?>
|
||||
<ul<?php if ($category->length > 8): ?> style="height: 264px"<?php endif; ?>>
|
||||
<?php
|
||||
if ($post->have()) {
|
||||
$categories = Typecho_Common::arrayFlatten($post->categories, 'mid');
|
||||
} else {
|
||||
$categories = array();
|
||||
}
|
||||
?>
|
||||
<?php while($category->next()): ?>
|
||||
<li><input type="checkbox" id="category-<?php $category->mid(); ?>" value="<?php $category->mid(); ?>" name="category[]" <?php if(in_array($category->mid, $categories)): ?>checked="true"<?php endif; ?>/>
|
||||
<label for="category-<?php $category->mid(); ?>"><?php $category->name(); ?></label></li>
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="typecho-post-option">
|
||||
<label for="slug" class="typecho-label"><?php _e('缩略名'); ?></label>
|
||||
<p><input type="text" id="slug" name="slug" value="<?php $post->slug(); ?>" class="mini w-100" /></p>
|
||||
<p class="description"><?php _e('为这篇日志自定义链接地址, 有利于搜索引擎收录'); ?></p>
|
||||
</section>
|
||||
<?php Typecho_Plugin::factory('admin/write-post.php')->option($post); ?>
|
||||
<?php if($post->have()): ?>
|
||||
<?php $modified = new Typecho_Date($post->modified); ?>
|
||||
<section class="typecho-post-option">
|
||||
<label class="typecho-label"><?php _e('本文由 <a href="%s">%s</a> 撰写',
|
||||
Typecho_Common::url('manage-posts.php?uid=' . $post->author->uid, $options->adminUrl), $post->author->screenName); ?></label>
|
||||
<p class="description"><?php _e('最后修改于 %s', $modified->word()); ?></p>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user