Skip to content

Commit

Permalink
feat: update casibase widget import code (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
HashCookie committed Aug 8, 2024
1 parent caf2120 commit a113b13
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
4 changes: 0 additions & 4 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,6 @@ var _hmt = _hmt || [];
src: "/js/clarity.js",
async: true,
},
{
src: "https://tcdn.casibase.org/casibase.js",
async: true,
},
{
src: "/js/casibase.js",
async: true,
Expand Down
21 changes: 16 additions & 5 deletions static/js/casibase.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
/* eslint-disable no-undef */
initCasibaseChat({
endpoint: "https://ai.casbin.com",
themeColor: "rgb(64,59,121)",
});
(function(w, d, s, c, i) {
const j = d.createElement(s);
j.async = false;
j.src = "https://tcdn.casibase.org/casibase.js";
j.onload = function() {
w[c]("init", {
endpoint: "https://ai.casbin.com",
themeColor: "rgb(64,59,121)",
});
};
const f = d.getElementsByTagName(s)[0];
f.parentNode.insertBefore(j, f);
w[c] = w[c] || function() {
(w[c].q = w[c].q || []).push(arguments);
};
})(window, document, "script", "casibaseChat");

0 comments on commit a113b13

Please sign in to comment.