Skip to content

Commit 968b2ed

Browse files
authored
Merge pull request #89 from Raclamusi/fix_badge
バグ修正と、説明専用バッジ用のスタイルを追加
2 parents 0dc0ac4 + 61b8f30 commit 968b2ed

File tree

6 files changed

+30
-9
lines changed

6 files changed

+30
-9
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## master
44

5+
## 3.0.27 (2026-03-09)
6+
7+
- 検索の表示順を、最短マッチ優先に変更
8+
- ページの別名で検索できるように変更
9+
- 説明専用バッジに対応
10+
- バッジのバグ修正
11+
512
## 3.0.26 (2025-12-15)
613

714
- 検索で、名前空間を除いた完全一致も優先して表示させるよう修正

css/badge.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
@include cr-badge-spec(#7473CA, '.fa-archive');
6060
}
6161

62+
&.exposition-only-spec {
63+
@include cr-badge-spec(#666, '.fa-sticky-note-o');
64+
}
65+
6266
&.latest-spec a {
6367
display: flex;
6468
}
@@ -173,6 +177,12 @@
173177
content: "C++ (廃案)";
174178
}
175179
}
180+
181+
#{$sel}.exposition-only-spec {
182+
& a:before, & ~ #{$sel}.latest-spec:not(.noprefix) a:before {
183+
content: "説明専用";
184+
}
185+
}
176186
}
177187

178188
@mixin cr-badge-auto($sel: "li.badge") {

js/crsearch/dom.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ export default class DOM {
2929
li.addClass('added-in-spec').attr('title', `${cppv}で追加`)
3030
}
3131
} else {
32-
name = attr == 'future' ? '将来' :
33-
attr == 'archive' ? '廃案' :
34-
null
32+
const name = attr == 'future' ? '将来' :
33+
attr == 'archive' ? '廃案' :
34+
null
3535

3636
if (name) {
37-
li.addClass('named-version-spec').attr('title', `C++ (${name})`)
38-
li.attr('named-version', attr)
37+
li.addClass('named-version-spec').attr('title', `C++ (${name})`)
38+
li.attr('data-named-version', attr)
39+
} else if (attr == 'exposition-only') {
40+
li.addClass('exposition-only-spec').attr('title', '説明専用')
3941
}
4042
}
4143

js/crsearch/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ export default class Index {
6363

6464
const attrs = []
6565
if (!opts.badges.noselfcpp && this._cpp_version) {
66-
attrs.push(`added-in-cpp${this._cpp_version}`)
66+
if (!/^(?:future|archive)$/.test(this._cpp_version)) {
67+
attrs.push(`added-in-cpp${this._cpp_version}`)
68+
}
6769
}
6870
if (this._attributes) {
6971
attrs.push(...this._attributes)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "crsearch",
3-
"version": "3.0.26",
3+
"version": "3.0.27",
44
"description": "cpprefjp / boostjp searcher",
55
"main": "dist/js/crsearch.js",
66
"module": "js/crsearch.js",

0 commit comments

Comments
 (0)