mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-14 03:16:25 +00:00
Empty commit
This commit is contained in:
parent
57e9bad021
commit
11240c5b0e
@ -111,11 +111,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Escape ampersands with html code to avoid breaking the search links
|
// Escape ampersands with url code to avoid breaking the search links
|
||||||
function escapeAmp(input){
|
function escapeAmpUrl(input){
|
||||||
return input.replace(/&/g,"%26");
|
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.
|
// Functions for fetching the required data are as follows.
|
||||||
// Also gets the data for shared artists as they're bundled.
|
// Also gets the data for shared artists as they're bundled.
|
||||||
@ -166,11 +171,11 @@
|
|||||||
var k = initialCount;
|
var k = initialCount;
|
||||||
if (a.length < 3) k = a.length;
|
if (a.length < 3) k = a.length;
|
||||||
for (var i = 0; i < k; i++) {
|
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 ){
|
if ( a.length > 3 ){
|
||||||
for (i = 3; i < a.length; i++) {
|
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>'
|
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.
|
// Fix Last.fm API returning more than one entry despite limit on certain conditions.
|
||||||
if ( typeof(json[0]) === "object" ) json = json[0];
|
if ( typeof(json[0]) === "object" ) json = json[0];
|
||||||
html += '<li class="lastfm_essential">Last played: ';
|
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>";
|
html += "</li>";
|
||||||
lastPlayedTrack = html;
|
lastPlayedTrack = html;
|
||||||
}
|
}
|
||||||
@ -245,11 +250,11 @@
|
|||||||
var k = initialCount;
|
var k = initialCount;
|
||||||
if (j.length < 3) k = j.length;
|
if (j.length < 3) k = j.length;
|
||||||
for (var i = 0; i < k; i++) {
|
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 ){
|
if ( j.length>3 ){
|
||||||
for (i = 3; i < j.length; i++) {
|
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>'
|
html+= '<li>[<a href="#topartists" id="lastfm_expand" onclick="return false">Expand</a>]</li>'
|
||||||
}
|
}
|
||||||
@ -288,11 +293,11 @@
|
|||||||
var k = initialCount;
|
var k = initialCount;
|
||||||
if (j.length < 3) k = j.length;
|
if (j.length < 3) k = j.length;
|
||||||
for (var i = 0; i < k; i++) {
|
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 ){
|
if ( j.length>3 ){
|
||||||
for (i = 3; i < j.length; i++) {
|
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>'
|
html+= '<li>[<a href="#topalbums" id="lastfm_expand" onclick="return false">Expand</a>]</li>'
|
||||||
}
|
}
|
||||||
@ -331,11 +336,11 @@
|
|||||||
var k = initialCount;
|
var k = initialCount;
|
||||||
if (j.length < 3) k = j.length;
|
if (j.length < 3) k = j.length;
|
||||||
for (var i = 0; i < k; i++) {
|
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 ){
|
if ( j.length>3 ){
|
||||||
for (i = 3; i < j.length; i++) {
|
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>'
|
html+= '<li>[<a href="#toptracks" id="lastfm_expand" onclick="return false">Expand</a>]</li>'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user