Skip to content

Commit

Permalink
Merge branch 'master' into SPHD2
Browse files Browse the repository at this point in the history
  • Loading branch information
yt4687 committed Oct 21, 2020
2 parents 6a2218d + 462d95d commit 44968da
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 12 deletions.
9 changes: 7 additions & 2 deletions htdocs/files/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

// 表示・非表示
// ターゲット座標以上
Expand Down
2 changes: 1 addition & 1 deletion htdocs/files/file.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// ロード時 & リサイズ時に発火
$(window).on('load resize', function(event){
$(window).on('DOMContentLoaded resize', function(event){

// コメントを取得してコメント一覧画面にコメントを流し込む
// スマホ以外のみ発動(スマホだと動作が遅くなるため)
Expand Down
14 changes: 10 additions & 4 deletions htdocs/files/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 = '<div class="video-subtitle-box">\n';
for(var i = (subtitles.length - 1); i >= 0; i--){
Expand Down Expand Up @@ -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 = '<div class="video-subtitle-box">\n';
for(var i = (subtitles.length - 1); i >= 0; i--){
Expand Down
9 changes: 7 additions & 2 deletions htdocs/files/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/files/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 5 additions & 1 deletion htdocs/tweet/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// モジュール読み込み
require_once ('../../modules/require.php');
require_once ('../../modules/module.php');

// セッション保存ディレクトリ
session_save_path($base_dir.'data/twitter_session');
Expand Down Expand Up @@ -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 '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">';
Expand Down
7 changes: 6 additions & 1 deletion htdocs/tweet/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 44968da

Please sign in to comment.