MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / toCodeMirrorKey

Function toCodeMirrorKey

web/pgadmin/static/js/utils.js:63–83  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

61
62// Convert shortcut obj to codemirror key format
63export function toCodeMirrorKey(obj) {
64 let shortcut = '';
65 if (!obj){
66 return shortcut;
67 }
68 if (obj.alt) { shortcut += 'Alt-'; }
69 if (obj.shift) { shortcut += 'Shift-'; }
70 if (obj.control) {
71 if(isMac() && obj.ctrl_is_meta) {
72 shortcut += 'Meta-';
73 } else {
74 shortcut += 'Ctrl-';
75 }
76 }
77 if(obj?.key.char?.length == 1) {
78 shortcut += obj?.key.char?.toLowerCase();
79 } else {
80 shortcut += obj?.key.char;
81 }
82 return shortcut;
83}
84
85export function getEpoch(inp_date) {
86 let date_obj = inp_date || new Date();

Callers

nothing calls this directly

Calls 1

isMacFunction · 0.90

Tested by

no test coverage detected