fix(frontend): align search and header components with reference
This commit is contained in:
1 parent
4c13ef478c
commit
542daca457
34 files changed
+803
-705
No files matched your search
@@ -1165,8 +1165,6 @@ function get_new_dplayer(_this, func) {
|
||||
v_u.indexOf('.mpd') != -1 && _win.dplayer.tbquire.push('dash');
|
||||
v_u.indexOf('.flv') != -1 && _win.dplayer.tbquire.push('flv');
|
||||
|
||||
jQuery('link#dplayer').length || jQuery('dplayer').append('<link type="text/css" id="dplayer" rel="stylesheet" href="' + _win.uri + '/css/dplayer.min.css?ver=' + _win.ver + '">');
|
||||
|
||||
_win.dplayer.tbquire.push('dplayer');
|
||||
|
||||
tbquire(_win.dplayer.tbquire, function () {
|
||||
@@ -3004,24 +3002,6 @@ _win.bd.on('click', '.rewards', function () {
|
||||
//作者页、文章导航、前台编辑、通用模板、微信分享均由 AKSRT 自有脚本按路由入队,
|
||||
//legacy main 不再通过 tbquire 重复加载同功能的旧模块副本。
|
||||
|
||||
//搜索关键词高亮
|
||||
if (_win.bd.hasClass('search')) {
|
||||
var val = jQuery('.search-desc-text .search-key').text();
|
||||
try {
|
||||
var reg = eval('/' + val + '/i');
|
||||
jQuery('.search-tab .item-heading a,.search-tab .item-excerpt,.search-tab .forum-title a,.search-tab .excerpt,#search-tab-user .display-name').each(function () {
|
||||
var $this = jQuery(this);
|
||||
if ($this.text().search(reg) != -1) {
|
||||
$this.html(
|
||||
$this.html().replace(reg, function (w) {
|
||||
return '<b class="focus-color">' + w + '</b>';
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
//数字填写翻页
|
||||
_win.bd.on('click', '.pag-jump .jump-icon', function () {
|
||||
var _input = jQuery(this).siblings('.jump-input');
|
||||
@@ -3449,7 +3429,7 @@ jQuery.fn.AutoSearch = function () {
|
||||
|
||||
//搜索功能-恢复默认占位符
|
||||
_win.bd.on('click', '.main-search [data-for]', function () {
|
||||
var _placeholder = jQuery('.main-search').find('.scale-placeholder');
|
||||
var _placeholder = jQuery(this).closest('form').find('.scale-placeholder');
|
||||
if (_placeholder.length) {
|
||||
_placeholder.text(_placeholder.attr('default'));
|
||||
}
|
||||
@@ -3534,6 +3514,8 @@ if (jQuery('.search-page-ajaxpager').length) {
|
||||
_win.bd.on('submit', '.page-search-box .search-form', function () {
|
||||
var $this = jQuery(this);
|
||||
var data = $this.serializeObject();
|
||||
// The empty-search page has no results pager to replace.
|
||||
if (!String(data.s || '').trim()) return;
|
||||
var url = new URL($this.attr('action'));
|
||||
url.search = new URLSearchParams(data).toString();
|
||||
|
||||
@@ -3679,12 +3661,15 @@ jQuery.fn.serializeObject = function () {
|
||||
//清空搜索关键词
|
||||
_win.bd.on('click', '.trash-history-search', function () {
|
||||
if (confirm(aksrt__('confirm_clear_search')) == true) {
|
||||
var control = jQuery(this);
|
||||
jQuery('.history-search')
|
||||
.slideUp()
|
||||
.delay(1000, function () {
|
||||
.slideUp(300, function () {
|
||||
jQuery(this).remove();
|
||||
});
|
||||
jQuery.cookie('history_search', '');
|
||||
jQuery.cookie('history_search', null, {
|
||||
path: control.attr('data-cookie-path') || '/',
|
||||
domain: control.attr('data-cookie-domain') || '',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user