|
| 1 | +/** |
| 2 | + * Copyright 2024 OpenBuild |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +export function initRunLLM() { |
| 18 | + if (typeof document !== 'undefined') { |
| 19 | + document.addEventListener('DOMContentLoaded', function () { |
| 20 | + var script = document.createElement('script'); |
| 21 | + script.type = 'module'; |
| 22 | + script.id = 'runllm-widget-script'; |
| 23 | + script.src = 'https://widget.runllm.com'; |
| 24 | + |
| 25 | + script.setAttribute('version', 'stable'); |
| 26 | + script.setAttribute('runllm-theme-color', '#64d88b'); |
| 27 | + script.setAttribute('runllm-brand-logo', '/favicon.svg'); |
| 28 | + script.setAttribute('runllm-keyboard-shortcut', 'Mod+j'); |
| 29 | + script.setAttribute('runllm-name', 'OpenBuild'); |
| 30 | + script.setAttribute('runllm-position', 'BOTTOM_RIGHT'); |
| 31 | + script.setAttribute('runllm-assistant-id', '328'); |
| 32 | + |
| 33 | + script.async = true; |
| 34 | + document.head.appendChild(script); |
| 35 | + }); |
| 36 | + } |
| 37 | +} |
0 commit comments