File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323 < body >
2424 < div id ="root "> </ div >
2525 < script type ="module " src ="/src/main.jsx "> </ script >
26- < script >
27- window . difyChatbotConfig = {
28- token : 'xg0maoDg7kzrcGT0' ,
29- isToggledByButton : true
30- }
31- </ script >
32- < script src ="https://udify.app/embed.min.js " id ="xg0maoDg7kzrcGT0 " defer > </ script >
33- < script >
34- ( function ( ) {
35- var expanded = false ;
36- window . addEventListener ( 'message' , function ( event ) {
37- if ( event . origin !== 'https://udify.app' ) return ;
38- if ( event . data && event . data . type === 'dify-chatbot-expand-change' ) {
39- expanded = event . data . payload && event . data . payload . expanded ;
40- var win = document . getElementById ( 'dify-chatbot-bubble-window' ) ;
41- if ( ! win ) return ;
42- if ( expanded ) {
43- win . classList . add ( 'dify-centered' ) ;
44- } else {
45- win . classList . remove ( 'dify-centered' ) ;
46- }
47- }
48- } ) ;
4926
50- function trySendConfig ( ) {
51- var iframe = document . querySelector ( '#dify-chatbot-bubble-window iframe' ) ;
52- if ( iframe && iframe . contentWindow ) {
53- iframe . contentWindow . postMessage ( {
54- type : 'dify-chatbot-config' ,
55- payload : { isToggledByButton : true , isDraggable : false }
56- } , 'https://udify.app' ) ;
57- }
58- }
59-
60- var observer = new MutationObserver ( function ( ) {
61- trySendConfig ( ) ;
62- } ) ;
63- observer . observe ( document . body , { childList : true , subtree : true } ) ;
64- } ) ( ) ;
65- </ script >
6627 </ body >
6728</ html >
You can’t perform that action at this time.
0 commit comments