@kangsicj/dcinsideenhancer 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  // @name DCInside Enhancer
3
3
  // @name:ko 디시 인핸서
4
4
  // @namespace https://github.com/kangsicj/DCInsideEnhancer
5
- // @version 1.3.1
5
+ // @version 1.3.2
6
6
  // @description DCInside filter & enhancer — mobile & PC. Block users/words/heads/notices/images & GIFs across posts, infinite list, zoom viewer, theme sync, encrypted multi-device sync.
7
7
  // @description:ko 디시인사이드 차단·편의 기능 (모바일·PC) - 유저·단어(제목/본문)·말머리·공지 차단, 같은/비슷한 이미지·움짤 모든 글 차단, 디시콘 제거, 차단 미디어 데이터 절약, 목록 자동 보충·무한 스크롤·뒤로 가기 위치 복원, 스크랩, 이미지 확대뷰 개선, 야간모드 자동 연동, 암호화 기기 간 동기화
8
8
  // @author kangsicj
@@ -2,7 +2,7 @@
2
2
  // @name DCInside Enhancer
3
3
  // @name:ko 디시 인핸서
4
4
  // @namespace https://github.com/kangsicj/DCInsideEnhancer
5
- // @version 1.3.1
5
+ // @version 1.3.2
6
6
  // @description DCInside filter & enhancer — mobile & PC. Block users/words/heads/notices/images & GIFs across posts, infinite list, zoom viewer, theme sync, encrypted multi-device sync.
7
7
  // @description:ko 디시인사이드 차단·편의 기능 (모바일·PC) - 유저·단어(제목/본문)·말머리·공지 차단, 같은/비슷한 이미지·움짤 모든 글 차단, 디시콘 제거, 차단 미디어 데이터 절약, 목록 자동 보충·무한 스크롤·뒤로 가기 위치 복원, 스크랩, 이미지 확대뷰 개선, 야간모드 자동 연동, 암호화 기기 간 동기화
8
8
  // @author kangsicj
@@ -75,7 +75,7 @@
75
75
  // 0. 설정·상수
76
76
  // =========================================================
77
77
 
78
- const SCRIPT_VERSION = '1.3.1';
78
+ const SCRIPT_VERSION = '1.3.2';
79
79
  const PROJECT_URL = 'https://github.com/kangsicj/DCInsideEnhancer';
80
80
  const DONATE_URL = 'https://fairy.hada.io/@jinny#support';
81
81
 
@@ -223,6 +223,7 @@
223
223
  hideNewsRows: true,
224
224
  hideCommentAds: true,
225
225
  hideCommentFab: true,
226
+ mobileRecentBar: true,
226
227
  mobileRecentStrip: true,
227
228
  hideSilbeAlarm: true,
228
229
  alarmBubble: true,
@@ -2069,6 +2070,44 @@
2069
2070
 
2070
2071
  .dc-pv-anchor { text-decoration: underline !important; text-decoration-color: var(--dc-accent-ink) !important; }
2071
2072
 
2073
+ #dc-recent-bar {
2074
+ display: flex;
2075
+ align-items: center;
2076
+ gap: 0;
2077
+ height: 34px;
2078
+ margin: 0;
2079
+ padding: 0 6px;
2080
+ overflow-x: auto;
2081
+ overflow-y: hidden;
2082
+ -webkit-overflow-scrolling: touch;
2083
+ scrollbar-width: none;
2084
+ overscroll-behavior-x: contain;
2085
+ background: var(--dc-rb-bg, #3b4890);
2086
+ border-bottom: 1px solid rgba(255,255,255,.12);
2087
+ box-sizing: border-box;
2088
+ }
2089
+ #dc-recent-bar::-webkit-scrollbar { display: none; }
2090
+ #dc-recent-bar .dc-rb-item {
2091
+ flex: 0 0 auto;
2092
+ display: inline-flex;
2093
+ align-items: center;
2094
+ gap: 2px;
2095
+ max-width: 46vw;
2096
+ height: 34px;
2097
+ padding: 0 10px;
2098
+ overflow: hidden;
2099
+ color: rgba(255,255,255,.82);
2100
+ font-size: 13px;
2101
+ font-weight: 500;
2102
+ letter-spacing: -.3px;
2103
+ text-decoration: none;
2104
+ text-overflow: ellipsis;
2105
+ white-space: nowrap;
2106
+ }
2107
+ #dc-recent-bar .dc-rb-item + .dc-rb-item { border-left: 1px solid rgba(255,255,255,.18); }
2108
+ #dc-recent-bar .dc-rb-item.on { color: var(--dc-rb-on, #ffe10a); font-weight: 700; }
2109
+ #dc-recent-bar .dc-rb-kind { font-size: 11px; opacity: .8; }
2110
+
2072
2111
  html.dc-recent-strip-on #lately_pop.dc-strip-lately #swiper-lately,
