radiko change timetable width/height

radiko の番組表の幅と高さを変更

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         radiko change timetable width/height
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  radiko の番組表の幅と高さを変更
// @author       aossy
// @match        *://radiko.jp/*
// @grant        none
// ==/UserScript==

(function () {
  'use strict';
  // 番組表の元の高さからの割合
  const scale = 0.2;

  // timetable_scroll.js の timeShiftScroll.itemHoueHeight (default 3000) で番組表の1時間の高さを決定
  // 番組表描画以外に、番組表の現在時刻へのスクロールへも影響するため最初に変更しておく
  timeShiftScroll.itemHourHeight = timeShiftScroll.itemHourHeight * scale;

  function change_timetable_height() {
    if (document.getElementById('program-table').getElementsByClassName('item-outer').length > 0) {
      $("div.item-outer").children("div").each(function () {
        $(this).css({ "min-height": "" });
        $(this).children("div.contents:first").css({ "max-height": $(this).css("height"), "overflow": "hidden" });
      });
    }
    else {
      setTimeout(change_timetable_height, 1000)
    };
  }

  function change_timetable_width() {
    $("div.content__inner").css({ "width": "80%", "min-width": "1000px" });
    $("div.program-table__outer").css({ "width": "100%", "min-width": "1000px" });
  }

  const target = document.getElementById('contents');
  const observer = new MutationObserver(function (mutations) {
    // 番組表の幅を変更
    change_timetable_width();
    // 番組表の高さを変更
    change_timetable_height();
  });

  const config = { childList: true };
  observer.observe(target, config);
})();