Window floating container

Adds a fixed header element for use by other scripts

当前为 2016-03-24 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/18233/115269/Window%20floating%20container.js

  1. // ==UserScript==
  2. // @name Window floating container
  3. // @version 1.0.0
  4. // @description Adds a fixed header element for use by other scripts
  5. // @author @_jnblog
  6. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js
  7. // @grant GM_addStyle
  8. // ==/UserScript==
  9. /* jshint -W097 */
  10. /* global $ */
  11. /* jshint asi: true, multistr: true */
  12. 'use strict'
  13.  
  14. var ijgFloater = $('#ijgWindowFloater')
  15. if (!ijgFloater.length) {
  16. GM_addStyle('#ijgWindowFloater {\
  17. position: fixed;\
  18. top: 0;\
  19. left: 0;\
  20. z-index: 2000;\
  21. color: white;\
  22. background-color: #EB6841;\
  23. }')
  24. GM_addStyle('#ijgWindowFloater a {\
  25. color: white !important;\
  26. padding: 5px;\
  27. display: inline-block;\
  28. }')
  29.  
  30. GM_addStyle('#ijgWindowFloater a:hover {\
  31. color: #FAF667 !important;\
  32. }')
  33.  
  34. GM_addStyle('.ijgWindowFloater-item + .ijgWindowFloater-item {\
  35. padding-left: 1em;\
  36. }')
  37. ijgFloater = $('<div id="ijgWindowFloater">')
  38. $('body').prepend(ijgFloater)
  39. }
  40.  
  41. function getFloater() {
  42. return ijgFloater
  43. }