Kasi-time

不可能を可能にする

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Kasi-time
// @namespace   https://twitter.com/akameco
// @description 不可能を可能にする
// @include     http://www.kasi-time.com/*
// @version     1.01
// @grant       none
// ==/UserScript==

setTimeout(function() { 
  function selectText() {
    let el  = document.getElementById("lyrics");
    let rng = document.createRange();
    rng.selectNodeContents(el);
    window.getSelection().addRange(rng);
  }

  $('body').css('-moz-user-select','text');
  $('body').off('copy contextmenu selectstart');

  let button = $('<button>');
  button.text('選択').css({
    'margin': '10px 10px 0 0',
    'borderTop': '1px solid #ccc',
    'borderRight': '1px solid #999',
    'borderBottom': '1px solid #999',
    'borderLeft': '1px solid #ccc',
    'padding': '3px 12px',
    'cursor': 'pointer',
    'color': '#666'
  }).click(function () {
    selectText();
  });

  $('.lyrics_menu').append(button);
}, 10);