header.xuanxuan.html.hook.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php if(strpos($_SERVER['HTTP_USER_AGENT'], 'xuanxuan') != false): ?>
  2. <style>
  3. body {scrollbar-gutter: stable both-edges;}
  4. #mainContent .detail + .detail {padding-top: 0;}
  5. ::-webkit-scrollbar-thumb {border-radius: 5px;}
  6. ::-webkit-scrollbar {width: 10px; height: 10px;}
  7. ::-webkit-scrollbar-thumb:vertical {box-shadow: inset 1px 1px 0 rgb(0 0 0 / 10%), inset 0 -1px 0 rgb(0 0 0 / 7%); background-color: rgba(0, 0, 0, 0.2); border-radius: 10px; opacity: 0; transition: opacity 0.1s;}
  8. ::-webkit-scrollbar,
  9. ::-webkit-scrollbar-button,
  10. ::-webkit-scrollbar-track,
  11. ::-webkit-scrollbar-thumb {visibility: hidden;opacity: 0;}
  12. :hover ::-webkit-scrollbar,
  13. :hover ::-webkit-scrollbar-button,
  14. :hover ::-webkit-scrollbar-track,
  15. :hover ::-webkit-scrollbar-thumb {visibility: visible;opacity: 1;}
  16. #navbar {display: flex; align-items: center; justify-content: center;}
  17. #navbar .nav {display: flex; align-items: center; height: 50px;}
  18. #navbar .nav > li {float: none;}
  19. #navbar .nav > li > a {padding-top: 3px!important; padding-bottom: 3px!important; border-radius: 4px;}
  20. </style>
  21. <script>
  22. $(function()
  23. {
  24. const logoutElement = $('#userNav .has-avatar .pull-right li > a[href*="logout"]');
  25. logoutElement.parent().addClass('hide');
  26. if(logoutElement.parent().prev().hasClass('divider')) logoutElement.parent().prev().addClass('hide');
  27. if(window.parent === window || window.parent.appHeaderStyleUpdated) return;
  28. const mainHeader = document.getElementById('mainHeader');
  29. if(!mainHeader) return;
  30. const style = window.getComputedStyle(mainHeader, null);
  31. const color = window.getComputedStyle(document.querySelector('#navbar .nav>li:not(.active)>a, #userMenu .nav>li:not(.active)>a'), null).color;
  32. const clientHeaderStyle = {windowControlBtnColor: color, background: style.background, color: color};
  33. window.parent.appHeaderStyleUpdated = true;
  34. window.open('xxc://setAppHeaderStyle/zentao-integrated/' + encodeURIComponent(JSON.stringify(clientHeaderStyle)), '_blank');
  35. });
  36. setTimeout(function() // Override confirm, prompt and alert methods.
  37. {
  38. window.confirm = function() {
  39. console.warn('\"window.confirm\" is disabled in webview.');
  40. return true;
  41. };
  42. window.prompt = function() {
  43. console.warn('\"window.prompt\" is disabled in webview.');
  44. };
  45. window.alert = function(msg) {
  46. const win = window.parent ? window.parent : window;
  47. win.open(`xxc://webview/alert/${encodeURIComponent(msg)}`, '_blank');
  48. };
  49. });
  50. </script>
  51. <?php if($this->app->moduleName =='user' && $this->app->methodName == 'deny'): ?>
  52. <script>
  53. $(function()
  54. {
  55. $('.m-user-deny .modal-footer').addClass('hide');
  56. });
  57. </script>
  58. <?php endif; ?>
  59. <?php endif; ?>