Login or Signup
Verify Your Mobile Number to Signup
Don't have an account? Sign up here!
Login as a Brand? Click here
Continue with Google Continue with Facebook Continue with Apple
'; $(curentThis).parent().parent().find('.bind_comment').append(xhtml); $(curentThis).parent().parent().find('.bind_comment').find('.div_cmt[data-commentid="' + json.comment_id + '"] span.myeditpost').linkify({target: "_blank"}); $('#loader').css('display', 'none'); // --- -- --- -- --- edit comment function start- -- - - - -- - - - // --- -- --- -- --- edit comment function end - -- - - - -- - - - // console.log(json); } }); }); $(".newsletter-close").click(function () { $("#comingsoon_email_error").html(null); }) $(document).on('click', '.img-responsive', function () { $("#comingsoon_email_error").html(null); // alert(1) }) $(document).on('click', '.edit_comment', function (e) { //alert(1); e.preventDefault(); var curentThis = this; // current event save to the variable var commente = $(curentThis).parent().parent().find('.myeditpost').text(); var commentedata = $(curentThis).parent().parent().find('.myeditpost').html('
update
'); //$(curentThis).parent().parent().find('.edit_comment').hide(); var commenteinput = $(curentThis).parent().parent().find('input').val(); }); $(document).on('click', '.update_comment', function (e) { e.preventDefault(); var curentThis = this; var updatecommenturl = "https://www.justgotochef.com/public/update-comment"; id = $(curentThis).closest('.div_cmt').attr('data-commentid'); var commenteinput = $(curentThis).parent().parent().find('input').val(); var formdata = {id: id, commenteinput: commenteinput, }; console.log(id); $.ajax({ url: updatecommenturl, method: "post", data: formdata, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, cache: false, success: function (json) { // On Successful service call // $(curentThis).parent().parent().find('.myeditpost').hide(); $(curentThis).parent().parent().find('.myeditpost').html(linkifyHtml(commenteinput)); console.log(json); } }); console.log(commenteinput); }); $(document).on('click', '.delete_comment', function (e) { e.preventDefault(); var deletecommenturl = 'https://www.justgotochef.com/public/delete-comment'; var curentThis = this; id = $(curentThis).closest('.div_cmt').attr('data-commentid'); var formdata = {id: id, }; $.ajax({ url: deletecommenturl, method: "post", data: formdata, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, cache: false, success: function (json) { // On Successful service call $(curentThis).closest('.div_cmt').remove(); console.log(json); } }); }); // coming soon function $(document).on('click', '.comingsoon', function (e) { e.preventDefault(); $("#comingsoon_email").val(''); $('#comingsoon_email_error').html(null); $('#action_request').val(null); var action_type = $(this).attr("data-action-type"); $('#action_request').val(action_type); }); function comingsoon_action() { var comingsoon_email_error; var comingsoon_email = $('#comingsoon_email').val(); var action_request = $('#action_request').val(); if (comingsoon_email == '') { $('#comingsoon_email_error').html('Please Enter Email'); $('#comingsoon_email').focus(); return false; } else { var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; var address = comingsoon_email; if (reg.test(address) == false) { $('#comingsoon_email_error').html('Invalid Email Address'); return false; } } $("#loader").attr("style", 'display:block'); var comingsoon_request_url = 'https://www.justgotochef.com/public/comingsoon_request_url'; var formdata = { comingsoon_email: comingsoon_email, action_request: action_request, }; $.ajax({ url: comingsoon_request_url, method: "post", data: formdata, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, cache: false, success: function (json) { // On Successful service call $('#comingsoon_email').val(null); $('#comingsoon_email_error').html(null); $('#comingsoon_email').attr("placeholder", "Enter Email.."); $('#comingsoon_email_error').html(json); $("#loader").attr("style", 'display:none'); console.log(json); } }); //alert(action_type); } $(document).ready(function () { var accountsession = ""; if (accountsession == "0") { $("#modal_thankyou").modal(); } }); $('#copyright_href').click(function () { window.open('http://www.culcom.in/', '_blank'); // window.location.href="http://www.culcom.in/"; }); $(document).on('click', '.followme', function (e) { e.preventDefault(); $('#loader').css('display', 'block'); var followmeurl = 'https://www.justgotochef.com/public/follow-me'; var followers = $(this).attr('data-follow-id'); // $(this).attr("data-page-type"); var user_type = $(this).attr('data-user-type'); var formdata = {followers: followers, user_type: user_type, }; $.ajax({ url: followmeurl, method: "post", data: formdata, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, cache: false, success: function (json) { // On Successful service call $('#loader').css('display', 'none'); $('.followme').html(null); $('.followme').html(json); if (json == 'Following') { $('#active_user').addClass('active'); } else { $('#active_user').removeClass('active'); } } }); // alert('followme'); }) $(document).on('click', ".in-my-kitchen", function () { // ga tracking code start ga('send', 'event', {eventCategory: 'Nutrition & Ingredients', eventAction: 'press', eventLabel: 'button', eventValue: 1}); // ga tracking code end var mynegativelisturl = 'https://www.justgotochef.com/public/my-kitchen'; var mythis = $(this); // var imktext = $(this).siblings().find('.imk-num').text(); // alert(imktext); // console.log('mythis',mythis.attr('class')); var page_id = $(this).attr('data-ingredient-id'); var model = $(this).attr('data-model'); //alert(page_id); var formdata = {ingredient_id: page_id, model: model, }; var isadd = localStorage.getItem('ingredient_' + page_id); $('#loader').css('display', 'block'); $.ajax({ url: mynegativelisturl, method: "post", data: formdata, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, cache: false, success: function (json) { // On Successful service call console.log('json',json); var data = jQuery.parseJSON(json); console.log('json mykitchen',data,mythis.parents('.tooltip-btn-div').html()); // alert(data.count); var mykitchencountElement = $('.icon-web').find('.tp-icon.ing_imk').find('span a'); var mykitchencount = parseInt(mykitchencountElement.text()); console.log(' mykitchencount++;', mykitchencount, mykitchencountElement) if (data.action == 'added') { mykitchencount++; // mythis.closest('.in-my-negative').removeClass('active'); mythis.closest('.tooltip-btn-div').find('.in-my-negative').removeClass('active'); var mymsg2 = "Added to My Smart Kitchen list"; $('.wishlist-span').removeClass('active'); $('.btn-tooltp.ingredients-product-like').removeClass('active'); // mythis.closest('ing_negative').removeClass('hide'); // mythis.removeClass('active'); // Remove active class here if (mythis.hasClass('active')) { mythis.removeClass('active'); } mythis.addClass('active'); mythis.parent().addClass('active'); var isadd = true; // Since we've added the class here, set isadd to true // Update the local storage or cookies to maintain state var isadd = localStorage.setItem('ingredient_' + page_id, 'true'); console.log('ingredient_', isadd); // if (isadd === 'true') { // mythis.addClass('active'); // mythis.parent().addClass('active'); // } else { // mythis.removeClass('active'); // } $('.wishlist-span').html('' + data.count); var kit = mythis.parent().find('.imk-num').text(data.count); console.log('dfdf',kit,data.count ) //$('.wishlist-span').html(data.count); // bingo mythis.closest(".tooltips").find(".img_help").addClass('hide'); mythis.closest(".tooltips").find(".ing_negative").addClass('hide'); mythis.closest(".tooltips").find(".ing_fav").addClass('hide'); mythis.closest(".tooltips").find(".ing_imk").removeClass('hide'); // new code var has_imk = mythis.siblings('.imk_fav').children().hasClass('active'); if (has_imk == true) { // alert(1); mythis.siblings('.imk_fav').removeClass('active'); mythis.siblings('.imk_fav').children().removeClass('active'); var imktext = mythis.siblings().find('.imk-num').text(); var imk_new_num = parseInt(imktext); var new_data = imk_new_num - 1; mythis.siblings().find('.imk-num').text(new_data); } } else { mykitchencount--; var mymsg2 = "Removed form My Smart Kitchen list"; mythis.parent().removeClass('active'); mythis.removeClass('active'); mythis.closest(".tooltips").find(".ing_negative").addClass('hide'); mythis.closest(".tooltips").find(".ing_negative").addClass('hide'); // Update the local storage or cookies to maintain state localStorage.removeItem('ingredient_' + page_id); var is_negative = mythis.closest(".tooltips").find(".ing_negative").hasClass('hide'); var is_fav = mythis.closest(".tooltips").find(".ing_fav").hasClass('hide'); var is_imk = mythis.closest(".tooltips").find(".ing_imk").hasClass('hide'); console.log(is_negative,is_fav,is_imk); if (is_negative == true && is_fav == true && is_imk == true) { mythis.closest(".tooltips").find(".img_help").removeClass('hide'); } var kit = mythis.parent().find('.imk-num').text(0); // alert(ttttt); $('#ing_negative').addClass('hide'); } mykitchencountElement.text(mykitchencount); // Update the count in the UI var countElement = mythis.siblings('.imk-num'); countElement.text(data.count); // Hide or show relevant elements based on the count if (mykitchencount > 0) { mykitchencountElement.closest('.Icon-img1').removeClass('hide'); } else { mykitchencountElement.closest('.Icon-img1').addClass('hide'); } $('#loader').css('display', 'none'); // location.reload(); $('#ajax_response').removeClass('hide'); $('#ajax_response_msg').html(mymsg2); window.setTimeout(function () { $('#ajax_response').addClass('hide'); }, 2000); console.log('jsonm', json); } }); if (isadd === 'true') { mythis.addClass('active'); mythis.parent().addClass('active'); } else { mythis.removeClass('active'); } }) $(document).on('click', ".in-my-negative", function () { // ga tracking code start ga('send', 'event', {eventCategory: 'Nutrition & Ingredients', eventAction: 'press', eventLabel: 'button', eventValue: 1}); // ga tracking code end var mynegativelisturl = 'https://www.justgotochef.com/public/mynegativelisturl'; var mythis = $(this); // var imktext = $(this).siblings().find('.imk-num').text(); // alert(imktext); $('#loader').css('display', 'block'); var page_id = $(this).attr('data-id'); var model = $(this).attr('data-model'); var formdata = {page_id: page_id, model: model, }; var isNegative = localStorage.getItem('negative_' + page_id); console.log('isNegative:', isNegative); //alert(page_id); $.ajax({ url: mynegativelisturl, method: "post", data: formdata, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, cache: false, success: function (json) { // On Successful service call var data = jQuery.parseJSON(json); var mykitchencountElement = $('.icon-web').find('.tp-icon.ing_imk').find('span a'); var mykitchencount = parseInt(mykitchencountElement.text()); // alert(data.action); console.log('json negative',data,mythis.parents('.tooltip-btn-div').html()); let myk_num_value = 0; if (data.action == 'added') { let myk_num = parseInt(mythis.parents('.tooltip-btn-div').find(".imk-num").text()); var mymsg2 = "Added to negative list"; $('.wishlist-span').removeClass('active'); $('.btn-tooltp.ingredients-product-like').removeClass('active'); // mythis.closest('ing_negative').removeClass('hide'); mythis.addClass('active'); // Update the local storage or cookies to maintain state var isNegative = localStorage.setItem('negative_' + page_id, 'true'); $('.red-indicator').show(); $('.LikeIcon').hide(); // if (isNegative === 'true') { // mythis.addClass('active'); // } else { // mythis.removeClass('active'); // } $('.wishlist-span').html('' + data.count); //$('.wishlist-span').html(data.count); // bingo mythis.closest(".tooltips").find(".img_help").addClass('hide'); mythis.closest(".tooltips").find(".ing_negative").removeClass('hide'); mythis.closest(".tooltips").find(".ing_fav").addClass('hide'); mythis.closest(".tooltips").find(".ing_imk").addClass('hide'); // new code var has_imk = mythis.siblings('.imk_fav').children().hasClass('active'); var has_imk_class = mythis.siblings('.imk_fav').hasClass('active'); if (has_imk == true || has_imk_class==true) { mythis.siblings('.imk_fav').removeClass('active'); mythis.siblings('.imk_fav').children().removeClass('active'); var imktext = mythis.siblings().find('.imk-num').text(); var imk_new_num = parseInt(imktext); var new_data = imk_new_num - 1; // alert(imk_new_num); // alert('new_data'+new_data); mythis.siblings().find('.imk-num').text(new_data); mythis.parents('.tooltip-btn-div').find(".imk_fav").removeClass('active'); // $('.red-indicator').show(); // $('.LikeIcon').hide(); } } else { var mymsg2 = "Removed form negative list"; mythis.removeClass('active'); // Update the local storage or cookies to maintain state localStorage.removeItem('negative_' + page_id); mythis.closest(".tooltips").find(".ing_negative").addClass('hide'); var is_negative = mythis.closest(".tooltips").find(".ing_negative").hasClass('hide'); var is_fav = mythis.closest(".tooltips").find(".ing_fav").hasClass('hide'); var is_imk = mythis.closest(".tooltips").find(".ing_imk").hasClass('hide'); if (is_negative == true && is_fav == true && is_imk == true) { mythis.closest(".tooltips").find(".img_help").removeClass('hide'); } $('.red-indicator').hide(); $('.LikeIcon').show(); // alert(ttttt); $('#ing_negative').addClass('hide'); } $('#loader').css('display', 'none'); // location.reload(); $('#ajax_response').removeClass('hide'); $('#ajax_response_msg').html(mymsg2); window.setTimeout(function () { $('#ajax_response').addClass('hide'); }, 2000); console.log('json', json); } }); // Toggle active class if (isNegative === 'true') { mythis.addClass('active'); $('.red-indicator').show(); $('.LikeIcon').hide(); } else { mythis.removeClass('active'); $('.red-indicator').hide(); $('.LikeIcon').show(); } // console.log(page_id+'-'+model); }); $('.close-fscr').click(function () { // alert('X'); $(".btn-initial").addClass("hide"); $(".my_first").removeClass("btn-initial hide"); $(".my_first").addClass("btn-gtc-brands login-btn"); $(".my_first").attr('data-toggle', 'modal'); $(".my_first").attr('data-target', '#modal-login'); $(".my_first").html("Login / Sign Up"); console.log('first login alert'); }); $(window).load(function () { var checkme = null; checkme = localStorage.getItem('check_visit'); if (checkme) { // alert('a'); $("#lgn-scr").addClass('hide'); $(".my_first").addClass("btn-gtc-brands login-btn"); $(".my_first").attr('data-toggle', 'modal'); $(".my_first").attr('data-target', '#modal-login'); } else { // alert('b'); // $(".wow.fadeInUp").addClass('hide'); $(".a.my_first.btn-initial").append('aaa'); $(".my_first").addClass("btn-initial"); $("#lgn-scr").removeClass('hide'); $(".my_first").removeClass("btn-gtc-brands login-btn"); $(".my_first").html(""); localStorage.setItem('check_visit', true); } }); // Add smooth scrolling to all links $(document).on('click', '.clicktotop', function (event) { $('html, body').animate({ scrollTop: $(".section2-wrapper").offset().top }, 800); return false; }); // auto login popup script start // function auto_login_popup(){ // $("#modal-login").modal('show'); // }; // setInterval(function(){ // auto_login_popup(); // }, 60000); // // end // setTimeout(auto_login_popup, 20000); // utm set and track $(document).ready(function () { var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); } } }; var utm_source = getUrlParameter('utm_source'); var utm_medium = getUrlParameter('utm_medium'); var utm_campaign = getUrlParameter('utm_campaign'); if (utm_source != undefined) { utmsource = utm_source; } else { utmsource = ''; } if (utm_medium != undefined) { utmmedium = utm_medium; } else { utmmedium = ''; } if (utm_campaign != undefined) { utmcampaign = utm_campaign; } else { utmcampaign = ''; } console.log(utmsource); function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } setCookie('utm_source', utmsource, 2); setCookie('utm_medium', utmmedium, 2); setCookie('utm_campaign', utmcampaign, 2); }) // utm end // Scroll to app links $(function () { $("#gtc-app").click(function () { $('html, body').animate({ scrollTop: $('.footer-parent').offset().top }, 'slow', 'swing'); }); if ('serviceWorker' in navigator) { window.addEventListener('load', () => { navigator.serviceWorker.register("https://www.justgotochef.com/public/sw.js").then(() => { console.log('Service Worker Registered') }) }) } }); // tracker $('.actiontrack').click(function () { var action_name = $(this).attr('data-action_name'); var action_description = $(this).attr('data-action_description'); var action_link = $(this).attr('data-action_link'); var page_type = $(this).attr('data-page_type'); var page_id = $(this).attr('data-page_id'); var url = "https://www.justgotochef.com/public/action-tracker"; var utm_source = ''; var utm_medium = ''; var utm_campagin = ''; var formdata = { action_name: action_name, action_description: action_description, action_link: action_link, page_id: page_id, page_type: page_type, utm_source: utm_source, utm_medium: utm_medium, utm_campagin: utm_campagin, }; $.ajax({ url: url, method: "post", data: formdata, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, cache: false, success: function (json) { // On Successful service call $('#loader').css('display', 'none'); console.log(json); } }); }) function showDiv() { document.getElementById('welcomeDiv').style.display = "block"; document.getElementById('login-signup').style.display="none";}function ShowRevert(){ document.getElementById('welcomeDiv').style.display = "none"; document.getElementById('login-signup').style.display="block";}// script.js /*const inputs = document.getElementsByClassName("otp_number"); inputs.addEventListener("input", function (e) { const target = e.target; const val = target.value; if (isNaN(val)) { target.value = ""; return; } if (val != "") { const next = target.nextElementSibling; if (next) { next.focus(); } } }); inputs.addEventListener("keyup", function (e) { const target = e.target; const key = e.key.toLowerCase(); if (key == "backspace" || key == "delete") { target.value = ""; const prev = target.previousElementSibling; if (prev) { prev.focus(); } return; } });*/console.clear();/*let inputs = document.querySelectorAll(".otp_number");let values = Array(4);let clipData;inputs[0].focus();inputs.forEach((tag, index) => { tag.addEventListener('keyup', (event) => { if(event.code === "Backspace" && hasNoValue(index)) { if(index > 0) inputs[index - 1].focus(); } //else if any input move focus to next or out else if (tag.value !== "") { (index < inputs.length - 1) ? inputs[index + 1].focus() : tag.blur(); } //add val to array to track prev vals values[index] = event.target.value; }); tag.addEventListener('.otp_number', () => { //replace digit if already exists if(tag.value > 10) { tag.value = tag.value % 10; } }); tag.addEventListener('paste', (event) => { event.preventDefault(); clipData = event.clipboardData.getData("text/plain").split(''); filldata(index); })})function filldata(index) { for(let i = index; i < inputs.length; i++) { inputs[i].value = clipData.shift(); }}function hasNoValue(index) { if(values[index] || values[index] === 0) return false; return true;}*/
'); console.log('notliked',objt.act); // $('#show_msg3').html(response.error).css('display', 'block'); } var successMessages = document.getElementsByClassName('success-custom'); setTimeout(function() { for (var i = 0; i < successMessages.length; i++) { successMessages[i].style.display = 'none'; } }, 3000); }, error: function(xhr, status, error) { // Handle errors if necessary console.error(error); //alert('Product removed from wishlist'); } }); }); }) $('.modal-notifyme').on('click',function(){ //alert('dgd') let parentSection = $(this).parents('.productBox'); let proId; //,proQty,proVar; console.log(parentSection.length) if(parentSection.length>0){ proId = parentSection.find('input[name=id]').val(); // proQty = parentSection.find('input[name=pro_quantity]').val(); // proVar = parentSection.find('#sel1v').find(":selected").val(); }else{ let parentSection = $(this).parents('.product-detail-div'); proId = parentSection.find('input[name=id]').val(); // proQty = parentSection.find('input[name=quant]').val(); // proVar = parentSection.find('#sel1').find(":selected").val(); } // alert(proId); // console.log('proId',proId,proQty,proVar,parentSection.length) let formId = $('#notifyme-form'); formId.find('input[name=product_id]').val(proId) // formId.find('input[name=qty]').val(proQty) // formId.find('input[name=product_variant_id]').val(proVar) }); $('#notifyme-form').on('submit',function(e){ e.preventDefault(); let proid = $(this).find('input[name=product_id]').val(); let productBox = 'probox-'+proid; let formSerializeData = $(this).serialize(); $('.'+productBox).find('.AddAndQuntyRow .notify-msg').remove(); let actionUrl = $(this).attr('action'); $.ajax({ url:actionUrl, type:'post', data:formSerializeData, success:function(resp){ console.log('resp',resp); if(resp.success){ // $('.'+productBox).find('.AddAndQuntyRow').append(`${resp.message}`); $('#modal-notifyme .notify-msg').removeClass('alert-danger').addClass('alert-success').text(resp.message).show(); }else{ // $('.'+productBox).find('.AddAndQuntyRow').append(`Try again.`); $('#modal-notifyme .notify-msg').removeClass('alert-success').addClass('alert-danger').text('Try again.').show(); } setTimeout(() => { //$('#modal-notifyme').modal('hide'); // location.reload(); $('#modal-notifyme .notify-msg').fadeOut(); $('#modal-notifyme').modal('hide'); // Close the modal }, 2000); //$('#modal-notifyme').modal('toggle');; } }) return false; });