Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add Songfacts URLs to the sidebar

  • Loading branch information...
commit 6baf21d904eb510d82c24dc6713dea651c74e77b 1 parent 6dfffe7
@lalinsky lalinsky authored
View
1  lib/MusicBrainz/Server/Data/URL.pm
@@ -31,6 +31,7 @@ my %URL_SPECIALIZATIONS = (
'Ozon' => qr{^https?://(?:www.)?ozon.ru/}i,
'PureVolume' => qr{^https?://(?:www.)?purevolume.com/}i,
'SecondHandSongs' => qr{^https?://(?:www.)?secondhandsongs.com/}i,
+ 'Songfacts' => qr{^https?://(?:www.)?songfacts.com/}i,
'Twitter' => qr{^https?://(?:www.)?twitter.com/}i,
'VGMdb' => qr{^https?://(?:www.)?vgmdb.net/}i,
'Wikipedia' => qr{^https?://([\w-]{2,})\.wikipedia.org/wiki/}i,
View
36 lib/MusicBrainz/Server/Entity/URL/Songfacts.pm
@@ -0,0 +1,36 @@
+package MusicBrainz::Server::Entity::URL::Songfacts;
+
+use Moose;
+
+extends 'MusicBrainz::Server::Entity::URL';
+with 'MusicBrainz::Server::Entity::URL::Sidebar';
+
+sub sidebar_name {
+ my $self = shift;
+
+ return "Songfacts";
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
+
+=head1 COPYRIGHT
+
+Copyright (C) 2011 MetaBrainz Foundation
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+=cut
View
1  root/components/common-macros.tt
@@ -556,6 +556,7 @@ END -%]
ELSIF url.url.host.search('youtube.com'); 'youtube';
ELSIF url.url.host.search('discogs.com'); 'discogs';
ELSIF url.url.host.search('secondhandsongs.com'); 'secondhandsongs';
+ ELSIF url.url.host.search('songfacts.com'); 'songfacts';
ELSIF url.url.host.search('soundcloud.com'); 'soundcloud';
ELSE; '';
END %]
View
BIN  root/static/images/favicons/songfacts-16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 root/static/styles/layout.css
@@ -432,6 +432,10 @@ div.warning img.warning {
background-image: url("../images/favicons/secondhandsongs-16.png");
}
+#sidebar ul.external_links li.songfacts {
+ background-image: url("../images/favicons/songfacts-16.png");
+}
+
#sidebar ul.external_links li.soundcloud {
background-image: url("../images/favicons/soundcloud-16.png");
}
Please sign in to comment.
Something went wrong with that request. Please try again.