Skip to content

Commit

Permalink
fix installer logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed Aug 27, 2019
1 parent ec3b775 commit b7f5cde
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 13 deletions.
2 changes: 1 addition & 1 deletion htdocs/files/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if (mm < 10) mm = "0" + mm;
var time = mm + ':' + ss;

html += '<tr class="comment-file"><td class="time" style="width: 62px;" value="' + videotime+ '">' + time + '</td>'
html += '<tr class="comment-file"><td class="time" style="width: 62px;" align="center" value="' + videotime+ '">' + time + '</td>'
+ '<td class="comment">' + data["data"][i][4].toString() +'</td></tr>';
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/files/onair.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
var time = hour + ':' + min + ':' + sec;

// コメントをウインドウに出す
$('#comment-draw-box').append('<tr><td class="time">' + time + '</td><td class="comment">' + danmaku['text'] +'</td></tr>');
$('#comment-draw-box').append('<tr><td class="time" align="center">' + time + '</td><td class="comment">' + danmaku['text'] +'</td></tr>');

// コメント描画
dp.danmaku.draw(danmaku);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/files/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ td {

.time {
width: 84px;
padding: 3px 10px;
padding: 3px 0px;
border-right: 1px solid #e5e8ea;
box-sizing: border-box;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/files/watch.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ section {
#search-more-box i{
position: absolute;
left: 30px;
font-size: 20px;
font-size: 22px;
line-height: 25px;
color: #70757a;
}
Expand Down
5 changes: 5 additions & 0 deletions htdocs/files/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@

// 1つずつだと遅すぎるため一気に出す
$('#search-list').append(html).hide().fadeIn(500);

// 検索キーワードがあるなら上までスクロール
if (text !== undefined && text !== '' && fileinfo.length == length){
$('html, body').animate({ scrollTop: 0 }, 700);
}

// 1件も見つからなかった場合
} else {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/watch.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
if (file_exists($infofile)){
$TSfile = json_decode(file_get_contents($infofile), true);
} else {
$TSfile = array();
$TSfile['data'] = array();
}

echo '</pre>';
Expand Down
38 changes: 31 additions & 7 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function if_copy($copy, $flg = false){
echo ' 1. TVRemotePlus をインストールするフォルダを指定します。'."\n";
echo "\n";
echo ' フォルダをドラッグ&ドロップするか、ファイルパスを入力してください。'."\n";
echo ' なお、Users・Program Files 以下と、日本語が含まれるパスは'."\n";
echo ' なお、Users・Program Files 以下と、日本語(全角)が含まれるパスは'."\n";
echo ' 動作しなくなる原因となるため、避けてください。'."\n";
echo "\n";
echo ' インストールするフォルダ:';
Expand All @@ -106,14 +106,23 @@ function if_copy($copy, $flg = false){

// フォルダが存在する場合アップデート
if (file_exists($serverroot) and file_exists($serverroot.'/config.php')){
$update = true;
echo ' 既に指定されたフォルダにインストールされていると判定しました。'."\n";
echo ' アップデートモードでインストールします。'."\n";
echo ' このままアップデートモードでインストールするには 1 を、'."\n";
echo ' 全て新規インストールする場合は 2 を入力してください。'."\n";
echo "\n";
echo ' インストール:';
$update_flg = trim(fgets(STDIN));
// 判定
if ($update_flg == 1) $update = true;
else $update = false;
} else {
$update = false;
}


// 新規インストールの場合はIPとポートを訊く
} else {
$update = false;
if ($update === false){
echo ' 2. TVRemotePlusをインストールするPCの、ローカルIPアドレスを入力してください。'."\n";
echo "\n";
echo ' ローカルIPアドレスは、通常 192.168.x.xx のような形式の家の中用の IP アドレスです。'."\n";
Expand Down Expand Up @@ -157,11 +166,22 @@ function if_copy($copy, $flg = false){
echo ' Enter キーで次に進む場合、自動で 32bit を選択します。'."\n";
echo "\n";
echo ' TVTest の BonDriver:';
// TVRemotePlusを稼働させるポート
// TVTestのBonDriver
$bondriver = trim(fgets(STDIN));
// 判定
if ($bondriver != 2) $bondriver = 1;
echo "\n";

echo ' 5. 録画ファイルのあるフォルダを指定します。'."\n";
echo "\n";
echo ' フォルダをドラッグ&ドロップするか、ファイルパスを入力してください。'."\n";
echo ' なお、日本語(全角文字)が含まれるパスとネットワークドライブ上のフォルダは、'."\n";
echo ' 動作しなくなる原因となるため、避けてください。'."\n";
echo "\n";
echo ' インストールするフォルダ:';
// 録画ファイルのあるフォルダ
$TSfile_dir = trim(fgets(STDIN));
echo "\n";
}

echo ' インストールを開始します。'."\n";
Expand All @@ -178,6 +198,7 @@ function if_copy($copy, $flg = false){
if_copy ('/require.php', true);
if_copy ('/stream.php', true);
if_copy ('/bin', true);
if_copy ('/cast', true);
if_copy ('/data', true);
if_copy ('/docs', true);
if_copy ('/htdocs', true);
Expand Down Expand Up @@ -221,7 +242,8 @@ function if_copy($copy, $flg = false){

// TVRemotePlusの設定ファイル
$tvrp_conf = file_get_contents($tvrp_conf_file);
$tvrp_conf = preg_replace('/\$http_port =.*/', '$http_port = '.$port.';', $tvrp_conf); // 置換
$tvrp_conf = preg_replace('/^\$TSfile_dir =.*/m', '$TSfile_dir = '.$TSfile_dir.';', $tvrp_conf); // 置換
$tvrp_conf = preg_replace('/^\$http_port =.*/m', '$http_port = '.$port.';', $tvrp_conf); // 置換
file_put_contents($tvrp_conf_file, $tvrp_conf); // 書き込み

// Apacheの設定ファイル
Expand Down Expand Up @@ -283,10 +305,12 @@ function if_copy($copy, $flg = false){
// 新規インストールのみの処理
if ($update === false){
echo ' セットアップはまだ終わっていません。'."\n\n";
echo ' BonDriver.ch2 ファイルは bin/TSTask/BonDriver/ フォルダに忘れずに入れてください'."\n\n";
echo ' BonDriver.ch2 ファイルは '.$serverroot .'/bin/TSTask/BonDriver/ に忘れずに入れてください'."\n\n";
echo ' 終わったら、デスクトップのショートカットから TVRemotePlus を起動し、その後'."\n";
echo ' ブラウザから http://'.$serverip.':'.$port.'/ にアクセスします。'."\n";
echo ' その後、≡ サイドメニュー → 設定 → 環境設定 から必要な箇所を設定してください。'."\n";
echo ' PWA 機能を使用する場合は、予め端末に設定ページからダウンロードできる自己署名証明書を'."\n";
echo ' インストールした上で、 https://'.$serverip.':'.$ssl_port.'/ にアクセスしてください。'."\n";
sleep(1);
}

Expand Down
2 changes: 1 addition & 1 deletion require.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$tstask_exe = 'TSTask.exe';
$tstask_path = $base_dir.'bin/TSTask/'.$tstask_exe;
$tstaskcentre_exe = 'TSTaskCentre.exe';
$tstaskcentre_path = $base_dir.'bin/TSTask/'.$tstask_exe;
$tstaskcentre_path = $base_dir.'bin/TSTask/'.$tstaskcentre_exe;


// ***** その他の設定 *****
Expand Down

0 comments on commit b7f5cde

Please sign in to comment.