%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/bitrix/www/local/components/p4/p.castings.feedback/templates/.default/
Upload File :
Create Path :
Current File : //home/bitrix/www/local/components/p4/p.castings.feedback/templates/.default/script.js

function showJobMessanger(userID,el){
	
	BXIM.openMessenger(userID);

	comment = el.closest('td.rpt_comment').find('div.testimonial-content').text().trim();
	if (comment.length>50) comment = comment.substr(0,50);
	
	vacancy = el.closest('div.post-content-wrap').find('h3').text().trim();
	
	setTimeout(function(){
		$('div#bx-messenger-popup-messenger textarea.bx-messenger-textarea-input').val(LOC_MESS["REPLY_TO_RESPONSE_ON_VACANCY"]+vacancy+"\n>"+comment+"\n");
	},400);
	
}

BX.ready(function(){

	// Инициализация окна отклика
	$('.casting-feedback-button').click(function(e){
			vacancy_id = $(this).attr('data-casting-id');
			
		if ($(this).attr("data-parameters") != "Y" || $(this).attr("data-portfolio") != "Y" || $(this).attr("data-contacts") != "Y" || $(this).attr("data-sex-match") != "Y"){
			$("#p_param"+vacancy_id).popover({html: true});
			$("#p_param"+vacancy_id).popover('show');
			var post_m_left_en = '';
			var post_m_left_ru = '';
			if ($(this).attr("data-auth-user") == "Y" && $(this).attr("data-sex-match") == "Y"){

				if ($(this).attr("data-portfolio") == "N"){
					post_m_left_en = '440px';
					post_m_left_ru = '440px';
				} else {
					post_m_left_en = '465px';
					post_m_left_ru = '450px';
				};
			}
			else {
				post_m_left_en = '435px';
				post_m_left_ru = '435px';
			};
			if ($(this).attr("data-siteid") == "p4")
				{$(".post-more-content .popover").css('left', post_m_left_en);}
			else 
				{$(".post-more-content .popover").css('left', post_m_left_ru);};

		} else {
		$('#casting-feedback-dialog').find('#FEEDBACK_CASTING_ID').attr('value',$(this).attr('data-casting-id'));
		//$('#casting-feedback-dialog').find('#myModalLabel').html($(this).attr('data-casting-title'));
		$('#send-feedback-btn-dismiss').hide();
		$('#send-feedback-btn').show();
		$('#feedback-submit-answer').hide();
		$('#feedback-submit-body').show();
	  $('#casting-feedback-dialog').modal('show');
		};
	});
	
	// Сохранение отклика
	$('#send-feedback-btn').click(function(){
		$(this).prop("disabled", true);
		$(this).text('Loading');
		var cast_id = $('#casting-feedback-form').find('#FEEDBACK_CASTING_ID').attr('value');
		if ($('#casting-feedback-form').find('#FEEDBACK_TEXT').val().length>=0) {
			BX.ajax.post(
				$('#casting-feedback-form').attr('action'),
				{
					ajax: 'Y',
					sessid: $('#casting-feedback-form').find('#sessid').attr('value'),
					FEEDBACK_CASTING_ID: $('#casting-feedback-form').find('#FEEDBACK_CASTING_ID').attr('value'),
					FEEDBACK_TEXT: $('#casting-feedback-form').find('#FEEDBACK_TEXT').val(),
				},
				function (data) {
					$('#feedback-submit-answer').html(data);
					$('#feedback-submit-answer').show();
					$('#feedback-submit-answer').css("text-align", "center");
					$('#feedback-submit-body').hide();
					$('#send-feedback-btn-dismiss').show();
					$('#send-feedback-btn-dismiss').css("margin-right","40%");
					$('#send-feedback-btn').hide();
					$('.casting-feedback-button[data-casting-id="'+cast_id+'"]').prop('disabled', true);
					var r_alr = $('.casting-feedback-button[data-casting-id="'+cast_id+'"]').attr('data-already');
					$('.casting-feedback-button[data-casting-id="'+cast_id+'"]').text(r_alr);
				}
			);
		}
		else {
			alert(LOC_MESS["ENTER_YOUR_RESPONSE_TEXT_ON_ADVERT"]);
		}
	});

});

Zerion Mini Shell 1.0