Skip to content

Commit

Permalink
下書き保存(expack.editor.savedraft)が無効なときに実況モードから書き込めない不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
2ch774 committed Mar 18, 2015
1 parent b808ad8 commit 97ad2e4
Showing 1 changed file with 51 additions and 52 deletions.
103 changes: 51 additions & 52 deletions rep2/live_post_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,61 +124,60 @@
echo <<<EOP
<script type="text/javascript" src="js/post_draft.js?{$_conf['p2_version_id']}"></script>
EOP;
}
// +live 書込規制用タイマー
if ($_GET['w_reg'] && $_conf['live.write_regulation']) {
$load_control = "cd_on()";
if ($_conf['live.write_regulation'] == 3) {
$count_down_second = "31";
} else if ($_conf['live.write_regulation'] == 2) {
$count_down_second = "21";
} else if ($_conf['live.write_regulation'] == 1) {
$count_down_second = "11";
}
} else {
$load_control = "cd_off()";
$count_down_second = "0";
}

// +live 書込規制用タイマー
if ($_GET['w_reg'] && $_conf['live.write_regulation']) {
$load_control = "cd_on()";
if ($_conf['live.write_regulation'] == 3) {
$count_down_second = "31";
} else if ($_conf['live.write_regulation'] == 2) {
$count_down_second = "21";
} else if ($_conf['live.write_regulation'] == 1) {
$count_down_second = "11";
}
} else {
$load_control = "cd_off()";
$count_down_second = "0";
}

echo <<<LIVE
<script language="javascript">
<!--
var cd_timer;
var count_down;
var kakikomi_b = "<input id=\"kakiko_submit\" type=\"submit\" name=\"submit\" value=\"{$submit_value}\" tabindex=\"4\" accesskey=\"z\">";
function cd_on() {
count_down = {$count_down_second}; // 書込規制時間
SetTimer();
}
function cd_off() {
document.getElementById("write_regulation").innerHTML = kakikomi_b;
}
function SetTimer() {
count_down -= 1; // カウントダウン
document.getElementById("write_reg_ato").innerHTML = "[あと";
document.getElementById("write_regulation").innerHTML = count_down; // 残秒表示
document.getElementById("write_reg_byou").innerHTML = "秒]";
if (count_down < 1) {
clearTimeout(cd_timer); // タイマー終了
document.getElementById("write_reg_ato").innerHTML = "";
document.getElementById("write_regulation").innerHTML = kakikomi_b;
document.getElementById("write_reg_byou").innerHTML = "";
} else {
cd_timer = setTimeout('SetTimer()', 1000);
}
}
//-->
</script>
LIVE;
echo <<<LIVE
<script language="javascript">
<!--
var cd_timer;
var count_down;
var kakikomi_b = "<input id=\"kakiko_submit\" type=\"submit\" name=\"submit\" value=\"{$submit_value}\" tabindex=\"4\" accesskey=\"z\">";
function cd_on() {
count_down = {$count_down_second}; // 書込規制時間
SetTimer();
}
function cd_off() {
document.getElementById("write_regulation").innerHTML = kakikomi_b;
}
function SetTimer() {
count_down -= 1; // カウントダウン
document.getElementById("write_reg_ato").innerHTML = "[あと";
document.getElementById("write_regulation").innerHTML = count_down; // 残秒表示
document.getElementById("write_reg_byou").innerHTML = "秒]";
if (count_down < 1) {
clearTimeout(cd_timer); // タイマー終了
document.getElementById("write_reg_ato").innerHTML = "";
document.getElementById("write_regulation").innerHTML = kakikomi_b;
document.getElementById("write_reg_byou").innerHTML = "";
} else {
cd_timer = setTimeout('SetTimer()', 1000);
}
}
//-->
</script>
LIVE;

$body_on_load = <<<EOP
onLoad="setFocus('MESSAGE'); checkSage(); {$load_control};"
EOP;
Expand Down

0 comments on commit 97ad2e4

Please sign in to comment.