MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / renderProfileForm

Function renderProfileForm

deployments/desktop/static/desktop.js:5044–5063  ·  view source on GitHub ↗
(data = {})

Source from the content-addressed store, hash-verified

5042 $("mentionSuggestions").hidden = true;
5043 return;
5044 }
5045 const token = ++state.mentionSearchToken;
5046 const data = await api(`/api/wiki/mentions?user_id=${encodeURIComponent(currentUser())}&q=${encodeURIComponent(context.query)}&limit=6`);
5047 if (token !== state.mentionSearchToken) return;
5048 renderMentionSuggestions(data.nodes || []);
5049 }
5050
5051 function scheduleMentionSearch() {
5052 window.clearTimeout(state.mentionSearchTimer);
5053 state.mentionSearchTimer = window.setTimeout(() => {
5054 searchMentionSuggestions().catch((error) => console.warn("Mention search failed.", error));
5055 }, 160);
5056 }
5057
5058 function insertMention(node) {
5059 const input = $("chatInput");
5060 const context = mentionQueryAtCursor();
5061 const title = node.title || node.node_id || "Wiki";
5062 const nodeId = node.node_id || node.id || title;
5063 const mentionText = `@[${title}](${nodeId})`;
5064 const start = context?.start ?? input.selectionStart ?? input.value.length;
5065 const end = context?.end ?? input.selectionEnd ?? input.value.length;
5066 input.value = `${input.value.slice(0, start)}${mentionText} ${input.value.slice(end)}`;

Callers 3

setLocaleFunction · 0.85
loadCurrentProfileFunction · 0.85
saveProfileFunction · 0.85

Calls 8

firstTextFunction · 0.85
currentUserFunction · 0.85
selectedUserInfoFunction · 0.85
sortedProfilePairsFunction · 0.85
renderProfileInfoGridFunction · 0.85
uiFunction · 0.85
setProfileSyncStatusFunction · 0.85
$Function · 0.70

Tested by

no test coverage detected