1let SozlesmeOkundu=false, chpTime, RabbitCookieTime=30, mobile_breakpoint=600; 2let noCallback=null, noTime=null, noFooter=null, lazyLoadInstance=null; 3let template_bs3Modal = '<div class="modal fade cmsdynamicmodal" id="cmsModal" data-modal="modal" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog">'+ 4 '<div class="modal-dialog" role="document">'+ 5 ' <div class="modal-content">'+ 6 ' <div class="modal-header"><h4 class="modal-title"></h4><button type="button" class="close" data-dismiss="modal">×</button></div>'+ 7 ' <div class="modal-body"></div>'+ 8 ' </div>'+ 9 '</div>'+ 10 '</div>'; 11let template_bs4Modal = '' + 12 '<div class="modal fade cmsdynamicmodal" id="cmsModal" data-modal="modal" tabindex="-1" data-backdrop="static" data-keyboard="false" role="dialog">'+ 13 ' <div class="modal-dialog modal-lg">'+ 14 ' <div class="modal-content">'+ 15 ' <div class="modal-header"><h4 class="modal-title"></h4><button type="button" class="close" data-dismiss="modal">×</button></div>'+ 16 ' <div class="modal-body"></div>'+ 17 ' </div>'+ 18 ' </div>'+ 19 '</div>'; 20 21function RabbitCMSLang(Key){ 22 let t=0; 23 if(typeof eval('RabbitCMS.getObject()["'+ Key +'"]') == 'undefined'){ 24 t = decodeURIComponent(Key); 25 }else{ 26 t = eval('RabbitCMS.getObject()["'+ Key +'"]'); 27 }; 28 return t 29}; 30 31function LangID() { 32 let $langId = $('meta[name="cmsUniqueKey"]').attr('data-langid'); 33 try { 34 return parseInt($langId); 35 } catch (e) { 36 if ($langId == '') { console.log(e); return rbtLid; } 37 }; 38};
39 40function RabbitMustache(){ 41 /* language Content Replacer */ 42 const keyz = document.querySelectorAll('language:not([data-mustache-replaced])'); 43 keyz.forEach(Text => { 44 Text.innerHTML = RabbitCMSLang( Text.getAttribute('data-key') ); 45 Text.setAttribute('data-mustache-replaced', true); 46 }); 47 48 /* placeholder Content Replacer */ 49 const pHolders = document.querySelectorAll('[data-placeholder]:not([data-placeholder-replaced])'); 50 pHolders.forEach(pHolder => { 51 pHolder.setAttribute('placeholder', RabbitCMSLang( pHolder.getAttribute('data-placeholder') )); 52 pHolder.setAttribute('data-placeholder-replaced', true); 53 }); 54 55 /* title Content Replacer */ 56 const tHolders = document.querySelectorAll('[data-key-title]:not([data-keytitle-replaced])'); 57 tHolders.forEach(tHolder => { 58 tHolder.setAttribute('title', RabbitCMSLang( tHolder.getAttribute('data-key-title') )); 59 tHolder.setAttribute('data-keytitle-replaced', true); 60 }); 61 62 /* Popover Content Replacer */ 63 var itemsProcessed = 0; 64 const cHolders = document.querySelectorAll('[data-bs-replace-content]:not([data-bs-replace-content-replaced])'); 65 cHolders.forEach(cHolder => { 66 cHolder.setAttribute('data-bs-content', RabbitCMSLang( cHolder.getAttribute('data-bs-replace-content') )); 67 cHolder.setAttribute('data-bs-replace-content-replaced', true); 68 itemsProcessed++; 69 if(itemsProcessed === cHolders.length){ 70 console.log('Complete..') 71 var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"][data-bs-replace-content-replaced]')); 72 var popoverList = popoverTriggerList.map(function(el){return new bootstrap.Popover(el)}); 73 } 74 }); 75}; 76 77var Warning = { 78 /* 79 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 80 * Adjans Rabbit CMS System 81 * Template Açıklama 82 * 83 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 84 */ 85 init: function() { 86 let Warns = Warning.getUrlVars()["WarningMessage"]; 87 if (Warns !== undefined) { 88 if(Warns.includes('#')){ 89 Warns = Warns.split('#')[0]; 90 }; 91 92 app.systems.alert('warning', RabbitCMSLang('dikkat'), RabbitCMSLang(Warns), null, noTime, noCallback,{confirm:true,cancel:false}); 93 }; 94 Warning.alert(); 95 }, 96 alert: function() { 97 if ($('.confirm')[0]) { 98 $("body").on('click', '.confirm', function(event) { 99 event.preventDefault(); 100 101 let url = $(this).attr("href"); 102 let Messages = $(this).data("confirm-msg"); 103 let alertCallback = function() { 104 location.href = url; 105 }; 106 app.systems.alert('info', RabbitCMSLang('islemi_onayla'), Messages, null, null, alertCallback, {confirm: true, cancel: true}); 107 }); 108 } 109 }, 110 /* 111 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 112 * Adjans Rabbit CMS System 113 * Template Açıklama 114 * 115 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 116 */ 117 getUrlVars: function() { 118 var vars = [], 119 hash; 120 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 121 for (var i = 0; i < hashes.length; i++) { 122 hash = hashes[i].split('='); 123 vars.push(hash[0]); 124 vars[hash[0]] = hash[1]; 125 } 126 return vars; 127 } 128}; 129 130let $body = document.querySelector('body'); 131let $CmsModalId='izimodal', $CmsModal=null; 132var app = { 133 /* 134 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 135 * Adjans Rabbit CMS System 136 * Template Açıklama 137 * 138 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 139 */ 140 init: function(){ 141 app.special_functions.fn_ConsoleLog('app=>init', 'info'); 142 143 app.event.ready(); 144 app.event.unload(); 145 app.event.beforeunload(); 146 app.event.resize(); 147 app.event.load(); 148 149 // app.i18n(); 150 app.modal.init(); 151
152 Warning.init(); 153 154 if( $('#euroconvert')[0] ){ 155 $('#euroconvert').html( parseFloat(one_euro).toFixed(2) + 'âº'); 156 } 157 }, 158 /* 159 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 160 * Adjans Rabbit CMS System 161 * Template Açıklama 162 * 163 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 164 */ 165 event: { 166 /************************************************ 167 * WINDOW READY 168 ************************************************/ 169 ready: function() { 170 app.special_functions.fn_ConsoleLog('app=>event=>DOMContentLoaded', 'info'); 171 app.systems.init(); 172 app.systems.cookieLaw(); 173 app.event.jQueryEvents(); 174 app.special_functions.fn_LazyLoad(); 175 app.special_functions.fn_ageVerficiation(); 176 app.special_functions.priceBeautifier(); 177 app.ecommerce.init(); 178 app.special_functions.starRating(); 179 app.special_functions.UserReview(); 180 app.SiparisTakip(); 181 app.special_functions.selectAllCheckbox(); 182 183 if($('[autocomplete="off"]')[0]){ 184 setTimeout(function(){ 185 $('[autocomplete="off"]:input').val(''); 186 }, 500); 187 }; 188 }, 189 /************************************************ 190 * WINDOW LOAD 191 ************************************************/ 192 load: function() { 193 app.special_functions.fn_ConsoleLog('app=>event=>load', 'info'); 194 window.addEventListener('load',function(){ 195 app.systems.PageLoaderHide(); 196 app.special_functions.fn_RangeSlider(); 197 app.tabController(); 198 }); 199 }, 200 /************************************************ 201 * WINDOW UNLOAD 202 ************************************************/ 203 unload: function() { 204 app.special_functions.fn_ConsoleLog('app=>event=>unload', 'info'); 205 window.addEventListener("unload", function(event) { 206 207 }); 208 }, 209 /************************************************ 210 * WINDOW BEFORE UNLOAD 211 ************************************************/ 212 beforeunload: function() { 213 app.special_functions.fn_ConsoleLog('app=>event=>beforeunload', 'info'); 214 window.addEventListener("beforeunload", function(event) { 215 216 }); 217 }, 218 /************************************************ 219 * WINDOW RESIZE 220 ************************************************/ 221 resize: function() { 222 app.special_functions.fn_ConsoleLog('app=>event=>resize', 'info'); 223 window.addEventListener("resize", function() { 224 225 }, true); 226 }, 227 /************************************************ 228 * WINDOW RESIZE 229 ************************************************/ 230 jQueryEvents: function() { 231 if (window.jQuery) { 232 app.special_functions.fn_ConsoleLog('app=>event=>jQueryEvents', 'info'); 233 /* Ajax Start Event */ 234 $(document).ajaxStart(function() { 235 app.special_functions.fn_ConsoleLog('app=>event=>jQueryEvents=>ajaxStart', 'info'); 236 }); 237 238 /* Ajax Success Event */ 239 $(document).ajaxSuccess(function() { 240 app.special_functions.fn_ConsoleLog('app=>event=>jQueryEvents=>ajaxSuccess', 'info'); 241 }); 242 243 /* Ajax Complete Event */ 244 $(document).ajaxComplete(function() { 245 app.special_functions.fn_ConsoleLog('app=>event=>jQueryEvents=>ajaxComplete', 'info'); 246 if ($('a[href="#"]').length) { 247 $('a[href="#"]').click(function(event) { 248 event.preventDefault(); 249 }); 250 } 251 252 fnMaskedInput(); 253 app.special_functions.fn_Tooltip(); 254 app.special_functions.fn_LazyLoadUpdate(); 255 }); 256 257 /* Ajax Error Event */ 258 $(document).ajaxError(function() { 259 app.special_functions.fn_ConsoleLog('app=>event=>jQueryEvents=>ajaxError', 'info'); 260 app.special_functions.fn_ConsoleLog('app=>event=>jQueryEvents=>ajaxError', 'error'); 261 262 }); 263 264 app.special_functions.fn_Tooltip(); 265 } 266 } 267 }, 268 /* 269 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
270 * Adjans Rabbit CMS System 271 * CMS Modal 272 * 273 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 274 */ 275 modal: { 276 init: function(){ 277 app.modal.createModal(); 278 }, 279 createModal: function(){ 280 if( $('#'+$CmsModalId)[0] ){ 281 $('#'+$CmsModalId).iziModal('destroy'); 282 $('#'+$CmsModalId).remove(); 283 }; 284 285 $('<div id="'+$CmsModalId+'"><!-- CMS IziModal --></div>').appendTo($body); 286 $CmsModal = $('#'+$CmsModalId+'').iziModal({ 287 zindex : 9999, 288 rtl : false, 289 theme : 'light', 290 width : 600, 291 radius : 3, 292 padding : 15, 293 headerColor:'#e6e6e6', /*88A0B9*/ 294 arrowKeys: false, 295 bodyOverflow:true, 296 history: false, 297 restoreDefaultContent: false, 298 closeOnEscape: false, 299 closeButton: true, 300 overlay: true, 301 overlayClose: false, 302 overlayColor: 'rgba(0, 0, 0, 0.6)', 303 setContent: '<p>Yükleniyor...</p>' 304 }); 305 306 $(document).on('opening', '#'+$CmsModalId+'', function (e) { 307 //console.log('Modal is opening'); 308 }); 309 $(document).on('opened', '#'+$CmsModalId+'', function (e) { 310 //console.log('Modal is opening'); 311 }); 312 $(document).on('closing', '#'+$CmsModalId+'', function (e) { 313 //console.log('Modal is opening'); 314 }); 315 $(document).on('closed', '#'+$CmsModalId+'', function (e) { 316 //console.log('Modal is opening'); 317 }); 318 $(document).on('fullscreen', '#'+$CmsModalId+'', function (e, modal) { 319 if(modal.isFullscreen){ 320 // Enabled 321 } else { 322 // Disabled 323 } 324 }); 325 }, 326 Destroy: function(){ 327 $CmsModal.iziModal('destroy'); 328 }, 329 Width: function(vWidth=400){ 330 $CmsModal.iziModal('setWidth', vWidth); 331 }, 332 StartLoading: function(){ 333 $CmsModal.iziModal('startLoading'); 334 }, 335 StopLoading: function(forceInstant=false){ 336 if(forceInstant){ 337 $CmsModal.iziModal('stopLoading'); 338 }else{ 339 setTimeout(function(){$CmsModal.iziModal('stopLoading');},200); 340 } 341 }, 342 getState: function(){ 343 return $CmsModal.iziModal('getState'); 344 }, 345 open: function(){ 346 $CmsModal.iziModal('open'); 347 }, 348 close: function(){ 349 $CmsModal.iziModal('close'); 350 $CmsModal.iziModal('setTitle', ''); 351 $CmsModal.iziModal('setSubtitle', ''); 352 $CmsModal.iziModal('setHeaderColor', ''); 353 $CmsModal.iziModal('setHeader', ''); 354 $CmsModal.iziModal('setBottom', 'auto'); 355 $CmsModal.iziModal('setTop', 'auto'); 356 }, 357 reset: function(){ 358 $CmsModal.iziModal('close'); 359 $CmsModal.iziModal('setWidth', 400); 360 // $CmsModal.iziModal('setContent', '...'); 361 }, 362 setHeader: function(vState=''){ 363 $CmsModal.iziModal('setHeader', vState); 364 }, 365 setTitle: function(vText='Modal'){ 366 // $CmsModal.find('.iziModal-header')[0] 367 $CmsModal.iziModal('setTitle', vText); 368 }, 369 setSubTitle: function(vText='Modal Subtitle'){ 370 // $CmsModal.find('.iziModal-header')[0] 371 $CmsModal.iziModal('setSubtitle', vText); 372 }, 373 fullscreen: function(vState=false){ 374 $CmsModal.iziModal('setFullscreen', vState); 375 }, 376 setBottom: function(vBottom='auto'){ 377 $CmsModal.iziModal('setBottom', vBottom); 378 }, 379 setTop: function(vTop='auto'){ 380 $CmsModal.iziModal('setTop', vTop); 381 }, 382 setContent: function(vText=''){ 383 $CmsModal.iziModal('setContent', vText); 384 } 385 }, 386 /* 387 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
388 * Adjans Rabbit CMS System 389 * CMS Swal with Callback 390 * 391 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 392 */ 393 swal: function(title='', html='', icon='error', CbSuccess=function(){}, CbFail=function(){}) { 394 Swal.fire({ 395 icon : icon, 396 title : title, 397 html : html, 398 showCancelButton : true, 399 showConfirmButton : true, 400 allowOutsideClick : false, 401 allowEscapeKey : false, 402 allowEnterKey : false, 403 buttonsStyling : false, 404 reverseButtons : true, 405 background : app.settings.swal.background, 406 backdrop :'rgba(0,0,0,0.6)', 407 customClass : app.settings.swal.customClass 408 }).then(function(result){ 409 if (result.value || result.dismiss=='timer'){ 410 CbSuccess(); 411 }else{ 412 CbFail(); 413 } 414 }).catch(swal.noop); 415 }, 416 /* 417 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 418 * Adjans Rabbit CMS System 419 * i18Next Entegrasyonu 420 * 421 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 422 */ 423 i18n: function() { 424 if ($('html[lang]')[0]) { 425 let $html = $('html'); 426 i18next.use(window.i18nextXHRBackend).init({ 427 debug : false, 428 lng : $html.attr('lang'), 429 escapeValue : false, 430 fallbackLng : 'tr', 431 backend : { 432 loadPath: '/translator/{{lng}}.json' 433 }, 434 returnObjects: true 435 }, 436 function(err, t) { 437 jqueryI18next.init(i18next, $); 438 } 439 ); 440 i18next.on('languageChanged', function(lng) { 441 let $lang = i18next.language; 442 let $prevlang = $('meta[name="cmsUniqueKey"]').attr('data-lang'); 443 $('html').attr('lang', $lang); 444 $('meta[name="cmsUniqueKey"]').attr('data-lang', $lang); 445 446 try { 447 let $lang_id = eval('i18next.store.data.' + $lang + '.translation.LANG_ID'); 448 $('meta[name="cmsUniqueKey"]').attr('data-langid', $lang_id); 449 if (history.pushState) { 450 let newUri = window.location.href.replace('/'+$prevlang+'/','/'+ $lang +'/'); 451 history.pushState(null, null, newUri); 452 } 453 } catch (e) { 454 console.log(e); 455 window.location.href = window.location.href.replace('/'+$prevlang+'/','/'+ $lang +'/'); 456 } 457 }); 458 $(document).on('shown.bs.modal', function() { 459 $('.modal').localize(); 460 }); 461 462 $('[data-cms-language]').on('click', function(event) { 463 event.preventDefault(); 464 let $lang = $(this).data('cms-language'); 465 i18next.changeLanguage($lang, function(err, t) { 466 $html.localize(); 467 $langChangeWarning.init(); 468 }); 469 }); 470 } 471 }, 472 /* 473 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 474 * Adjans Rabbit CMS System 475 * Tab Controller 476 * 477 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 478 */ 479 tabController: function() { 480 $('.nav-tabs li a').on('shown.bs.tab', function(event) { 481 let $activeTab = $(this); 482 let $activeContainer = $activeTab.parents().find('.tab-pane'); 483 let oncekiTabAdi = $(event.relatedTarget).text(); 484 let oncekiTabHash = $(event.relatedTarget).attr('href'); 485 let yeniTabAdi = $(event.target).text(); 486 let yeniTabHash = $(event.target).attr('href'); 487 let yeniHash = location.origin + location.pathname + location.search + $(event.target).attr('href'); 488 489 if (history.pushState) { 490 history.pushState(null, null, yeniHash); 491 } else { 492 location.hash = yeniHash; 493 }; 494 495 $activeContainer.removeClass('active'); 496 $(yeniTabHash).addClass('active'); 497 }); 498 499 if (window.location.hash && $('.nav-tabs').length) { 500 let $selectedTab = window.location.hash; 501 502 let $tab = $('.nav-tabs a[href="' + $selectedTab + '"]'); 503 $tab.tab('show'); 504 $tab.parent().find('.nav-tabs li a').removeClass('active'); 505 $tab.addClass('active'); 506 507 if ($('select.onlymobile')[0]) { 508 $('select.onlymobile').val($selectedTab) 509 } 510 }; 511 }, 512 /* 513 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
514 * Adjans Rabbit CMS System 515 * Template Açıklama 516 * 517 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 518 */ 519 popover: function() { 520 if (document.querySelector('[data-toggle="tooltip"]')) { 521 $('[data-toggle="tooltip"]').tooltip('hide'); 522 $('[data-toggle="tooltip"]').tooltip(); 523 } 524 if (document.querySelector('[data-toggle="popover"]')) { 525 $('.popover').remove(); 526 $('[data-toggle="popover"]').popover('dispose'); 527 $('[data-toggle="popover"]').popover(); 528 } 529 return false; 530 }, 531 /* 532 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 533 * Adjans Rabbit CMS System 534 * Template Açıklama 535 * 536 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 537 */ 538 SiparisTakip: function() { 539 if (document.querySelector('.SiparisTakip')) { 540 $('.SiparisTakip').unbind('click'); 541 $('.SiparisTakip').click(function(event) { 542 event.preventDefault(); 543 544 var OTURUM_ANAHTARI = ''; 545 if( $('#OTURUM_ANAHTARI').length ){ 546 OTURUM_ANAHTARI = $('#OTURUM_ANAHTARI').val(); 547 } 548 549 Swal.fire({ 550 title: 'Oturum Anahtarınız', 551 html: 'Size verilen özel oturum anahtarınızı bu alana girin.', 552 icon: 'info', 553 input: 'text', 554 inputValue: OTURUM_ANAHTARI, 555 inputPlaceholder: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 556 inputAttributes: { 557 autocapitalize: 'off', 558 autocomplete: 'off' 559 }, 560 showCancelButton: true, 561 cancelButtonText: 'Vazgeç', 562 confirmButtonText: 'Kontrol Et', 563 showLoaderOnConfirm: true, 564 backdrop:'rgba(0,0,0,0.6)', 565 preConfirm: (login) => { 566 if (login.length == 36) { 567 return login; 568 } else { 569 Swal.showValidationMessage('Geçersiz Oturum Anahtarı'); 570 } 571 }, 572 allowOutsideClick: false 573 }).then(function(result) { 574 if (result.value != true && result.dismiss === undefined) { 575 $.ajax({
576 url: "/content/class/inc.core.asp?Cmd=CheckOrderByUserKey&nocache=" + Math.random(), 577 type: "POST", 578 data: { 579 'USERKEY': result.value 580 }, 581 success: function(data) { 582 /* MODAL Aà */ 583 if ($('.cmsdynamicmodal').length) { 584 $('.cmsdynamicmodal').modal("show").trigger('show.bs.modal'); 585 } else { 586 $(template_bs4Modal).appendTo('body'); 587 $('.cmsdynamicmodal').modal(); 588 } 589 $('.cmsdynamicmodal .modal-title').html('SipariÅ Sorgulama'); 590 $('.cmsdynamicmodal .modal-body').html(data); 591 $('.cmsdynamicmodal .modal-footer').html('<button type="button" class="btn btn-danger" data-dismiss="modal">Kapat</button>'); 592 }, 593 error: function(e) { 594 app.systems.alert('error', RabbitCMSLang('hata_olustu'), RabbitCMSLang('islem_yapilamadi'), null, 1000, noCallback, { confirm: false, cancel: false }); 595 } 596 }); 597 }; 598 if (result.value === undefined && result.dismiss == "cancel") { 599 600 } 601 }); 602 }); 603 } 604 }, 605 /* 606 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 607 * Adjans Rabbit CMS System 608 * Template Açıklama 609 * 610 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 611 */ 612 settings: { 613 // PageLoaderStatus: cms_site_loader_effect, 614 ConsoleLog: false, 615 cookieSettings: { 616 status : settings_COOKIE_WARN, 617 popupTitle : settings_popup_title, 618 popupText : settings_popup_text, 619 cookiePolicyUrl : settings_popup_url, 620 buttonContinueTitle : RabbitCMSLang('tamam'), 621 buttonLearnmoreTitle : RabbitCMSLang('detay'), 622 buttonCustomizeTitle : RabbitCMSLang('ayarlar') 623 }, 624 OWLSliderSettings: { 625 navigation: false, 626 slideSpeed: 300, 627 paginationSpeed: 400, 628 singleItem: true, 629 autoPlay: true 630 }, 631 swalDefault: function(type='warning', title='title', html='html'){ 632 let data = { 633 'icon' : type, 634 'title' : title, 635 'html' : html, 636 'showCancelButton' : true, 637 'cancelButtonText' : RabbitCMSLang('vazgec'), 638 'confirmButtonText' : RabbitCMSLang('tamam'), 639 'showConfirmButton' : true, 640 'background' : app.settings.swal.background, 641 'customClass' : app.settings.swal.customClass, 642 'allowOutsideClick' : false, 643 'allowEscapeKey' : false, 644 'allowEnterKey' : false, 645 'buttonsStyling' : false, 646 'reverseButtons' : true, 647 'timer' : null 648 } 649 return data 650 }, 651 swal: { 652 background: 'rgba(255, 255, 255, 1)', 653 customClass: { 654 closeButton : 'btn btn-seconary', 655 confirmButton : 'btn btn-success', 656 cancelButton : 'btn btn-seconary' 657 } 658 }, 659 instaFeedSettings: { 660 clientId: '568a0a2230d142808c3b3f46c78954ce', 661 userId: '2229312800', 662 mediaCount: 9 663 } 664 }, 665 /* 666 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 667 * Adjans Rabbit CMS System 668 * Template Açıklama 669 * 670 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 671 */ 672 paymentMessage: function(MessageType, Message, OrderID, consoleLog=null){ 673 console.log('Log: ', consoleLog); 674 switch(MessageType) { 675 case 'Failed': 676 $.featherlight.current().close(); 677 678 let TheCallBackFailed = function(){ 679 window.location.reload(); 680 }; 681 682 app.systems.alert('warning', 'Ãdeme BaÅarısız', 'Ãdeme iÅlemi sırasında bir sorun oluÅtu ve tamamlanamadı. Lütfen tekrar deneyin. Hata Açıklaması: '+ Message +' ', null, null, TheCallBackFailed, { confirm: true, cancel: false }); 683 684 break; 685 case 'Success': 686 let TheCallBackSuccess = function(){ 687 // window.location.reload(); 688 window.location.href = '/'+cms_lang+'/account/?Section=OrderDetails&OrderComplete=1&I='+OrderID+''; 689 }; 690 691 try { 692 $.featherlight.current().close(); 693 } 694 catch(error) { 695 console.error('FeatherLight Bulunamadı!'); 696 } 697 698 app.systems.alert('success', 'İÅlem BaÅarılı', ''+ Message +'', null, 3000, TheCallBackSuccess, { confirm: true, cancel: false }); 699 700 break; 701 default: 702 // code block 703 } 704 }, 705 /* 706 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
707 * Adjans Rabbit CMS System 708 * Template Açıklama 709 * 710 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 711 */ 712 special_functions:{ 713 /* 714 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 715 * Adjans Rabbit CMS System 716 * Template Açıklama 717 * 718 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 719 */ 720 selectAllCheckbox: function() { 721 if (document.querySelector('[cms-selectall]')) { 722 $("[cms-selectall]").click(function() { 723 let TargetClass = $(this).attr('cms-selectall'); 724 725 $('input[type="checkbox"].' + TargetClass).prop('checked', $(this).prop('checked')); 726 }); 727 } 728 }, 729 /* 730 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 731 * Adjans Rabbit CMS System 732 * Template Açıklama 733 * 734 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 735 */ 736 urlParam: function(name) { 737 var results = new RegExp('[\?&]' + name + '=([^&#]*)') 738 .exec(window.location.search); 739 740 return (results !== null) ? results[1] || 0 : false; 741 }, 742 /* 743 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 744 * Adjans Rabbit CMS System 745 * Template Açıklama 746 * 747 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 748 */ 749 UserReview: function() { 750 if (document.querySelector('#submitReview')) { 751 let ReviewSubmitBtn = $('#submitReview button'); 752 753 ReviewSubmitBtn.unbind('click'); 754 ReviewSubmitBtn.click(function(event) { 755 event.preventDefault(); 756 ReviewSubmitBtn.prop('disabled', true); 757 758 let review = $('#review').val(); 759 760 if (review.length < 10) { 761 app.systems.alert('error', RabbitCMSLang('islem_yapilamadi'), RabbitCMSLang('yorum_gerekli'), null, 3000, noCallback, { confirm: true, cancel: false }); 762 ReviewSubmitBtn.prop('disabled', false); 763 return false 764 } 765 766 $.ajax({
767 type: "POST", 768 url: '/content/class/inc.core.asp?Cmd=POST:ProductReview', 769 data: { 770 productId: app.special_functions.urlParam('I'), 771 prodReview: review, 772 prodScore: $('#ReviewScore').val() 773 }, 774 success: function(data) { 775 if (data.status == 200) { 776 $('#submitReview')[0].reset(); 777 app.systems.alert('success', RabbitCMSLang('islem_basarili'), RabbitCMSLang('yorumeklendi'), null, 3000, noCallback, { confirm: true, cancel: false }); 778 } else { 779 app.systems.alert('error', RabbitCMSLang('hata_olustu'), data.messages, null, 2000, noCallback, { confirm: false, cancel: false }); 780 } 781 ReviewSubmitBtn.prop('disabled', false); 782 }, 783 error: function(e) { 784 app.systems.alert('error', RabbitCMSLang('hata_olustu'), RabbitCMSLang('islem_yapilamadi'), null, 2000, noCallback, { confirm: false, cancel: false }); 785 ReviewSubmitBtn.prop('disabled', false); 786 } 787 }); 788 789 }); 790 } 791 }, 792 /* 793 * ############################################################### 794 * Adjans Rabbit CMS System 795 * Template Açıklama 796 * ############################################################### 797 */ 798 starRating: function() { 799 if ($('[data-plugin-star-rating]').length) { 800 $('[data-plugin-star-rating]').each(function(index, el) { 801 let $data = $(this).attr('data-plugin-options'); 802 let $pluginSettings = app.special_functions.parseSettings( $data ); 803 804 $(this).rating($pluginSettings); 805 }); 806 } 807 }, 808 /* 809 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 810 * Adjans Rabbit CMS System 811 * Template Açıklama 812 * 813 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 814 */ 815 parseSettings: function(vString=''){ 816 try{ 817 return JSON.parse( vString.replace(/'/g,'"').replace(';','')); 818 } 819 catch(e){ 820 return{} 821 }; 822 }, 823 /* 824 * ############################################################### 825 * Adjans Rabbit CMS System 826 * Template Açıklama 827 * ############################################################### 828 */ 829 prettySize: function(bytes, separator = '', postFix = '') { 830 if (bytes) { 831 const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; 832 const i = Math.min(parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10), sizes.length - 1); 833 return `${(bytes / (1024 ** i)).toFixed(i ? 1 : 0)}${separator}${sizes[i]}${postFix}`; 834 } 835 return 'n/a'; 836 }, 837 /* 838 * ############################################################### 839 * Adjans Rabbit CMS System 840 * Template Açıklama 841 * ############################################################### 842 */ 843 IlIlceAjax: function() { 844 if ( $('.ililceAjax')[0] ) { 845 var once_secin_txt = $("option:selected", $("#ILCE")[0]).val(); 846 $('.ililceAjax').each(function(e) { 847 var $AnaKutu = $(this); 848 849 /* Seçili Varsa */ 850 if ($("option:selected", $AnaKutu).val() !== "") { 851 var $AltKutu = $(this).attr("data-parent"); 852 var SEcilenIlID = $("option:selected", $AnaKutu).val(); 853 $.getJSON("/api/?Cmd=il.ilceler&Province=" + SEcilenIlID, function(sonuc) { 854 $("#" + $AltKutu).empty().append('<option value="0">İlçe Seçin</option>') 855 856 $.each(sonuc.RESULTS[0].DISTRICT, function(index, value) { 857 $("#" + $AltKutu).append('<option value="' + value.ID + '">' + value.DISTRICT + '</option>'); 858 }); 859 $("#" + $AltKutu).val(parseInt($("#" + $AltKutu).attr('data-selected'))); 860 }); 861 } 862 863 $($AnaKutu).on("change", function(event) { 864 event.preventDefault(); 865 var $AltKutu = $(this).attr("data-parent"); 866 var SEcilenIlID = $("option:selected", $AnaKutu).val(); 867 868 if (SEcilenIlID == 0) { 869 $("#" + $AltKutu).empty().append('<option value="0">' + once_secin_txt + '</option>'); 870 } else { 871 $.getJSON("/api/?Cmd=il.ilceler&Province=" + SEcilenIlID, function(sonuc) { 872 $("#" + $AltKutu).empty().append('<option value="0">İlçe Seçin</option>') 873 874 $.each(sonuc.RESULTS[0].DISTRICT, function(index, value) { 875 $("#" + $AltKutu).append('<option value="' + value.ID + '">' + value.DISTRICT + '</option>'); 876 }); 877 }); 878 } 879 }); 880 881 }); 882 } 883 }, 884 /* 885 * ###############################################################
886 * Adjans Rabbit CMS System 887 * Template Açıklama 888 * ############################################################### 889 */ 890 priceBeautifier: function() { 891 if ($('price')[0]) { 892 $('price:not([data-init])').each(function(index, elem) { 893 let PriceElem = $(this); 894 let PriceVal = parseFloat(PriceElem.html().replace('.', '').replace(',', '.')); 895 let tmpCurrency = cms_currency; 896 897 if(PriceElem.html().indexOf("EUR") > -1){ 898 tmpCurrency = 'EUR'; 899 }else if(PriceElem.html().indexOf("USD") > -1){ 900 tmpCurrency = 'USD'; 901 }else { 902 tmpCurrency = 'TRY'; 903 } 904 905 var formatter = new Intl.NumberFormat(cms_locale, { 906 style: 'currency', 907 currency: tmpCurrency, 908 minimumFractionDigits: 3, 909 maximumFractionDigits: 3, 910 }); 911 912 // let PriceVal = PriceElem.html(); 913 let result = formatter.format(PriceVal).split(','); 914 PriceElem.html(`${result[0]}.<small>${result[1]}</small>`); 915 PriceElem.attr('data-init', 'true'); 916 PriceElem.attr('data-currency', tmpCurrency); 917 }) 918 } 919 }, 920 /* 921 * ############################################################### 922 * Adjans Rabbit CMS System 923 * Template Açıklama 924 * ############################################################### 925 */ 926 fn_ageVerficiation: function(){ 927 if ( document.querySelectorAll('[cms-plugin="AgeVerification"]').length>0) { 928 app.special_functions.fn_ConsoleLog('app=>special_functions=>fn_ageVerficiation', 'info'); 929 930 var minAge = $('select').val(); 931 $('select').on('change', function() { 932 minAge = $(this).val(); 933 }); 934 $('button').on('click', function() { 935 sessionStorage.clear(); 936 $.ageCheck({ minAge: minAge }); 937 }); 938 $.ageCheck({ minAge: minAge }); 939 } 940 }, 941 /* 942 * ############################################################### 943 * Adjans Rabbit CMS System 944 * Template Açıklama 945 * ############################################################### 946 */ 947 fn_LazyLoad: function(){ 948 if ( $('.lazy')[0] ) { 949 app.special_functions.fn_ConsoleLog('app=>special_functions=>fn_LazyLoad', 'info'); 950 951 var callback_enter = function(element) { 952 }; 953 var callback_exit = function(element) { 954 }; 955 var callback_reveal = function(element) { 956 }; 957 var callback_loaded = function(element) { 958 }; 959 var callback_error = function(element) { 960 /* element.src = "https://via.placeholder.com/440x560/?text=Error+Placeholder"; */ 961 }; 962 var callback_finish = function() { 963 }; 964 965 lazyLoadInstance = new LazyLoad({ 966 elements_selector : ".lazy", 967 callback_enter : callback_enter, 968 callback_exit : callback_exit, 969 callback_reveal : callback_reveal, 970 callback_loaded : callback_loaded, 971 callback_error : callback_error, 972 callback_finish : callback_finish 973 }); 974 975 window.addEventListener('LazyLoad::Initialized', function (event) { 976 window.lazyLoadInstance = event.detail.instance; 977 }, false); 978 } 979 }, 980 fn_LazyLoadUpdate: function() { 981 app.special_functions.fn_ConsoleLog('app=>special_functions=>fn_LazyLoadUpdate', 'start'); 982 983 setTimeout(function() { 984 if (lazyLoadInstance == null) { 985 app.special_functions.fn_LazyLoad(); 986 } else {
987 lazyLoadInstance.update(); 988 }; 989 }, 500); 990 }, 991 /* 992 * ############################################################### 993 * Adjans Rabbit CMS System 994 * Template Açıklama 995 * ############################################################### 996 */ 997 fn_RangeSlider: function(){ 998 if (document.querySelector('#slider-range')) { 999 app.special_functions.fn_ConsoleLog('app=>special_functions=>fn_RangeSlider', 'info'); 1000 1001 $("#slider-range").slider({ 1002 range: true, 1003 min: 0, 1004 max: 500, 1005 //values: [ 75, 300 ], 1006 slide: function(event, ui) { 1007 $("#amount").val("$" + ui.values[0]); //+ " - $" + ui.values[ 1 ] ); 1008 } 1009 }); 1010 1011 $("#amount").val("$" + $("#slider-range").slider("values", 0)); // + 1012 // " - $" + $( "#slider-range" ).slider( "values", 1 ) ); 1013 } 1014 }, 1015 /* 1016 * ############################################################### 1017 * Adjans Rabbit CMS System 1018 * Bootstrap Tooltip 1019 * ############################################################### 1020 */ 1021 fn_Tooltip: function(){ 1022 app.special_functions.fn_ConsoleLog('app=>special_functions=>fn_Tooltip', 'info'); 1023 1024 if (document.querySelector('[data-toggle="tooltip"]')) { 1025 /* First, Destroy */ 1026 $('[data-toggle="tooltip"]').tooltip('dispose'); 1027 /*Then Init */ 1028 $('[data-toggle="tooltip"]').tooltip({trigger : 'hover'}); 1029 } 1030 }, 1031 /* 1032 * ############################################################### 1033 * Adjans Rabbit CMS System 1034 * Console Log Debug 1035 * ############################################################### 1036 */ 1037 fn_ConsoleLog: function(msg, color) { 1038 if(app.settings.ConsoleLog){ 1039 color = color || "black"; 1040 bgc = "White"; 1041 switch (color) { 1042 case "success": color = "Green"; bgc = "LimeGreen"; break; 1043 case "info": color = "DodgerBlue"; bgc = "Turquoise"; break; 1044 case "error": color = "Red"; bgc = "Black"; break; 1045 case "start": color = "OliveDrab"; bgc = "PaleGreen"; break; 1046 case "warning": color = "Tomato"; bgc = "Black"; break; 1047 case "end": color = "Orchid"; bgc = "MediumVioletRed"; break; 1048 default: color = color; 1049 } 1050 1051 if (typeof msg == "object") { 1052 console.log(msg); 1053 } else if (typeof color == "object") { 1054 console.log("%c" + msg, "color: PowderBlue;font-weight:bold; background-color: RoyalBlue;"); 1055 console.log(color); 1056 } else { 1057 console.log("%c" + msg, "color:" + color + ";font-weight:bold; background-color: " + bgc + ";"); 1058 } 1059 } 1060 }, 1061 /* 1062 * ############################################################### 1063 * Adjans Rabbit CMS System 1064 * Instagram Feed JS 1065 * ############################################################### 1066 */ 1067 fn_InstaFeed: function(){ 1068 if (document.querySelector('#InstagramFeed')) { 1069 app.special_functions.fn_ConsoleLog('app=>special_functions=>fn_InstaFeed', 'start'); 1070 1071 let instaApiURL = "https://api.instagram.com/v1/users/"+ app.settings.instaFeedSettings.userId +"/media/recent/?client_id="+ app.settings.instaFeedSettings.clientId +"&count="+ app.settings.instaFeedSettings.mediaCount +"" 1072 1073 $.ajax({
1074 type : "GET", 1075 dataType : "jsonp", 1076 cache : false, 1077 url : instaApiURL, 1078 success: function(data) { 1079 for (var i = 0; i < app.settings.instaFeedSettings.mediaCount; i++) { 1080 var text = '', locationName = '', likes = ''; 1081 if (data.data[i].caption != null) 1082 text = data.data[i].caption.text; 1083 if (data.data[i].likes != null) 1084 if (data.data[i].likes.count > 0) 1085 likes = " like : " + data.data[i].likes.count; 1086 $("#InstagramFeed").append('<div class="col-xs-4"><a class="Rabbitgallery" href="' + data.data[i].images.standard_resolution.url + '"><img class="img-responsive" alt="Instagram" src="' + data.data[i].images.low_resolution.url + '" /></a></div>'); 1087 } 1088 }, 1089 complete: function() { 1090 $("#InstagramFeed div a").prettyPhoto({ animation_speed: 'fast', slideshow: 10000, hideflash: true }); 1091 } 1092 }); 1093 } 1094 } 1095 }, 1096 /* 1097 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 1098 * Adjans Rabbit CMS System 1099 * Template Açıklama 1100 * 1101 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 1102 */ 1103 systems: { 1104 /* 1105 * ############################################################### 1106 * Adjans Rabbit CMS System 1107 * Template Açıklama 1108 * 1109 * ############################################################### 1110 */ 1111 init: function(){ 1112 app.special_functions.fn_ConsoleLog('app=>systems=>init', 'start'); 1113 1114 app.systems.PageLoader(); 1115 app.systems.hrefHashPrevent(); 1116 app.systems.slider('owl'); 1117 app.systems.slider('slick'); 1118 app.systems.slider('hbslider'); 1119 app.systems.PopUp(); 1120 app.systems.socialSharePlugin(); 1121 }, 1122 /* 1123 * ############################################################### 1124 * Adjans Rabbit CMS System 1125 * UnClick 1126 * ############################################################### 1127 */ 1128 hrefHashPrevent: function(){ 1129 if ( document.querySelector('.unclick') ) { 1130 app.special_functions.fn_ConsoleLog('app=>systems=>hrefHashPrevent', 'start'); 1131 1132 $(".unclick").click(function(event) { 1133 event.preventDefault(); 1134 1135 }); 1136 } 1137 }, 1138 /* 1139 * ############################################################### 1140 * Adjans Rabbit CMS System 1141 * Cookie Plugin 1142 * ############################################################### 1143 */ 1144 cookieLaw: function(){ 1145 if (app.settings.cookieSettings.status) { 1146 app.special_functions.fn_ConsoleLog('app=>systems=>cookieLaw', 'start'); 1147 1148 $('body').ihavecookies({ 1149 title: '🍪 ' + app.settings.cookieSettings.popupTitle, 1150 message: app.settings.cookieSettings.popupText, 1151 delay: 600, 1152 expires: 30, 1153 samesite: 'none', 1154 secure: 1, 1155 link: app.settings.cookieSettings.cookiePolicyUrl, 1156 onAccept: function() { 1157 var myPreferences = $.fn.ihavecookies.cookie(); 1158 //console.log('Yay! The following preferences were saved...'); 1159 //console.log(myPreferences); 1160 }, 1161 cookieTypesTitle: 'Kabul edebileceÄiniz çerezler', 1162 fixedCookieTypeLabel: 'Gerekli', 1163 cookieTypes:[ 1164 { 1165 type:"Site Ayarları", 1166 value:"preferences", 1167 description:"These are cookies that are related to your site preferences, e.g. remembering your username, site colours, etc." 1168 },{ 1169 type:"İstatistik", 1170 value:"analytics", 1171 description:"Cookies related to site visits, browser types, etc." 1172 },{ 1173 type:"Pazarlama", 1174 value:"marketing", 1175 description:"Cookies related to marketing, e.g. newsletters, social media, etc" 1176 } 1177 ], 1178 uncheckBoxes: false, 1179 acceptBtnLabel: app.settings.cookieSettings.buttonContinueTitle, 1180 advancedBtnLabel: app.settings.cookieSettings.buttonCustomizeTitle, 1181 moreInfoLabel: app.settings.cookieSettings.buttonLearnmoreTitle 1182 }); 1183 1184 if ($.fn.ihavecookies.preference('preferences') === true) { 1185 //console.log('preferences is accepted.'); 1186 }; 1187 if ($.fn.ihavecookies.preference('analytics') === true) { 1188 //console.log('analytics is accepted.'); 1189 }; 1190 if ($.fn.ihavecookies.preference('marketing') === true) { 1191 //console.log('marketing is accepted.'); 1192 }; 1193 } 1194 }, 1195 /* 1196 * ###############################################################
1197 * Adjans Rabbit CMS System 1198 * Sosyal PaylaÅım URL Düzeltme 1199 * ############################################################### 1200 */ 1201 socialSharePlugin: function(){ 1202 if ( document.querySelector('.SocHref') ) { 1203 app.special_functions.fn_ConsoleLog('app=>systems=>socialSharePlugin', 'start'); 1204 1205 let SayfaURL = $(location).attr('href'); 1206 1207 $('a.SocHref').each(function(i, obj) { 1208 let MevcutURL = $(this).attr("href"); 1209 let YeniURL = MevcutURL + SayfaURL; 1210 1211 $(this).attr("href", YeniURL); 1212 }); 1213 } 1214 }, 1215 /* 1216 * ############################################################### 1217 * Adjans Rabbit CMS System 1218 * GoodUI Alert 1219 * ############################################################### 1220 */ 1221 alert: function(type="", title="", message="", footerhtml="", tTimer=null, callBack=noCallback, buttons={confirm:false, cancel:true}){ 1222 app.special_functions.fn_ConsoleLog('app=>systems=>alert', 'start'); 1223 1224 Swal.fire({ 1225 icon : type, 1226 title : title, 1227 html : message, 1228 footer : footerhtml, 1229 showCancelButton : buttons.cancel, 1230 showConfirmButton : buttons.confirm, 1231 allowOutsideClick : false, 1232 allowEscapeKey : false, 1233 allowEnterKey : false, 1234 buttonsStyling : false, 1235 reverseButtons : true, 1236 background : app.settings.swal.background, 1237 backdrop :'rgba(0,0,0,0.6)', 1238 customClass : app.settings.swal.customClass, 1239 timer : tTimer 1240 }).then(function(result){ 1241 if (result.value || result.dismiss=='timer'){ 1242 app.special_functions.fn_ConsoleLog('app=>systems=>alert=>callBack', 'start'); 1243 let CheckTypefn = typeof(result); 1244 if( CheckTypefn == 'function' || CheckTypefn == 'object' ){ 1245 try { 1246 callBack(result); 1247 } 1248 catch(error) { 1249 app.special_functions.fn_ConsoleLog('app=>systems=>alert=>callbackfn', 'error'); 1250 } 1251 }; 1252 } 1253 }).catch(swal.noop); 1254 }, 1255 /* 1256 * ############################################################### 1257 * Adjans Rabbit CMS System 1258 * Ajax Handler 1259 * ############################################################### 1260 */ 1261 SetAjax: function(url, method, data, callback, globalMi=true){ 1262 app.special_functions.fn_ConsoleLog('app=>systems=>SetAjax('+globalMi+')', 'start'); 1263 1264 return new Promise(function(resolve, reject) { 1265 $.ajax({
1266 type : method, 1267 global : globalMi, 1268 url : url, 1269 data : data, 1270 success : function(result) { 1271 return resolve(result); 1272 }, 1273 error: function(e) { 1274 reject(e); 1275 app.systems.alert('error', 'İÅlem BaÅarısız', 'Bir Hata OluÅtu<br />'+e+'', null, null, noCallback, {confirm:false, cancel:true}); 1276 } 1277 }); 1278 }); 1279 }, 1280 /* 1281 * ############################################################### 1282 * Adjans Rabbit CMS System 1283 * OWL Slide Crousel (Standart Include) 1284 * ############################################################### 1285 */ 1286 slider: function(SliderType) { 1287 app.special_functions.fn_ConsoleLog('app=>systems=>slider', 'start'); 1288 1289 switch (SliderType) { 1290 case 'hbslider': 1291 if (document.querySelector('#hbslider')) { 1292 $("#hbslider").swipe({ 1293 swipe: function(event, direction, distance, duration, fingerCount, fingerData) { 1294 if (direction == 'left') $(this).carousel('next'); 1295 if (direction == 'right') $(this).carousel('prev'); 1296 }, 1297 allowPageScroll: "vertical" 1298 }); 1299 }; 1300 case 'owl': 1301 if (document.querySelector('#slider')) { 1302 if(typeof($.fn.owlCarousel)=="undefined"){ 1303 app.special_functions.fn_ConsoleLog('app=>systems=>slider=> owlCarousel kütüphanesi Yüklü DeÄil', 'error'); 1304 return false; 1305 } 1306 $(".owl-carousel").owlCarousel(app.settings.OWLSliderSettings); 1307 } 1308 break; 1309 case 'slick': 1310 if(document.querySelector('.slider-for')){ 1311 $('.slider-for').slick({ 1312 slidesToShow: 1, 1313 slidesToScroll: 1, 1314 arrows: false, 1315 fade: true, 1316 asNavFor: '.slider-nav' 1317 }); 1318 $('.slider-nav').slick({ 1319 slidesToShow: 3, 1320 slidesToScroll: 1, 1321 asNavFor: '.slider-for', 1322 dots: true, 1323 centerMode: true, 1324 focusOnSelect: true 1325 }); 1326 } 1327 1328 break; 1329 default: 1330 } 1331 }, 1332 /* 1333 * ############################################################### 1334 * Adjans Rabbit CMS System 1335 * PopUp Sistem 1336 * http://vodkabears.github.io/remodal/ 1337 * ############################################################### 1338 */ 1339 PopUp: function() { 1340 app.special_functions.fn_ConsoleLog('app=>systems=>PopUp', 'start'); 1341 1342 if (document.querySelector('#remodal-bg')) { 1343 if (typeof($.fn.remodal) == undefined) { 1344 app.special_functions.fn_ConsoleLog('app=>systems=>PopUp=> popup kütüphanesi Yüklü DeÄil', 'error'); 1345 return false; 1346 }; 1347 1348 let PopUpModal = $('[data-remodal-id="modal"]').remodal({ 1349 hashTracking: false, 1350 closeOnConfirm: false, 1351 closeOnCancel: true, 1352 closeOnEscape: true, 1353 closeOnOutsideClick: false 1354 }); 1355 if (Cookies.get('service_popup') == undefined) { 1356 PopUpModal.open(); 1357 app.special_functions.fn_ConsoleLog('app=>systems=>PopUp', 'success'); 1358 Cookies.set('service_popup', 'seen', { expires: parseInt(lng_DEF_POPUPTIME) }); 1359 }; 1360 }; 1361 }, 1362 /* 1363 * ############################################################### 1364 * Adjans Rabbit CMS System 1365 * Page Loader Effect 1366 * ############################################################### 1367 */ 1368 PageLoader: function() { 1369 // if (app.settings.PageLoaderStatus == 1) { 1370 // app.special_functions.fn_ConsoleLog('app=>systems=>PageLoader', 'start'); 1371 1372 // }; 1373 }, 1374 /* 1375 * ###############################################################
1376 * Adjans Rabbit CMS System 1377 * Template Açıklama 1378 * 1379 * ############################################################### 1380 */ 1381 PageLoaderHide: function() { 1382 if (document.querySelector('#loader-wrapper')) { 1383 app.special_functions.fn_ConsoleLog('app=>systems=>PageLoaderHide', 'start'); 1384 1385 setTimeout(function() { 1386 $($body).addClass('loaded'); 1387 1388 setTimeout(function() { 1389 $('#loader-wrapper, #loaderstyle').remove(); 1390 }, 1500); 1391 }, 200); 1392 }; 1393 }, 1394 /* 1395 * ############################################################### 1396 * Adjans Rabbit CMS System 1397 * Template Açıklama 1398 * ############################################################### 1399 */ 1400 template: function() { 1401 app.special_functions.fn_ConsoleLog('app=>systems=>template', 'start'); 1402 } 1403 }, 1404 /* 1405 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 1406 * Adjans Rabbit CMS System 1407 * Template Açıklama 1408 * 1409 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 1410 */ 1411 ecommerce: { 1412 /* 1413 * ############################################################### 1414 * Adjans Rabbit CMS System 1415 * Sepet Yüklenince 1416 * ############################################################### 1417 */ 1418 init: function() { 1419 app.special_functions.fn_ConsoleLog('app=>ecommerce=>init', 'start'); 1420 app.ecommerce.cartBind(); 1421 app.ecommerce.FilterNavActivate(); 1422 app.ecommerce.hoverCollapse(); 1423 app.ecommerce.userLeftMenu(); 1424 app.ecommerce.catFilterAndJoin(); 1425 app.ecommerce.dropDownCart(); 1426 app.ecommerce.toggleNotes(); 1427 app.ecommerce.removeTo(); 1428 app.ecommerce.cartMinusPlus(); 1429 1430 function spinnerMax(){ 1431 return $('[name="quantity"]').attr('data-max'); 1432 } 1433 1434 if( $('.cmsSpinner')[0] ){ 1435 $('.cmsSpinner').spinner('changed', function(e, newVal, oldVal) { 1436 let $max = spinnerMax(); 1437 if(newVal>$max){ 1438 $(this).val($max); 1439 }; 1440 if(newVal<0){ 1441 $(this).val(0); 1442 } 1443 }); 1444 }; 1445 1446 function _addressAutoSelect(){ 1447 function redirect(){ 1448 let InvoiceId = $('option:selected', $('#sel_invoice') ).val(); 1449 let ShippingId= $('option:selected', $('#sel_shipping') ).val(); 1450 location.href=`/tr/payment/?InvoiceID=${InvoiceId}&ShippingID=${ShippingId}`; 1451 } 1452 $(document).off('change', '#sel_invoice, #sel_shipping'); 1453 $(document).on('change', '#sel_invoice, #sel_shipping', function(event) { 1454 event.preventDefault(); 1455 $("#address_cards").LoadingOverlay("show"); 1456 redirect(); 1457 }); 1458 1459 if ( parseInt($('option:selected', $('#sel_invoice')).val()) > 0) { 1460 console.log('Fatura Trigged') 1461 setTimeout(function() { 1462 $('#sel_invoice').trigger('AdresGuncelle'); 1463 }, 500); 1464 }; 1465 if ( parseInt($('option:selected', $('#sel_shipping')).val()) > 0) { 1466 console.log('Sevkiyat Trigged') 1467 setTimeout(function() { 1468 $('#sel_shipping').trigger('AdresGuncelle'); 1469 }, 750); 1470 }; 1471 }; 1472 _addressAutoSelect(); 1473 1474 if( $('#VariationsContainer')[0] ){ 1475 function inStockControl(stokAdet) { 1476 if (stokAdet > 0) { 1477 $('#StokWarning') 1478 .removeClass('alert-danger alert-success') 1479 .addClass('alert-success') 1480 .html(RabbitCMSLang('stokta_var_txt')) 1481 .show(); 1482 } else { 1483 $('#StokWarning') 1484 .removeClass('alert-danger alert-success') 1485 .addClass('alert-danger') 1486 .html(RabbitCMSLang('stokta_yok_txt')) 1487 .show(); 1488 } 1489 }; 1490 1491 $('#VariationsContainer > div:nth-child(1)').on('click', '.product__selector', function(event) { 1492 event.preventDefault(); 1493 let $clickedLi = $(this); 1494 let $activeClass = $clickedLi.closest('ul').data('activeclass'); 1495 let $secim = $clickedLi.children('input[type="radio"]'); 1496 $secim.prop('checked', true).trigger('change'); 1497 let $secimVal = $secim.val(); 1498 let VARYASYON_ID = $secim.attr("value"); 1499 let URUN_ID = $secim.attr("data-urun-id"); 1500 let $stok_adedi = $clickedLi.data('stok'); 1501 1502 $clickedLi.closest('ul').find('li').removeClass($activeClass); 1503 $clickedLi.addClass($activeClass); 1504 1505 $.ajax({
1506 url: "/content/class/inc.core.asp?Cmd=PROD:AltVaryasyon", 1507 type: "POST", 1508 cache: false, 1509 data: { 1510 VARYASYON_ID: VARYASYON_ID, 1511 URUN_ID: URUN_ID 1512 }, 1513 success: function(data) { 1514 if (data == "ERROR") { 1515 Swal.fire({ 1516 title: 'Bir Hata OluÅtu', 1517 html: 'Bilinmeyen Bir Hata OluÅtu', 1518 type: "error", 1519 timer: 2000, 1520 showConfirmButton: false 1521 }); 1522 } else { 1523 if ($('#VariationsContainer > div:nth-child(2)')[0]) { 1524 $('#VariationsContainer > div:nth-child(2)').remove(); 1525 }; 1526 $(data).appendTo('#VariationsContainer'); 1527 app.popover(); 1528 1529 if ($("#VariationsContainer > div:nth-child(2) .product__selector").length > 0) { 1530 $("#VariationsContainer > div:nth-child(2) .product__selector")[0].click(); 1531 } else { 1532 inStockControl($stok_adedi); 1533 } 1534 } 1535 }, 1536 error: function(e) { 1537 Swal.fire({ 1538 title: 'Bir Hata OluÅtu', 1539 html: 'Bilinmeyen Bir Hata OluÅtu', 1540 type: "error", 1541 timer: 2000,
1542 showConfirmButton: false 1543 }); 1544 } 1545 }); 1546 }); 1547 1548 // $('#VariationsContainer > div:nth-child(2)').on('click', '.product__selector', function(event) { 1549 $($body).on('click', '#VariationsContainer div:nth-child(2) .product__selector', function(event) { 1550 event.preventDefault(); 1551 let $clickedLi = $(this); 1552 let $activeClass = $clickedLi.closest('ul').data('activeclass'); 1553 let $secim = $clickedLi.children('input[type="radio"]'); 1554 $secim.prop('checked', true).trigger('change'); 1555 let $stok_adedi = $clickedLi.data('stok'); 1556 1557 $clickedLi.closest('ul').find('li').removeClass($activeClass); 1558 $clickedLi.addClass($activeClass); 1559 1560 inStockControl($stok_adedi); 1561 }); 1562 1563 if ($("#VariationsContainer > div:nth-child(1) .product__selector").length > 0) { 1564 $("#VariationsContainer > div:nth-child(1) .product__selector")[0].click(); 1565 }; 1566 } 1567 }, 1568 /* 1569 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 1570 * Adjans Rabbit CMS System 1571 * Template Açıklama 1572 * 1573 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 1574 */ 1575 toggleNotes: function(){ 1576 $($body).on('click', '.toggle-note', function(event) { 1577 event.preventDefault(); 1578 let $elem = $(this); 1579 $elem.next().toggle('fast'); 1580 }); 1581 }, 1582 /* 1583 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 1584 * Adjans Rabbit CMS System 1585 * Template Açıklama 1586 * 1587 * #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# 1588 */ 1589 dropDownCart: function() { 1590 $($body).on('click', '#SepetDropDown', function(event) { 1591 event.preventDefault(); 1592 1593 if ($('#CartContainer').hasClass('show')) { 1594 SepetDropdownFunction(); 1595 } 1596 }); 1597 1598 /* 1599 Sepet DropDown Bind 1600 */ 1601 $($body).on('click', '#SepetDropDownRefresh', function(event) { 1602 event.preventDefault(); 1603 SepetDropdownFunction(); 1604 }); 1605 /* 1606 Sepet Dropdown Listing WS 1607 */ 1608 function SepetDropdownFunction() { 1609 let $source = $('#SepetDokumu'); 1610 let $data = {}; 1611 let TotalPrice = 0; 1612 1613 //$('#SepetDokumu li').not(':last').remove(); 1614 $('#CartTotals').addClass('hide'); 1615 $("#CartContainer").LoadingOverlay("show"); 1616 $('#SepetDokumu li').remove(); 1617 let CartTotals = 0; 1618 setTimeout(function() { 1619 app.systems.SetAjax("/ws/?Cmd=user.cart", "GET", $data, null, false) 1620 .then(function(v) { 1621 if (v.status == 200) { 1622 /* LOOP */ 1623 $(v.RESULTS).each(function(index, el) { 1624 let l = '' + 1625 '<li class="item">' + 1626 ' <a href="'+ el.URUN_LINK +'" title="'+ el.URUN_ADI +'" class="product-image">' + 1627 ' <img src="'+ el.FOTOGRAF +'" alt="'+ el.URUN_ADI +'">' + 1628 ' </a>' + 1629 ' <div class="product-details">' + 1630 ' <p class="product-name mb-0">' + 1631 ' <a href="'+ el.URUN_LINK +'">'+ el.URUN_ADI +'<br><small>'+ el.OZELLIK +'</small></a>' + 1632 ' </p>' + 1633 ' <p class="qty-price mb-0">' + 1634 ' '+ el.ADET + ' X <span class="price">'+ el.FIYAT +'</span>' + 1635 // ' <div>'+ el.TOPLAM_FIYAT +'</div>' + 1636 ' </p>' + 1637 ' <a href="#" class="btn-remove" data-cmd="DeleteFromCart" data-productId="'+ el.ID +'" data-id="' + el.SEPET_ID + '"><i class="fas fa-times"></i></a>' +
1638 ' </div>' + 1639 '</li>'; 1640 CartTotals++; 1641 $source.prepend(l); 1642 TotalPrice += parseFloat(el.TOPLAM_FIYAT.replace('<price>','').replace('</price>','').replace(',', '.')); 1643 }); 1644 /* LOOP */ 1645 1646 // setTimeout(function() { 1647 // app.ecommerce.removeTo(); 1648 // }, 300); 1649 1650 } else if (v.status == 201) { 1651 $source.prepend('<li class="item text-center">Sepetiniz BoÅ</li>'); 1652 } else { 1653 app.systems.alert('error', 'İÅlem BaÅarısız', v.messages, null, null); 1654 } 1655 1656 }) 1657 .catch(function(v) { 1658 1659 }) 1660 .finally(function(v) { 1661 if (CartTotals > 0) { 1662 $('#CartTotals').removeClass('hide'); 1663 $('#TotalPrice').html('<price>' + TotalPrice.toFixed(2) + '</price>'); 1664 app.special_functions.priceBeautifier(); 1665 } 1666 $("#CartContainer").LoadingOverlay("hide"); 1667 app.special_functions.priceBeautifier(); 1668 }); 1669 }, 250); 1670 } 1671 1672 }, 1673 /* 1674 * ############################################################### 1675 * Adjans Rabbit CMS System 1676 * Sepet Yüklenince 1677 * ############################################################### 1678 */ 1679 catFilterAndJoin: function() { 1680 if ($('input[data-select]')[0]) { 1681 $("body").on('change', '[data-select]', function(event) { 1682 let Total = []; 1683 let TheKey = $(this).data('select'); 1684 1685 let count = $('[data-select="' + TheKey + '"]:checked').length; 1686 if (count == 0) $('#' + TheKey).val(''); 1687 $('[data-select="' + TheKey + '"]:checked').each(function(index, el) { 1688 Total.push($(this).val()); 1689 if (index + 1 === count) $('#' + TheKey).val(Total.join(',')); 1690 }); 1691 }); 1692 } 1693 }, 1694 /* 1695 * ############################################################### 1696 * Adjans Rabbit CMS System 1697 * Sepet Yüklenince 1698 * ############################################################### 1699 */ 1700 userLeftMenu: function() { 1701 /* User Navbar Mobile Convert*/ 1702 if ($('#UserNavBarMain').length && $('#UserNavBar').length && $(window).width()<mobile_breakpoint) { 1703 $("#UserNavBarMain a").each(function() { 1704 var el = $(this); 1705 $("<option />", { 1706 "value": el.attr("href"), 1707 "text": el.text() 1708 }).appendTo("#UserNavBar"); 1709 1710 $(document).on("change", "#UserNavBar", function(event) { 1711 window.location = $(this).find("option:selected").val(); 1712 }); 1713 }); 1714 } 1715 }, 1716 /* 1717 * ############################################################### 1718 * Adjans Rabbit CMS System 1719 * Sepet Yüklenince 1720 * ############################################################### 1721 */ 1722 fnAdresEkleme: function() { 1723 app.special_functions.fn_ConsoleLog('app=>ecommerce=>init', 'start'); 1724 1725 app.ecommerce.TaxOrIdentityChecker(0); 1726 1727 $("#KURUMSAL").unbind('change'); 1728 $("#KURUMSAL").change(function(event) { 1729 if ($('option:selected', $("#KURUMSAL")).val() == "1") { 1730 app.ecommerce.TaxOrIdentityChecker(1); 1731 } else { 1732 app.ecommerce.TaxOrIdentityChecker(0);
1733 }; 1734 }); 1735 1736 $("#reg_fatcheck").unbind('change'); 1737 $("#reg_fatcheck").change(function(event) { 1738 if ($(this).is(':checked') == true) { 1739 $('.vergi').show('fast'); 1740 } else { 1741 $('.vergi').hide('fast'); 1742 } 1743 }); 1744 1745 $("#AdresKaydet").unbind('click'); 1746 $("#AdresKaydet").click(function(event) { 1747 event.preventDefault(); 1748 1749 var Adi = $('#FRM_ADRES_ADI'); 1750 var Adres = $('#ACIKADRES'); 1751 var kurumsal = $('option:selected', $("#KURUMSAL")).val(); 1752 var unvan = $('#reg_UNVAN'); 1753 var tel1 = $('#reg_TELEFON1'); 1754 var tel2 = $('#reg_TELEFON2'); 1755 var vergi_dairesi = $('#reg_VERGI_DAIRESI'); 1756 var vergi_no = $('#reg_TC_VERGI'); 1757 1758 Adi.removeClass('is-invalid');Adres.removeClass('is-invalid'); 1759 1760 var IlSecim = $("option:selected", $("#ADR_IL")).val(); 1761 var IlceSecim = $("option:selected", $("#ADR_ILCE")).val(); 1762 1763 if (Adi.val().length < 2) { 1764 Swal.fire(RabbitCMSLang('hata_olustu'), RabbitCMSLang('adrFrm_warn1'), 'error'); 1765 Adi.addClass('is-invalid'); return false; 1766 }; 1767 if (Adres.val().length < 10) { 1768 Swal.fire(RabbitCMSLang('hata_olustu'), RabbitCMSLang('adrFrm_warn2'), 'error'); 1769 Adres.addClass('is-invalid');return false; 1770 }; 1771 if (IlSecim == "0") { 1772 Swal.fire(RabbitCMSLang('hata_olustu'), RabbitCMSLang('adrFrm_warn3'), 'error'); 1773 $("#ADR_IL").addClass('is-invalid'); return false; 1774 }; 1775 if (IlceSecim == undefined || IlceSecim == "0") { 1776 Swal.fire(RabbitCMSLang('hata_olustu'), RabbitCMSLang('adrFrm_warn4'), 'error'); 1777 $("#ADR_ILCE").addClass('is-invalid'); return false; 1778 }; 1779 1780 if(tel1.val().length > 2 && tel1.val().length != 14){ 1781 if( !validatePhone( tel1.val() ) ){ 1782 Swal.fire(RabbitCMSLang('hata_olustu'), RabbitCMSLang('adrFrm_warn5'),'error'); 1783 return false; 1784 }; 1785 }; 1786 1787 $.ajax({
1788 url: "/content/class/inc.core.asp?ClassCmd=AdresEkle&SelectLastOne=True", 1789 type: "POST", 1790 data: { 1791 return: encodeURIComponent($('#AdresFormuReturn').val()), 1792 ADRES_ADI: Adi.val(), 1793 ADRES: Adres.val(), 1794 ADR_IL: IlSecim, 1795 ADR_ILCE: IlceSecim, 1796 TELEFON1: tel1.val(), 1797 TELEFON2: tel2.val(), 1798 VERGI_DAIRESI: vergi_dairesi.val(), 1799 TC_VERGI: vergi_no.val(), 1800 sevk: $("[name='sevk']:checked").val(), 1801 fatura: $("[name='fatura']:checked").val(), 1802 unvan: $("#reg_UNVAN").val(), 1803 kurumsal: kurumsal 1804 }, 1805 success: function(data) { 1806 if (data == "DONE") { 1807 Swal.fire( RabbitCMSLang('islem_basarili'), RabbitCMSLang('islem_basarili'), 'success'); 1808 $('#cmsModal').modal('hide'); 1809 window.location.reload(); 1810 }else if(data=="DONE-SELECTLAST"){ 1811 Swal.fire('Eklendi','Adresiniz eklendi.','success'); 1812 window.location.reload(true); 1813 // if (window.location.href.indexOf("?") > -1) { 1814 // location.href = window.location.href + '&SelectLastAddress=True'; 1815 // }else{ 1816 // location.href = window.location.href + '?SelectLastAddress=True'; 1817 // } 1818 } else { 1819 alert('İÅleminiz Yapılamadı !') 1820 } 1821 }, 1822 error: function(e) { 1823 alert('İÅleminiz Yapılamadı !') 1824 } 1825 }); 1826 }); 1827 }, 1828 TaxOrIdentityChecker: function(bindType = 0) { 1829 console.log('bindType', bindType); 1830 if (bindType == 0) { 1831 $('#TC_VERGI_LABEL').html($('#TC_VERGI_LABEL').attr('data-bireysel')); 1832 } else { 1833 $('#TC_VERGI_LABEL').html($('#TC_VERGI_LABEL').attr('data-kurumsal')); 1834 }; 1835 1836 $($body).on('keyup', '#TC_VERGI', function(event) { 1837 let $input = $(this); 1838 let $value = $input.val(); 1839 1840 $input.removeClass('is-valid is-invalid'); 1841 1842 let Limit = bindType==0 ? 11:10; 1843 if(bindType==2){Limit=11} 1844 1845 if ( $value.length > Limit) { 1846 $input.val( $value.substr(0, Limit) ); 1847 }; 1848 1849 let Sonuc = bindType==0 ? TCKimlikDogrulama( $value ) : VergiKimlikDogrulama( $value ); 1850 if(bindType==2){ 1851 if(TCKimlikDogrulama( $value )==false && VergiKimlikDogrulama( $value )==false){ 1852 Sonuc=false 1853 }else{ 1854 Sonuc=true 1855 } 1856 } 1857 if (Sonuc==true) { 1858 $input.addClass('is-valid'); 1859 } else { 1860 $input.addClass('is-invalid'); 1861 }; 1862 }); 1863 }, 1864 /* 1865 * ############################################################### 1866 * Adjans Rabbit CMS System 1867 * Sepet Yüklenince 1868 * ############################################################### 1869 */ 1870 hoverCollapse: function(){ 1871 $($body).on('click', '.cms-tree a span', function(event) { 1872 event.preventDefault(); 1873 1874 let $elem = $(this); 1875 let $target = $elem.closest('a').next(); 1876 if(!$target.hasClass('collapse')){ 1877 return false; 1878 }; 1879 1880 if( $target.hasClass('show') ){ 1881 $elem.removeClass('opened'); 1882 $target.collapse('hide'); 1883 }else{ 1884 $elem.addClass('opened'); 1885 $target.collapse('show'); 1886 }; 1887 }); 1888 1889 if( $(".cms-tree li.showUps")[0] ){ 1890 $(".cms-tree li.showUps").parentsUntil(".cms-tree ul:not(.collapse)").each(function(index, el) { 1891 let $elem = $(el).closest('ul'); 1892 if($elem.hasClass('collapse')){ 1893 $elem.collapse('show'); 1894 $elem.addClass('cms-tree-active'); 1895 } 1896 }); 1897 } 1898 }, 1899 /* 1900 * ###############################################################
1901 * Adjans Rabbit CMS System 1902 * Sepet Yüklenince 1903 * ############################################################### 1904 */ 1905 FilterNavActivate: function() { 1906 if ($('#FilterNav').length) { 1907 let ActiveHref = Warning.getUrlVars()["SortBy"]; 1908 console.log(ActiveHref) 1909 if(ActiveHref!=undefined) $('#FilterNav a[href*="SortBy=' + ActiveHref + '"]').addClass('btn-primary'); 1910 } 1911 }, 1912 /* 1913 * ############################################################### 1914 * Adjans Rabbit CMS System 1915 * Sepet Yüklenince 1916 * ############################################################### 1917 */ 1918 RemoveCouponCode: function() { 1919 if ($('#RemoveCouponCode').length) { 1920 $('#RemoveCouponCode').unbind('click'); 1921 $('#RemoveCouponCode').click(function(event) { 1922 event.preventDefault(); 1923 1924 Swal.fire({ 1925 title: RabbitCMSLang('islemi_onayla'), 1926 html: RabbitCMSLang('coupon_remove'), 1927 icon: "info", 1928 showConfirmButton: true, 1929 showCancelButton: true, 1930 allowOutsideClick: false, 1931 allowEscapeKey: false, 1932 confirmButtonClass: 'btn btn-success', 1933 confirmButtonText: RabbitCMSLang('tamam'), 1934 cancelButtonText: RabbitCMSLang('vazgec') 1935 }).then(function(result) { 1936 if (result.value) { 1937 $.ajax({
1938 url: "/content/class/inc.core.asp?ClassCmd=AJAX:RemoveCouponCode&nocache=" + Math.random(), 1939 type: "GET", 1940 success: function(data) { 1941 if (data.status == 200) { 1942 if (document.querySelector('#SepetDokum')) { 1943 app.ecommerce.updateCart(); 1944 }; 1945 1946 app.systems.alert('success', RabbitCMSLang('islem_basarili'), data.messages, null, noTime, noCallback, { confirm: true, cancel: false }); 1947 } else { 1948 app.systems.alert('error', RabbitCMSLang('hata_olustu'), data.messages, null, 5000, noCallback, { confirm: true, cancel: false }); 1949 } 1950 }, 1951 error: function(e) { 1952 app.systems.alert('error', RabbitCMSLang('hata_olustu'), RabbitCMSLang('islem_yapilamadi'), null, 1000, noCallback, { confirm: false, cancel: false }); 1953 } 1954 }); 1955 } 1956 }); 1957 1958 }); 1959 } 1960 }, 1961 /* 1962 * ############################################################### 1963 * Adjans Rabbit CMS System 1964 * Sepet Yüklenince 1965 * ############################################################### 1966 */ 1967 MoneyPoints: function(){ 1968 if ($('#ParaPuanCevir').length) { 1969 $('#ParaPuanCevir').prop('disabled', true); 1970 1971 $('[cms-selectall], .selectall').bind('click', function() { 1972 let TotalChecked = $('.selectall:checked').length; 1973 let TotalSelectedMoney = 0.00; 1974 $('#TotalSelectedMoney').val('0').trigger('mask'); 1975 $('#ParaPuanCevir').prop('disabled', true); 1976 1977 $('.selectall:checked').each(function(index, el) { 1978 let money = parseInt($(this).attr('data-money').replace(',', '.')); 1979 TotalSelectedMoney += money; 1980 if (index + 1 === TotalChecked) { 1981 $('#TotalSelectedMoney').val(TotalSelectedMoney.toFixed(2)).trigger('mask'); 1982 if (TotalSelectedMoney > 0) { 1983 $('#ParaPuanCevir').prop('disabled', false); 1984 } 1985 } 1986 }); 1987 }); 1988 1989 $('#ParaPuanCevir').click(function(event) { 1990 event.preventDefault(); 1991 let $ConvertBtn = $(this); 1992 $ConvertBtn.prop('disabled', true); 1993 1994 $.ajax({
1995 type: "POST", 1996 url: '/content/class/inc.core.asp?Cmd=ConvertMoneyPoint', 1997 data: $('#ConvertableOrders').serializeArray(), 1998 success: function(data) { 1999 if (data.status == 200) { 2000 let $refreshCb = function() { 2001 location.reload(); 2002 }; 2003 2004 app.systems.alert('success', RabbitCMSLang('islem_basarili'), RabbitCMSLang('moneypoint_converted'), null, 3000, $refreshCb, { confirm: true, cancel: false }); 2005 } else { 2006 app.systems.alert('error', RabbitCMSLang('hata_olustu'), data.messages, null, 2000, noCallback, { confirm: false, cancel: false }); 2007 } 2008 $ConvertBtn.prop('disabled', false); 2009 }, 2010 error: function(e) { 2011 app.systems.alert('error', RabbitCMSLang('hata_olustu'), RabbitCMSLang('islem_yapilamadi'), null, 2000, noCallback, { confirm: false, cancel: false }); 2012 $ConvertBtn.prop('disabled', false); 2013 } 2014 }); 2015 }); 2016 } 2017 2018 if ($('[data-addcoupon]').length) { 2019 $('[data-addcoupon]').click(function(event) { 2020 event.preventDefault(); 2021 let Kupon = $(this).attr('data-addcoupon'); 2022 2023 $.ajax({
2024 url: "/content/class/inc.core.asp?ClassCmd=AJAX:UseCouponCode&nocache=" + Math.random(), 2025 type: "POST", 2026 data: { 2027 'KUPON': Kupon 2028 }, 2029 success: function(data) { 2030 if (data.status == 200) { 2031 app.systems.alert('success', RabbitCMSLang('islem_basarili'), data.messages, null, noTime, noCallback, { confirm: true, cancel: false }); 2032 } else { 2033 app.systems.alert('error', RabbitCMSLang('hata_olustu'), data.messages, null, 5000, noCallback, { confirm: true, cancel: false }); 2034 } 2035 }, 2036 error: function(e) { 2037 app.systems.alert('error', RabbitCMSLang('hata_olustu'), RabbitCMSLang('islem_yapilamadi'), null, 1000, noCallback, { confirm: false, cancel: false }); 2038 } 2039 }); 2040 }); 2041 } 2042 }, 2043 /* 2044 * ############################################################### 2045 * Adjans Rabbit CMS System 2046 * Sepet Yüklenince 2047 * ############################################################### 2048 */ 2049 UseCouponCode: function() { 2050 if ($('#UseCouponCode').length) { 2051 $('#UseCouponCode').unbind('click'); 2052 $('#UseCouponCode').click(function(event) { 2053 event.preventDefault(); 2054 let KuponKodu = $('#CouponCodeInput').val(); 2055 2056 if(KuponKodu.length<2){ 2057 app.systems.alert('error', RabbitCMSLang('hata_olustu'), RabbitCMSLang('short_coupon_code'), null, 5000, noCallback, { confirm: true, cancel: false }); 2058 return false; 2059 }; 2060 2061 $.ajax({
2062 url: "/content/class/inc.core.asp?ClassCmd=AJAX:UseCouponCode&nocache=" + Math.random(), 2063 type: "POST", 2064 data: { 2065 'KUPON': KuponKodu 2066 }, 2067 success: function(data) { 2068 if (data.status == 200) { 2069 if (document.querySelector('#SepetDokum')) { 2070 app.ecommerce.updateCart(); 2071 }; 2072 2073 app.systems.alert('success', RabbitCMSLang('islem_basarili'), data.messages, null, noTime, noCallback, { confirm: true, cancel: false }); 2074 } else { 2075 app.systems.alert('error', RabbitCMSLang('hata_olustu'), data.messages, null, 5000, noCallback, { confirm: true, cancel: false }); 2076 } 2077 }, 2078 error: function(e) { 2079 app.systems.alert('error', RabbitCMSLang('hata_olustu'), RabbitCMSLang('islem_yapilamadi'), null, 1000, noCallback, { confirm: false, cancel: false }); 2080 } 2081 }); 2082 }); 2083 } 2084 }, 2085 2086 /* 2087 * ############################################################### 2088 * Adjans Rabbit CMS System 2089 * Sepet Yüklenince 2090 * ############################################################### 2091 */ 2092 couponToggle: function(){ 2093 if( $('#coupon_toggle').length ){ 2094 $('#coupon_toggle').unbind('click'); 2095 $('#coupon_toggle').click(function(event) { 2096 $('div.cart-coupon-content').toggle('fast'); 2097 }); 2098 } 2099 }, 2100 couponInit: function(){
2101 app.ecommerce.couponToggle(); 2102 app.ecommerce.UseCouponCode(); 2103 app.ecommerce.RemoveCouponCode(); 2104 app.ecommerce.MoneyPoints(); 2105 }, 2106 /* 2107 * ############################################################### 2108 * Adjans Rabbit CMS System 2109 * Asenkron Bindirmeler 2110 * ############################################################### 2111 */ 2112 cartBind: function() { 2113 app.special_functions.fn_ConsoleLog('app=>ecommerce=>cartBind', 'start'); 2114 2115 app.ecommerce.addTo(); 2116 // app.ecommerce.removeTo(); 2117 // app.ecommerce.cartMinusPlus(); 2118 app.special_functions.priceBeautifier(); 2119 app.ecommerce.couponInit(); 2120 // app.ecommerce.GetAgreement(); 2121 // app.ecommerce.GetKargoTakip(); 2122 }, 2123 /* 2124 * ############################################################### 2125 * Adjans Rabbit CMS System 2126 * Sepetten Sil 2127 * ############################################################### 2128 */ 2129 removeTo: function() { 2130 app.special_functions.fn_ConsoleLog('app=>ecommerce=>cartBind=>removeTo() DeleteFromCart', 'start'); 2131 2132 $($body).on('click', '[data-cmd="DeleteFromCart"]', function(event) { 2133 event.preventDefault(); 2134 2135 let $btn = $(this); 2136 let SepetID = $(this).attr("data-id"); 2137 let productId = $(this).attr('data-productid'); 2138 2139 $btn.prop('disabled', true); 2140 app.systems.SetAjax("/sys/?Cmd=DELETE:DeleteFromCart", "POST", { SEPET_ID: SepetID }, null, true) 2141 .then(function(v) { 2142 if (v.status == 200) { 2143 $.toast({ 2144 title: RabbitCMSLang('islem_basarili'), 2145 // subtitle: '11 mins ago', 2146 content: RabbitCMSLang('sepetten_silindi'), 2147 type: 'success', 2148 delay: 5000 2149 }); 2150 2151 app.ecommerce.updateCart(); 2152 2153 $('[data-cmd="AddToCart"][data-id="' + productId + '"]').attr('data-incart', '0'); 2154 2155 if ( $('#cmsCartCounter')[0] ){ 2156 $("#cmsCartCounter").html(v.cartcount); 2157 }; 2158 2159 if ($('#SepetDropDown').parent('div.show')[0]) { 2160 CustomFunctions.SepetDropdownFunction(); 2161 setTimeout(function() { 2162 swal.Close(); 2163 $('#SepetDropDown').dropdown('toggle'); 2164 }, 300); 2165 }; 2166 2167 if ( $('form[data-cmd="OdemeIslemleri"]')[0]) { 2168 window.location.reload(); 2169 }; 2170 } else { 2171 app.systems.alert('error', 'İÅlem BaÅarısız', v); 2172 }; 2173 2174 $btn.prop('disabled', false); 2175 app.special_functions.fn_LazyLoadUpdate(); 2176 }) 2177 .catch(function(v) { 2178 app.special_functions.fn_ConsoleLog('app=>ecommerce=>removeTo() Error', 'error'); 2179 }); 2180 2181 }); 2182 }, 2183 /* 2184 * ############################################################### 2185 * Adjans Rabbit CMS System 2186 * Sepet Adetlerini Güncelle 2187 * ############################################################### 2188 */ 2189 cartMinusPlus: function() { 2190 app.special_functions.fn_ConsoleLog('app=>ecommerce=>cartBind=>quantity-button', 'start'); 2191 2192 $($body).on('change', '.qty-text', function(event) { 2193 event.preventDefault(); 2194 let newQty = $(this).val(); 2195 if (newQty.length == 0 || isNumeric(newQty) == false) { 2196 return false; 2197 } 2198 newQty = parseInt(newQty) 2199 if (newQty < 0) { newQty = 0; } 2200 2201 app.ecommerce.updateProduct($(this).data('prodid'), $(this).data('specid'), newQty); 2202 }); 2203
2204 $($body).on('focusout', '.CartNotes', function(event) { 2205 event.preventDefault(); 2206 let $elem = $(this); 2207 app.ecommerce.updateProductNote($elem.data('cartid'), $elem.val(), $elem); 2208 }); 2209 2210 $($body).on('click', '[data-cmd="quantity-plus"]', function(event) { 2211 event.preventDefault(); 2212 app.ecommerce.addProduct($(this).data('prodid'), $(this).data('specid')); 2213 }); 2214 2215 $($body).on('click', '[data-cmd="quantity-minus"]', function(event) { 2216 event.preventDefault(); 2217 app.ecommerce.removeProduct($(this).data('prodid'), $(this).data('specid')); 2218 }); 2219 }, 2220 /* 2221 * ############################################################### 2222 * Adjans Rabbit CMS System 2223 * Sepet Güncelleme 2224 * ############################################################### 2225 */ 2226 updateCart: function() { 2227 app.special_functions.fn_ConsoleLog('app=>ecommerce=>updateCart', 'start'); 2228 2229 $.ajax({
2230 type : "GET", 2231 global : false, 2232 url : "/content/class/inc.core.asp?ClassCmd=AJAX:ReloadCart&nocache="+Math.random()+"", 2233 data : {}, 2234 success : function(v) { 2235 if (v !== "ERROR") { 2236 if ( document.querySelector('#SepetDokum') ) {$("#SepetDokum").html(v);} 2237 app.ecommerce.cartBind(); 2238 } else { 2239 app.special_functions.fn_ConsoleLog('updateCart ÃalıÅtırılamıyor', 'error'); 2240 app.systems.alert('error', 'İÅlem BaÅarısız', v, null, null, noCallback, {confirm:true, cancel:false}); 2241 } 2242 }, 2243 error: function(e) { 2244 app.systems.alert('error', 'İÅlem BaÅarısız', 'Bir Hata OluÅtu<br />'+e+'', null, null, noCallback, {confirm:true, cancel:false}); 2245 } 2246 }); 2247 }, 2248 /* 2249 * ############################################################### 2250 * Adjans Rabbit CMS System 2251 * E-Commerce: Adres Kaydet 2252 * app.ecommerce.address_save(); 2253 * ############################################################### 2254 */ 2255 address_save: function() { 2256 if ($(".saveaddress").length) { 2257 app.special_functions.fn_ConsoleLog('app=>ecommerce=>address_save', 'start'); 2258 2259 $(".saveaddress").unbind('click'); 2260 $(".saveaddress").click(function(event) { 2261 event.preventDefault(); 2262 2263 var AdressID = $(this).attr("data-id"); 2264 var GidecekData = $("#GuncellemeFormu" + AdressID).serialize(); 2265 var GidecekDataARR = $("#GuncellemeFormu" + AdressID).serializeArray(); 2266 2267 app.systems.SetAjax("/content/class/inc.core.asp?Cmd=AdresGuncelle&ID="+AdressID+"&nocache="+Math.random()+"", "POST", GidecekData, null, true) 2268 .then(function(v) { 2269 if (cevap == 'DONE') { 2270 $("#adres_adi_" + AdressID + "").html(GidecekDataARR[0].value); 2271 $("#adres_" + AdressID + "").html(GidecekDataARR[1].value + ' ' + GidecekDataARR[2].value + ' ' + GidecekDataARR[3].value); 2272 2273 app.systems.alert('success', IslemBasariliLabel, RabbitCMSLang('adres_guncellendi') , null, 1000, noCallback, {confirm:false, cancel:false}); 2274 } else { 2275 app.systems.alert('success', IslemBasarisiz, IslemBasarisiz , null, 1000, noCallback, {confirm:false, cancel:false}); 2276 } 2277 }) 2278 .catch(function(v) { 2279 app.special_functions.fn_ConsoleLog('app=>ecommerce=>address_save Error', 'error'); 2280 app.systems.alert('error', 'İÅlem BaÅarısız', v.messages ); 2281 }); 2282 2283 }); 2284 } 2285 }, 2286 /* 2287 * ############################################################### 2288 * Adjans Rabbit CMS System 2289 * Sepete / Favorilere Ekleme 2290 * 2291 * ############################################################### 2292 */ 2293 addTo: function() { 2294 app.special_functions.fn_ConsoleLog('app=>ecommerce=>addTo', 'start'); 2295 2296 /* 2297 Add to Cart 2298 */ 2299 $($body).on('click', '[data-cmd="AddToCart"]', function(event) { 2300 let selector = $(this); 2301 let $prodId = selector.data("id"); 2302 let $sepete_ekle = $('[data-cmd="QuantityCart"]')[0] ? parseInt($('[data-cmd="QuantityCart"]').val()) : selector.data('quantity'); 2303 let $specId = this.hasAttribute("data-spec") ? selector.data("spec") : SeciliSpecID(); 2304 let $inCart = selector.data("incart") ? selector.data("incart") : 0; 2305 let $sepete_eklenecek=0; 2306 let $prodName = selector.data('product-name'); 2307 2308 if( $('option:selected', $('#CARPAN')).val() == 'palet' ){
2309 let Carpan = parseInt( $('#CARPAN option:eq(1)').attr('data-carpan') ); 2310 $sepete_eklenecek = $inCart + (Carpan*$sepete_ekle); 2311 }else{ 2312 $sepete_eklenecek = $inCart + $sepete_ekle; 2313 } 2314 2315 2316 if ($specId === false) { 2317 app.systems.alert('error', RabbitCMSLang('islem_yapilamadi'), 'Bilinmeyen bir hata oluÅtu. Tekrar bu mesaj ile karÅılaÅırsanız lütfen bize haber verin.', null, 3000, noCallback, { confirm: false, cancel: false }); 2318 return false; 2319 }; 2320 2321 let success_msg = RabbitCMSLang('sepete_eklendi').replace('{*ADD_COUNT*}', $sepete_ekle).replace('{*PRODUCT_NAME*}', $prodName).replace('{*INCART_COUNT*}', $sepete_eklenecek); 2322 2323 let PostData = { 2324 ID: $prodId, 2325 ADET:$sepete_eklenecek, 2326 OZELLIK_ID: $specId 2327 }; 2328 app.systems.SetAjax("/content/class/inc.core.asp?ClassCmd=AJAX:AddToBasket", "POST", PostData, null, true) 2329 .then(function(v) { 2330 if (v.status == 200) { 2331 selector.attr("data-incart", $sepete_eklenecek); 2332 2333 $.toast({ 2334 title: RabbitCMSLang('islem_basarili'), 2335 // subtitle: '11 mins ago', 2336 content: success_msg, 2337 type: 'success', 2338 delay: 5000 2339 }); 2340 2341 if ($('#SepetDokum')[0]) { 2342 app.ecommerce.updateCart(); 2343 }; 2344 2345 // if(selector.prev().hasClass('cms-hide')){ 2346 // selector.hide(); 2347 // selector.prev().removeClass('cms-hide'); 2348 // }; 2349 2350 if ($('#cmsCartCounter')[0]) { 2351 $('#cmsCartCounter').html(v.cartcount); 2352 }; 2353 2354 if (!typeof gtagInstalled == "undefined") { 2355 gtag('event', 'add_to_cart', { "items": [{ "id": $prodId, "quantity": $sepete_ekle }] }); 2356 }; 2357 } else { 2358 app.systems.alert('error', RabbitCMSLang('islem_yapilamadi'), v.messages); 2359 } 2360 }) 2361 .catch(function(v) { 2362 app.special_functions.fn_ConsoleLog('app=>ecommerce=>addTo catch error', 'error'); 2363 app.systems.alert('error', RabbitCMSLang('islem_yapilamadi'), v.messages); 2364 }) 2365 .finally(function(v) { 2366 2367 }); 2368 }); 2369 2370 /* 2371 Add to Favorite 2372 */ 2373 $($body).on('click', '[data-cmd="AddToFavorite"]', function(event) { 2374 let $selector = $(this); 2375 let $prodId = $selector.data("id"); 2376 let $prodName = $selector.data('product-name'); 2377 let add_msg = RabbitCMSLang('favori_eklendi').replace('{*PRODUCT_NAME*}', $prodName); 2378 let remove_msg = RabbitCMSLang('favori_cikartildi').replace('{*PRODUCT_NAME*}', $prodName); 2379 let PostData = { 2380 ID: $prodId, 2381 }; 2382 2383 app.systems.SetAjax("/content/class/inc.core.asp?ClassCmd=AJAX:AddToFavorite", "POST", PostData, null, true) 2384 .then(function(v) { 2385 if (v.status == "success") { 2386 $.toast({ 2387 title: RabbitCMSLang('islem_basarili'), 2388 // subtitle: '11 mins ago', 2389 content: add_msg, 2390 type: 'success', 2391 delay: 5000 2392 }); 2393 if(!$selector.find('i').hasClass('text-danger')){ 2394 $selector.find('i').removeClass('far').addClass('fas text-danger'); 2395 } 2396 if($selector.find('span')){ 2397 $selector.find('span').html(RabbitCMSLang('favori_cikart')) 2398 } 2399 } else if (v.status == "remove") { 2400 $.toast({ 2401 title: RabbitCMSLang('islem_basarili'),
2402 // subtitle: '11 mins ago', 2403 content: remove_msg, 2404 type: 'error', 2405 delay: 5000 2406 }); 2407 if($selector.find('i').hasClass('text-danger')){ 2408 $selector.find('i').removeClass('fas text-danger').addClass('far'); 2409 } 2410 if($selector.find('span')){ 2411 $selector.find('span').html(RabbitCMSLang('favori_ekle')) 2412 } 2413 } else if (v.status == "login_required") { 2414 app.systems.alert('info', RabbitCMSLang('giris_yapin'), RabbitCMSLang('giris_gerekli_txt'), null, null, null, { confirm: true, cancel: false }); 2415 }; 2416 }) 2417 .catch(function(v) { 2418 app.special_functions.fn_ConsoleLog('app=>ecommerce=>addTo catch error', 'error'); 2419 app.systems.alert('error', RabbitCMSLang('islem_yapilamadi'), v.messages); 2420 }) 2421 .finally(function(v) { 2422 2423 }); 2424 }); 2425 }, 2426 /* 2427 * ############################################################### 2428 * Adjans Rabbit CMS System 2429 * Template Açıklama 2430 * 2431 * ############################################################### 2432 */ 2433 updateProduct: function(productId, specId, newQty) { 2434 app.special_functions.fn_ConsoleLog('app=>ecommerce=>updateProduct', 'start'); 2435 app.ecommerce.SepetiGuncelle(productId, newQty, specId); 2436 }, 2437 /* 2438 * ############################################################### 2439 * Adjans Rabbit CMS System 2440 * Template Açıklama 2441 * 2442 * ############################################################### 2443 */ 2444 updateProductNote: function(cartID, cartNote, elem) { 2445 app.special_functions.fn_ConsoleLog('app=>ecommerce=>updateProductNote', 'start'); 2446 2447 if( elem.attr('data-defaultval') == cartNote){ 2448 2449 return false 2450 } 2451 2452 var $loadingContent = elem.closest('div.note'); 2453 $loadingContent.loading({ 2454 theme: 'light', 2455 message: RabbitCMSLang('yukleniyor'), 2456 start: true, 2457 onStart: function(loading) { 2458 loading.overlay.slideDown(100); 2459 }, 2460 onStop: function(loading) { 2461 loading.overlay.fadeOut(10); 2462 app.ecommerce.updateCart(); 2463 } 2464 }); 2465 2466 let PostData = { 2467 ID: cartID, 2468 URUN_NOTU: cartNote 2469 }; 2470 2471 app.systems.SetAjax("/content/class/inc.core.asp?ClassCmd=AJAX:UpdateCartNote&nocache=" + Math.random() + "", "POST", PostData, null, true) 2472 .then(function(v) { 2473 if (v.status == "success") { 2474 //app.systems.alert('success', RabbitCMSLang('islem_basarili'), v.message , null, 2000, noCallback, {confirm:false, cancel:false}); 2475 2476 elem.attr('data-defaultval', cartNote); 2477 2478 if( $loadingContent.is(':loading')==true){ 2479 setTimeout(function(){ 2480 $loadingContent.loading('toggle'); 2481 }, 400); 2482 }; 2483 2484 // app.ecommerce.updateCart(); 2485 //CustomApp._loading.hide( elem.parent('div') ); 2486 } 2487 }) 2488 .catch(function(v) { 2489 app.special_functions.fn_ConsoleLog('app=>ecommerce=>updateProductNote Error', 'error'); 2490 app.systems.alert('error', 'İÅlem BaÅarısız', v.message); 2491 }) 2492 .finally(function(v) { 2493 2494 }); 2495 }, 2496 /* 2497 * ###############################################################
2498 * Adjans Rabbit CMS System 2499 * Template Açıklama 2500 * 2501 * ############################################################### 2502 */ 2503 addProduct: function(productId, specId) { 2504 app.special_functions.fn_ConsoleLog('app=>ecommerce=>addProduct', 'start'); 2505 2506 let qty = parseInt( $('#qty_' + productId).val() ); 2507 qty++; 2508 app.ecommerce.SepetiGuncelle(productId, qty, specId); 2509 }, 2510 /* 2511 * ############################################################### 2512 * Adjans Rabbit CMS System 2513 * Template Açıklama 2514 * 2515 * ############################################################### 2516 */ 2517 removeProduct: function(productId, specId) { 2518 app.special_functions.fn_ConsoleLog('app=>ecommerce=>removeProduct', 'start'); 2519 2520 let qty = parseInt( $('#qty_' + productId).val() ); 2521 // if (qty == 1) { 2522 // confirmDelete("p", productId); 2523 // return; 2524 // } 2525 qty--; 2526 app.ecommerce.SepetiGuncelle(productId, qty, specId); 2527 2528 /* gtag */ 2529 if (!typeof gtagInstalled == "undefined") { 2530 gtag('event', 'remove_from_cart', { 2531 "items": [{ 2532 "id": productId 2533 }] 2534 }); 2535 }; 2536 }, 2537 /* 2538 * ############################################################### 2539 * Adjans Rabbit CMS System 2540 * Template Açıklama 2541 * 2542 * ############################################################### 2543 */ 2544 SepetiGuncelle: function(productId, qty, specId) { 2545 app.special_functions.fn_ConsoleLog('app=>ecommerce=>SepetiGuncelle', 'start'); 2546 2547 let PostData = { 2548 ID: productId, 2549 ADET: qty, 2550 OZELLIK_ID: specId 2551 }; 2552 app.systems.SetAjax("/content/class/inc.core.asp?ClassCmd=AJAX:AddToBasket", "POST", PostData, null, true) 2553 .then(function(v) { 2554 if (v.status == 200) { 2555 $.toast({ 2556 title: RabbitCMSLang('islem_basarili'), 2557 // subtitle: '11 mins ago', 2558 content: RabbitCMSLang('sepet_guncellendi'), 2559 type: 'success', 2560 delay: 5000 2561 }); 2562 2563 if ($('#SepetDokum')[0]) { 2564 app.ecommerce.updateCart(); 2565 }; 2566 2567 if ($('#cmsCartCounter')[0]) { 2568 $('#cmsCartCounter').html(v.cartcount); 2569 }; 2570 2571 if (!typeof gtagInstalled == "undefined") { 2572 gtag('event', 'add_to_cart', { "items": [{ "id": $prodId, "quantity": $sepete_ekle }] }); 2573 }; 2574 }else{ 2575 $.toast({ 2576 title: RabbitCMSLang('hata_olustu'), 2577 // subtitle: '11 mins ago', 2578 content: RabbitCMSLang('islem_yapilamadi'), 2579 type: 'error', 2580 delay: 5000 2581 }); 2582 } 2583 }) 2584 .catch(function(v) { 2585 app.special_functions.fn_ConsoleLog('app=>ecommerce=>SepetiGuncelle Error', 'error'); 2586 app.systems.alert('error', 'İÅlem BaÅarısız', v); 2587 }); 2588 } 2589 2590 } 2591 2592} 2593 2594window.addEventListener("DOMContentLoaded", function(event) { 2595 app.init(); 2596}); 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670/* 2671****************************************** 2672* Tam Yükleme Sonrası Yapılacaklar 2673****************************************** 2674*/ 2675$(window).on('load', function () { 2676 /* Adres Kaydetme Modal */ 2677 2678 /* Adres Ekleme Modal */ 2679 if( $(".addaddress").length ){ 2680 $(".addaddress").click(function(event) { 2681 event.preventDefault();
2682 var GidecekData = $("#GuncellemeFormu0").serialize(); 2683 var GidecekDataARR = $("#GuncellemeFormu0").serializeArray(); 2684 2685 $.ajax({ 2686 type: 'POST', 2687 url: 'inc.core.asp?Cmd=AdresEkle', 2688 data: GidecekData, 2689 success: function(cevap) { 2690 if(cevap=='DONE'){ 2691 Swal.fire(IslemBasariliLabel, IslemBasariliLabel, 'success'); 2692 document.getElementById("GuncellemeFormu0").reset(); 2693 window.location = window.location.origin + window.location.pathname + "?Msg=AdresEklendi#adreslerim"; 2694 }else{ 2695 Swal.fire({ 2696 title: IslemBasarisiz, 2697 icon: "error", 2698 html: IslemBasarisiz, 2699 timer: 1000, 2700 showConfirmButton: false, 2701 backdrop:'rgba(0,0,0,0.6)' 2702 }); 2703 } 2704 } 2705 }); 2706 2707 }); 2708 } 2709 /*Adres Silme Metod*/ 2710 if( $(".adresSil").length ){ 2711 $(".adresSil").click(function(event) { 2712 event.preventDefault(); 2713 var SilID = $(this).attr("data-id"); 2714 Swal.fire({ 2715 title: RabbitCMSLang('islemi_onayla'), 2716 html: RabbitCMSLang('adres_silinecek'), 2717 icon: 'warning', 2718 showCancelButton: true, 2719 confirmButtonColor: "#DD6B55", 2720 confirmButtonText: RabbitCMSLang('tamam'), 2721 cancelButtonText: RabbitCMSLang('vazgec'), 2722 backdrop:'rgba(0,0,0,0.6)' 2723 },function(isConfirm){ 2724 if (isConfirm) { 2725 $.get("inc.core.asp?Cmd=AdresSil&ID="+SilID, function( data ) { 2726 if(data=='DONE'){ 2727 $("#usr_add_line_"+SilID).remove(); 2728 Swal.fire(IslemBasariliLabel, RabbitCMSLang('adres_silindi'), 'success'); 2729 }else{ 2730 Swal.fire('Oops...', RabbitCMSLang('bilinmeyen_hata'), 'error'); 2731 } 2732 }); 2733 } else { 2734 // handle all other cases 2735 } 2736 }); 2737 2738 }); 2739 } 2740 2741}); 2742 2743/* 2744****************************************** 2745* Ãn Yükleme Sonrası Yapılacaklar 2746****************************************** 2747*/ 2748jQuery(document).ready(function($) { 2749 if ($('.inputBirthday, #DOGUM_TARIHI').length) { $('.inputBirthday, #DOGUM_TARIHI').mask("99.99.999"); } 2750 if ($('.inputPhone, #TELEFON').length) { $('.inputPhone, #TELEFON').mask("0999 999 99 99"); } 2751 if ($('.inputTCNo, #TCKNO').length) { $('.inputTCNo, #TCKNO').mask("99999999999"); } 2752 2753 /*Admin Pre Formatter*/ 2754 if ($('#pre').length) { 2755 if (Cookies.get('Rabbitpre') == "1") { 2756 $("#pre").prop('checked', true); 2757 $("pre").show('slow'); 2758 } else { 2759 $("#pre").prop('checked', false); 2760 $("pre").hide(); 2761 } 2762 $('#pre').click(function(event) { 2763 if ($('#pre').prop('checked')) { 2764 Cookies.set('Rabbitpre', "1", { expires: 30 }); 2765 $("#pre").prop('checked', true); 2766 $("pre").show('slow'); 2767 } else { 2768 Cookies.set('Rabbitpre', "0", { expires: 30 }); 2769 $("#pre").prop('checked', false); 2770 $("pre").hide(''); 2771 } 2772 }); 2773 } 2774}); 2775 2776 2777/* 2778 * ############################################################### 2779 * Adjans Rabbit CMS System 2780 * TC Kimlik Numarası DoÄrulama 2781 * Usage; return true or false 2782 * ############################################################### 2783*/ 2784function SepetSayisiArttir() { 2785 var SepetteKac = parseInt($("#sepetcount").html()) + 1; 2786 $("#sepetcount").html(SepetteKac); 2787}; 2788 2789function SepetSayisiAzalt() { 2790 var SepetteKac = parseInt($("#sepetcount").html()) - 1; 2791 $("#sepetcount").html(SepetteKac); 2792}; 2793 2794 2795$(window).on('load', function() { 2796 if ($('[data-abone]').length) { 2797 fnAbonelikButonu(); 2798 }; 2799 2800 if ($("#BeRegister").length) { 2801 $("#BeRegister").click(function(event) { 2802 event.preventDefault(); 2803 if ($("#USER_ADI").val().length < 2) { 2804 Swal.fire('Oops...', "Lütfen geçerli bir ad yazın", 'error'); 2805 return false; 2806 } else if ($("#USER_SOYADI").val().length < 2) { 2807 Swal.fire('Oops...', "Lütfen geçerli bir soyad yazın", 'error'); 2808 return false; 2809 } else if (validateEmail($("#EPOSTA").val()) != true) { 2810 Swal.fire('Oops...', "Lütfen geçerli bir eposta yazın", 'error'); 2811 return false; 2812 } else if ($("#SIFRE").val().length < 5) { 2813 Swal.fire('Oops...', "Parolanız en az 6 karakterli olmalıdır.", 'error'); 2814 return false; 2815 } else if ($("#SOZLESME").is(':checked') == false) { 2816 Swal.fire('Oops...', "Kullanıcı ve Gizlilik SözleÅmesini onaylamanız gerekmektedir.", 'error'); 2817 return false; 2818 } else { 2819 $("#BeRegisterForm").submit(); 2820 } 2821 2822 }); 2823 }; 2824 2825 if ($("#SIFRE").length && $("meter").length) { 2826 var strength = { 2827 0: RabbitCMSLang('psw_cokkotu') + ' â¹', 2828 1: RabbitCMSLang('psw_kotu') + ' â¹', 2829 2: RabbitCMSLang('psw_zayif') + ' â¹', 2830 3: RabbitCMSLang('psw_iyi') + ' âº', 2831 4: RabbitCMSLang('psw_cokiyi') + ' â»' 2832 } 2833 var password = document.getElementById('SIFRE'); 2834 var meter = document.getElementById('password-strength-meter'); 2835 var text = document.getElementById('password-strength-text'); 2836 2837 password.addEventListener('input', function() { 2838 var val = password.value; 2839 var result = zxcvbn(val); 2840 meter.value = result.score; 2841 if (val !== "") { 2842 var PassText = ''; 2843 PassText += RabbitCMSLang('psw_strong') + ': <strong>' + strength[result.score] + '</strong><br />'; 2844 if (result.feedback.warning.length > 0) { 2845 PassText += '<suggest>'; 2846 PassText += '<strong>' + result.feedback.warning + '</strong>'; 2847 for (var t = 0; t < result.feedback.suggestions.length; t++) { 2848 PassText += '• ' + result.feedback.suggestions[t] + '<br />'; 2849 }; 2850 PassText += '</suggest>'; 2851 }; 2852 text.innerHTML = PassText; 2853 2854 } else { 2855 text.innerHTML = ""; 2856 } 2857 }); 2858 } 2859}); 2860 2861function getInstallment(id){ 2862 if ($('#InstallmentDiv').length) { 2863 if( $("price").html().length < 3 ){ 2864 $('#InstallmentDiv').html('Veri Yüklenemedi!'); 2865 return false 2866 }; 2867 2868 $.ajax({
2869 url : "/content/class/inc.core.asp?Cmd=PROD:GetInstallment", 2870 type : "POST", 2871 data : 'Price='+ parseFloat( $("price").html().replace('.', '').replace(',', '.') ) +'', 2872 cache : false, 2873 global : false, 2874 success : function(data) { 2875 $('#InstallmentDiv').html(data.messages); 2876 }, 2877 error : function(e) { 2878 $('#InstallmentDiv').html('Taksit Bilgileri Yüklenemedi.'); 2879 } 2880 }); 2881 } 2882} 2883 2884function fnAbonelikButonu(){ 2885 $('[data-abone]').unbind('click'); 2886 $('[data-abone]').click(function(event) { 2887 var $buton = $(this); 2888 var AbonelikTuru = $(this).attr('data-abone'); 2889 var AbonelikID = $(this).attr('data-abone-id'); 2890 2891 $.ajax({ 2892 url: "/content/class/inc.core.asp?Cmd=BildirimAbonelik", 2893 type: "POST", 2894 cache: false, 2895 data: "Tip="+AbonelikTuru+"&AbonelikID="+AbonelikID+"", 2896 success: function(data) { 2897 if(data.status == 204 || data.status==205){ 2898 $buton.replaceWith(data.messages); 2899 Swal.fire({ 2900 title : 'İÅlem BaÅarılı', 2901 html : 'Abonelik Bilginiz DeÄiÅtirildi.', 2902 icon : "success", 2903 timer : 2000,
2904 showConfirmButton: false, 2905 backdrop:'rgba(0,0,0,0.6)' 2906 }); 2907 fnAbonelikButonu(); 2908 }else{ 2909 Swal.fire({ 2910 title : 'Uyarı', 2911 html : data.messages, 2912 icon : "info", 2913 showConfirmButton : true, 2914 showCancelButton : true, 2915 backdrop:'rgba(0,0,0,0.6)', 2916 allowOutsideClick : false, 2917 allowEscapeKey : false, 2918 confirmButtonClass : 'btn btn-success', 2919 confirmButtonText : 'GiriÅ Yap', 2920 cancelButtonText : 'Vazgeç' 2921 }).then(function(result){ 2922 if (result.value) { 2923 location.href = '/tr/account/'; 2924 } 2925 }); 2926 } 2927 }, 2928 error: function(e) { 2929 Swal.fire({ 2930 title : 'Bir Hata OluÅtu', 2931 html : 'Bilinmeyen Bir Hata OluÅtu', 2932 icon : "error", 2933 timer : 2000,
2934 showConfirmButton: false, 2935 backdrop:'rgba(0,0,0,0.6)' 2936 }); 2937 } 2938 }); 2939 }); 2940} 2941 2942/********************************************* 2943* Seçilen Specs Datasını Bulucu 2944**********************************************/ 2945function SeciliSpecID() { 2946 if ($('input[name="VARYASYON_ALT_ID"]').length) { 2947 return $('input[name="VARYASYON_ALT_ID"]:checked').val(); 2948 } else { 2949 if ($('input[type="radio"][name="VARYASYON_ID"]').length) { 2950 return $('input[name="VARYASYON_ID"]:checked').val(); 2951 } else if ($('input[type="hidden"][name="VARYASYON_ID"]').length) { 2952 return $('input[name="VARYASYON_ID"]').val(); 2953 } else { 2954 return false; 2955 } 2956 } 2957}; 2958/********************************************* 2959* Alt Specs Kontrolü 2960**********************************************/ 2961function AltSpecVarmi(){ 2962 if( $("#VariationsContainer > div:nth-child(2) .pro-chx").length ){ 2963 return true; 2964 }else{ 2965 return false; 2966 }; 2967};
2968/********************************************* 2969* Varyasyon KDV HESAPLAYICI 2970**********************************************/ 2971function indirimOrani(price1, price2) { 2972 var price = parseFloat(price1); 2973 var sale = parseFloat(price2); 2974 var korting = (Math.round(((sale - price) / price) * 100)); 2975 return "" + korting + "%"; 2976}; 2977/********************************************* 2978* Varyasyon Fiyat Güncelleme 2979**********************************************/ 2980var currency_symbol = "âº" 2981function ParaFormatla(v) { 2982 var formattedOutput = new Intl.NumberFormat(cms_locale, { 2983 style: 'currency', 2984 currency: cms_currency, 2985 minimumFractionDigits: 3, 2986 maximumFractionDigits: 3, 2987 }); 2988 let Sonuc = formattedOutput.format(v).replace(currency_symbol, ''); 2989 return Sonuc 2990}; 2991 2992function roundDownSignificantDigits(number, decimals) { 2993 let significantDigits = (parseInt(number.toExponential().split('e-')[1])) || 0; 2994 let decimalsUpdated = (decimals || 0) + significantDigits - 1; 2995 decimals = Math.min(decimalsUpdated, number.toString().length); 2996 2997 return (Math.floor(number * Math.pow(10, decimals)) / Math.pow(10, decimals)); 2998} 2999function ParaFormatlaX(v,g) { 3000 var formattedOutput = new Intl.NumberFormat(cms_locale, { 3001 style: 'currency', 3002 currency: g, 3003 minimumFractionDigits: 3, 3004 maximumFractionDigits: 3, 3005 }); 3006 3007 console.log('RESULT: ', v, formattedOutput.format( roundDownSignificantDigits(v, 4) ) ) 3008 return formattedOutput.format( roundDownSignificantDigits(v, 4) ); 3009}; 3010 3011var ssfg=0; 3012function SeciliSpecFiyatGuncelle(fiyat1, fiyat2, parabirimi, StokAdedi, SonFiyat, SepettekiAdedi=0, productId, FotoId, PaletAdedi=1, Gramaj=0, StokKodu='', Barkod='', Birim, OrjinalFiyat) { 3013 var $FiyatElement = $("#price_line"); 3014 var $SadeceFiyatElem= $("#price_line2"); 3015 var Fiyat1 = parseFloat( fiyat1.replace(',', '') ); 3016 var Fiyat2 = parseFloat( fiyat2.replace(',', '') ); 3017 var SatisFiyat = parseFloat( SonFiyat.replace(',', '') ); 3018 var Stok = parseInt(StokAdedi); 3019 var orjinal_fiyat = parseFloat( OrjinalFiyat.replace(',', '') ); 3020 var KDVText = ''; 3021 3022 /* Seçimli Fotografı Ortala */ 3023 /* OWL Carousel */ 3024 if ($('.cur-pointer[data-foto="' + FotoId + '"]')[0] && ssfg > 0 && FotoId != '0') { 3025 $('.cur-pointer[data-foto="' + FotoId + '"]').click(); 3026 }; 3027 /* Slick Slider */ 3028 if ($('.slider-for.slick-initialized.slick-slider')[0] && ssfg > 0) { 3029 let $index = $('a[data-foto="' + FotoId + '"]').data('slick-index'); 3030 if ($index == 'undefined' || FotoId == '0') { 3031 } else { 3032 $('.slider-for').slick('slickGoTo', $index); 3033 } 3034 }; 3035 ssfg++; 3036 3037 let $curSign; 3038 if(parabirimi=='EUR'){$curSign='â¬'} 3039 if(parabirimi=='TRY'){$curSign='âº'} 3040 3041 /* 3042 * KDV Dahil DeÄil İse 3043 **/ 3044 if (cms_ecommerce_tax_included == 0) { 3045 KDVText = '<small id="tax_included_price">' + RabbitCMSLang('kdvdahil') + ' ' + ParaFormatla(SatisFiyat) + ' ' + $curSign + '</small>'; 3046 } else { 3047 KDVText = '<small id="tax_included_price">' + RabbitCMSLang('kdvdahil') + '</small>'; 3048 }; 3049 3050 if (Fiyat2 > 0 && Fiyat2 < Fiyat1) { 3051 var fiyatHtml = ''; 3052 fiyatHtml += '<span>'+ indirimOrani(Fiyat1, Fiyat2) + '</span> '; 3053 // fiyatHtml += ''+ parabirimi +'<price>'+ ParaFormatlaX( Fiyat2, parabirimi ) + '</price>'; 3054 fiyatHtml += ''+ parabirimi +''+ ParaFormatlaX( Fiyat2, parabirimi ) + ''; 3055 // fiyatHtml += '<del>'+ $curSign +'<price>'+ ParaFormatlaX( Fiyat1, parabirimi ) +'</price></del> '; 3056 fiyatHtml += '<del>'+ $curSign +' '+ ParaFormatlaX( Fiyat1, parabirimi ) +'</del> '; 3057 if(parabirimi=='EUR'){ 3058 // fiyatHtml+= ' - <b style="color: #d7000f;">âº</b><price style="color: #d7000f;">'+ (Fiyat1*parseFloat(one_euro)).toFixed(2) +'</price>'; 3059 fiyatHtml+= ' - <b style="color: #d7000f;">âº</b><span style="color: #d7000f;">'+ (Fiyat1*parseFloat(one_euro)).toFixed(2) +'</span>'; 3060 } 3061 fiyatHtml += '<div class="mb-0 mt-0"><small>'+ KDVText +'</small></div> '; 3062 3063 // $SadeceFiyatElem.html('<pice>'+ParaFormatlaX( Fiyat2, parabirimi )+'</price>'); 3064 $SadeceFiyatElem.html(''+ParaFormatlaX( Fiyat2, parabirimi )+''); 3065 } else { 3066 var fiyatHtml = '' 3067 fiyatHtml += ''+ $curSign +'<price>'+ ParaFormatlaX( Fiyat1, parabirimi ) +'</price>'; 3068 if(parabirimi=='EUR'){ 3069 fiyatHtml+= ' - <b style="color: #d7000f;">âº</b><price style="color: #d7000f;">'+ (Fiyat1*parseFloat(one_euro)).toFixed(2) +'</price>' 3070 } 3071 fiyatHtml+='<div class="mb-0 mt-0"><small>'+ KDVText +'</small></div> '; 3072 3073 // $SadeceFiyatElem.html('<pice>'+ParaFormatlaX( Fiyat1, parabirimi )+'</price>'); 3074 $SadeceFiyatElem.html(''+ParaFormatlaX( Fiyat1, parabirimi )+''); 3075 }; 3076 3077 /* FİYAT LİSTELEME */ 3078 let vadeli=0.00; 3079 if(login=='true'){ 3080 vadefarki = parseFloat(vadefarki); 3081 $FiyatElement.html(fiyatHtml); 3082 if(iskonto>0){ 3083 console.log(orjinal_fiyat, parabirimi) 3084 // $('#ana_fiyat').html('<price>'+ ParaFormatlaX( orjinal_fiyat, parabirimi ) +'</price>'); 3085 $('#ana_fiyat').html(ParaFormatlaX( orjinal_fiyat, parabirimi ));
3086 if(Fiyat2>0 && Fiyat2<Fiyat1){ 3087 vadeli = Fiyat2*(100+vadefarki)/100; 3088 console.log('Fiyat2: ', Fiyat2) 3089 // $('#iskontolu_fiyat').html('<price>'+ ParaFormatlaX( Fiyat2, parabirimi ) +'</price> <sup>%'+iskonto+'</sup>'); 3090 // $('#iskontolu_fiyat').html(''+ ParaFormatlaX( Fiyat2, parabirimi ) +' <sup>%'+iskonto+'</sup>'); 3091 $('#iskontolu_fiyat').html($curSign +''+ Fiyat2 +' <sup>%'+iskonto+'</sup>'); 3092 }else{ 3093 console.log('Fiyat1: ', Fiyat1) 3094 vadeli = Fiyat1*(100+vadefarki)/100; 3095 3096 // $('#iskontolu_fiyat').html('âº'+ String(Fiyat1).replace('.', ',') ); 3097 $('#iskontolu_fiyat').html( ParaFormatlaX(Fiyat1, parabirimi) +' <sup>%'+iskonto+'</sup>'); 3098 // app.special_functions.priceBeautifier(); 3099 // $('#iskontolu_fiyat').html('<price>'+ ParaFormatla( Fiyat1 ) +'</price> <sup>%'+iskonto+'</sup>'); 3100 } 3101 }else{ 3102 vadeli = orjinal_fiyat*(100+vadefarki)/100; 3103 // $('#ana_fiyat').html('<price>'+ ParaFormatlaX( orjinal_fiyat, parabirimi ) +'</price>'); 3104 $('#ana_fiyat').html(''+ ParaFormatlaX( orjinal_fiyat, parabirimi ) +''); 3105 } 3106 // $('#vadeli_fiyat').html('<price>'+ ParaFormatlaX( vadeli, parabirimi ) +'</price> <sup>%'+vadefarki+'</sup>'); 3107 $('#vadeli_fiyat').html(''+ ParaFormatlaX( vadeli, parabirimi ) +' <sup>%'+vadefarki+'</sup>'); 3108 }else{ 3109 $FiyatElement.html(''); 3110 } 3111 /* FİYAT LİSTELEME */ 3112 3113 if(PaletAdedi==0){ 3114 $('#PALET_ADEDI').closest('tr').hide('fast'); 3115 }else{ 3116 $('#PALET_ADEDI').closest('tr').show('fast'); 3117 $('#PALET_ADEDI').html(PaletAdedi); 3118 } 3119 3120 if(Gramaj==0){ 3121 $('#AGIRLIK').closest('tr').hide('fast'); 3122 $('#PALET_AGIRLIK').closest('tr').hide('fast'); 3123 }else{ 3124 $('#AGIRLIK').closest('tr').show('fast'); 3125 $('#PALET_AGIRLIK').closest('tr').show('fast'); 3126 3127 $('#AGIRLIK').html( ToKG(Gramaj, Birim) ); 3128 $('#PALET_AGIRLIK').html( ToKG(Gramaj*PaletAdedi, Birim) ); 3129 } 3130 3131 $('#UrunStokKodu').html(StokKodu); 3132 if(StokKodu.length<1){ 3133 $('#UrunStokKodu').closest('tr').hide('fast'); 3134 }else{ 3135 $('#UrunStokKodu').closest('tr').show('fast'); 3136 } 3137 3138 $('#UrunBarkodu').html(Barkod); 3139 if(Barkod.length<1){ 3140 $('#UrunBarkodu').closest('tr').hide('fast'); 3141 }else{ 3142 $('#UrunBarkodu').closest('tr').show('fast'); 3143 } 3144 3145 $('#CARPAN option:eq(1)').attr('data-carpan', PaletAdedi); 3146 3147 $('[name="quantity"]').attr('data-max', StokAdedi); 3148 $('[name="quantity"]').attr('max', StokAdedi); 3149 if (StokAdedi > 0) { 3150 $('[name="quantity"]').val('1'); 3151 $('[data-cmd="AddToCart"]').prop('disabled', false); 3152 $('.add-to-cart-button').prop('disabled', false); 3153 } else { 3154 $('[name="quantity"]').val('0'); 3155 $('[data-cmd="AddToCart"]').prop('disabled', true); 3156 $('.add-to-cart-button').prop('disabled', true); 3157 }; 3158 3159 $('#stokadedi').html(StokAdedi); 3160 $('[data-cmd="AddToCart"][data-id="' + productId + '"]').attr('data-incart', SepettekiAdedi); 3161 if ($('#InstallmentDiv').hasClass('active')) { 3162 $('a[href="#InstallmentDiv"]').trigger('click'); 3163 }; 3164 3165 app.special_functions.priceBeautifier(); 3166}; 3167 3168function ToKG(Gramaj, Birim){ 3169 if(Birim=='Gram'){ 3170 return (Gramaj / 1000) + ' Kg'; 3171 }else if(Birim=='Litre'){ 3172 return Gramaj +' '+ Birim; 3173 }else if(Birim=='Metre'){ 3174 return Gramaj +' '+ Birim; 3175 }else if(Birim=='m²'){ 3176 return Gramaj +' '+ Birim; 3177 }else{ 3178 return Gramaj; 3179 } 3180} 3181 3182$(document).ready(function() { 3183 app.special_functions.fn_ConsoleLog('CMS: Main JS Ready', 'info'); 3184 3185 if( $('.fiyat').length ){ 3186 $('.fiyat').click(function(event) { 3187 $(this).select(); 3188 }).mask("#.##0,00", {reverse: true}); 3189 }; 3190 3191 /* Human Sense */ 3192 var trigLoad=false; 3193 var loadDeferredStyles = function() { 3194 if( $("#deferred-styles").length ){ 3195 var addStylesNode = document.getElementById("deferred-styles"); 3196 var replacement = document.createElement("div"); 3197 replacement.innerHTML = addStylesNode.textContent; 3198 document.body.appendChild(replacement) 3199 addStylesNode.parentElement.removeChild(addStylesNode); 3200 } 3201 }; 3202 3203 $("body").bind("mousemove touchmove touchstart",function(){ 3204 if (trigLoad == false) { 3205 trigLoad = true; 3206 var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || 3207 window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; 3208 if (raf) raf(function() { window.setTimeout(loadDeferredStyles, 0); }); 3209 else window.addEventListener('load', loadDeferredStyles); 3210 3211 } 3212 });
3213 setTimeout(function(){ 3214 if(trigLoad==false){ 3215 trigLoad = true; 3216 var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || 3217 window.webkitRequestAnimationFrame || window.msRequestAnimationFrame; 3218 if (raf) raf(function() { window.setTimeout(loadDeferredStyles, 0); }); 3219 else window.addEventListener('load', loadDeferredStyles); 3220 } 3221 }, 1000); 3222 /* Human Sense End */ 3223 3224 3225 /* 3226 Anchor Click Block 3227 */ 3228 if( $('a[href="#"]').length ){ 3229 $('a[href="#"]').click(function(event){ 3230 event.preventDefault(); 3231 }); 3232 } 3233 3234 /* 3235 Login-register Tab 3236 */ 3237 if( $('#login-form-link').length ){ 3238 $('#login-form-link').click(function(e) { 3239 e.preventDefault(); 3240 $("#login-form").delay(100).fadeIn(100); 3241 $("#register-form").fadeOut(100); 3242 $('#register-form-link').removeClass('active'); 3243 $(this).addClass('active'); 3244 }); 3245 $('#register-form-link').click(function(e) { 3246 e.preventDefault(); 3247 $("#register-form").delay(100).fadeIn(100); 3248 $("#login-form").fadeOut(100); 3249 $('#login-form-link').removeClass('active'); 3250 $(this).addClass('active'); 3251 }); 3252 } 3253 3254 if( $('[data-cmd="SaleContract"]').length ){ 3255 if( $('input[data-cmd="SaleContract"]').length ){ 3256 $('input[data-cmd="SaleContract"]').click(function(){ 3257 if( $(this).prop('checked') ){ 3258 SozlesmeOkundu=true; 3259 }else{ 3260 SozlesmeOkundu=false; 3261 } 3262 }); 3263 }else{ 3264 $('[data-cmd="SaleContract"]').on('scroll', function() { 3265 var offset = $('[data-cmd="SaleContract"]').outerHeight(); // height of textarea 3266 3267 if (this.scrollHeight <= (this.scrollTop+offset)) { 3268 $($body).css('overflow', 'hidden'); 3269 SozlesmeOkundu=true; 3270 app.special_functions.fn_ConsoleLog('CMS: SaleContract Readed', 'success'); 3271 } 3272 }); 3273 3274 // re-enable scrolling on mouseout 3275 $('[data-cmd="SaleContract"]').on('mouseout', function() { 3276 $($body).css('overflow', 'scroll'); 3277 }); 3278 } 3279 } 3280 3281 //$.fn.tooltip.Constructor.VERSION 3282 /* 3283 * ############################################################### 3284 * Modal Creator 3285 * ############################################################### 3286 */ 3287 3288 if( $('[data-modal-cmd]').length ){ 3289 $('[data-modal-cmd]').unbind("click"); 3290 $('[data-modal-cmd]').click(function(e){ 3291 e.preventDefault(); 3292 var $modalCmd = $(this).attr("data-modal-cmd"); 3293 var ModalHeaderText = $(this).attr("data-modal-header"); 3294 /* BS 3 */ 3295 if(parseInt( $.fn.tooltip.Constructor.VERSION ) == 3){ 3296 if( $('.cmsdynamicmodal').length ){ 3297 $('.cmsdynamicmodal').modal("show").trigger('show.bs.modal'); 3298 }else{ 3299 $(template_bs3Modal).appendTo('body'); 3300 $('.cmsdynamicmodal').modal(); 3301 } 3302 3303 /* Dynamic Content*/ 3304 $.ajax({
3305 url: "/content/class/inc.core.asp?ClassCmd="+$modalCmd+"&return="+ encodeURIComponent(window.location.href) +"&nocache="+ Math.random(), 3306 type: "GET", 3307 success: function(data) { 3308 $('.cmsdynamicmodal .modal-title').html(ModalHeaderText); 3309 $('.cmsdynamicmodal .modal-body').html( data ); 3310 $('.cmsdynamicmodal .modal-footer').html(''); 3311 if( ("#cms_payment_form").length ){ 3312 $("#AdresFormuReturn").val( encodeURIComponent(location.href) ); 3313 } 3314 }, 3315 error: function(e) { 3316 app.special_functions.fn_ConsoleLog('CMS: '+e, 'error'); 3317 Swal.fire({ 3318 title: RabbitCMSLang('hata_olustu'), 3319 html: RabbitCMSLang('islem_yapilamadi'), 3320 icon: "error", 3321 timer: 2000,
3322 showConfirmButton: false, 3323 backdrop:'rgba(0,0,0,0.6)' 3324 }); 3325 } 3326 }); 3327 3328 $('.cmsdynamicmodal').on('show.bs.modal', function(){ 3329 3330 }); 3331 $('.cmsdynamicmodal').on('hidden.bs.modal', function(){ 3332 3333 }); 3334 } 3335 3336 /* BS 4 */ 3337 if(parseInt( $.fn.tooltip.Constructor.VERSION ) == 4){ 3338 if( $('.cmsdynamicmodal').length ){ 3339 $('.cmsdynamicmodal').modal("show").trigger('show.bs.modal'); 3340 }else{ 3341 $(template_bs4Modal).appendTo('body'); 3342 $('.cmsdynamicmodal').modal(); 3343 } 3344 3345 /* Dynamic Content*/ 3346 $.ajax({ 3347 url: "/content/class/inc.core.asp?ClassCmd="+$modalCmd+"&return="+ encodeURIComponent(window.location.href) +"&nocache="+ Math.random(), 3348 type: "GET", 3349 success: function(data) { 3350 $('.cmsdynamicmodal .modal-title').html(ModalHeaderText); 3351 $('.cmsdynamicmodal .modal-body').html( data ); 3352 $('.cmsdynamicmodal .modal-footer').html(''); 3353 if( ("#cms_payment_form").length ){ 3354 $("#AdresFormuReturn").val( encodeURIComponent(location.href) ); 3355 } 3356 }, 3357 error: function(e) { 3358 app.special_functions.fn_ConsoleLog('CMS: '+e, 'error'); 3359 Swal.fire({ 3360 title: RabbitCMSLang('hata_olustu'), 3361 html: RabbitCMSLang('islem_yapilamadi'), 3362 type: "error", 3363 timer: 2000,
3364 showConfirmButton: false, 3365 backdrop:'rgba(0,0,0,0.6)' 3366 }); 3367 } 3368 }); 3369 3370 $('.cmsdynamicmodal').on('show.bs.modal', function(){ 3371 3372 }); 3373 $('.cmsdynamicmodal').on('hidden.bs.modal', function(){ 3374 3375 }); 3376 } 3377 }) 3378 } 3379 3380 /* 3381 * ############################################################### 3382 * Address Selector Bind 3383 * ############################################################### 3384 */ 3385 if( $('[data-cmd="DynamicBind"]').length ){ 3386 $('[data-cmd="DynamicBind"]').each(function(i, obj) { 3387 app.special_functions.fn_ConsoleLog('CMS: DynamicBind Loaded', 'info'); 3388 let $element = $(this); 3389 3390 $element.unbind("change, AdresGuncelle"); 3391 $element.on("change, AdresGuncelle", function(event) { 3392 console.log('AdresGuncelle Trigged !'); 3393 var $Elem = $(this) 3394 var $Tipi = $(this).attr("data-tip") 3395 var $holder = $("#holder_" + $Elem.attr("id") ); 3396 var $AdresID = $("option:selected", $Elem).val() //$("#" + holder + " option:selected").val(); 3397 3398 $holder.html("<em>" + RabbitCMSLang('yukleniyor') + "..</em>"); 3399 $.ajax({
3400 url: "/content/class/inc.core.asp?ClassCmd=AJAX:AdresGetir&Tip="+$Tipi+"&ID="+$AdresID+"&nocache="+ Math.random(), 3401 type: "GET", 3402 success: function(data) { 3403 if( data.status == "success" ){ 3404 $holder.html( data.address ); 3405 }else{ 3406 $holder.html( data.msg ); 3407 } 3408 }, 3409 error: function(e) { 3410 app.special_functions.fn_ConsoleLog('CMS: '+e, 'error'); 3411 Swal.fire({ 3412 title: RabbitCMSLang('hata_olustu'), 3413 html: RabbitCMSLang('islem_yapilamadi'), 3414 icon: "error", 3415 timer: 2000, 3416 showConfirmButton: false, 3417 backdrop:'rgba(0,0,0,0.6)' 3418 }); 3419 } 3420 }); 3421 }); 3422 }); 3423 } 3424 3425 /* 3426 * ############################################################### 3427 * Get Cart Counter 3428 * ############################################################### 3429 */ 3430 if( $("#cmsCartCounter").length ){ 3431 $.ajax({
3432 url: "/content/class/inc.core.asp?ClassCmd=AJAX:GetCartCounter&nocache="+ Math.random(), 3433 type: "GET", 3434 success: function(data) { 3435 if( data.status == "success" ){ 3436 $("#cmsCartCounter").html( data.cartcount ); 3437 }else{ 3438 $("#cmsCartCounter").html("?"); 3439 } 3440 }, 3441 error: function(e) { 3442 app.special_functions.fn_ConsoleLog('CMS: '+e, 'error'); 3443 $("#cmsCartCounter").html("?"); 3444 } 3445 }); 3446 } 3447 3448 3449 /* 3450 * ############################################################### 3451 * Newsletter 3452 * ############################################################### 3453 */ 3454 if ($('[data-cmd="Newsletter"]').length) { 3455 $('[data-cmd="Newsletter"]').click(function(event) { 3456 event.preventDefault(); 3457 var EPosta = $('[data-cmd="newsletteremail"]').val(); 3458 3459 if( validateEmail( EPosta ) != true ){ 3460 Swal.fire({ 3461 title: RabbitCMSLang('islem_yapilamadi'), 3462 html: RabbitCMSLang('hata_olustu'), 3463 icon: "error", 3464 timer: 4000,
3465 showConfirmButton: false, 3466 backdrop:'rgba(0,0,0,0.6)' 3467 }); 3468 return false; 3469 } 3470 3471 Swal.fire({ 3472 title : RabbitCMSLang('newsletter_baslik'), 3473 html: RabbitCMSLang('newsletter_bilgi'), 3474 icon: 'warning', 3475 showCancelButton: true, 3476 confirmButtonColor: '#3085d6', 3477 cancelButtonColor: '#d33d33', 3478 confirmButtonText: RabbitCMSLang('evet'), 3479 cancelButtonText: RabbitCMSLang('hayir'), 3480 reverseButtons: true, 3481 backdrop:'rgba(0,0,0,0.6)' 3482 }).then(function(result){ 3483 if (result.value) { 3484 $.ajax({ 3485 url: "/content/class/inc.core.asp?ClassCmd=AJAX:Newsletter&nocache="+ Math.random(), 3486 icon: "POST", 3487 data: 'eposta=' + EPosta + '', 3488 success: function(data) { 3489 if( data.status == "added" ){ 3490 Swal.fire({ 3491 title: RabbitCMSLang('islem_basarili'), 3492 html: RabbitCMSLang('newsletter_eklendi'), 3493 icon: "success", 3494 timer: 2000,
3495 showConfirmButton: false, 3496 backdrop:'rgba(0,0,0,0.6)' 3497 }); 3498 }else if( data.status == "error" ) { 3499 Swal.fire({ 3500 title: RabbitCMSLang('islem_yapilamadi'), 3501 html: RabbitCMSLang('hata_olustu'), 3502 icon: "error", 3503 timer: 4000, 3504 showConfirmButton: false, 3505 backdrop:'rgba(0,0,0,0.6)' 3506 }); 3507 }else{ 3508 Swal.fire({ 3509 title: RabbitCMSLang('islem_basarili'), 3510 html: RabbitCMSLang('newsletter_cikartildi'), 3511 icon: "success", 3512 timer: 2000,
3513 showConfirmButton: false, 3514 backdrop:'rgba(0,0,0,0.6)' 3515 }); 3516 } 3517 }, 3518 error: function(e) { 3519 3520 } 3521 }); 3522 } 3523 }); 3524 }); 3525 } 3526 3527 /* 3528 * ############################################################### 3529 * Delete From Address 3530 * ############################################################### 3531 */ 3532 if( $('input[name="ODEME_YONTEMI"][data-options]').length ){ 3533 app.special_functions.fn_ConsoleLog('CMS: Options Get', 'info'); 3534 $('input[name="ODEME_YONTEMI"][data-options]').click(function(){ 3535 let targetId = $("#"+$(this).attr("data-options")); 3536 let $taksit = $(this).attr('data-taksit'); 3537 let $taksitler = []; 3538 3539 $('#TAKSIT option').remove(); 3540 3541 if($taksit=='0'){ 3542 $('#TAKSIT').append('<option value="0">PeÅin</option>'); 3543 $('#TAKSIT_CONTAINER').hide('fast'); 3544 }else{ 3545 3546 if($taksit.indexOf(",")>-1){ 3547 $.each( $taksit.split(','), function(){ 3548 $taksitler.push(parseInt(this)); 3549 }); 3550 }else{ 3551 $taksitler.push($taksit); 3552 } 3553 3554 $.each( $taksitler, function(){ 3555 if(this=='0' || this=='1'){ 3556 $('#TAKSIT').append('<option value="0">PeÅin</option>'); 3557 }else{ 3558 $('#TAKSIT').append('<option value="'+ this +'">'+ this +' Taksit</option>'); 3559 } 3560 }); 3561 3562 $('#TAKSIT_CONTAINER').show('fast'); 3563 } 3564 3565 $(".oyoptions").not(':checked').hide('fast'); 3566 if( targetId.css('display')=='none'){ 3567 targetId.show('fast'); 3568 }else{ 3569 if(!$(this).prop('checked')){targetId.hide('fast');}else{targetId.show('fast');} 3570 } 3571 }); 3572 } 3573 if ($('[data-cmd="DoPayment"]').length) { 3574 $('[data-cmd="DoPayment"]').click(function(event) { 3575 event.preventDefault(); 3576 $('#cms_payment_form').attr('action', '#'); 3577 3578 let $buton = $(this); 3579 let $payment_Selected_elem = $('form[data-cmd="OdemeIslemleri"] input[name="ODEME_YONTEMI"]:checked'); 3580 let $payment_method = $payment_Selected_elem.attr('data-method') 3581 let ODEME_YONTEMI = $payment_Selected_elem.val(); 3582 let ADRES_SEVKIYAT = $("option:selected", $('form[data-cmd="OdemeIslemleri"] select#sel_shipping')[0]).val(); 3583 let ADRES_FATURA = $("option:selected", $('form[data-cmd="OdemeIslemleri"] select#sel_invoice')[0]).val(); 3584 let ODEME_ISLEMI = $('#ODEME').val(); 3585 if(ODEME_ISLEMI=='1'){ 3586 ADRES_SEVKIYAT=1; 3587 ADRES_FATURA=1; 3588 } 3589 3590 if (ADRES_FATURA === undefined) { 3591 Swal.fire('Oops...', RabbitCMSLang('sevkiyat_adres_sec'), 'info'); 3592 $('[data-modal-cmd="AJAX:AdresFormu"]').click(); 3593 return false; 3594 }; 3595 3596 if(ADRES_SEVKIYAT==0){ 3597 Swal.fire('Oops...', RabbitCMSLang('sevkiyat_adres_sec'), 'error'); 3598 return false; 3599 }else if(ADRES_FATURA==0){ 3600 Swal.fire('Oops...', RabbitCMSLang('fatura_adres_sec'), 'error'); 3601 return false; 3602 // }else if(SozlesmeOkundu==false){ 3603 // Swal.fire('Oops...', RabbitCMSLang('contract_mustread'), 'error'); 3604 // return false; 3605 }else if(!ODEME_YONTEMI){ 3606 Swal.fire('Oops...', RabbitCMSLang('odeme_yontemi_secin'), 'error'); 3607 return false; 3608 }else{ 3609 3610 var FormWidth = 1170, FormHeight = 900; 3611 let FormURI = '/content/class/inc.core.asp?Cmd='+ $payment_method +''; 3612 $('#cms_payment_form').attr('action', FormURI); 3613 3614 if($payment_method == 'iyzicoService'){ 3615 FormHeight = 550; 3616 FormWidth = 400; 3617 } 3618 $.featherlight({ 3619 openSpeed : 100, 3620 closeSpeed : 1000, 3621 persist : true, 3622 iframe : 'about:blank', 3623 iframeMaxWidth : '100%', 3624 iframeWidth : '100vw', 3625 iframeName : 'featherlight', 3626 iframeHeight : '100vh', 3627 closeOnEsc : false, 3628 closeOnClick : false, 3629 loading : 'Yükleniyor', 3630 afterOpen : function(){ 3631 $("form#cms_payment_form").submit(); 3632 }, 3633 afterClose : function(){ 3634 3635 } 3636 }); 3637 } 3638 }); 3639 } 3640 3641 /* 3642 * ############################################################### 3643 * Delete From Address 3644 * ############################################################### 3645 */ 3646 if ($('[data-cmd="DeleteFromAddress"]')[0]) { 3647 $($body).on('click', '[data-cmd="DeleteFromAddress"]', function(event) { 3648 event.preventDefault(); 3649 let $btn = $(this); 3650 let $AddressId = $btn.data('id'); 3651 3652 Swal.fire({ 3653 title: RabbitCMSLang('adres_silinecek'), 3654 html: RabbitCMSLang('adres_sil_onay'), 3655 icon: 'warning',
3656 showCancelButton: true, 3657 confirmButtonColor: '#3085d6', 3658 cancelButtonColor: '#d33d33', 3659 confirmButtonText: RabbitCMSLang('tamam'), 3660 cancelButtonText: RabbitCMSLang('vazgec'), 3661 reverseButtons: true, 3662 backdrop:'rgba(0,0,0,0.6)' 3663 }).then(function(result){ 3664 if (result.value) { 3665 $.ajax({ 3666 url: "/sys/?Cmd=DELETE:AddressDelete", 3667 type: "POST", 3668 data: { 3669 ADRES_ID : $AddressId 3670 }, 3671 success: function(data) { 3672 if( data.status == 200 ){ 3673 Swal.fire({ 3674 title: RabbitCMSLang('islem_basarili'), 3675 html: RabbitCMSLang('adres_silindi'), 3676 icon: "success", 3677 timer: 2000,
3678 showConfirmButton: false, 3679 backdrop:'rgba(0,0,0,0.6)' 3680 }); 3681 3682 $("#Address_"+$AddressId)[0] && $("#Address_"+$AddressId).remove(); 3683 }else{ 3684 3685 } 3686 }, 3687 error: function(e) { 3688 3689 } 3690 }); 3691 } 3692 }); 3693 }); 3694 } 3695 3696 if ($('[data-cmd="UpdateAddress"]').length) { 3697 $('[data-cmd="UpdateAddress"]').click(function(event) { 3698 event.preventDefault(); 3699 var AdresID = $(this).attr("data-id"); 3700 var Baslik = $(this).attr("data-title"); 3701 Swal.fire({ 3702 title : 'Adres Güncelleme', 3703 html : '<strong>'+Baslik+'</strong> baÅlıklı adres kaydı güncellenecektir. YapacaÄınız bu güncelleme, mevcut sipariÅlerinizin ulaÅtırılacaÄı adresleri deÄiÅtirmeyecek veya etki etmeyecektir. Devam etmek istiyor musunuz?', 3704 icon : 'info', 3705 showCancelButton : true, 3706 confirmButtonColor : '#3085d6', 3707 cancelButtonColor : '#d33d33', 3708 confirmButtonText : 'Tamam', 3709 cancelButtonText : 'Vazgeç', 3710 reverseButtons : true, 3711 backdrop :'rgba(0,0,0,0.6)' 3712 }).then((result) => { 3713 if (result.value) { 3714 3715 if( $('.cmsdynamicmodal').length ){ 3716 $('.cmsdynamicmodal').modal("show").trigger('show.bs.modal'); 3717 }else{ 3718 $(template_bs4Modal).appendTo('body'); 3719 $('.cmsdynamicmodal').modal(); 3720 } 3721 3722 $.ajax({
3723 url: "/content/class/inc.core.asp?ClassCmd=AJAX:AdresGuncellemeFormu&I="+ AdresID +"&nocache="+ Math.random(), 3724 type: "GET", 3725 success: function(data) { 3726 $('.cmsdynamicmodal').modal("show").trigger('show.bs.modal'); 3727 $('.cmsdynamicmodal .modal-title').html('Adres Güncelleme'); 3728 $('.cmsdynamicmodal .modal-body').html( data ); 3729 3730 $("#AdresFormuReturn").val( encodeURIComponent(location.href) ); 3731 }, 3732 error: function(e) { 3733 3734 } 3735 }); 3736 } 3737 }); 3738 }); 3739 }; 3740 3741 /* 3742 * ############################################################### 3743 * Sosyal PaylaÅım Butonu 3744 * ############################################################### 3745 */ 3746 if ($(".SocialButtonList").length) { 3747 var SayfaURL = $(location).attr('href'); 3748 $('a.SocHref').each(function(i, obj) { 3749 var MevcutURL = $(this).attr("href"); 3750 var YeniURL = MevcutURL + SayfaURL; 3751 $(this).attr("href", YeniURL); 3752 }); 3753 } 3754 3755 /* 3756 * ############################################################### 3757 * Session Saving 3758 * ############################################################### 3759 */ 3760 if( $("body").length ){ 3761 $('<iframe>', { 3762 src: '/content/class/inc.core.asp?ClassCmd=AJAX:RefreshSession', 3763 id: 'refreshFrame', 3764 frameborder: 0, 3765 width: 0, 3766 height: 0, 3767 scrolling: 'no' 3768 }).appendTo('body').css('display','none'); 3769 } 3770 3771 /* 3772 * ############################################################### 3773 * Asenkron İÅlemler 3774 * ############################################################### 3775 */ 3776 // if (pushid > 0) { 3777 // $.ajax({
3778 // url: "/content/class/inc.core.asp?Cmd=AJAX:PushPost", 3779 // type: "POST", 3780 // data: "ID=" + pushid, 3781 // success: function(data) { 3782 3783 // }, 3784 // error: function(e) { 3785 3786 // } 3787 // }); 3788 // } 3789 if ($('input[data-name="X_FORM_TOKEN"]')[0]) { 3790 $.ajax({ 3791 url: "/content/class/inc.core.asp?Cmd=AJAX:X_FORM_TOKEN", 3792 type: "POST", 3793 data: "r=" + Math.random(), 3794 success: function(data) { 3795 $('input[data-name="X_FORM_TOKEN"]').each(function(index) { 3796 $(this).val(data.code); 3797 }); 3798 }, 3799 error: function(e) {} 3800 }); 3801 }; 3802 3803 /* 3804 * ############################################################### 3805 * Masked İnputlar 3806 * ############################################################### 3807 */ 3808 fnMaskedInput(); 3809 3810 /* 3811 * ############################################################### 3812 * Whatsapp Widget 3813 * ############################################################### 3814 */ 3815 if($('#mwb_whatsapp')[0]){ 3816 let btn_text = $('#mwb_whatsapp').attr('button-title'); 3817 let pre_msg = $('#mwb_whatsapp').attr('description'); 3818 let welcome_msg = $('#mwb_whatsapp').attr('welcome-message'); 3819 let mt_name = $('#mwb_whatsapp').attr('name'); 3820 let phonenmb = $('#mwb_whatsapp').attr('number'); 3821 let position = $('#mwb_whatsapp').attr('position'); 3822 3823 var mwb_whatsapp=function(){"use strict";function t(){}function e(t){return t()}function a(){return Object.create(null)}function n(t){t.forEach(e)}function o(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function r(t,e){t.appendChild(e)}function s(t,e,a){t.insertBefore(e,a||null)}function p(t){t.parentNode.removeChild(t)}function c(t){return document.createElement(t)}function l(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function d(t){return document.createTextNode(t)}function h(){return d(" ")}function g(t,e,a,n){return t.addEventListener(e,a,n),()=>t.removeEventListener(e,a,n)}function u(t,e,a){null==a?t.removeAttribute(e):t.getAttribute(e)!==a&&t.setAttribute(e,a)}function f(t,e){e=""+e,t.data!==e&&(t.data=e)}function b(t,e){(null!=e||t.value)&&(t.value=e)}function m(t,e,a,n){t.style.setProperty(e,a,n?"important":"")}let x;function w(t){x=t}const v=[],A=[],y=[],k=[],$=Promise.resolve();let z=!1;function M(t){y.push(t)}function C(){const t=new Set;do{for(;v.length;){const t=v.shift();w(t),S(t.$$)}for(;A.length;)A.pop()();for(let e=0;e<y.length;e+=1){const a=y[e];t.has(a)||(a(),t.add(a))}y.length=0}while(v.length);for(;k.length;)k.pop()();z=!1}function S(t){if(null!==t.fragment){t.update(),n(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(M)}}const E=new Set;function B(t,e){-1===t.$$.dirty[0]&&(v.push(t),z||(z=!0,$.then(C)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function D(i,r,s,p,c,l,d=[-1]){const h=x;w(i);const g=r.props||{},u=i.$$={fragment:null,ctx:null,props:l,update:t,not_equal:c,bound:a(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(h?h.$$.context:[]),callbacks:a(),dirty:d};let f=!1;var b,m,v;u.ctx=s?s(i,g,(t,e,a=e)=>(u.ctx&&c(u.ctx[t],u.ctx[t]=a)&&(u.bound[t]&&u.bound[t](a),f&&B(i,t)),e)):[],u.update(),f=!0,n(u.before_update),u.fragment=!!p&&p(u.ctx),r.target&&(r.hydrate?u.fragment&&u.fragment.l((v=r.target,Array.from(v.childNodes))):u.fragment&&u.fragment.c(),r.intro&&((b=i.$$.fragment)&&b.i&&(E.delete(b),b.i(m))),function(t,a,i){const{fragment:r,on_mount:s,on_destroy:p,after_update:c}=t.$$;r&&r.m(a,i),M(()=>{const a=s.map(e).filter(o);p?p.push(...a):n(a),t.$$.on_mount=[]}),c.forEach(M)}(i,r.target,r.anchor),C()),w(h)}let L;function T(e){let a,n,o,i;return{c(){a=l("svg"),n=l("path"),o=l("g"),i=l("path"),u(n,"fill","#DFE5E7"),u(n,"d","M106.251.5C164.653.5 212 47.846 212 106.25S164.653 212 106.25 212C47.846 212 .5 164.654.5 106.25S47.846.5 106.251.5z"),u(i,"d","M173.561 171.615a62.767 62.767 0 0 0-2.065-2.955 67.7 67.7 0 0 0-2.608-3.299 70.112 70.112 0 0 0-3.184-3.527 71.097 71.097 0 0 0-5.924-5.47 72.458 72.458 0 0 0-10.204-7.026 75.2 75.2 0 0 0-5.98-3.055c-.062-.028-.118-.059-.18-.087-9.792-4.44-22.106-7.529-37.416-7.529s-27.624 3.089-37.416 7.529c-.338.153-.653.318-.985.474a75.37 75.37 0 0 0-6.229 3.298 72.589 72.589 0 0 0-9.15 6.395 71.243 71.243 0 0 0-5.924 5.47 70.064 70.064 0 0 0-3.184 3.527 67.142 67.142 0 0 0-2.609 3.299 63.292 63.292 0 0 0-2.065 2.955 56.33 56.33 0 0 0-1.447 2.324c-.033.056-.073.119-.104.174a47.92 47.92 0 0 0-1.07 1.926c-.559 1.068-.818 1.678-.818 1.678v.398c18.285 17.927 43.322 28.985 70.945 28.985 27.678 0 52.761-11.103 71.055-29.095v-.289s-.619-1.45-1.992-3.778a58.346 58.346 0 0 0-1.446-2.322zM106.002 125.5c2.645 0 5.212-.253 7.68-.737a38.272 38.272 0 0 0 3.624-.896 37.124 37.124 0 0 0 5.12-1.958 36.307 36.307 0 0 0 6.15-3.67 35.923 35.923 0 0 0 9.489-10.48 36.558 36.558 0 0 0 2.422-4.84 37.051 37.051 0 0 0 1.716-5.25c.299-1.208.542-2.443.725-3.701.275-1.887.417-3.827.417-5.811s-.142-3.925-.417-5.811a38.734 38.734 0 0 0-1.215-5.494 36.68 36.68 0 0 0-3.648-8.298 35.923 35.923 0 0 0-9.489-10.48 36.347 36.347 0 0 0-6.15-3.67 37.
3823124 37.124 0 0 0-5.12-1.958 37.67 37.67 0 0 0-3.624-.896 39.875 39.875 0 0 0-7.68-.737c-21.162 0-37.345 16.183-37.345 37.345 0 21.159 16.183 37.342 37.345 37.342z"),u(o,"fill","#FFF"),u(a,"v-else",""),u(a,"xmlns","http://www.w3.org/2000/svg"),u(a,"viewBox","0 0 212 212"),u(a,"width","50"),u(a,"height","50")},m(t,e){s(t,a,e),r(a,n),r(a,o),r(o,i)},p:t,d(t){t&&p(a)}}}function U(t){let e,a,n;return{c(){(e=c("img")).src!==(a=t[0])&&u(e,"src",a),u(e,"alt",n=t[6]+" Logo")},m(t,a){s(t,e,a)},p(t,o){1&o&&e.src!==(a=t[0])&&u(e,"src",a),64&o&&n!==(n=t[6]+" Logo")&&u(e,"alt",n)},d(t){t&&p(e)}}}function H(e){let a,o,i,l,x,w,v,A,y,k,$,z,M,C,S,E,B,D,L,H,P,_,I,O,R,F,N,X,j,V,q,J,Y,Q,W,G;function K(t,e){return null!==t[0]?U:T}let Z=K(e),tt=Z(e);return{c(){a=c("div"),o=c("div"),i=c("div"),l=c("div"),tt.c(),x=h(),w=c("p"),v=c("span"),A=d(e[6]),y=h(),k=c("br"),$=h(),z=c("small"),M=d(e[1]),C=h(),S=c("div"),E=c("div"),(B=c("div")).innerHTML='<div style="position: relative;display: flex;"><div class="ixsrax"></div> \n <div class="dRvxoz"></div> \n <div class="kXBtNt"></div></div>',D=h(),L=c("div"),H=c("div"),P=d(e[6]),_=h(),I=c("div"),O=h(),(R=c("div")).textContent=`${function(){let t=new Date;return String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")}()}`,F=h(),N=c("div"),X=c("textarea"),j=h(),(V=c("button")).innerHTML='<svg viewBox="0 0 448 448"><path d="M.213 32L0 181.333 320 224 0 266.667.213 416 448 224z"></path></svg>',q=h(),(J=c("button")).textContent="Ã",Q=h(),(W=c("button")).innerHTML='<svg width="18" viewBox="0 0 24 24"><path fill="#eceff1" d="M20.5 3.4A12.1 12.1 0 0012 0 12 12 0 001.7 17.8L0 24l6.3-1.7c2.8 1.5 5 1.4 5.8 1.5a12 12 0 008.4-20.3z"></path><path fill="#4caf50" d="M12 21.8c-3.1 0-5.2-1.6-5.4-1.6l-3.7 1 1-3.7-.3-.4A9.9 9.9 0 012.1 12a10 10 0 0117-7 9.9 9.9 0 01-7 16.9z"></path><path fill="#fafafa" d="M17.5 14.3c-.3 0-1.8-.8-2-.9-.7-.2-.5 0-1.7 1.3-.1.2-.3.2-.6.1s-1.3-.5-2.4-1.5a9 9 0 01-1.7-2c-.3-.6.4-.6 1-1.7l-.1-.5-1-2.2c-.2-.6-.4-.5-.6-.5-.6 0-1 0-1.4.3-1.6 1.8-1.2 3.6.2 5.6 2.7 3.5 4.2 4.2 6.8 5 .7.3 1.4.3 1.9.2.6 0 1.7-.7 2-1.4.3-.7.3-1.3.2-1.4-.1-.2-.3-.3-.6-.4z"></path></svg> \n <span>\n '+ btn_text +'\n </span>',this.c=t,u(l,"class","whatsapp-chat-avatar"),u(v,"class","whatsapp-chat-name"),m(z,"float","left"),u(i,"class","whatsapp-chat-header"),m(B,"opacity","0"),u(B,"class","whatsapp-chat-message-loader"),u(H,"class","bMIBDo"),u(I,"class","iSpIQi"),u(R,"class","cqCDVm"),m(L,"opacity","1"),u(L,"class","whatsapp-chat-message"),u(E,"class","whatsapp-chat-bubble"),u(S,"class","whatsapp-chat-body"),u(S,"pattern",e[3]),u(X,"placeholder","Bir mesaj yazın"), u(X, "value", pre_msg),u(X,"maxlength","120"),u(X,"row","1"),u(V,"type","button"),u(N,"class","whatsapp-message-box"),u(J,"type","button"),u(J,"class","close-chat"),u(o,"id","whatsapp-chat"),u(o,"class",Y=e[4]?"show widget_"+ position +"":"hide widget_"+ position +""),u(W,"class","whatsapp-trigger-chat widget_"+ position +""),u(W,"title","Show Chat"),u(a,"id","app"),G=[g(X,"input",e[11]),g(V,"click",e[8]),g(J,"click",e[7]),g(W,"click",e[7])]},m(t,n){s(t,a,n),r(a,o),r(o,i),r(i,l),tt.m(l,null),r(i,x),r(i,w),r(w,v),r(v,A),r(w,y),r(w,k),r(w,$),r(w,z),r(z,M),r(o,C),r(o,S),r(S,E),r(E,B),r(E,D),r(E,L),r(L,H),r(H,P),r(L,_),r(L,I),I.innerHTML=e[2],r(L,O),r(L,R),r(o,F),r(o,N),r(N,X),b(X,e[5]),r(N,j),r(N,V),r(o,q),r(o,J),r(a,Q),r(a,W)},p(t,[e]){Z===(Z=K(t))&&tt?tt.p(t,e):(tt.d(1),(tt=Z(t))&&(tt.c(),tt.m(l,null))),64&e&&f(A,t[6]),2&e&&f(M,t[1]),64&e&&f(P,t[6]),4&e&&(I.innerHTML=t[2]),8&e&&u(S,"pattern",t[3]),32&e&&b(X,t[5]),16&e&&Y!==(Y=t[4]?"show widget_"+ position +"":"hide widget_"+ position +"")&&u(o,"class",Y)},i:t,o:t,d(t){t&&p(a),tt.d(),n(G)}}}function P(t,e,a){let n,o=!1,i="",{name:r=mt_name}=e,{number:s=phonenmb}=e,{avatar:p=null}=e,{description:c="Genellikle bir saat içinde yanıt verir"}=e,{welcomeMessage:l=welcome_msg}=e,{pattern:d="/content/img/whatsapp-bg.png"}=e;return t.$set=(t=>{"name"in t&&a(9,r=t.name),"number"in t&&a(10,s=t.number),"avatar"in t&&a(0,p=t.avatar),"description"in t&&a(1,c=t.description),"welcomeMessage"in t&&a(2,l=t.welcomeMessage),"pattern"in t&&a(3,d=t.pattern)}),t.$$.update=(()=>{1536&t.$$.dirty&&a(6,n=r||s)}),[p,c,l,d,o,i,n,function(){a(4,o=!o)},function(){var t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"https://wa.me/"+String(s).replace("+","")+"?text="+encodeURIComponent(i):"https://api.whatsapp.com/se
3823nd?phone="+s+"&text="+encodeURIComponent(i);window.open(t,"_blank"),a(5,i=""),a(4,o=!1)},r,s,function(){i=this.value,a(5,i)}]}"function"==typeof HTMLElement&&(L=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,a){this[t]=a}$destroy(){!function(t,e){const a=t.$$;null!==a.fragment&&(n(a.on_destroy),a.fragment&&a.fragment.d(e),a.on_destroy=a.fragment=null,a.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const a=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return a.push(e),()=>{const t=a.indexOf(e);-1!==t&&a.splice(t,1)}}$set(){}});class _ extends L{constructor(t){super(),this.shadowRoot.innerHTML='<link data-add="cms" rel="stylesheet" href="/content/css_system/whatsapp.css" />',D(this,{target:this.shadowRoot},P,H,i,{name:9,number:10,avatar:0,description:1,welcomeMessage:2,pattern:3}),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),C()))}static get observedAttributes(){return["name","number","avatar","description","welcomeMessage","pattern"]}get name(){return this.$$.ctx[9]}set name(t){this.$set({name:t}),C()}get number(){return this.$$.ctx[10]}set number(t){this.$set({number:t}),C()}get avatar(){return this.$$.ctx[0]}set avatar(t){this.$set({avatar:t}),C()}get description(){return this.$$.ctx[1]}set description(t){this.$set({description:t}),C()}get welcomeMessage(){return this.$$.ctx[2]}set welcomeMessage(t){this.$set({welcomeMessage:t}),C()}get pattern(){return this.$$.ctx[3]}set pattern(t){this.$set({pattern:t}),C()}}return customElements.define("whatsapp-widget",_),new _({target:document.body})}(); 3824 } 3825}); 3826 3827 3828 3829 3830 3831 3832 3833 3834/* 3835 * ############################################################### 3836 * Masked Input İçin Ayarlar 3837 * ############################################################### 3838 */ 3839function fnMaskedInput() { 3840 if ($('input[cms-mask="mobile"]').length) { 3841 app.special_functions.fn_ConsoleLog('CMS: cms-mask[mobile] found.', 'info'); 3842 $('input[cms-mask="mobile"]:not(.fnMaskedInput)').each(function(index, el) { 3843 $(this).addClass('fnMaskedInput'); 3844 $(this).mask("0000 000 00 00", { 3845 // translation: { 5: { pattern: /5/, fallback: 5 } }, 3846 placeholder: "05__ ___ __ __" 3847 }); 3848 }); 3849 } 3850 if ($('input[cms-mask="phone"]').length) { 3851 app.special_functions.fn_ConsoleLog('CMS: cms-mask[phone] found.', 'info'); 3852 $('input[cms-mask="phone"]:not(.fnMaskedInput)').each(function(index, el) { 3853 $(this).addClass('fnMaskedInput'); 3854 $(this).mask("0000 000 00 00", { 3855 placeholder: "0___ ___ __ __" 3856 }); 3857 }); 3858 } 3859} 3860 3861/* 3862 * ############################################################### 3863 * Chapta Varsa Buton Koruması 3864 * İlgili formda ki tüm submitleri bul ve disable yap. 3865 * ############################################################### 3866 */ 3867jQuery(document).ready(function($) { 3868 if ($('form').find('div.g-recaptcha').length) { 3869 $('form').find('div.g-recaptcha').each(function(index) { 3870 $(this).closest('form').find('[type=submit]').prop("disabled", true); 3871 }); 3872 }; 3873}); 3874 3875function CMScorrectCaptcha() { 3876 $('form').find('div.g-recaptcha').each(function(index) { 3877 $(this).closest('form').find('[type=submit]').prop("disabled", false); 3878 }); 3879}; 3880 3881function isNumeric(num) { 3882 return !isNaN(num) 3883}; 3884 3885function delay(callback, ms) { 3886 var timer = 0; 3887 return function() { 3888 var context = this, 3889 args = arguments; 3890 clearTimeout(timer); 3891 timer = setTimeout(function() { 3892 callback.apply(context, args); 3893 }, ms || 0); 3894 }; 3895};
3896 3897function validateEmail(email) { 3898 var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 3899 return re.test(String(email).toLowerCase()); 3900}; 3901 3902function validatePhone(tel) { 3903 var parcalanmisTel = tel.split(""); 3904 if (!/[^05].[^0-9 ]/.test(tel)) { 3905 if (parcalanmisTel[0] == "0" && parcalanmisTel[1] == "5" && tel.length == 14) 3906 return true; 3907 else 3908 return false; 3909 } else 3910 return false; 3911}; 3912 3913function TCKimlikDogrulama(TCno) { 3914 TCno = String(TCno); if(TCno=='11111111111'){return true;}; if (!TCno.match(/^[0-9]{11}$/)) return false; var invalid = ['/11111111110/', '/22222222220/', '/33333333330/', '/44444444440/', '/55555555550/', '/66666666660/', '/7777777770/', '/88888888880/', '/99999999990/']; if (new RegExp('\\b' + TCno + '\\b').test(invalid)) { return false; }; var pr1 = parseInt(TCno.substr(0, 1)); var pr2 = parseInt(TCno.substr(1, 1)); var pr3 = parseInt(TCno.substr(2, 1)); var pr4 = parseInt(TCno.substr(3, 1)); var pr5 = parseInt(TCno.substr(4, 1)); var pr6 = parseInt(TCno.substr(5, 1)); var pr7 = parseInt(TCno.substr(6, 1)); var pr8 = parseInt(TCno.substr(7, 1)); var pr9 = parseInt(TCno.substr(8, 1)); var pr10 = parseInt(TCno.substr(9, 1)); var pr11 = parseInt(TCno.substr(10, 1)); if ((pr1 + pr3 + pr5 + pr7 + pr9 + pr2 + pr4 + pr6 + pr8 + pr10) % 10 != pr11) return false; if (((pr1 + pr3 + pr5 + pr7 + pr9) * 7 + (pr2 + pr4 + pr6 + pr8) * 9) % 10 != pr10) return false; if (((pr1 + pr3 + pr5 + pr7 + pr9) * 8) % 10 != pr11) return false; return true; 3915}; 3916 3917function VergiKimlikDogrulama(kno){ 3918 var v1 = 0; var v2 = 0; var v3 = 0; var v4 = 0; var v5 = 0; var v6 = 0; var v7 = 0; var v8 = 0; var v9 = 0; var v11 = 0; var v22 = 0; var v33 = 0; var v44 = 0; var v55 = 0; var v66 = 0; var v77 = 0; var v88 = 0; var v99 = 0; var v_last_digit = 0; var toplam = 0; var desen = /[0-9]{10}/; if (kno.length == 10) { v1 = (Number(kno.charAt(0)) + 9) % 10; v2 = (Number(kno.charAt(1)) + 8) % 10; v3 = (Number(kno.charAt(2)) + 7) % 10; v4 = (Number(kno.charAt(3)) + 6) % 10; v5 = (Number(kno.charAt(4)) + 5) % 10; v6 = (Number(kno.charAt(5)) + 4) % 10; v7 = (Number(kno.charAt(6)) + 3) % 10; v8 = (Number(kno.charAt(7)) + 2) % 10; v9 = (Number(kno.charAt(8)) + 1) % 10; v_last_digit = Number(kno.charAt(9)); v11 = (v1 * 512) % 9; v22 = (v2 * 256) % 9; v33 = (v3 * 128) % 9; v44 = (v4 * 64) % 9; v55 = (v5 * 32) % 9; v66 = (v6 * 16) % 9; v77 = (v7 * 8) % 9; v88 = (v8 * 4) % 9; v99 = (v9 * 2) % 9; if (v1 != 0 && v11 == 0) v11 = 9; if (v2 != 0 && v22 == 0) v22 = 9; if (v3 != 0 && v33 == 0) v33 = 9; if (v4 != 0 && v44 == 0) v44 = 9; if (v5 != 0 && v55 == 0) v55 = 9; if (v6 != 0 && v66 == 0) v66 = 9; if (v7 != 0 && v77 == 0) v77 = 9; if (v8 != 0 && v88 == 0) v88 = 9; if (v9 != 0 && v99 == 0) v99 = 9; toplam = v11 + v22 + v33 + v44 + v55 + v66 + v77 + v88 + v99; if (toplam % 10 == 0) toplam = 0; else toplam = (10 - (toplam % 10)); if (toplam == v_last_digit) { return true; } else return false; } else return false; 3919}; 3920 3921/* 3922 Payment Communication 3923*/ 3924var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent"; 3925var eventer = window[eventMethod]; 3926var messageEvent = eventMethod === "attachEvent" ? "onmessage" : "message"; 3927eventer(messageEvent, function(e) { 3928 if (e.origin == document.location.origin) { 3929 switch (e.data.cmd) { 3930 case "none": 3931 fitFormSize(e.data.size); 3932 break; 3933 case "ShowAlert": 3934 console.log('msg: ' + e.data.messages); 3935 /*$.featherlight.current().close();*/ 3936 break; 3937 case "SuccessOrder": 3938 console.log('msg: ' + e.data.orderId); 3939 break; 3940 case "FormClose": 3941 /*$.featherlight.current().close();*/ 3942 break; 3943 default: 3944 }; 3945 } else { 3946 console.log('Others: Cmd: ' + e.data.cmd); 3947 return; 3948 } 3949}); 3950 3951window.addEventListener('message', function(event) { 3952 console.log('message recivied: ', event.data); 3953 3954 if (event.origin !== 'https://qnbpay.myfixyapikim.com') { 3955 console.log('Origin Outside'); 3956 return; 3957 } 3958 3959 if (event.data && event.data.action === 'callPayment') { 3960 app.paymentMessage(event.data.pmType, event.data.pmMsg, event.data.pmOrder, event.data.pmLog); // app fonksiyonunu parametrelerle çalıÅtır 3961 } 3962}); 3963 3964function fitFormSize(newHeight){ 3965 $('iframe#featherlight').attr('height', parseInt(newHeight) ); 3966};
3967 3968window.addEventListener('load',function(){ 3969 if(document.querySelector('html[data-supercache="true"]')!=null){ 3970 document.querySelector('small.scripttimer').innerHTML = `Sayfa Yüklenme Hızı: ${(Date.now() - rabbitTimeStart)/10000} Sec.`; 3971 } 3972});
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.