「MediaWiki:Forum.js」の版間の差分

編集の要約なし
編集の要約なし
266行目: 266行目:
                         const source = await (await fetch(mw.config.get('wgScript') + `?title=${mw.config.get('wgPageName')}&action=raw`)).text();
                         const source = await (await fetch(mw.config.get('wgScript') + `?title=${mw.config.get('wgPageName')}&action=raw`)).text();
                         const newText = source.replace(new RegExp(`(\\{\\{post\\|(.*?)\\|${postId}\\|(.*?)\\|4=)((.|\n)*?)(}})`), '$1[Deleted]$6');
                         const newText = source.replace(new RegExp(`(\\{\\{post\\|(.*?)\\|${postId}\\|(.*?)\\|4=)((.|\n)*?)(}})`), '$1[Deleted]$6');
                         fetch('/mediawiki/forum-proxy.php', {
                         fetch('/wiki/forum-proxy.php', {
                             method: 'POST',
                             method: 'POST',
                             headers: { 'Content-Type': 'application/json' },
                             headers: { 'Content-Type': 'application/json' },
288行目: 288行目:
                         const threadName = mw.config.get('wgPageName').replace(mw.forum.toppage + '/', '');
                         const threadName = mw.config.get('wgPageName').replace(mw.forum.toppage + '/', '');
                         if (!confirm(`スレッド「${threadName}」を削除しますか?\nこの操作は取り消せません。`)) return;
                         if (!confirm(`スレッド「${threadName}」を削除しますか?\nこの操作は取り消せません。`)) return;
                         fetch('/mediawiki/forum-proxy.php', {
                         fetch('/wiki/forum-proxy.php', {
                             method: 'POST',
                             method: 'POST',
                             headers: { 'Content-Type': 'application/json' },
                             headers: { 'Content-Type': 'application/json' },
400行目: 400行目:
                             const anonParam = isAnon ? '|anon=1' : '';
                             const anonParam = isAnon ? '|anon=1' : '';
                             content += `{{post|${mw.forum.username}|1|{{subst:#timel:Y/m/d H:i:s}}|4=${document.querySelector('#wpTextbox1').value}${anonParam}}}`;
                             content += `{{post|${mw.forum.username}|1|{{subst:#timel:Y/m/d H:i:s}}|4=${document.querySelector('#wpTextbox1').value}${anonParam}}}`;
                             fetch('/mediawiki/forum-proxy.php', {
                             fetch('/wiki/forum-proxy.php', {
                                 method: 'POST',
                                 method: 'POST',
                                 headers: { 'Content-Type': 'application/json' },
                                 headers: { 'Content-Type': 'application/json' },
510行目: 510行目:
                             postBody.appendtext = `\n{{post|${mw.forum.username}|${lp}|{{subst:#timel:Y/m/d H:i:s}}|4=${document.querySelector('#wpTextbox1').value}${document.querySelector('#f-reply-cb').checked ? '|re=' + document.querySelector('#f-reply').value : ''}${anonParam}}}`;
                             postBody.appendtext = `\n{{post|${mw.forum.username}|${lp}|{{subst:#timel:Y/m/d H:i:s}}|4=${document.querySelector('#wpTextbox1').value}${document.querySelector('#f-reply-cb').checked ? '|re=' + document.querySelector('#f-reply').value : ''}${anonParam}}}`;
                         }
                         }
                         fetch('/mediawiki/forum-proxy.php', {
                         fetch('/wiki/forum-proxy.php', {
                             method: 'POST',
                             method: 'POST',
                             headers: { 'Content-Type': 'application/json' },
                             headers: { 'Content-Type': 'application/json' },