MCPcopy Create free account
hub / github.com/NsLearning/LangHelper / init

Function init

ChatGPT/src-tauri/src/scripts/cmd.js:3–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1// *** Core Script - CMD ***
2
3function init() {
4 const styleDom = document.createElement('style');
5 styleDom.innerHTML = `form {
6 position: relative;
7 }
8 .chat-model-cmd-list {
9 position: absolute;
10 bottom: 60px;
11 max-height: 100px;
12 overflow: auto;
13 z-index: 9999;
14 }
15 .chat-model-cmd-list>div {
16 border: solid 2px rgba(80,80,80,.3);
17 border-radius: 5px;
18 background-color: #fff;
19 }
20
21 html.dark .chat-model-cmd-list>div {
22 background-color: #4a4a4a;
23 }
24 html.dark .chat-model-cmd-list .cmd-item {
25 border-color: #666;
26 }
27 html.dark .chat-model-cmd-list .cmd-item b {
28 color: #e8e8e8;
29 }
30 html.dark .chat-model-cmd-list .cmd-item i {
31 color: #999;
32 }
33 html.dark .chat-model-cmd-list .cmd-item.selected {
34 background: rgba(59,130,246,.5);
35 }
36
37 .chat-model-cmd-list .cmd-item {
38 font-size: 12px;
39 border-bottom: solid 1px rgba(80,80,80,.2);
40 padding: 2px 4px;
41 display: flex;
42 user-select: none;
43 cursor: pointer;
44 }
45 .chat-model-cmd-list .cmd-item:last-child {
46 border-bottom: none;
47 }
48 .chat-model-cmd-list .cmd-item.selected {
49 background: rgba(59,130,246,.3);
50 }
51 .chat-model-cmd-list .cmd-item b {
52 display: inline-block;
53 width: 100px;
54 overflow: hidden;
55 text-overflow: ellipsis;
56 white-space: nowrap;
57 border-radius: 4px;
58 margin-right: 10px;
59 color: #2a2a2a;
60 }

Callers 1

cmd.jsFile · 0.70

Calls 2

cmdTipFunction · 0.85
initDomFunction · 0.85

Tested by

no test coverage detected