/** @TODO JQUERY HAS SOME PROBLEM AROUND SOLVED*/ var $=jQuery; /**GLOBALS*/ var name , surname , address , phone , email , modal, modali, modal9, modal10; jQuery(function(){ /** submit isleminden sonraki durumda mesaj gelmis ise modal durumu acar*/ isSettingPageModalNeedsToOpen(); //$('.accordion-toggle-icon').click(function(){ $('.accordion-toggle-icon').parent().click(function() { $(this).find('.accordion-toggle-icon').toggleClass('accordion-open-icon accordion-close-icon'); //Adds 'a', removes 'b' and vice versa }); //}); }); /** * @desc Sayfa yuklendiginde bir modal uzerine yazi eklenen bir * kosul olustugunda sayfa ile beraber mesajlı modalı otomatik acar. * @return {Boolean} [description]0 */ function wc_key_and_secret_page(){ window.open("admin.php?page=wc-settings&tab=api§ion=keys&create-key=1"); $('#create_key_and_secret_modal').modal('hide'); } function isSettingPageModalNeedsToOpen(){ if ($('#modal-bodyddd-content-message-taken').html()!==null&&$('#modal-bodyddd-content-message-taken').html()!==undefined&&$('#modal-bodyddd-content-message-taken').html().trim()!=="") { $('#result-modal').modal('show'); //$('.modal-backdrop').removeClass("modal-backdrop"); setTimeout(function(){$('#result-modal').modal('hide');},6000); } } function open_tab(tab){ $('.nav-tabs a[href='+tab+']').tab('show'); }; function open_step_under_tab(tab,stepValue){ $('.nav-tabs a[href='+tab+']').tab('show'); setTimeout(function(open_the_wanted_one){ $.when($("button[aria-expanded='true']") .each(function(){this.click()}) ) .then(function(){ open_the_wanted_one(stepValue); }); function open_the_wanted_one (stepValue){ setTimeout(function(){ if($('#'+stepValue).attr('aria-expanded')==undefined||$('#'+stepValue).attr('aria-expanded')=='false'){ $("#"+stepValue) .click(function( e,stepValue ) {}) .trigger( "click",[stepValue ] ); } },400); } },500); }; // function jump_to_help_tab(value){ // jQuery('#hasan4').each(function(elm){this.click();}); // } function appsila_wqt_setting_page_settings_tab(){ } function appsila_wqt_handle_form_submission() { name = document.getElementById("billing_first_name").value; surname = document.getElementById("billing_last_name").value; address = document.getElementById("billing_address_1").value; phone = document.getElementById("billing_phone").value; email = document.getElementById("billing_email").value; if (name == "") { alert("Name must be filled out"); return false; } if (surname == "") { alert("Surname must be filled out"); return false; } if (address == "") { alert("Adress must be filled out"); return false; } if (phone == "") { alert("Phone must be filled out"); return false; } if (email == "") { alert("Email must be filled out"); return false; } document.getElementById("loader").style.display = "block"; } function appsila_wqt_request_quote_on_cart_page_modal(){ $('#appsila-wqt-request-quote-on-cart-page-modal-container-id').modal('show'); appsila_wqt_modal_null_inputs_fill_defaults() } function appsila_wqt_ponpilii(){ $('#appsila-wqt-request-quote-on-single-product-page-modal-container-id').modal('show'); appsila_wqt_modal_null_inputs_fill_defaults(); } function appsila_wqt_modal_null_inputs_fill_defaults(){ if ($('#billing_phone').val()==""||$('#billing_phone').val()==null||$('#billing_phone').val()===undefined) { $('#billing_phone').val("+"); } if ($('#billing_address_1').val()==""||$('#billing_address_1').val()==" "||$('#billing_address_1').val()==null||$('#billing_address_1').val()===undefined) { $('#billing_address_1').val(" "); } } function appsila_wqt_ponpili2(){ modal = document.getElementById('popup2myModal'); modal.style.display = "none"; } function appsila_wqt_popup9Close(){ /**@see Modal-Nulls fixing*/ appsila_wqt_modal_null_inputs_fill_defaults(); $(".modal").modal('hide'); modal9 = document.getElementById('popup9myModal'); modal9.style.display = "none"; } function appsila_wqt_popup10Close(){ modal10 = document.getElementById('popup10myModal'); modal10.style.display = "none"; } function appsila_wqt_ponpilii2(){ modali = document.getElementById('popup3myModal'); modali.style.display = "none"; } // Get the button that opens the modal modal = document.getElementById('popup2myModal'); modali = document.getElementById('popup3myModal'); modal9 = document.getElementById('popup9myModal'); moda10 = document.getElementById('popup10myModal'); var myVar; var btn2 = document.getElementById("insert_empty_cart_button"); // Get the element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks on (x), close the modal // // // // When the user clicks anywhere outside of the modal, close it /* function appsila_wqt_ponpili3(){ // window.onclick = function(event) { // if (event.target == modal) { // modal.style.display = "none"; // } // }; // } // // function appsila_wqt_ponpilii3(){ // window.onclick = function(event) { // if (event.target == modali) { // modali.style.display = "none"; // } // }; // } // function appsila_wqt_popup9(){ // window.onclick = function(event) { // if (event.target == modal9) { // modal9.style.display = "none"; // } // }; // } // function appsila_wqt_popup10(){ // window.onclick = function(event) { // if (event.target == modal10) { // modal10.style.display = "none"; // } // }; // } // // // // // // window.addEventListener('load',function() { // if (document.getElementById("hasan1")!==null&&document.getElementById("hasan1")!==undefined) { // document.getElementById("hasan1").addEventListener("click", appsila_wqt_myFunction); // function appsila_wqt_myFunction() { // document.getElementById("hasan1").getAttribute('href'); // document.getElementById("tab1").style.display="block"; // document.getElementById("tab2").style.display="none"; // document.getElementById("tab3").style.display="none"; // document.getElementById("tab4").style.display="none"; // } // } // }, false); // window.addEventListener('load',function() { // if (document.getElementById("hasan2")!==null&&document.getElementById("hasan2")!==undefined) { // document.getElementById("hasan2").addEventListener("click", appsila_wqt_myFunction2); // function appsila_wqt_myFunction2() { // document.getElementById("hasan1").getAttribute('href'); // document.getElementById("tab2").style.display="block"; // document.getElementById("tab1").style.display="none"; // document.getElementById("tab3").style.display="none"; // document.getElementById("tab4").style.display="none"; // } // } // }, false); // window.addEventListener('load', function() { // if (document.getElementById("hasan3")!==null&&document.getElementById("hasan3")!==undefined) { // document.getElementById("hasan3").addEventListener("click", appsila_wqt_myFunction3); // function appsila_wqt_myFunction3() { // document.getElementById("hasan1").getAttribute('href'); // document.getElementById("tab3").style.display="block"; // document.getElementById("tab2").style.display="none"; // document.getElementById("tab1").style.display="none"; // document.getElementById("tab4").style.display="none"; // } // } // }, false); // window.addEventListener('load',function() { // if (document.getElementById("hasan4")!==null&&document.getElementById("hasan4")!==undefined) { // document.getElementById("hasan4").addEventListener("click", appsila_wqt_myFunction4); // function appsila_wqt_myFunction4() { // document.getElementById("hasan1").getAttribute('href'); // document.getElementById("tab4").style.display="block"; // document.getElementById("tab3").style.display="none"; // document.getElementById("tab2").style.display="none"; // document.getElementById("tab1").style.display="none"; // } // } // }, false); // function modalResultPrinter(variablesX){ // if(variablesX===undefined){variablesX={}} // $('#result-modal .modal-header .modal-title').html(variablesX.title); // $('#result-modal .modal-footer .modal-result-button').html(variablesX.button); // $('#result-modal .modal-body').html(variablesX.content); // $("#result-modal").modal("show"); // } // function modalResultTrueOpen(){ // var variablesX={ // title:"", // button:"", // content:"" // }; // modalResultPrinter(); // // } // function modalResultFalseOpen(){ // var variablesX={ // title:"", // button:"", // content:"" // }; // modalResultPrinter(); // }*/