summaryrefslogtreecommitdiff
path: root/lib/VNDB
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
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')
-rw-r--r--lib/VNDB/Func.pm4
-rw-r--r--lib/VNDB/Handler/VNPage.pm4
-rw-r--r--lib/VNDB/Util/CommonHTML.pm8
-rw-r--r--lib/VNDB/Util/FormHTML.pm4
-rw-r--r--lib/VNDB/Util/LayoutHTML.pm7
5 files changed, 12 insertions, 15 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm
index b4848796..2644ea35 100644
--- a/lib/VNDB/Func.pm
+++ b/lib/VNDB/Func.pm
@@ -31,8 +31,8 @@ sub clearfloat {
# Draws a CSS icon, arguments: class, title
sub cssicon {
- acronym class => "icons $_[0]", title => $_[1];
- lit '&nbsp;';
+ abbr class => "icons $_[0]", title => $_[1];
+ lit '&#xa0;';
end;
}
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index cf8a50af..20f12bf3 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -668,7 +668,7 @@ sub _anime {
}
txt '] ';
end;
- acronym title => $_->{title_kanji}||$_->{title_romaji}, shorten $_->{title_romaji}, 50;
+ abbr title => $_->{title_kanji}||$_->{title_romaji}, shorten $_->{title_romaji}, 50;
b ' ('.(defined $_->{type} ? mt("_animetype_$_->{type}").', ' : '').$_->{year}.')';
br;
}
@@ -748,7 +748,7 @@ sub _affiliate_links {
|| ($f->{default_version} && $f->{default_version}->($self, $link, $rel))
|| $version;
txt " at $f->{name}";
- acronym class => 'pricenote', title =>
+ abbr class => 'pricenote', title =>
$link->{lastfetch} ? sprintf('Last updated: %s.', $en->age($link->{lastfetch})) : '', " for $link->{price}"
if $link->{price};
txt ' ยป';
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';