「MediaWiki:Forum.js」の版間の差分
編集の要約なし |
編集の要約なし |
||
| 7行目: | 7行目: | ||
// 設定がない場合のデフォルト値 | // 設定がない場合のデフォルト値 | ||
mw.forum = mw.forum || {}; | mw.forum = mw.forum || {}; | ||
mw.forum.toppage = mw.forum.toppage || ' | mw.forum.toppage = mw.forum.toppage || 'KenryoBBS1'; | ||
mw.forum.threads = mw.forum.threads || 20; | mw.forum.threads = mw.forum.threads || 20; | ||
mw.forum.sticky = mw.forum.sticky || []; | mw.forum.sticky = mw.forum.sticky || []; | ||
| 47行目: | 47行目: | ||
// 動物リスト | // 動物リスト | ||
const animals = [ | const animals = [ | ||
' | 'アライグマ', 'カピバラ', 'キリン', 'ペンギン', 'パンダ', | ||
'ウサギ', 'リス', 'ハリネズミ', 'コアラ', 'ナマケモノ', | |||
'イルカ', 'クジラ', 'サメ', 'タコ', 'イカ', | |||
'フクロウ', 'タカ', 'スズメ', 'ツバメ', 'カラス', | |||
'ライオン', 'トラ', 'ゾウ', 'サイ', 'カバ', | |||
'オオカミ', 'キツネ', 'タヌキ', 'イノシシ', 'シカ' | |||
' | |||
' | |||
' | |||
' | |||
' | |||
]; | ]; | ||
| 162行目: | 146行目: | ||
// 匿名ユーザーのみ投稿フォームの上部に表示される | // 匿名ユーザーのみ投稿フォームの上部に表示される | ||
const anonSettingsHtml = isAnon ? `<details id="f-name-settings" style="margin-bottom:.8em;border:1px solid #ccc;padding:.5em;border-radius:3px;"> | const anonSettingsHtml = isAnon ? `<details id="f-name-settings" style="margin-bottom:.8em;border:1px solid #ccc;padding:.5em;border-radius:3px;"> | ||
<summary style="cursor:pointer;font-weight:bold;user-select:none;">名前・トリップの設定</summary> | <summary style="cursor:pointer;font-weight:bold;user-select:none;">▼ 名前・トリップの設定</summary> | ||
<div style="margin-top:.5em;"> | <div style="margin-top:.5em;"> | ||
<p style="margin:.2em 0 .5em;font-size:.9em;color:#555;"> | <p style="margin:.2em 0 .5em;font-size:.9em;color:#555;"> | ||
| 249行目: | 233行目: | ||
headers: { 'Content-Type': 'application/json' }, | headers: { 'Content-Type': 'application/json' }, | ||
body: JSON.stringify({ | body: JSON.stringify({ | ||
title: mw.config.get('wgPageName'), | title: mw.config.get('wgPageName'), | ||
text: newText, | text: newText, | ||
summary: `${msg.deletesummary} #${postId}` | summary: `${msg.deletesummary} #${postId}` | ||
}) | }) | ||
| 320行目: | 304行目: | ||
mw.loader.using('ext.wikiEditor'); | mw.loader.using('ext.wikiEditor'); | ||
document.querySelector('#f-create').onclick = function () { | document.querySelector('#f-create').onclick = function () { | ||
let content = | // ホームへ戻るリンクをページ先頭に追加 | ||
let content = `[[${mw.forum.toppage}|← ${mw.forum.toppage}に戻る]]\n`; | |||
if (mw.forum.zeroTemplate) { | if (mw.forum.zeroTemplate) { | ||
content += `{{post|System|0|{{subst:#timel:Y/m/d H:i:s}}|4=${mw.forum.zeroTemplate}}}\n`; | content += `{{post|System|0|{{subst:#timel:Y/m/d H:i:s}}|4=${mw.forum.zeroTemplate}}}\n`; | ||
| 402行目: | 387行目: | ||
// プロキシ経由でBot名義に編集する | // プロキシ経由でBot名義に編集する | ||
const postBody = { | const postBody = { | ||
title: mw.config.get('wgPageName'), | title: mw.config.get('wgPageName'), | ||
summary: summary | summary: summary | ||
}; | }; | ||