bootstrap.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. if (Config.modulename == 'admin' && Config.controllername == 'index' && Config.actionname == 'index') {
  2. require.config({
  3. paths: {
  4. 'fastchat': '../addons/fastchat/js/fastchat'
  5. },
  6. shim: {
  7. 'fastchat': {
  8. deps: ['css!../addons/fastchat/css/fastchat.css'],
  9. exports: 'FastChat'
  10. }
  11. }
  12. });
  13. require(['fastchat'], function (FastChat) {
  14. FastChat.initialize(document.domain, 'admin');
  15. });
  16. } else {
  17. if (window.parent.Config && window.parent.Config.modulename == 'admin') {
  18. window.FastChat = window.parent.FastChat;
  19. // 一键添加会话窗口
  20. $(document).on('click', '.fastchat_user', function (e) {
  21. FastChat.forecast_add_session(e);
  22. });
  23. } else {
  24. require.config({
  25. paths: {
  26. 'fastchat': '../addons/fastchat/js/fastchat'
  27. },
  28. shim: {
  29. 'fastchat': {
  30. deps: ['css!../addons/fastchat/css/fastchat.css'],
  31. exports: 'FastChat'
  32. }
  33. }
  34. });
  35. require(['fastchat'], function (FastChat) {
  36. FastChat.initialize(document.domain, window.parent.Config.modulename);
  37. });
  38. }
  39. }