'use strict';

/* global Connector, Util */

Connector.playerSelector = '#player';

Connector.artistTrackSelector = '.player-current-title';

Connector.getArtistTrack = function() {
	var text = $(Connector.artistTrackSelector).text();
	var m = text.match(/ - /g);
	if (m && (m.length === 2)) {
		var arr = text.split(' - ');
		return {artist: arr[1], track: arr[2]};
	}
	return Util.splitArtistTrack(text);
};

Connector.isPlaying = function () {
	return $('.player-pause').is(':visible');
};

'use strict';

/* global Connector, Util */

Connector.playerSelector = '#player';

Connector.artistTrackSelector = '.player-current-title';

Connector.getArtistTrack = function() {
	var text = $(Connector.artistTrackSelector).text();
	var m = text.match(/ - /g);
	if (m && (m.length === 2)) {
		var arr = text.split(' - ');
		return {artist: arr[1], track: arr[2]};
	}
	return Util.splitArtistTrack(text);
};

Connector.isPlaying = function () {
	return $('.player-pause').is(':visible');
};

Connector.onReady = Connector.onStateChanged;

Use 'Connector.onReady' function to emulate DOM update