/**
* Video club info layer constructor.
* @constructor
*/
function sclub_info(parent) {
this.on = false;
this.parent = parent;
this.dom_obj = create_block_element('layer_bg', document.body);
this.main_container = {};
this.film_title = {};
this.full_info = {};
this.film_cover = {};
this.scrollbar = {};
}
sclub_info.prototype.show = function (item) {
_debug('sclub_info.show');
this.item = item;
if (!module.downloads) {
this.color_buttons.get('red').disable();
} else {
this.color_buttons.get('red').enable();
}
this.dom_obj.show();
this.on = true;
this.fill(item);
};
sclub_info.prototype.hide = function () {
_debug('sclub_info.hide');
this.parent.on = true;
this.full_info.scrollTop = 0;
this.reset();
this.dom_obj.hide();
this.on = false;
this.scrollbar && this.scrollbar.reset && this.scrollbar.reset();
this.parent.password_input.on && this.parent.password_input.hide && this.parent.password_input.hide();
this.parent.rent_password_input.on && this.parent.rent_password_input.hide && this.parent.rent_password_input.hide();
this.parent.series_switch.on && this.parent.series_switch.hide && this.parent.series_switch.hide();
};
sclub_info.prototype.reset = function () {
_debug('sclub_info.reset');
this.film_title.innerHTML = '';
this.full_info.innerHTML = '';
this.film_cover.innerHTML = '';
};
sclub_info.prototype.init = function () {
this.logo_dom_obj = create_block_element('main_logo', this.dom_obj);
if (stb.user && stb.user.portal_logo_url) {
this.logo_dom_obj.style.background = 'url(' + stb.user.portal_logo_url + ') no-repeat';
}
this.header_path = create_block_element('mb_header_first', this.dom_obj);
this.path_container = document.createElement('span');
this.header_path.innerHTML = word['sclub_title'] + ' / ';
this.header_path.appendChild(this.path_container);
this.path_container.innerHTML = word['sclub_info'];
var ears_left_container = create_block_element('ears_left_container');
this.left_ear = create_block_element('ears_left');
var left_arrow = create_block_element('ears_arrow_left');
var text_element = create_block_element();
text_element.innerHTML = word['ears_back'];
this.left_ear.appendChild(left_arrow);
this.left_ear.appendChild(text_element);
this.left_ear.appendChild(left_arrow.cloneNode(true));
ears_left_container.appendChild(this.left_ear);
this.dom_obj.appendChild(ears_left_container);
this.main_container = create_block_element('mb_main_filminfo', this.dom_obj);
this.film_title = create_block_element('mb_filminfo_name', this.main_container);
var info_container = create_block_element('mb_filminfo_fullinfo', this.main_container);
this.full_info = create_block_element('mb_hidden_overflow', info_container);
this.scrollbar = new scrollbar(info_container, this.full_info, {"height": 350});
info_container.insertBefore(this.scrollbar.dom_obj, this.full_info);
//create_block_element('mb_filminfo_trans', this.main_container);
create_block_element('mb_filminfo_trans', info_container);
this.film_cover = create_block_element('mb_filminfo_prev', this.main_container);
this.hide();
};
sclub_info.prototype.fill = function (item) {
_debug('sclub_info.fill');
this.film_title.innerHTML = (item.name == item.o_name) ? item.name : item.name + ' / ' + item.o_name;
var full_info = '' + word['vclub_year'] + ': ' + item.year + '
';
full_info += '' + word['vclub_genre'] + ': ' + item.genres_str + '
';
if (item.country) {
full_info += '' + word['vclub_country'] + ': ' + item.country + '
';
}
full_info += '' + word['vclub_length'] + ': ' + item.time + ' ' + (empty(item.series) ? (word['vclub_minutes'] + '.') : '') + '
';
if (item.age) {
full_info += '' + get_word('vclub_age') + ': ' + item.age + '
';
}
if (item.rating_mpaa) {
full_info += '' + get_word('vclub_rating_mpaa') + ': ' + item.rating_mpaa + '
';
}
full_info += '