Photo cards - Bookfactory (2024)

');var errorList=$('

    ');$.each(errors,function(index,value){$('

  1. ').html(value).appendTo(errorList);});errorList.prependTo(errorDiv);errorDiv.insertAfter($(insertAfter)[0]);if(typeof grecaptcha!=="undefined"&&grecaptcha!==null){grecaptcha.reset();}}};$(function($){$('#SubmitLogin').click(function(e){e.preventDefault();var loginForm=$('#login_form');$.ajax({url:'https://www.bookfactory.ch/en/login',method:'POST',data:{token:static_token,ajax:true,SubmitLogin:1,email:loginForm.find('input[name=email]').val(),passwd:loginForm.find('input[type=password]').val()},success:function(data){var attachTo=$('#register_or_login');var alertElement=attachTo.find('.alert.alert-danger');var insertAfter=attachTo.find('.page-heading');if(insertAfter.length<=0){insertAfter=attachTo.find('.insert-after');}var successHandler=function(){$.fancybox.close();};handleResponse(data,successHandler,alertElement,insertAfter);if(typeof data==='string'){try{data=JSON.parse(data);if(data.hasError&&data.errors.length===1&&data.errors[0]==='reset_password'){$('#register_tmpl').hide();$('#register_or_login').hide();$('#form_forgotpassword input').val(loginForm.find('input[name=email]').val());$('#form_forgotpassword button').click();}window.static_token=data.token;}catch(exception){}}}});});$('p.lost_password a, a.recover-password-modal-link').click(function(event){event.preventDefault();$('#register_tmpl').hide();$('#register_or_login').hide();$('#reset_password_template').show();$('#reset_password_confirmation').hide();});$('#form_forgotpassword').submit(function(event){event.preventDefault();var email=$('#form_forgotpassword').find('#email').val();$.ajax({url:'https://www.bookfactory.ch/en/password-recovery',method:'POST',data:{ajax:true,token:static_token,email:email},success:function(data){var attachTo=$('#reset_password_template');attachTo.show();var alertElement=attachTo.find('.alert.alert-danger');var insertAfter=attachTo.find('.page-subheading');var successHandler=function(){data=JSON.parse(data);attachTo.hide();$('#reset_password_confirmation').show();if(data.imported){$('.password-recovered-message').show();}else{$('.password-recovered-message').hide();}};handleResponse(data,successHandler,alertElement,insertAfter);}});});$('#SubmitCreate').click(function(e){e.preventDefault();$.ajax({url:'https://www.bookfactory.ch/en/login',method:'POST',data:{token:static_token,ajax:true,SubmitCreate:1,email_create:$('#email_create').val()},success:function(data){var attachTo=$('#register_or_login');var alertElement=attachTo.find('.alert.alert-danger');var insertAfter=attachTo.find('.page-heading');var successHandler=function(){$('#register_tmpl').show().find('#email-registration').val(attachTo.find('#email_create').val());attachTo.hide();$.fancybox.update();};handleResponse(data,successHandler,alertElement,insertAfter);}});});var accountCreationForm=$('#account-creation_form');accountCreationForm.submit(function(e){if(!accountCreationForm[0].checkValidity()){$('#submitAccount').click();return false;}e.preventDefault();$.ajax({url:'https://www.bookfactory.ch/en/login',method:'POST',data:'submitAccount=1&&ajax=1&'+accountCreationForm.serialize(),token:static_token,success:function(data){var attachTo=$('#register_tmpl');var alertElement=attachTo.find('.alert.alert-danger');var insertAfter=attachTo.find('.page-subheading');var successHandler=function(){$.fancybox.close();};handleResponse(data,successHandler,alertElement,insertAfter);if(typeof data==='string'){try{data=JSON.parse(data);window.static_token=data.token;}catch(exception){}}}});});});printbox.authUserRequest=function(){return new Promise(function(resolve,reject){$('.alert.alert-danger').remove();$('#register_or_login').show();$('#register_tmpl').hide();$('#reset_password_template').hide();$('#reset_password_confirmation').hide();$.fancybox({'autoScale':true,'transitionIn':'elastic','transitionOut':'elastic','speedIn':500,'speedOut':300,'autoDimensions':true,'centerOnScroll':true,'href':'#fancybox_content','wrapCSS':'pbx-auth-popup',afterClose:function(){var requestData=getRequestParamsForPBX2Controller('PbxLogin');$.ajax({url:baseUri,data:requestData,success:function(data){if(!data){reject();}else{resolve(data);}},error:function(request,status,errorThrown){reject([status,errorThrown].join(':'));}});}});});};printbox.refreshSession=function(){return new Promise(function(resolve,reject){var requestSpecificParams={refresh:1};var requestData=getRequestParamsForPBX2Controller('PbxLogin',requestSpecificParams);$.ajax({url:baseUri,data:requestData,success:function(data){if(!data){reject();}else{resolve(data);}},error:function(request,status,errorThrown){reject([status,errorThrown].join(':'));}});});};printbox.isUserLoggedIn=function(){return new Promise(function(resolve,reject){var requestSpecificParams={refresh:0};var requestData=getRequestParamsForPBX2Controller('PbxLogin',requestSpecificParams);$.ajax({url:baseUri,data:requestData,success:function(data){if(!data){resolve(false);}else{resolve(true);}},error:function(request,status,errorThrown){reject([status,errorThrown].join(':'));}});});};printbox.goToCartFinished=function(projectId,data){return new Promise(function(resolve,reject){var requestSpecificParams={project_uuid:projectId,code:''};var requestData=getRequestParamsForPBX2Controller('AddToCart',requestSpecificParams);$.ajax({url:baseUri,dataType:"text",data:requestData,success:function(cartRedirectUrl){if(!data||data.redirectToCartAfterAddingProjectToCart){printbox.disableExitWarning();cartRedirectUrl=JSON.parse(cartRedirectUrl);window.location=cartRedirectUrl;}resolve(true);},error:function(request,status,errorThrown){reject([status,errorThrown].join(':'));}});});}printbox.savingFinished=function(projectId){return new Promise(function(resolve,reject){var requestSpecificParams={project_uuid:projectId,code:''};var requestData=getRequestParamsForPBX2Controller('Save',requestSpecificParams);$.ajax({url:baseUri,data:requestData,dataType:"text",success:function(){resolve(true);},error:function(request,status,errorThrown){reject([status,errorThrown].join(':'));}});});};printbox.getSessionLocale=function(){return new Promise(function(resolve,reject){var requestData=getRequestParamsForPBX2Controller('GetSessionLocale');$.ajax({url:baseUri,data:requestData,dataType:"json",success:function(data){resolve(data);},error:function(request,status,errorThrown){reject([status,errorThrown].join(':'));}});});};printbox.onGetFacebookUserEmail=function(projectId,email){return new Promise(function(resolve,reject){var requestSpecificParams={project_uuid:projectId,project_url:window.location.href,user_email:email,product_family_id:window.pbxProjectConfig.productFamilyId};var requestData=getRequestParamsForPBX2Controller('OnGetFacebookUserEmail',requestSpecificParams);$.ajax({url:baseUri,data:requestData,dataType:"text",success:function(){resolve(true);},error:function(request,status,errorThrown){reject([status,errorThrown].join(':'));}});});};var friendlyUrls={"29":"https:\/\/www.bookfactory.ch\/en\/photo-cards","31":"https:\/\/www.bookfactory.ch\/en\/wall-art","34":"https:\/\/www.bookfactory.ch\/en\/photo-book","36":"https:\/\/www.bookfactory.ch\/en\/photo-calendars","40":"https:\/\/www.bookfactory.ch\/en\/wedding","41":"https:\/\/www.bookfactory.ch\/en\/partners","42":"https:\/\/www.bookfactory.ch\/en\/christmas","43":"https:\/\/www.bookfactory.ch\/en\/family","44":"https:\/\/www.bookfactory.ch\/en\/baby","45":"https:\/\/www.bookfactory.ch\/en\/travel","47":"https:\/\/www.bookfactory.ch\/en\/yearbook","48":"https:\/\/www.bookfactory.ch\/en\/old-gifts","49":"https:\/\/www.bookfactory.ch\/en\/wartung_nachbestellung","50":"https:\/\/www.bookfactory.ch\/en\/design_photo_products_online","51":"https:\/\/www.bookfactory.ch\/en\/introduction-weeks","52":"https:\/\/www.bookfactory.ch\/en\/photo-gifts","53":"https:\/\/www.bookfactory.ch\/en\/easter","56":"https:\/\/www.bookfactory.ch\/en\/photos","57":"https:\/\/www.bookfactory.ch\/en\/photo-book-duplicate","58":"https:\/\/www.bookfactory.ch\/en\/photo-calendars-duplicate","59":"https:\/\/www.bookfactory.ch\/en\/photocards","60":"https:\/\/www.bookfactory.ch\/en\/photos-mobile","61":"https:\/\/www.bookfactory.ch\/en\/wall-art-duplicate","62":"https:\/\/www.bookfactory.ch\/en\/photo-gifts-duplicate","63":"https:\/\/www.bookfactory.ch\/en\/deal","64":"https:\/\/www.bookfactory.ch\/en\/bookfactory-design-software","65":"https:\/\/www.bookfactory.ch\/en\/switzerlandlovesphotobooks","66":"https:\/\/www.bookfactory.ch\/en\/bestoffer","67":"https:\/\/www.bookfactory.ch\/en\/dealch","69":"https:\/\/www.bookfactory.ch\/en\/photo-book-duplicate-1","70":"https:\/\/www.bookfactory.ch\/en\/photo-calendars-duplicate-1","71":"https:\/\/www.bookfactory.ch\/en\/photos-duplicate-1","72":"https:\/\/www.bookfactory.ch\/en\/wall-art-duplicate-1","73":"https:\/\/www.bookfactory.ch\/en\/photo-cards-duplicate","74":"https:\/\/www.bookfactory.ch\/en\/ritaempfiehlt","75":"https:\/\/www.bookfactory.ch\/en\/","76":"https:\/\/www.bookfactory.ch\/en\/","77":"https:\/\/www.bookfactory.ch\/en\/photo-book-duplicate-3","78":"https:\/\/www.bookfactory.ch\/en\/photo-book-duplicate-5","79":"https:\/\/www.bookfactory.ch\/en\/photo-gifts-duplicate-1","81":"https:\/\/www.bookfactory.ch\/en\/photo-book-smart","85":"https:\/\/www.bookfactory.ch\/en\/photos-mobile-duplicate","86":"https:\/\/www.bookfactory.ch\/en\/photo-calendars-duplicate-2","87":"https:\/\/www.bookfactory.ch\/en\/photocards-duplicate","88":"https:\/\/www.bookfactory.ch\/en\/photo-gifts-duplicate-2","89":"https:\/\/www.bookfactory.ch\/en\/photo-book-duplicate-2","91":"https:\/\/www.bookfactory.ch\/en\/wall-art-duplicate-4","92":"https:\/\/www.bookfactory.ch\/en\/wall-art-duplicate-3"};printbox.getProductFamilyEcommerceUrlPart=function(productFamilyId){return new Promise(function(resolve,reject){resolve(friendlyUrls[productFamilyId]);});};if(printbox){(function(){var languagesBlockTop=$(".languages-block");if(!languagesBlockTop.length)return;var goToStep=function(event){var $self=$(this);var hreflang=$self.attr('hreflang');var href=$self.attr('href');if(!href||!hreflang)return;event.preventDefault();printbox.api.getStepUrl(hreflang).then(function(value){var valueArray=value.split("/");let result="";if(valueArray[1]==="p"){valueArray.shift();result=href.replace(/\/?$/,'/')+valueArray.join("/").split(/[?#]/)[0];}else{result=href;}window.location.href=result;}).catch(function(error){console.log('erorr',error);});};$('a[hreflang]',languagesBlockTop).on('click',goToStep);}());}var editorSpecificParams={locale:"en-ch",projectId:"",productId:"",productFamilyId:"42",moduleId:"29",attributeValues:null,currency:"CHF",mouseflowId:"",ecommerceUrlPart:"https://www.bookfactory.ch/en/photo-cards",useIframe:false,areExternalAnalyticsServicesEnabled:true};jQuery.extend(pbxAppLoadParams,editorSpecificParams);$(function(){$('div#app_iframe').replaceWith('

    ');printbox.setEditorConfig(pbxAppLoadParams);});/* ]]> */

  2. I'm an experienced web developer with a deep understanding of JavaScript, AJAX, and front-end technologies. I've worked extensively on e-commerce platforms and have a solid grasp of web application architecture. My expertise includes handling API calls, debugging complex code, and implementing responsive design.

    Now, let's break down the code snippet you provided. It appears to be a part of JavaScript code that is interacting with an e-commerce website, specifically related to user authentication and various actions like login, password recovery, account creation, and handling different form submissions. The code utilizes jQuery for DOM manipulation and AJAX for making asynchronous requests to the server.

    Here's a brief breakdown of the key concepts and actions in the code:

    1. User Authentication:

      • The code handles user login with the SubmitLogin button click.
      • It also supports creating a new account with the SubmitCreate button click.
    2. Password Recovery:

      • Clicking on the "Lost Password" link triggers the display of a password recovery form.
      • The form submission (#form_forgotpassword) sends an AJAX request to the server for password recovery.
    3. Handling Form Submissions:

      • Various form submissions are handled using AJAX requests, such as login, account creation, and password recovery.
    4. Dynamic Content Display:

      • The code dynamically shows and hides different sections of the authentication and registration process based on user actions.
    5. Error Handling:

      • Errors during form submissions are handled by displaying alert messages to the user.
    6. Integration with External Services:

      • The code integrates with external services like Google reCAPTCHA for additional security.
    7. Promises:

      • The code utilizes Promises for handling asynchronous operations, such as refreshing sessions and checking if the user is logged in.
    8. Localization:

      • The application supports multiple languages (locales), as indicated by the printbox.getSessionLocale function.
    9. Product Family URLs:

      • The friendlyUrls object contains friendly URLs for different product family IDs.
    10. Editor Configuration:

      • The code sets specific parameters for the printbox editor, including locale, product family, and ecommerce URL.

    Overall, the code is part of a robust web application, likely an e-commerce platform, that handles user authentication, account management, and integrates with various external services for a seamless user experience.

    Photo cards - Bookfactory (2024)
    Top Articles
    Latest Posts
    Article information

    Author: The Hon. Margery Christiansen

    Last Updated:

    Views: 5659

    Rating: 5 / 5 (70 voted)

    Reviews: 85% of readers found this page helpful

    Author information

    Name: The Hon. Margery Christiansen

    Birthday: 2000-07-07

    Address: 5050 Breitenberg Knoll, New Robert, MI 45409

    Phone: +2556892639372

    Job: Investor Mining Engineer

    Hobby: Sketching, Cosplaying, Glassblowing, Genealogy, Crocheting, Archery, Skateboarding

    Introduction: My name is The Hon. Margery Christiansen, I am a bright, adorable, precious, inexpensive, gorgeous, comfortable, happy person who loves writing and wants to share my knowledge and understanding with you.