feat: 未収録コンテンツ(CF・ハウジング・潜水艦・ミラプリ・リテイナー・ゴールドソーサー・PvP・DD)の完全実装&攻略Wiki規則追加
This commit is contained in:
1 parent
d5a829bcd7
commit
7321c79f8c
20 files changed
+3211
-239
No files matched your search
+107
-111
@@ -11,7 +11,9 @@ const WIKI_NAV_CONFIG = {
|
||||
globalNav: [
|
||||
{ title: '🏠 トップ', path: 'index.html' },
|
||||
{ title: '⭐ フリートライアル最強装備', path: 'equipment/freetrial_gear_guide.html' },
|
||||
{ title: '🐎 マウント完全攻略', path: 'mounts/index.html' }
|
||||
{ title: '🐎 マウント完全攻略', path: 'mounts/index.html' },
|
||||
{ title: '⚔️ バトル・ルーレット完全攻略', path: 'battle_contents/index.html' },
|
||||
{ title: '🏡 ハウジング・潜水艦完全攻略', path: 'housing/index.html' }
|
||||
],
|
||||
sidebar: [
|
||||
{
|
||||
@@ -24,7 +26,9 @@ const WIKI_NAV_CONFIG = {
|
||||
links: [
|
||||
{ text: '🏠 Wiki トップ', path: 'index.html' },
|
||||
{ text: '⭐ フリートライアル最強装備', path: 'equipment/freetrial_gear_guide.html' },
|
||||
{ text: '🐎 マウント総合・全一覧', path: 'mounts/index.html' }
|
||||
{ text: '🐎 マウント総合・全一覧', path: 'mounts/index.html' },
|
||||
{ text: '⚔️ バトル・ルーレット完全攻略', path: 'battle_contents/index.html' },
|
||||
{ text: '🏡 ハウジング・潜水艦完全攻略', path: 'housing/index.html' }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -36,6 +40,17 @@ const WIKI_NAV_CONFIG = {
|
||||
{ text: 'WXHB・同時押し設定', path: 'xhb/wxhb_settings.html' }
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'links',
|
||||
title: '⚔️ バトル・ダンジョン攻略',
|
||||
links: [
|
||||
{ text: 'CF・ルーレット・トームストーン', path: 'battle_contents/index.html' },
|
||||
{ text: 'コンサポ&フェイス完全攻略', path: 'battle_contents/duty_support.html' },
|
||||
{ text: '宝の地図 G1〜G17完全攻略', path: 'battle_contents/treasure_hunt.html' },
|
||||
{ text: 'モブハント・A連戦・S湧かせ', path: 'battle_contents/hunt.html' },
|
||||
{ text: 'ディープダンジョン完全攻略', path: 'deep_dungeon/index.html' }
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'groups',
|
||||
title: '⚔️ 戦闘ジョブ攻略',
|
||||
@@ -89,6 +104,18 @@ const WIKI_NAV_CONFIG = {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'links',
|
||||
title: '🏡 ハウジング・生活・金策',
|
||||
links: [
|
||||
{ text: 'ハウジング総合・土地購入抽選', path: 'housing/index.html' },
|
||||
{ text: '内装・浮かせ技・レイアウト', path: 'housing/interior_layout.html' },
|
||||
{ text: '潜水艦・ボイジャー金策', path: 'housing/submarine_airship.html' },
|
||||
{ text: 'リテイナー&マーケット金策', path: 'retainer/index.html' },
|
||||
{ text: 'ミラプリ&2箇所染色ガイド', path: 'glamour/index.html' },
|
||||
{ text: 'ゴールドソーサー&MGP稼ぎ', path: 'gold_saucer/index.html' }
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'links',
|
||||
title: '⭐ 装備・IL・育成',
|
||||
@@ -124,6 +151,13 @@ const WIKI_NAV_CONFIG = {
|
||||
{ text: 'ギャザクラ製作マクロ集', path: 'crafter_gatherer/macros.html' }
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'links',
|
||||
title: '⚔️ PvP完全攻略',
|
||||
links: [
|
||||
{ text: 'PvP総合・クリコン&FL立ち回り', path: 'pvp/index.html' }
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'links',
|
||||
title: '📜 システム・便利マクロ',
|
||||
@@ -162,7 +196,24 @@ function getWikiRootPrefix() {
|
||||
}
|
||||
const pathname = window.location.pathname.replace(/\\/g, '/');
|
||||
if (pathname.includes('/jobs/')) return '../../';
|
||||
if (pathname.includes('/crafter_gatherer/') || pathname.includes('/xhb/') || pathname.includes('/multiplayer/') || pathname.includes('/macros/') || pathname.includes('/mounts/') || pathname.includes('/equipment/') || pathname.includes('/common/')) return '../';
|
||||
if (
|
||||
pathname.includes('/crafter_gatherer/') ||
|
||||
pathname.includes('/xhb/') ||
|
||||
pathname.includes('/multiplayer/') ||
|
||||
pathname.includes('/macros/') ||
|
||||
pathname.includes('/mounts/') ||
|
||||
pathname.includes('/equipment/') ||
|
||||
pathname.includes('/housing/') ||
|
||||
pathname.includes('/battle_contents/') ||
|
||||
pathname.includes('/glamour/') ||
|
||||
pathname.includes('/retainer/') ||
|
||||
pathname.includes('/gold_saucer/') ||
|
||||
pathname.includes('/pvp/') ||
|
||||
pathname.includes('/deep_dungeon/') ||
|
||||
pathname.includes('/common/')
|
||||
) {
|
||||
return '../';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -199,18 +250,18 @@ function renderHeader(rootPrefix) {
|
||||
function renderGlobalNav(rootPrefix) {
|
||||
const nav = document.getElementById('wiki-global-nav');
|
||||
if (!nav) return;
|
||||
const itemsHtml = WIKI_NAV_CONFIG.globalNav.map(item => {
|
||||
const fullHref = rootPrefix + item.path;
|
||||
const activeClass = isCurrentPage(item.path) ? ' class="active"' : '';
|
||||
return `<li><a href="${fullHref}"${activeClass}>${item.title}</a></li>`;
|
||||
const items = WIKI_NAV_CONFIG.globalNav.map(item => {
|
||||
const active = isCurrentPage(item.path) ? ' class="active"' : '';
|
||||
return `<li><a href="${rootPrefix}${item.path}"${active}>${item.title}</a></li>`;
|
||||
}).join('');
|
||||
nav.innerHTML = `<ul class="wiki-nav-list">${itemsHtml}</ul>`;
|
||||
nav.innerHTML = `<ul class="wiki-nav-list">${items}</ul>`;
|
||||
}
|
||||
|
||||
// サイドバーレンダリング
|
||||
function renderSidebar(rootPrefix) {
|
||||
const sidebar = document.getElementById('wiki-sidebar');
|
||||
if (!sidebar) return;
|
||||
|
||||
let html = '';
|
||||
WIKI_NAV_CONFIG.sidebar.forEach(section => {
|
||||
if (section.type === 'search') {
|
||||
@@ -218,18 +269,17 @@ function renderSidebar(rootPrefix) {
|
||||
<div class="sidebar-box">
|
||||
<div class="sidebar-title">${section.title}</div>
|
||||
<div class="sidebar-content">
|
||||
<div class="sidebar-search-box">
|
||||
<form onsubmit="doSearch(event)" class="sidebar-search-box">
|
||||
<input type="text" id="sidebarSearchInput" class="sidebar-search-input" placeholder="キーワード検索...">
|
||||
<button type="button" id="sidebarSearchBtn" class="sidebar-search-btn">検索</button>
|
||||
</div>
|
||||
<button type="submit" id="sidebarSearchBtn" class="sidebar-search-btn">検索</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
} else if (section.type === 'links') {
|
||||
const linksHtml = section.links.map(link => {
|
||||
const fullHref = rootPrefix + link.path;
|
||||
const currentClass = isCurrentPage(link.path) ? ' class="current"' : '';
|
||||
return `<li${currentClass}><a href="${fullHref}">${link.text}</a></li>`;
|
||||
const linksHtml = section.links.map(l => {
|
||||
const active = isCurrentPage(l.path) ? ' class="active"' : '';
|
||||
return `<li><a href="${rootPrefix}${l.path}"${active}>${l.text}</a></li>`;
|
||||
}).join('');
|
||||
html += `
|
||||
<div class="sidebar-box">
|
||||
@@ -241,15 +291,13 @@ function renderSidebar(rootPrefix) {
|
||||
`;
|
||||
} else if (section.type === 'groups') {
|
||||
let groupsHtml = '';
|
||||
section.groups.forEach((group, idx) => {
|
||||
const marginTop = idx === 0 ? '4px' : '8px';
|
||||
const groupLinks = group.links.map(link => {
|
||||
const fullHref = rootPrefix + link.path;
|
||||
const currentClass = isCurrentPage(link.path) ? ' class="current"' : '';
|
||||
return `<li${currentClass}><a href="${fullHref}">${link.text}</a></li>`;
|
||||
section.groups.forEach(g => {
|
||||
const groupLinks = g.links.map(l => {
|
||||
const active = isCurrentPage(l.path) ? ' class="active"' : '';
|
||||
return `<li><a href="${rootPrefix}${l.path}"${active}>${l.text}</a></li>`;
|
||||
}).join('');
|
||||
groupsHtml += `
|
||||
<p style="font-size: 11px; font-weight: bold; color: #525a66; margin: ${marginTop} 0 2px;">${group.name}</p>
|
||||
<p style="font-size: 11px; font-weight: bold; color: var(--wiki-text-muted); margin: 6px 0 2px;">${g.name}</p>
|
||||
<ul>${groupLinks}</ul>
|
||||
`;
|
||||
});
|
||||
@@ -263,6 +311,7 @@ function renderSidebar(rootPrefix) {
|
||||
`;
|
||||
}
|
||||
});
|
||||
|
||||
sidebar.innerHTML = html;
|
||||
}
|
||||
|
||||
@@ -276,101 +325,48 @@ function renderFooter() {
|
||||
`;
|
||||
}
|
||||
|
||||
// サイト内検索機能の初期化
|
||||
function initSearch(rootPrefix) {
|
||||
const searchInput = document.getElementById('sidebarSearchInput');
|
||||
const searchBtn = document.getElementById('sidebarSearchBtn');
|
||||
if (searchInput) {
|
||||
const doSearch = () => {
|
||||
const q = searchInput.value.trim();
|
||||
if (q) {
|
||||
window.location.href = `${rootPrefix}index.html?q=${encodeURIComponent(q)}`;
|
||||
}
|
||||
};
|
||||
if (searchBtn) searchBtn.addEventListener('click', doSearch);
|
||||
searchInput.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter') doSearch();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// マクロコピーボタンの初期化
|
||||
function initMacroCopy() {
|
||||
document.querySelectorAll('.wiki-macro-box').forEach(box => {
|
||||
const header = box.querySelector('.wiki-macro-header');
|
||||
const code = box.querySelector('.wiki-macro-code');
|
||||
if (header && code && !header.querySelector('button')) {
|
||||
const btn = document.createElement('button');
|
||||
btn.type = 'button';
|
||||
btn.textContent = '📋 マクロをコピー';
|
||||
btn.style.cssText = 'background: #525a66; color: #fff; border: 1px solid #3c424c; padding: 2px 8px; font-size: 11px; cursor: pointer; border-radius: 2px;';
|
||||
btn.addEventListener('click', () => {
|
||||
navigator.clipboard.writeText(code.innerText.trim()).then(() => {
|
||||
btn.textContent = '✔ コピー完了!';
|
||||
setTimeout(() => { btn.textContent = '📋 マクロをコピー'; }, 2000);
|
||||
});
|
||||
});
|
||||
header.appendChild(btn);
|
||||
}
|
||||
// クリップボードコピー機能
|
||||
function copyToClipboard(button, targetId) {
|
||||
const target = document.getElementById(targetId);
|
||||
if (!target) return;
|
||||
const text = target.innerText;
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
const originalText = button.innerText;
|
||||
button.innerText = 'コピー完了!';
|
||||
button.classList.add('copied');
|
||||
setTimeout(() => {
|
||||
button.innerText = originalText;
|
||||
button.classList.remove('copied');
|
||||
}, 2000);
|
||||
}).catch(err => {
|
||||
console.error('コピー失敗:', err);
|
||||
});
|
||||
}
|
||||
|
||||
// キャッシュ完全無効化ポリシーの適用(常に最新データを取得)
|
||||
function applyNoCachePolicy() {
|
||||
// 1. metaタグによるキャッシュ無効化の動的保証
|
||||
const metaDirectives = [
|
||||
{ httpEquiv: 'Cache-Control', content: 'no-cache, no-store, must-revalidate' },
|
||||
{ httpEquiv: 'Pragma', content: 'no-cache' },
|
||||
{ httpEquiv: 'Expires', content: '0' }
|
||||
];
|
||||
metaDirectives.forEach(dir => {
|
||||
if (!document.querySelector('meta[http-equiv="' + dir.httpEquiv + '"]')) {
|
||||
const meta = document.createElement('meta');
|
||||
meta.httpEquiv = dir.httpEquiv;
|
||||
meta.content = dir.content;
|
||||
document.head.appendChild(meta);
|
||||
}
|
||||
});
|
||||
|
||||
// 2. iframe読み込み時のキャッシュバスター付与
|
||||
const cacheBuster = Date.now();
|
||||
document.querySelectorAll('iframe.wiki-header-frame, iframe.wiki-sidebar-frame').forEach(frame => {
|
||||
const originalSrc = frame.getAttribute('src');
|
||||
if (originalSrc && !originalSrc.includes('_t=')) {
|
||||
const separator = originalSrc.includes('?') ? '&' : '?';
|
||||
frame.src = originalSrc + separator + '_t=' + cacheBuster;
|
||||
}
|
||||
});
|
||||
// サイト内検索実行
|
||||
function doSearch(event) {
|
||||
if (event) event.preventDefault();
|
||||
const input = document.getElementById('sidebarSearchInput');
|
||||
const q = input ? input.value.trim() : '';
|
||||
if (q) {
|
||||
const root = getWikiRootPrefix();
|
||||
window.location.href = `${root}index.html?q=${encodeURIComponent(q)}`;
|
||||
}
|
||||
}
|
||||
|
||||
// 共通初期化処理
|
||||
function initWikiCommon() {
|
||||
// キャッシュ無効化を適用
|
||||
applyNoCachePolicy();
|
||||
// 初期化実行
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const root = getWikiRootPrefix();
|
||||
const sidebarFrame = document.querySelector('.wiki-sidebar-frame');
|
||||
const headerFrame = document.querySelector('.wiki-header-frame');
|
||||
|
||||
const rootPrefix = getWikiRootPrefix();
|
||||
|
||||
// iframeが配置されていない場合のみJS動的レンダリング(フォールバック)
|
||||
const hasHeaderFrame = document.querySelector('.wiki-header-frame');
|
||||
const hasSidebarFrame = document.querySelector('.wiki-sidebar-frame');
|
||||
|
||||
if (!hasHeaderFrame) {
|
||||
renderHeader(rootPrefix);
|
||||
renderGlobalNav(rootPrefix);
|
||||
// iframe読み込み失敗時のフォールバックレンダリング
|
||||
if (!sidebarFrame) {
|
||||
renderSidebar(root);
|
||||
}
|
||||
|
||||
if (!hasSidebarFrame) {
|
||||
renderSidebar(rootPrefix);
|
||||
initSearch(rootPrefix);
|
||||
if (!headerFrame) {
|
||||
renderHeader(root);
|
||||
renderGlobalNav(root);
|
||||
}
|
||||
|
||||
renderFooter();
|
||||
initMacroCopy();
|
||||
}
|
||||
|
||||
// DOM ready 時に安全に実行(すでにロード済みのケースも完全対応)
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', initWikiCommon);
|
||||
} else {
|
||||
initWikiCommon();
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user