PageSourceSearch

https://www.auto-platinium.com/themes/auto-platinium-v3/js/modules/fbloginblock/views/js/fbloginblock.js

js auto-platinium.com collected 2026-10-04 02:55:04 UTC 6,928 bytes, 233 lines download raw bytes

1/**
2 * 2011 - 2018 StorePrestaModules SPM LLC.
3 *
4 * MODULE fbloginblock
5 *
6 * @author    SPM <[email protected]>
7 * @copyright Copyright (c) permanent, SPM
8 * @license   Addons PrestaShop license limitation
9 * @version   1.8.2
10 * @link      http://addons.prestashop.com/en/2_community-developer?contributor=61669
11 *
12 * NOTICE OF LICENSE test
13 *
14 * Don't use this module on several shops. The license provided by PrestaShop Addons
15 * for all its modules is valid only once for a single shop.
16 */
17
18document.addEventListener("DOMContentLoaded", function(event) {
19
20    $(document).ready(function() {
21
22
23
24        if(fbloginblockislogged == 0) {
25            /* fixed bug for icons CSS styles only for Prestashop 1.7.x.x and Safari */
26            fbloginblock_fixed_safari_css_bug();
27
28
29            /* footer social logins buttons. var fbloginblock_login_buttons_footer - located in the head.tpl */
30            display_fbloginblock_login_buttons_footer(fbloginblock_login_buttons_footer);
31
32
33            /* top social logins buttons. var fbloginblock_login_buttons_top - located in the head.tpl */
34            display_fbloginblock_login_buttons_top(fbloginblock_login_buttons_top);
35
36            /* authpage social logins buttons. var fbloginblock_login_buttons_authpage - located in the head.tpl */
37            display_fbloginblock_login_buttons_authpage(fbloginblock_login_buttons_authpage);
38
39            /* beforeauthpage social logins buttons. var fbloginblock_login_buttons_beforeauthpage - located in the head.tpl */
40            display_fbloginblock_login_buttons_beforeauthpage(fbloginblock_login_buttons_beforeauthpage);
41
42            /* welcome social logins buttons. var fbloginblock_login_buttons_welcome - located in the head.tpl */
43            display_fbloginblock_login_buttons_welcome(fbloginblock_login_buttons_welcome);
44        }
45
46
47        if(fbloginblockamazonci != '' && fbloginblockis_ssl == 1) {
48            init_amazon_fbloginblock();
49        }
50
51
52    });
53
54});
55
56
57
58
59
60
61
62function display_fbloginblock_login_buttons_welcome(data_fbloginblock_login_buttons_welcome){
63
64
65    if($('#header_user_info a') && data_fbloginblock_login_buttons_welcome.length > 0)
66        $('#header_user_info a:last').after(data_fbloginblock_login_buttons_welcome);
67
68    // for PS 1.6 >
69    if($('.header_user_info') && data_fbloginblock_login_buttons_welcome.length > 0)
70        $('.header_user_info:last').after('<div class="header_user_info_ps16">'+data_fbloginblock_login_buttons_welcome+'<\/div>');
71
72    // for ps 1.7
73    if($('.user-info') && data_fbloginblock_login_buttons_welcome.length > 0)
74        $('.user-info:last').prepend(data_fbloginblock_login_buttons_welcome);
75
76
77}
78
79
80function display_fbloginblock_login_buttons_beforeauthpage(data_fbloginblock_login_buttons_beforeauthpage){
81
82    if(fbloginblock_is17==1) {
83
84        /*setTimeout(function(){
85
86         if($('#checkout-login-form').length>0){
87         $('#checkout-login-form').append(ph);
88         } else {
89         $('#login-form').parent().after(ph);
90         }
91
92         }, 1000);*/
93
94        $('#login-form').parent().before(data_fbloginblock_login_buttons_beforeauthpage);
95    }else if(fbloginblock_is16 == 1) {
96        $('#login_form .connexion-group').append(data_fbloginblock_login_buttons_beforeauthpage);
97        $('#login_modal .account-creation .text-center').append(data_fbloginblock_login_buttons_beforeauthpage);
98    }else {
99        $('#create-account_form').before(data_fbloginblock_login_buttons_beforeauthpage);
100    }
101
102
103}
104
105
106function display_fbloginblock_login_buttons_authpage(data_fbloginblock_login_buttons_authpage){
107
108    if(fbloginblock_is17==1) {
109
110        /*setTimeout(function(){
111
112         if($('#checkout-login-form').length>0){
113         $('#checkout-login-form').append(ph);
114         } else {
115         $('#login-form').parent().after(ph);
116         }
117
118         }, 1000);*/
119
120        $('#login-form').parent().after(data_fbloginblock_login_buttons_authpage);
121    }else if(fbloginblock_is16 == 1) {
122        $('.order_car_title').prepend(data_fbloginblock_login_buttons_authpage);
123    }else {
124        $('#login_form').after(data_fbloginblock_login_buttons_authpage);
125    }
126
127
128}
129
130function display_fbloginblock_login_buttons_top(data_fbloginblock_login_buttons_top){
131    $('body').prepend(data_fbloginblock_login_buttons_top);
132}
133
134
135function display_fbloginblock_login_buttons_footer(data_fbloginblock_login_buttons_footer){
136    $('body').append(data_fbloginblock_login_buttons_footer);
137}
138
139
140function fbloginblock_fixed_safari_css_bug(){
141    if(fbloginblock_is17) {
142        /* fixed bug for icons CSS styles only for Prestashop 1.7.x.x and Safari */
143        var inDesktopSafari = (navigator.userAgent.toLowerCase().indexOf('safari') !== -1 && navigator.userAgent.toLowerCase().indexOf('chrome') === -1) && typeof window.ontouchstart === 'undefined';
144
145        var inMobileSafari = (navigator.userAgent.toLowerCase().indexOf('safari') !== -1 && navigator.userAgent.toLowerCase().indexOf('chrome') === -1) && typeof window.ontouchstart !== 'undefined';
146
147        if (inDesktopSafari || inMobileSafari) {
148
149            document.body.className += ' safari';
150        }
151        /* fixed bug for icons CSS styles only for Prestashop 1.7.x.x and Safari */
152    }
153}
154
155
156
157
158function amazonlogin(){
159
160    if(fbloginblockis_ssl==0) {
161        alert(fbloginblockssltxt);
162        return;
163    } else if(fbloginblockamazonci == ''){
164        alert(fbloginblock_aerror);
165        return;
166    } else {
167
168
169
170        options = { scope : 'profile' };
171        amazon.Login.authorize(options, fbloginblockamazon_url);
172        return false;
173    }
174
175}
176
177function init_amazon_fbloginblock(){
178
179    //add div amazon-root
180    if ($('div#amazon-root').length == 0)
181    {
182        FBRootDomAmazon = $('<div>', {'id':'amazon-root'});
183        $('body').prepend(FBRootDomAmazon);
184    }
185
186    window.onAmazonLoginReady = function() {
187        amazon.Login.setClientId(fbloginblockamazonci);
188    };
189    (function(d) {
190        var a = d.createElement('script'); a.type = 'text/javascript';
191        a.async = true; a.id = 'amazon-login-sdk';
192        a.src = 'https://api-cdn.amazon.com/sdk/login1.js';
193        d.getElementById('amazon-root').appendChild(a);
194    })(document);
195
196}
197
198function getCookie_fbloginblock(cname) {
199    var name = cname + "=";
200    var ca = document.cookie.split(';');
201    for(var i = 0; i < ca.length; i++) {
202        var c = ca[i];
203        while (c.charAt(0) == ' ') {
204            c = c.substring(1);
205        }
206        if (c.indexOf(name) == 0) {
207            return c.substring(name.length, c.length);
208        }
209    }
210    return "";
211}
212
213function displayGDPR(id,type){
214
215    if(fbloginblockislogged == 0) {
216
217
218        if(
219            //fbloginblockis_display_gdpr == 1 ||
220            getCookie_fbloginblock('gdpr-popup') != 'hidden'
221        ){
222
223
224            display_htmlgdpr(fbloginblock_htmlgdpr,id,type);
225
226            return false;
227        } else {
228            return true;
229        }
230    }
231}
232
233

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.