summaryrefslogtreecommitdiff
path: root/lib/VNDB/Util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-11-01 13:42:56 +0100
committerYorhel <git@yorhel.nl>2015-11-01 13:43:50 +0100
commit8c9cfe238e565088b37d256eb461a01919ef9968 (patch)
tree56143b98815c308aa84dc626a91364db5eadec23 /lib/VNDB/Util
parent3c967881d7b5408a49f16de8b268b053d6ba9051 (diff)
Switch to HTML5 doctype + s/acronym/abbr/ + s/&nbsp;/&#xa0;/e
I'd have preferred to stick with XHTML 1.0, but unfortunately browsers won't allow you to use modern Javascript APIs with an older doctype. Note that most pages don't actually validate correctly as HTML5, I'm relying on browsers to be lenient. In either case, I'd like VNDB to stay valid XML (XHTML5, then), and luckily that shouldn't be a problem.
Diffstat (limited to 'lib/VNDB/Util')
-rw-r--r--lib/VNDB/Util/CommonHTML.pm8
-rw-r--r--lib/VNDB/Util/FormHTML.pm4
-rw-r--r--lib/VNDB/Util/LayoutHTML.pm7
3 files changed, 8 insertions, 11 deletions
diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm
index bcc2ea97..7504ace8 100644
--- a/lib/VNDB/Util/CommonHTML.pm
+++ b/lib/VNDB/Util/CommonHTML.pm
@@ -204,12 +204,12 @@ sub htmlRevision {
table class => 'stripe';
thead;
Tr;
- td; lit '&nbsp;'; end;
+ td; lit '&#xa0;'; end;
td; revheader($self, $type, $old); end;
td; revheader($self, $type, $new); end;
end;
Tr;
- td; lit '&nbsp;'; end;
+ td; lit '&#xa0;'; end;
td colspan => 2;
b mt '_revision_edit_summary', $new->{rev};
br; br;
@@ -439,6 +439,7 @@ sub htmlSearchBox {
sub htmlRGHeader {
my($self, $title, $type, $obj) = @_;
+ # This used to be a good test for inline SVG support, but I'm not sure it is nowadays.
if(($self->reqHeader('Accept')||'') !~ /application\/xhtml\+xml/) {
$self->htmlHeader(title => $title);
$self->htmlMainTabs($type, $obj, 'rg');
@@ -452,8 +453,7 @@ sub htmlRGHeader {
$self->htmlFooter;
return 1;
}
- $self->resHeader('Content-Type' => 'application/xhtml+xml; charset=UTF-8');
- $self->htmlHeader(title => $title, svg => 1);
+ $self->htmlHeader(title => $title);
$self->htmlMainTabs($type, $obj, 'rg');
return 0;
}
diff --git a/lib/VNDB/Util/FormHTML.pm b/lib/VNDB/Util/FormHTML.pm
index 9612f904..afecbe08 100644
--- a/lib/VNDB/Util/FormHTML.pm
+++ b/lib/VNDB/Util/FormHTML.pm
@@ -97,7 +97,7 @@ sub htmlFormPart {
if(/check/) {
Tr class => 'newfield';
td class => 'label';
- lit '&nbsp;';
+ lit '&#xa0;';
end;
td class => 'field';
input type => 'checkbox', name => $o{short}, id => $o{short}, tabindex => 10,
@@ -120,7 +120,7 @@ sub htmlFormPart {
} elsif($o{label}) {
txt $o{label};
} else {
- lit '&nbsp;';
+ lit '&#xa0;';
}
end;
}
diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm
index 76b15690..fcd26346 100644
--- a/lib/VNDB/Util/LayoutHTML.pm
+++ b/lib/VNDB/Util/LayoutHTML.pm
@@ -17,11 +17,8 @@ sub htmlHeader { # %options->{ title, noindex, search, feeds, svg }
$skin = $self->{skin_default} if !$self->{skins}{$skin} || !-d "$VNDB::ROOT/static/s/$skin";
# heading
- html lang => $self->{l10n}->language_tag(), $o{svg} ? (
- doctype => 'xhtml-math-svg',
- 'xmlns:svg' => 'http://www.w3.org/2000/svg',
- 'xmlns:xlink' => 'http://www.w3.org/1999/xlink'
- ) : ();
+ lit '<!DOCTYPE HTML>';
+ tag 'html', lang => $self->{l10n}->language_tag();
head;
title $o{title};
Link rel => 'shortcut icon', href => '/favicon.ico', type => 'image/x-icon';