Kasi-time

不可能を可能にする

目前为 2015-05-18 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Kasi-time
  3. // @namespace https://twitter.com/akameco
  4. // @description 不可能を可能にする
  5. // @include http://www.kasi-time.com/*
  6. // @version 1.01
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. setTimeout(function() {
  11. function selectText() {
  12. let el = document.getElementById("lyrics");
  13. let rng = document.createRange();
  14. rng.selectNodeContents(el);
  15. window.getSelection().addRange(rng);
  16. }
  17.  
  18. $('body').css('-moz-user-select','text');
  19. $('body').off('copy contextmenu selectstart');
  20.  
  21. let button = $('<button>');
  22. button.text('選択').css({
  23. 'margin': '10px 10px 0 0',
  24. 'borderTop': '1px solid #ccc',
  25. 'borderRight': '1px solid #999',
  26. 'borderBottom': '1px solid #999',
  27. 'borderLeft': '1px solid #ccc',
  28. 'padding': '3px 12px',
  29. 'cursor': 'pointer',
  30. 'color': '#666'
  31. }).click(function () {
  32. selectText();
  33. });
  34.  
  35. $('.lyrics_menu').append(button);
  36. }, 10);