-Subproject commit 92789f87d558991f3b602fcc553ddc37cfe83b5c
+Subproject commit 6b4b21b9139670faf83bb894ec378d49ecc6acdc
margin: 0px;
}
+div.title
+{
+ text-align: center;
+ padding-top: 21px;
+ padding-bottom: 21px;
+ padding-left: 0px;
+ padding-right: 0px;
+ border: 0px;
+ margin: 0px;
+}
+
h1#titletext
{
margin: 0px;
padding: 0px;
}
+h1.titletext
+{
+ margin: 0px;
+ border: 0px;
+ padding: 0px;
+}
+
div#storypuzzle
{
text-align: left;
border: 0px;
}
+div.undertext
+{
+ text-align: left;
+ padding: 8px;
+ margin: 0px;
+ border: 0px;
+}
+
div#chat
{
text-align: left;
border-color: #bb6622;
}
+div.comment
+{
+ text-align: left;
+ border: solid #0057af 4px;
+ background-color: #0057af;
+}
+
+div.comment:hover
+{
+ border-color: #bb6622;
+ background-color: #bb6622;
+}
+
+div.commentinfo
+{
+ color: #ffffff!important;
+ /* font-weight: bold; */
+}
+
+div.commenttext
+{
+ background-color: #ffffff;
+ color: #000000;
+}
+
+div.space
+{
+ background-color: #46a3ff;
+ height: 27px;
+ margin-top: 27px;
+ margin-bottom: 27px;
+}
+
div#command
{
text-align: left;
'normal' => 0,
'bb' => 1,
'info' => 2,
+ 'words' => 3
};
use constant CHAT_STATE => {
'disconnected' => 0,
print $fh html_encode_line("\n".$data->{'content'});
}
+# TODO: previous page preload?
sub print_viewer_page {
(
my $file,
my $state,
my $settings,
my $frame_data,
- my $next_frame_data
+ my $next_frame_data,
+ my $words_data,
) = @_;
my $fh;
my $text_mode = int($context->{'text_mode'});
my $timer_unlocked = int($context->{'timer_unlocked'});
my $timer = int($context->{'timer'});
+ my $words_page = int($context->{'words_page'});
# my $prev_frame = $frame - 1;
my $next_frame = $frame + 1;
$timer_s = 'EE';
}
+ my $words_posts = int($words_data->{'posts'});
+ my $words_link_text = 'Words'.(($words_posts > 0) ? "[$words_posts]" : '');
+
my $prev_available = (($frame > 0) && $access);
my $next_available = ($launch || $password_ok || ($next_frame <= $last_frame));
my $prefetch_next = (
'b' => TEXT_MODE->{'info'}
}}
);
+ my $words_url = merge_url (
+ $viewer_url,
+ {'query'=>{
+ 'b' => TEXT_MODE->{'words'}
+ }}
+ );
my $frame_file;
my $frame_url;
my $frame_next_url;
$password_query = url_query_encode({'p', $settings->{'password'}});
$goto_url = merge_url($goto_url , {'query' => $password_query, 'append_query' => 1});
$info_url = merge_url($info_url , {'query' => $password_query, 'append_query' => 1});
+ $words_url = merge_url($words_url , {'query' => $password_query, 'append_query' => 1});
$bbcode_url = merge_url($bbcode_url , {'query' => $password_query, 'append_query' => 1});
$viewer_url = merge_url($viewer_url , {'query' => $password_query, 'append_query' => 1});
$viewer_0_url = merge_url($viewer_0_url , {'query' => $password_query, 'append_query' => 1});
my $_base_url = html_entity_encode_dec($base_url , 1);
my $_goto_url = html_entity_encode_dec($goto_url , 1);
my $_info_url = html_entity_encode_dec($info_url , 1);
+ my $_words_url = html_entity_encode_dec($words_url , 1);
my $_bbcode_url = html_entity_encode_dec($bbcode_url , 1);
my $_timer_url = html_entity_encode_dec($timer_url , 1);
my $_viewer_full_url = html_entity_encode_dec($viewer_full_url, 1);
}
print $fh '<a href="'.$_goto_url.'">GOTO</a>'."\n";
print $fh ' <span style="float: right;">'."\n ";
- if ($text_mode != TEXT_MODE->{'normal'}) {
+ if ($text_mode == TEXT_MODE->{'normal'}) {
+ print $fh '<a href="'.$_words_url.'">'.$words_link_text.'</a> | ';
+ }
+ else {
print $fh '<a href="'.$_viewer_url.'">Without</a> | ';
}
print $fh '<a href="'.$_info_url.'">Info</a> | ';
print $fh " </div>\n";
print $fh " </div>\n";
+ if ($text_mode == TEXT_MODE->{'words'}) {
+ # TODO: HERE PRINT COMMENTS
+ }
+
print_html_body_end($fh, $ong_state == STATE->{'inactive'});
print_html_end($fh);
my %frame_data = read_data_file(join_path(PATH_SEPARATOR(), DATA_PATH(), 0));
my %next_frame_data= read_data_file(join_path(PATH_SEPARATOR(), DATA_PATH(), 1));
my %default = read_data_file(DATA_DEFAULT_PATH());
+ my %words_data = read_data_file(
+ join_path(PATH_SEPARATOR(), DATA_WORDS_PATH(), 0),
+ '', # encoding
+ 0, # no header
+ 1, # header only
+ 1, # as list
+ );
%frame_data = merge_settings(\%default, \%frame_data);
%next_frame_data= merge_settings(\%default, \%next_frame_data);
$r = print_viewer_page(
$fh,
{
- 'launch' => 0,
- 'frame' => 0,
- 'access' => 1,
- 'password_ok' => 0,
+ 'launch' => 0,
+ 'frame' => 0,
+ 'access' => 1,
+ 'password_ok' => 0,
'timer_unlocked' => 3, # not relevant
- 'timer' => 0, # not relevant
- 'static' => 1,
- 'show_command' => 1
+ 'timer' => 0, # not relevant
+ 'static' => 1,
+ 'show_command' => 1,
+ 'text_mode' => TEXT_MODE->{'normal'},
+ 'words_page' => 0 # not relevant
},
$state,
$settings,
\%frame_data,
- \%next_frame_data
+ \%next_frame_data,
+ \%words_data
);
}
# no conditions met, pretend a normal Apache2 index
$r = print_viewer_page(
$fh,
{
- 'launch' => 1,
- 'frame' => 0,
- 'access' => 1,
- 'password_ok' => 0,
+ 'launch' => 1,
+ 'frame' => 0,
+ 'access' => 1,
+ 'password_ok' => 0,
'timer_unlocked' => 3,
- 'timer' => 0,
- 'static' => 1,
- 'show_command' => 1,
+ 'timer' => 0,
+ 'static' => 1,
+ 'show_command' => 1,
+ 'text_mode' => TEXT_MODE->{'normal'},
+ 'words_page' => 0 # not relevant
},
$state,
$settings,
\%frame_data,
- \%next_frame_data
+ \%next_frame_data,
+ {'posts' => 0} # words_data
);
return $r;
}
RM =/usr/bin/rm
SUDO =/usr/bin/sudo
-BIN_PATH = /botm/bin/test-bsta
-DATA_PATH = /botm/data/test-bsta
-LIB_PATH = /botm/lib/test-bsta
-LOG_PATH = /botm/log/test-bsta
-TMP_PATH = /botm/tmp/test-bsta
-WWW_PATH = /botm/www/1190/bstatest
+BIN_PATH = /botm/bin/test-bsta
+DATA_PATH = /botm/data/test-bsta
+DATA_WORDS_PATH = /botm/data/test-bsta/words
+LIB_PATH = /botm/lib/test-bsta
+LOG_PATH = /botm/log/test-bsta
+TMP_PATH = /botm/tmp/test-bsta
+WWW_PATH = /botm/www/1190/bstatest
CONF = /botm/etc/www/conf/1190/test-bsta.conf
CRON = /etc/cron.d/test-bsta
DIR=\
$(BIN_PATH)\
$(DATA_PATH)\
+$(DATA_WORDS_PATH)\
$(LIB_PATH)\
$(LOG_PATH)\
$(TMP_PATH)\
HIDDEN_DIR=\
$(DATA_PATH)\
+$(DATA_WORDS_PATH)\
$(TMP_PATH)
SETUID=\
###MAKE_RM: RM = rm
###MAKE_SUDO: SUDO = sudo
-###MAKE_BIN_PATH: BIN_PATH = /botm/bin/bsta
-###MAKE_DATA_PATH: DATA_PATH = /botm/data/bsta
-###MAKE_LIB_PATH: LIB_PATH = /botm/lib/bsta
-###MAKE_LOG_PATH: LOG_PATH = /botm/log/bsta
-###MAKE_TMP_PATH: TMP_PATH = /botm/tmp/bsta
-###MAKE_WWW_PATH: WWW_PATH = /botm/www/1190/bsta
+###MAKE_BIN_PATH: BIN_PATH = /botm/bin/bsta
+###MAKE_DATA_PATH: DATA_PATH = /botm/data/bsta
+###MAKE_DATA_WORDS_PATH: DATA_WORDS_PATH = /botm/data/bsta/words
+###MAKE_LIB_PATH: LIB_PATH = /botm/lib/bsta
+###MAKE_LOG_PATH: LOG_PATH = /botm/log/bsta
+###MAKE_TMP_PATH: TMP_PATH = /botm/tmp/bsta
+###MAKE_WWW_PATH: WWW_PATH = /botm/www/1190/bsta
###MAKE_CONF: CONF = /botm/etc/www/conf/1190/bsta.conf
###MAKE_CRON: CRON = /etc/cron.d/bsta
DIR=\
$(BIN_PATH)\
$(DATA_PATH)\
+$(DATA_WORDS_PATH)\
$(LIB_PATH)\
$(LOG_PATH)\
$(TMP_PATH)\
HIDDEN_DIR=\
$(DATA_PATH)\
+$(DATA_WORDS_PATH)\
$(TMP_PATH)
SETUID=\
_data_settings_path = @_PATH( $data_path, settings )
_data_state_path = @_PATH( $data_path, state )
_data_story_path = @_PATH( $data_path, story )
+_data_words_path = @_PATH( $data_path, words )
_log_path = @_PATH( $log_path, )
_log_ong_path = @_PATH( $log_path, ong.log)
MAKE_CONF = CONF = $_conf_path
MAKE_CRON = CRON = $_cron_path
-MAKE_BIN_PATH = BIN_PATH = $bin_path
-MAKE_DATA_PATH = DATA_PATH = $data_path
-MAKE_LIB_PATH = LIB_PATH = $lib_path
-MAKE_LOG_PATH = LOG_PATH = $log_path
-MAKE_TMP_PATH = TMP_PATH = $tmp_path
-MAKE_WWW_PATH = WWW_PATH = $www_path
+MAKE_BIN_PATH = BIN_PATH = $bin_path
+MAKE_DATA_PATH = DATA_PATH = $data_path
+MAKE_DATA_WORDS_PATH = DATA_WORDS_PATH = $_data_words_path
+MAKE_LIB_PATH = LIB_PATH = $lib_path
+MAKE_LOG_PATH = LOG_PATH = $log_path
+MAKE_TMP_PATH = TMP_PATH = $tmp_path
+MAKE_WWW_PATH = WWW_PATH = $www_path
PERL_LIB = @_PERL_USE_2(lib, @_PERL_STR($lib_path))
PERL_DATA_SETTINGS_PATH = @_PERL_CONSTANT_STR( DATA_SETTINGS_PATH, $_data_settings_path)
PERL_DATA_STATE_PATH = @_PERL_CONSTANT_STR( DATA_STATE_PATH , $_data_state_path )
PERL_DATA_STORY_PATH = @_PERL_CONSTANT_STR( DATA_STORY_PATH , $_data_story_path )
+PERL_DATA_WORDS_PATH = @_PERL_CONSTANT_STR( DATA_WORDS_PATH , $_data_words_path )
PERL_LOG_PATH = @_PERL_CONSTANT_STR( LOG_PATH, $_log_path)
###PERL_DATA_SETTINGS_PATH: DATA_SETTINGS_PATH = /botm/data/bsta/settings
###PERL_DATA_STATE_PATH: DATA_STATE_PATH = /botm/data/bsta/state
###PERL_DATA_STORY_PATH: DATA_STORY_PATH = /botm/data/bsta/story
+###PERL_DATA_WORDS_PATH: DATA_WORDS_PATH = /botm/data/bsta/words/
binmode STDIN, ':encoding(UTF-8)';
binmode STDOUT, ':encoding(UTF-8)';
my %state;
my %new_state;
my %goto_list;
+my %words_data;
my $method;
my $frame;
my $show_command;
my $ongtime;
my $text_mode;
+my $words_page;
+my $words_data_path;
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
###PERL_SET_PATH: $ENV{'PATH'} = /usr/local/bin:/usr/bin:/bin;
}
$text_mode = int($cgi{'b'});
-if($text_mode > 2) {
+if($text_mode > TEXT_MODE->{'words'}) {
$text_mode = TEXT_MODE->{'normal'};
}
+$words_page = int($cgi{'i'});
+
+$words_data_path = join_path(PATH_SEPARATOR(), DATA_WORDS_PATH(), $frame);
+%words_data = read_data_file(
+ $words_data_path, # file
+ '', # encoding
+ 0, # no header
+ ($text_mode != TEXT_MODE->{'words'}), # header only
+ 1, # as list
+);
print "Content-type: text/html\n";
if(!$access) {
'static' => 0,
'show_command' => $show_command,
'text_mode' => $text_mode,
+ 'words_page' => $words_page
},
\%state,
\%settings,
\%frame_data,
- \%next_frame_data
+ \%next_frame_data,
+ \%words_data,
);