更新样式

This commit is contained in:
joyqi 2013-10-08 15:45:37 +08:00
parent 9dbfe24320
commit 18124bfeca
7 changed files with 99 additions and 24 deletions

View File

@ -7,11 +7,22 @@
$(document).ready(function() {
var _d = $(document);
//增加高亮效果
<?php if ($notice->highlight): ?>
//增加高亮效果
$('#<?php echo $notice->highlight; ?>').effect('highlight', '#AACB36', 1000);
<?php endif; ?>
$('.typecho-list-table').tableSelectable({
checkEl : 'input[type=checkbox]',
rowEl : 'tr',
selectAllEl : '.typecho-table-select-all'
});
$('.btn-drop').dropdownMenu({
btnEl : '.dropdown-toggle',
menuEl : '.dropdown-menu'
});
//增加淡出效果
(function () {
var p = $('.popup');
@ -29,6 +40,7 @@
}
})();
/*
//增加滚动效果,滚动到上面的一条error
(function () {
var _firstError = _d.getElement('.typecho-option .error');
@ -73,7 +85,6 @@
}
});
/** 如果匹配则继续 */
if (/^<?php echo preg_quote($options->adminUrl, '/'); ?>.*$/.exec(_href)
|| /^<?php echo substr(preg_quote(Typecho_Common::url('s', $options->index), '/'), 0, -1); ?>action\/[_a-zA-Z0-9\/]+.*$/.exec(_href)) {
return;
@ -86,6 +97,7 @@
Typecho.Table.init('.typecho-list-table');
Typecho.Table.init('.typecho-list-notable');
*/
});
})();
</script>

View File

