Changes for page 学校ページ テンプレート
Last modified by Super Admin on 2026/04/05 18:59
From version
56.1
edited by Super Admin
on 2026/03/15 16:10
on 2026/03/15 16:10
Change comment:
There is no comment for this version
To version
57.1
edited by Super Admin
on 2026/03/17 13:41
on 2026/03/17 13:41
Change comment:
There is no comment for this version
Summary
Details
- Page properties
-
- Content
-
... ... @@ -1003,6 +1003,21 @@ 1003 1003 window.history.replaceState({}, document.title, window.location.pathname); 1004 1004 } 1005 1005 } 1006 + // 長文投稿の折りたたみ初期化 1007 + document.querySelectorAll('.thread-post-body').forEach(function(body) { 1008 + // 画像・ファイル添付を除いたテキスト部分の高さを判定 1009 + if (body.scrollHeight > body.clientHeight + 10 || body.textContent.length > 300) { 1010 + body.classList.add('truncated'); 1011 + var btn = document.createElement('button'); 1012 + btn.className = 'btn-read-more'; 1013 + btn.textContent = '続きを読む ▼'; 1014 + btn.addEventListener('click', function() { 1015 + var isExpanded = body.classList.toggle('expanded'); 1016 + btn.textContent = isExpanded ? '折りたたむ ▲' : '続きを読む ▼'; 1017 + }); 1018 + body.parentNode.insertBefore(btn, body.nextSibling); 1019 + } 1020 + }); 1006 1006 }); 1007 1007 1008 1008 // トースト通知表示