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

Function floatlayout_reply

Hostloc-Enhanced.user.js:378–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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>`);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected