tower工作区全屏切换

2020/12/2 下午10:38:33

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        tower工作区全屏切换
// @namespace   Violentmonkey Scripts
// @match       https://tower.im/teams/*
// @match       https://tower.im/projects/*
// @grant       none
// @version     1.0
// @author      -
// @description 2020/12/2 下午10:38:33
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js
// @require      https://cdn.bootcss.com/async/3.1.0/async.min.js
// @require      https://cdn.bootcss.com/lodash.js/4.17.15/lodash.min.js
// @require      https://cdn.bootcss.com/lockr/0.8.5/lockr.min.js
// ==/UserScript==
const styles = `
  .full .todolists
  ,.full tr-project-list-view 
  {
      position:fixed;
      z-index:500;
      top:0;
      left:0;
      height:100%;
      width:100%;
      padding:0 !important;
      background:#f0f0f0;
  }

  .full-screen-toggler{
      position:fixed;
      z-index:5147483001;
      bottom:0;
      right:0;
      background:#f50;
      padding:6px 12px;
      color:#fff;
      cursor:default;
  }

`

$(__=>{
  
  $("header").append(`<style>${styles}</style>`);
  
  $("<a class='full-screen-toggler'>全屏切换</a>").appendTo("body").click(__=>{
      $("body").toggleClass("full");
  }).trigger("click")
})