PageSourceSearch

https://arabicpost.net/wp-content/themes/arabicpost/deco-framework…/coins/assets/js/script.js?ver=1790906522

js arabicpost.net collected 2026-10-02 03:02:29 UTC 9,526 bytes, 273 lines download raw bytes

1(function ($) {
2	"use strict";
3
4	let Deco_Coins = {
5
6		bcCalcChange: function (event) {
7			console.log(event);
8			let coinsNum = document.querySelector('.Bc-num.convertCoinNum'),
9				toConvertCoins = document.querySelector('.Bc-toConvertCoin'),
10				convertCoinsNum = document.querySelector('.Bc-convertCoin'),
11				toCoinsNum = document.querySelector('.Bc-num.toConvertCoin'),
12				errorMessage = document.querySelector('.is-calc-error'),
13				errorMessageTwo = document.querySelector('.is-calc-error.error-two'),
14				loader = document.querySelector('.Bc-loader-container'),
15				container = document.querySelector('.Bc-num.toConvertCoin'),
16				containerTwo = document.querySelector('.Bc-num.convertCoinNum');
17
18			if (event.target.classList.contains('Bc-toConvertCoin') || event.target.classList.contains('Bc-convertCoin') || event.target.classList.contains('convertCoinNum')) {
19
20				errorMessage.classList.remove('is-active');
21				coinsNum.classList.remove('is-error');
22				errorMessageTwo.classList.remove('is-active');
23				toCoinsNum.classList.remove('is-error');
24
25				if (coinsNum.value) {
26					if (!isNaN(coinsNum.value)) {
27						// Check Before Request
28						errorMessageTwo.classList.remove('is-active');
29						toCoinsNum.classList.remove('is-error');
30						container.value = "";
31						let num = coinsNum.value ? Number(coinsNum.value) : 1;
32						let url = 'https://min-api.cryptocompare.com/data/pricemultifull?fsyms=' + convertCoinsNum.value + '&tsyms=' + toConvertCoins.value;
33						let CALC_WIDGET = axios.get(url).then(function (response) {
34							if (response) {
35								let val = response.data.RAW[convertCoinsNum.value][toConvertCoins.value]['PRICE'],
36									value = Number(val) * num;
37								container.value = value; // Check For Error After Request
38
39								if (isNaN(coinsNum.value)) {
40									errorMessage.classList.add('is-active');
41									coinsNum.classList.add('is-error');
42									container.value = '';
43								}
44							}
45						});
46						return CALC_WIDGET;
47					} else {
48						errorMessage.classList.add('is-active');
49						coinsNum.classList.add('is-error');
50						container.value = '';
51					}
52				}
53			}
54
55			if (event.target.classList.contains('Bc-toConvertCoin') || event.target.classList.contains('Bc-convertCoin') || event.target.classList.contains('toConvertCoin')) {
56
57				errorMessage.classList.remove('is-active');
58				coinsNum.classList.remove('is-error');
59				errorMessageTwo.classList.remove('is-active');
60				toCoinsNum.classList.remove('is-error');
61
62				if (toCoinsNum.value) {
63					if (!isNaN(toCoinsNum.value)) {
64						// if (loader.classList) {
65						//     loader.classList.add("is-active");
66						// }
67						// Check Before Request
68						errorMessage.classList.remove('is-active');
69						coinsNum.classList.remove('is-error');
70						containerTwo.value = "";
71						let num = toCoinsNum.value ? Number(toCoinsNum.value) : 1;
72						let url = 'https://min-api.cryptocompare.com/data/pricemultifull?fsyms=' + toConvertCoins.value + '&tsyms=' + convertCoinsNum.value;
73						let CALC_TWO_WIDGET = axios.get(url).then(function (response) {
74							if (response) {
75								let val = response.data.RAW[toConvertCoins.value][convertCoinsNum.value]['PRICE'],
76									value = Number(val) * num;
77								containerTwo.value = (Math.round(value * 100) / 100).toFixed(2); // Check For Error After Request
78
79								if (isNaN(toCoinsNum.value)) {
80									errorMessageTwo.classList.add('is-active');
81									toCoinsNum.classList.add('is-error');
82									containerTwo.value = '';
83								}
84							}
85						});
86						return CALC_TWO_WIDGET;
87					} else {
88						errorMessageTwo.classList.add('is-active');
89						toCoinsNum.classList.add('is-error');
90						containerTwo.value = '';
91					}
92				}
93			}
94		}, // CALC COINS IN ALL STATUS
95
96		bcCalcClick: function () {
97
98			let coinsNum = document.querySelector('.Bc-num.convertCoinNum'),
99				toConvertCoins = document.querySelector('.Bc-toConvertCoin'),
100				convertCoinsNum = document.querySelector('.Bc-convertCoin'),
101				toCoinsNum = document.querySelector('.Bc-num.toConvertCoin'),
102				errorMessage = document.querySelector('.is-calc-error'),
103				errorMessageTwo = document.querySelector('.is-calc-error.error-two'),
104				loader = document.querySelector('.Bc-loader-container'),
105				container = document.querySelector('.Bc-num.toConvertCoin'),
106				containerTwo = document.querySelector('.Bc-num.convertCoinNum');
107			errorMessage.classList.remove('is-active');
108			coinsNum.classList.remove('is-error');
109			errorMessageTwo.classList.remove('is-active');
110			toCoinsNum.classList.remove('is-error');
111
112			if (coinsNum.value) {
113				if (!isNaN(coinsNum.value)) {
114					// Check Before Request
115					errorMessageTwo.classList.remove('is-active');
116					toCoinsNum.classList.remove('is-error');
117					container.value = "";
118					let num = coinsNum.value ? Number(coinsNum.value) : 1;
119					let url = 'https://min-api.cryptocompare.com/data/pricemultifull?fsyms=' + convertCoinsNum.value + '&tsyms=' + toConvertCoins.value;
120					let CALC_WIDGET = axios.get(url).then(function (response) {
121						if (response) {
122							let val = response.data.RAW[convertCoinsNum.value][toConvertCoins.value]['PRICE'],
123								value = Number(val) * num;
124							container.value = value; // Check For Error After Request
125
126							if (isNaN(coinsNum.value)) {
127								errorMessage.classList.add('is-active');
128								coinsNum.classList.add('is-error');
129								container.value = '';
130							}
131						}
132					});
133					return CALC_WIDGET;
134				} else {
135					errorMessage.classList.add('is-active');
136					coinsNum.classList.add('is-error');
137					container.value = '';
138				}
139			}
140		}, // CALC COINS IN ALL STATUS
141
142		requets: function () {
143			// sidebar pricing
144			let sidebarContainer = document.querySelector('.aside-coins');
145
146			if (sidebarContainer) {
147				// let requestPricing = function requestPricing() {
148				let data = {
149					action      : 'PRICING',
150					nonce       : requestObject.nonce,
151					responseType: 'json'
152				};
153				let container = sidebarContainer.querySelector('.aside-coins .inner');
154
155				axios.post(axiosUrl, Qs.stringify(data)).then(function (response) {
156					if (response) {
157						container.innerHTML = response.data;
158						document.querySelector('.aside-coins').classList.remove("is-active");
159						// document.querySelector('.Bc-loader').remove();
160					}
161				}).then(function (response) {
162					if (window.matchMedia("(max-width: 990px)").matches) {
163						new Swiper('.swiper-pricing', {
164							slidesPerView : 3,
165							spaceBetween  : 10,
166							autoplay      : true,
167							loop          : true,
168							allowTouchMove: true
169						});
170					}
171				});
172				// };
173
174				// requestPricing();
175			} // SINGLE
176
177
178			// if (document.querySelector('.Bc-single-container')) {
179			// 	let scroll = false;
180			// 	let h = document.querySelector('.Bc-single-container').offsetHeight;
181			// 	document.addEventListener("scroll", function (event) {
182			// 		if (scroll) {
183			// 			return false;
184			// 		}
185			//
186			// 		if (getDocHeight() - h <= getScrollXY()[1] + window.innerHeight) {
187			// 			scroll = true;
188			// 			let container = document.querySelector('.Bc-single-container'),
189			// 				page = container.getAttribute("data-page"),
190			// 				str = (parseInt(page) + 1).toString();
191			// 			let data = {
192			// 				action      : 'SINGLE_SCROLL',
193			// 				nonce       : requestObject.nonce,
194			// 				responseType: 'json',
195			// 				page        : page,
196			// 				query       : requestObject.query
197			// 			};
198			// 			axios.post(axiosUrl, Qs.stringify(data)).then(function (response) {
199			// 				if (response) {
200			// 					container.setAttribute("data-page", str);
201			// 					document.querySelector('.Bc-single-response').innerHTML = document.querySelector('.Bc-single-response').innerHTML + response.data;
202			// 					scroll = false;
203			// 					LazyLoad.update();
204			// 					comments();
205			// 					related();
206			// 				} else {
207			// 					scroll = true;
208			// 				}
209			// 			});
210			// 		}
211			// 	});
212			// }
213		}, // LIVE SEARCH
214
215		init: function () {
216
217			// let widgets = document.querySelectorAll(".Bc-coin-chart");
218			// Array.from(widgets).forEach(function (widget) {
219			// 	let id = widget.getAttribute('data-id'),
220			// 		getId = document.querySelector('#' + id),
221			// 		color = widget.getAttribute('data-color'),
222			// 		data = JSON.parse(widget.getAttribute('data-values'));
223			// 	let spark = {
224			// 		chart  : {
225			// 			type     : 'line',
226			// 			height   : 90,
227			// 			sparkline: {
228			// 				enabled: true
229			// 			},
230			// 			group    : 'sparklines'
231			// 		},
232			// 		series : [{
233			// 			name: '',
234			// 			data: data
235			// 		}],
236			// 		stroke : {
237			// 			width: 1.5,
238			// 			curve: 'smooth'
239			// 		},
240			// 		markers: {
241			// 			size: 0
242			// 		},
243			// 		tooltip: {
244			// 			fixed: {
245			// 				enabled : true,
246			// 				position: 'right'
247			// 			},
248			// 			x    : {
249			// 				show: false
250			// 			}
251			// 		},
252			// 		colors : color
253			// 	};
254			// 	new ApexCharts(document.querySelector(getId), spark).render();
255			// }); // CLAC COINS
256
257			document.addEventListener('change', Deco_Coins.bcCalcChange, false);
258			document.addEventListener('input', Deco_Coins.bcCalcChange, false);
259			document.addEventListener('cut', Deco_Coins.bcCalcChange, false);
260			document.addEventListener('copy', Deco_Coins.bcCalcChange, false);
261			document.addEventListener('paste', Deco_Coins.bcCalcChange, false);
262			$(document).on('click', '.js_convercoin', Deco_Coins.bcCalcClick);
263
264			Deco_Coins.requets();
265		}
266
267	};
268
269	$(document).ready(function () {
270		Deco_Coins.init();
271	});
272
273})(jQuery);

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.