MCPcopy Create free account
hub / github.com/XIU2/UserScript / replyCustom_1

Function replyCustom_1

Hostloc-Enhanced.user.js:377–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

375 document.addEventListener('DOMNodeInserted', vfastpost); // 监听插入事件
376 }
377 function replyCustom_1() {
378 let floatlayout_reply = e => {
379 if (e.target.nodeType == 1 && e.target.innerHTML && e.target.innerHTML.indexOf('id="floatlayout_reply"') > -1) {
380 // 快速回复(悬浮)中添加 URL 按钮
381 document.querySelector('#floatlayout_reply .fbld').insertAdjacentHTML('afterend', `<a href="javascript:;" title="点击给选中文字添加 url 标签(可正常显示为 URL)" class="flnk" style="filter: hue-rotate(83deg);" onclick="seditor_insertunit('post', '[url][i]', '[/i][/url]');doane(event);">URL</a>`);
382 document.getElementById('postsubmit').onclick = function () {
383 if (GM_getValue('menu_customLittleTail')) document.getElementById('postmessage').value += GM_getValue('menu_customLittleTail').replaceAll('\\n', '\n');
384 }
385 }
386 }
387 document.addEventListener('DOMNodeInserted', floatlayout_reply); // 监听插入事件
388 // 快速发帖(各版块帖子列表底部)中添加 URL 按钮
389 document.querySelector('#fastposteditor .fbld').insertAdjacentHTML('afterend', `<a href="javascript:;" title="点击给选中文字添加 url 标签(可正常显示为 URL)" class="flnk" style="filter: hue-rotate(83deg);" onclick="seditor_insertunit('post', '[url][i]', '[/i][/url]');doane(event);">URL</a>`);
390 }
391 function replyCustom_2() { // 帖子底部的回复框
392 document.getElementById('fastpostsubmit').onclick = function () {
393 if (GM_getValue('menu_customLittleTail')) document.getElementById('fastpostmessage').value += GM_getValue('menu_customLittleTail').replaceAll('\\n', '\n');

Callers 1

replyCustomFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected