";
hiddener.onclick=hiddencb;
document.getElementById("mw-content-text").appendChild(hiddener);
});
var hcb=0;
function hiddencb(){
if(hcb==0){
document.getElementById("mw-panel").style.transform="translateX(-170px)";
document.getElementById("content").style.marginLeft="0px";
document.getElementById("left-navigation").style.marginLeft="0px";
document.getElementById("openimg").style.transform="rotate(180deg)";
document.getElementById("footer").style.marginLeft="0px";
hcb=1;
}else{
document.getElementById("mw-panel").style.transform="translateX(0px)";
document.getElementById("content").style.marginLeft="10.5em";
document.getElementById("left-navigation").style.marginLeft="10.5em";
document.getElementById("openimg").style.transform="rotate(0deg)";
document.getElementById("footer").style.marginLeft="11em";
hcb=0;
}
}
');
if (data.artist) container.append('
' + data.artist + '
');
if (data.album) container.find('.subtitle').append(' - ' + data.album);
}
//if ($.client.profile().layout !== 'webkit') return;
var clientVersion = $.client.profile().versionNumber;
if (clientVersion<55) self.addClass('dark');
else self.addClass('light');
if (data.lrcsrc) $.ajax({
url: data.lrcsrc,
type: 'GET',
dataType: 'text',
error: function() {
var arg = ['error:'];
for (var i = 0, l = arguments.length; i
' + tags.title + '');
if (tags.artist && !data.artist) container.append('
' + tags.artist + '
');
if (tags.album) container.find('.subtitle').append(' - ' + tags.album);
}
if (!times.length) return finish(self, container);
var lrcList = $('
').appendTo(container.append(container.find('.title, .subtitle')[0] ? '
' : ''));
times.forEach(function(time) {
var li = $('
');
if (lrcs[time]) lrcs[time].split('\n').forEach(function(t) {
li.append($('').text(t));
});
lis[time] = li.appendTo(lrcList);
});
lrcList.find('div').each(function() {
if (this.innerText.trim() === '') this.remove();
});
var curIndex = -1;
audio.addEventListener('timeupdate', function() {
var time = (this.currentTime || 0) * 1000,
curLine;
for (var i = 0, l = times.length; i 0 ? i - 1 0 ? i - 1 : 0]];
break;
}
if (!curLine) curLine = lrcList.find('li').last();
if (curLine.hasClass('show')) return;
curLine.addClass('show').siblings().removeClass('show');
var prev = curLine.prev(),
height = 0,
maxHight = 0;
$(curLine.nextAll(':not(:empty)').slice(0, 2)).add(curLine).add(prev).each(function() {
maxHight += $(this).height();
});
if (maxHight > lrcList.height()) lrcList.height(maxHight);
if (!prev.text()) prev = prev.prev();
prev.prevAll().each(function() {
height += $(this).height();
});
curLine.parent().clearQueue().animate({
scrollTop: height
}, 370);
});
audio.addEventListener('play', function() {
var lastLine = lrcList.find('li:last'),
realLastLine = lrcList.find('li:not(:empty)').last();
if (!lastLine.is('.show:not(:empty)')) {
var lineHeight = realLastLine.height() + realLastLine.prev(':not(:empty)').height();
lastLine.css('margin-bottom', (lrcList.height() - lineHeight) + 'px');
}
});
finish(self, container);
}
});
else finish(self, container);
});
//要不要加分割线
function finish(self, container) {
if (!container.text()) container.remove();
self.fadeIn();
}
});
});
});