radiko change timetable width/height

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

您需要先安装一款用户脚本管理器扩展,例如 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);
})();