/*
***
Author: Jaeeme
Author URI: http://soolegal.com
File Name : common.js
***
*/
// lazy
$(function () {
if (jQuery('img.lazy').length > 0) {
jQuery("img.lazy").lazyload();
}
});
// tooltip
$(document).ready(function () {
jQuery('[data-toggle="tooltip"]').tooltip();
});
// dateCalendar Online Chamber
jQuery(document).ready(function () {
jQuery(".dateCalendar-oc").datepicker({
minDate: 0,
dateFormat: "dd-mm-yy",
});
});
// disable before timepicker
jQuery(document).on('focus', "#reg-oc-date", function () {
jQuery(this).datepicker({
minDate: 0,
dateFormat: "dd-mm-yy",
});
});
/*jQuery(document).on('focus', "#reg-oc-date", function () {
jQuery(".ui-datepicker").css('style', 'bottom:0px!important');
var enableDays = ["7-8-2020", "8-8-2020", "9-8-2020"];
function enableAllTheseDays(date) {
var sdate = jQuery.datepicker.formatDate('d-m-yy', date)
console.log(sdate)
if(jQuery.inArray(sdate, enableDays) != -1) {
return [true];
}
return [false];
}
jQuery(this).datepicker({
dateFormat: 'dd-mm-yy',
//defaultDate: "+1m",
beforeShowDay: enableAllTheseDays
});
});*/
// dateCalendar
jQuery(document).ready(function () {
jQuery(".dateCalendar").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: "yy-mm-dd",
yearRange: "1940:2050"
});
});
// disable before timepicker
jQuery(document).on('focus', ".disable-before-timepicker", function () {
jQuery(".ui-datepicker").css('style', 'bottom:0px!important');
jQuery(this).datetimepicker({
minDate: 0,
dateFormat: "yy-mm-dd",
timeFormat: 'hh:mm tt',
});
});
// timepicker
jQuery(document).on('focus', ".timepicker", function () {
jQuery(".ui-datepicker").css('style', 'bottom:0px!important');
jQuery(this).datetimepicker({
dateFormat: "yy-mm-dd",
timeFormat: 'hh:mm tt',
});
});
// slider timepicker
jQuery(document).on('focus', ".slider_timepicker", function () {
jQuery(this).timepicker({
hourGrid: 4,
minuteGrid: 10,
timeFormat: 'hh:mm tt'
});
});
// get DatePicker
jQuery(document).on('focus', '.getDatePicker', function () {
jQuery(this).datepicker({
changeMonth: true,
changeYear: true,
dateFormat: "yy-mm-dd",
yearRange: "1940:2050"
});
});
// get DatePicker for date of birth
jQuery(document).on('focus', '.dobDatePicker', function () {
var d = new Date();
var currentYear = d.getFullYear();
jQuery(this).datepicker({
changeMonth: true,
changeYear: true,
dateFormat: "yy-mm-dd",
yearRange: "1940:" + currentYear,
});
});
//image show on choose
jQuery(document).on('change', "#url", function () {
if (this.files && this.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah')
.attr('src', e.target.result)
.width(120)
.height(112)
.css({'display': "block"});
};
reader.readAsDataURL(this.files[0]);
}
});
// mobile app suggestion
jQuery(document).on("click", "button#suggestionsend", function (e) {
e.preventDefault();
if (jQuery('form#sendsuggestion').valid() === false) {
return false;
} else {
jQuery.ajax({
data: jQuery('form#sendsuggestion input, form#sendsuggestion textarea'),
url: url + 'mobile-app/thank-you',
type: 'post',
dataType: 'json',
beforeSend: function () {
jQuery('#suggestionsend').button('loading...');
},
complete: function () {
jQuery('#suggestionsend').button('reset');
jQuery('form#sendsuggestion').find('input[type=text], input[name=email], select, textarea').each(function () {
jQuery(this).val('');
});
},
success: function (json) {
jQuery('div#succeess-msg').html('
Thank you for your suggestions.
');
setTimeout(function () {
jQuery('div#succeess-msg').hide()
}, 5000);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
}
});
// create mob app data
jQuery(document).on('click', '#add-mobApp', function () {
if (jQuery('form#mob-app-form').valid() === false) {
return false;
} else {
jQuery.ajax({
url: url + 'mobileapp/saveInterested',
type: 'post',
data: jQuery('#mob-app-form select, #mob-app-form input[type=\'text\']'),
dataType: 'json',
beforeSend: function () {
jQuery('#add-mobApp').button('loading');
},
complete: function () {
jQuery('#add-mobApp').button('reset');
jQuery('#mobAppinterested').modal('hide');
},
success: function (json) {
jQuery("span#alert-mov-info").html(' Thank you for interest!
');
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
}
});
// create mob app data
jQuery(document).on('click', '#add-mobApp-signup', function () {
if (jQuery('form#mob-app-signup-form').valid() === false) {
return false;
} else {
jQuery.ajax({
url: url + 'mobileapp/saveInterested',
type: 'post',
data: jQuery('#mob-app-signup-form select, #mob-app-signup-form input[type=\'text\']'),
dataType: 'json',
beforeSend: function () {
jQuery('#add-mobApp-signup').button('loading');
},
complete: function () {
jQuery('#add-mobApp-signup').button('reset');
jQuery('#mob-app-signup-form').find('select, input[type=\'text\']').each(function () {
jQuery(this).val('');
});
},
success: function (json) {
jQuery("span#alert-mov-info").html(' Thank you for interest!
');
setTimeout(function () {
jQuery('#alert-mov-info').empty();
}, 5000);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
}
});
// create mob app data
jQuery(document).on('click', '.close-mob-application', function () {
jQuery.ajax({
url: url + 'mobileapp/close',
type: 'post',
dataType: 'json',
success: function (json) {
}
});
});
// recent & popular Resource Centre
jQuery(document).on('click', 'a.home-rc-pr', function () {
var resource_centre_id = jQuery(this).data('homerc');
var type_id = jQuery(this).data('typeid');
//recent Resource Centre
$.ajax({
url: url + "resourcecentre/recentResourceCentre",
type: 'post',
data: {resource_centre_id: resource_centre_id, type_id: type_id},
dataType: 'html',
beforeSend: function () {
jQuery('span#render-home-recent-rc').html('
');
},
success: function (html) {
jQuery('span#render-home-recent-rc').html(html);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
// popularResourceCentre
$.ajax({
url: url + "resourcecentre/popularResourceCentre",
type: 'post',
data: {resource_centre_id: resource_centre_id, type_id: type_id},
dataType: 'html',
beforeSend: function () {
jQuery('span#render-home-popular-rc').html('
');
},
success: function (html) {
jQuery('span#render-home-popular-rc').html(html);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
// Sidebar menu script start
$.sidebarMenu = function (menu) {
var animationSpeed = 300,
subMenuSelector = '.sidebar-submenu';
$(menu).on('click', 'li a', function (e) {
var $this = $(this);
var checkElement = $this.next();
if (checkElement.is(subMenuSelector) && checkElement.is(':visible')) {
checkElement.slideUp(animationSpeed, function () {
checkElement.removeClass('menu-open');
});
checkElement.parent("li").removeClass("active");
}
//If the menu is not visible
else if ((checkElement.is(subMenuSelector)) && (!checkElement.is(':visible'))) {
//Get the parent menu
var parent = $this.parents('ul').first();
//Close all open menus within the parent
var ul = parent.find('ul:visible').slideUp(animationSpeed);
//Remove the menu-open class from the parent
ul.removeClass('menu-open');
//Get the parent li
var parent_li = $this.parent("li");
//Open the target menu and add the menu-open class
checkElement.slideDown(animationSpeed, function () {
//Add the class active to the parent li
checkElement.addClass('menu-open');
parent.find('li.active').removeClass('active');
parent_li.addClass('active');
});
}
//if this isn't a link, prevent the page from being redirected
if (checkElement.is(subMenuSelector)) {
e.preventDefault();
}
});
}
$.sidebarMenu($('.sidebar-menu'))
// Sidebar menu script end
// active menu
jQuery(function () {
var base_url = window.location.origin;
function stripTrailingSlash(str) {
if (str.substr(-1) == '/') {
return str.substr(0, str.length - 1);
}
return str;
}
var url = window.location.pathname;
var activePage = stripTrailingSlash(base_url + url);
jQuery('ul.profile-side-menu a').each(function () {
//alert('currentPage');
var currentPage = stripTrailingSlash(jQuery(this).attr('href'));
//alert(currentPage);
if (activePage == currentPage) {
jQuery(this).parent().addClass('active');
}
});
// show sub menu
jQuery('ul.sidebar-submenu a').each(function () {
//alert(jQuery(this).attr('href'));
var currentPage = stripTrailingSlash(jQuery(this).attr('href'));
//alert(currentPage);
if (activePage == currentPage) {
jQuery(this).parent().parent().parent().addClass('active');
jQuery(this).parent().parent().css("display", "block");
//jQuery(this).parent().css("border-left", "4px solid #ffc36d");
jQuery(this).css("color", "#FFFFFF !important");
}
});
});
// active sub menu on edit profile
jQuery(function () {
var base_url = window.location.origin;
function stripTrailingSlash(str) {
if (str.substr(-1) == '/') {
return str.substr(0, str.length - 1);
}
return str;
}
var url = window.location.pathname;
var activePage = stripTrailingSlash(base_url + url);
jQuery('span#active-sub-menu a').each(function () {
var currentPage = stripTrailingSlash(jQuery(this).attr('href'));
if (activePage == currentPage) {
jQuery(this).addClass('profile-top-menu-active');
}
});
});
// rewards book flight tickets save
jQuery(document).on('click', '#rewards-book-flight-tickets-save', function () {
if (jQuery('form#rewards-book-flight-tickets-frm').valid() === false) {
return false;
} else {
jQuery.ajax({
url: url + 'member/rewardsBookFlightTickets',
type: 'post',
data: jQuery('#rewards-book-flight-tickets-frm select, #rewards-book-flight-tickets-frm input'),
dataType: 'json',
beforeSend: function () {
jQuery('#rewards-book-flight-tickets-save').button('loading');
},
complete: function () {
jQuery('#rewards-book-flight-tickets-save').button('reset');
jQuery('#rewards-book-flight-tickets-frm').find('select, input[type=\'text\']').each(function () {
jQuery(this).val('');
});
jQuery('#rewards-book-flight-tickets-id').modal('hide');
},
success: function (json) {
jQuery("span#alert-book-flight-tickets-info").html(' Your request has been successfully submitted!
');
setTimeout(function () {
jQuery('#alert-book-flight-tickets-info').empty(),
location.reload();
}, 5000);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
}
});
// rewards cashback save
jQuery(document).on('click', '#cashback-request-save', function () {
if (jQuery('form#cashback-request-frm').valid() === false) {
return false;
} else {
jQuery.ajax({
url: url + 'member/cashbackRequest',
type: 'post',
data: jQuery('#cashback-request-frm input[type=\'radio\']:checked, #cashback-request-frm select, #cashback-request-frm input[type=\'text\']'),
dataType: 'json',
beforeSend: function () {
jQuery('#cashback-request-save').button('loading');
},
complete: function () {
jQuery('#cashback-request-save').button('reset');
jQuery('#cashback-request-frm').find('select, input[type=\'text\']').each(function () {
jQuery(this).val('');
});
jQuery('#cashback-request-id').modal('hide');
},
success: function (json) {
jQuery("span#alert-book-flight-tickets-info").html(' Your request has been successfully submitted!
');
setTimeout(function () {
jQuery('#alert-book-flight-tickets-info').empty(),
location.reload();
}, 5000);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
}
});
//function renderMAIL() {
// var slider = new Slider('#profile-boost-slider_1', {
// formatter: function(value) {
// var countmember = value;
// jQuery('#boost-member-qty').val(value);
// return value;
// }
// });
//}
//function renderSMS() {
// var slider = new Slider('#profile-boost-slider_2', {
// formatter: function(value) {
// jQuery('#boost-smsmember-qty').val(value);
// return value;
// }
// });
//}
//var slider = new Slider('#profileboostmail', {
// formatter: function(value) {
// return 'Current value: ' + value;
// }
//});
//var slider = new Slider('#profileboostsms', {
// formatter: function(value) {
// return 'Current value: ' + value;
// }
//});
function renderSliders() {
var rangeSlider = function () {
var slider = $('.range-slider'),
range = $('.range-slider__range'),
value = $('.range-slider__value');
slider.each(function () {
value.each(function () {
var value = $(this).prev().attr('value');
$(this).html(value);
});
range.on('input', function () {
$(this).next(value).html(this.value);
});
});
};
}
var rangeSlider = function () {
var slider = $('.range-slider'),
range = $('.range-slider__range'),
value = $('.range-slider__value');
slider.each(function () {
value.each(function () {
var value = $(this).prev().attr('value');
$(this).html(value);
});
range.on('input', function () {
$(this).next(value).html(this.value);
});
});
};
rangeSlider();
$("#filter_event_filter").click(function () {
$("form#filterEvent").submit();
});
// country search for legal-global-initiative page
$(document).ready(function () {
jQuery('#search-country').keyup(function () {
var country = $(this).val();
$.ajax({
type: 'post',
url: url + 'Profile/searchCountry',
data: {country: country},
dataType: 'json',
success: function (json) {
var countrydata = "";
jQuery.each(json, function (i, value) {
countrydata += '' + value + '';
});
jQuery('#render-country').html(countrydata);
}
});
});
});
// like functionality global function
jQuery(document).on('click', '.like-sc', function() {
var member_id = jQuery(this).data('author');
var post_id = jQuery(this).data('sspid');
var category_id = jQuery(this).data('postcatid');
var forum_combine_id = jQuery(this).data('forumcombineid');
jQuery.ajax({
url: baseurl + "specialsection/insertLike",
type: 'post',
data: {member_id: member_id, post_id: post_id, category_id: category_id},
dataType: 'json',
beforeSend: function () {
jQuery('#like-sc'+post_id).html('Like');
jQuery('#render-arrow'+post_id).html('');
},
success: function (json) {
if(json.count) {
jQuery('#like-sc'+post_id).html('Like');
jQuery('#render-arrow'+forum_combine_id).html(''+json.total_count+'');
} else {
jQuery('#like-sc'+post_id).html('Like');
jQuery('#render-arrow'+forum_combine_id).html(''+json.total_count+'');
if(json.total_count) {
if(json.count==0) {
jQuery('#like-sc'+post_id).html('Like');
}
jQuery('#render-arrow'+forum_combine_id).html(''+json.total_count+'');
}
}
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
// render like members
jQuery(document).on('click', '.like-member-action', function() {
var post_id = jQuery(this).data('sspid');
var category_id = jQuery(this).data('postcatid');
var forum_combine_id = jQuery(this).data('forumcombineid');
var total_count_likes = jQuery('#render-arrow'+forum_combine_id).text();
jQuery.ajax({
url: baseurl + "specialsection/getLikeMembers",
type: 'post',
data: {post_id:post_id, forum_combine_id: forum_combine_id, category_id:category_id, total_count_likes:total_count_likes},
dataType: 'html',
beforeSend: function () {
jQuery('#render-like-members').html('
');
},
success: function (html) {
jQuery('#render-like-members').html(html);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
// render comments
jQuery(document).on('click', '.comment-action', function() {
var post_id = jQuery(this).data('postid');
var category_id = jQuery(this).data('categoryid');
var forum_combine_id = jQuery(this).data('forumcombineid');
jQuery.ajax({
url: baseurl + "forum/renderComments",
type: 'post',
data: {post_id:post_id, forum_combine_id: forum_combine_id, category_id:category_id},
dataType: 'html',
beforeSend: function () {
//jQuery('#render-sc-comment-box'+forum_combine_id).html('
');
},
success: function (html) {
jQuery('#render-sc-comment-box'+forum_combine_id).html(html);
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
$('#render-sc-comment-box'+post_id).removeClass('hide');
});
// write comment on discussion forum
jQuery(document).on('click', 'button.comment_forum_post', function () {
var forum_combine_id = jQuery(this).data('forumcombineid');
var topic_id = jQuery('#topicid'+forum_combine_id).val();
var topic = jQuery('#topicid'+forum_combine_id).attr('data-topic');
var post_id = jQuery('#topicid'+forum_combine_id).data('postid');
var member_id = jQuery(this).data('mid');
var name = jQuery('#comment-name'+forum_combine_id).val();
var email = jQuery('#comment-email'+forum_combine_id).val();
var contactno = jQuery('#comment-contactno'+forum_combine_id).val();
jQuery('input').removeClass('placeholder-change');
jQuery('input').removeClass('placeholder-change-color');
jQuery('input').css({"border-color": "#CCCCCC", "border-width": "1px", "border-style": "solid"});
jQuery('textarea').removeClass('placeholder-change');
jQuery('textarea').removeClass('placeholder-change-color');
jQuery('textarea').css({"border-color": "#CCCCCC", "border-width": "1px", "border-style": "solid"});
if (name == "")
{
jQuery('#comment-name'+forum_combine_id).css({"border-color": "#FF0000", "border-width": "1px", "border-style": "solid"});
jQuery('#comment-name'+forum_combine_id).addClass('placeholder-change-color');
return false;
} else {
jQuery('#comment-name'+forum_combine_id).css({"border-color": "#CCCCCC", "border-width": "1px", "border-style": "solid"});
jQuery('#comment-name'+forum_combine_id).addClass('placeholder-change');
}
if (email == "")
{
jQuery('#comment-email'+forum_combine_id).css({"border-color": "#FF0000", "border-width": "1px", "border-style": "solid"});
jQuery('#comment-email'+forum_combine_id).addClass('placeholder-change-color');
return false;
} else {
jQuery('#comment-email'+forum_combine_id).css({"border-color": "#CCCCCC", "border-width": "1px", "border-style": "solid"});
jQuery('#comment-email'+forum_combine_id).addClass('placeholder-change');
}
if (typeof email !== typeof undefined && email !== false) {
if (validateEmail(email) == true)
{
} else {
jQuery('#comment-email'+forum_combine_id).css({"border-color": "#FF0000", "border-width": "1px", "border-style": "solid"});
jQuery('#comment-email'+forum_combine_id).addClass('placeholder-change-color');
return false;
}
}
var comment = jQuery('#comment'+forum_combine_id).val();
if (comment) {
jQuery("textarea#comment").css({"border-color": "#CCCCCC", "border-width": "1px", "border-style": "solid"});
jQuery.ajax({
url: url + 'Forum/saveComments',
type: 'post',
data: {name: name, email: email, contactno: contactno, comment: comment, topic_id: topic_id, topic: topic, member_id: member_id, post_id:post_id},
dataType: 'html',
beforeSend: function () {
jQuery('button.comment_forum_post').button('loading');
//jQuery('button.comment_forum_post').html('');
},
complete: function () {
jQuery('button.comment_forum_post').button('reset');
jQuery('textarea#comment').val('');
//jQuery('button.comment_forum_post').html('Send');
jQuery('#comment'+forum_combine_id).val('');
jQuery('#comment-name'+forum_combine_id).val('');
jQuery('#comment-email'+forum_combine_id).val('');
jQuery('#comment-contactno'+forum_combine_id).val('');
},
success: function (html) {
//if (resp.status == 'success') {
jQuery('#render-forum-comment'+forum_combine_id).prepend(html);
//location.reload();
//}
// var cmnt = jQuery('#roar_comment24').html();
// var addcmnt = +cmnt + +1;
// jQuery('#roar_comment24').html(addcmnt);
// $('html, body').animate({
// scrollTop: jQuery("#comment-high-light").offset().top
// }, 2000);
jQuery('textarea#comment' + forum_combine_id).css({"border-color": "#CCCCCC", "border-width": "1px", "border-style": "solid"});
jQuery('textarea#comment' + forum_combine_id).addClass('placeholder-change');
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
} else {
jQuery("textarea#comment"+forum_combine_id).css({"border-color": "#FF0000", "border-width": "1px", "border-style": "solid"});
jQuery('textarea#comment'+forum_combine_id).addClass('placeholder-change-color');
}
});
jQuery(document).on('click', '.reply', function () {
var rpid = $(this).attr('id');
var mrpid = $(this).attr('data-mrid');
var cat = $(this).attr('data-cat');
var slug = $(this).attr('data-slug');
var parentid = $(this).attr('parentid');
var postid = $(this).data('postid');
var groupID = $(this).data('groupid');
// alert(mrpid);
var innerhtml = " ";
innerhtml += '';
//alert(innerhtml);
$('#render-reply-message-box' + rpid).html(innerhtml);
});
jQuery(document).on('click', '.cancel-reply', function () {
var crpid = $(this).data('cancel');
$('#render-reply-message-box' + crpid).html('');
});
jQuery(document).on('click', '.reply_message_btn', function () {
var rpid = $(this).attr('replyid');
var replyname = $('#replyname' + rpid).val();
var replyemail = $('#replyemail' + rpid).val();
var replycontactno = $('#replycontactno' + rpid).val();
var replymessage = $('#replymessage' + rpid).val();
var parentid = $('#parentid' + rpid).val();
var cat = $('#cat' + rpid).val();
var slug = $('#slug' + rpid).val();
var postid = $('#postid' + rpid).val();
var groupID = $('#cat-group-id' + rpid).val();
jQuery('input').removeClass('placeholder-change');
jQuery('input').removeClass('placeholder-change-color');
jQuery('input').css({"border-color": "#CCCCCC", "border-width": "1px", "border-style": "solid"});
jQuery('textarea').removeClass('placeholder-change');
jQuery('textarea').removeClass('placeholder-change-color');
jQuery('textarea').css({"border-color": "#CCCCCC", "border-width": "1px", "border-style": "solid"});
if (replyname == "")
{
jQuery('#replyname' + rpid).css({"border-color": "#FF0000", "border-width": "1px", "border-style": "solid"});
jQuery('#replyname' + rpid).addClass('placeholder-change-color');
return false;
} else {
jQuery('#replyname' + rpid).css({"border-color": "#CCCCCC", "border-width": "1px", "border-style": "solid"});
jQuery('#replyname' + rpid).addClass('placeholder-change');
}
if (replyemail == "")
{
jQuery('#replyemail' + rpid).css({"border-color": "#FF0000", "border-width": "1px", "border-style": "solid"});
jQuery('#replyemail' + rpid).addClass('placeholder-change-color');
return false;
} else {
jQuery('#replyemail' + rpid).css({"border-color": "#CCCCCC", "border-width": "1px", "border-style": "solid"});
jQuery('#replyemail' + rpid).addClass('placeholder-change');
}
if (typeof replyemail !== typeof undefined && replyemail !== false) {
if (validateEmail(replyemail) == true)
{
} else {
jQuery('#replyemail' + rpid).css({"border-color": "#FF0000", "border-width": "1px", "border-style": "solid"});
jQuery('#replyemail' + rpid).addClass('placeholder-change-color');
return false;
}
}
if (replymessage.trim() == "")
{
jQuery('#replymessage' + rpid).css({"border-color": "#FF0000", "border-width": "1px", "border-style": "solid"});
jQuery('#replymessage' + rpid).addClass('placeholder-change-color');
return false;
} else {
jQuery('#replymessage' + rpid).css({"border-color": "#FF0000", "border-width": "1px", "border-style": "solid"});
jQuery('#replymessage' + rpid).addClass('placeholder-change');
}
$.ajax({
type: 'post',
url: url + "forum/saveReplyMessage",
data: {rpid: rpid, replyname: replyname, replyemail: replyemail, replycontactno:replycontactno, replymessage: replymessage, cat: cat, slug: slug, post_id:postid,groupID:groupID},
dataType: 'html',
beforeSend: function () {
jQuery('button#reply-btn' + rpid).button('loading');
jQuery('button#reply-btn' + rpid).html('');
},
complete: function () {
jQuery('button#reply-btn' + rpid).button('reset');
jQuery('textarea#replymessage' + rpid).val('');
jQuery('#reply-btn' + rpid).html('Send');
jQuery('#forum-comment-reply-form').remove();
},
success: function (html) {
//jQuery('#render-forum-comment'+forum_combine_id).append(html);
jQuery('#reply-btn' + rpid).parent().parent().parent().parent().after(html);
/*if (response.status == 'success') {
location.reload();
}*/
}
});
});
function validateEmail(sEmail) {
var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (filter.test(sEmail)) {
return true;
} else {
return false;
}
}
// for top search Menu js //
$(function () {
$(".input-group-btn .dropdown-menu li a").click(function () {
var selText = $(this).html();
//working version - for single button //
//$('.btn:first-child').html(selText+'');
//working version - for multiple buttons //
$(this).parents('.input-group-btn').find('.btn-search').html(selText);
});
});
// for top search Menu end //
// get Notification Info
jQuery(document).on('click', '.side-notif-info', function () {
$.ajax({
type: 'post',
url: url + "member/getNotificationInfo",
dataType: 'html',
beforeSend: function () {
jQuery('div.render-side-notif-info').html('
');
},
success: function (html) {
jQuery('div.render-side-notif-info').html(html);
}
});
});
// get Member Information
jQuery(document).on('click', '.side-user-info', function () {
$.ajax({
type: 'post',
url: url + "member/getMemberInformation",
dataType: 'html',
beforeSend: function () {
jQuery('div.render-side-usr-info').html('
');
},
success: function (html) {
jQuery('div.render-side-usr-info').html(html);
}
});
});
$('.rightside-panel').click(function () {
$("#mySidenav").css("width", "380px");
});
$(document).on('click', '.closebtn', function () {
$("#mySidenav").css("width", "0px");
});
$('.bell-icon').click(function () {
$("#notificationSidenav").css("width", "380px");
});
$(document).on('click', '.notifi_closebtn', function () {
$("#notificationSidenav").css("width", "0px");
});
//by raunak for search //
$("#search-top").click(function () {
$("#search-panel-open").toggle();
});
//c2rm top menu
$(".mobnav").click(function () {
$(".mob-sidenav").toggle();
});
// looking-job-status
jQuery(document).on('click', '.looking-job-status', function () {
var status = jQuery(this).data('jlstatus');
$.ajax({
url: url + "profile/jobLookingStatus",
type: 'post',
data: {status: status},
dataType: 'json',
beforeSend: function () {
jQuery('.looking-job-spin').html('');
},
complete: function () {
jQuery('.looking-job-spin').html('');
},
success: function (json) {
jQuery(".looking-job-spin").html('');
}
});
});
// clear all notification
jQuery(document).on('click','.delete_all_notifiction',function() {
if(confirm('Are you sure you want to delete?')){
$.ajax({
type:'POST',
url:url+'notification/removeAllNotification',
data:{'delete':'delete'},
dataType:'json',
success:function(resp)
{
console.log(resp);
location.reload();
}
});
}
});
/* First time display popup code */
if(localStorage.getItem("disclaimer_popup")) {
$('#bg_show_ft_popup').hide();
$('#disclaimer_popup').hide();
}else{
$('#disclaimer_popup').show();
$('#bg_show_ft_popup').show();
}
function getCookie(name) {
var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
return v ? v[2] : null;
}
jQuery(document).on('click', '#disclaimer_close', function () {
localStorage.setItem("disclaimer_popup", 'close successfully');
$('#bg_show_ft_popup').hide();
$('#disclaimer_popup').hide();
});
jQuery(document).on('click', '#disclaimer_agree', function () {
localStorage.setItem("disclaimer_popup", 'close successfully');
$('#bg_show_ft_popup').hide();
$('#disclaimer_popup').hide();
});
/* First time display popup code End */
// read full story
jQuery(document).on('click', '.see-more-data-comment', function(){
var comment_id = jQuery(this).data('seemorecomment');
jQuery('#comment-half-full-desc-'+comment_id).hide();
jQuery('#comment-full-desc-'+comment_id).show();
});