src/SiteBundle/Resources/views/Base/sabitJS.html.twig line 1

Open in your IDE?
  1. <script src="{{ asset('assets/plugins/fancybox-master/dist/jquery.fancybox.min.js') }}"></script>
  2. {# <a href="image.jpg" data-fancybox data-caption="Caption for single image"></a> #}
  3. <script src="{{ asset('assets/horizontal/assets/lazyload-master/dist/lazyload.js') }}"></script>
  4. <script src="{{ asset('assets/horizontal/assets/lazyload-master/dist/lazyImg.js') }}"></script>
  5. <script src="{{ asset('assets/horizontal/assets/jquery-number/jquery.number.min.js') }}"></script>
  6. <script src="{{ asset('assets/horizontal/assets/inputmask/dist/min/jquery.inputmask.bundle.min.js') }}"></script>
  7. <script src="{{ asset('assets/horizontal/assets/jquery.numeric/jquery.numeric.min.js') }}"></script>
  8. <script src="{{ asset('assets/horizontal/assets/jquery-price-format/jquery.priceformat.min.js') }}"></script>
  9. <script src="{{ asset('assets/sharer.js') }}"></script>
  10. <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/js/all.min.js" integrity="sha512-u3fPA7V8qQmhBPNT5quvaXVa1mnnLSXUep5PS1qo5NRzHwG19aHmNJnj1Q8hpA/nBWZtZD4r4AX6YOt5ynLN2g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  11. <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  12. <script>
  13.     function lazy() {
  14.         (function() {
  15.             function logElementEvent(eventName, element) {
  16.                 console.log(
  17.                     Date.now(),
  18.                     eventName,
  19.                     element.getAttribute("data-src")
  20.                 );
  21.             }
  22.             var callback_enter = function(element) {
  23.                 logElementEvent("🔑 ENTERED", element);
  24.             };
  25.             var callback_exit = function(element) {
  26.                 logElementEvent("🚪 EXITED", element);
  27.             };
  28.             var callback_reveal = function(element) {
  29.                 logElementEvent("👁️ REVEALED", element);
  30.             };
  31.             var callback_loaded = function(element) {
  32.                 logElementEvent("👍 LOADED", element);
  33.             };
  34.             var callback_error = function(element) {
  35.                 logElementEvent("💀 ERROR", element);
  36.                 element.src =
  37.                     "/resimyok.png";
  38.             };
  39.             var callback_finish = function() {
  40.                 logElementEvent("✔️ FINISHED", document.documentElement);
  41.             };
  42.             var ll = new LazyLoad({
  43.                 elements_selector: ".lazy",
  44.                 // Assign the callbacks defined above
  45.                 callback_enter: callback_enter,
  46.                 callback_exit: callback_exit,
  47.                 callback_reveal: callback_reveal,
  48.                 callback_loaded: callback_loaded,
  49.                 callback_error: callback_error,
  50.                 callback_finish: callback_finish
  51.             });
  52.         })();
  53.     }
  54.     function checkEmail(email) {
  55.         var filter = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/;
  56.         if (!filter.test(email)) {
  57.             //alert('Lütfen uygun formatta bir mail adresi giriniz !');
  58.             return false;
  59.         }
  60.         else{
  61.             //alert('Mail adresi uygun formattadır.');
  62.             return true;
  63.         }
  64.     }
  65.     $().ready(function () {
  66.         $('.priceFormat').priceFormat({
  67.             prefix: '',
  68.             thousandsSeparator: ''
  69.         });
  70.         $(":input").inputmask();
  71.         $('.numeric').numeric();
  72.         {% if ''|dilSay > 1 %}
  73.         $('body').prepend('<div class="rv_language">\n' +
  74.             '    <div class="rv_lang-icon animated shake delay-5s">\n' +
  75.             '        <img class="lazy" data-src="{{ asset('assets/language.png') }}" width="32" />\n' +
  76.             '    </div>\n' +
  77.             '    <div class="rv_lang">\n' +
  78.             '        <h4><img class="lazy" data-src="{{ asset('assets/flag/'~app.session.get('dil')['kisa']~'.png') }}" width="25" alt="{{ app.session.get('dil')['kisa'] }}"> <span class="lang_text">{{ app.session.get('dil')['uzun']|ceviri }} ({{ app.session.get('dil')['kisa']|upper }})</span></h4>\n' +
  79.         '\n' +
  80.         '        <ul>\n' +
  81.         '            {{ ''|site_dilGetir|raw }}\n' +
  82.         '        </ul>\n' +
  83.         '    </div>\n' +
  84.         '</div>');
  85.         lazy();
  86.         {% endif %}
  87.         $('.rv_lang-icon').click(function () {
  88.             $('.rv_language').css('right',0);
  89.             setTimeout(function () {
  90.                 $('.rv_language').css('right','-200px');
  91.             },5000);
  92.         });
  93.         if($('.system_popup').length){
  94.             $(".system_popup").click();
  95.         }
  96.     });
  97.     function formKayit(adi){
  98.         var hata = 0;
  99.         var eHata = 0;
  100.         var inputSayi = $('.'+adi+' input[type=text]').length;
  101.         for(var i=0;i<inputSayi;i++){
  102.             if ($('.'+adi+' input[type=text]:eq('+i+')').prop('required')==true){
  103.                 if ($('.'+adi+' input[type=text]:eq('+i+')').val()==''){
  104.                     hata++;
  105.                 }
  106.             }
  107.         }
  108.         var emailSayi = $('.'+adi+' input[type=email]').length;
  109.         for(var i=0;i<emailSayi;i++){
  110.             if ($('.'+adi+' input[type=email]:eq('+i+')').prop('required')==true){
  111.                 if (($('.'+adi+' input[type=email]:eq('+i+')').val()=='') || (!checkEmail($('.'+adi+' input[type=email]:eq('+i+')').val()))){
  112.                     eHata++;
  113.                 }
  114.             }else{
  115.                 if($('.'+adi+' input[type=email]:eq('+i+')').val()!=''){
  116.                     if(!checkEmail($('.'+adi+' input[type=email]:eq('+i+')').val())){
  117.                         eHata++;
  118.                     }
  119.                 }
  120.             }
  121.         }
  122.         var txtSayi = $('.'+adi+' textarea').length;
  123.         for(var i=0;i<txtSayi;i++){
  124.             if ($('.'+adi+' textarea:eq('+i+')').prop('required')==true){
  125.                 if ($('.'+adi+' textarea:eq('+i+')').val()==''){
  126.                     hata++;
  127.                 }
  128.             }
  129.         }
  130.         var selectSayi = $('.'+adi+' select').length;
  131.         for(var i=0;i<selectSayi;i++){
  132.             if ($('.'+adi+' select:eq('+i+')').prop('required')==true){
  133.                 if ($('.'+adi+' select:eq('+i+')').val()==''){
  134.                     hata++;
  135.                 }
  136.             }
  137.         }
  138.         var fileSayi = $('.'+adi+' input[type=file]').length;
  139.         for(var i=0;i<fileSayi;i++){
  140.             if ($('.'+adi+' input[type=file]:eq('+i+')').prop('required')==true){
  141.                 var fileId = $('.'+adi+' input[type=file]:eq('+i+')').attr('id');
  142.                 if (document.getElementById(fileId).files[0]==undefined){
  143.                     hata++;
  144.                 }
  145.             }
  146.         }
  147.         var checkSayi = $('.'+adi+' input[type=checkbox]').length;
  148.         for(var i=0;i<checkSayi;i++){
  149.             checkClass = $('.'+adi+' input[type=checkbox]:eq('+i+')').attr('class');
  150.             var icCheckEdilen = 0;
  151.             var icCheckSayi = $('.'+adi+' .'+checkClass).length;
  152.             if ($('.'+adi+' .'+checkClass+':eq(0)').prop('required')==true) {
  153.                 for(var y=0;y<icCheckSayi;y++){
  154.                     if($('.'+adi+' .'+checkClass+':eq('+y+')').prop('checked')==true){
  155.                         icCheckEdilen++;
  156.                     }
  157.                 }
  158.                 if(icCheckEdilen==0){
  159.                     hata++;
  160.                 }
  161.             }
  162.         }
  163.         var radioSayi = $('.'+adi+' input[type=radio]').length;
  164.         for(var i=0;i<radioSayi;i++){
  165.             radioClass = $('.'+adi+' input[type=radio]:eq('+i+')').attr('class');
  166.             var icRadioEdilen = 0;
  167.             var icRadioSayi = $('.'+adi+' .'+radioClass).length;
  168.             if ($('.'+adi+' .'+radioClass+':eq(0)').prop('required')==true) {
  169.                 for(var y=0;y<icRadioSayi;y++){
  170.                     if($('.'+adi+' .'+radioClass+':eq('+y+')').prop('checked')==true){
  171.                         icRadioEdilen++;
  172.                     }
  173.                 }
  174.                 if(icRadioEdilen==0){
  175.                     hata++;
  176.                 }
  177.             }
  178.         }
  179.         if(hata>0){
  180.             $('.hata_'+adi).html('<div class="alert alert-danger">{{ 'Lütfen zorunlu alanları doldurunuz.'|ceviri }}</div>');
  181.             return false;
  182.         }
  183.         if(eHata>0){
  184.             $('.hata_'+adi).html('<div class="alert alert-danger">{{ 'Mail adresiniz geçersiz veya boş bırakılmış.'|ceviri }}</div>');
  185.             return false;
  186.         }
  187.         $('.'+adi+' .formBtn').html('<img src="{{ asset('assets/img/loading.svg') }}" width="22px">');
  188.         $('.'+adi+' .formBtn').prop('disabled',true);
  189.         $('.'+adi).submit();
  190.     }
  191. </script>
  192. {{ 'ozelHead'|ayarlar|default('')|raw }}
  193. {% if 'whatsapp'|ayarlar==1 %}
  194.     <script type="text/javascript">
  195.         (function () {
  196.             var options = {
  197.                 whatsapp: "+9{{ 'gsm'|site_iletisimBilgileri|replace({'(':'',')':'',' ':''}) }}", // WhatsApp numaranızı buraya girin
  198.                 call_to_action: "{{ 'Merhaba, nasıl yardımcı olabilirim?'|ceviri }}", // Görünecek metin
  199.                 position: "right", // Position may be 'right' or 'left'
  200.             };
  201.             var proto = document.location.protocol, host = "whatshelp.io", url = proto + "//static." + host;
  202.             var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url + '/widget-send-button/js/init.js';
  203.             s.onload = function () { WhWidgetSendButton.init(host, proto, options); };
  204.             var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
  205.         })();
  206.     </script>
  207. {% endif %}