Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ePUB: xhtml conformity also for missa
Browse files Browse the repository at this point in the history
... now rendering on macOS as well
FAJ-Munich committed Oct 15, 2024
1 parent 3ccef18 commit 20487e9
Showing 17 changed files with 239 additions and 116 deletions.
10 changes: 8 additions & 2 deletions standalone/tools/epubgen2/Ehoras.setup
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
$priest='0';;
$building='0';;
$lang1='Latin';;
$psalmvar='0';;
$whitebground='0';;
$blackfont='black';;
$smallblack='82 black';;
@@ -12,13 +13,18 @@ $smallfont='63 red';;
$titlefont='113 red';;
$screenheight='1024';;
$textwidth='80';;
$oldhymns='0';;
$nonumbers='0';;
$nofancychars='0';;
$noinnumbers='1';;
$noflexa='0';;

[parameterscheck]
bbtbtcccccccnn
bbtbbtcccccccnnbbbbb

[general]
$expand='psalms';;
$version='Rubrics 1960';;
$version='Rubrics 1960 - 1960';;
$lang2='English';;
$accented='plain';;

38 changes: 38 additions & 0 deletions standalone/tools/epubgen2/Emissa.setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[parameters]
$pope='(nomen Papae),(name of Pope)';;
$bishop='(nomen Episcopi),(name of Bishop)';;
$lang1='Latin';;
$whitebground='1';;
$blackfont='black';;
$smallblack='82 black';;
$redfont=' italic red';;
$initiale='150 bold italic red';;
$largefont='113 bold italic red';;
$smallfont='63 red';;
$titlefont='113 red';;
$screenheight='1024';;
$textwidth='80';;
$nofancychars='0';;
$building='0';;

[parameterscheck]
ttobcccccccnnbb

[general]
$version='Rubrics 1960 - 1960';;
$lang2='English';;
$votive='Hodie';;
$rubrics='1';;
$solemn='0';;

[generalcheck]
ooobb

[generalc]
$version1='Rubrics 1960 - 1960';;
$version2='New Mass';;
$lang1='Latin';;
$lang2='Latin';;

[generalccheck]
oooo
28 changes: 17 additions & 11 deletions standalone/tools/epubgen2/EofficiumXhtml.pl
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ package main;
#use CGI::Cookie;;
use CGI::Carp qw(fatalsToBrowser);
use File::Basename;
use LWP::Simple;
use Time::Local;

#use DateTime;
@@ -34,9 +33,16 @@ package main;
our $Hk = 0;
our $Ck = 0;
our $officium = 'Eofficium.pl';
our $version = 'Rubrics 1960';
our $version = 'Rubrics 1960 - 1960';

@versions = ('Trident 1570', 'Trident 1910', 'Divino Afflatu', 'Reduced 1955', 'Rubrics 1960', '1960 Newcalendar');
@versions = (
'Trident - 1570',
'Trident - 1910',
'Divino Afflatu - 1954',
'Reduced - 1955',
'Rubrics 1960 - 1960',
'Rubrica 1960 - 2020 USA/Rubrics 1960 Newcalendar'
);

#***common variables arrays and hashes
#filled getweek()
@@ -215,7 +221,7 @@ ()

#setcookies('horasgp', 'general');
}
if (!$version) { $version = 'Rubrics 1960'; }
if (!$version) { $version = 'Rubrics 1960 - 1960'; }
if (!$lang2) { $lang2 = 'English'; }
$only = ($lang1 =~ $lang2) ? 1 : 0;

@@ -311,7 +317,7 @@ ()
<a href="$date1-3-Prima.html">Prima</a>
&nbsp;&nbsp;
<a href="$date1-4-Tertia.html">Tertia</a>
<br />
<br/>
<a href="$date1-5-Sexta.html">Sexta</a>
&nbsp;&nbsp;
<a href="$date1-6-Nona.html">Nona</a>
@@ -335,7 +341,7 @@ ()

if ($linkmissa) {
print << "PrintTag";
<br />
<br/>
<a href="$date1-9-Missa.html">Missa</a>
PrintTag
}
@@ -374,9 +380,9 @@ sub headline {
}

