%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/bitrix/www/local/templates/p4_new/components/bitrix/news.list/castings/
Upload File :
Create Path :
Current File : //home/bitrix/www/local/templates/p4_new/components/bitrix/news.list/castings/script.js

function initConfirmatorModal(title, text) {
	$('#confirmator h3#myModalLabel').text(title);
	$('#confirmator div.modal-body').text(text);
	$('button#adbase-offer-close-btn').hide();
	$('button#adbase-offer-cancel-btn').show();
	$('button#adbase-offer-submit-btn').show();		
	$('button#adbase-offer-submit-btn').unbind('click');
}

function initConfirmatorButton() {
	$('button#adbase-offer-close-btn').show();
	$('button#adbase-offer-cancel-btn').hide();
	$('button#adbase-offer-submit-btn').hide();		
}

BX.ready(function(){
			
	$('a.post-show-more').click(function(){
		if ($(this).attr('data-show')=='N') {
			$(this).html(LOC_MESS["HIDE"]);
			vacancy_id = $(this).attr('data-post-id');
			$('#post-more-content-'+vacancy_id).fadeIn('slow');
			$(this).attr('data-show','Y');
			$(this).css("background","#633ebd");
			$(this).css("color","#fff");
			// Подгружаем отклики
			BX.ajax.get(
				feedback_url,
				{
					'VACANCY_ID': vacancy_id,
					'sessid': BX.bitrix_sessid(),
					'ajax': 'Y'
				},
				function (html) {
					$('div#post-more-content-'+vacancy_id+' div.feedback-container').html(html);
				}
			);
		}
		else {
			$(this).html(LOC_MESS["MORE_INFO"]);
			$('#post-more-content-'+$(this).attr('data-post-id')).hide();
			$(this).attr('data-show','N');
			$(this).css("background","none");
			$(this).css("color","#633ebd");
		}

	});
	    $(document).click(function (event) {
			if ($(event.target).attr('data-auth') != 'N') {
				$('span[id^="sh_m"]').popover('hide');
			}
		});
		$(document).click(function (event) {
			if ($(event.target).attr('type') != 'button') {
				$('span[id^="p_param"]').popover('hide');
			}
		});
	if (window.location.hash.length>0){
		id = window.location.hash.substring(1);
		$('a.post-show-more[data-post-id='+id+']').click();
		$('body').animate({ scrollTop: $('div.post-content-wrap[data-id='+id+']').offset().top-100 }, 500);
	}
	
	$('button#adbase-offer-close-btn').click(function() {
		window.location.reload();
	});

	$('button#adbase-offer-button-copy').click(function() {
		id = $(this).parents('div.post-content-wrap').data('id');

		initConfirmatorModal(LOC_MESS["REPUBLICATION_OFFER"],	LOC_MESS["RUN_REPUBLICATION_OFFER"]+id+' "'+
			$(this).parents('div.post-content-wrap').find('h3.content-title').text()+'"?');

		$('button#adbase-offer-submit-btn').click(function(){
			$('form#adbase-form-post input[name="ID"]').attr('value', id);
			$('form#adbase-form-post input[name="ACTION"]').attr('value', 'EDIT');
			$('form#adbase-form-post').submit();
		});

		$('#confirmator').modal('show');
	});

	$('button#adbase-offer-button-stop').click(function() {
		id = $(this).parents('div.post-content-wrap').data('id');
		initConfirmatorModal(LOC_MESS["CONFIRMATION_OF_UNPUBLISHING"],	LOC_MESS["UNPUBLISH_OFFER"]+id+' "'+
			$(this).parents('div.post-content-wrap').find('h3.content-title').text()+LOC_MESS["QUESTION"]);
		
		$('button#adbase-offer-submit-btn').click(function(){
			$.post(
				offerParams.url_ajax,
				{
					ACTION: 'STOP',
					ID: id,
				},
				function(result) {
					$('#confirmator div.modal-body').text(result);
					initConfirmatorButton();
				}
			);
		});

		$('#confirmator').modal('show');
	});

});

Zerion Mini Shell 1.0