// source --> https://www.vikyreal.cz/wp-content/plugins/realteo/assets/js/frontend.min.js
/* ----------------- Start Document ----------------- */
(function($){
"use strict";
$(document).ready(function(){
/*----------------------------------------------------*/
/* Inline CSS replacement for backgrounds etc.
/*----------------------------------------------------*/
function inlineCSS() {
// Common Inline CSS
$(".property-slider .item, .fullwidth-property-slider .item, .address-container").each(function() {
var attrImageBG = $(this).attr('data-background-image');
var attrColorBG = $(this).attr('data-background-color');
$(this).css('background-image', 'url('+attrImageBG+')');
$(this).css('background', ''+attrColorBG+'');
});
}
// Init
inlineCSS();
$('.realteo-dashboard-action-delete').click(function(e) {
e.preventDefault();
if (window.confirm(realteo.areyousure)) {
location.href = this.href;
}
});
$( '.realteo-ordering' ).on( 'change', 'select.orderby', function() {
var order = $(this).val();
$('#realteo-search-form #realteo_order').val(order);
if($( 'form#realteo-search-form' ).length>0) {
$( 'form#realteo-search-form' ).submit();
} else {
window.history.replaceState(null, null, window.location.pathname);
window.location.href = window.location.href + "?realteo_order="+order;
}
});
$('label.selectit input[type="checkbox"]').click(function(){
$(this).parent().toggleClass('active');
});
/*----------------------------------------------------*/
/* Slick Carousel
/*----------------------------------------------------*/
$('.property-slider').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: true,
fade: true,
asNavFor: '.property-slider-nav',
centerMode: true,
slide: ".item"
});
$('.property-slider-nav').slick({
slidesToShow: 6,
slidesToScroll: 1,
asNavFor: '.property-slider',
dots: false,
arrows: false,
centerMode: false,
focusOnSelect: true,
responsive: [
{
breakpoint: 993,
settings: {
slidesToShow: 4,
}
},
{
breakpoint: 767,
settings: {
slidesToShow: 3,
}
}
]
});
$('.fullwidth-property-slider').slick({
centerMode: true,
centerPadding: '20%',
slidesToShow: 1,
responsive: [
{
breakpoint: 1367,
settings: {
centerPadding: '15%'
}
},
{
breakpoint: 993,
settings: {
centerPadding: '0'
}
}
]
});
$('.fullwidth-home-slider').slick({
centerMode: true,
centerPadding: '0',
slidesToShow: 1,
responsive: [
{
breakpoint: 1367,
settings: {
centerPadding: '0'
}
},
{
breakpoint: 993,
settings: {
centerPadding: '0'
}
}
]
});
/*----------------------------------------------------*/
/* Mortgage Calculator
/*----------------------------------------------------*/
// Gets property price
var propertyPricing = parseFloat($('.property-price').text().replace(/[^0-9\.]+/g,""));
if (propertyPricing > 0) {
$('.pick-price').on('click', function(){
$('#amount').val(parseInt(propertyPricing));
});
}
// replacing comma with dot
$('.mortgageCalc').on( 'change', '#interest', function() {
$("#interest").val($("#interest").val().replace(/,/g, '.'));
});
// Calculator
function mortgageCalc() {
var amount = parseFloat($("#amount").val().replace(/[^0-9\.]+/g,"")),
months =parseFloat($("#years").val().replace(/[^0-9\.]+/g,"")*12),
down = parseFloat($("#downpayment").val().replace(/[^0-9\.]+/g,"")),
annInterest = parseFloat($("#interest").val().replace(/[^0-9\.]+/g,"")),
monInt = annInterest / 1200,
calculation = ((monInt + monInt / (Math.pow(1 + monInt, months) - 1)) * (amount - (down || 0))).toFixed(2);
if (calculation > 0 ){
$(".calc-output-container").css({'opacity' : '1', 'max-height' : '200px' });
$(".calc-output").hide().html(calculation + ' ' + $('.mortgageCalc').attr("data-calc-currency")).fadeIn(300);
}
}
// Calculate
$('.calc-button').on('click', function(){
mortgageCalc();
});
/*----------------------------------------------------*/
/* Compare Menu
/*----------------------------------------------------*/
$('.csm-trigger').on('click', function(){
$('.compare-slide-menu').toggleClass('active');
});
$('.csm-mobile-trigger').on('click', function(){
$('.compare-slide-menu').removeClass('active');
});
// Tooltips
$(".compare-button.with-tip, .like-icon.with-tip, .widget-button.with-tip").each(function() {
$(this).on('click', function(e){
e.preventDefault();
});
var tipContent = $(this).attr('data-tip-content');
if($(this).hasClass('already-added')){
$(this).append('
'+ $(this).attr('data-tip-added-content') + '
');
} else {
$(this).append(''+ tipContent + '
');
}
});
$('.compare-button, .compare-widget-button').on('click', function(e){
e.preventDefault();
/*if it's already added show the sidebar and stop*/
if($(this).hasClass('already-added')){
$('.compare-slide-menu').fadeIn().addClass('active');
return;
}
var tipAddingContent = $(this).attr('data-tip-adding-content');
var tipAddedContent = $(this).attr('data-tip-added-content');
/* if there are 1-3 properties, proceed to add on emore*/
if($(".csm-properties .listing-item").length < 4) {
$(this).find(".tip-content").html(tipAddingContent);
$('.compare-button, .compare-widget-button').fadeIn();
$(this).addClass('clicked');
var post_id = $(this).data("post_id"),
handler = $(this),
nonce = $(this).data("nonce"),
addedtolist = $(this).data("saved-title")
$.ajax({
type : "post",
dataType : "json",
url : realteo.ajax_url,
data : {action: "realteo_compare_this", post_id : post_id, nonce: nonce},
success : function(response) {
if(response.type == "success") {
handler.removeClass('clicked').addClass('compared').addClass('already-added');
$('.csm-properties').append(response.html);
$('.compare-slide-menu').fadeIn().addClass('active');
handler.find(".tip-content").html(tipAddedContent);
if($(".csm-properties .listing-item").length > 4) {
$('.compare-slide-menu').fadeIn().addClass('active');
$('.compare-slide-menu .notification').show();
setTimeout( function(){ $('.compare-slide-menu .notification').fadeOut() }, 2500 );
}
} else {
handler.removeClass('clicked')
handler.find(".tip-content").html(response.message);
}
}
});
} else {
$('.compare-slide-menu').fadeIn().addClass('active');
$('.compare-slide-menu .notification').show();
setTimeout( function(){ $('.compare-slide-menu .notification').fadeOut() }, 2500 );
}
});
$(".compare-list-container .remove-from-compare").on('click', function(e){
e.preventDefault();
var handler = $(this);
var post_id = $(this).data("post_id");
var nonce = $(this).data("nonce");
var index = handler.parent().parent().parent().index();
$( "#compare-list li.compare-list-properties > div:eq("+index+")").addClass('opacity-05');
$.ajax({
type : "post",
dataType : "json",
url : realteo.ajax_url,
data : {action: "realteo_uncompare_this", post_id : post_id, nonce: nonce},
success : function(response) {
if(response.type == "success") {
console.log($('#compare-list li.compare-list-properties > div').length);
var number_left = $('#compare-list li.compare-list-properties > div').length;
if(number_left == 2) {
$('.compare-list-container').fadeOut(300, function() { $(this).remove(); });
$('.nothing-compares-2u').show();
}
$( "#compare-list li.compare-list-properties > div:eq("+index+")").fadeOut(300, function() { $(this).remove(); });
$( "#compare-list li:not(.compare-list-properties)" ).each(function() {
$( this ).find('div:eq('+index+' )').fadeOut(300, function() { $(this).remove(); });
});
}
else {
$( "#compare-list li.compare-list-properties > div:eq("+index+")").removeClass('opacity-05');
}
}
})
});
$('.compare-slide-menu').on( 'click', '.reset-compare', function(e) {
e.preventDefault();
var handler = $(this);
var nonce = $(this).data("nonce");
$(".csm-properties").addClass('opacity-05');
$.ajax({
type : "post",
dataType : "json",
url : realteo.ajax_url,
data : {action: "realteo_uncompare_all", nonce: nonce},
success : function(response) {
if(response.type == "success") {
$(".csm-properties").empty();
$('.compare-slide-menu').removeClass('active');
setTimeout( function(){ $('.compare-slide-menu').fadeOut().removeClass('opacity-05') }, 500 );
} else {
alert(response.message);
$(".csm-properties").removeClass('opacity-05');
}
}
})
});
$('.compare-slide-menu').on( 'click', '.remove-from-compare', function(e) {
e.preventDefault();
var handler = $(this);
var post_id = $(this).data("post_id");
var nonce = $(this).data("nonce");
$(this).parent().parent().addClass('opacity-05');
$.ajax({
type : "post",
dataType : "json",
url : realteo.ajax_url,
data : {action: "realteo_uncompare_this", post_id : post_id, nonce: nonce},
success : function(response) {
if(response.type == "success") {
handler.parent().parent().fadeOut(300, function() {
$(this).remove();
$('.compare-widget-button.with-tip').removeClass('already-added').find('.tip-content').html($('.compare-widget-button.with-tip').data('tip-content'));
if ($(".csm-properties .listing-item").length == 0){
$('.compare-slide-menu').removeClass('active')
setTimeout( function(){ $('.compare-slide-menu').fadeOut() }, 500 );
}
});
} else {
alert(response.message);
handler.parent().parent().removeClass('opacity-05');
}
}
})
});
/*----------------------------------------------------*/
/* Owl Carousel
/*----------------------------------------------------*/
$('.carousel').owlCarousel({
autoPlay: false,
navigation: true,
slideSpeed: 600,
items : 3,
itemsDesktop : [1239,3],
itemsTablet : [991,2],
itemsMobile : [767,1]
});
$('.testimonial-carousel').owlCarousel({
autoPlay: false,
navigation: false,
dots: true,
slideSpeed: 600,
items : 3,
itemsDesktop : [1239,3],
itemsTablet : [991,2],
itemsMobile : [767,1]
});
$('.agents-carousel').owlCarousel({
autoPlay: false,
navigation: true,
slideSpeed: 600,
items : 4,
itemsDesktop : [1239,3],
itemsTablet : [991,2],
itemsMobile : [767,1]
});
$('.logo-carousel').owlCarousel({
autoPlay: false,
navigation: true,
slideSpeed: 600,
items : 5,
itemsDesktop : [1239,4],
itemsTablet : [991,3],
itemsMobile : [767,1]
});
$('.listing-carousel').owlCarousel({
autoPlay: false,
navigation: true,
slideSpeed: 800,
items : 1,
itemsDesktop : [1239,1],
itemsTablet : [991,1],
itemsMobile : [767,1]
});
$('.owl-next, .owl-prev').on("click", function (e) {
e.preventDefault();
});
$('#realteo_reset_filters').on("click", function (e) {
e.preventDefault();
$('#realteo-search-form').get(0).reset();
$('#realteo-search-form input').val('');
$("#realteo-search-form .chosen-select").val('').trigger("chosen:updated");
$('#realteo-search-form').find('input[type=checkbox]:checked').removeAttr('checked');
$(".first-slider-value").each(function() {
var name = $(this).attr('name');
var val = realteo[name];
var $slider = $(this).parent();
$slider.slider("values", 0, val);
$(this).val(val);
});
$(".second-slider-value").each(function() {
var name = $(this).attr('name');
var val = realteo[name];
var $slider = $(this).parent();
$slider.slider("values", 1, val);
$(this).val(val);
});
});
/*----------------------------------------------------*/
/* Chosen Plugin
/*----------------------------------------------------*/
var config = {
'.chosen-select' : {disable_search_threshold: 10, width:"100%"},
'.chosen-select-deselect' : {allow_single_deselect:true, width:"100%"},
'.chosen-select-no-single' : {disable_search_threshold:100, width:"100%"},
'.chosen-select-no-single.no-search' : {disable_search_threshold:10, width:"100%"},
'.chosen-select-no-results': {no_results_text:'Oops, nothing found!'},
'.chosen-select-width' : {width:"95%"}
};
for (var selector in config) {
if (config.hasOwnProperty(selector)) {
$(selector).chosen(config[selector]);
}
}
/* Custom Input With Select
/*----------------------------------------------------*/
$('.select-input').each(function(){
var thisContainer = $(this);
var $this = $(this).children('select'), numberOfOptions = $this.children('option').length;
$this.addClass('select-hidden');
$this.wrap('');
$this.after('');
var $styledSelect = $this.next('div.select-styled');
$styledSelect.text($this.children('option').eq(0).text());
var $list = $('', {
'class': 'select-options'
}).insertAfter($styledSelect);
for (var i = 0; i < numberOfOptions; i++) {
$('', {
text: $this.children('option').eq(i).text(),
rel: $this.children('option').eq(i).val()
}).appendTo($list);
}
var $listItems = $list.children('li');
$list.wrapInner('');
$(this).children('input').on('click', function(e){
$('.select-options').hide();
e.stopPropagation();
$styledSelect.toggleClass('active').next('ul.select-options').toggle();
});
$(this).children('input').keypress(function() {
$styledSelect.removeClass('active');
$list.hide();
});
$listItems.on('click', function(e){
e.stopPropagation();
// $styledSelect.text($(this).text()).removeClass('active');
$(thisContainer).children('input').val( $(this).text() ).removeClass('active');
$this.val($(this).attr('rel'));
$list.hide();
//console.log($this.val());
});
$(document).on('click', function(e){
$styledSelect.removeClass('active');
$list.hide();
});
// Unit character
var fieldUnit = $(this).children('input').attr('data-unit');
if(fieldUnit) {
$(this).children('input').before(''+ fieldUnit + '');
}
});
/*----------------------------------------------------*/
/* Search Handler
/*----------------------------------------------------*/
$('.main-search-input #keyword_search').change(function() {
$('.sidebar #search_keywords').val($(this).val());
});
if($('#realteo-search-form').length>0){
$("#myButton").click(function() {
$("#myForm").submit();
});
}
/*----------------------------------------------------*/
/* Searh Form More Options
/*----------------------------------------------------*/
$('.more-search-options-trigger').on('click', function(e){
e.preventDefault();
$('.more-search-options, .more-search-options-trigger').toggleClass('active');
$('.more-search-options.relative').animate({height: 'toggle', opacity: 'toggle'}, 300);
});
if ($("#realteo-search-form .more-search-options input:checkbox:checked").length > 0) {
$('.more-search-options, .more-search-options-trigger').toggleClass('active');
$('.more-search-options.relative').animate({height: 'toggle', opacity: 'toggle'}, 300);
}
/*----------------------------------------------------*/
/* Range Sliders
/*----------------------------------------------------*/
// Range
$(".range-slider-element").each(function() {
var id = $(this).attr('id');
var offer_type = $('#_offer_type').val();
if( id == '_price' && offer_type ){
var dataMin = realteo[offer_type + '_' + id + '_min'],
dataMax = realteo[offer_type + '_' + id + '_max'];
} else {
var dataMin = realteo[id+'_min'],
dataMax = realteo[id+'_max'];
}
if(typeof dataMin == typeof undefined) {
dataMin = $(this).attr('data-min');
}
if(typeof dataMax == typeof undefined) {
dataMax = $(this).attr('data-max');
}
var
dataValueMax = $(this).attr('data-value-max'),
dataValueMin = $(this).attr('data-value-min'),
dataUnit = $(this).attr('data-unit'),
name = $(this).attr('id');
$(this).append( "" );
$(this).slider({
range: true,
animate: true,
min: parseInt(dataMin),
max: parseInt(dataMax),
values: [ parseInt(dataValueMin), parseInt(dataValueMax) ],
slide: function( event, ui ) {
event = event;
$(this).children( ".first-slider-value" ).val( dataUnit + ui.values[ 0 ].toString() );
$(this).children( ".second-slider-value" ).val( dataUnit + ui.values[ 1 ].toString() );
}
});
$(this).children( ".first-slider-value" ).val( dataUnit + $( this ).slider( "values", 0 ).toString() );
$(this).children( ".second-slider-value" ).val( dataUnit + $( this ).slider( "values", 1 ).toString() );
});
$(".realteo-bookmark-it").click( function(e) {
e.preventDefault();
var tipAddingContent = $(this).attr('data-tip-content-bookmarking');
var tipAddedContent = $(this).attr('data-tip-content-bookmarked');
if($(this).is('.clicked,.liked')){
return;
}
$(this).addClass('clicked');
$(this).find(".tip-content").html(tipAddingContent);
var post_id = $(this).data("post_id"),
handler = $(this),
nonce = $(this).data("nonce"),
addedtolist = $(this).data("saved-title")
$.ajax({
type : "post",
dataType : "json",
url : realteo.ajax_url,
data : {action: "realteo_bookmark_this", post_id : post_id, nonce: nonce},
success : function(response) {
if(response.type == "success") {
handler.removeClass('clicked').addClass('liked');
handler.find(".tip-content").html(tipAddedContent);
}
else {
alert(response.message);
handler.removeClass('clicked')
}
}
})
});
$(".realteo-unbookmark-it").click( function(e) {
e.preventDefault();
var handler = $(this);
var post_id = $(this).data("post_id");
var nonce = $(this).data("nonce");
handler.closest('tr').addClass('opacity-05');
$.ajax({
type : "post",
dataType : "json",
url : realteo.ajax_url,
data : {action: "realteo_unbookmark_this", post_id : post_id, nonce: nonce},
success : function(response) {
console.log(response);
if(response.type == "success") {
handler.closest('tr').fadeOut();
}
else {
handler.closest('tr').removeClass('opacity-05');
}
}
})
});
// Tooltip
$(".tip").each(function() {
var tipContent = $(this).attr('data-tip-content');
$(this).append(''+ tipContent + '
');
});
/*----------------------------------------------------*/
/* Listing Layout Switcher
/*----------------------------------------------------*/
function gridLayoutSwitcher() {
var listingsContainer = $('.listings-container:not(.relateo-related-properties)');
var saved = Cookies.get('findeo-layout');
console.log(saved);
if(saved) {
listingsContainer.addClass(saved)
}
// switcher buttons / anchors
if ( $(listingsContainer).is(".list-layout") ) {
owlReload();
$('.layout-switcher a.grid, .layout-switcher a.grid-three').removeClass("active");
$('.layout-switcher a.list').addClass("active");
}
if ( $(listingsContainer).is(".grid-layout") ) {
owlReload();
$('.layout-switcher a.grid').addClass("active");
$('.layout-switcher a.grid-three, .layout-switcher a.list').removeClass("active");
gridClear(2);
}
if ( $(listingsContainer).is(".grid-layout-three") ) {
owlReload();
$('.layout-switcher a.grid, .layout-switcher a.list').removeClass("active");
$('.layout-switcher a.grid-three').addClass("active");
gridClear(3);
}
// grid cleaning
function gridClear(gridColumns) {
$(listingsContainer).find(".clearfix").remove();
$(".listings-container > .listing-item:nth-child("+gridColumns+"n)").after("");
}
// objects that need to resized
var resizeObjects = $('.listings-container .listing-img-container img, .listings-container .listing-img-container').not('.listings-container.compact .listing-img-container img, .listings-container.compact .listing-img-container');
// if list layout is active
function listLayout() {
if ( $('.layout-switcher a').is(".list.active") ) {
$(listingsContainer).each(function(){
$(this).removeClass("grid-layout grid-layout-three");
$(this).addClass("list-layout");
});
$('.listing-item').each(function(){
var listingContent = $(this).find('.listing-content').height();
$(this).find(resizeObjects).css('height', ''+listingContent+'');
});
}
} listLayout();
$(window).on('load resize', function() {
listLayout();
});
// if grid layout is active
$('.layout-switcher a.grid').on('click', function(e) { gridClear(2); });
function gridLayout() {
if ( $('.layout-switcher a').is(".grid.active") ) {
$(listingsContainer).each(function(){
$(this).removeClass("list-layout grid-layout-three");
$(this).addClass("grid-layout");
});
$('.listing-item').each(function(){
$(this).find(resizeObjects).css('height', 'auto');
});
}
} gridLayout();
// if grid layout is active
$('.layout-switcher a.grid-three').on('click', function(e) { gridClear(3); });
function gridThreeLayout() {
if ( $('.layout-switcher a').is(".grid-three.active") ) {
$(listingsContainer).each(function(){
$(this).removeClass("list-layout grid-layout");
$(this).addClass("grid-layout-three");
});
$('.listing-item').each(function(){
$(this).find(resizeObjects).css('height', 'auto');
});
}
} gridThreeLayout();
// Mobile fixes
$(window).on('resize', function() {
$(resizeObjects).css('height', '0');
listLayout();
gridLayout();
gridThreeLayout();
});
$(window).on('load resize', function() {
var winWidth = $(window).width();
if(winWidth < 992) {
owlReload();
// reset to two columns grid
gridClear(2);
}
if(winWidth > 992) {
if ( $(listingsContainer).is(".grid-layout-three") ) {
gridClear(3);
}
if ( $(listingsContainer).is(".grid-layout") ) {
gridClear(2);
}
}
if(winWidth < 768) {
if ( $(listingsContainer).is(".list-layout") ) {
$('.listing-item').each(function(){
$(this).find(resizeObjects).css('height', 'auto');
});
}
}
if(winWidth < 1366) {
if ( $(".fs-listings").is(".list-layout") ) {
$('.listing-item').each(function(){
$(this).find(resizeObjects).css('height', 'auto');
});
}
}
});
// owlCarousel reload
function owlReload() {
$('.listing-carousel').each(function(){
$(this).data('owlCarousel').reload();
});
}
// switcher buttons
$('.layout-switcher a').on('click', function(e) {
e.preventDefault();
var switcherButton = $(this);
switcherButton.addClass("active").siblings().removeClass('active');
Cookies.set("findeo-layout", $(this).attr('id'));
// reset images height
$(resizeObjects).css('height', '0');
// carousel reload
owlReload();
// if grid layout is active
gridLayout();
// if three columns grid layout is active
gridThreeLayout();
// if list layout is active
listLayout();
});
} gridLayoutSwitcher();
/* Adjusting Similar Listings List Layout */
function similarPropertiesResize() {
$('.listings-container.list-layout .listing-item').each(function(){
var listingContentS = $(this).find('.listing-content').height();
$(this).find('.listing-img-container img, .listing-img-container').css('height', ''+listingContentS+'');
});
}
similarPropertiesResize();
$(window).on('load resize', function() {
similarPropertiesResize();
var resizeGridObjects = $('.listings-container .listing-img-container img, .listings-container .listing-img-container').not('.listings-container.compact .listing-img-container img, .listings-container.compact .listing-img-container');
$('.listings-container.grid-layout-three .listing-item, .listings-container.grid-layout .listing-item').each(function(){
$(this).find(resizeGridObjects).css('height', 'auto');
});
});
$('.agency-tabs li a').on('click', function() {
setTimeout(function(){
similarPropertiesResize();
}, 100);
});
/*----------------------------------------------------*/
/* Masonry
/*----------------------------------------------------*/
// Agent Profile Alignment
$(window).on('load resize', function() {
$('.agents-grid-container').masonry({
itemSelector: '.grid-item', // use a separate class for itemSelector, other than .col-
columnWidth: '.grid-item',
percentPosition: true,
horizontalOrder: true
});
$('.findeo-post-grid-wrapper').masonry({
itemSelector: '.col-md-4', // use a separate class for itemSelector, other than .col-
columnWidth: '.col-md-4',
percentPosition: true,
horizontalOrder: true
});
var agentAvatarHeight = $(".agent-avatar img").height();
var agentContentHeight = $(".agent-content").innerHeight();
if ( agentAvatarHeight < agentContentHeight ) {
$('.agent-page').addClass('long-content');
} else {
$('.agent-page').removeClass('long-content');
}
});
if($("#avatar-uploader").length>0) {
/* Upload using dropzone */
Dropzone.autoDiscover = false;
var avatarDropzone = new Dropzone ("#avatar-uploader", {
url: realteo.upload,
maxFiles:1,
dictDefaultMessage: realteo.dictDefaultMessage,
dictFallbackMessage: realteo.dictFallbackMessage,
dictFallbackText: realteo.dictFallbackText,
dictFileTooBig: realteo.dictFileTooBig,
dictInvalidFileType: realteo.dictInvalidFileType,
dictResponseError: realteo.dictResponseError,
dictCancelUpload: realteo.dictCancelUpload,
dictCancelUploadConfirmation: realteo.dictCancelUploadConfirmation,
dictRemoveFile: realteo.dictRemoveFile,
dictMaxFilesExceeded: realteo.dictMaxFilesExceeded,
acceptedFiles: 'image/*',
accept: function(file, done) {
done();
},
init: function() {
this.on("addedfile", function() {
if (this.files[1]!=null){
this.removeFile(this.files[0]);
}
});
},
success: function (file, response) {
file.previewElement.classList.add("dz-success");
file['attachment_id'] = response; // push the id for future reference
$("#avatar-uploader-id").val(file['attachment_id']);
},
error: function (file, response) {
file.previewElement.classList.add("dz-error");
},
// update the following section is for removing image from library
addRemoveLinks: true,
removedfile: function(file) {
var attachment_id = file['attachment_id'];
$("#avatar-uploader-id").val('');
$.ajax({
type: 'POST',
url: realteo.delete,
data: {
media_id : attachment_id
},
success: function (result) {
console.log(result);
},
error: function () {
console.log("delete error");
}
});
var _ref;
return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
}
});
avatarDropzone.on("maxfilesexceeded", function(file)
{
this.removeFile(file);
});
if($('.edit-profile-photo').attr('data-photo')){
var mockFile = { name: $('.edit-profile-photo').attr('data-name'), size: $('.edit-profile-photo').attr('data-size') };
avatarDropzone.emit("addedfile", mockFile);
avatarDropzone.emit("thumbnail", mockFile, $('.edit-profile-photo').attr('data-photo'));
avatarDropzone.emit("complete", mockFile);
avatarDropzone.files.push(mockFile);
// If you use the maxFiles option, make sure you adjust it to the
// correct amount:
avatarDropzone.options.maxFiles = 1;
}
}
var type = $('#_offer_type,#offer_type,input[name="_offer_type"]:checked').val();
if(realteo.available_for_rental.indexOf(type) !== -1) {
$('#rental_period').prop('disabled', false).trigger("chosen:updated");
$('#_rental_period').prop('disabled', false).trigger("chosen:updated");
} else {
$('#rental_period').prop('disabled', true).trigger("chosen:updated");
$('#_rental_period').prop('disabled', true).trigger("chosen:updated");
}
if($.isArray(type)) {
$('#rental_period').prop('disabled', false).trigger("chosen:updated");
$('#_rental_period').prop('disabled', false).trigger("chosen:updated");
}
$(document.body).on('change', '#_offer_type,#offer_type,input[name="_offer_type"]', function () {
var type = $(this).val();
var rent_price_min = realteo.rent_price_min,
rent_price_max = realteo.rent_price_max,
sale_price_min = realteo.sale_price_min,
sale_price_max = realteo.sale_price_max,
_price_min = realteo._price_min,
_price_max = realteo._price_max;
if(isNaN(sale_price_min) || sale_price_min == null) {
sale_price_min = realteo._price_min;
}
if(isNaN(sale_price_max) || sale_price_max == null) {
sale_price_max = realteo._price_max;
}
console.log(type);
console.log(realteo.available_for_rental);
if(realteo.available_for_rental.indexOf(type) !== -1) {
$('.range-slider-element#_price input[name=_price_min]').val( parseInt(rent_price_min));
$('.range-slider-element#_price input[name=_price_max]').val( parseInt(rent_price_max));
$('.range-slider-element#_price').slider("option", "min", parseInt(rent_price_min));
$('.range-slider-element#_price').slider("option", "max", parseInt(rent_price_max));
$('#rental_period').prop('disabled', false).trigger("chosen:updated");
$('#_rental_period').prop('disabled', false).trigger("chosen:updated");
$('.range-slider-element#_price').slider( "option", "values", [ parseInt(rent_price_min), parseInt(rent_price_max) ] );
} else if(type === 'sale') {
$('#rental_period').prop('disabled', true).trigger("chosen:updated");
$('#_rental_period').prop('disabled', true).trigger("chosen:updated");
$('.range-slider-element#_price input[name=_price_min]').val( parseInt(sale_price_min));
$('.range-slider-element#_price input[name=_price_max]').val( parseInt(sale_price_max));
$('.range-slider-element#_price').slider("option", "min", parseInt(sale_price_min));
$('.range-slider-element#_price').slider("option", "max", parseInt(sale_price_max));
$('.range-slider-element#_price').slider( "option", "values", [ parseInt(sale_price_min), parseInt(sale_price_max) ] );
} else {
if($.isArray(type)) {
$('#rental_period').prop('disabled', false).trigger("chosen:updated");
$('#_rental_period').prop('disabled', false).trigger("chosen:updated");
} else {
$('#rental_period').prop('disabled', true).trigger("chosen:updated");
$('#_rental_period').prop('disabled', true).trigger("chosen:updated");
}
$('.range-slider-element#_price').slider("option", "min", parseInt(_price_min));
$('.range-slider-element#_price').slider("option", "max", parseInt(sale_price_max));
$('.range-slider-element#_price').slider( "option", "values", [ parseInt(_price_min), parseInt(sale_price_max) ] );
$('.range-slider-element#_price input[name=_price_min]').val( parseInt(_price_min));
$('.range-slider-element#_price input[name=_price_max]').val( parseInt(sale_price_max));
}
});
$('.print-simple').on( "click", function() {
window.print();
return false;
});
/*----------------------------------------------------*/
/* Floorplans
/*----------------------------------------------------*/
// Unit character
var floorArea = $('.floorplans-area').children('input').attr('data-fp-unit');
$('.floorplans-area').children('input').before(''+ floorArea + '');
$('.fm-move').on('click', function() {
$(this).parent().parent().toggleClass("active");
});
var dropzones = [];
$( "table#floorplans-submit-container tr" ).each(function(index) {
Dropzone.autoDiscover = false;
var tr = $(this);
dropzones[index] = tr.find('.floor_dropzone').dropzone({
url: realteo.upload,
maxFiles:1,
acceptedFiles: 'image/*',
success: function (file, response) {
file.previewElement.classList.add("dz-success");
file['attachment_id'] = response; // push the id for future reference
tr.find('.floorplans_image_id').val(file['attachment_id']);
},
error: function (file, response) {
file.previewElement.classList.add("dz-error");
},
// update the following section is for removing image from library
addRemoveLinks: true,
removedfile: function(file) {
var attachment_id = file['attachment_id'];
tr.find('.floorplans_image_id').val('');
$.ajax({
type: 'POST',
url: realteo.delete,
data: {
media_id : attachment_id
},
success: function (result) {
console.log(result);
},
error: function () {
console.log("delete error");
}
});
var _ref;
return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
}
});
var thumb_url = tr.find('.floorplans_image').val();
var thumb_id = tr.find('.floorplans_image_id').val();
var thumb_size = tr.find('.floorplans_image').data('size');
if(thumb_url){
var mockFile = { name: tr.find('.floorplans_title').val(), size: thumb_size, attachment_id: thumb_id };
dropzones[index].get(0).dropzone.emit("addedfile", mockFile);
dropzones[index].get(0).dropzone.emit("thumbnail", mockFile, thumb_url);
dropzones[index].get(0).dropzone.emit("complete", mockFile);
dropzones[index].get(0).dropzone.files.push(mockFile);
dropzones[index].get(0).dropzone.options.maxFiles = 1;
dropzones[index].on("maxfilesexceeded", function(file) {
this.removeFile(file);
});
}
});
function newMenuItem() {
var row = $('.add-floorplans-submit-item').data( 'toclone' );
row = row.replace( /\[-1\]/g, "[" + $('table#floorplans-submit-container').find('tr').size() + "]");
var index = $('table#floorplans-submit-container').find('tr').size();
$($(row)).appendTo('table#floorplans-submit-container').each(function() {
var fpItem = $(this);
$(this).find('.fm-move').on('click', function() {
fpItem.toggleClass("active");
});
var tr = $(this);
dropzones[index] = $(this).find('.floor_dropzone').dropzone({
url: realteo.upload,
maxFiles:1,
acceptedFiles: 'image/*',
success: function (file, response) {
file.previewElement.classList.add("dz-success");
file['attachment_id'] = response; // push the id for future reference
tr.find('.floorplans_image_id').val(file['attachment_id']);
},
error: function (file, response) {
file.previewElement.classList.add("dz-error");
},
// update the following section is for removing image from library
addRemoveLinks: true,
removedfile: function(file) {
var attachment_id = file['attachment_id'];
tr.find('.floorplans_image_id').val('');
$.ajax({
type: 'POST',
url: realteo.delete,
data: {
media_id : attachment_id
},
success: function (result) {
console.log(result);
},
error: function () {
console.log("delete error");
}
});
var _ref;
return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
}
});
$('table#floorplans-submit-container tbody').sortable();
});
}
if ($("table#floorplans-submit-container").is('*')) {
$('.add-floorplans-submit-item').on('click', function(e) {
e.preventDefault();
newMenuItem();
refreshTitle();
});
// remove ingredient
$(document).on( "click", "#floorplans-submit-container .fp-btn.remove", function(e) {
e.preventDefault();
$(this).parent().parent().parent().remove();
});
}
$('table#floorplans-submit-container tbody').sortable({
forcePlaceholderSize: true,
dropOnEmpty: true,
forceHelperSize: false,
placeholder : 'sortableHelper',
zIndex: 999990,
opacity: 0.6,
tolerance: "pointer",
start: function(e, ui ){
ui.placeholder.height(ui.helper.outerHeight());
}
});
function refreshTitle() {
$(".floorplans-submit-item").each(function() {
var thisFloor = $(this);
var pricingListTitle = $(this).find(".floorplans-name input");
var floorplanPlaceholder = pricingListTitle.attr("placeholder");
thisFloor.find(".floorplan-title").text(floorplanPlaceholder);
pricingListTitle.keyup(function() {
var inputContent = pricingListTitle.val();
thisFloor.find(".floorplan-title").text(inputContent);
if ( pricingListTitle.val().length === 0 ) {
thisFloor.find(".floorplan-title").text(floorplanPlaceholder);
}
});
pricingListTitle.keyup();
});
}
refreshTitle();
$(".search_agent").submit(function (e) {
e.preventDefault();
var handler = $(this);
var agency_id = $(this).find('#add_agent').data('agency');
var search = $(this).find('#add_agent').val();
$(this).find('#search-results-loading').show();
$.ajax({
type : "post",
url : realteo.ajax_url,
data : {
action: "user_search",
search: search,
agency_id : agency_id
},
success : function(response) {
console.log($(this));
handler.find('#search-results-loading').hide();
handler.find('#search-results').html(response);
}
})
});
$( ".search_agent" ).on( "click", ".invite-agent-link", function(e) {
e.preventDefault();
var handler = $(this);
var agent = $(this).data('agent');
var agency_id = $(this).data('agency');
$.ajax({
type : "post",
dataType : "json",
url : realteo.ajax_url,
data : { action: "invite_agent", agent_id : agent, agency_id : agency_id},
success : function(response) {
if(response.type == "success") {
handler.parent().append(' '+response.message+'');
} else {
handler.parent().append(' '+response.message+'');
}
}
});
});
$( ".remove-agent-list" ).on( "click", function(e) {
e.preventDefault();
var handler = $(this);
var agent = $(this).data('agent');
var agency_id = $(this).data('agency');
handler.css('opacity', '0.6');
$.ajax({
type : "post",
dataType : "json",
url : realteo.ajax_url,
data : { action: "remove_agent", agent_id : agent, agency_id : agency_id},
success : function(response) {
console.log(response);
if(response.type == "success") {
handler.append(' '+response.message+'');
setTimeout( function(){ handler.fadeOut() }, 2500 );
} else {
handler.append(' '+response.message+'');
handler.css('opacity', '1');
}
}
});
});
// ------------------ End Document ------------------ //
});
})(this.jQuery);
/**/
var pfHeaderImgUrl = '';
var pfHeaderTagline = '';
var pfdisableClickToDel = '0';
var pfHideImages = '0';
var pfImageDisplayStyle = 'right';
var pfDisableEmail = '0';
var pfDisablePDF = '0';
var pfDisablePrint = '0';
var pfCustomCSS = '.rsImg {display:block;}';
(function() {
var e = document.createElement('script'); e.type="text/javascript";
if('https:' == document.location.protocol) {
js='https://pf-cdn.printfriendly.com/ssl/main.js';
}
else{
js='http://cdn.printfriendly.com/printfriendly.js';
}
e.src = js;
document.getElementsByTagName('head')[0].appendChild(e);
})();
/*! jQuery UI - v1.12.1 - 2017-09-21
* http://jqueryui.com
* Includes: widget.js, widgets/mouse.js
* Copyright jQuery Foundation and other contributors; Licensed MIT
*
* jQuery UI Touch Punch 0.2.3
*
* Copyright 2011–2014, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){t.ui=t.ui||{};t.ui.version="1.12.1";var e=0,i=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{(s=t._data(n,"events"))&&s.remove&&t(n).triggerHandler("remove")}catch(t){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,u={},r=e.split(".")[0],h=r+"-"+(e=e.split(".")[1]);return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[r]=t[r]||{},n=t[r][e],o=t[r][e]=function(t,e){if(!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){t.isFunction(s)?u[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}():u[e]=s}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},u,{constructor:o,namespace:r,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var s,n,o=i.call(arguments,1),a=0,u=o.length;a",options:{classes:{},disabled:!1,create:null},_createWidget:function(i,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;o=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}),function(t){function e(t,e){if(!(t.originalEvent.touches.length>1)){t.preventDefault();var i=t.originalEvent.changedTouches[0],s=document.createEvent("MouseEvents");s.initMouseEvent(e,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(s)}}if(t.support.touch="ontouchend"in document,t.support.touch){var i,s=t.ui.mouse.prototype,n=s._mouseInit,o=s._mouseDestroy;s._touchStart=function(t){var s=this;!i&&s._mouseCapture(t.originalEvent.changedTouches[0])&&(i=!0,s._touchMoved=!1,e(t,"mouseover"),e(t,"mousemove"),e(t,"mousedown"))},s._touchMove=function(t){i&&(this._touchMoved=!0,e(t,"mousemove"))},s._touchEnd=function(t){i&&(e(t,"mouseup"),e(t,"mouseout"),this._touchMoved||e(t,"click"),i=!1)},s._mouseInit=function(){var e=this;e.element.bind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),n.call(e)},s._mouseDestroy=function(){var e=this;e.element.unbind({touchstart:t.proxy(e,"_touchStart"),touchmove:t.proxy(e,"_touchMove"),touchend:t.proxy(e,"_touchEnd")}),o.call(e)}}}(jQuery);
/*!
* JavaScript Cookie v2.2.0
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/
;(function (factory) {
var registeredInModuleLoader = false;
if (typeof define === 'function' && define.amd) {
define(factory);
registeredInModuleLoader = true;
}
if (typeof exports === 'object') {
module.exports = factory();
registeredInModuleLoader = true;
}
if (!registeredInModuleLoader) {
var OldCookies = window.Cookies;
var api = window.Cookies = factory();
api.noConflict = function () {
window.Cookies = OldCookies;
return api;
};
}
}(function () {
function extend () {
var i = 0;
var result = {};
for (; i < arguments.length; i++) {
var attributes = arguments[ i ];
for (var key in attributes) {
result[key] = attributes[key];
}
}
return result;
}
function init (converter) {
function api (key, value, attributes) {
var result;
if (typeof document === 'undefined') {
return;
}
// Write
if (arguments.length > 1) {
attributes = extend({
path: '/'
}, api.defaults, attributes);
if (typeof attributes.expires === 'number') {
var expires = new Date();
expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
attributes.expires = expires;
}
// We're using "expires" because "max-age" is not supported by IE
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
try {
result = JSON.stringify(value);
if (/^[\{\[]/.test(result)) {
value = result;
}
} catch (e) {}
if (!converter.write) {
value = encodeURIComponent(String(value))
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
} else {
value = converter.write(value, key);
}
key = encodeURIComponent(String(key));
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
key = key.replace(/[\(\)]/g, escape);
var stringifiedAttributes = '';
for (var attributeName in attributes) {
if (!attributes[attributeName]) {
continue;
}
stringifiedAttributes += '; ' + attributeName;
if (attributes[attributeName] === true) {
continue;
}
stringifiedAttributes += '=' + attributes[attributeName];
}
return (document.cookie = key + '=' + value + stringifiedAttributes);
}
// Read
if (!key) {
result = {};
}
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling "get()"
var cookies = document.cookie ? document.cookie.split('; ') : [];
var rdecode = /(%[0-9A-Z]{2})+/g;
var i = 0;
for (; i < cookies.length; i++) {
var parts = cookies[i].split('=');
var cookie = parts.slice(1).join('=');
if (!this.json && cookie.charAt(0) === '"') {
cookie = cookie.slice(1, -1);
}
try {
var name = parts[0].replace(rdecode, decodeURIComponent);
cookie = converter.read ?
converter.read(cookie, name) : converter(cookie, name) ||
cookie.replace(rdecode, decodeURIComponent);
if (this.json) {
try {
cookie = JSON.parse(cookie);
} catch (e) {}
}
if (key === name) {
result = cookie;
break;
}
if (!key) {
result[name] = cookie;
}
} catch (e) {}
}
return result;
}
api.set = api;
api.get = function (key) {
return api.call(api, key);
};
api.getJSON = function () {
return api.apply({
json: true
}, [].slice.call(arguments));
};
api.defaults = {};
api.remove = function (key, attributes) {
api(key, '', extend(attributes, {
expires: -1
}));
};
api.withConverter = init;
return api;
}
return init(function () {});
}));
/*!
* jQuery UI Touch Punch 0.2.3
*
* Copyright 2011–2014, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
// source --> https://www.vikyreal.cz/wp-content/plugins/woocommerce/assets/js/jquery-blockui/jquery.blockUI.min.js
/*!
* jQuery blockUI plugin
* Version 2.70.0-2014.11.23
* Requires jQuery v1.7 or later
*
* Examples at: http://malsup.com/jquery/block/
* Copyright (c) 2007-2013 M. Alsup
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Thanks to Amir-Hossein Sobhi for some excellent contributions!
*/
!function(){"use strict";function e(e){function t(t,n){var s,h,k=t==window,y=n&&n.message!==undefined?n.message:undefined;if(!(n=e.extend({},e.blockUI.defaults,n||{})).ignoreIfBlocked||!e(t).data("blockUI.isBlocked")){if(n.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,n.overlayCSS||{}),s=e.extend({},e.blockUI.defaults.css,n.css||{}),n.onOverlayClick&&(n.overlayCSS.cursor="pointer"),h=e.extend({},e.blockUI.defaults.themedCSS,n.themedCSS||{}),y=y===undefined?n.message:y,k&&p&&o(window,{fadeOut:0}),y&&"string"!=typeof y&&(y.parentNode||y.jquery)){var m=y.jquery?y[0]:y,g={};e(t).data("blockUI.history",g),g.el=m,g.parent=m.parentNode,g.display=m.style.display,g.position=m.style.position,g.parent&&g.parent.removeChild(m)}e(t).data("blockUI.onUnblock",n.onUnblock);var v,I,w,U,x=n.baseZ;v=e(r||n.forceIframe?'':''),I=e(n.theme?'':''),n.theme&&k?(U='',n.title&&(U+='"),U+='
',U+="
"):n.theme?(U='"):U=k?'':'',w=e(U),y&&(n.theme?(w.css(h),w.addClass("ui-widget-content")):w.css(s)),n.theme||I.css(n.overlayCSS),I.css("position",k?"fixed":"absolute"),(r||n.forceIframe)&&v.css("opacity",0);var C=[v,I,w],S=e(k?"body":t);e.each(C,function(){this.appendTo(S)}),n.theme&&n.draggable&&e.fn.draggable&&w.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var O=f&&(!e.support.boxModel||e("object,embed",k?null:t).length>0);if(u||O){if(k&&n.allowBodyStretch&&e.support.boxModel&&e("html,body").css("height","100%"),(u||!e.support.boxModel)&&!k)var E=a(t,"borderTopWidth"),T=a(t,"borderLeftWidth"),M=E?"(0 - "+E+")":0,B=T?"(0 - "+T+")":0;e.each(C,function(e,t){var o=t[0].style;if(o.position="absolute",e<2)k?o.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+n.quirksmodeOffsetHack+') + "px"'):o.setExpression("height",'this.parentNode.offsetHeight + "px"'),k?o.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):o.setExpression("width",'this.parentNode.offsetWidth + "px"'),B&&o.setExpression("left",B),M&&o.setExpression("top",M);else if(n.centerY)k&&o.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),o.marginTop=0;else if(!n.centerY&&k){var i="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+(n.css&&n.css.top?parseInt(n.css.top,10):0)+') + "px"';o.setExpression("top",i)}})}if(y&&(n.theme?w.find(".ui-widget-content").append(y):w.append(y),(y.jquery||y.nodeType)&&e(y).show()),(r||n.forceIframe)&&n.showOverlay&&v.show(),n.fadeIn){var j=n.onBlock?n.onBlock:c,H=n.showOverlay&&!y?j:c,z=y?j:c;n.showOverlay&&I._fadeIn(n.fadeIn,H),y&&w._fadeIn(n.fadeIn,z)}else n.showOverlay&&I.show(),y&&w.show(),n.onBlock&&n.onBlock.bind(w)();if(i(1,t,n),k?(p=w[0],b=e(n.focusableElements,p),n.focusInput&&setTimeout(l,20)):d(w[0],n.centerX,n.centerY),n.timeout){var W=setTimeout(function(){k?e.unblockUI(n):e(t).unblock(n)},n.timeout);e(t).data("blockUI.timeout",W)}}}function o(t,o){var s,l=t==window,d=e(t),a=d.data("blockUI.history"),c=d.data("blockUI.timeout");c&&(clearTimeout(c),d.removeData("blockUI.timeout")),o=e.extend({},e.blockUI.defaults,o||{}),i(0,t,o),null===o.onUnblock&&(o.onUnblock=d.data("blockUI.onUnblock"),d.removeData("blockUI.onUnblock"));var r;r=l?e(document.body).children().filter(".blockUI").add("body > .blockUI"):d.find(">.blockUI"),o.cursorReset&&(r.length>1&&(r[1].style.cursor=o.cursorReset),r.length>2&&(r[2].style.cursor=o.cursorReset)),l&&(p=b=null),o.fadeOut?(s=r.length,r.stop().fadeOut(o.fadeOut,function(){0==--s&&n(r,a,o,t)})):n(r,a,o,t)}function n(t,o,n,i){var s=e(i);if(!s.data("blockUI.isBlocked")){t.each(function(e,t){this.parentNode&&this.parentNode.removeChild(this)}),o&&o.el&&(o.el.style.display=o.display,o.el.style.position=o.position,o.el.style.cursor="default",o.parent&&o.parent.appendChild(o.el),s.removeData("blockUI.history")),s.data("blockUI.static")&&s.css("position","static"),"function"==typeof n.onUnblock&&n.onUnblock(i,n);var l=e(document.body),d=l.width(),a=l[0].style.width;l.width(d-1).width(d),l[0].style.width=a}}function i(t,o,n){var i=o==window,l=e(o);if((t||(!i||p)&&(i||l.data("blockUI.isBlocked")))&&(l.data("blockUI.isBlocked",t),i&&n.bindEvents&&(!t||n.showOverlay))){var d="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";t?e(document).bind(d,n,s):e(document).unbind(d,s)}}function s(t){if("keydown"===t.type&&t.keyCode&&9==t.keyCode&&p&&t.data.constrainTabKey){var o=b,n=!t.shiftKey&&t.target===o[o.length-1],i=t.shiftKey&&t.target===o[0];if(n||i)return setTimeout(function(){l(i)},10),!1}var s=t.data,d=e(t.target);return d.hasClass("blockOverlay")&&s.onOverlayClick&&s.onOverlayClick(t),d.parents("div."+s.blockMsgClass).length>0||0===d.parents().children().filter("div.blockUI").length}function l(e){if(b){var t=b[!0===e?b.length-1:0];t&&t.focus()}}function d(e,t,o){var n=e.parentNode,i=e.style,s=(n.offsetWidth-e.offsetWidth)/2-a(n,"borderLeftWidth"),l=(n.offsetHeight-e.offsetHeight)/2-a(n,"borderTopWidth");t&&(i.left=s>0?s+"px":"0"),o&&(i.top=l>0?l+"px":"0")}function a(t,o){return parseInt(e.css(t,o),10)||0}e.fn._fadeIn=e.fn.fadeIn;var c=e.noop||function(){},r=/MSIE/.test(navigator.userAgent),u=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),f=(document.documentMode,e.isFunction(document.createElement("div").style.setExpression));e.blockUI=function(e){t(window,e)},e.unblockUI=function(e){o(window,e)},e.growlUI=function(t,o,n,i){var s=e('');t&&s.append(""+t+"
"),o&&s.append(""+o+"
"),n===undefined&&(n=3e3);var l=function(t){t=t||{},e.blockUI({message:s,fadeIn:"undefined"!=typeof t.fadeIn?t.fadeIn:700,fadeOut:"undefined"!=typeof t.fadeOut?t.fadeOut:1e3,timeout:"undefined"!=typeof t.timeout?t.timeout:n,centerY:!1,showOverlay:!1,onUnblock:i,css:e.blockUI.defaults.growlCSS})};l();s.css("opacity");s.mouseover(function(){l({fadeIn:0,timeout:3e4});var t=e(".blockMsg");t.stop(),t.fadeTo(300,1)}).mouseout(function(){e(".blockMsg").fadeOut(1e3)})},e.fn.block=function(o){if(this[0]===window)return e.blockUI(o),this;var n=e.extend({},e.blockUI.defaults,o||{});return this.each(function(){var t=e(this);n.ignoreIfBlocked&&t.data("blockUI.isBlocked")||t.unblock({fadeOut:0})}),this.each(function(){"static"==e.css(this,"position")&&(this.style.position="relative",e(this).data("blockUI.static",!0)),this.style.zoom=1,t(this,o)})},e.fn.unblock=function(t){return this[0]===window?(e.unblockUI(t),this):this.each(function(){o(this,t)})},e.blockUI.version=2.7,e.blockUI.defaults={message:"Please wait...
",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var p=null,b=[]}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}();