print << "PrintTag";
<p class="cen"><span class="$daycolorclass">$headline<br /></span>
$comment<br /><br />
<span class="c">$h</span>&nbsp;&nbsp;&nbsp;
<p class="cen"><span class="$daycolorclass">$headline<br/></span>
$comment<br/><br/>
<span class="c">$h</span>&ensp;
<a href="$datep-1-Matutinum.html">&darr;</a>
$date1
<a href="$daten-1-Matutinum.html">&uarr;</a>
@@ -389,7 +395,7 @@ sub headline {
<a href="$date1-3-Prima.html">Prima</a>
&nbsp;&nbsp;
<a href="$date1-4-Tertia.html">Tertia</a>
<br />
<br/>
<a href="$date1-5-Sexta.html">Sexta</a>
&nbsp;&nbsp;
<a href="$date1-6-Nona.html">Nona</a>
@@ -401,7 +407,7 @@ sub headline {

if ($linkmissa) {
print << "PrintTag";
<br />
<br/>
<a href="$date1-9-Missa.html">Missa</a>
PrintTag
}
12 changes: 6 additions & 6 deletions standalone/tools/epubgen2/Ewebdia.pl
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ sub setup {

if ($parmode[$i] =~ /^label/i) {
my $ilabel = $parvalue[$i];
if ($parpar[$i]) { $ilabel = wrap($ilabel, $parpar[$i], "<BR />\n"); }
if ($parpar[$i]) { $ilabel = wrap($ilabel, $parpar[$i], "<br/>\n"); }
$input .= "$ilabel";
$input .= "<INPUT TYPE=HIDDEN NAME=\'I$k\' VALUE=\'$parvalue[$i]\'>\n";

@@ -157,7 +157,7 @@ sub setup {
do_write("$datafolder/gen/$savefile.gen", $pv);
}

$input .= "<TEXTAREA NAME=\'I$k\' ID=\'I$k\' COLS=$size[1] ROWS=$size[0]>$pv</TEXTAREA><BR />\n";
$input .= "<TEXTAREA NAME=\'I$k\' ID=\'I$k\' COLS=$size[1] ROWS=$size[0]>$pv</TEXTAREA><br/>\n";
$input .= "<A HREF='#' onclick='loadrut();'>";
$input .= setfont($dialogfont) . "Load</FONT></A>";

@@ -444,7 +444,7 @@ sub setvrbar {
# #remove auxiliary characters
# $text =~ s/wait[0-9]+//ig;
# $text =~ s/\_/ /g;
# $text =~ s/\{\:.*?\:\}(<BR />)*\s*//g;
# $text =~ s/\{\:.*?\:\}(<br/>)*\s*//g;
# $text =~ s/\{\:.*?\:\}//sg;
# $text =~ s/\`//g;
#
@@ -496,7 +496,7 @@ sub setvrbar {
# #$htmltext .= setfont($blackfont,$text) . "</DIV>\n";
# #if ($only || !columnsel($lang)) {$htmltext .= "</DIV>\n";}
#
# $text =~ s/<BR>/<br \/>/sg;
# $text =~ s/<BR>/<br\/>/sg;
#
# #$text =~ s/\n//g;
# print $text;
@@ -542,8 +542,8 @@ sub longtd {
my $a1 = shift;
my $a2 = shift;

my @a1 = split('<BR />', $a1);
my @a2 = split('<BR />', $a2);
my @a1 = split('<br/>', $a1);
my @a2 = split('<br/>', $a2);
my @b1 = splice(@b1, @b1);
my @b2 = splice(@b2, @b2);
my $i;
38 changes: 19 additions & 19 deletions standalone/tools/epubgen2/epubgen2.sh
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ OPTIONS:
-m Generate Mass propers in addition to office texts.
-r RUBRICS The rubrics to use. Defaults to 1960.
Supported values are: 1570, 1910, DA, 1955, 1960, Newcal, Dominican, Monastic
Supported values are: 1570, 1910, DA, 1955, 1960, Newcal, Dominican
-c FILENAME The cover image to use without path. It must be a file in the data
directory. Defaults to "cover.jpg".
@@ -66,16 +66,16 @@ CDUR=$(pwd)
EPUBDIR=$CDUR/output #output directory, defaults to "output" subdirectory in the folder this script is in.
COVER_FILENAME=cover.jpg #a jpg file name to serve as cover (it has to exist in SOURCEDATADIR) #ascensio.jpg
RUBRICS_CODE=1960
RUBRICS=Rubrics%201960
RUBRICS=Rubrics%201960%20%2D%201960
RUBRICS_NAME=
NOFANCYCHARS=1 #0 or 1; when 1, "fancy" characters such as ℟ ℣ +︎ ✠ ✙︎ are replaced with R. V. + + +
OPTIONAL_KINDLEGEN_PATH=/usr/local/bin/kindlegen #full path to kindlegen executable, if exists, used to convert the resulting EPUB files to MOBI format as well

#constants
#supported rubrics as in Eofficium.pl
ALL_RUBRICS_CODES=(Monastic 1570 1910 DA 1955 1960 Newcal Dominican)
ALL_RUBRICS=("Monastic" "Tridentine 1570" "Tridentine 1910" "Divino Afflatu" "Reduced 1955" "Rubrics 1960" "1960 Newcalendar" "Ordo Praedicatorum")
ALL_RUBRICS_NAME=("_Monastic" "_1570" "_1910" "_DA" "_1955" "" "NC")
ALL_RUBRICS_CODES=(1570 1910 DA 1955 1960 Newcal Dominican)
ALL_RUBRICS=("Tridentine - 1570" "Tridentine - 1910" "Divino Afflatu - 1954" "Reduced - 1955" "Rubrics 1960 - 1960" "Rubrics 1960 - 2020 USA" "Ordo Praedicatorum - 1962")
ALL_RUBRICS_NAME=("_1570" "_1910" "_DA" "_1955" "" "NC" "OP")

YEAR_RE='^[0-9]+$'

@@ -317,10 +317,10 @@ generateHour() {
}

generateHours() {
echo -e "\e[1m:: Starting to generate hours\e[0m"
echo -e "\033[1m:: Starting to generate hours\033[0m"
foreachHourInRange generateHour
echo ""
echo -e "\e[1m:: Finished the generation of hours\e[0m"
echo -e "\033[1m:: Finished the generation of hours\033[0m"
}


@@ -385,15 +385,15 @@ outputYearToFile() {


generateTOCs() {
echo -e "\e[1m:: Starting to create TOCs\e[0m"
echo -e "\033[1m:: Starting to create TOCs\033[0m"

#generate OPF per month
foreachMonthInRange outputMonthToFile

#generate OPF per year
foreachYear outputYearToFile

echo -e "\e[1m:: Finished the creating of TOCs\e[0m"
echo -e "\033[1m:: Finished the creating of TOCs\033[0m"
}

#################################################################################################################
@@ -423,7 +423,7 @@ printf '<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="uuid_id" version="2.0">
<metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:calibre="http://calibre.kovidgoyal.net/2009/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/">
<meta name="cover" content="cover"/><dc:date>'
date --iso-8601
date +"%Y-%m-%dT%H:%M:%S:%z"
printf "</dc:date><dc:title>Breviarium $1</dc:title>
<dc:creator>Divinum Officium</dc:creator>
<dc:publisher></dc:publisher>
@@ -491,15 +491,15 @@ outputYearToFileOPF() {
}

generateOPF() {
echo -e "\e[1m:: Starting to create OPFs\e[0m"
echo -e "\033[1m:: Starting to create OPFs\033[0m"

#generate OPF per month
foreachMonthInRange outputMonthToFileOPF

#generate OPF per year
foreachYear outputYearToFileOPF

echo -e "\e[1m:: Finished the creating of OPFs\e[0m"
echo -e "\033[1m:: Finished the creating of OPFs\033[0m"
}

#Expects OPF_FILENAME to be set.
@@ -679,11 +679,11 @@ createEPUBYear() {
}

createEPUBs() {
echo -e "\e[1m:: Starting to create EPUBs for each month\e[0m"
echo -e "\033[1m:: Starting to create EPUBs for each month\033[0m"
foreachMonthInRange createEPUBMonth
echo -e "\e[1m:: Starting to create EPUBs for each year\e[0m"
echo -e "\033[1m:: Starting to create EPUBs for each year\033[0m"
foreachYear createEPUBYear
echo -e "\e[1m:: Finished the creation of EPUBs\e[0m"
echo -e "\033[1m:: Finished the creation of EPUBs\033[0m"
}


@@ -704,13 +704,13 @@ convertMOBIYear() {
createMOBIs() {
if [[ ! -e "$OPTIONAL_KINDLEGEN_PATH" ]]
then
echo "\e[1m:: KindleGen not found in $OPTIONAL_KINDLEGEN_PATH, skipping the conversion to of MOBI format. \e[0m"
echo "\033[1m:: KindleGen not found in $OPTIONAL_KINDLEGEN_PATH, skipping the conversion to of MOBI format. \033[0m"
else
echo -e "\e[1m:: Starting the conversion to MOBI format for each month\e[0m"
echo -e "\033[1m:: Starting the conversion to MOBI format for each month\033[0m"
foreachMonthInRange convertMOBIMonth
echo -e "\e[1m:: Starting the conversion to MOBI format for each year\e[0m"
echo -e "\033[1m:: Starting the conversion to MOBI format for each year\033[0m"
foreachYear convertMOBIYear
echo -e "\e[1m:: Finished the conversion to MOBI format\e[0m"
echo -e "\033[1m:: Finished the conversion to MOBI format\033[0m"
fi
}

8 changes: 5 additions & 3 deletions web/cgi-bin/DivinumOfficium/RunTimeOptions.pm
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ use constant LEGACY_VERSION_NAMES => {
'Monastic' => 'Monastic - 1963',
'1960 Newcalendar' => 'Rubrics 1960 - 2020 USA',
'Dominican' => 'Ordo Praedicatorum - 1962',

# safeguard switch from missa to horas
'Tridentine - 1910' => 'Tridentine - 1906',
'Ordo Praedicatorum Dominican 1962' => 'Ordo Praedicatorum - 1962',
@@ -52,6 +53,7 @@ use constant LEGACY_MISSA_VERSION_NAMES => {
'Reduced 1955' => 'Reduced - 1955',
'1960 Newcalendar' => 'Rubrics 1960 - 2020 USA',
'Dominican' => 'Ordo Praedicatorum Dominican 1962',

# safeguard switch from horas to missa
'Monastic Tridentinum 1617' => 'Tridentine - 1570',
'Monastic Divino 1930' => 'Divino Afflatu - 1954',
@@ -60,16 +62,16 @@ use constant LEGACY_MISSA_VERSION_NAMES => {
'Tridentine - 1906' => 'Tridentine - 1910',
'Ordo Praedicatorum - 1962' => 'Ordo Praedicatorum Dominican 1962',
};

# exported

sub check_version {
my $v = shift;
my $missa = shift;

if (!$missa) {
return LEGACY_VERSION_NAMES->{$v} || unequivocal($v, 'versions');
}
else {
} else {
return LEGACY_MISSA_VERSION_NAMES->{$v} || unequivocal($v, 'versions');
}
}
6 changes: 3 additions & 3 deletions web/cgi-bin/horas/horas.pl
Original file line number Diff line number Diff line change
@@ -175,11 +175,11 @@ sub resolve_refs {

# Concatenate the expansions of the lines with a line break between each.
push @resolved_lines, '';
my $resolved_block = join "<BR />\n", @resolved_lines;
my $resolved_block = join "<br/>\n", @resolved_lines;

#removes occasional double linebreaks
$resolved_block =~ s/<BR \/>\s*<BR \/>/<BR \/>/g;
$resolved_block =~ s/<\/P>\s*<BR \/>/<\/P>/g;
$resolved_block =~ s/<br\/>\s*<br\/>/<br\/>/ig;
$resolved_block =~ s/<\/P>\s*<br\/>/<\/P>/ig;
return $resolved_block;
}

30 changes: 15 additions & 15 deletions web/cgi-bin/horas/horascommon.pl
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@

sub error {
my $t = shift;
our $error .= "= $t =<br />";
our $error .= "= $t =<br/>";
}

sub occurrence {
@@ -777,7 +777,7 @@ sub concurrence {
&& $version !~ /1955|196/)
{
$vespera = 3;
$dayname[2] = $tomorrowname[2] . "<br />Vespera de Officium occurente, Commemoratio Sanctorum tantum";
$dayname[2] = $tomorrowname[2] . "<br/>Vespera de Officium occurente, Commemoratio Sanctorum tantum";
$cwrank = '';
$ctname = '';
%cwinner = undef;
@@ -789,7 +789,7 @@ sub concurrence {
&& $version !~ /1955|196/)
{
$vespera = 3;
$dayname[2] .= "<br />Vespera de Officium occurente; nihil de sequenti";
$dayname[2] .= "<br/>Vespera de Officium occurente; nihil de sequenti";
$cwrank = '';
$csname = '';
%cwinner = undef;
@@ -801,7 +801,7 @@ sub concurrence {
} else {
$vespera = 3;
$dayname[2] = '' unless $dayname[2] =~ /Dominica|Advent|Quadr|Pass/i;
$dayname[2] .= "<br />Vespera de Officium occurente " unless $version =~ /1955|196/;
$dayname[2] .= "<br/>Vespera de Officium occurente " unless $version =~ /1955|196/;
$cwrank = '';
$ctname = '';
%cwinner = undef;
@@ -821,9 +821,9 @@ sub concurrence {
$winner = $cwinner;

if ($crank < 7 && $comrank >= $ccomrank && $comrank > 2) {
$tomorrowname[2] = $dayname[2] .= "<br />Vespera de sequenti; nihil de præcedenti (tempora)";
$tomorrowname[2] = $dayname[2] .= "<br/>Vespera de sequenti; nihil de præcedenti (tempora)";
} else {
$tomorrowname[2] .= "<br />Vespera de sequenti; nihil de præcedenti";
$tomorrowname[2] .= "<br/>Vespera de sequenti; nihil de præcedenti";
@commemoentries = ();
$commemoratio = '';
}
@@ -837,7 +837,7 @@ sub concurrence {
} else {
$vespera = 3;
$tvesp = 3;
$dayname[2] .= "<br />Vespera de præcedenti; nihil de sequenti (tempora)";
$dayname[2] .= "<br/>Vespera de præcedenti; nihil de sequenti (tempora)";
$ctrank = '';
$ctname = '';
%cwinner = undef;
@@ -880,7 +880,7 @@ sub concurrence {
|| ($rank >= ($version =~ /trident/i ? 6 : 5) && $winner !~ /feria|in.*octava/i && $crank < 2.1)
)
{ # on Duplex I. cl / II. cl no commemoration of following Simplex and Common Octaves
$dayname[2] .= "<br />Vespera de præcedenti; nihil de sequenti";
$dayname[2] .= "<br/>Vespera de præcedenti; nihil de sequenti";
$cwinner = '';
%cwinner = ();
$vespera = 3;
@@ -906,9 +906,9 @@ sub concurrence {
$cvespera = 3;

if ($comrank == 2.1 || $comrank == 2.99 || $comrank == 3.9) { # privilidged Feria, Dominica, or infra 8vam
$dayname[2] .= "<br />Vespera de sequenti; commemoratio de off. priv. tantum";
$dayname[2] .= "<br/>Vespera de sequenti; commemoratio de off. priv. tantum";
} else {
$dayname[2] .= "<br />Vespera de sequenti; nihil de præcedenti";
$dayname[2] .= "<br/>Vespera de sequenti; nihil de præcedenti";
}
$rank = $crank;
$commune = $ccommune;
@@ -931,7 +931,7 @@ sub concurrence {
$winner = $cwinner;
$cwinner = $commemoratio;
@dayname = @tomorrowname;
$dayname[2] .= "<br />Vespera de sequenti; commemoratio de præcedenti Dominica";
$dayname[2] .= "<br/>Vespera de sequenti; commemoratio de præcedenti Dominica";
$rank = $crank;
$commune = $ccommune;
$communetype = $ccommunetype;
@@ -948,7 +948,7 @@ sub concurrence {
$cvespera = 1;
$commemoratio = $cwinner;
$dayname[2] = "Commemoratio: $cwrank[0]";
$dayname[2] .= "<br />Vespera de præcedenti; commemoratio de sequenti";
$dayname[2] .= "<br/>Vespera de præcedenti; commemoratio de sequenti";
$dayname[2] .= " Dominica" if $cwinner{Rank} =~ /Dominica/i;
} elsif ($flcrank == $flrank) { # "flattend ranks" are equal => a capitulo
$commemoratio = $winner;
@@ -995,7 +995,7 @@ sub concurrence {
$rank = $crank;
$commune = $ccommune;
$communetype = $ccommunetype;
$dayname[2] .= "<br />A capitulo de sequenti; commemoratio de præcedenti";
$dayname[2] .= "<br/>A capitulo de sequenti; commemoratio de præcedenti";
} elsif ($crank > $rank) { # tommorow is outranking today
$vespera = 1;
$commemoratio = $winner;
@@ -1007,13 +1007,13 @@ sub concurrence {
$rank = $crank;
$commune = $ccommune;
$communetype = $ccommunetype;
$dayname[2] .= "<br />Vespera de sequenti; commemoratio de præcedenti";
$dayname[2] .= "<br/>Vespera de sequenti; commemoratio de præcedenti";
} else { # today is outranking tomorrow
$commemoratio = $cwinner;
$dayname[2] = "Commemoratio: $cwrank[0]";
$vespera = 3;
$cvespera = 1;
$dayname[2] .= "<br />Vespera de præcedenti; commemoratio de sequenti";
$dayname[2] .= "<br/>Vespera de præcedenti; commemoratio de sequenti";

if ($cwinner{Rank} =~ /infra octavam/i || $ccommemoentries[0] =~ /infra octavam/i) {
my @comentries = ();
4 changes: 2 additions & 2 deletions web/cgi-bin/horas/kalendar.pl
Original file line number Diff line number Diff line change
@@ -263,8 +263,8 @@ sub kalendar_table {
push(@c1, $c1);
push(@c2, $c2);
}
my $c1 = join('<BR />', @c1);
my $c2 = join('<BR />', @c2);
my $c1 = join('<br/>', @c1);
my $c2 = join('<br/>', @c2);
$output .= << "PrintTag";
<TR><TD ALIGN="CENTER"><A HREF=# onclick="callbrevi('$date1');">$d1</A></TD>
<TD>$c1</TD>
1 change: 1 addition & 0 deletions web/cgi-bin/horas/officium.pl
Original file line number Diff line number Diff line change
@@ -118,6 +118,7 @@ package main;
set_runtime_options('parameters'); # priest, lang1 ... etc

if ($command =~ s/changeparameters//) { getsetupvalue($command); }

#print "Content-type: text/html; charset=utf-8\n\n"; #<= uncomment for debuggin "Internal Server Errors"
$version = check_version($version) || (error("Unknown version: $version") && 'Rubrics 1960 - 1960');
$lang1 = check_language($lang1) || (error("Unknown language: $lang1") && 'Latin');
6 changes: 3 additions & 3 deletions web/cgi-bin/horas/officium_html.pl
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ sub mainpage {
<TD ALIGN="CENTER"><FONT COLOR="MAROON">Commune Sanctorum</FONT></TD>
<TD ALIGN="CENTER"><FONT COLOR="MAROON">Proprium Sanctorum</FONT></TD>
</TR></TABLE>
<BR />
<br/>
PrintTag
}

@@ -154,13 +154,13 @@ sub hiddenfields {
sub buildscript {
local ($_) = @_;
s/[\n]+/<BR \/>/g;
s/[\n]+/<br\/>/g;
s/\_//g;
s/\,\,\,/\&ensp\;/g;
return << "PrintTag";
<TABLE $background BORDER="3" ALIGN="CENTER" WIDTH="60%" CELLPADDING="8"><TR><TD>
$_
</TD></TR><TABLE><BR />
</TD></TR><TABLE><br/>
PrintTag
}
31 changes: 16 additions & 15 deletions web/cgi-bin/horas/webdia.pl
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ sub htmlHead {
a:link { color: $link; }
a:visited { color: $visitedlink; }
body {
background: #eeeeee;
background: $dialogbackground;
}
.contrastbg { background: white; }
\@media (prefers-color-scheme: dark) {
@@ -108,7 +108,7 @@ sub htmlInput {

if ($parmode =~ /^label/i) {
my $ilabel = $parvalue;
if ($parpar) { $ilabel = wrap($ilabel, $parpar, "<BR />\n"); }
if ($parpar) { $ilabel = wrap($ilabel, $parpar, "<br/>\n"); }
$output .= "$ilabel";
$output .= "<INPUT TYPE='HIDDEN' NAME=\'$parname\' VALUE=\'$parvalue\'>\n";
} elsif ($parmode =~ /entry/i) {
@@ -137,7 +137,7 @@ sub htmlInput {
$savefile =~ s/\.gen//;
do_write("$datafolder/gen/$savefile.gen", $pv);
}
$output .= "<TEXTAREA NAME=\'$parname\' ID=\'$parname\' COLS='$size[1]' ROWS='$size[0]'>$pv</TEXTAREA><BR />\n";
$output .= "<TEXTAREA NAME=\'$parname\' ID=\'$parname\' COLS='$size[1]' ROWS='$size[0]'>$pv</TEXTAREA><br/>\n";
$output .= "<A HREF='#' onclick='loadrut();'>";
$output .= setfont($dialogfont) . "Load</FONT></A>";
} elsif ($parmode =~ /checkbutton/i) {
@@ -327,7 +327,7 @@ sub getcookies {

#check if the structure of the parameters is the same
if (@sti > @param + 1 || ($check !~ /^$sti[-1]/)) {
$error = "Cookie $cname mismatch $name need $check has $param<br />== $sti[-1]";
$error = "Cookie $cname mismatch $name need $check has $param<br/>== $sti[-1]";
return 0;
}
setsetup($name, @sti);
@@ -478,17 +478,17 @@ sub setcell {
}
}
print "<TD VALIGN='TOP' WIDTH='$width%'"
. ($lang1 ne $lang || $text =~ /{omittitur}/ ? "" : " ID='$hora$searchind'") . ">"
unless $officium =~ /Eofficium/;
topnext_cell(\$text, $lang) unless $popup; # || $officium =~ /Eofficium/;
. ($lang1 ne $lang || $text =~ /{omittitur}/ ? "" : " ID='$hora$searchind'") . ">";
print "<p>" if $officium =~ /Eofficium|Emissa/;
topnext_cell(\$text, $lang) unless $popup || $officium =~ /Eofficium|Emissa/;
}
process_inline_alleluias(\$text, $dayname[0] =~ /Pasc/) unless $missa; # missa use own solution
# which should removed
suppress_alleluia(\$text) if ($dayname[0] =~ /Quadp|Quad[1-5]|Quad6-[0-5]/i && ($missa || !Septuagesima_vesp()));
$text =~ s/\<BR \/\>\s*\<BR \/\>/\<BR \/\>/g;
$text =~ s/\<br\/\>\s*\<br\/\>/\<br\/\>/ig;
if ($lang =~ /Latin/i) { $text = spell_var($text); }
if ($text =~ /%(.*?)%/) {
@@ -497,7 +497,7 @@ sub setcell {
$text =~ s/wait[0-9]+//ig;
$text =~ s/\_/ /g;
# $text =~ s/\{\:.*?\:\}(<BR />)*\s*//g;
# $text =~ s/\{\:.*?\:\}(<br/>)*\s*//g;
$text =~ s/\{\:.*?\:\}//sg;
$text =~ s/\`//g; #`
$text =~ s/\s([»!?;:])/&nbsp;$1/g; # no-break space before punctutation (mostly French)
@@ -514,6 +514,7 @@ sub setcell {
# } elsif ($officium =~ /Eofficium/) {
# print $text;
} else {
$text .= '</p>' if $officium =~ /Eofficium|Emissa/;
print setfont($blackfont, $text) . "</TD>\n";
if (!columnsel($lang) || $only) { print "</TR>\n"; }
}
@@ -524,7 +525,7 @@ sub setcell {
sub topnext_cell {
if ($officium =~ /Pofficium/i) { return; }
my ($text, $lang) = @_;
my @a = split('<BR />', $$text);
my @a = split('<br/>', $$text);
if (@a > 2 && $expand !~ /skeleton/i) {
my $str = "<DIV ALIGN='right'><FONT SIZE='1' COLOR='green'>";
@@ -579,13 +580,13 @@ sub table_end {
print "<TR><TD VALIGN='TOP' WIDTH='$width%'>\n";
my $item;
my $len1 = 0;
foreach $item (@ctext1) { print "$item<BR />\n"; $len1 += wnum($item); }
foreach $item (@ctext1) { print "$item<br/>\n"; $len1 += wnum($item); }
print "</TD>\n";
if (!$only) {
$len2 = 0;
print "<TD VALIGN='TOP' WIDTH='$width%'>\n";
foreach $item (@ctext2) { print "$item<BR />\n"; $len2 += wnum($item); }
foreach $item (@ctext2) { print "$item<br/>\n"; $len2 += wnum($item); }
print "</TD></TR>\n";
}
print "<TR><TD VALIGN='TOP' WIDTH='$width%'><FONT SIZE='1'>$len1 words</FONT></TD>";
@@ -678,7 +679,7 @@ sub selectable_p {
my $colour = $curvalue eq $name ? 'red' : '';
push(@output, qq(\n<A HREF="$href"><FONT COLOR=$colour>$text</FONT></A>));
}
join('<BR />', @output) . "</TD></TR>\n";
join('<br/>', @output) . "</TD></TR>\n";
}
sub horas_menu {
@@ -704,7 +705,7 @@ sub horas_menu {
if (($0 =~ /Pofficium/ && $votive ne 'C9' && ($i == 2 || $i == 6)) || (($i == (@horas - 2)) && ($0 !~ /Cofficium/)))
{
$output .= '<BR />';
$output .= '<br/>';
} else {
$output .= '&nbsp;&nbsp;';
}
@@ -735,7 +736,7 @@ sub html_dayhead {
if ($subhead) {
($pre, $main) = split(/: /, $subhead, 2);
$output .= "<BR />\n<SPAN STYLE=\"font-size:82%; color:maroon;\"><I>$pre";
$output .= "<br/>\n<SPAN STYLE=\"font-size:82%; color:maroon;\"><I>$pre";
$output .= ": " . setfont(liturgical_color($main, ''), $main) if $main;
$output .= "</I></SPAN>\n";
}
3 changes: 2 additions & 1 deletion web/cgi-bin/missa/Cmissa.pl
Original file line number Diff line number Diff line change
@@ -112,6 +112,7 @@ package main;
set_runtime_options('parameters'); # priest, lang1 ... etc

if ($command eq 'changeparameters') { getsetupvalue($command); }

#print "Content-type: text/html; charset=utf-8\n\n"; #<= uncomment for debuggin "Internal Server Errors"
setcookies('missap', 'parameters');
setcookies('missagc', 'generalc');
@@ -121,7 +122,7 @@ package main;
$setupsave =~ s/\r*\n*//g;

our $command = strictparam('command');
our $hora = $command; #Matutinum, Laudes, Prima, Tertia, Sexta, Nona, Vespera, Completorium
our $hora = $command; #Matutinum, Laudes, Prima, Tertia, Sexta, Nona, Vespera, Completorium
our $browsertime = strictparam('browsertime');
our $searchvalue = strictparam('searchvalue');
if (!$searchvalue) { $searchvalue = '0'; }
98 changes: 77 additions & 21 deletions web/cgi-bin/missa/Emissa.pl
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ package main;

#use DateTime;
use locale;
use lib "$Bin/..";
use lib "$Bin/../../../web/cgi-bin";
use DivinumOfficium::Main qw(vernaculars liturgical_color);
use DivinumOfficium::Date qw(prevnext);
use DivinumOfficium::LanguageTextTools
@@ -32,8 +32,8 @@ package main;
our $Ck = 0;
our $missa = 1;
our $NewMass = 0;
our $officium = 'missa.pl';
our $version = 'Rubrics 1960';
our $officium = 'Emissa.pl';
our $version = 'Rubrics 1960 - 1960';

#***common variables arrays and hashes
#filled getweek()
@@ -64,19 +64,39 @@ package main;
# 4= duplex majus, 5 = duplex II classis 6=duplex I classes 7=above 0=none

#*** collect standard items
#require "$Bin/ordocommon.pl";
#allow the script to be started directly from the "standalone/tools/epubgen2" subdirectory
if (!-e "$Bin/../DivinumOfficium/do_io.pl") {
$Bin = "$Bin/../../../web/cgi-bin/missa";
}

require "$Bin/../DivinumOfficium/do_io.pl";
require "$Bin/../DivinumOfficium/SetupString.pl";
require "$Bin/../horas/horascommon.pl";
require "$Bin/../DivinumOfficium/dialogcommon.pl";
require "$Bin/../DivinumOfficium/webdia.pl";
require "$Bin/../../../standalone/tools/epubgen2/Ewebdia.pl";

require "$Bin/../DivinumOfficium/setup.pl";
require "$Bin/ordo.pl";
require "$Bin/propers.pl";

require "$Bin/../horas/webdia.pl";
require "$Bin/../../../standalone/tools/epubgen2/Ewebdia.pl";

binmode(STDOUT, ':encoding(utf-8)');
$q = new CGI;

#replaced methods
#*** build_comment_line_xhtml()
# Replacement for build_comment_line() from horascommon.pl
#
# Sets $comment to the HTML for the comment line.
sub build_comment_line_xhtml() {
our @dayname;
our ($comment, $marian_commem);

my $commentcolor = ($dayname[2] =~ /(Feria)/i) ? '' : ($marian_commem && $dayname[2] =~ /^Commem/) ? ' rb' : ' m';
$comment = ($dayname[2]) ? "<span class=\"s$commentcolor\">$dayname[2]</span>" : "";
}

#get parameters
getini('missa'); #files, colors
$setupsave = strictparam('setup');
@@ -85,7 +105,7 @@ package main;
our %translate; #translation of the skeleton label for 2nd language

if (!$setupsave) {
%setup = %{setupstring('', 'missa.setup')};
%setup = %{setupstring('', '../../../standalone/tools/epubgen2/Emissa.setup')};
} else {
%setup = split(';;;', $setupsave);
}
@@ -145,63 +165,99 @@ package main;
$solemn = strictparam('solemn');
}

if (!$version) { $version = 'Rubrics 1960'; }
if (!$version) { $version = 'Rubrics 1960 - 1960'; }
if (!$lang2) { $lang2 = 'Latin'; }

# save parameters
$setupsave =~ s/\r*\n*//g;
$setupsave =~ s/\"/\~24/g;
precedence(); #fills our hashes et variables
setsecondcol();

# prepare title
$daycolor =
($commune =~ /(C1[0-9])/) ? "blue"
: ($dayname[1] =~ /(Quattuor|Feria|Vigilia)/i) ? "black"
: ($dayname[1] =~ /duplex/i) ? "red"
: "grey";

build_comment_line_xhtml();

#prepare main pages
$title = "Sancta Missa";

$command =~ s/(pray|change|setup)//ig;
$title = "Sancta Missa";

#*** print pages (setup, hora=pray, mainpage)
#generate HTML
htmlHead($title, 2);

#note the whole content is wrapped in a <div> for XHTML standard compatibilty
print << "PrintTag";
<body><div>
PrintTag

load_languages_data($lang1, $lang2, $version, $missa);
$head = $title;
$headline = setheadline();
headline($head);

load_languages_data($lang1, $lang2, $version, $missa);
$only = 1; # single-column
ordo();

print << "PrintTag";
PrintTag

#common end for programs
if ($error) { print "<p align=center><font color=red>$error</font></p>\n"; }
if ($debug) { print "<p align=center><font color=blue>$debug</font></p>\n"; }
print "</body></html>";
if ($error) { print "<p class=\"cen rd\">$error</p>\n"; }
if ($debug) { print "<P class=\"cen rd\">$debug</p>\n"; }

print << "PrintTag";
</div></body></html>
PrintTag

#*** hedline($head) prints headlibe for main and pray
sub headline {
my $head = shift;
my $headline = html_dayhead($headline, $dayname[2]);
if ($headline =~ /\!/) { $headline = $` . "<FONT SIZE=\"1\">" . $' . "</FONT>"; }
my $daten = prevnext($date1, 1);
my $datep = prevnext($date1, -1);

#convert $daycolor to $daycolorclass
my $daycolorclass = ""; #rely on default being black font color

if ($daycolor eq "blue") {
$daycolorclass = "rb";
} elsif ($daycolor eq "gray") {
$daycolorclass = "rb";
} elsif ($daycolor eq "red") {
$daycolorclass = "rd";
}

print << "PrintTag";
<?xml version='1.0' encoding='utf-8'?><html xmlns="http://www.w3.org/1999/xhtml"><head/><body>
<p align="center"><a href="$datep-9-Missa.html">&darr;</a>
<p class="cen"><span class="$daycolorclass">$headline<br/></span>
$comment<br/><br/>
<span class="c">Missa</span>&ensp;
<a href="$datep-9-Missa.html">&darr;</a>
$date1
<a href="$daten-9-Missa.html">&uarr;</a>
<br />
</p>
<p class="cen">
<a href="$date1-1-Matutinum.html">Matutinum</a>
&nbsp;&nbsp;
<a href="$date1-2-Laudes.html">Laudes</a>
&nbsp;&nbsp;
<a href="$date1-3-Prima.html">Prima</a>
&nbsp;&nbsp;
<a href="$date1-4-Tertia.html">Tertia</a>
<br />
<br/>
<a href="$date1-5-Sexta.html">Sexta</a>
&nbsp;&nbsp;
<a href="$date1-6-Nona.html">Nona</a>
&nbsp;&nbsp;
<a href="$date1-7-Vespera.html">Vespera</a>
&nbsp;&nbsp;
<a href="$date1-8-Completorium.html">Completorium</a>
<br />
$headline<br>
<a href="$date1-9-Missa.html"><font color="maroon" size="+1"><b><i>$head</i></b></font></a>
</p>
PrintTag
}
4 changes: 4 additions & 0 deletions web/cgi-bin/missa/missa.pl
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ package main;
use DivinumOfficium::LanguageTextTools
qw(prayer translate load_languages_data omit_regexp suppress_alleluia process_inline_alleluias alleluia_ant ensure_single_alleluia ensure_double_alleluia);
use DivinumOfficium::RunTimeOptions qw(check_version check_language);

$error = '';
$debug = '';

@@ -62,6 +63,7 @@ package main;
our $communerule; # $commune{Rank}
our $duplex; #1=simplex-feria, 2=semiduplex-feria privilegiata, 3=duplex
# 4= duplex majus, 5 = duplex II classis 6=duplex I classes 7=above 0=none

binmode(STDOUT, ':encoding(utf-8)');

#*** collect standard items
@@ -89,6 +91,7 @@ package main;
our $command = strictparam('command');
our $browsertime = strictparam('browsertime');
our $searchvalue = strictparam('searchvalue');

if (!$searchvalue) { $searchvalue = '0'; }
our $missanumber = strictparam('missanumber');
if (!$missanumber) { $missanumber = 1; }
@@ -106,6 +109,7 @@ package main;
set_runtime_options('parameters'); # priest, lang1 ... etc

if ($command eq 'changeparameters') { getsetupvalue($command); }

#print "Content-type: text/html; charset=utf-8\n\n"; <= uncomment for debuggin "Internal Server Errors"
$version = check_version($version, $missa) || (error("Unknown version: $version") && 'Rubrics 1960 - 1960');
$lang1 = check_language($lang1) || (error("Unknown language: $lang1") && 'Latin');
34 changes: 20 additions & 14 deletions web/cgi-bin/missa/ordo.pl
Original file line number Diff line number Diff line change
@@ -83,25 +83,25 @@ sub resolve_refs {
$t[0] =~ s/^\s*\#/\!\!/;
}

#cycle by lines
my $it;
my $line_prefix;
my @resolved_lines; # Array of blocks expanded from lines.
my $merged_lines; # Preceding continued lines.

for ($it = 0; $it < @t; $it++) {
#cycle by lines
for (my $it = 0; $it < @t; $it++) {
$line = $t[$it];
$line =~ s/\s+$//;
$line =~ s/^\s+//;

# Should this line be joined to the next? Strip off the continuation
# character as we check.
my $line_continues = ($line =~ s/\s*~\s*$//);
my $merge_with_next = ($line =~ s/~$//);

# The first batch of transformations are performed on the current
# input line only.
#$ and & references
if ($line !~ /(callpopup|rubrics)/i && $line =~ /^\s*[\$\&]/) #??? was " /[\#\$\&]/)
{
$line =~ s/\.//g;
$line =~ s/\s+$//;
$line =~ s/^\s+//;

#prepares reading the part of common w/ antiphona
if ($line =~ /psalm/ && $t[$it - 1] =~ /^\s*Ant\. /i) {
@@ -194,18 +194,22 @@ sub resolve_refs {
/emx;

# Connect lines marked by tilde.
if ($line_continues && $it < $#t) {
$line_prefix = $line;
if ($merge_with_next && $it < $#t) {
$merged_lines = $line . ' ';
} else {
$line_prefix = '';
$t .= "$line<BR>\n";
push @resolved_lines, $merged_lines . $line;
$merged_lines = '';
}
} #line by line cycle ends

# Concatenate the expansions of the lines with a line break between each.
push @resolved_lines, '';
my $resolved_block = join "<br/>\n", @resolved_lines;

#removes occasional double linebreaks
$t =~ s/\<BR\>\s*\<BR\>/\<BR\>/g;
$t =~ s/<\/P>\s*<BR>/<\/P>/g;
return $t;
$resolved_block =~ s/\<BR\/\>\s*\<BR\/\>/\<BR\/\>/g;
$resolved_block =~ s/<\/P>\s*<BR\/>/<\/P>/g;
return $resolved_block;
}

#*** Alleluia($lang)
@@ -253,6 +257,8 @@ sub getordinarium {
}
my $fname = 'Ordo';
if ($version =~ /1967/i) { $fname = 'Ordo67'; }

#elsif ($version =~ /Praedicatorum/i) { $fname = 'OrdoOP'; }
if ($NewMass) { $fname = ($column == 1) ? $ordos{$version1} : $ordos{$version2}; }
$fname = checkfile($lang, "Ordo/$fname.txt");

4 changes: 3 additions & 1 deletion web/cgi-bin/missa/propers.pl
Original file line number Diff line number Diff line change
@@ -1153,7 +1153,9 @@ sub placeattibi {

sub Communio_Populi : ScriptFunc {
my $lang = shift;
return "<A HREF=\"mpopup.pl?popup=Communio&rubrics=$rubrics&lang1=$lang1&lang2=$lang2\" TARGET=_NEW>Communio</A>\n";
return $officium =~ /Emissa/i
? ""
: "<A HREF=\"mpopup.pl?popup=Communio&rubrics=$rubrics&lang1=$lang1&lang2=$lang2\" TARGET=\"_NEW\">Communio</A>\n";
}

sub Ultimaev : ScriptFunc {

0 comments on commit 20487e9

Please sign in to comment.