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

Function applyReportAnnotation

deployments/desktop/static/desktop.js:2896–2913  ·  view source on GitHub ↗
(command, value)

Source from the content-addressed store, hash-verified

2894 }
2895
2896 function applyReportAnnotation(command, value) {
2897 const body = $("reportViewerBody");
2898 const range = selectedReportAnnotationRange();
2899 if (!body || !range || range.collapsed || !body.contains(range.commonAncestorContainer)) return;
2900 const wrapper = document.createElement("span");
2901 wrapper.dataset.paperflowAnnotation = command;
2902 if (command === "foreColor") wrapper.style.color = value;
2903 else if (command === "bold") wrapper.style.fontWeight = "700";
2904 else if (command === "italic") wrapper.style.fontStyle = "italic";
2905 else wrapper.style.backgroundColor = value;
2906 wrapper.appendChild(range.extractContents());
2907 range.insertNode(wrapper);
2908 saveReportAnnotation();
2909 const selection = window.getSelection();
2910 selection?.removeAllRanges();
2911 state.reportAnnotationRange = null;
2912 hideReportAnnotationToolbar();
2913 }
2914
2915 function clearReportAnnotations() {
2916 if (!state.currentReport?.report_id) return;

Callers 1

bindEventsFunction · 0.85

Calls 4

saveReportAnnotationFunction · 0.85
$Function · 0.70

Tested by

no test coverage detected