()
| 616 | return src.substring(0, src.indexOf('/assistant.js')) |
| 617 | } |
| 618 | function init() { |
| 619 | const sqlbotScripts = document.querySelectorAll(`script[id^="${script_id_prefix}"]`) |
| 620 | const scriptsArray = Array.from(sqlbotScripts) |
| 621 | const src_list = scriptsArray.map((script) => script.src) |
| 622 | src_list.forEach((src) => { |
| 623 | const id = getParam(src, 'id') |
| 624 | window.sqlbot_assistant_handler[id] = window.sqlbot_assistant_handler[id] || {} |
| 625 | window.sqlbot_assistant_handler[id]['id'] = id |
| 626 | const propName = script_id_prefix + id + '-state' |
| 627 | if (window[propName]) { |
| 628 | return true |
| 629 | } |
| 630 | window[propName] = true |
| 631 | loadScript(src, id) |
| 632 | expposeGlobalMethods(id) |
| 633 | }) |
| 634 | } |
| 635 | |
| 636 | function showMsg(title, content) { |
| 637 | // 检查并创建容器(如果不存在) |
nothing calls this directly
no test coverage detected