2073
2112
  html.dc-recent-strip-on #lately_pop.dc-strip-lately #lately_paging1 { display: none !important; }
2074
2113
  .dc-recent-strip {
@@ -10506,6 +10545,14 @@
10506
10545
  off: '댓글로 이동 버튼을 보여 줍니다.',
10507
10546
  refresh: 'root'
10508
10547
  },
10548
+ {
10549
+ group: 'clean',
10550
+ key: 'mobileRecentBar',
10551
+ name: '메뉴 위에 최근 방문 갤러리 늘 보이기 (모바일)',
10552
+ on: '검색창과 [갤러리 · 마이너갤 · …] 메뉴 사이에 최근 방문 갤러리를 한 줄로 보여 줍니다. 옆으로 밀어 보고, 누르면 바로 이동합니다. 지금 갤러리는 노란색입니다.',
10553
+ off: '[최근 방문]을 눌러야 보입니다.',
10554
+ refresh: 'root'
10555
+ },
10509
10556
  {
10510
10557
  group: 'clean',
10511
10558
  key: 'mobileRecentStrip',
@@ -10806,6 +10853,10 @@
10806
10853
  repinReadColors();
10807
10854
  }
10808
10855
 
10856
+ if (item.key === 'mobileRecentBar') {
10857
+ renderRecentBar();
10858
+ }
10859
+
10809
10860
  if (item.key === 'mobileRecentStrip') {
10810
10861
  renderRecentStrip();
10811
10862
  }
@@ -13575,10 +13626,11 @@
13575
13626
  const ordered = orderRecent(kept);
13576
13627
 
13577
13628
  if (recentOrder.fixed) {
13578
- const keys = ordered.map(recentKeyOf);
13629
+ const known = new Set(recentOrder.keys);
13630
+ const added = ordered.map(recentKeyOf).filter(key => !known.has(key));
13579
13631
 
13580
- if (JSON.stringify(keys) !== JSON.stringify(recentOrder.keys.filter(key => keys.includes(key)))) {
13581
- recentOrder = { ...recentOrder, keys };
13632
+ if (added.length) {
13633
+ recentOrder = { ...recentOrder, keys: [...recentOrder.keys, ...added].slice(-200) };
13582
13634
  writeJson(STORAGE.recentOrder, recentOrder);
13583
13635
  }
13584
13636
  }
@@ -13592,6 +13644,7 @@
13592
13644
  writeJson(STORAGE.recent, recentGalls);
13593
13645
  exportNativeRecent();
13594
13646
  reorderNativeRecentDom();
13647
+ refreshRecentViews();
13595
13648
  };
13596
13649
 
13597
13650
  const moveRecent = (item, step) => {
@@ -13609,6 +13662,7 @@
13609
13662
  writeJson(STORAGE.recent, recentGalls);
13610
13663
  exportNativeRecent();
13611
13664
  reorderNativeRecentDom();
13665
+ refreshRecentViews();
13612
13666
  };
13613
13667
 
