diff --git a/standalone/tools/epubgen2/Ehoras.setup b/standalone/tools/epubgen2/Ehoras.setup index 7c12f94a340..1272a9ac306 100644 --- a/standalone/tools/epubgen2/Ehoras.setup +++ b/standalone/tools/epubgen2/Ehoras.setup @@ -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';; diff --git a/standalone/tools/epubgen2/Emissa.setup b/standalone/tools/epubgen2/Emissa.setup new file mode 100644 index 00000000000..6b0f95b35b8 --- /dev/null +++ b/standalone/tools/epubgen2/Emissa.setup @@ -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 diff --git a/standalone/tools/epubgen2/EofficiumXhtml.pl b/standalone/tools/epubgen2/EofficiumXhtml.pl index 5bc732962de..3b7c02b29b2 100755 --- a/standalone/tools/epubgen2/EofficiumXhtml.pl +++ b/standalone/tools/epubgen2/EofficiumXhtml.pl @@ -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 @@ () Prima    Tertia -
+
Sexta    Nona @@ -335,7 +341,7 @@ () if ($linkmissa) { print << "PrintTag"; -
+
Missa PrintTag } @@ -374,9 +380,9 @@ sub headline { } print << "PrintTag"; -

$headline
-$comment

-$h    +

$headline
+$comment

