diff --git a/htdocs/files/common.js b/htdocs/files/common.js index 1d0211e8..c1a5f281 100644 --- a/htdocs/files/common.js +++ b/htdocs/files/common.js @@ -107,9 +107,14 @@ $('#tweet-account-box').css('opacity', 0); $('#tweet-account-box').css('visibility', 'hidden'); + // スクロール位置を取得 - const position_current = $(this).scrollTop() + 54; // 54 はヘッダー分 - const position_target = $('#epg-box').offset().top; // 計算めんどいのであえて jQuery + let position_current = $(this).scrollTop() + 54; // 54 はヘッダー分 + let position_target = 450; + + if ($('#epg-box').offset() !== undefined) { + position_target = $('#epg-box').offset().top; // 計算めんどいのであえて jQuery + } // 表示・非表示 // ターゲット座標以上 diff --git a/htdocs/files/file.js b/htdocs/files/file.js index 7fa480d0..62e6ddbe 100644 --- a/htdocs/files/file.js +++ b/htdocs/files/file.js @@ -1,6 +1,6 @@ // ロード時 & リサイズ時に発火 - $(window).on('load resize', function(event){ + $(window).on('DOMContentLoaded resize', function(event){ // コメントを取得してコメント一覧画面にコメントを流し込む // スマホ以外のみ発動(スマホだと動作が遅くなるため) diff --git a/htdocs/files/script.js b/htdocs/files/script.js index f103e347..4af0cea4 100644 --- a/htdocs/files/script.js +++ b/htdocs/files/script.js @@ -607,6 +607,12 @@ } }); + // Shift キー + window.isShiftKey = false; + $(document).on('keydown keyup', function(event) { + window.isShiftKey = event.shiftKey; + }); + // 現在変換中か window.isComposing = false; $('#tweet').on('compositionstart', function() { @@ -1427,8 +1433,8 @@ var video = document.getElementsByClassName('dplayer-video-current')[0]; var subtitles = video.textTracks[1].activeCues; - // 字幕オンなら - if (video.textTracks[1].mode == 'showing' && video.textTracks[1].cues.length){ + // 字幕オン & Shift キーが押されていないなら + if (video.textTracks[1].mode == 'showing' && video.textTracks[1].cues.length && (!event.shiftKey || !window.isShiftKey)){ var subtitle_html = '
\n'; for(var i = (subtitles.length - 1); i >= 0; i--){ @@ -1495,8 +1501,8 @@ html = html.replace(/transform: translateX\(.*?\)\;/, 'left: ' + position + 'px;'); } - // 字幕オンなら - if (video.textTracks[1].mode == 'showing' && video.textTracks[1].cues.length){ + // 字幕オン & Shift キーが押されていないなら + if (video.textTracks[1].mode == 'showing' && video.textTracks[1].cues.length && !event.shiftKey){ var subtitle_html = '
\n'; for(var i = (subtitles.length - 1); i >= 0; i--){ diff --git a/htdocs/files/settings.css b/htdocs/files/settings.css index 44d479ce..bc826250 100644 --- a/htdocs/files/settings.css +++ b/htdocs/files/settings.css @@ -189,11 +189,11 @@ select { } #setting-user .select-wrap { - width: 150px; + max-width: 150px; } #setting-user .text-box { - width: 150px; + max-width: 150px; } .download, .download:link, .download:visited { @@ -288,6 +288,9 @@ select { #setting-user .toggle-switch { margin-left: 20px; } + #setting-env .toggle-switch { + margin-left: auto; + } input[type="text"], input[type="number"], input[type="url"], input[type="email"], input[type="password"] { width: 100%; margin-left: 0px; @@ -322,9 +325,11 @@ select { @media screen and (max-width: 500px){ #setting-user .select-wrap { width: 100%; + max-width: 100%; } #setting-user .text-box { width: 100%; + max-width: 100%; } .setting-select { flex-direction: column; diff --git a/htdocs/files/style.css b/htdocs/files/style.css index 3a23b8c4..d1d23277 100644 --- a/htdocs/files/style.css +++ b/htdocs/files/style.css @@ -921,7 +921,7 @@ google-cast-launcher:hover + #cast-toggle:before, google-cast-launcher:hover + # bottom: auto !important; z-index: 400 !important; border-radius: 6px; - box-shadow: 0 1px 10px 0 rgba(32, 33, 36, 0.5); + box-shadow: 0 1px 8px 0 rgba(32, 33, 36, 0.35); opacity: 1; transition: opacity 0.2s ease-in-out; } diff --git a/htdocs/tweet/auth.php b/htdocs/tweet/auth.php index ab44c7e5..1804069d 100644 --- a/htdocs/tweet/auth.php +++ b/htdocs/tweet/auth.php @@ -2,6 +2,7 @@ // モジュール読み込み require_once ('../../modules/require.php'); + require_once ('../../modules/module.php'); // セッション保存ディレクトリ session_save_path($base_dir.'data/twitter_session'); @@ -41,13 +42,16 @@ exit(1); } + // リファラからストリーム番号を取得 + $stream = getStreamNumber($_SERVER['HTTP_REFERER']); + // config.phpで入力した値を用いてTwitterに接続 $connection = new TwitterOAuth($CONSUMER_KEY, $CONSUMER_SECRET); // エラー捕捉 try { // 認証URLを取得するためのリクエストトークンの生成 - $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => $OAUTH_CALLBACK)); + $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => $OAUTH_CALLBACK.'?stream='.$stream)); } catch(Exception $e) { echo ''; diff --git a/htdocs/tweet/callback.php b/htdocs/tweet/callback.php index 6a822613..c6758910 100644 --- a/htdocs/tweet/callback.php +++ b/htdocs/tweet/callback.php @@ -48,7 +48,12 @@ setcookie('twitter', $cookie, time() + 7776000, '/'); // トップページにリダイレクト - header('Location: '.$site_url); + if (isset($_GET['stream']) and !empty($_GET['stream'])) { // ストリーム番号があるか + header('Location: '.$site_url.$_GET['stream'].'/'); + } else { + header('Location: '.$site_url); + } + exit; } else {