# -*- mode:Perl; tab-width:4; -*-
# Time-stamp: <2001/09/10 (Mon) 20:23:25 m-hase@ceres.dti.ne.jp>
################################################################
# MAKOPi's theme
#
################################################################
# japanese theme
# $Id: theme.ph,v 1.59 2000/10/22 04:28:41 kenji Exp $
################################################################
# User variable
# parameter %value is expanded to value of the user variable.
# you can use other value of user variable by noting as "%user{BASHO}".
package HNS::Hnf::UserVar;
$Templates{'TENKI'} = "[天気:%value]";
$Templates{'BASHO'} = "(%value)";
$Templates{'TAION'} = " 体温:%value度";
$Templates{'TAIJU'} = " 体重:%value" . "Kg";
$Templates{'SUIMIN'} = " 睡眠:%value時間";
$Templates{'BGM'} = " BGM:%value";
$Templates{'HOSU'} = " %value歩";
$Templates{'HON'} = " 読書:%value";
$Templates{'KITAKU'} = " 帰宅時間:%value";
$Templates{'WALK'} = " 散歩:%value";
$Templates{'RUN'} = " ジョギング:%value";
$Templates{'SANZAI'} = " 散財度数:%value円";
$Templates{'HIMEKURI'} = " ひめくり:%value";
$Templates{'YOTEI'} = "%value";
################################################################
# Mark
package HNS::Hnf::Command::MARK;
# image size is automatically set
$List{"(^^)"} = "icons/usaniko.png";
$List{"(-_-)"} = "icons/usamesen.png";
$List{"(^^;"} = "icons/usaase.png";
$List{"(;_;)"} = "icons/usauru.png";
$List{"(T_T)"} = "icons/usauru2.png";
$List{"v(^^)"} = "icons/usav.png";
$List{"m(__)m"} = "icons/usapeko.png";
$List{"!!"} = "icons/usadoki.png";
$List{"??"} = "icons/usahatena.png";
$List{"!?"} = "icons/usanaze.png";
$List{"(笑)"} = "icons/usasho.png";
$List{":-)"} = "icons/usasmile2.png";
$List{":-("} = "icons/usaheno2.png";
$List{":-P"} = "icons/usabe2.png";
$List{"φ(._.)"} = "icons/usamemo.png";
################################################################
# Language
package HNS::System;
$Lang = "ja";
# $MyDiaryURI = "http://localhost:8080/~MAKOPi/diary/"; #"%MYDIARYURI%";
################################################################
# CategoryList
package HNS::CategoryList;
$CatDir = "cat";
$TitleLabel = "タイトル一覧";
$SubmitLabel = "表示!";
$Template = qq(<img src="%src" width="%width" height="%height" alt="">%value<br>\n);
$Categorize = "カテゴリ分類";
################################################################
# Extend HTML
package HNS::ExtHTML;
$DOCTYPE = qq(<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">\n);
#$Head = undef;
$Head{dynamic} = qq(<meta http-equiv="Content-Style-Type" content="text/css">
<META NAME="keywords" CONTENT="diary,vaio,C1VJ,Crusoe,Emacs,Meadow,hns,w3m,Anime">
<style type="text/css"><!--
BODY { BACKGROUND: #ddffdd;
line-height: 120%;
}
h2.title {
FONT-SIZE: 14pt;
}
h2.day {
BACKGROUND: #88dd88;
PADDING-TOP: 0.3em;
PADDING-BOTTOM: 0.3em;
PADDING-RIGHT: 0.3em;
PADDING-LEFT: 0.3em;
BORDER-LEFT-WIDTH: MIDIUM;
BORDER-LEFT-STYLE: SOLID;
BORDER-BOTTOM-WIDTH: MIDIUM;
BORDER-BOTTOM-STYLE: SOLID;
/* BORDER-WIDTH: THIN;*/
BORDER-COLOR: #88ee88;
BORDER-STYLE: OUTSET;
}
h3.new {
BACKGROUND: #bbeebb;
PADDING-TOP: 0.2em;
PADDING-BOTTOM: 0.2em;
PADDING-RIGHT: 0.2em;
PADDING-LEFT: 0.4em;
BORDER-COLOR: #88aa88;
BORDER-LEFT-WIDTH: 5px;
BORDER-LEFT-STYLE: SOLID;
BORDER-BOTTOM-WIDTH: 1px;
BORDER-BOTTOM-STYLE: SOLID;
margin-left: 1em;
}
table.calendar {
BACKGROUND: #d0ffd0;
MARGIN: 0.1em;
BORDER-COLOR: #88aa88;
BORDER-WIDTH: 1px;
BORDER-STYLE: SOLID;
}
table.unagi2 {
BACKGROUND: #d0ffd0;
BORDER-COLOR: #88aa88;
BORDER-WIDTH: 1px;
BORDER-STYLE: SOLID;
}
HR { COLOR: #88aa88; }
/* P { text-indent: 1em; } */
TH.sunday, TD.sunday { width: 1.75em; BACKGROUND: pink; }
TH.satday, TD.satday { width: 1.75em; BACKGROUND: skyblue; }
TH.weekday, TD.weekday{ width: 1.75em; BACKGROUND: mediumspringgreen; }
TH.today, TD.today { width: 1.75em; BACKGROUND: #FFFF99; }
div.uservar { color: brown; font-weight: bold; }
div.section { margin-left: 2em; margin-top: 0; }
div.sub { margin-left: 1em; margin-top: 0; }
div.list { margin-left: 1em; }
div.fn { margin-left: 1em; margin-top: 0; }
div.url { margin-bottom: 0; }
div.cite {
BACKGROUND: #eeffee;
padding: 0.5em;
margin-left: 0.25em;
margin-right: 0.25em;
}
blockquote {
BACKGROUND: #eeffee;
/* margin: 0.3em; */
padding: 0.8em;
margin-left: 1.0em;
margin-right: 1.0em;
}
pre {
BACKGROUND-COLOR: ivory;
white-space: pre;
padding: 0.5em;
border-color: #ffeeb0;
border-style: outset;
border-width: 4px;
}
a.hide:link {
color: black;
text-decoration: none;
}
a:visited {
color: darkpink;
}
a.index:link {
color: blue;
text-decoration: none;
}
a.index:visited {
text-decoration: none;
}
a:hover {
color: blue;
background-color: springgreen;
}
span.black { color: black; }
span.bold-red { color: red; font-weight: bold; }
div.bold-red { color: red; font-weight: bold; }
.dummy {}
.larger { FONT-SIZE: larger; }
.smaller { FONT-SIZE: smaller; }
.red { color: red; }
.green { color: green; }
.blue { color: blue; }
.bg-green { BACKGROUND: #88FF88;}
span.isbn { color: gray; FONT-SIZE: 9pt; }
span.cd { color: gray; FONT-SIZE: 9pt; }
--></style>
);
$Head{static} = qq(<!--
#$BodyVal = undef;
##$BodyVal = "bgcolor=#ffffcc";
# $BodyVal = "bgcolor=#ccffcc";
$BodyVal = "bgcolor=#ddffdd";
#$DynamicPrintFunc = undef;
##$DynamicPrintFunc = \&PrintTime;
##sub PrintTime
##{
## print qq(<div align="center">time is);
## print join(':', reverse ((localtime)[0..2]));
## print qq(</div>);
##}
################################################################
package HNS::Collection;
# %num : number of showing diarys
$FootMessages{'HasContent'} = "以上、%num 日分です。\n";
$FootMessages{'NoContent'} = "該当するものはありません。\n";
################################################################
# PIM
# Schedule
package HNS::PIM::Schedule;
@WeekString = ('<font color="red">日</font>', '月', '火', '水', '木', '金', '<font color="blue">土</font>');
@ABCString = ('上', '中', '下');
$Unfixed = '??';
$ContentTemplate = qq(<li><strong>%month/%day%week</strong> %content</li>\n);
$BeginTemplate = "<ul>";
$EndTemplate = "</ul>";
# TODO
package HNS::PIM::Todo;
$ContentTemplate = "<li><strong>%priority</strong> %content</li>\n";
$BeginTemplate = "<ul>";
$EndTemplate = "</ul>";
################################################################
# Calendar
package HNS::Calendar::Table;
@WeekString = ('<font color="red">日</font>', '月', '火', '水', '木', '金', '<font color="blue">土</font>');
$TableBorder = 0;
# $NextTemplate{dynamic} = qq(<a href="$HNS::System::MyDiaryURI?%year%month">来月</a><a href="./t%year%{month}.html">(T)</a>);
# $PrevTemplate{dynamic} = qq(<a href="$HNS::System::MyDiaryURI?%year%month">先月</a><a href="./t%year%{month}.html">(T)</a>);
# $ThisTemplate{dynamic} = qq(<a href="$HNS::System::MyDiaryURI?%year%month">%year年%month月</a><a href="./t%year%{month}.html">(T)</a>);
# $NextTemplate{static} = qq(<a href="./%year%month.html">来月</a><a href="./t%year%{month}.html">(T)</a>);
# $PrevTemplate{static} = qq(<a href="./%year%month.html">先月</a><a href="./t%year%{month}.html">(T)</a>);
# $ThisTemplate{static} = qq(<a href="./%year%month.html">%year年%month月</a><a href="./t%year%{month}.html">(T)</a>);
$NextTemplate{dynamic} = qq(<a href="$HNS::System::MyDiaryURI?%year%month">来月</a><a href="./title.cgi?CAT=ALL&%year%{month}">[T]</a>);
$PrevTemplate{dynamic} = qq(<a href="$HNS::System::MyDiaryURI?%year%month">先月</a><a href="./title.cgi?CAT=ALL&%year%{month}">[T]</a>);
$ThisTemplate{dynamic} = qq(<a href="$HNS::System::MyDiaryURI?%year%month">%year年%month月</a><a href="./title.cgi?CAT=ALL&%year%{month}">[T]</a>);
$NextTemplate{static} = qq(<a href="./%year%month.html">来月</a><a href="./t%year%{month}.html">[T]</a>);
$PrevTemplate{static} = qq(<a href="./%year%month.html">先月</a><a href="./t%year%{month}.html">[T]</a>);
$ThisTemplate{static} = qq(<a href="./%year%month.html">%year年%month月</a><a href="./t%year%{month}.html">[T]</a>);
$DayCurrentTemplate = qq(<a href="%ruri#%{ymd}0">%day</a>);
$DayNonCurrentTemplate = qq(<a href="%href">%day</a>);
package HNS::Calendar::NoTable;
$NextTemplate{dynamic} = qq(<a href="$HNS::System::MyDiaryURI?%year%month">>></a>);
$PrevTemplate{dynamic} = qq(<a href="$HNS::System::MyDiaryURI?%year%month"><<</a>);
$ThisTemplate{dynamic} = qq(<a href="$HNS::System::MyDiaryURI?%year%month">%year/%month</a>);
$NextTemplate{static} = qq(<a href="./%year%month.html">>></a>);
$PrevTemplate{static} = qq(<a href="./%year%month.html"><<</a>);
$ThisTemplate{static} = qq(<a href="./%year%month.html">%year/%month</a>);
$DayCurrentTemplate = qq(<a href="%ruri#%{ymd}0">%day</a>);
$DayNonCurrentTemplate = qq(<a href="%href">%day</a>);
################################################################
# DateSelect
package HNS::DateSelect;
$YearTemplate = "%year年";
$MonthTemplate = "%month月";
$DayTemplate = "%start_day〜%end_day日";
$AllLabel = "全て";
################################################################
# Direct Ctalendar
package HNS::Calendar::Direct;
$SubmitLabel = "Go!";
################################################################
# Style
package HNS::Style;
$Templates{Table}->{pim} = qq(
<hr>
<table class="pim" summary="pim" width="100%">
<tbody>
<tr>
<th align="left">予定</th>
<th align="left">TODO</th>
</tr>
<tr>
<td valign="top">
%schedule
</td>
<td valign="top">
%todo
</td>
</tr>
</tbody>
</table>
);
$Templates{Table}->{head_style}->{dynamic} = qq(
%pim
<hr>
<table summary="calendar" align="center" width="95%" >
<tr>
<td nowrap valign="top" align="left">
%calendar
</td>
<td nowrap valign="center" align="center">
</td>
<td nowrap valign="top" align="right">
%unagi
</td>
</tr>
</TABLE>
<hr>
);
$Templates{Table}->{head_style}->{static} = $Templates{Table}->{head_style}->{dynamic};
# $Templates{Table}->{head_style}->{static} = qq(
# %pim
# <hr>
# %calendar
# <hr>
# );
$Templates{Table}->{foot_style} = "\n<hr>\n%category_list";
$Templates{Table}->{head_recent_style} = $Templates{Table}->{head_style};
$Templates{Table}->{foot_recent_style} = $Templates{Table}->{foot_style};
# $Templates{Table}->{head_recent_style} = qq(
# %pim
# <hr>
# );
#
# $Templates{Table}->{foot_recent_style} = qq(
# <hr>
# <table summary="calendar">
# <tr>
# <td rowspan="2" valign="top">
# %calendar
# </td>
# <td valign="top">
# %unagi
# </td>
# </tr>
# <tr>
# <td valign="bottom">
# %direct_calendar
# </td>
# </tr>
# </table>
# \n<hr>%category_list
# );
# template for no table browser
$Templates{NoTable} = {
pim => qq(<hr>\n%schedule %todo %link),
head_style => qq(%pim\n<hr>\n%unagi\n<hr>\n%calendar
%direct_calendar\n<hr>\n),
foot_style=> "<hr>\n%category_list"
};
$Templates{NoTable}->{head_recent_style} = $Templates{NoTable}->{head_style};
$Templates{NoTable}->{foot_recent_style} = $Templates{NoTable}->{foot_style};
# unagi template
# $UnagiTemplate = qq(
# <a href="%namazu_url">Namazu</a> for hns による簡易全文検索<br>
# 詳しくは <a href="%unagi_url">詳細指定/ヘルプ</a>を参照して下さい
# <form method="GET" action="%unagi_url">
# <strong>検索式:</strong>
# <input type="TEXT" name="key" size="30" value="">
# <input type="SUBMIT" name="submit" value="Search!">
# <input type="HIDDEN" name="whence" value="0">
# </form>
# );
# <tr><td nowrap valign="center" align="right">
$UnagiTemplate = qq(
<table class="unagi" cellspacing>
<tr valign="center"><td align="right">
<form action="http://hpcgi2.nifty.com/MAKOPi/diary/index.cgi" method="get">
<!-- <form action="index2.cgi" method="get"> -->
<select name="YEAR">
<option value="2001" selected>2001年</option>
<option value="2000" >2000年</option>
</select>
<select name="MONTH">
<option value="01" >01月</option>
<option value="02" >02月</option>
<option value="03" >03月</option>
<option value="04" >04月</option>
<option value="05" >05月</option>
<option value="06" >06月</option>
<option value="07" >07月</option>
<option value="08" selected>08月</option>
<option value="09" >09月</option>
<option value="10" >10月</option>
<option value="11" >11月</option>
<option value="12" >12月</option>
</select>
<input type="submit" value="Jump!">
</form>
</td></tr>
<tr valign="center"><td align="right">
<form method="GET" action="%unagi_url">
<strong>KEYWORD:</strong>
<SELECT NAME="key" SIZE="1">
<OPTION value="C1VJ">VAIO C1VJ
<OPTION value="hns">hns
<OPTION value="Windows 2000">Windows2000
<OPTION value="IEEE 1394">IEEE1394
<OPTION value="w3m">w3m
<OPTION value="wanderlust">Wanderlust
<OPTION value="Meadow">Meadow
<OPTION value="emacs">emacs
<OPTION value="cygwin">cygwin
<OPTION value="libretto">Libretto
<OPTION value="Crusoe">Crusoe
<OPTION value="Comp">Computer
<OPTION value="Anime">Anime
<OPTION value="Moe">萌え
</SELECT>
<input type="SUBMIT" name="submit" value="検索">
<input type="HIDDEN" name="whence" value="0">
</form>
</td></tr>
<tr valign="center"><td align="right">
<form method="GET" action="%unagi_url">
<strong>検索式:</strong>
<input type="TEXT" name="key" size="20" value="">
<input type="SUBMIT" name="submit" value="検索">
<input type="HIDDEN" name="whence" value="0">
</form>
</td></tr>
</table>
);
$NoUnagiTemplate = qq(
<a href="http://www.h14m.org/"><img src="./icons/hns-logo.png" width="200" height="40" align="right" alt="HNS logo"></a>
);
################################################################
# Warning
package HNS::Hnf::Warning;
$Head = "<br><font color=\"red\">\[- 日記システム警告:";
$Foot = "-\]</font><br>\n";
# parameters:
# %c : the command name
# %p : command name of inserted position
#
$Messages{'IllegalHeader'} = "ヘッダ部が不正です";
$Messages{'UndefinedUserVar'} = "定義されていないユーザ変数が使われています";
$Messages{'Reserved'} = "コマンド %c は予約されています。";
$Messages{'NoMatch'} = "コマンド %p の中にコマンド %c を含めることはできません。コマンド /%c が抜けている可能性があります。";
$Messages{'NotDefined'} = "コマンド %c の引数として %t は定義されていません。";
################################################################
# Version Message
# paramter:
# %homepage
# %public_version
# %current_version
# package HNS;
# $VersionMessages{'Public'} = q(<hr>
# <div>hns - 日記自動生成システム - Version %public</div>);
# $VersionMessages{'NonPublic'} = qq(<hr>
# <div>
# <font color="red">注意:</font>
# 今現在使用されているこの日記自動生成システムは
# Version %current です。<br>
# 公開されている日記自動生成システムは
# Version %public です。
# </div>
# );
package HNS;
$VersionMessages{'Public'} = q(<hr>
<div>hns - Hyper NIKKI System - Version %public</div>);
$VersionMessages{'NonPublic'} = qq(<hr>
<div>
<font color="red">Caution: </font>
current version is %current,
public released version is %public.
</div>
);
################################################################
# Template
# usable parameter (%[A-Za-z0-9_]) is:
# date:
# %year, %month, %day : year, month, day
# %high : int(day/10)
# %abc : day 1-10 -> a, 11-20 -> b, 21-31 -> c
# counter:
# %new, %sub, %fn : counter of NEW, SUB, FN
# %mark : for GRP mark, if not in GRP the same as %new
package HNS::Diary::Template;
$BaseTemplate{dynamic} = "$HNS::System::MyDiaryURI?%year%month%abc";
#$BaseTemplate{dynamic} = "$HNS::System::MyDiaryURI?%year%month%day"; # 1日分のみ
$BaseTemplate{static} = "./%year%month.html"; # 静的生成
$HrefTemplate{dynamic} = "%base&to=%name#%name";
#$HrefTemplate{dynamic} = "%base#%name"; # to= を付けない
$HrefTemplate{static} = "%base?to=%name#%name"; # 静的生成
package HNS::Diary;
################
# diary limited parameter:
# %week : week string
#
# user-variable
# %user{VARNAME} : string as which user-var-format is expanded using
# value of user-variable VARNAME.
# $Head{dynamic} = qq(
# <h2><a class="hide" href="%href" name="%name">%year年%month月%day日(%week)</a>
# [<a href="$HNS::System::MyDiaryURI?%month%day">n年日記</a>]</h2>
# );
# $Head{static} = qq(
# <h2><a class="hide" href="%href" name="%name">%year年%month月%day日(%week)</a></h2>
# );
@WeekString = ('<font color="red">日</font>', '月', '火', '水', '木', '金', '<font color="blue">土</font>');
$Head{dynamic} = qq(
<h2><a class="hide" href="%href" name="%name">%year年%month月%day日(%week)</a>
[<a href="$HNS::System::MyDiaryURI?%month%day">n年日記</a>] <a href="http://nnh.to/%month/%day.html">今日は何の日</a></h2>
);
$Head{static} = qq(
<h2><a class="hide" href="%href" name="%name">%year年%month月%day日(%week)</a> <a href="http://nnh.to/%month/%day.html">今日は何の日</a></h2>
);
$UserVar = qq(<div class="uservar">
%user{TENKI}%user{BASHO}%user{TAIJU}%user{TAION}%user{SUIMIN}%user{BGM}
%user{HOSU}%user{HON}%user{KITAKU}%user{SANZAI}%user{HIMEKURI}%user{YOTEI}
</div>);
$Foot = qq(<hr>\n);
### Yotei
# $YoteiVal = "<li>%value</li>";
# $YoteiHead = "今日の予定\n<ul>";
# $YoteiFoot = "</ul>";
$YoteiHead = qq(
<span class="black"><h3 class="new">■今日の予定</h3>
<ul>\n);
$YoteiVal = "<li>%value</li>";
$YoteiFoot = "</ul></span>";
package HNS::Hnf::Command::ConvUrl;
$HrefTemplate = "%base#%name";
$Template{mydiary} = "%href";
$Template{ISBN} = "http://www.eshopping.ne.jp/bks.svl?CID=BKS504&access_method=isbn_cd&input_data=%param";
# $Template{ISBN} = "http://www.bk1.co.jp/cgi-bin/srch/srch_result_book.cgi?idx=3&isbn=%param";
# $Template{ISBN} = "http://www.isize.com/book/cgi-bin/isbn.cgi?isbn=%param";
# $Template{ISBN} = "http://www1.honyasan.co.jp/washo/book.cfm?PRODUCT_CD=%param";
$Template{CD} = "http://www.hmv.co.jp/search/title.asp?category=CATALOGUENO&keyword=%param";
# $Template{CD} = "http://www.towerrecords.co.jp/tower/towercdj.nsf/SearchProductID/%param";
# $Template{CD} = "https://cd2.shinseido.co.jp/cgi-bin/ehsql_select/ec/slist10.ehtml?eh-dbase=ecdb&eh-table=product&eh-key-attribute=pro_no&pro_recno=%param";
package HNS::Hnf::Command::CAT;
$Template{dynamic} = qq([<a href="./title.cgi?CAT=%enc_var">%var</a>]);
$ImgTemplate{dynamic} = qq(<a href="./title.cgi?CAT=%enc_var">%img</a>);
$Template{static} = qq([<a href="./tc%year%month.html#%enc_var">%var</a>]);
$ImgTemplate{static} = qq(<a href="./tc%year%month.html#%enc_var">%img</a>);
package HNS::Hnf::Command::NEW;
$Template = qq(
<h3 class="new"><a class="hide" name="%name" title="%name" href="%href">%cat %content</h3>
<div class="section">\n);
$EndTemplate = "</div><!-- end of NEW -->\n";
# $Template = qq(
# <h3 class="new">
# <SPAN STYLE="width:100%; filter:Shadow(color=gray)">
# <a class="hide" name="%name" title="%name" href="%href">#%mark</a>
# %cat
# %content</SPAN></h3>
# <div class="section">\n);
# $EndTemplate = "</div><!-- end of NEW -->\n";
package HNS::Hnf::Command::LNEW;
$Template = qq(
<h3 class="new"><a class="hide" name="%name" title="%name"
href="%href">%cat <a href="%1">%content</a></h3>
<div class="section">\n);
$EndTemplate = "</div><!-- end of LNEW -->\n";
package HNS::Hnf::Command::RLNEW;
$Template = qq(
<h3 class="new"><a class="hide" name="%name" title="%name" href="%href">%cat <a href="%url%2">%content</a></h3>
<div class="section">\n);
$EndTemplate = "</div><!-- end of RLNEW -->\n";
package HNS::Hnf::Command::SUB;
$Template = qq(
<h4><a class="hide" name="%name" title="%name" href="%href">@</a>
%content:</h4>
<div class="sub">
);
$EndTemplate = "</div><!-- end of SUB -->\n";
package HNS::Hnf::Command::LSUB;
$Template = qq(
<h4><a class="hide" name="%name" title="%name" href="%href">@</a>
<a href="%1">%content</a>:</h4>
<div class="sub">
);
$EndTemplate = "</div><!-- end of LSUB -->\n";
$NumAttr = 1;
package HNS::Hnf::Command::RLSUB;
$Template = qq(
<h4><a class="hide" name="%name" title="%name" href="%href">@</a>
<a href="%url%2">%content</a>:</h4>
<div class="sub">
);
$EndTemplate = "</div><!-- end of RLSUB -->\n";
$NumAttr = 2;
################################################################
# package HNS::Hnf::Command::P;
# $Template = qq(
# <p><a name='%name' title='%name' href='%href'>. </a> );
# $EndTemplate = "</p><!-- end of P -->\n";
################################################################
# Inline Elements
# these element has no content commands,
# so $EndTemplate, $AllowCommands has no means.
package HNS::Hnf::Command::LINK;
$Template = qq(<a href="%1">%content</a>\n);
$NumAttr = 1;
package HNS::Hnf::Command::RLINK;
$Template = qq(<a href="%url%2">%content</a>\n);
$NumAttr = 2;
# overriden AsHTML
package HNS::Hnf::Command::URL;
$Template = qq(<div class="url">
<img alt="*" src="./icons/mark01.png" width="16" height="16">
<a href="%1">%content (%1)</a>
</div>\n);
$NumAttr = 1;
package HNS::Hnf::Command::STRIKE;
$Template = qq(<strike>%content</strike>\n);
package HNS::Hnf::Command::LSTRIKE;
$Template = qq(<strike><a href="%1">%content</a></strike>\n);
$NumAttr = 1;
package HNS::Hnf::Command::STRONG;
$Template = qq(<strong>%content</strong>\n);
package HNS::Hnf::Command::FONT;
$Template = qq(<font %1="%2">%content</font>\n);
$NumAttr = 2;
package HNS::Hnf::Command::IMG;
$Template =
qq(<img %align src="%2" alt="%content" width="%width" height="%height">\n);
$NumAttr = 2;
# overriden AsHTML
package HNS::Hnf::Command::MARK;
$Template = qq(<img src="%src" alt="%1" width="%width" height="%height">\n);
$NumAttr = 1;
# overriden AsHTML
package HNS::Hnf::Command::ALIAS;
$Template = "%term";
# overriden AsHTML
################################################################
# Block Commands
package HNS::Hnf::Command::PRE;
$Template = "<pre>\n";
$EndTemplate = "</pre>\n";
package HNS::Hnf::Command::CITE;
$Template = "<blockquote>\n";
$EndTemplate = "</blockquote>\n";
# $Template = "<div class=cite><blockquote>\n";
# $EndTemplate = "</blockquote></div>\n";
package HNS::Hnf::Command::UL;
$Template = "<ul>\n";
$EndTemplate = qq(</ul>\n);
package HNS::Hnf::Command::OL;
$Template = "<ol>\n";
$EndTemplate = qq(</ol>\n);
package HNS::Hnf::Command::LI;
$Template = q(<li>%content);
$EndTemplate = "</li>\n";
##############################
package HNS::Hnf::Command::DT;
$Template = q(<dt><strong>%content</strong><br>);
$EndTemplate = "</dt>\n";
##############################
package HNS::Hnf::Command::HR;
$Template = q(<hr>\n);
package HNS::Hnf::Command::FN;
$Template =
qq(<a href="$ENV{'REQUEST_URI'}#%name"><small>*%fn</small></a>\n);
$HeaderTemplate = qq(<hr class="section" width="40%" align="left">
<div class="fn">\n);
$FooterTemplate = qq(</div>\n);
$ContentTemplate = qq(
<a class="hide" name="%name" href="%href"><small>*%fn</small></a>: %content<br>
);
package HNS::Tools::Title;
$CatTemplate{dynamic} = qq(<h3>%img<a href="title.cgi?%{arg}CAT=%enc_var">%var</a></h3>\n);
$CatLinkTemplate{dynamic} = qq([<a href="title.cgi?%{arg}CAT=%enc_var">%var</a>]);
$CatTemplate{static} = qq(<h3>%img<a href="#%enc_var" name="%enc_var">%var</a></h3>\n);
$CatLinkTemplate{static} = qq([<a href="tc%year%month.html#%enc_var">%var</a>]);
$HeadTitle = qq(<title>$HNS::System::Title Title List</title>\n);
# $Header = qq(<h1><a href="$HNS::System::MyDiaryURI">$HNS::System::Title</a> Title List</h1>\n);
$Header{dynamic} = qq(<h1><a href="$HNS::System::MyDiaryURI">$HNS::System::Title</a> Title List</h1>\n);
$Header{static} = qq(<h1><a href="./recent.html">$HNS::System::Title</a> Title List</h1>\n);
# $BacktoDiary = qq(<div align="right"><a href="$HNS::System::MyDiaryURI">Back to Diary</a></div>\n);
$BacktoDiary{dynamic} = qq(<div align="right"><a href="$HNS::System::MyDiaryURI">Back to Diary</a></div>\n);
$BacktoDiary{static} = qq(<div align="right"><a href="./recent.html">Back to Diary</a></div>\n);
package HNS::Tools::Title::Hnf;
$BaseTemplate{dynamic} = "$HNS::System::MyDiaryURI?%year%month%abc";
$BaseTemplate{static} = "./%year%month.html";
package HNS::Tools::HeadLine;
$Max = $HNS::System::DefaultMax * 3;
$HeadTitle = qq(<title>$HNS::System::Title HeadLine</title>\n);
$Header = "";
$BacktoDiary = "";
$BaseTemplate{dynamic} = "$HNS::System::MyDiaryURI?%year%month%abc";
$BaseTemplate{static} = "./%year%month.html";
$RecentBaseTemplate{dynamic} = "$HNS::System::MyDiaryURI";
$RecentBaseTemplate{static} = "./recent.html";
$DayTemplate = qq(<strong><a href="%href" class="hide">%year年%month月%day日</a></strong>);
# $DayTemplate{dynamic} = qq(<strong><a href="%href" class="hide" target="diary>"%year年%month月%day日</a></strong>);
# $DayTemplate{static} = qq(<strong><a href="%href" class="hide" target="diary">%year年%month月%day日</a></strong>);
package HNS::Tools::HeadLine::New;
# $Template = qq(<b>・</b><a href="%href" title="%para">%content</a>);
$Template{dynamic} = qq(<b>・</b><a href="%href" class="index" target="diary" title="%para">%content</a>);
$Template{static} = qq(<b>・</b><a href="%href" class="index" target="diary" title="%para">%content</a>);
###############################################################
################################################################
### Patch for Command.pm
################################################################
package HNS::Hnf::Command::New;;
$AllowCommands = [ $HNS::Hnf::Command::New::AllowCommands,
'TABLE','TAG'];
package HNS::Hnf::Command::Sub;
$AllowCommands = [ $HNS::Hnf::Command::Sub::AllowCommands,
'TABLE','TAG'];
package HNS::Hnf::Command::LI;
$AllowCommands = [ $HNS::Hnf::Command::LI::AllowCommands,
'TABLE','TAG'];
# P command
# package HNS::Hnf::Command::P;
# use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
# $CountName $OmittableEnd);
# use vars qw($BaseTemplate $NameTemplate $HrefTemplate
# %BaseTemplate %NameTemplate %HrefTemplate); # HNS::Diary::Template
# @ISA = qw(HNS::Hnf::Command::ConvTemplate HNS::Hnf::Command::Block);
# $NameTemplate = "%year%month%day%{new}P%p";
# $AllowCommands = [$HNS::Hnf::Command::Entities{'Inline'},'RED','GREEN'];
# $OmittableEnd = 1; # or 0
# $Template = qq(
# <p><a name='%name' title='%name' href='%href'>. </a> );
# $EndTemplate = "</p><!-- end of P -->\n";
# $CountName = 'p'; #added
#
###################################################
# Table Commands
# TABLE
package HNS::Hnf::Command::TABLE;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd);
@ISA = qw(HNS::Hnf::Command::List);
$Template = qq(<table %align width="%2" border="1"><caption><strong>%content</strong></caption>\n);
$EndTemplate = "</table>\n";
$AllowCommands = ['TR', 'TD', 'TH'];
$NumAttr = 2;
sub AsHTML ($$$)
{
my ($self, $start, $params) = @_;
my %loc = (r=>'align="right"', c=>'align="center"', l=>'align="left"' , n=>'' );
my $align = $loc{$self->{attr}->[1]};
$params->{align} = $align;
return $self->SUPER::AsHTML($start, $params);
}
# TR
package HNS::Hnf::Command::TR;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd);
@ISA = qw(HNS::Hnf::Command::List);
$Template = q(<tr %content>);
$EndTemplate = "</tr>\n";
$OmittableEnd = 1;
# $AllowCommands = [$HNS::Hnf::Command::Entities{'Inline'}];
$AllowCommands = [$HNS::Hnf::Command::Entities{'Flow'}];
$AllowCommands = ['TD','TH'];
# TD
package HNS::Hnf::Command::TD;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd);
@ISA = qw(HNS::Hnf::Command::Block);
$Template = q(<td>%content);
$EndTemplate = "</td>";
$OmittableEnd = 1;
$AllowCommands = [$HNS::Hnf::Command::Entities{'Flow'}];
# TH
package HNS::Hnf::Command::TH;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd);
@ISA = qw(HNS::Hnf::Command::Block);
$Template = q(<th>%content);
$EndTemplate = "</th>";
$OmittableEnd = 1;
$AllowCommands = [$HNS::Hnf::Command::Entities{'Flow'}];
# TAG
package HNS::Hnf::Command::TAG;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd);
@ISA = qw(HNS::Hnf::Command::Inline);
$AllowCommands = [''];
$Template = "%term";
$OmittableEnd = 1;
sub AsHTML ($$$)
{
my ($self, $start, $params) = @_;
my $term = $self->{arg_content};
$term =~ s/&/&/g;
$term =~ s/</</g;
$term =~ s/>/>/g;
$params->{term} = $term;
$self->SUPER::AsHTML($start, $params);
}
## # RAW
## package HNS::Hnf::Command::RAW;
## use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
## $IsBeginSection $CountName $OmittableEnd);
## @ISA = qw(HNS::Hnf::Command::Block);
## $AllowCommands = [''];
## $Template = "<!--RAW START-->\n%content";
## $EndTemplate = "<!--RAW END-->";
## $OmittableEnd = 1;
# RAW
package HNS::Hnf::Command::RAW;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd);
@ISA = qw(HNS::Hnf::Command::Block);
$AllowCommands = [''];
$Template = "<!--RAW START-->\n%content";
$EndTemplate = "<!--RAW END-->";
$OmittableEnd = 1;
## ################################################################
## ### Patch for Diary.pm
## ################################################################
## package HNS::Diary;
## use vars qw($RawMode); # added
## $RawMode = 0; ### [0:Normal 1:RAW] # added
##
## use vars qw($RTMode @RTBuf);
## $RTMode = 0; ### [0:Normal 1:Push 2:Convert]
## @RTBuf = ();
##
## sub HnfPrint ($){
## my $hnf_ = shift;
##
## ### RAW
## if( $hnf_ =~ /^<\!--RAW START-->/ ) { $RawMode = 1;}
## if( $hnf_ =~ /^<\!--RAW END-->/ ) { $RawMode = 0;}
## if( $RawMode == 1 ){
## $hnf_ =~ s/&/&/g;
## $hnf_ =~ s/</</g;
## $hnf_ =~ s/>/>/g;
## }
## ### \& で & を表示
## $hnf_ =~ s/\\&/&/g;
##
## ### RT
## if( $hnf_ =~ /^<\!--RT START-->/ ) { $RTMode = 1; @RTBuf=(); return; }
## if( $hnf_ =~ /^<\!--RT END-->/ ) { $RTMode = 2; }
## if( $RTMode == 1 ) {
## push(@RTBuf, $hnf_);
## return;
## } elsif( $RTMode == 2 ){
## if($HNS::Status->style_type =~ /NoTable/i){
## $hnf_ = "<pre>\n";
## $hnf_ .= join("",@RTBuf);
## $hnf_ .= "</pre>\n";
## } else {
## $hnf_ = HNS::Hnf::Command::RT::rt2html(@RTBuf);
## }
## $RTMode = 0;
## }
##
## if ($HNS::System::Caching) {
## print X $hnf_;
## }
## else {
## $HNS::Diary::Hnf .= $hnf_;
## }
## }
################################################################
### Patch for Table.pm
################################################################
package HNS::Calendar::Table;
sub AsHTML ($$$$)
{
my ($self, $year, $month, $col) = @_;
($year, $month) = (sprintf("%04d", $year), sprintf("%02d", $month));
my $html;
my $templ = new HNS::Template;
#-- today
my $today = new DateTime::Date;
$today->year($HNS::Status->start_time->year);
$today->month($HNS::Status->start_time->month);
$today->day($HNS::Status->start_time->day);
# table start
$html .= qq(<table class="calendar" border="$TableBorder" summary="calendar">\n); # modified
# $html .= qq(<table class="calendar" border="$TableBorder" summary="calendar" cellspacing="1" cellpadding="3" >\n); # modified
# month
my $date = new DateTime::Date(year=>$year, month=>$month, day=>1);
$html .= "<tr>\n";
# prev
$html .= qq( <th colspan="2" align="left">);
my $prev = ref $col->prev;
if ($prev) {
$html .= $templ->Expand(SelectTemplate($PrevTemplate, %PrevTemplate),
{year=>$col->prev->year,
month=>sprintf("%02d", $col->prev->month)});
}
$html .= "</th>\n";
# this month
$html .= qq( <th colspan="3" align="center">);
$html .= $templ->Expand(SelectTemplate($ThisTemplate, %ThisTemplate),
{year=>$date->year,
month=>sprintf("%02d", $date->month)});
$html .= "</th>\n";
# next
$html .= qq( <th colspan="2" align="right">);
my $next = ref $col->next;
if ($next) {
$html .= $templ->Expand(SelectTemplate($NextTemplate, %NextTemplate),
{year=>$col->next->year,
month=>sprintf("%02d", $col->next->month)});
}
$html .= "</th>\n";
# week
$html .= "</tr>\n<tr>\n";
# for (0..6){
# $html .= " <th align=\"center\">" .
# # $DateTime::Date::WeekString{uc($WeekStringType)}->[$_] .
# $WeekString[$_] .
# "</th>\n";
# }
###############################################
# $html .= " <th align=\"center\" width='2em' class='sunday'>" . $WeekString[0] . "</th>\n";
# for (1..5){
# $html .= " <th align=\"center\" width='2em' class='weekday'>" . $WeekString[$_] . "</th>\n";
# }
# $html .= " <th align=\"center\" width='2em' class='satday'>" . $WeekString[6] . "</th>\n";
$html .= " <th align=\"center\" class='sunday'>" . $WeekString[0] . "</th>\n";
for (1..5){
$html .= " <th align=\"center\" class='weekday'>" . $WeekString[$_] . "</th>\n";
}
$html .= " <th align=\"center\" class='satday'>" . $WeekString[6] . "</th>\n";
###############################################
# day
# null space
my $start_week = $date->week;
if ($start_week){
$html .= "</tr>\n<tr>\n";
}
my $day = 1;
for my $i (1..$start_week){
# $html .= " <td></td>";
###############################################
if ($i == 1){
$html .= " <td class='sunday'></td>";
}
else {
$html .= " <td></td>";
}
###############################################
}
$html .= "\n";
# 1..31
for $day (1..$date->DaysMonth){
if (($day+$start_week)%7-1 == 0){
$html .= qq(</tr>\n<tr>\n);
}
# $html .= qq( <td align="right">);
###############################################
if (($day == $today->day)&&($date->month == $today->month)&&($date->year == $today->year)){
$html .= qq( <td align="right" class='today'>);
}else{
if (($day+$start_week)%7 == 1){
$html .= qq( <td align="right" class='sunday'>);
}
elsif (($day+$start_week)%7 == 0){
$html .= qq( <td align="right" class='satday'>);
}
else {
$html .= qq( <td align="right">);
}
}
###############################################
my $ymd = sprintf("%04d%02d%02d", $year, $month, $day);
if ($col->diarys->{$ymd}){
my $high = int($day/10);
my $abc;
if ($day < 11) {
$abc = "a";
}
elsif ($day < 21) {
$abc = "b";
}
else {
$abc = "c";
}
if ($col->diarys->{$ymd}->read_done){
# $html .= sprintf($DayCurrentTemplate,
# $ENV{'REQUEST_URI'},
# $year, $month, $day, $day);
$html .= $templ->Expand(SelectTemplate($DayCurrentTemplate,
%DayCurrentTemplate),
{ruri=>$ENV{'REQUEST_URI'}, year=>$year,
month=>$month, day=>$day, ymd=>$ymd});
} else {
# $html .= sprintf($DayNonCurrentTemplate,
# $year, $month, $high,
# $year, $month, $day, $day);
my $params = {year=>$year, month=>$month, high=>$high,
abc=>$abc, day=>$day, ymd=>$ymd};
$self->ExpandTempl($templ, $params);
$html .= $templ->Expand($DayNonCurrentTemplate, $params);
}
} else {
$html .= qq($day);
}
$html .= qq(</td>\n);
}
$html .= qq(</tr>\n</table>);
}
################################################################
package HNS::Hnf::Command::New;;
$AllowCommands = [ $HNS::Hnf::Command::New::AllowCommands,
'RED','GREEN','ISUB','URI'];
package HNS::Hnf::Command::Sub;
$AllowCommands = [ $HNS::Hnf::Command::Sub::AllowCommands,
'RED','GREEN','ISUB','URI'];
package HNS::Hnf::Command::LI;
$AllowCommands = [ $HNS::Hnf::Command::LI::AllowCommands,
'RED','GREEN','ISUB','URI'];
# package HNS::Hnf::Command::Inline;
# $AllowCommands = [$HNS::Hnf::Command::Entities{'Inline'},'RED','GREEN'];
# RED
package HNS::Hnf::Command::RED;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd);
@ISA = qw(HNS::Hnf::Command::Decoration);
$Template = qq(<font %1="%2" color="red">%content</font>\n);
$NumAttr = 2;
# GREEN
package HNS::Hnf::Command::GREEN;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd);
@ISA = qw(HNS::Hnf::Command::Decoration);
$Template = qq(<font %1="%2" color="green">%content</font>\n);
$NumAttr = 2;
################################################################
# ISUB
package HNS::Hnf::Command::ISUB;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd);
@ISA = qw(HNS::Hnf::Command::Sub);
$Template = qq(
<a class="hide" name="%name" title="%name" href="%href">@</a>
<strong>%content</strong>: );
################################################################
package HNS::Hnf::Command::URI;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd);
@ISA = qw(HNS::Hnf::Command::URL);
$Template = qq(<div class="url">
<img alt="*" src="./icons/mark01.png" width="16" height="16">
<a href="%1">%content</a>
</div>\n);
$NumAttr = 1;
################################################################
### Append AllowCommands
package HNS::Hnf::Command::New;
$AllowCommands = [ $HNS::Hnf::Command::New::AllowCommands,'ISBN','CD'];
package HNS::Hnf::Command::Sub;
$AllowCommands = [ $HNS::Hnf::Command::Sub::AllowCommands,'ISBN','CD'];
package HNS::Hnf::Command::LI;
$AllowCommands = [ $HNS::Hnf::Command::LI::AllowCommands,'ISBN','CD'];
################################################################
### ISBN
package HNS::Hnf::Command::ISBN;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd
$ContentTemplate $Separator @Stores );
@ISA = qw(HNS::Hnf::Command::Inline);
$AllowCommands = [$HNS::Hnf::Command::Entities{'Inline'}];
$NumAttr = 1;
$Template = qq(<strong> %content </strong><span class="isbn">[ISBN%code: %stores]</span>);
$EndTemplate = qq(<br>\n);
$ContentTemplate = qq(<a href="%url">%name</a>);
$Separator = "/";
@Stores = ({'name'=>'eS',
'url'=> qq(http://www.eshopping.ne.jp/bks.svl?CID=BKS504&access_method=isbn_cd&input_data=%code)},
{'name'=>'bk',
'url'=> qq(http://www.bk1.co.jp/cgi-bin/srch/srch_result_book.cgi?idx=3&isbn=%code)},
{'name'=>'IS',
'url'=> qq(http://www.isize.com/book/cgi-bin/isbn.cgi?isbn=%code)},
{'name'=>'旭',
'url'=> qq(http://www.netdirect.co.jp/search/ISSSchDetail.asp?ISBN=%code_no_bar)},
{'name'=>'JB',
'url'=> qq(http://www.jbook.co.jp/product.asp?isbn=%code_no_bar)},
{'name'=>'BO',
'url' => qq(http://www.jp.bol.com/cec/cstage?ecaction=bcssearch&query_type=BS_ISBN&isbn=%code_no_bar)},
{'name'=>'紀',
'url'=> qq(http://bookweb.kinokuniya.co.jp/guest/cgi-bin/wshosea.cgi?W-ISBN=%code_no_bar)},
{'name'=>'AM',
'url'=> qq(http://www.amazon.co.jp/exec/obidos/ASIN/%code_no_bar)},
{'name'=>'富',
'url'=> qq(http://www.fujisan.com/online/Jsearch?key=productcode&value=%code_no_bar)},
{'name'=>'本',
'url'=> qq(http://www1.honyasan.co.jp/washo/book.cfm?PRODUCT_CD=%code)});
sub AsHTML($$$)
{
my ($self, $start, $params) = @_;
my $code = $self->{attr}->[1];
my $code_no_bar = $code;
$code_no_bar =~ s/\-//g;
my $templ = new HNS::Template;
my @contents;
for (@Stores){
my $name = $_->{'name'};
my $url = $_->{'url'};
my $tmp_params;
$tmp_params->{url} = $templ->Expand($url, {'code'=>$code,
'code_no_bar'=>$code_no_bar});
$tmp_params->{name} = $name;
push(@contents, $templ->Expand($ContentTemplate, $tmp_params));
}
$params->{stores} = join($Separator, @contents);
$params->{code} = $code;
return $self->SUPER::AsHTML($start, $params);
}
################################################################
### CD
package HNS::Hnf::Command::CD;
use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
$IsBeginSection $CountName $OmittableEnd
$ContentTemplate $Separator @Stores );
@ISA = qw(HNS::Hnf::Command::Inline);
$AllowCommands = [$HNS::Hnf::Command::Entities{'Inline'}];
$NumAttr = 1;
$Template = qq(<strong> %content </strong><span class="cd">[%code: %stores]</span>);
$EndTemplate = qq(<br>\n);
$ContentTemplate = qq(<a href="%url">%name</a>);
$Separator = "/";
@Stores = ({'name'=>'hm',
'url'=> qq(http://www.hmv.co.jp/search/title.asp?category=CATALOGUENO&keyword=%code)},
{'name'=>'To',
'url'=> qq(http://www.towerrecords.co.jp/tower/towercdj.nsf/SearchProductID/%code)},
{'name'=>'旭',
'url'=> qq(http://www.netdirect.co.jp/search/ISSSchDetail.asp?ISBN=%code_no_bar)},
{'name'=>'JB',
'url'=> qq(http://sea.jbook.co.jp/search97cgi/s97_cgi.exe?Action=Search&ResultTemplate=search_result_40.hts&QueryText=%28%28+%code+%29%3cIN%3etext_area%29+and+sale_status_asc_all)},
{'name'=>'新',
'url'=> qq(https://cd2.shinseido.co.jp/cgi-bin/ehsql_select/ec/slist10.ehtml?eh-dbase=ecdb&eh-table=product&eh-key-attribute=pro_no&pro_recno=%code)} );
sub AsHTML($$$)
{
my ($self, $start, $params) = @_;
my $code = $self->{attr}->[1];
my $code_no_bar = $code;
$code_no_bar =~ s/\-//g;
my $templ = new HNS::Template;
my @contents;
for (@Stores){
my $name = $_->{'name'};
my $url = $_->{'url'};
my $tmp_params;
$tmp_params->{url} = $templ->Expand($url, {'code'=>$code,
'code_no_bar'=>$code_no_bar});
$tmp_params->{name} = $name;
push(@contents, $templ->Expand($ContentTemplate, $tmp_params));
}
$params->{stores} = join($Separator, @contents);
$params->{code} = $code;
return $self->SUPER::AsHTML($start, $params);
}
################################################################
package HNS::Hnf::Command::ISBN;
$Template = qq(<strong> %content </strong>
<nobr><span class="isbn">[ISBN%code: %stores]</span></nobr>
);
package HNS::Hnf::Command::CD;
$Template = qq(<strong> %content </strong>
<nobr><span class="cd">[%code: %stores]</span></nobr>
);
## ################################################################
## package HNS::Hnf::Command::New;;
## $AllowCommands = [ $HNS::Hnf::Command::New::AllowCommands,'RT'];
##
## package HNS::Hnf::Command::Sub;
## $AllowCommands = [ $HNS::Hnf::Command::Sub::AllowCommands,'RT'];
##
## ################################################################
## ### RT
## package HNS::Hnf::Command::RT;
## use vars qw(@ISA $Template $EndTemplate $NumAttr $IsOneline $AllowCommands
## $IsBeginSection $CountName $OmittableEnd);
## @ISA = qw(HNS::Hnf::Command::Cite);
## $AllowCommands = [''];
## $Template = "<!--RT START-->\n";
## $EndTemplate = "<!--RT END-->\n";
## $OmittableEnd = 1;
##
##
##
## sub rt2html(@){
##
## my @lines = @_;
##
## my @value_align=("left", "center", "right");
## my $caption = "";
## my $delimiter = ",\t"; # デリミタ
##
## my $tbl_width = 1;
## my $tbl_height = 0;
## my $tbl_header = -1; # THEAD領域の行数
## my $tbl_body = -1; # TBODY領域の行数
##
## my %style_table; # <TABLE> 追加属性
## my %style_thead; # <THEAD> 追加属性
## my %style_tindex; # <TBODY> 追加属性(見出し部)
## my %style_tbody; # <TBODY> 追加属性(本体)
##
## my $theme = 0;
## my $status = 0; # 0:config 1:head&body 2:body
## my $x;
## my $y;
## my $line;
##
## ### default
## $style_table{'border'} = 1;
##
## ### read
## foreach $line (@lines){
## # print " LINE=",$line,"<br>";
## if( $line =~ /^#/ ){
## next;
## }
## if( $status == 0 ){ # ConfigBlock
## if( $line =~ /^\s*caption\s*=\s*(.*)\s*$/i ){
## $caption = $1;
## next;
## }
## if( $line =~ /^\s*delimiter\s*=\s*(.*)\s*$/i ){
## $delimiter = $1;
## next;
## }
## if( $line =~ /^\s*(table|thead|tindex|tbody)_(\w+)\s*=\s*(\w+)\s*/i ){
## my $type = $1;
## my $key = $2;
## my $value = $3;
## if( $type =~ /table/ ){ $style_table{$key} = $value;}
## if( $type =~ /thead/ ){ $style_thead{$key} = $value;}
## if( $type =~ /tindex/){ $style_tindex{$key}= $value;}
## if( $type =~ /tbody/ ){ $style_tbody{$key} = $value;}
## next;
## }
## if( $line =~ /^\s*theme\s*=\s*(\d+)\s*$/i ){
## $theme = $1;
## next;
## }
## }
##
## if( $line =~ /^\s*\n$/ ){
## if( $status == 1 ){
## $status = 2; # thead と tbody が存在する表である
## $tbl_header = $tbl_height;
## }
## next;
## }
##
## if( $status == 0 ){ $status = 1; }
## # デリミタとその前後の空白がセパレータとなる
## my @items = split(/\s*[$delimiter]\s*/, $line);
## my $w = @items; # 配列の個数
## if( $w >= $tbl_width ){
## $tbl_width = $w;
## }
## if( $w == $tbl_width ){
## my $x = 0;
## my $item;
## foreach $item (@items){
## my $align; # 0:left 1:center 2:right
## $item =~ s/^(\s*)//g;
## $item =~ s/(\s*)$//g;
## if( $item =~ /^[0-9]+.?[0-9]*/ ){
## $align = 2; # 数字は右詰め
## } else {
## $align = 0; # 他は左詰め
## }
## $tbl_item[$x][$tbl_height] = $item;
## $tbl_align[$x][$tbl_height]= $align; # align
## $tbl_col[$x][$tbl_height] = 1; # clospan
## $tbl_row[$x][$tbl_height] = 1; # rowspan
## $x++;
## }
## $tbl_height++;
## }
##
## }
## ###
## if( $status == 1 ){
## $tbl_header = 0;
## $tbl_body = $tbl_height;
## } elsif( $status == 2 ){
## $tbl_body = $tbl_height - $tbl_header;
## }
##
## ### parse
## for( $y=$tbl_height-1 ; $y >= 0 ; $y-- ){
## for( $x=$tbl_width-1 ; $x >= 0 ; $x-- ){
## my $tmp = $tbl_item[$x][$y];
## if( $tmp =~ /^\s*==\s*$/ ){
## if( $x > 0 ){
## $tbl_col[$x-1][$y] += $tbl_col[$x][$y]; # 左側のセルに結合(colspan 増加)
## $tbl_col[$x][$y] = 0;
## $tbl_row[$x][$y] = 0; # このセルは消滅するので0を入れておく
## }
## }
## if( $tmp =~ /^\s*\|\|\s*$/ ){
## if( $y > 0 ){
## $tbl_row[$x][$y-1] += $tbl_row[$x][$y]; # 上のセルに結合(rowspan 増加)
## $tbl_row[$x][$y] = 0;
## $tbl_col[$x][$y] = 0; # このセルは消滅するので0を入れておく
## }
## }
## }
## }
##
## # ### debug
## # for( $y=0 ; $y < $tbl_height ; $y++ ){
## # for( $x=0 ; $x < $tbl_width ; $x++ ){
## # printf("(%1d,%1d,%1d) ",$tbl_col[$x][$y] ,$tbl_row[$x][$y] ,$tbl_align[$x][$y] );
## # }
## # print "<br>\n";
## # }
## # print "status=$status<br>\n";
## # print "tbl_height=$tbl_height<br>\n";
## # print "tbl_header=$tbl_header<br>\n";
## # print "tbl_body=$tbl_body<br>\n";
## # print "theme=$theme<br>\n";
## # print "<hr>";
## # while( ($key, $value) = each %style_table ){
## # print "TABLE[",$key,"]=",$value,"<br>\n";
## # }
## # print "<hr>";
## # while( ($key, $value) = each %style_thead ){
## # print "THEAD[",$key,"]=",$value,"<br>\n";
## # }
## # print "<hr>";
## # while( ($key, $value) = each %style_tbody ){
## # print "TBODY[",$key,"]=",$value,"<br>\n";
## # }
## # print "<hr>";
##
## ### generate
## my $hnf_ ="";
## $hnf_ .= "<table";
## while( ($key, $value) = each %style_table ){
## $hnf_ .= " $key='$value'";
## }
## $hnf_ .= ">\n";
## $hnf_ .= "<caption><strong>$caption</strong></caption>\n";
##
## ### <THEAD>
## if( $tbl_header > 0 ){
## $hnf_ .= "<thead";
## while( ($key, $value) = each %style_thead ){
## $hnf_ .= " $key='$value'";
## }
## $hnf_ .= ">\n";
## for( $y=0 ; $y < $tbl_header ; $y++ ){
## $hnf_ .= "<tr>";
## for( $x=0 ; $x < $tbl_width ; $x++ ){
## my $item = $tbl_item[$x][$y];
## my $col = $tbl_col[$x][$y];
## my $row = $tbl_row[$x][$y];
## my $align= 1;
## my $tag = "th";
## if(($col > 0)&&($row > 0)){
## $hnf_ .= sprintf("<%s",$tag);
## $hnf_ .= sprintf(" align='%s'",$value_align[$align]);
## $hnf_ .= sprintf(" colspan='%d'",$col) if $col > 1;
## $hnf_ .= sprintf(" rowspan='%d'",$row) if $row > 1;
## $hnf_ .= sprintf(">%s</%s>",$item,$tag);
## }
## }
## $hnf_ .= "</tr>\n";
## }
## $hnf_ .= "</thead>\n";
## }
##
## ### <TBODY>
## $hnf_ .= "<tbody>";
##
## # 見出し
## $hnf_ .= "<colgroup";
## while( ($key, $value) = each %style_tindex ){
## $hnf_ .= " $key='$value'";
## }
## $hnf_ .= ">\n";
##
## # 本体
## $style_tbody{'span'} = $tbl_width unless exists( $style_tbody{'span'});
## $hnf_ .= "<colgroup";
## while( ($key, $value) = each %style_tbody ){
## $hnf_ .= " $key='$value'";
## }
## $hnf_ .= ">\n";
##
## for( $y=$tbl_header ; $y < $tbl_height ; $y++ ){
## $hnf_ .= "\n";
## $hnf_ .= "<tr>";
## # $hnf_ .= "<tr";
## # $hnf_ .= " bgcolor='$style_tbody{'bgcolor'}'" if exists( $style_tbody{'bgcolor'});
## # $hnf_ .= ">";
## for( $x=0 ; $x < $tbl_width ; $x++ ){
## my $item = $tbl_item[$x][$y];
## my $align= $tbl_align[$x][$y];
## my $col = $tbl_col[$x][$y];
## my $row = $tbl_row[$x][$y];
## my $tag = "td";
## # my $bgcolor ="";
## my $x_strong = 0;
## $x_strong = $style_tindex{'span'} if exists( $style_tindex{'span'});
## if( $x <= ($x_strong - 1) ){
## $tag = "th";
## $align = 1;
## }
## if(($col > 0)&&($row > 0)){
## $hnf_ .= sprintf("<%s",$tag);
## $hnf_ .= sprintf(" align='%s'",$value_align[$align]);
## # $hnf_ .= sprintf(" bgcolor='%s'",$bgcolor) if $bgcolor ne "";
## $hnf_ .= sprintf(" colspan='%d'",$col) if $col > 1;
## $hnf_ .= sprintf(" rowspan='%d'",$row) if $row > 1;
## $hnf_ .= sprintf(">%s</%s>",$item,$tag);
## }
## }
## $hnf_ .= "</tr>\n";
## }
## # $hnf_ .= "</colgroup>\n"; # <colgroup>は閉じないで良いらしい
## $hnf_ .= "</tbody>\n";
## $hnf_ .= "</table>\n";
##
## return $hnf_;
##
## }
## ################################################################
1;