footer.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. </div>
  2. <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/mdui.min.js"></script>
  3. <script>
  4. $(document).pjax('a', '#pjax-container',{'timeout':false})
  5. $("#isLoading").hide()
  6. var inst = new mdui.Drawer('#main-drawer');
  7. $(document).on('pjax:send', function() {
  8. if (isMobile()) {
  9. inst.close();
  10. }
  11. $("#isLoading").show()
  12. })
  13. $(document).on('pjax:complete', function() {
  14. setTimeout(function() {
  15. $("#isLoading").hide()
  16. }, 2000);
  17. })
  18. function isMobile() {
  19. var userAgentInfo = navigator.userAgent;
  20. var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
  21. var mobile_flag = false;
  22. for (var v = 0; v < mobileAgents.length; v++) {
  23. if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
  24. mobile_flag = true;
  25. break;
  26. }
  27. }
  28. var screen_width = window.screen.width;
  29. var screen_height = window.screen.height;
  30. if (screen_width < 500 && screen_height < 800) {
  31. mobile_flag = true;
  32. }
  33. return mobile_flag;
  34. }
  35. function getNowURL(){
  36. return window.location.protocol+'//'+window.location.host
  37. }
  38. $(function() {
  39. var clipboard = new ClipboardJS('.copy');
  40. clipboard.on('success', function(e) {
  41. mdui.snackbar({
  42. message: '复制表白卡片地址成功!',
  43. position: 'right-top'
  44. });
  45. });
  46. clipboard.on('error', function(e) {
  47. mdui.snackbar({
  48. message: '复制表白卡片地址失败!请尝试手动复制!',
  49. position: 'right-top'
  50. });
  51. });
  52. });
  53. </script>