Empty commit

This commit is contained in:
Git 2013-01-28 08:00:16 +00:00
parent 57e9bad021
commit 11240c5b0e

View File

@ -111,10 +111,15 @@
}
}
// Escape ampersands with html code to avoid breaking the search links
function escapeAmp(input){
// Escape ampersands with url code to avoid breaking the search links
function escapeAmpUrl(input){
return input.replace(/&/g,"%26");
}
// Escape ampersands with html code to avoid breaking the search links
function escapeAmpHtml(input){
return input.replace(/&/g,"&");
}
// Functions for fetching the required data are as follows.
@ -166,11 +171,11 @@
var k = initialCount;
if (a.length < 3) k = a.length;
for (var i = 0; i < k; i++) {
sharedArtistsHtml += '<li><a href="artist.php?artistname=' + escapeAmp(a[i]['name']) + '">' + a[i]['name'] + '</a></li>'
sharedArtistsHtml += '<li><a href="artist.php?artistname=' + escapeAmpUrl(a[i]['name']) + '">' + escapeAmpHtml(a[i]['name']) + '</a></li>'
}
if ( a.length > 3 ){
for (i = 3; i < a.length; i++) {
sharedArtistsHtml += '<li class="hidden"><a href="artist.php?artistname=' + escapeAmp(a[i]['name']) + '">' + a[i]['name'] + '</a></li>'
sharedArtistsHtml += '<li class="hidden"><a href="artist.php?artistname=' + escapeAmpUrl(a[i]['name']) + '">' + escapeAmpHtml(a[i]['name']) + '</a></li>'
}
sharedArtistsHtml += '<li>[<a href="#sharedartists" id="lastfm_expand" onclick="return false">Expand</a>]</li>'
}
@ -210,7 +215,7 @@
// Fix Last.fm API returning more than one entry despite limit on certain conditions.
if ( typeof(json[0]) === "object" ) json = json[0];
html += '<li class="lastfm_essential">Last played: ';
html += '<a href="artist.php?artistname=' + escapeAmp(json['artist']['#text']) + '">' + json['artist']['#text'] + '</a> - <a href="torrents.php?searchstr=' + escapeAmp(json['name']) + '">' + json['name'] + '</a>';
html += '<a href="artist.php?artistname=' + escapeAmpUrl(json['artist']['#text']) + '">' + escapeAmpHtml(json['artist']['#text']) + '</a> - <a href="torrents.php?searchstr=' + escapeAmpUrl(json['name']) + '">' + escapeAmpHtml(json['name']) + '</a>';
html += "</li>";
lastPlayedTrack = html;
}
@ -245,11 +250,11 @@
var k = initialCount;
if (j.length < 3) k = j.length;
for (var i = 0; i < k; i++) {
html += '<li><a href="artist.php?artistname=' + escapeAmp(j[i]['name']) + '">' + j[i]['name'] + '</a></li>'
html += '<li><a href="artist.php?artistname=' + escapeAmpUrl(j[i]['name']) + '">' + escapeAmpHtml(j[i]['name']) + '</a></li>'
}
if ( j.length>3 ){
for (i = 3; i < j.length; i++) {
html += '<li class="hidden"><a href="artist.php?artistname=' + escapeAmp(j[i]['name']) + '">' + j[i]['name'] + '</a></li>'
html += '<li class="hidden"><a href="artist.php?artistname=' + escapeAmpUrl(j[i]['name']) + '">' + escapeAmpHtml(j[i]['name']) + '</a></li>'
}
html+= '<li>[<a href="#topartists" id="lastfm_expand" onclick="return false">Expand</a>]</li>'
}
@ -288,11 +293,11 @@
var k = initialCount;
if (j.length < 3) k = j.length;
for (var i = 0; i < k; i++) {
html += '<li><a href="artist.php?artistname=' + escapeAmp(j[i]['artist']['name']) + '">' + j[i]['artist']['name'] + '</a> - <a href="torrents.php?searchstr=' + escapeAmp(j[i]['name']) + '">' + j[i]['name'] + '</a></li>'
html += '<li><a href="artist.php?artistname=' + escapeAmpUrl(j[i]['artist']['name']) + '">' + escapeAmpHtml(j[i]['artist']['name']) + '</a> - <a href="torrents.php?searchstr=' + escapeAmpUrl(j[i]['name']) + '">' + escapeAmpHtml(j[i]['name']) + '</a></li>'
}
if ( j.length>3 ){
for (i = 3; i < j.length; i++) {
html += '<li class="hidden"><a href="artist.php?artistname=' + escapeAmp(j[i]['artist']['name']) + '">' + j[i]['artist']['name'] + '</a> - <a href="torrents.php?searchstr=' + escapeAmp(j[i]['name']) + '">' + j[i]['name'] + '</a></li>'
html += '<li class="hidden"><a href="artist.php?artistname=' + escapeAmpUrl(j[i]['artist']['name']) + '">' + escapeAmpHtml(j[i]['artist']['name']) + '</a> - <a href="torrents.php?searchstr=' + escapeAmpUrl(j[i]['name']) + '">' + escapeAmpHtml(j[i]['name']) + '</a></li>'
}
html+= '<li>[<a href="#topalbums" id="lastfm_expand" onclick="return false">Expand</a>]</li>'
}
@ -331,11 +336,11 @@
var k = initialCount;
if (j.length < 3) k = j.length;
for (var i = 0; i < k; i++) {
html += '<li><a href="artist.php?artistname=' + escapeAmp(j[i]['artist']['name']) + '">' + j[i]['artist']['name'] + '</a> - <a href="torrents.php?searchstr=' + escapeAmp(j[i]['name']) + '">' + j[i]['name'] + '</a></li>'
html += '<li><a href="artist.php?artistname=' + escapeAmpUrl(j[i]['artist']['name']) + '">' + escapeAmpHtml(j[i]['artist']['name']) + '</a> - <a href="torrents.php?searchstr=' + escapeAmpUrl(j[i]['name']) + '">' + escapeAmpHtml(j[i]['name']) + '</a></li>'
}
if ( j.length>3 ){
for (i = 3; i < j.length; i++) {
html += '<li class="hidden"><a href="artist.php?artistname=' + escapeAmp(j[i]['artist']['name']) + '">' + j[i]['artist']['name'] + '</a> - <a href="torrents.php?searchstr=' + escapeAmp(j[i]['name']) + '">' + j[i]['name'] + '</a></li>'
html += '<li class="hidden"><a href="artist.php?artistname=' + escapeAmpUrl(j[i]['artist']['name']) + '">' + escapeAmpHtml(j[i]['artist']['name']) + '</a> - <a href="torrents.php?searchstr=' + escapeAmpUrl(j[i]['name']) + '">' + escapeAmpHtml(j[i]['name']) + '</a></li>'
}
html+= '<li>[<a href="#toptracks" id="lastfm_expand" onclick="return false">Expand</a>]</li>'
}