`
if (theme_type == 'theme5' || theme_type == 'theme9' || theme_type == 'theme10') {
preview_html = `
`;
desc = '';
} else if (theme_type == 'theme6' || theme_type == 'theme7') {
preview_html = `
`;
}
if (theme_type == 'theme7') {
sclass = ' card-contact-shadow mt-2';
}
preview_html += `
`;
if(theme_type == 'theme1' || theme_type == 'theme3'){
preview_html = `
`;
}
if(theme_type == 'theme4' || theme_type == 'theme5'){
desc = `
`;
}
if(theme_type == 'theme4'|| theme_type == 'theme5' ){
preview_html = `
`;
}
if(theme_type == 'theme2'){
preview_html = `
`;
}
image_count++;
rowno++;
}
if (element_type == "testimonial") {
html = `
`;
preview_html = `
`;
if(theme_type == 'theme1' || theme_type == 'theme3' ||theme_type == 'theme5'){
preview_html = `
`;
}
if(theme_type == 'theme2' ||theme_type == 'theme4'){
preview_html = `
`;
}
testimonial_rating_count++;
testimonial_image_count++;
rowno++;
}
if (element_type == "social_links") {
html = `
|
|
|
`;
if (theme_type == 'theme1') {
preview_html = `
`;
social_preview_html = `
`;
$(".inputrow_socials_preview").append(preview_html);
}
if (theme_type == 'theme2') {
/*preview_html = `
`;*/
preview_html = `
`;
social_preview_html = `
`;
$(".inputrow_socials_preview").append(social_preview_html);
}
if (theme_type == 'theme3') {
preview_html = `
`;
$(".inputrow_socials_preview").append(preview_html);
}
if (theme_type == 'theme4') {
preview_html = `
`;
social_preview_html = `
`;
$(".inputrow_socials_preview").append(preview_html);
}
if (theme_type == 'theme5') {
// preview_html = `
`;
preview_html = `
`;
$(".inputrow_socials_preview").append(preview_html);
}
if (theme_type == 'theme6') {
preview_html = `
`;
$(".inputrow_socials_preview").append(preview_html);
}
if (theme_type == 'theme7') {
preview_html = `
`;
$(".inputrow_socials_preview").append(preview_html);
}
if (theme_type == 'theme8') {
preview_html = `
https://demo.rajodiya.com/
${element}
`;
$(".inputrow_socials_preview").append(preview_html);
}
if (theme_type == 'theme9') {
preview_html = `
`;
$(".inputrow_socials_preview").append(preview_html);
}
if (theme_type == 'theme10') {
preview_html = `
`;
$(".inputrow_socials_preview").append(preview_html);
}
rowno++;
$("#socialsModal").modal('hide');
}
$(`#${divid}`).append(html);
console.log(preview_html);
$(`#${divid}_preview`).append(preview_html);
if (element_type == "contact") {
checkcount('hide');
}
$("input").keyup(function() {
var id = $(this).attr('id');
//console.log(id);
var preview = $(`#${id}`).val();
$(`#${id}_preview`).text(preview);
});
$("textarea").keyup(function() {
var id = $(this).attr('id');
//console.log(id);
var preview = $(`#${id}`).val();
$(`#${id}_preview`).text(preview);
});
$(".social_href").keyup(function() {
var id = $(this).attr('id');
//console.log(id);
var preview = $(`#${id}`).val();
var h_preview = validURL(preview);
//console.log(h_preview);
if (h_preview == true) {
$(`#${id}_error_href`).text("");
$(`.${id}_href_preview`).attr("href", preview);
} else {
$(`#${id}_error_href`).text("Please enter valid link");
$(`#${id}_href_preview`).attr("href", "#");
}
//var h_preview = `{{ url("") }}/${preview}`;
});
$( ".textboxhover" ).mouseover(function() {
$( this ).removeClass( "border-0" );
}).mouseout(function() {
$( this ).addClass("border-0");
});
return rowno;
}
/*$(document).on('click', '#removeRow', function () {
if($(this).data('id') == "testimonials"){
$(this).closest('#inputFormRow3').remove();
}
if($(this).data('id') == "socials"){
$(this).closest('#inputFormRow4').remove();
}
});*/
function validURL(str) {
var pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
'(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
return !!pattern.test(str);
}
$(document).on('click', '#removeRow_contact', function() {
var this_id = $(this).data('id');
$(`#${this_id}`).remove();
$(this).closest('#inputFormRow').remove();
checkcount('show');
});
$(document).on('click', '#removeRow_appointment', function() {
var this_id = $(this).data('id');
$(`#${this_id}`).remove();
$(this).closest('#inputFormRow1').remove();
});
$(document).on('click', '#removeRow_services', function() {
var this_id = $(this).data('id');
$(`#${this_id}`).remove();
$(this).closest('#inputFormRow2').remove();
});
$(document).on('click', '#removeRow_testimonials', function() {
var this_id = $(this).data('id');
$(`#${this_id}`).remove();
$(this).closest('#inputFormRow3').remove();
});
$(document).on('click', '#removeRow_socials', function() {
var this_id = $(this).data('id');
$(`.${this_id}`).remove();
$(this).closest('#inputFormRow4').remove();
});
$(".input-text-location").each(function () {
var textarea = $(this);
var text = textarea.text();
var div = $('
');
div.css({
"width":"530px"
});
div.text(text);
$('body').append(div);
var divHeight = $('#temp').height();
div.remove();
divHeight += 32;
this.setAttribute("style", "height:" + divHeight + "px;overflow-y:hidden;");
}).on("input", function () {
this.style.height = "auto";
this.style.height = (this.scrollHeight) + "px";
});