'use strict';

/* global Connector */

Connector.playerSelector = '.global-content';

Connector.isPlaying = function () {
	return $('.player-buttonPause').length ||
			$('.Artist-Mini-Playing').length ||
			$('.Artist-Maximus-Playing').length ||
			$('.Hello-Mini-Playing').length ||
			($('#PlayerFrame iframe').contents().find("#Play").length ? //embed
			$('#PlayerFrame iframe').contents().find("#Play").attr('src').indexOf('pause') !== -1 :
			false);
};

Connector.getArtistTrack = function () {
	var artist = null;
	var track = null;

	if ($('#PlayerFrame iframe').contents().find("#Play").length ? //embed
			$('#PlayerFrame iframe').contents().find("#Play").attr('src').indexOf('pause') !== -1 :
			false) { //embed
		artist = $('.H-artist').text();
		track = $('#PlayerFrame iframe').contents().find("#PlayerPanel > :first-child").text();
	} else if ($('.player-buttonPause').length) {
		var text = $('.player:has(.player-buttonPause) .player-name span').text();
		var separator = this.findSeparator(text);

		if (separator !== null) {
			artist = text.substr(0, separator.index).trim();
			track = text.substr(separator.index + separator.length).trim();
		}
	} else if ($('.Hello-Mini-Playing').length) {
		artist = $('.H-artist').text();
		track = $('.Hello-Mini-Playing').attr('title');
	} else {
		artist = $('.AR-wrap:has(.Artist-Mini-Playing) .AR-name').text() ||
				$(':has(.Artist-Mini-Playing) > div > .Artist-link').text() ||
				$('.A-wrap:has(.Artist-Maximus-Playing) .AR-name').text();

		track = $('.Artist-Mini-Playing').attr('title') ||
				$('.Artist-Maximus-Playing').attr('title');
	}

	return {artist: artist, track: track};
};
Connector.getAlbum = function () {
	return $('#PlayerFrame iframe').contents().find("#Play").length ? //embed
			$('#TrackList h1').text() :
			$('.Release-preview:has(.Hello-Mini-Playing) .Release-select strong').text() || null;
};

@@ -314,39 +314,39 @@
 contents().find(
-%22
+'
 #Play
-%22
+'
 ).length ? //emb
@@ -340,32 +340,34 @@
 ength ? //embed%0A
+%09%09
 %09%09%09$('#PlayerFra
@@ -386,39 +386,39 @@
 contents().find(
-%22
+'
 #Play
-%22
+'
 ).attr('src').in
@@ -433,32 +433,34 @@
 ause') !== -1 :%0A
+%09%09
 %09%09%09false);%0A%7D;%0A%0AC
@@ -577,39 +577,39 @@
 contents().find(
-%22
+'
 #Play
-%22
+'
 ).length ? //emb
@@ -655,23 +655,23 @@
 ().find(
-%22
+'
 #Play
-%22
+'
 ).attr('
@@ -803,25 +803,25 @@
 ents().find(
-%22
+'
 #PlayerPanel
@@ -835,17 +835,17 @@
 st-child
-%22
+'
 ).text()
@@ -1744,15 +1744,15 @@
 ind(
-%22
+'
 #Play
-%22
+'
 ).le

Fix quotes farfrommoscow