Web DingTalk Helper

make web dingtalk fullscreen

当前为 2016-09-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Web DingTalk Helper
  3. // @namespace http://creamidea.github.io/
  4. // @version 0.0.1
  5. // @license MIT License (Expat)
  6. // @description make web dingtalk fullscreen
  7. // @author creamidea
  8. // @email creamidea@gmail.com
  9. // @match https://im.dingtalk.com/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. var timer
  15.  
  16. function resize() {
  17. $('#layout-main').css({
  18. 'position': 'static',
  19. 'top': 0,
  20. 'left': 0,
  21. 'marginLeft': 0,
  22. 'marginTop': 0,
  23. 'width': '100%',
  24. 'height': '100%'
  25. }).find('#body').css('height', $('#layout-main').height() - $('#layout-main #header').height() - 1)
  26. }
  27.  
  28. $(window).on('resize', resize)
  29.  
  30. resize()
  31. timer = setInterval(function () {
  32. if ( $('#layout-main').css('position') === 'absolute' ) {
  33. resize()
  34. clearInterval(timer)
  35. }
  36. }, 1000)
  37.  
  38. })()