13614
13668
  const reorderNativeRecentDom = () => {
@@ -13634,6 +13688,18 @@
13634
13688
  const saveRecent = () => {
13635
13689
  recentGalls = tidyRecent(recentGalls);
13636
13690
  writeJson(STORAGE.recent, recentGalls);
13691
+ refreshRecentViews();
13692
+ };
13693
+
13694
+ let recentViewTimer = null;
13695
+
13696
+ const refreshRecentViews = () => {
13697
+ clearTimeout(recentViewTimer);
13698
+ recentViewTimer = setTimeout(() => {
13699
+ if (typeof initialized !== 'undefined' && initialized) {
13700
+ renderRecentBar();
13701
+ }
13702
+ }, 50);
13637
13703
  };
13638
13704
 
13639
13705
  const recentUrl = item => {
@@ -14004,6 +14070,62 @@
14004
14070
  strip.querySelector('.dc-rs-chip.here')?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' });
14005
14071
  };
14006
14072
 
14073
+ const renderRecentBar = () => {
14074
+ const nav = IS_MOBILE_SITE ? document.querySelector('nav.nav') : null;
14075
+ let bar = document.getElementById('dc-recent-bar');
14076
+
14077
+ if (!nav || settings.mobileRecentBar === false || !recentGalls.length) {
14078
+ bar?.remove();
14079
+ return;
14080
+ }
14081
+
14082
+ if (!bar) {
14083
+ bar = h('div', 'dc-ui');
14084
+ bar.id = 'dc-recent-bar';
14085
+ bar.setAttribute('aria-label', '최근 방문 갤러리');
14086
+ nav.parentNode.insertBefore(bar, nav);
14087
+ }
14088
+
14089
+ try {
14090
+ const cs = getComputedStyle(nav);
14091
+ const active = nav.querySelector('li.on a') || nav.querySelector('a');
14092
+
14093
+ bar.style.setProperty('--dc-rb-bg', cs.backgroundColor);
14094
+ bar.style.setProperty('--dc-rb-on', active ? getComputedStyle(active).color : '#ffe10a');
14095
+ } catch {
14096
+ }
14097
+
14098
+ const keep = bar.scrollLeft;
14099
+ const here = (currentGalleryVisit() || {}).id;
14100
+
14101
+ bar.textContent = '';
14102
+
14103
+ recentGalls.forEach(item => {
14104
+ const link = h('a', `dc-rb-item${item.id === here ? ' on' : ''}`, item.n || item.id);
14105
+
14106
+ link.href = recentUrl(item);
14107
+
14108
+ if (item.k !== 'G') {
14109
+ link.appendChild(h('span', 'dc-rb-kind', item.k === 'M' ? 'ⓜ' : item.k === 'N' ? 'ⓝ' : 'ⓟ'));
14110
+ }
14111
+
14112
+ bar.appendChild(link);
14113
+ });
14114
+
14115
+ bar.scrollLeft = keep;
14116
+
14117
+ const on = bar.querySelector('.dc-rb-item.on');
14118
+
14119
+ if (on && !keep) {
14120
+ const b = bar.getBoundingClientRect();
14121
+ const r = on.getBoundingClientRect();
14122
+
14123
+ if (r.right > b.right || r.left < b.left) {
14124
+ bar.scrollLeft += r.left - b.left - 12;
14125
+ }
14126
+ }
14127
+ };
14128
+
14007
14129
  const watchRecentStrip = () => {
14008
14130
  const pop = document.getElementById('lately_pop');
14009
14131
 
@@ -14039,6 +14161,7 @@
14039
14161
  exportNativeRecent();
14040
14162
  watchNativeRecentDom();
14041
14163
  watchRecentStrip();
14164
+ renderRecentBar();
14042
14165
 
14043
14166
  const follow = () => {
14044
14167
  if (document.visibilityState === 'visible' && (importNativeRecent() || recentOrder.fixed)) {
@@ -14074,6 +14197,7 @@
14074
14197
  writeJson(STORAGE.recent, recentGalls);
14075
14198
  exportNativeRecent();
14076
14199
  reorderNativeRecentDom();
14200
+ refreshRecentViews();
14077
14201
 
14078
14202
  return true;
14079
14203
  };
@@ -14117,6 +14241,7 @@
14117
14241
  recentGalls = next;
14118
14242
  writeJson(STORAGE.recent, recentGalls);
14119
14243
  exportNativeRecent();
14244
+ refreshRecentViews();
14120
14245
 
14121
14246
  return true;
14122
14247
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kangsicj/dcinsideenhancer",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "DCInside filter & enhancer userscript for mobile and PC (디시인사이드 차단·편의 유저스크립트)",
5
5
  "license": "MIT",
6
6
  "author": "kangsicj",