Skip to content

Commit

Permalink
继续重构
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqi committed Oct 8, 2013
1 parent 18124bf commit f8c05ee
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 20 deletions.
3 changes: 2 additions & 1 deletion admin/common-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
$('.typecho-list-table').tableSelectable({
checkEl : 'input[type=checkbox]',
rowEl : 'tr',
selectAllEl : '.typecho-table-select-all'
selectAllEl : '.typecho-table-select-all',
actionEl : '.dropdown-menu a'
});

$('.btn-drop').dropdownMenu({
Expand Down
6 changes: 4 additions & 2 deletions admin/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ select {
}

button {
line-height: 22px; height: 26px; vertical-align: middle;
height: 28px;
vertical-align: middle;
zoom: 1;
display: inline-block;
color: #666;
font-size: 13px;
Expand Down Expand Up @@ -1317,7 +1319,7 @@ margin-top: 25px;

.typecho-list-operate button {
height: 24px;
line-height: 24px;
zoom: 1;
}

.typecho-list-operate .operate {
Expand Down
13 changes: 12 additions & 1 deletion admin/javascript/typecho.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
var table = this, s = $.extend({
checkEl : null,
rowEl : null,
selectAllEl : null
selectAllEl : null,
actionEl : null
}, options);

function clickRow (t) {
Expand Down Expand Up @@ -57,6 +58,16 @@
}).removeClass('checked');
}
});

$(s.actionEl).click(function () {
var t = $(this), lang = t.attr('lang');

if (!lang || confirm(lang)) {
table.parents('form').attr('action', t.attr('href')).submit();
}

return false;
});
};
})($);

Expand Down
21 changes: 12 additions & 9 deletions admin/manage-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@
<div class="column-24 start-01 typecho-list">
<div class="typecho-list-operate">
<form method="get">
<p class="operate"><?php _e('操作'); ?>:
<span class="operate-button typecho-table-select-all"><?php _e('全选'); ?></span>,
<span class="operate-button typecho-table-select-none"><?php _e('不选'); ?></span>&nbsp;&nbsp;&nbsp;
<?php _e('选中项'); ?>:
<span rel="delete" lang="<?php _e('你确认要删除这些页面吗?'); ?>" class="operate-button operate-delete typecho-table-select-submit"><?php _e('删除'); ?></span>
</p>
<p class="search">
<div class="operate">
<input type="checkbox" class="typecho-table-select-all" />
<div class="btn-group btn-drop">
<button class="dropdown-toggle" type="button" href="">选中项 &nbsp;<i class="icon-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a lang="<?php _e('你确认要删除这些页面吗?'); ?>" href="<?php $options->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
</ul>
</div>
</div>
<div class="search">
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-pages.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" value="<?php '' != $request->keywords ? print(htmlspecialchars($request->keywords)) : _e('请输入关键字'); ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
<input type="text" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo htmlspecialchars($request->keywords); ?>" name="keywords" />
<button type="submit"><?php _e('筛选'); ?></button>
</p>
</div>
</form>
</div>

Expand Down
11 changes: 5 additions & 6 deletions admin/manage-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
<div class="btn-group btn-drop">
<button class="dropdown-toggle" type="button" href="">选中项 &nbsp;<i class="icon-caret-down"></i></button>
<ul class="dropdown-menu">
<li><a href=""><?php _e('删除'); ?></a></li>
<li><a lang="<?php _e('你确认要删除这些文章吗?'); ?>" href="<?php $options->index('/action/contents-post-edit?do=delete'); ?>"><?php _e('删除'); ?></a></li>
</ul>
</div>
</div>
<p class="search">
<div class="search">
<?php if ('' != $request->keywords || '' != $request->category): ?>
<a href="<?php $options->adminUrl('manage-posts.php' . (isset($request->uid) ? '?uid=' . htmlspecialchars($request->get('uid')) : '')); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" value="<?php '' != $request->keywords ? print(htmlspecialchars($request->keywords)) : _e('请输入关键字'); ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
<input type="text" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo htmlspecialchars($request->keywords); ?>" name="keywords" />
<select name="category">
<option value=""><?php _e('所有分类'); ?></option>
<?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($category); ?>
Expand All @@ -37,11 +37,11 @@
<?php if(isset($request->uid)): ?>
<input type="hidden" value="<?php echo htmlspecialchars($request->get('uid')); ?>" name="uid" />
<?php endif; ?>
</p>
</div>
</form>
</div>

<form method="post" name="manage_posts" class="operate-form" action="<?php $options->index('/action/contents-post-edit'); ?>">
<form method="post" name="manage_posts" class="operate-form">
<table class="typecho-list-table">
<colgroup>
<col width="25"/>
Expand Down Expand Up @@ -113,7 +113,6 @@
<?php endif; ?>
</tbody>
</table>
<input type="hidden" name="do" value="delete" />
</form>

<?php if($posts->have()): ?>
Expand Down
2 changes: 1 addition & 1 deletion admin/manage-users.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<?php if ('' != $request->keywords): ?>
<a href="<?php $options->adminUrl('manage-users.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
<?php endif; ?>
<input type="text" value="<?php '' != $request->keywords ? print(htmlspecialchars($request->keywords)) : _e('请输入关键字'); ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
<input type="text" placeholder="<?php _e('请输入关键字'); ?>" value="<?php echo htmlspecialchars($request->keywords); ?>" name="keywords" />
<button type="submit"><?php _e('筛选'); ?></button>
</p>
</form>
Expand Down

0 comments on commit f8c05ee

Please sign in to comment.