diff --git a/common/js/wiki_common.js b/common/js/wiki_common.js index e74892b..b24a2d5 100644 --- a/common/js/wiki_common.js +++ b/common/js/wiki_common.js @@ -1,412 +1,414 @@ -/** - * FINAL FANTASY XIV 総合攻略Wiki - * 共通ナビゲーション&UI自動レンダリングエンジン - * Seesaa Wiki ニュートラルグレー テンプレート準拠 - */ - -// サイト共通ナビゲーション定義マスター -const WIKI_NAV_CONFIG = { - siteTitle: 'FINAL FANTASY XIV 総合攻略Wiki', - siteDesc: '光の戦士のための実戦立ち回り・XHB配置・マクロ詳細・育成ロードマップ集成 (パッチ7.x 黄金のレガシー対応)', - globalNav: [ - { title: '🏠 トップ', path: 'index.html' }, - { title: '⭐ フリートライアル最強装備', path: 'equipment/freetrial_gear_guide.html' }, - { title: '🐎 マウント完全攻略', path: 'mounts/index.html' }, - { title: '🏰 ダンジョン完全攻略一覧', path: 'dungeons/index.html' }, - { title: '🔥 討滅戦完全攻略一覧', path: 'trials/index.html' }, - { title: '👑 レイド完全攻略一覧', path: 'raids/index.html' }, - { title: '⚔️ バトル・ルーレット完全攻略', path: 'battle_contents/index.html' }, - { title: '🏡 ハウジング・潜水艦完全攻略', path: 'housing/index.html' } - ], - sidebar: [ - { - type: 'search', - title: 'サイト内検索' - }, - { - type: 'links', - title: 'メインメニュー', - links: [ - { text: '🏠 Wiki トップ', path: 'index.html' }, - { text: '⭐ フリートライアル最強装備', path: 'equipment/freetrial_gear_guide.html' }, - { text: '🐎 マウント総合・全一覧', path: 'mounts/index.html' }, - { text: '🏰 ダンジョン完全攻略一覧', path: 'dungeons/index.html' }, - { text: '🔥 討滅戦完全攻略一覧', path: 'trials/index.html' }, - { text: '👑 レイド完全攻略一覧', path: 'raids/index.html' }, - { text: '⚔️ バトル・ルーレット完全攻略', path: 'battle_contents/index.html' }, - { text: '🏡 ハウジング・潜水艦完全攻略', path: 'housing/index.html' } - ] - }, - { - type: 'links', - title: '🎮 XHB・操作設計', - links: [ - { text: 'XHB総合案内・思想', path: 'xhb/index.html' }, - { text: '全ジョブ共通XHB配置', path: 'xhb/common_layout.html' }, - { text: 'WXHB・同時押し設定', path: 'xhb/wxhb_settings.html' } - ] - }, - { - type: 'groups', - title: '🏰 バトル個別攻略', - groups: [ - { - name: '【ダンジョン個別攻略】', - links: [ - { text: 'ダンジョン総合ポータル', path: 'dungeons/index.html' }, - { text: 'サスタシャ侵食洞 (Lv15)', path: 'dungeons/sastasha.html' }, - { text: 'タムタラの墓所 (Lv16)', path: 'dungeons/tam_tara.html' }, - { text: 'カッパーベル銅山 (Lv17)', path: 'dungeons/copperbell.html' }, - { text: '記憶幻想 アレクサンドリア (Lv100)', path: 'dungeons/alexandria.html' } - ] - }, - { - name: '【討滅戦個別攻略】', - links: [ - { text: '討滅戦総合ポータル', path: 'trials/index.html' }, - { text: 'イフリート討滅戦 (Lv20)', path: 'trials/ifrit.html' } - ] - }, - { - name: '【レイド個別攻略】', - links: [ - { text: 'レイド総合ポータル', path: 'raids/index.html' }, - { text: 'アルカディア LH1層 (Lv100)', path: 'raids/arcadia_lh1.html' }, - { text: '古代の民の迷宮 (Lv50)', path: 'raids/labyrinth_of_ancients.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: '⚔️ 戦闘ジョブ攻略', - groups: [ - { - name: '【巴術士】', - links: [ - { text: '巴術士基礎・ジョブ解放', path: 'jobs/arcanist/index.html' }, - { text: '巴術士専用マクロ', path: 'jobs/arcanist/macros.html' } - ] - }, - { - name: '【召喚士】', - links: [ - { text: '召喚士トップ・基礎', path: 'jobs/summoner/index.html' }, - { text: 'Lv34スキル回し', path: 'jobs/summoner/rotation_lv34.html' }, - { text: 'Lv50〜100バースト回し', path: 'jobs/summoner/rotation_lv50_100.html' }, - { text: '召喚士専用XHB配置', path: 'jobs/summoner/xhb.html' }, - { text: '召喚士実戦マクロ集', path: 'jobs/summoner/macros.html' } - ] - }, - { - name: '【学者】', - links: [ - { text: '学者トップ・Lv34基礎', path: 'jobs/scholar/index.html' }, - { text: 'フェアリー操作の極意', path: 'jobs/scholar/fairy_guide.html' }, - { text: '学者専用XHB配置', path: 'jobs/scholar/xhb.html' }, - { text: '学者実戦マクロ集', path: 'jobs/scholar/macros.html' } - ] - }, - { - name: '【吟遊詩人】', - links: [ - { text: '吟遊詩人トップ・基礎', path: 'jobs/bard/index.html' }, - { text: '3大戦歌ローテーション', path: 'jobs/bard/songs_rotation.html' }, - { text: 'Lv70〜100スキル回し', path: 'jobs/bard/rotation_lv70_100.html' }, - { text: '固定48枠XHB完全設計', path: 'jobs/bard/xhb.html' }, - { text: '12×1 CD監視ホットバー', path: 'jobs/bard/cd_hotbar.html' }, - { text: '吟遊詩人実戦マクロ集', path: 'jobs/bard/macros.html' } - ] - }, - { - name: '【侍】', - links: [ - { text: '侍トップ・基礎', path: 'jobs/samurai/index.html' }, - { text: '雪月花・コンボ・バースト', path: 'jobs/samurai/combos_rotation.html' }, - { text: '固定48枠XHB完全設計', path: 'jobs/samurai/xhb.html' }, - { text: '12×1 CD監視ホットバー', path: 'jobs/samurai/cd_hotbar.html' }, - { text: '侍実戦マクロ集', path: 'jobs/samurai/macros.html' } - ] - } - ] - }, - { - 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・育成', - links: [ - { text: 'フリトラ最強装備ガイド', path: 'equipment/freetrial_gear_guide.html' } - ] - }, - { - type: 'links', - title: '🐎 マウント完全攻略', - links: [ - { text: 'マウント総合トップ・全一覧', path: 'mounts/index.html' }, - { text: 'ストーリー・クエスト入手', path: 'mounts/quest_story.html' }, - { text: '友好部族(蛮族)マウント', path: 'mounts/tribal_quests.html' }, - { text: '極蛮神・連動マウント', path: 'mounts/extreme_trials.html' }, - { text: '高難易度レイド・零式', path: 'mounts/raids_savage.html' }, - { text: 'ゴールドソーサー(MGP)', path: 'mounts/gold_saucer.html' }, - { text: 'DD・特殊探索・VD', path: 'mounts/deep_dungeon_field.html' }, - { text: 'アチーブメント・PvP', path: 'mounts/achievements_pvp.html' }, - { text: '生活系・復興・無人島', path: 'mounts/life_island_hunt.html' }, - { text: 'オンラインストア・絶版', path: 'mounts/store_events.html' } - ] - }, - { - type: 'links', - title: '🔨 ギャザラー・クラフター', - links: [ - { text: 'ギャザクラ総合トップ', path: 'crafter_gatherer/index.html' }, - { text: '全ギルド・NPC座標一覧', path: 'crafter_gatherer/npc_locations.html' }, - { text: '爆速レベル上げロードマップ', path: 'crafter_gatherer/leveling_roadmap.html' }, - { text: 'リーヴ&GC調達納品', path: 'crafter_gatherer/leves_gc_supply.html' }, - { text: '復興・釣り・お得意様', path: 'crafter_gatherer/ishgard_ocean_custom.html' }, - { text: 'ギャザクラ製作マクロ集', path: 'crafter_gatherer/macros.html' } - ] - }, - { - type: 'links', - title: '⚔️ PvP完全攻略', - links: [ - { text: 'PvP総合・クリコン&FL立ち回り', path: 'pvp/index.html' } - ] - }, - { - type: 'links', - title: '📜 システム・便利マクロ', - links: [ - { text: 'プレイ快適化・便利マクロ大全', path: 'macros/useful_macros.html' } - ] - }, - { - type: 'links', - title: '🛡️ マルチプレイ基礎', - links: [ - { text: '初心者心得・基本マナー', path: 'multiplayer/index.html' }, - { text: 'ID・討伐戦立ち回り基礎', path: 'multiplayer/dungeon_basics.html' } - ] - } - ], - footer: { - copyright: '© SQUARE ENIX CO., LTD. All Rights Reserved. | FINAL FANTASY XIV', - subText: 'FF14 攻略Wiki (Seesaa Wiki ニュートラルグレー テンプレート完全準拠)' - } -}; - -// Wikiルートへの相対パスプレフィックスを検出 -function getWikiRootPrefix() { - const scripts = document.querySelectorAll('script'); - for (let i = 0; i < scripts.length; i++) { - const src = scripts[i].getAttribute('src') || ''; - const idx = src.indexOf('common/js/wiki_common.js'); - if (idx !== -1) { - return src.substring(0, idx); - } - // common/ 内のパーツHTML (common/sidebar.html 等) からの読み込み - if (src.endsWith('wiki_common.js') && (src.includes('js/') || src === 'wiki_common.js')) { - return '../'; - } - } - 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('/housing/') || - pathname.includes('/battle_contents/') || - pathname.includes('/glamour/') || - pathname.includes('/retainer/') || - pathname.includes('/gold_saucer/') || - pathname.includes('/pvp/') || - pathname.includes('/deep_dungeon/') || - pathname.includes('/dungeons/') || - pathname.includes('/trials/') || - pathname.includes('/raids/') || - pathname.includes('/common/') - ) { - return '../'; - } - return ''; -} - -// 現在のページ判定 -function isCurrentPage(linkPath) { - const currentPath = window.location.pathname.replace(/\\/g, '/'); - if (currentPath.endsWith('/' + linkPath) || currentPath.endsWith(linkPath)) { - return true; - } - if (linkPath.endsWith('index.html')) { - const dirPath = linkPath.replace(/index\.html$/, ''); - if (currentPath.endsWith('/' + dirPath) || currentPath.endsWith(dirPath)) { - return true; - } - } - return false; -} - -// ヘッダーレンダリング -function renderHeader(rootPrefix) { - const header = document.getElementById('wiki-header'); - if (!header) return; - header.innerHTML = ` -
- ${WIKI_NAV_CONFIG.siteTitle} -
-
- ${WIKI_NAV_CONFIG.siteDesc} -
- `; -} - -// グローバルナビレンダリング -function renderGlobalNav(rootPrefix) { - const nav = document.getElementById('wiki-global-nav'); - if (!nav) return; - const items = WIKI_NAV_CONFIG.globalNav.map(item => { - const active = isCurrentPage(item.path) ? ' class="active"' : ''; - return `
  • ${item.title}
  • `; - }).join(''); - nav.innerHTML = ``; -} - -// サイドバーレンダリング -function renderSidebar(rootPrefix) { - const sidebar = document.getElementById('wiki-sidebar'); - if (!sidebar) return; - - let html = ''; - WIKI_NAV_CONFIG.sidebar.forEach(section => { - if (section.type === 'search') { - html += ` - - `; - } else if (section.type === 'links') { - const linksHtml = section.links.map(l => { - const active = isCurrentPage(l.path) ? ' class="active"' : ''; - return `
  • ${l.text}
  • `; - }).join(''); - html += ` - - `; - } else if (section.type === 'groups') { - let groupsHtml = ''; - section.groups.forEach(g => { - const groupLinks = g.links.map(l => { - const active = isCurrentPage(l.path) ? ' class="active"' : ''; - return `
  • ${l.text}
  • `; - }).join(''); - groupsHtml += ` -

    ${g.name}

    - - `; - }); - html += ` - - `; - } - }); - - sidebar.innerHTML = html; -} - -// フッターレンダリング -function renderFooter() { - const footer = document.getElementById('wiki-footer'); - if (!footer) return; - footer.innerHTML = ` -

    ${WIKI_NAV_CONFIG.footer.copyright}

    -

    ${WIKI_NAV_CONFIG.footer.subText}

    - `; -} - -// クリップボードコピー機能 -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 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)}`; - } -} - -// 初期化実行 -document.addEventListener('DOMContentLoaded', () => { - const root = getWikiRootPrefix(); - const sidebarFrame = document.querySelector('.wiki-sidebar-frame'); - const headerFrame = document.querySelector('.wiki-header-frame'); - - // iframe読み込み失敗時のフォールバックレンダリング - if (!sidebarFrame) { - renderSidebar(root); - } - if (!headerFrame) { - renderHeader(root); - renderGlobalNav(root); - } - renderFooter(); -}); +/** + * FINAL FANTASY XIV 総合攻略Wiki + * 共通ナビゲーション&UI自動レンダリングエンジン + * Seesaa Wiki ニュートラルグレー テンプレート準拠 + */ + +// サイト共通ナビゲーション定義マスター +const WIKI_NAV_CONFIG = { + siteTitle: 'FINAL FANTASY XIV 総合攻略Wiki', + siteDesc: '光の戦士のための実戦立ち回り・XHB配置・マクロ詳細・育成ロードマップ集成 (パッチ7.x 黄金のレガシー対応)', + globalNav: [ + { title: '🏠 トップ', path: 'index.html' }, + { title: '⭐ フリートライアル最強装備', path: 'equipment/freetrial_gear_guide.html' }, + { title: '🐎 マウント完全攻略', path: 'mounts/index.html' }, + { title: '🏰 ダンジョン完全攻略一覧', path: 'dungeons/index.html' }, + { title: '🔥 討滅戦完全攻略一覧', path: 'trials/index.html' }, + { title: '👑 レイド完全攻略一覧', path: 'raids/index.html' }, + { title: '⚔️ バトル・ルーレット完全攻略', path: 'battle_contents/index.html' }, + { title: '🏡 ハウジング・潜水艦完全攻略', path: 'housing/index.html' } + ], + sidebar: [ + { + type: 'search', + title: 'サイト内検索' + }, + { + type: 'links', + title: 'メインメニュー', + links: [ + { text: '🏠 Wiki トップ', path: 'index.html' }, + { text: '⭐ フリートライアル最強装備', path: 'equipment/freetrial_gear_guide.html' }, + { text: '🐎 マウント総合・全一覧', path: 'mounts/index.html' }, + { text: '🏰 ダンジョン完全攻略一覧', path: 'dungeons/index.html' }, + { text: '🔥 討滅戦完全攻略一覧', path: 'trials/index.html' }, + { text: '👑 レイド完全攻略一覧', path: 'raids/index.html' }, + { text: '⚔️ バトル・ルーレット完全攻略', path: 'battle_contents/index.html' }, + { text: '🏡 ハウジング・潜水艦完全攻略', path: 'housing/index.html' } + ] + }, + { + type: 'links', + title: '🎮 XHB・操作設計', + links: [ + { text: 'XHB総合案内・思想', path: 'xhb/index.html' }, + { text: '全ジョブ共通XHB配置', path: 'xhb/common_layout.html' }, + { text: 'WXHB・同時押し設定', path: 'xhb/wxhb_settings.html' } + ] + }, + { + type: 'groups', + title: '🏰 バトル個別攻略', + groups: [ + { + name: '【ダンジョン個別攻略】', + links: [ + { text: 'ダンジョン総合ポータル', path: 'dungeons/index.html' }, + { text: 'サスタシャ侵食洞 (Lv15)', path: 'dungeons/sastasha.html' }, + { text: 'タムタラの墓所 (Lv16)', path: 'dungeons/tam_tara.html' }, + { text: 'カッパーベル銅山 (Lv17)', path: 'dungeons/copperbell.html' }, + { text: '記憶幻想 アレクサンドリア (Lv100)', path: 'dungeons/alexandria.html' }, + { text: 'ブレイフロクスの野営地 (Lv32)', path: 'dungeons/brayflox.html' } + ] + }, + { + name: '【討滅戦個別攻略】', + links: [ + { text: '討滅戦総合ポータル', path: 'trials/index.html' }, + { text: 'イフリート討滅戦 (Lv20)', path: 'trials/ifrit.html' } + ] + }, + { + name: '【レイド個別攻略】', + links: [ + { text: 'レイド総合ポータル', path: 'raids/index.html' }, + { text: 'アルカディア LH1層 (Lv100)', path: 'raids/arcadia_lh1.html' }, + { text: '古代の民の迷宮 (Lv50)', path: 'raids/labyrinth_of_ancients.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: '⚔️ 戦闘ジョブ攻略', + groups: [ + { + name: '【巴術士】', + links: [ + { text: '巴術士基礎・ジョブ解放', path: 'jobs/arcanist/index.html' }, + { text: '巴術士専用マクロ', path: 'jobs/arcanist/macros.html' } + ] + }, + { + name: '【召喚士】', + links: [ + { text: '召喚士トップ・基礎', path: 'jobs/summoner/index.html' }, + { text: 'Lv34スキル回し', path: 'jobs/summoner/rotation_lv34.html' }, + { text: 'Lv50〜100バースト回し', path: 'jobs/summoner/rotation_lv50_100.html' }, + { text: '召喚士専用XHB配置', path: 'jobs/summoner/xhb.html' }, + { text: '召喚士実戦マクロ集', path: 'jobs/summoner/macros.html' } + ] + }, + { + name: '【学者】', + links: [ + { text: '学者トップ・Lv34基礎', path: 'jobs/scholar/index.html' }, + { text: 'フェアリー操作の極意', path: 'jobs/scholar/fairy_guide.html' }, + { text: '学者専用XHB配置', path: 'jobs/scholar/xhb.html' }, + { text: '学者実戦マクロ集', path: 'jobs/scholar/macros.html' } + ] + }, + { + name: '【吟遊詩人】', + links: [ + { text: '吟遊詩人トップ・基礎', path: 'jobs/bard/index.html' }, + { text: '3大戦歌ローテーション', path: 'jobs/bard/songs_rotation.html' }, + { text: 'Lv70〜100スキル回し', path: 'jobs/bard/rotation_lv70_100.html' }, + { text: '固定48枠XHB完全設計', path: 'jobs/bard/xhb.html' }, + { text: '12×1 CD監視ホットバー', path: 'jobs/bard/cd_hotbar.html' }, + { text: '吟遊詩人実戦マクロ集', path: 'jobs/bard/macros.html' } + ] + }, + { + name: '【侍】', + links: [ + { text: '侍トップ・基礎', path: 'jobs/samurai/index.html' }, + { text: '雪月花・コンボ・バースト', path: 'jobs/samurai/combos_rotation.html' }, + { text: '固定48枠XHB完全設計', path: 'jobs/samurai/xhb.html' }, + { text: '12×1 CD監視ホットバー', path: 'jobs/samurai/cd_hotbar.html' }, + { text: '侍実戦マクロ集', path: 'jobs/samurai/macros.html' } + ] + } + ] + }, + { + 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・育成', + links: [ + { text: 'フリトラ最強装備ガイド', path: 'equipment/freetrial_gear_guide.html' } + ] + }, + { + type: 'links', + title: '🐎 マウント完全攻略', + links: [ + { text: 'マウント総合トップ・全一覧', path: 'mounts/index.html' }, + { text: 'ストーリー・クエスト入手', path: 'mounts/quest_story.html' }, + { text: '友好部族(蛮族)マウント', path: 'mounts/tribal_quests.html' }, + { text: '極蛮神・連動マウント', path: 'mounts/extreme_trials.html' }, + { text: '高難易度レイド・零式', path: 'mounts/raids_savage.html' }, + { text: 'ゴールドソーサー(MGP)', path: 'mounts/gold_saucer.html' }, + { text: 'DD・特殊探索・VD', path: 'mounts/deep_dungeon_field.html' }, + { text: 'アチーブメント・PvP', path: 'mounts/achievements_pvp.html' }, + { text: '生活系・復興・無人島', path: 'mounts/life_island_hunt.html' }, + { text: 'オンラインストア・絶版', path: 'mounts/store_events.html' } + ] + }, + { + type: 'links', + title: '🔨 ギャザラー・クラフター', + links: [ + { text: 'ギャザクラ総合トップ', path: 'crafter_gatherer/index.html' }, + { text: '全ギルド・NPC座標一覧', path: 'crafter_gatherer/npc_locations.html' }, + { text: '爆速レベル上げロードマップ', path: 'crafter_gatherer/leveling_roadmap.html' }, + { text: 'リーヴ&GC調達納品', path: 'crafter_gatherer/leves_gc_supply.html' }, + { text: '復興・釣り・お得意様', path: 'crafter_gatherer/ishgard_ocean_custom.html' }, + { text: 'ギャザクラ製作マクロ集', path: 'crafter_gatherer/macros.html' } + ] + }, + { + type: 'links', + title: '⚔️ PvP完全攻略', + links: [ + { text: 'PvP総合・クリコン&FL立ち回り', path: 'pvp/index.html' } + ] + }, + { + type: 'links', + title: '📜 システム・便利マクロ', + links: [ + { text: 'プレイ快適化・便利マクロ大全', path: 'macros/useful_macros.html' } + ] + }, + { + type: 'links', + title: '🛡️ マルチプレイ基礎', + links: [ + { text: '初心者心得・基本マナー', path: 'multiplayer/index.html' }, + { text: 'ID・討伐戦立ち回り基礎', path: 'multiplayer/dungeon_basics.html' } + ] + } + ], + footer: { + copyright: '© SQUARE ENIX CO., LTD. All Rights Reserved. | FINAL FANTASY XIV', + subText: 'FF14 攻略Wiki (Seesaa Wiki ニュートラルグレー テンプレート完全準拠)' + } +}; + +// Wikiルートへの相対パスプレフィックスを検出 +function getWikiRootPrefix() { + const scripts = document.querySelectorAll('script'); + for (let i = 0; i < scripts.length; i++) { + const src = scripts[i].getAttribute('src') || ''; + const idx = src.indexOf('common/js/wiki_common.js'); + if (idx !== -1) { + return src.substring(0, idx); + } + // common/ 内のパーツHTML (common/sidebar.html 等) からの読み込み + if (src.endsWith('wiki_common.js') && (src.includes('js/') || src === 'wiki_common.js')) { + return '../'; + } + } + 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('/housing/') || + pathname.includes('/battle_contents/') || + pathname.includes('/glamour/') || + pathname.includes('/retainer/') || + pathname.includes('/gold_saucer/') || + pathname.includes('/pvp/') || + pathname.includes('/deep_dungeon/') || + pathname.includes('/dungeons/') || + pathname.includes('/trials/') || + pathname.includes('/raids/') || + pathname.includes('/common/') + ) { + return '../'; + } + return ''; +} + +// 現在のページ判定 +function isCurrentPage(linkPath) { + const currentPath = window.location.pathname.replace(/\\/g, '/'); + if (currentPath.endsWith('/' + linkPath) || currentPath.endsWith(linkPath)) { + return true; + } + if (linkPath.endsWith('index.html')) { + const dirPath = linkPath.replace(/index\.html$/, ''); + if (currentPath.endsWith('/' + dirPath) || currentPath.endsWith(dirPath)) { + return true; + } + } + return false; +} + +// ヘッダーレンダリング +function renderHeader(rootPrefix) { + const header = document.getElementById('wiki-header'); + if (!header) return; + header.innerHTML = ` +
    + ${WIKI_NAV_CONFIG.siteTitle} +
    +
    + ${WIKI_NAV_CONFIG.siteDesc} +
    + `; +} + +// グローバルナビレンダリング +function renderGlobalNav(rootPrefix) { + const nav = document.getElementById('wiki-global-nav'); + if (!nav) return; + const items = WIKI_NAV_CONFIG.globalNav.map(item => { + const active = isCurrentPage(item.path) ? ' class="active"' : ''; + return `
  • ${item.title}
  • `; + }).join(''); + nav.innerHTML = ``; +} + +// サイドバーレンダリング +function renderSidebar(rootPrefix) { + const sidebar = document.getElementById('wiki-sidebar'); + if (!sidebar) return; + + let html = ''; + WIKI_NAV_CONFIG.sidebar.forEach(section => { + if (section.type === 'search') { + html += ` + + `; + } else if (section.type === 'links') { + const linksHtml = section.links.map(l => { + const active = isCurrentPage(l.path) ? ' class="active"' : ''; + return `
  • ${l.text}
  • `; + }).join(''); + html += ` + + `; + } else if (section.type === 'groups') { + let groupsHtml = ''; + section.groups.forEach(g => { + const groupLinks = g.links.map(l => { + const active = isCurrentPage(l.path) ? ' class="active"' : ''; + return `
  • ${l.text}
  • `; + }).join(''); + groupsHtml += ` +

    ${g.name}

    + + `; + }); + html += ` + + `; + } + }); + + sidebar.innerHTML = html; +} + +// フッターレンダリング +function renderFooter() { + const footer = document.getElementById('wiki-footer'); + if (!footer) return; + footer.innerHTML = ` +

    ${WIKI_NAV_CONFIG.footer.copyright}

    +

    ${WIKI_NAV_CONFIG.footer.subText}

    + `; +} + +// クリップボードコピー機能 +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 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)}`; + } +} + +// 初期化実行 +document.addEventListener('DOMContentLoaded', () => { + const root = getWikiRootPrefix(); + const sidebarFrame = document.querySelector('.wiki-sidebar-frame'); + const headerFrame = document.querySelector('.wiki-header-frame'); + + // iframe読み込み失敗時のフォールバックレンダリング + if (!sidebarFrame) { + renderSidebar(root); + } + if (!headerFrame) { + renderHeader(root); + renderGlobalNav(root); + } + renderFooter(); +}); + diff --git a/common/sidebar.html b/common/sidebar.html index 3732139..bc90452 100644 --- a/common/sidebar.html +++ b/common/sidebar.html @@ -1,259 +1,261 @@ - - - - - - - - - - FF14 攻略Wiki 共通サイドメニュー - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + FF14 攻略Wiki 共通サイドメニュー + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dungeons/brayflox.html b/dungeons/brayflox.html new file mode 100644 index 0000000..b05cd49 --- /dev/null +++ b/dungeons/brayflox.html @@ -0,0 +1,412 @@ + + + + + + + + + + + + + + + + + 奪還支援 ブレイフロクスの野営地 完全攻略・ボスギミック&ロール別立ち回り - FF14 攻略Wiki + + + + + + + +
    + + + + + + + +
    + + + +
    + + + +
    + +
    + +
    + + トップ > ダンジョン攻略 > 新生エオルゼア > 奪還支援 ブレイフロクスの野営地 完全攻略 + +
    + +
    + +

    奪還支援 ブレイフロクスの野営地 完全攻略・ボスギミック&ロール別立ち回り

    + +
    + + コンテンツ種別: 4人制インスタンスダンジョン + + 適正レベル: Lv32〜34(シンク上限Lv34) + + 最終更新: 2026年10月29日 + + 対応パッチ: 7.x 黄金のレガシー最新 + +
    + +
    + +
    📢 初の「ジョブ」本格運用ID・毒ギミックの登竜門
    + +
    + +
      + +
    • ジョブクリスタル装備必須: クラス(剣術士・幻術士等)からジョブ(ナイト・白魔道士等)へ昇格して挑むことが強く推奨されるレベル帯。
    • + +
    • 大ボス「アイアタル」の毒沼誘導: ボスが吐き出す毒液(緑色の毒沼)の上にボス自身が乗っているとリジェネ(HP自動回復)するため、タンクは即座に通常床へ引っ張り出す。
    • + +
    • 毒デバフのエスナ解除: 毒スタックが増えるとヒーラーの回復が追いつかなくなるため、エスナでのデバフ解除を徹底。
    • + +
    + +
    + +
    + +
    + +

    「奪還支援 ブレイフロクスの野営地」は、東ラノシアのジャングルに位置するゴブリン族の野営地である。水辺や湿地帯の進行、毒沼トラップ、大ボス「アイアタル」の誘導テクニック、各ロールの立ち回りを徹底解説する。

    + + + + + + + +

    1. コンテンツ基本データ・解放手順・ドロップ報酬

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    項目詳細データ
    参加条件ファイター/ソーサラー Lv32以上(アイテムレベル制限なし)
    制限時間 / 参加人数90分 / 4人(タンク1 / ヒーラー1 / DPS2)
    解放クエストメインクエスト「カタリストの行方」
    受注場所 / NPC東ラノシア:ワインポート / NPC「シャミア・サトミア」
    クリア報酬大量経験値、ギル
    宝箱・ドロップ品Lv32バトルメイジ装備、キャバルリー装備、インファントリー装備(大人気ミラプリ)
    コンテンツサポーター完全対応(ソロ攻略可能)
    + + + +

    2. 全体マップ進行・道中の進め方&周回ルート

    + +

    全体進行フロー

    + +
      + +
    1. スタート ➜ ボス1区画: ゲートキーパーのゴブリンを助けつつ鍵を入手。水辺のトカゲや鳥をタンクがまとめて撃破。
    2. + +
    3. ボス1 ➜ ボス2区画: つり橋を渡り、ドレイクが生息する野営地跡へ。眠っているモンスターは無理に起こさず通り抜けることも可能。
    4. + +
    5. ボス2 ➜ ボス3区画: 湿地帯。水生モンスターと巨大トカゲの2グループまとめ進行。
    6. + +
    7. ボス3 ➜ 大ボス区画: 洞窟を抜け、緑色の毒霧が立ち込める最深部「竜のねぐら」へ突入。
    8. + +
    + + + +

    3. ボス1攻略:グレート・イエローペリカン

    + +

    毒ブレスを吐く巨大怪鳥。増援の小型ペリカンが出現する。

    + +
      + +
    • 毒ブレスの向き: ボスの前方に強烈な毒ブレスを吐くため、タンクはボスの頭を必ず外周に向ける。
    • + +
    • ペリカン増援: 戦闘中に湧く小ペリカンをタンクが範囲攻撃でキャッチし、DPSが迅速に処理する。
    • + +
    + + + +

    4. ボス2攻略:インフェルノ・ドレイク

    + +

    火を噴くトカゲモンスター。ブレイフロクス(ゴブリンNPC)が逃げ回りながら乱入してくる。

    + +
      + +
    • ブレイフロクスの救出: 増援の小ドレイクがブレイフロクスを追尾するため、タンクが敵視を取るかDPSが素早く倒す。
    • + +
    + + + +

    5. ボス3攻略:ヘルベンダー

    + +

    オタマジャクシ型の水棲魔獣。ボグ・バブルによる行動不能トラップを仕掛けてくる。

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    技名効果と対処法
    ボグ・バブル(水泡拘束)ランダム1名を巨大な泡の中に閉じ込め行動不能にする。他のメンバーが泡を攻撃して破壊すると即座に救出できる。
    + + + +

    6. 大ボス攻略:アイアタル

    + +

    緑色の翼竜型ドラゴン。フィールドに毒沼を生成し、自ら回復する厄介なボス。

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    技名(詠唱)攻撃タイプ・予兆効果・回避ギミック解説
    毒液(トキシック・ヴォミット)円形床設置毒沼プレイヤーの足元に緑色の毒沼を生成。触れると猛毒デバフ(スタック制)が付与される。ボスがこの毒沼の上に乗っていると、ボス自身のリジェネ(HP回復)が猛烈に発動するため、タンクは即座にボスを毒沼のない通常床へ誘導する。
    毒ブレス前方扇状不可視攻撃タンクへの強打撃+毒付与。タンク以外が巻き込まれないよう外周に向ける。
    スワイプ後方扇状攻撃(予兆あり)ボスの背後に尻尾を叩きつける。側面へ避難する。
    + + + +

    7. ロール別立ち回り&よくある全滅原因

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ロール立ち回りの要点・注意点
    TANK(タンク)大ボス戦の誘導が最重要。毒沼が出たら直ちにボスを引っ張って毒沼の外へ出す。外周を円を描くように順次移動させて安全地帯を広く確保する。
    HEALER(ヒーラー)タンクや味方に毒デバフが2スタック以上溜まったら「エスナ」で迅速に解除。毒沼の上には絶対に足を踏み入れない。
    DPS(攻)自身に毒液マーカーがついた場合、フィールドの中央に捨てず、外周の端に捨ててから戻る。ボスの背後で殴る際はスワイプの予兆に注意。
    + +
    + +
    ⚠️ 初心者が最も陥りやすい全滅原因と対策
    + +

    アイアタルを毒沼の上で戦わせる回復ループ全滅:
    + + タンクが動かず、ボスを毒沼の上に乗せたまま戦い続けると、ボスのHPが高速で全快し続けて戦闘が終わらず、ヒーラーのMPが枯渇して全滅する。ボスが緑の沼に乗ったら1秒も躊躇せず通常床へ引っ張り出すこと。

    + +
    + +
    + +
    + + + + + +
    + + + + + + + diff --git a/dungeons/index.html b/dungeons/index.html index e93a882..f323b01 100644 --- a/dungeons/index.html +++ b/dungeons/index.html @@ -1,189 +1,190 @@ - - - - - - - - - インスタンスダンジョン(ID)完全攻略一覧&周回ガイド - FF14 攻略Wiki - - - - -
    - - - - - -
    - - -
    - -
    - -
    -
    - トップ > バトルコンテンツ > ダンジョン(ID)完全攻略一覧 -
    - -
    -

    インスタンスダンジョン(ID)完全攻略一覧&周回ガイド

    -
    - カテゴリ: バトル・ダンジョン攻略 - 最終更新: 2026年10月29日 - 対応パッチ: 7.x 黄金のレガシー最新 -
    - -
    -
    📢 全ダンジョン個別攻略ページ完備(テンプレート完全準拠)
    -
    -
      -
    • 統一フォーマット適用: 全個別ページで「基本データ」「全体マップ進行・まとめ基準」「各ボス全技・予兆・回避法」「ロール別立ち回り」「初心者の全滅防止策」を共通構造で完全網羅。
    • -
    • 現行パッチ7.x仕様: 改修後の新生IDギミックや、最新パッチ7.x黄金エキスパートIDまで最新環境に完全対応。
    • -
    -
    -
    -
    - -

    ファイナルファンタジーXIVの4人制インスタンスダンジョン(ID)の完全攻略ポータルである。各拡張ごとのダンジョン一覧、道中の全体進行フロー、まとめ進行時のロール別(タンク・ヒーラー・DPS)の鉄則、および各個別ダンジョン攻略ページへのリンクを網羅する。

    - - - - - -

    1. ダンジョン攻略・まとめ進行の共通鉄則

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    ロール道中・まとめ進行の基本動作ボス戦での基本動作
    TANK(タンク)先頭をスプリントで走り、敵集団に範囲攻撃を当てて敵視を固定。2グループ目まで足を止めずに進行し、立ち止まった瞬間に防御バフ(ランパート、短リキャ軽減、アームズレングス等)を順繰りに展開。ボスの向きを常に北(奥)に向けて背面をPTへ向ける。強攻撃の詠唱に短リキャ軽減を合わせる。
    HEALER(ヒーラー)タンクに遅れずスプリントで追従。移動中にHot付与・バリア展開。敵集団が固まったら自身も範囲攻撃を撃ちつつ、タンクのHPが50%を切らないようアビリティヒールを差し込む。全体攻撃の着弾前に軽減・バリア、着弾後に全体回復。ギミック被弾者への迅速なケア。
    DPS(攻撃)敵が2体以上の状況では100%範囲攻撃スキルを連打。敵集団を一気に削る。タンクより先走って敵を釣らない。ボスの背面・側面から火力を集中。増援雑魚が湧いた際はボスよりも増援処理を最優先。
    - - -

    2. 黄金のレガシー(Lv91〜100)ダンジョン一覧

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ダンジョン名参加Lv / IL特徴・周回目的個別攻略
    記憶幻想 アレクサンドリアLv100 (IL690〜)【エキルレ対象】 黄金メインクエスト最終ダンジョン。最新トームストーン「天道」「美学」最高効率周回。攻略を見る ➜
    荒野秘境 サボテンダーバレーLv100 (IL690〜)黄金サブクエスト開放ID。砂漠と遺跡を舞台にした最新高難易度エキスパートID。攻略を見る ➜
    濁流遡上 イフイカ・トゥムLv91 (IL630〜)黄金最初のレベリングダンジョン。川下りと原生生物との戦闘。コンサポ対応。準備中
    - - -

    3. 新生・蒼天・紅蓮・漆黒・暁月 代表ダンジョン一覧

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ダンジョン名参加Lv / 拡張特徴・周回目的個別攻略
    天然要害 サスタシャ侵食洞Lv15 (新生2.0)【初心者が最初に挑む最重要ID】 ロール別基礎、ギミックメモ、水門の泡処理。攻略を見る ➜
    地下霊断 タムタラの墓所Lv16 (新生2.0)【第2のダンジョン】 封印結界の解除、マインドブラストの麻痺回避、増援インプの敵視回収。攻略を見る ➜
    封鎖坑道 カッパーベル銅山Lv17 (新生2.0)【第3のダンジョン】 昇降機(エレベーター)の乗車確認、スライム分裂、ギュゲスの棍棒強打撃。攻略を見る ➜
    奪還支援 ブレイフロクスの野営地Lv32 (新生2.0)初のジョブ専用アクション使用ID。毒消し、アイアタル毒沼誘導の登竜門。準備中
    強硬突入 イシュガルド教皇庁Lv57 (蒼天3.0)蒼天メインストーリー屈指の名ダンジョン。大まとめ時の強烈な被ダメージ対策。準備中
    殺戮郷村 ホルミンスターLv71 (漆黒5.0)漆黒フェイス解放ID。罪喰いとの激闘、不可視突進の回避。準備中
    - -
    -
    - - - - -
    - - - - + + + + + + + + + インスタンスダンジョン(ID)完全攻略一覧&周回ガイド - FF14 攻略Wiki + + + + +
    + + + + + +
    + + +
    + +
    + +
    +
    + トップ > バトルコンテンツ > ダンジョン(ID)完全攻略一覧 +
    + +
    +

    インスタンスダンジョン(ID)完全攻略一覧&周回ガイド

    +
    + カテゴリ: バトル・ダンジョン攻略 + 最終更新: 2026年10月29日 + 対応パッチ: 7.x 黄金のレガシー最新 +
    + +
    +
    📢 全ダンジョン個別攻略ページ完備(テンプレート完全準拠)
    +
    +
      +
    • 統一フォーマット適用: 全個別ページで「基本データ」「全体マップ進行・まとめ基準」「各ボス全技・予兆・回避法」「ロール別立ち回り」「初心者の全滅防止策」を共通構造で完全網羅。
    • +
    • 現行パッチ7.x仕様: 改修後の新生IDギミックや、最新パッチ7.x黄金エキスパートIDまで最新環境に完全対応。
    • +
    +
    +
    +
    + +

    ファイナルファンタジーXIVの4人制インスタンスダンジョン(ID)の完全攻略ポータルである。各拡張ごとのダンジョン一覧、道中の全体進行フロー、まとめ進行時のロール別(タンク・ヒーラー・DPS)の鉄則、および各個別ダンジョン攻略ページへのリンクを網羅する。

    + + + + + +

    1. ダンジョン攻略・まとめ進行の共通鉄則

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    ロール道中・まとめ進行の基本動作ボス戦での基本動作
    TANK(タンク)先頭をスプリントで走り、敵集団に範囲攻撃を当てて敵視を固定。2グループ目まで足を止めずに進行し、立ち止まった瞬間に防御バフ(ランパート、短リキャ軽減、アームズレングス等)を順繰りに展開。ボスの向きを常に北(奥)に向けて背面をPTへ向ける。強攻撃の詠唱に短リキャ軽減を合わせる。
    HEALER(ヒーラー)タンクに遅れずスプリントで追従。移動中にHot付与・バリア展開。敵集団が固まったら自身も範囲攻撃を撃ちつつ、タンクのHPが50%を切らないようアビリティヒールを差し込む。全体攻撃の着弾前に軽減・バリア、着弾後に全体回復。ギミック被弾者への迅速なケア。
    DPS(攻撃)敵が2体以上の状況では100%範囲攻撃スキルを連打。敵集団を一気に削る。タンクより先走って敵を釣らない。ボスの背面・側面から火力を集中。増援雑魚が湧いた際はボスよりも増援処理を最優先。
    + + +

    2. 黄金のレガシー(Lv91〜100)ダンジョン一覧

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ダンジョン名参加Lv / IL特徴・周回目的個別攻略
    記憶幻想 アレクサンドリアLv100 (IL690〜)【エキルレ対象】 黄金メインクエスト最終ダンジョン。最新トームストーン「天道」「美学」最高効率周回。攻略を見る ➜
    荒野秘境 サボテンダーバレーLv100 (IL690〜)黄金サブクエスト開放ID。砂漠と遺跡を舞台にした最新高難易度エキスパートID。攻略を見る ➜
    濁流遡上 イフイカ・トゥムLv91 (IL630〜)黄金最初のレベリングダンジョン。川下りと原生生物との戦闘。コンサポ対応。準備中
    + + +

    3. 新生・蒼天・紅蓮・漆黒・暁月 代表ダンジョン一覧

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ダンジョン名参加Lv / 拡張特徴・周回目的個別攻略
    天然要害 サスタシャ侵食洞Lv15 (新生2.0)【初心者が最初に挑む最重要ID】 ロール別基礎、ギミックメモ、水門の泡処理。攻略を見る ➜
    地下霊断 タムタラの墓所Lv16 (新生2.0)【第2のダンジョン】 封印結界の解除、マインドブラストの麻痺回避、増援インプの敵視回収。攻略を見る ➜
    封鎖坑道 カッパーベル銅山Lv17 (新生2.0)【第3のダンジョン】 昇降機(エレベーター)の乗車確認、スライム分裂、ギュゲスの棍棒強打撃。攻略を見る ➜
    奪還支援 ブレイフロクスの野営地Lv32 (新生2.0)初のジョブ専用アクション使用ID。毒消し、アイアタル毒沼誘導の登竜門。攻略を見る ➜
    強硬突入 イシュガルド教皇庁Lv57 (蒼天3.0)蒼天メインストーリー屈指の名ダンジョン。大まとめ時の強烈な被ダメージ対策。準備中
    殺戮郷村 ホルミンスターLv71 (漆黒5.0)漆黒フェイス解放ID。罪喰いとの激闘、不可視突進の回避。準備中
    + +
    +
    + + + + +
    + + + + + diff --git a/tools/update_links.py b/tools/update_links.py new file mode 100644 index 0000000..10d5436 --- /dev/null +++ b/tools/update_links.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +import os +import re + +def normalize_text(text): + # CRLF統一 + text = text.replace('\r\n', '\n').replace('\r', '\n') + lines = [line.rstrip() for line in text.split('\n')] + # 連続空行の防止(最大1行) + result_lines = [] + prev_empty = False + for line in lines: + if line == '': + if not prev_empty: + result_lines.append(line) + prev_empty = True + else: + result_lines.append(line) + prev_empty = False + return '\r\n'.join(result_lines) + '\r\n' + +def save_utf8_bom(path, content): + content = normalize_text(content) + # 既存の先頭BOM文字を除去してから書き込む + content = content.lstrip('\ufeff') + with open(path, 'w', encoding='utf-8-sig', newline='\r\n') as f: + f.write(content) + +def update_dungeon_index(dungeon_id, dungeon_name, url): + path = 'dungeons/index.html' + if not os.path.exists(path): + return + with open(path, 'r', encoding='utf-8', errors='ignore') as f: + c = f.read() + # 該当行の「準備中」をリンクへ置換 + pattern = re.compile(rf'([^<]*{re.escape(dungeon_name)}[^<]*\s*[^<]*\s*[^<]*\s*)準備中()', re.DOTALL) + if pattern.search(c): + c = pattern.sub(rf'\g<1>攻略を見る ➜\2', c) + save_utf8_bom(path, c) + print(f"Updated {path} for {dungeon_name}") + +def update_sidebar_dungeon(name, url): + # 1. sidebar.html + path_sb = 'common/sidebar.html' + if os.path.exists(path_sb): + with open(path_sb, 'r', encoding='utf-8', errors='ignore') as f: + c = f.read() + target = '
  • 記憶幻想 アレクサンドリア (Lv100)
  • ' + new_entry = f'
  • {name}
  • ' + if new_entry not in c and target in c: + c = c.replace(target, f'{target}\n {new_entry}') + save_utf8_bom(path_sb, c) + print(f"Updated {path_sb} with {name}") + + # 2. wiki_common.js + path_js = 'common/js/wiki_common.js' + if os.path.exists(path_js): + with open(path_js, 'r', encoding='utf-8', errors='ignore') as f: + c = f.read() + target_js = "{ text: '記憶幻想 アレクサンドリア (Lv100)', path: 'dungeons/alexandria.html' }" + new_entry_js = f"{{ text: '{name}', path: 'dungeons/{url}' }}" + if new_entry_js not in c and target_js in c: + c = c.replace(target_js, f"{target_js},\n {new_entry_js}") + save_utf8_bom(path_js, c) + print(f"Updated {path_js} with {name}") + +def normalize_file(filepath): + if not os.path.exists(filepath): + return + with open(filepath, 'r', encoding='utf-8', errors='ignore') as f: + c = f.read() + save_utf8_bom(filepath, c) + print(f"Normalized {filepath}") + +if __name__ == '__main__': + normalize_file('dungeons/brayflox.html') + update_dungeon_index('brayflox', 'ブレイフロクス', 'brayflox.html') + update_sidebar_dungeon('ブレイフロクスの野営地 (Lv32)', 'brayflox.html')