/** * We offer the best and most useful modules PrestaShop and modifications for your online store. * * We are experts and professionals in PrestaShop * * @author PresTeamShop.com * @copyright 2011-2017 PresTeamShop * @license see file: LICENSE.txt * @category PrestaShop * @category Module */ var AppOPC = { initialized: false, init: function() { AppOPC.initialized = true; Fields.init(); ShipToPay.init(); ImagePayment.init(); $.ptsInitPopOver(); $.ptsInitColorPicker(); $.ptsInitTabDrop(); $.ptsInitChangeLog(); AppOPC.registerEvents(); AppOPC.fillRequiredFieldList(); $('#pts_content > .pts-overlay').remove(); }, registerEvents: function(){ //switch events with dependency //use as second param the object {checked: false} if is visible when uncheck the element //best $('.switch').ptsToggleDepend(); //Ship To Pay $('#update_ship_to_pay').click(ShipToPay.update); //show option form $('#lst_type_control').change(AppOPC.changeTypeControl); //save social login $('.btn-save-social_login').on('click', AppOPC.saveSocialLogin); //modal social login info $('.handler-modal-social-login').on('click', AppOPC.showModalSocialLogin); $('button#btn-save-translation').on('click', function(e){AppOPC.saveTranslations(e);}); $('button#btn-save-download-translation').on('click', function(e){AppOPC.saveTranslations(e);}); $('button#btn-share-translation').on('click', AppOPC.shareTranslation); $('div.tab-content div#tab-translate select#lst-id_lang').on('change', function(e){AppOPC.getTranslationsByLang(e);}); $('button[name*="btn-save-translation-"]').on('click', function(e){AppOPC.saveTranslations(e);}); $('div#tab-register button.btn-delete-address').on('click', function(e){AppOPC.deleteEmptyAddressesOPC(e);}); $('button#btn-expand-collapse-all').on('click', function() { $('#content_translations .panel-title .accordion-toggle').trigger('click'); }); $.getFAQs(); $(document).on('hidden.bs.collapse', '#content_faqs', function(e){AppOPC.toggleIconCollapse(e);}); $(document).on('shown.bs.collapse', '#content_faqs', function(e){AppOPC.toggleIconCollapse(e);}); //modificado $(document).on('hidden.bs.collapse', '.content_translations', function(e){AppOPC.toggleIconCollapse(e);}); $(document).on('shown.bs.collapse', '.content_translations', function(e){AppOPC.toggleIconCollapse(e);}); //modificado $('div.tab-content div#tab-suggestions a[id="suggestions-contact"]').attr({'target': '_blank', 'href': 'https://addons.prestashop.com/en/write-to-developper?id_product=8503'}); $('div.tab-content div#tab-suggestions a[id="suggestions-opinions"]').attr({'target': '_blank', 'href': 'http://addons.prestashop.com/ratings.php'}); $('#pts_content ul.nav a[href="#tab-another_modules"]') .attr({'target': '_blank', 'class': 'another_modules', 'href': 'https://addons.prestashop.com/en/2_community-developer?contributor=57585'}) .removeAttr('data-toggle'); /*$("div.tab-content #tab-code_editors .linedtextarea").linedtextarea( {selectedLine: 1} );*/ $('div.tab-content div#tab-code_editors form .btn-save-code-editors').on('click', AppOPC.saveContentCodeEditors); /* debug mode */ var $div_container_ip_debug = $('div.tab-content div#tab-general form div#container-enable_debug div#container-ip_debug'); var $sub_div_add_ip = $('
') .addClass('col-xs-12 col-sm-3 input-group-md pull-right') .appendTo($div_container_ip_debug); var $button = $('