فهرست منبع

#5102 Upgrade PhotoSwipe to v.5

Alex Trofimov 1 سال پیش
والد
کامیت
b406bd367e
2فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 1 0
      inc/classes/BxDolTemplate.php
  2. 6 0
      inc/js/functions.js

+ 1 - 0
inc/classes/BxDolTemplate.php

@@ -693,6 +693,7 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
 
         $this->addJsOption('sys_fixed_header');
         $this->addJsOption('sys_confirmation_before_redirect');
+        $this->addJsOption('sys_storage_s3_endpoint');
     }
     
     protected function initImages()

+ 6 - 0
inc/js/functions.js

@@ -1670,12 +1670,18 @@ function bx_redirect_for_external_links (e)
     $(aExclude).each(function () {
         sPattern += ':not([href^="' + this + '"])';
     });
+    if ('undefined' !== typeof(aDolOptions.sys_storage_s3_endpoint) && aDolOptions.sys_storage_s3_endpoint.length)
+        sPattern += ':not([href^="https://' + aDolOptions.sys_storage_s3_endpoint + '"])';
+
     sPattern += ":is([href^='http://'],[href^='https://'])";
 
     if ('undefined' === typeof(e))
         e = $('document');
 
     e.find(sPattern).each(function() {
+        if ($(this).attr('href').match(/s3\.amazonaws\.com/))
+            return;
+            
         $(this).on('contextmenu', function(e) {
             e.preventDefault();
         });