+$h $date1 @@ -389,7 +395,7 @@ sub headline { Prima    Tertia -
+
Sexta    Nona @@ -401,7 +407,7 @@ sub headline { if ($linkmissa) { print << "PrintTag"; -
+
Missa PrintTag } diff --git a/standalone/tools/epubgen2/Ewebdia.pl b/standalone/tools/epubgen2/Ewebdia.pl index 66cf2b7ddbd..0e239fe10f6 100755 --- a/standalone/tools/epubgen2/Ewebdia.pl +++ b/standalone/tools/epubgen2/Ewebdia.pl @@ -123,7 +123,7 @@ sub setup { if ($parmode[$i] =~ /^label/i) { my $ilabel = $parvalue[$i]; - if ($parpar[$i]) { $ilabel = wrap($ilabel, $parpar[$i], "
\n"); } + if ($parpar[$i]) { $ilabel = wrap($ilabel, $parpar[$i], "
\n"); } $input .= "$ilabel"; $input .= "\n"; @@ -157,7 +157,7 @@ sub setup { do_write("$datafolder/gen/$savefile.gen", $pv); } - $input .= "
\n"; + $input .= "
\n"; $input .= ""; $input .= setfont($dialogfont) . "Load"; @@ -444,7 +444,7 @@ sub setvrbar { # #remove auxiliary characters # $text =~ s/wait[0-9]+//ig; # $text =~ s/\_/ /g; -# $text =~ s/\{\:.*?\:\}(
)*\s*//g; +# $text =~ s/\{\:.*?\:\}(
)*\s*//g; # $text =~ s/\{\:.*?\:\}//sg; # $text =~ s/\`//g; # @@ -496,7 +496,7 @@ sub setvrbar { # #$htmltext .= setfont($blackfont,$text) . "\n"; # #if ($only || !columnsel($lang)) {$htmltext .= "\n";} # -# $text =~ s/
/
/sg; +# $text =~ s/
//sg; # # #$text =~ s/\n//g; # print $text; @@ -542,8 +542,8 @@ sub longtd { my $a1 = shift; my $a2 = shift; - my @a1 = split('
', $a1); - my @a2 = split('
', $a2); + my @a1 = split('
', $a1); + my @a2 = split('
', $a2); my @b1 = splice(@b1, @b1); my @b2 = splice(@b2, @b2); my $i; diff --git a/standalone/tools/epubgen2/epubgen2.sh b/standalone/tools/epubgen2/epubgen2.sh index b90c6f3aaee..8db6e3619c0 100755 --- a/standalone/tools/epubgen2/epubgen2.sh +++ b/standalone/tools/epubgen2/epubgen2.sh @@ -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,7 +385,7 @@ 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 @@ -393,7 +393,7 @@ generateTOCs() { #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 ' ' -date --iso-8601 +date +"%Y-%m-%dT%H:%M:%S:%z" printf "Breviarium $1 Divinum Officium @@ -491,7 +491,7 @@ 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 @@ -499,7 +499,7 @@ generateOPF() { #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 } diff --git a/web/cgi-bin/DivinumOfficium/RunTimeOptions.pm b/web/cgi-bin/DivinumOfficium/RunTimeOptions.pm index b0141814c46..873229d0e40 100644 --- a/web/cgi-bin/DivinumOfficium/RunTimeOptions.pm +++ b/web/cgi-bin/DivinumOfficium/RunTimeOptions.pm @@ -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'); } } diff --git a/web/cgi-bin/horas/horas.pl b/web/cgi-bin/horas/horas.pl index 4bf8c30c609..54fd8fc2e18 100644 --- a/web/cgi-bin/horas/horas.pl +++ b/web/cgi-bin/horas/horas.pl @@ -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 "
\n", @resolved_lines; + my $resolved_block = join "
\n", @resolved_lines; #removes occasional double linebreaks - $resolved_block =~ s/
\s*
/
/g; - $resolved_block =~ s/<\/P>\s*
/<\/P>/g; + $resolved_block =~ s/\s*//ig; + $resolved_block =~ s/<\/P>\s*/<\/P>/ig; return $resolved_block; } diff --git a/web/cgi-bin/horas/horascommon.pl b/web/cgi-bin/horas/horascommon.pl index 7d512768740..c3c040afb7c 100644 --- a/web/cgi-bin/horas/horascommon.pl +++ b/web/cgi-bin/horas/horascommon.pl @@ -14,7 +14,7 @@ sub error { my $t = shift; - our $error .= "= $t =
"; + our $error .= "= $t =
"; } sub occurrence { @@ -777,7 +777,7 @@ sub concurrence { && $version !~ /1955|196/) { $vespera = 3; - $dayname[2] = $tomorrowname[2] . "
Vespera de Officium occurente, Commemoratio Sanctorum tantum"; + $dayname[2] = $tomorrowname[2] . "
Vespera de Officium occurente, Commemoratio Sanctorum tantum"; $cwrank = ''; $ctname = ''; %cwinner = undef; @@ -789,7 +789,7 @@ sub concurrence { && $version !~ /1955|196/) { $vespera = 3; - $dayname[2] .= "
Vespera de Officium occurente; nihil de sequenti"; + $dayname[2] .= "
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] .= "
Vespera de Officium occurente " unless $version =~ /1955|196/; + $dayname[2] .= "
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] .= "
Vespera de sequenti; nihil de præcedenti (tempora)"; + $tomorrowname[2] = $dayname[2] .= "
Vespera de sequenti; nihil de præcedenti (tempora)"; } else { - $tomorrowname[2] .= "
Vespera de sequenti; nihil de præcedenti"; + $tomorrowname[2] .= "
Vespera de sequenti; nihil de præcedenti"; @commemoentries = (); $commemoratio = ''; } @@ -837,7 +837,7 @@ sub concurrence { } else { $vespera = 3; $tvesp = 3; - $dayname[2] .= "
Vespera de præcedenti; nihil de sequenti (tempora)"; + $dayname[2] .= "
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] .= "
Vespera de præcedenti; nihil de sequenti"; + $dayname[2] .= "
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] .= "
Vespera de sequenti; commemoratio de off. priv. tantum"; + $dayname[2] .= "
Vespera de sequenti; commemoratio de off. priv. tantum"; } else { - $dayname[2] .= "
Vespera de sequenti; nihil de præcedenti"; + $dayname[2] .= "
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] .= "
Vespera de sequenti; commemoratio de præcedenti Dominica"; + $dayname[2] .= "
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] .= "
Vespera de præcedenti; commemoratio de sequenti"; + $dayname[2] .= "
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] .= "
A capitulo de sequenti; commemoratio de præcedenti"; + $dayname[2] .= "
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] .= "
Vespera de sequenti; commemoratio de præcedenti"; + $dayname[2] .= "
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] .= "
Vespera de præcedenti; commemoratio de sequenti"; + $dayname[2] .= "
Vespera de præcedenti; commemoratio de sequenti"; if ($cwinner{Rank} =~ /infra octavam/i || $ccommemoentries[0] =~ /infra octavam/i) { my @comentries = (); diff --git a/web/cgi-bin/horas/kalendar.pl b/web/cgi-bin/horas/kalendar.pl index 40c7ebb0567..0e42322f34d 100755 --- a/web/cgi-bin/horas/kalendar.pl +++ b/web/cgi-bin/horas/kalendar.pl @@ -263,8 +263,8 @@ sub kalendar_table { push(@c1, $c1); push(@c2, $c2); } - my $c1 = join('
', @c1); - my $c2 = join('
', @c2); + my $c1 = join('
', @c1); + my $c2 = join('
', @c2); $output .= << "PrintTag"; $d1 $c1 diff --git a/web/cgi-bin/horas/officium.pl b/web/cgi-bin/horas/officium.pl index 67f91943f41..fba65a3dd54 100755 --- a/web/cgi-bin/horas/officium.pl +++ b/web/cgi-bin/horas/officium.pl @@ -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'); diff --git a/web/cgi-bin/horas/officium_html.pl b/web/cgi-bin/horas/officium_html.pl index d78bceb06bd..decb1c62d82 100644 --- a/web/cgi-bin/horas/officium_html.pl +++ b/web/cgi-bin/horas/officium_html.pl @@ -86,7 +86,7 @@ sub mainpage { Commune Sanctorum Proprium Sanctorum -
+
PrintTag } @@ -154,13 +154,13 @@ sub hiddenfields { sub buildscript { local ($_) = @_; - s/[\n]+/
/g; + s/[\n]+//g; s/\_//g; s/\,\,\,/\&ensp\;/g; return << "PrintTag";
$_ -

+

PrintTag } diff --git a/web/cgi-bin/horas/webdia.pl b/web/cgi-bin/horas/webdia.pl index aac22092500..12e33914922 100644 --- a/web/cgi-bin/horas/webdia.pl +++ b/web/cgi-bin/horas/webdia.pl @@ -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, "
\n"); } + if ($parpar) { $ilabel = wrap($ilabel, $parpar, "
\n"); } $output .= "$ilabel"; $output .= "\n"; } elsif ($parmode =~ /entry/i) { @@ -137,7 +137,7 @@ sub htmlInput { $savefile =~ s/\.gen//; do_write("$datafolder/gen/$savefile.gen", $pv); } - $output .= "
\n"; + $output .= "
\n"; $output .= ""; $output .= setfont($dialogfont) . "Load"; } 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
== $sti[-1]"; + $error = "Cookie $cname mismatch $name need $check has $param
== $sti[-1]"; return 0; } setsetup($name, @sti); @@ -478,9 +478,9 @@ sub setcell { } } print "\n"; if (!columnsel($lang) || $only) { print "\n"; } } @@ -524,7 +525,7 @@ sub setcell { sub topnext_cell { if ($officium =~ /Pofficium/i) { return; } my ($text, $lang) = @_; - my @a = split('
', $$text); + my @a = split('
', $$text); if (@a > 2 && $expand !~ /skeleton/i) { my $str = "
"; @@ -579,13 +580,13 @@ sub table_end { print "
\n"; if (!$only) { $len2 = 0; print "\n"; } print ""; @@ -678,7 +679,7 @@ sub selectable_p { my $colour = $curvalue eq $name ? 'red' : ''; push(@output, qq(\n$text)); } - join('
', @output) . "
\n"; + join('
', @output) . "\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 .= '
'; + $output .= '
'; } else { $output .= '  '; } @@ -735,7 +736,7 @@ sub html_dayhead { if ($subhead) { ($pre, $main) = split(/: /, $subhead, 2); - $output .= "
\n$pre"; + $output .= "
\n$pre"; $output .= ": " . setfont(liturgical_color($main, ''), $main) if $main; $output .= "\n"; } diff --git a/web/cgi-bin/missa/Cmissa.pl b/web/cgi-bin/missa/Cmissa.pl index d33f53192b8..27aaa675291 100755 --- a/web/cgi-bin/missa/Cmissa.pl +++ b/web/cgi-bin/missa/Cmissa.pl @@ -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'; } diff --git a/web/cgi-bin/missa/Emissa.pl b/web/cgi-bin/missa/Emissa.pl index 2404bcc4cc6..a79f1db6a1b 100755 --- a/web/cgi-bin/missa/Emissa.pl +++ b/web/cgi-bin/missa/Emissa.pl @@ -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]) ? "$dayname[2]" : ""; +} + #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,45 +165,84 @@ 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
for XHTML standard compatibilty +print << "PrintTag"; +
+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 "

$error

\n"; } -if ($debug) { print "

$debug

\n"; } -print ""; +if ($error) { print "

$error

\n"; } +if ($debug) { print "

$debug

\n"; } + +print << "PrintTag"; +
+PrintTag #*** hedline($head) prints headlibe for main and pray sub headline { my $head = shift; - my $headline = html_dayhead($headline, $dayname[2]); + if ($headline =~ /\!/) { $headline = $` . "" . $' . ""; } 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"; - -

+

$headline
+$comment

+Missa  + $date1 -
+

+

Matutinum    Laudes @@ -191,7 +250,7 @@ sub headline { Prima    Tertia -
+
Sexta    Nona @@ -199,9 +258,6 @@ sub headline { Vespera    Completorium -
-$headline
-$head

PrintTag } diff --git a/web/cgi-bin/missa/missa.pl b/web/cgi-bin/missa/missa.pl index fbdd616b296..421dea2c974 100755 --- a/web/cgi-bin/missa/missa.pl +++ b/web/cgi-bin/missa/missa.pl @@ -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'); diff --git a/web/cgi-bin/missa/ordo.pl b/web/cgi-bin/missa/ordo.pl index d856796fc75..973559e1077 100755 --- a/web/cgi-bin/missa/ordo.pl +++ b/web/cgi-bin/missa/ordo.pl @@ -83,16 +83,18 @@ 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. @@ -100,8 +102,6 @@ sub resolve_refs { 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
\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 "
\n", @resolved_lines; + #removes occasional double linebreaks - $t =~ s/\\s*\/\/g; - $t =~ s/<\/P>\s*
/<\/P>/g; - return $t; + $resolved_block =~ s/\\s*\/\/g; + $resolved_block =~ s/<\/P>\s*/<\/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"); diff --git a/web/cgi-bin/missa/propers.pl b/web/cgi-bin/missa/propers.pl index 4901eb3bf57..7a66c6281bc 100644 --- a/web/cgi-bin/missa/propers.pl +++ b/web/cgi-bin/missa/propers.pl @@ -1153,7 +1153,9 @@ sub placeattibi { sub Communio_Populi : ScriptFunc { my $lang = shift; - return "Communio\n"; + return $officium =~ /Emissa/i + ? "" + : "Communio\n"; } sub Ultimaev : ScriptFunc {
" - unless $officium =~ /Eofficium/; - topnext_cell(\$text, $lang) unless $popup; # || $officium =~ /Eofficium/; + . ($lang1 ne $lang || $text =~ /{omittitur}/ ? "" : " ID='$hora$searchind'") . ">"; + print "

" 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 @@ -488,7 +488,7 @@ sub setcell { suppress_alleluia(\$text) if ($dayname[0] =~ /Quadp|Quad[1-5]|Quad6-[0-5]/i && ($missa || !Septuagesima_vesp())); - $text =~ s/\
\s*\
/\
/g; + $text =~ s/\\s*\/\/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/\{\:.*?\:\}(
)*\s*//g; + # $text =~ s/\{\:.*?\:\}(
)*\s*//g; $text =~ s/\{\:.*?\:\}//sg; $text =~ s/\`//g; #` $text =~ s/\s([»!?;:])/ $1/g; # no-break space before punctutation (mostly French) @@ -514,6 +514,7 @@ sub setcell { # } elsif ($officium =~ /Eofficium/) { # print $text; } else { + $text .= '

' if $officium =~ /Eofficium|Emissa/; print setfont($blackfont, $text) . "
\n"; my $item; my $len1 = 0; - foreach $item (@ctext1) { print "$item
\n"; $len1 += wnum($item); } + foreach $item (@ctext1) { print "$item
\n"; $len1 += wnum($item); } print "
\n"; - foreach $item (@ctext2) { print "$item
\n"; $len2 += wnum($item); } + foreach $item (@ctext2) { print "$item
\n"; $len2 += wnum($item); } print "
$len1 words