@ -262,7 +262,7 @@ button, .dropdown-menu {
box-shadow: rgba(0, 0, 0, 0.12) 0 1px 2px, inset white 0 1px 0;
}
button:disabled, button:active {
button:disabled, button:active, button.active {
background: #EEE;
-webkit-box-shadow: inset rgba(0, 0, 0, 0.2) 0 0 4px;
-moz-box-shadow: inset rgba(0, 0, 0, 0.2) 0 0 4px;
@ -299,7 +299,7 @@ button.primary:hover {
color: #5591b0;
}
button.primary:active {
button.primary:active, button.primary.active {
background: #dcebf4;
}
@ -348,6 +348,7 @@ button.primary:active {
background: #f9f9f7;
text-align: left;
min-width: 108px;
display: none;
}
.dropdown-menu li {
@ -1462,11 +1463,7 @@ a.operate-reply {
background: #eff5d9;
}
.typecho-list-table tbody tr.hover, .typecho-list-table tbody tr:hover {
}
.typecho-list-table tbody tr.hover td, .typecho-list-table tbody tr:hover td, ul.typecho-list-notable li:hover, ul.typecho-list-notable li.hover {
.typecho-list-table tbody tr:hover td, ul.typecho-list-notable li:hover {
background: #E3EEBD;
}
@ -1474,7 +1471,7 @@ a.operate-reply {
background: #DBE9AB;
}
.typecho-list-table tbody tr.checked-even td, ul.typecho-list-notable li.checked-even {
.typecho-list-table tbody tr.even.checked td, ul.typecho-list-notable li.even.checked {
background: #CCE087;
}
@ -1503,8 +1500,7 @@ a.operate-reply {
display: none;
}
.typecho-list-table tr:hover td .hidden-by-mouse, ul.typecho-list-notable li:hover .hidden-by-mouse,
.typecho-list-table tr.hover td .hidden-by-mouse, ul.typecho-list-notable li.hover .hidden-by-mouse {
.typecho-list-table tr:hover td .hidden-by-mouse, ul.typecho-list-notable li:hover .hidden-by-mouse {
display: inline;
}
@ -1512,7 +1508,7 @@ a.operate-reply {
color: #999;
}
.deactivate tbody tr:hover, .deactivate tbody tr.hover {
.deactivate tbody tr:hover {
color: #333;
}
@ -1520,7 +1516,7 @@ a.operate-reply {
color: #FFC177;
}
.deactivate tbody tr:hover a, .deactivate tbody tr.hover a {
.deactivate tbody tr:hover a {
color: #BD6800;
}
@ -1737,15 +1733,15 @@ ul.typecho-list-notable li #typecho-respond {
font-weight: bold;
}
.typecho-theme-list tbody tr.hover td, .typecho-theme-list tbody tr:hover td {
.typecho-theme-list tbody tr:hover td {
background: none;
}
.typecho-theme-list tbody tr td.current, .typecho-theme-list tbody tr td.hover {
.typecho-theme-list tbody tr td.current, .typecho-theme-list tbody tr td:hover {
background: #e3eebd;
}
.typecho-theme-list tbody tr td.hover .activate, .typecho-theme-list tbody tr td.hover .edit {
.typecho-theme-list tbody tr td:hover .activate, .typecho-theme-list tbody tr td:hover .edit {
display: block;
position: absolute;
background: #BD6800;
@ -1760,7 +1756,7 @@ ul.typecho-list-notable li #typecho-respond {
filter:alpha(opacity=80);
}
.typecho-theme-list tbody tr td.hover a.activate:hover, .typecho-theme-list tbody tr td.hover a.edit:hover {
.typecho-theme-list tbody tr td:hover a.activate:hover, .typecho-theme-list tbody tr td:hover a.edit:hover {
background: #D29B51;
text-decoration: none;
}
@ -2389,11 +2385,11 @@ ul.autocompleter-choices span.autocompleter-queried {
display: none;
}
.typecho-page-main ul.tag-list li:hover, .typecho-page-main ul.tag-list li.hover {
.typecho-page-main ul.tag-list li:hover {
background: none;
}
.typecho-page-main ul.tag-list li.checked, .typecho-page-main ul.tag-list li.checked-even {
.typecho-page-main ul.tag-list li.checked, .typecho-page-main ul.tag-list li.even.checked {
background: none;
font-weight: bold;
text-decoration: underline;

View File

@ -3,9 +3,9 @@ if (!defined('__TYPECHO_ROOT_DIR__')) {
exit;
}
$header = '<link rel="stylesheet" type="text/css" href="' . Typecho_Common::url('css/reset.source.css?v=' . $suffixVersion, $options->adminUrl) . '" />
<link rel="stylesheet" type="text/css" href="' . Typecho_Common::url('css/grid.source.css?v=' . $suffixVersion, $options->adminUrl) . '" />
<link rel="stylesheet" type="text/css" href="' . Typecho_Common::url('css/typecho.source.css?v=' . $suffixVersion, $options->adminUrl) . '" />';
$header = '<link rel="stylesheet" type="text/css" href="' . Typecho_Common::url('css/reset.css?v=' . $suffixVersion, $options->adminUrl) . '" />
<link rel="stylesheet" type="text/css" href="' . Typecho_Common::url('css/grid.css?v=' . $suffixVersion, $options->adminUrl) . '" />
<link rel="stylesheet" type="text/css" href="' . Typecho_Common::url('css/style.css?v=' . $suffixVersion, $options->adminUrl) . '" />';
/** 注册一个初始化插件 */
$header = Typecho_Plugin::factory('admin/header.php')->header($header);

View File

@ -1,3 +1,66 @@
(function ($) {
// 下拉菜单插件
$.fn.dropdownMenu = function (options) {
this.each(function () {
var menu = this, s = $.extend({
menuEl : null,
btnEl : null
}, options);
$(s.btnEl, menu).click(function () {
var t = $(this);
t.toggleClass('active');
$(s.menuEl, menu).toggle();
return false;
});
});
};
// 表格选择插件
$.fn.tableSelectable = function (options) {
var table = this, s = $.extend({
checkEl : null,
rowEl : null,
selectAllEl : null
}, options);
function clickRow (t) {
var t = $(t), check = $(s.checkEl, t), checked = check.prop('checked');
check.prop('checked', !checked);
if (checked) {
t.removeClass('checked');
} else {
t.addClass('checked');
}
}
$(s.rowEl, this).each(function () {
$(s.checkEl, this).click(function (e) {
clickRow($(this).parents(s.rowEl));
});
}).click(function () {
clickRow(this);
});
$(s.selectAllEl).click(function () {
var t = $(this), checked = t.prop('checked');
if (checked) {
$(s.rowEl, table).each(function () {
$(s.checkEl, this).prop('checked', true);
}).addClass('checked');
} else {
$(s.rowEl, table).each(function () {
$(s.checkEl, this).prop('checked', false);
}).removeClass('checked');
}
});
};
})($);
/** 初始化全局对象 */
var Typecho = {};
@ -297,6 +360,7 @@ Typecho.toggle = function (sel, btn, showWord, hideWord) {
};
/** 自动保存组件 */
/*
Typecho.autoSave = new Class({
//继承自Options
@ -376,8 +440,10 @@ Typecho.autoSave = new Class({
}
}
});
*/
/** 文本编辑器插入文字 */
/*
Typecho.textarea = new Class({
//继承自Options
@ -532,6 +598,7 @@ Typecho.textarea = new Class({
this.textarea.selectRange(range.start, range.end + before.length + after.length);
}
});
*/
/** 自动完成 */
Typecho.autoComplete = function (match, token) {

View File

@ -15,7 +15,7 @@ $stat = Typecho_Widget::widget('Widget_Stat');
<div class="operate">
<input type="checkbox" class="typecho-table-select-all" />
<div class="btn-group btn-drop">
<button class="dropdown-toggle" href="">选中项 &nbsp;<i class="icon-caret-down"></i></button>
<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>
</ul>