改进附件编辑

This commit is contained in:
fen 2013-10-15 21:08:25 +08:00
parent 5b7dcf6726
commit c719c49872
7 changed files with 47 additions and 31 deletions

View File

@ -313,9 +313,8 @@ button.primary:active, button.primary.active {
}
.loading {
background-image: url(../images/ajax-loader.gif);
background-position: left center;
background-repeat: no-repeat;
padding-left: 20px;
background: transparent url(../images/ajax-loader.gif) no-repeat left center;
}
@ -1851,7 +1850,7 @@ ul.typecho-list-notable li .loading {
.typecho-page-main .typecho-mini-panel .tag-selection a {
}
/*
.typecho-attachment-photo-box .description {
}
@ -1878,8 +1877,8 @@ ul.typecho-list-notable li .loading {
_display: inline;
position: relative;
}
.typecho-attachment-photo-box img {
*/
.typecho-attachment-photo {
border: 1px solid #E6E6E3;
max-width: 100%;
}
@ -1932,11 +1931,11 @@ ul.typecho-list-notable li .loading {
background-position: 0 -144px;
}
.typecho-attachment-photo-box .typecho-mime {
/*.typecho-attachment-photo-box .typecho-mime {
bottom: -6px;
margin-right: 3px;
float: left;
}
}*/
/*
* Hide from both screenreaders and browsers: h5bp.com/u
@ -2021,14 +2020,24 @@ ul.typecho-list-notable li .loading {
#upload-panel.drag, .tDnD_whileDrag {
background-color: #FFFBCC;
}
.tDnD_whileDrag {
-ms-transform-origin: 0 0;
-moz-transform-origin: 0 0;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-ms-transform: rotate(2deg);
-moz-transform: rotate(2deg);
-webkit-transform: rotate(2deg);
webkit-transform: rotate(2deg);
}
#file-list {
list-style: none;
margin: 0;
padding: 0;
}
#file-list li { padding-top: 5px; }
#file-list .loading { padding-left: 20px; }
#file-list li { margin-top: 5px; }
#file-list .delete { margin-left: 5px; color: #B94A48; }

View File

@ -32,12 +32,12 @@ include 'menu.php';
<form method="post" name="manage_users" class="operate-form">
<table class="typecho-list-table">
<colgroup>
<col width="3%"/>
<col width="20"/>
<col width="5%"/>
<col width="30%"/>
<col width=""/>
<col width="25%"/>
<col width="25%"/>
<col width="12%"/>
<col width="15%"/>
</colgroup>
<thead>
<tr>

View File

@ -11,23 +11,29 @@ Typecho_Widget::widget('Widget_Contents_Attachment_Edit')->to($attachment);
<?php include 'page-title.php'; ?>
<div class="col-group typecho-page-main">
<div class="col-mb-12 col-tb-8">
<div class="typecho-attachment-photo-box">
<?php if ($attachment->attachment->isImage): ?>
<p><img src="<?php $attachment->attachment->url(); ?>" alt="<?php $attachment->attachment->name(); ?>" /></p>
<?php endif; ?>
<div class="description">
<ul>
<?php $mime = Typecho_Common::mimeIconType($attachment->attachment->mime); ?>
<li><span class="typecho-mime typecho-mime-<?php echo $mime; ?>"></span><strong><?php $attachment->attachment->name(); ?></strong> <small><?php echo number_format(ceil($attachment->attachment->size / 1024)); ?> Kb</small></li>
<li><input id="attachment-url" type="text" readonly class="text" value="<?php $attachment->attachment->url(); ?>" />
<button id="exchange" disabled><?php _e('替换'); ?></button>
<span id="swfu"><span id="swfu-placeholder"></span></span></li>
</ul>
</div>
<?php if ($attachment->attachment->isImage): ?>
<p><img src="<?php $attachment->attachment->url(); ?>" alt="<?php $attachment->attachment->name(); ?>" class="typecho-attachment-photo" /></p>
<?php endif; ?>
<p>
<?php $mime = Typecho_Common::mimeIconType($attachment->attachment->mime); ?>
<span class="typecho-mime typecho-mime-<?php echo $mime; ?>"></span>
<a href=""><strong><?php $attachment->attachment->name(); ?></strong></a>
<span><?php echo number_format(ceil($attachment->attachment->size / 1024)); ?> Kb</span>
</p>
<p>
<input id="attachment-url" type="text" class="mono w-100" value="<?php $attachment->attachment->url(); ?>" readonly />
</p>
<div id="upload-panel" class="p">
将要替换的文件拖放到这里 或者 <a href="" class="upload-file">选择替换文件</a><input type="file" class="visuallyhidden">
<ul id="file-list">
<li class="loading">上传中</li>
</ul>
</div>
</div>
<div class="col-mb-12 col-tb-4 typecho-mini-panel typecho-radius-topleft typecho-radius-topright typecho-radius-bottomleft typecho-radius-bottomright">
<div class="col-mb-12 col-tb-4">
<?php $attachment->form()->render(); ?>
</div>
</div>

View File

@ -96,6 +96,7 @@ $(document).ready(function() {
// 高级选项控制
$('#advance-panel-btn').click(function() {
$('#advance-panel').toggle();
$(this).toggleClass('fold');
return false;
});

View File

@ -91,7 +91,6 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
<p><input id="tags" name="tags" type="text" value="<?php $post->tags(',', false); ?>" class="w-100 text" /></p>
</section>
<a href="###" id="advance-panel-btn"><?php _e('高级选项'); ?></a>
<div id="advance-panel">
<?php if($user->pass('editor', true)): ?>
<section class="typecho-post-option visibility-option">
@ -125,6 +124,7 @@ Typecho_Widget::widget('Widget_Contents_Post_Edit')->to($post);
</ul>
</section>
</div><!-- end #advance-panel -->
<a href="###" id="advance-panel-btn"><?php _e('高级选项'); ?></a>
<?php Typecho_Plugin::factory('admin/write-post.php')->option($post); ?>
<?php if($post->have()): ?>

View File

@ -117,7 +117,7 @@ class Widget_Contents_Attachment_Edit extends Widget_Contents_Post_Edit implemen
Typecho_Widget_Helper_Form::POST_METHOD);
/** 附件名称 */
$name = new Typecho_Widget_Helper_Form_Element_Text('name', NULL, $this->title, _t('标题*'));
$name = new Typecho_Widget_Helper_Form_Element_Text('name', NULL, $this->title, _t('标题 *'));
$form->addInput($name);
/** 附件缩略名 */

View File

@ -214,7 +214,7 @@ RewriteRule . {$basePath}index.php [L]
} else if (!isset($patterns[$postPatternValue])) {
$customPatternValue = $this->decodeRule($postPatternValue);
}
$patterns['custom'] = _t('个性化定义') . ' <input type="text" class="w-40 text-s" name="customPattern" value="' . $customPatternValue . '" />';
$patterns['custom'] = _t('个性化定义') . ' <input type="text" class="w-40 text-s mono" name="customPattern" value="' . $customPatternValue . '" />';
$postPattern = new Typecho_Widget_Helper_Form_Element_Radio('postPattern', $patterns,
$postPatternValue, _t('自定义文章路径'), _t('可用参数:{cid} 日志ID、{slug} 日志缩略名、{category} 分类、{year} 年、{month} 月、{day} <br />选择一种合适的文章静态路径风格, 使得你的网站链接更加友好.<br />