PageSourceSearch

https://markamama.com.tr/js/tsoftapps/v5/header.js?v=1790246342

js markamama.com.tr collected 2026-09-24 11:43:32 UTC 5,679 bytes, 236 lines download raw bytes

1// T-Soft Apps Library
2
3const TSOFT_APPS_LIBS = {
4    fetch: {
5        post: async function (url, body = {}, option) {
6            const options = {
7                method: "POST",
8                headers: {
9                    'Content-Type': 'application/json'
10                },
11                redirect: 'follow',
12                referrerPolicy: 'no-referrer',
13                body: JSON.stringify(body)
14            }
15            const response = await fetch(url, options);
16            return response.json();
17        }
18    },
19    get: {
20        script: {
21            head: (uri, callback) => {
22                const script = document.createElement('script');
23                script.src = uri
24
25                if (typeof callback === 'function' && callback !== undefined) {
26                    script.onload = callback
27                }
28
29                document.head.appendChild(script);
30            },
31            body: (uri, callback) => {
32                const script = document.createElement('script');
33                script.src = uri
34
35                if (typeof callback === 'function' && callback !== undefined) {
36                    script.onload = callback
37                }
38
39                document.body.appendChild(script);
40            }
41        },
42        cookie: (cname) => {
43            let name = cname + "=";
44            let decodedCookie = decodeURIComponent(document.cookie);
45            let ca = decodedCookie.split(';');
46            for (let i = 0; i < ca.length; i++) {
47                let c = ca[i];
48                while (c.charAt(0) == ' ') {
49                    c = c.substring(1);
50                }
51                if (c.indexOf(name) == 0) {
52                    return c.substring(name.length, c.length);
53                }
54            }
55            return "";
56        }
57    },
58    set: {
59        cookie: (cname, cvalue, exdays) => {
60            const d = new Date();
61            d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
62            let expires = "expires=" + d.toUTCString();
63            document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
64        }
65    }
66}
67
68// T-Soft Apps global object
69
70let TSOFT_APPS = {
71    cart: {
72        callback: {
73            add: [],
74            delete: [],
75            deleteAll: [],
76            update: [],
77            updateAll: [],
78            load: [],
79        }
80    },
81    order: {
82        address: {
83            callback: []
84        },
85        payment: {
86            callback: []
87        },
88        approve: {
89            callback: []
90        },
91        return : {
92            callback: []
93        },
94        cancel : {
95            callback: []
96        },
97        page: {
98            callback: []
99        },
100        makePayment: {
101            callback: []
102        }
103    },
104    product: {
105        detail: {
106            callback: []
107        },
108        quickView: {
109            callback: {
110                open: []
111            }
112        },
113        wishList: {
114            callback: {
115                add: [],
116                delete: []
117            }
118        },
119        click: {
120            callback: []
121        },
122        stockAlarm: {
123            callback: {
124                add: [],
125                delete: [],
126                deleteAll: []
127            }
128        },
129        dynamicLoader: [],
130        comment: {
131            callback: {
132                add: []
133            }
134        }
135    },
136    page: {
137        cart: {
138            callback: []
139        },
140        search: {
141            callback: []
142        },
143        category: {
144            callback: [],
145            dynamicLoad: {
146                callback: []
147            }
148        },
149        tracking: {
150            approve: {
151                callback: []
152            },
153            login: {
154                callback: []
155            },
156            sign: {
157                callback: []
158            }
159        },
160        home: {
161            callback: []
162        },
163        other: {
164            callback: []
165        },
166        member: {
167            confirmation: {
168                callback: []
169            }
170        }
171    },
172    get: {
173        basket: undefined,
174        cart: {
175            load: undefined
176        },
177        result: {
178            basket: undefined,
179            cart: {
180                load: undefined
181            }
182        }
183    },
184    metaFormSubmit: {
185        callback: []
186    }
187}
188
189const TSOFT_APPS_ENDPOINTS = {
190    getBasket: "/srv/service/customer/get-basket",
191    getCartLoad: "/srv/service/cart/load"
192}
193
194// Fonksiyonlar
195TSOFT_APPS.get.basket = async function (call) {
196    if (window?.CART_COUNT > 0){
197        const response = await fetch(TSOFT_APPS_ENDPOINTS.getBasket)
198        const data = response.json();
199
200        TSOFT_APPS.get.result.basket = data;
201        if (typeof call === 'function') {
202            return await call(data);
203        }
204    }else{
205        TSOFT_APPS.get.result.basket = null
206    }
207}
208TSOFT_APPS.get.cart.load = async function (call) {
209    if (window?.CART_COUNT > 0){
210        const response = await fetch(TSOFT_APPS_ENDPOINTS.getCartLoad)
211        const data = response.json();
212
213        TSOFT_APPS.get.result.cart.load = data;
214        if (typeof call === 'function') {
215            return await call(data);
216        }
217    } else{
218        TSOFT_APPS.get.result.cart.load = null
219    }
220}
221
222function TsoftAppsOrderAddressCallback(func) {
223    TSOFT_APPS.order.address.callback.push(func)
224}
225
226function TsoftAppsOrderPaymentCallback(func) {
227    TSOFT_APPS.order.payment.callback.push(func)
228}
229
230function TsoftAppsOrderMakePaymentCallback(func) {
231    TSOFT_APPS.order.makePayment.callback.push(func)
232}
233
234function TsoftAppsOrderApproveCallback(func) {
235    TSOFT_APPS.order.approve.callback.push(func)
236}

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.