WP Offload S3 Lite - Version 2.4

Version Description

= 2.3 = This is a major upgrade that switches to using a custom table for storing data about offloaded Media Library items. Once upgraded you will not be able to downgrade without restoring data from a backup.

= 2.0 = This is a major upgrade that introduces support for DigitalOcean Spaces, renames the plugin to WP Offload Media Lite, and coincidentally upgrades some of its database settings. You may not be able to downgrade to WP Offload S3 Lite 1.x after upgrading to WP Offload Media Lite 2.0+.

= 1.1 = This is a major change, which ensures S3 URLs are no longer saved in post content. Instead, local URLs are filtered on page generation and replaced with the S3 version. If you depend on the S3 URLs being stored in post content you will need to make modifications to support this version.

= 0.6 = This version requires PHP 5.3.3+ and the Amazon Web Services plugin

Download this release

Release Info

Developer deliciousbrains
Plugin Icon 128x128 WP Offload S3 Lite
Version 2.4
Comparing to
See all releases

Code changes from version 2.3.2 to 2.4

Files changed (147) hide show
  1. README.md +31 -3
  2. assets/css/delivery-provider.css +1 -0
  3. assets/css/media.css +1 -1
  4. assets/css/styles.css +1 -1
  5. assets/js/delivery-provider.js +89 -0
  6. assets/js/delivery-provider.min.js +1 -0
  7. assets/js/script.js +174 -14
  8. assets/js/script.min.js +1 -1
  9. assets/sass/delivery-provider.scss +28 -0
  10. assets/sass/media.scss +93 -1
  11. assets/sass/styles.scss +209 -14
  12. classes/amazon-s3-and-cloudfront.php +1031 -444
  13. classes/as3cf-filter.php +6 -6
  14. classes/as3cf-notices.php +1 -2
  15. classes/as3cf-plugin-base.php +38 -0
  16. classes/as3cf-plugin-compatibility.php +20 -17
  17. classes/as3cf-utils.php +140 -6
  18. classes/filters/as3cf-local-to-s3.php +64 -29
  19. classes/filters/as3cf-s3-to-local.php +21 -1
  20. classes/items/item.php +33 -8
  21. classes/items/media-library-item.php +96 -27
  22. classes/providers/delivery/another-cdn.php +49 -0
  23. classes/providers/delivery/aws-cloudfront.php +112 -0
  24. classes/providers/delivery/cloudflare.php +62 -0
  25. classes/providers/delivery/delivery-provider.php +428 -0
  26. classes/providers/delivery/digitalocean-spaces-cdn.php +85 -0
  27. classes/providers/delivery/gcp-cdn.php +75 -0
  28. classes/providers/delivery/keycdn.php +62 -0
  29. classes/providers/delivery/other.php +61 -0
  30. classes/providers/delivery/stackpath.php +62 -0
  31. classes/providers/delivery/storage.php +103 -0
  32. classes/providers/provider.php +38 -865
  33. classes/providers/{aws-provider.php → storage/aws-provider.php} +178 -79
  34. classes/providers/{digitalocean-provider.php → storage/digitalocean-provider.php} +17 -1
  35. classes/providers/{gcp-provider.php → storage/gcp-provider.php} +91 -50
  36. classes/providers/{null-provider.php → storage/null-provider.php} +1 -1
  37. classes/providers/storage/storage-provider.php +958 -0
  38. classes/providers/{streams → storage/streams}/aws-s3-stream-wrapper.php +30 -12
  39. classes/providers/{streams → storage/streams}/gcp-gcs-stream-wrapper.php +1 -2
  40. classes/upgrades/upgrade-filter-post.php +4 -4
  41. classes/upgrades/upgrade-items-table.php +2 -2
  42. classes/upgrades/upgrade.php +25 -0
  43. include/functions.php +34 -10
  44. languages/amazon-s3-and-cloudfront-en.pot +436 -183
  45. readme.txt +31 -3
  46. vendor/Aws3/Aws/AbstractConfigurationProvider.php +133 -0
  47. vendor/Aws3/Aws/Api/ApiProvider.php +1 -1
  48. vendor/Aws3/Aws/Api/DocModel.php +1 -1
  49. vendor/Aws3/Aws/Api/ErrorParser/AbstractErrorParser.php +69 -0
  50. vendor/Aws3/Aws/Api/ErrorParser/JsonParserTrait.php +8 -0
  51. vendor/Aws3/Aws/Api/ErrorParser/JsonRpcErrorParser.php +12 -2
  52. vendor/Aws3/Aws/Api/ErrorParser/RestJsonErrorParser.php +15 -2
  53. vendor/Aws3/Aws/Api/ErrorParser/XmlErrorParser.php +34 -14
  54. vendor/Aws3/Aws/Api/Parser/AbstractRestParser.php +13 -3
  55. vendor/Aws3/Aws/Api/Parser/DecodingEventStreamIterator.php +1 -1
  56. vendor/Aws3/Aws/Api/Parser/Exception/ParserException.php +23 -0
  57. vendor/Aws3/Aws/Api/Parser/MetadataParserTrait.php +74 -0
  58. vendor/Aws3/Aws/Api/Parser/PayloadParserTrait.php +1 -1
  59. vendor/Aws3/Aws/Api/Parser/XmlParser.php +16 -0
  60. vendor/Aws3/Aws/Api/Serializer/RestJsonSerializer.php +1 -1
  61. vendor/Aws3/Aws/Api/Serializer/RestSerializer.php +5 -0
  62. vendor/Aws3/Aws/Api/Serializer/XmlBody.php +1 -1
  63. vendor/Aws3/Aws/Api/Service.php +20 -2
  64. vendor/Aws3/Aws/Api/ShapeMap.php +3 -1
  65. vendor/Aws3/Aws/Api/Validator.php +11 -1
  66. vendor/Aws3/Aws/Arn/AccessPointArn.php +67 -0
  67. vendor/Aws3/Aws/Arn/Arn.php +112 -0
  68. vendor/Aws3/Aws/Arn/ArnInterface.php +30 -0
  69. vendor/Aws3/Aws/Arn/ArnParser.php +39 -0
  70. vendor/Aws3/Aws/Arn/Exception/InvalidArnException.php +10 -0
  71. vendor/Aws3/Aws/Arn/ResourceTypeAndIdTrait.php +32 -0
  72. vendor/Aws3/Aws/Arn/S3/AccessPointArn.php +25 -0
  73. vendor/Aws3/Aws/AwsClient.php +63 -6
  74. vendor/Aws3/Aws/AwsClientTrait.php +9 -2
  75. vendor/Aws3/Aws/ClientResolver.php +49 -4
  76. vendor/Aws3/Aws/ClientSideMonitoring/AbstractMonitoringMiddleware.php +12 -3
  77. vendor/Aws3/Aws/ClientSideMonitoring/Configuration.php +12 -2
  78. vendor/Aws3/Aws/ClientSideMonitoring/ConfigurationInterface.php +7 -1
  79. vendor/Aws3/Aws/ClientSideMonitoring/ConfigurationProvider.php +33 -124
  80. vendor/Aws3/Aws/CloudFront/CloudFrontClient.php +171 -0
  81. vendor/Aws3/Aws/CloudFront/CookieSigner.php +57 -0
  82. vendor/Aws3/Aws/CloudFront/Exception/CloudFrontException.php +11 -0
  83. vendor/Aws3/Aws/CloudFront/Signer.php +99 -0
  84. vendor/Aws3/Aws/CloudFront/UrlSigner.php +95 -0
  85. vendor/Aws3/Aws/Command.php +3 -0
  86. vendor/Aws3/Aws/ConfigurationProviderInterface.php +14 -0
  87. vendor/Aws3/Aws/Credentials/AssumeRoleWithWebIdentityCredentialProvider.php +100 -0
  88. vendor/Aws3/Aws/Credentials/CredentialProvider.php +218 -35
  89. vendor/Aws3/Aws/Credentials/EcsCredentialProvider.php +4 -1
  90. vendor/Aws3/Aws/Credentials/InstanceProfileProvider.php +109 -10
  91. vendor/Aws3/Aws/Crypto/DecryptionTrait.php +4 -3
  92. vendor/Aws3/Aws/Crypto/EncryptionTrait.php +1 -1
  93. vendor/Aws3/Aws/Endpoint/Partition.php +43 -5
  94. vendor/Aws3/Aws/Endpoint/PartitionEndpointProvider.php +22 -3
  95. vendor/Aws3/Aws/EndpointDiscovery/Configuration.php +39 -0
  96. vendor/Aws3/Aws/EndpointDiscovery/ConfigurationInterface.php +29 -0
  97. vendor/Aws3/Aws/EndpointDiscovery/ConfigurationProvider.php +170 -0
  98. vendor/Aws3/Aws/EndpointDiscovery/EndpointDiscoveryMiddleware.php +240 -0
  99. vendor/Aws3/Aws/EndpointDiscovery/EndpointList.php +80 -0
  100. vendor/Aws3/Aws/EndpointDiscovery/Exception/ConfigurationException.php +13 -0
  101. vendor/Aws3/Aws/EndpointParameterMiddleware.php +4 -0
  102. vendor/Aws3/Aws/Exception/AwsException.php +19 -3
  103. vendor/Aws3/Aws/Exception/IncalculablePayloadException.php +10 -0
  104. vendor/Aws3/Aws/Exception/InvalidJsonException.php +10 -0
  105. vendor/Aws3/Aws/Exception/InvalidRegionException.php +10 -0
  106. vendor/Aws3/Aws/Handler/GuzzleV5/GuzzleHandler.php +4 -4
  107. vendor/Aws3/Aws/MultiRegionClient.php +2 -0
  108. vendor/Aws3/Aws/Multipart/AbstractUploadManager.php +21 -7
  109. vendor/Aws3/Aws/Psr16CacheAdapter.php +26 -0
  110. vendor/Aws3/Aws/ResponseContainerInterface.php +1 -0
  111. vendor/Aws3/Aws/RetryMiddleware.php +6 -0
  112. vendor/Aws3/Aws/S3/BucketEndpointArnMiddleware.php +200 -0
  113. vendor/Aws3/Aws/S3/MultipartCopy.php +7 -1
  114. vendor/Aws3/Aws/S3/MultipartUploader.php +1 -1
  115. vendor/Aws3/Aws/S3/ObjectCopier.php +9 -0
  116. vendor/Aws3/Aws/S3/ObjectUploader.php +3 -2
  117. vendor/Aws3/Aws/S3/PutObjectUrlMiddleware.php +1 -1
  118. vendor/Aws3/Aws/S3/RegionalEndpoint/Configuration.php +29 -0
  119. vendor/Aws3/Aws/S3/RegionalEndpoint/ConfigurationInterface.php +22 -0
  120. vendor/Aws3/Aws/S3/RegionalEndpoint/ConfigurationProvider.php +158 -0
  121. vendor/Aws3/Aws/S3/RegionalEndpoint/Exception/ConfigurationException.php +13 -0
  122. vendor/Aws3/Aws/S3/S3Client.php +85 -4
  123. vendor/Aws3/Aws/S3/S3ClientInterface.php +2 -2
  124. vendor/Aws3/Aws/S3/S3EndpointMiddleware.php +1 -1
  125. vendor/Aws3/Aws/S3/S3MultiRegionClient.php +1 -1
  126. vendor/Aws3/Aws/S3/S3UriParser.php +20 -1
  127. vendor/Aws3/Aws/S3/StreamWrapper.php +13 -6
  128. vendor/Aws3/Aws/S3/Transfer.php +5 -2
  129. vendor/Aws3/Aws/S3/UseArnRegion/Configuration.php +31 -0
  130. vendor/Aws3/Aws/S3/UseArnRegion/ConfigurationInterface.php +19 -0
  131. vendor/Aws3/Aws/S3/UseArnRegion/ConfigurationProvider.php +141 -0
  132. vendor/Aws3/Aws/S3/UseArnRegion/Exception/ConfigurationException.php +13 -0
  133. vendor/Aws3/Aws/Sdk.php +113 -1
  134. vendor/Aws3/Aws/Signature/AnonymousSignature.php +1 -1
  135. vendor/Aws3/Aws/Signature/SignatureInterface.php +1 -1
  136. vendor/Aws3/Aws/StreamRequestPayloadMiddleware.php +67 -0
  137. vendor/Aws3/Aws/WrappedHttpHandler.php +1 -1
  138. vendor/Aws3/Aws/data/accessanalyzer/2019-11-01/api-2.json.php +4 -0
  139. vendor/Aws3/Aws/data/accessanalyzer/2019-11-01/paginators-1.json.php +4 -0
  140. vendor/Aws3/Aws/data/acm-pca/2017-08-22/api-2.json.php +1 -1
  141. vendor/Aws3/Aws/data/acm-pca/2017-08-22/paginators-1.json.php +1 -1
  142. vendor/Aws3/Aws/data/acm-pca/2017-08-22/waiters-2.json.php +1 -1
  143. vendor/Aws3/Aws/data/acm/2015-12-08/api-2.json.php +1 -1
  144. vendor/Aws3/Aws/data/alexaforbusiness/2017-11-09/api-2.json.php +1 -1
  145. vendor/Aws3/Aws/data/alexaforbusiness/2017-11-09/paginators-1.json.php +1 -1
  146. vendor/Aws3/Aws/data/aliases.json.php +4 -0
  147. vendor/Aws3/Aws/data/amplify/2017-07-25/api-2.json.php +1 -1
README.md CHANGED
@@ -2,9 +2,9 @@
2
  **Contributors:** bradt, deliciousbrains, ianmjones
3
  **Tags:** uploads, amazon, s3, amazon s3, digitalocean, digitalocean spaces, google cloud storage, gcs, mirror, admin, media, cdn, cloudfront
4
  **Requires at least:** 4.9
5
- **Tested up to:** 5.4
6
  **Requires PHP:** 5.5
7
- **Stable tag:** 2.3.2
8
  **License:** GPLv3
9
 
10
  Copies files to Amazon S3, DigitalOcean Spaces or Google Cloud Storage as they are uploaded to the Media Library. Optionally configure Amazon CloudFront or another CDN for faster delivery.
@@ -32,7 +32,7 @@ Although WP Offload Media doesn't include image optimization features, we work c
32
  * [Assets Pull addon](https://deliciousbrains.com/wp-offload-media/?utm_campaign=WP%2BOffload%2BS3&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=assets%2Baddon#addons) - Serve your CSS, JS and fonts via CloudFront or another CDN
33
  * [WooCommerce integration](https://deliciousbrains.com/wp-offload-media/?utm_campaign=WP%2BOffload%2BS3&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=woocommerce%2Baddon#integrations)
34
  * [Easy Digital Downloads integration](https://deliciousbrains.com/wp-offload-media/?utm_campaign=WP%2BOffload%2BS3&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=edd%2Baddon#integrations)
35
- * PriorityExpert™ email support
36
 
37
  [Compare pro vs free →](https://deliciousbrains.com/wp-offload-media/upgrade/?utm_campaign=WP%2BOffload%2BS3&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting)
38
 
@@ -89,6 +89,34 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin
89
 
90
  ## Changelog ##
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  ### WP Offload Media Lite 2.3.2 - 2019-12-09 ###
93
  * Improvement: Reduced database queries when external object cache available
94
  * Bug fix: Uncaught Error: Call to undefined function DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\choose_handler()
2
  **Contributors:** bradt, deliciousbrains, ianmjones
3
  **Tags:** uploads, amazon, s3, amazon s3, digitalocean, digitalocean spaces, google cloud storage, gcs, mirror, admin, media, cdn, cloudfront
4
  **Requires at least:** 4.9
5
+ **Tested up to:** 5.5
6
  **Requires PHP:** 5.5
7
+ **Stable tag:** 2.4
8
  **License:** GPLv3
9
 
10
  Copies files to Amazon S3, DigitalOcean Spaces or Google Cloud Storage as they are uploaded to the Media Library. Optionally configure Amazon CloudFront or another CDN for faster delivery.
32
  * [Assets Pull addon](https://deliciousbrains.com/wp-offload-media/?utm_campaign=WP%2BOffload%2BS3&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=assets%2Baddon#addons) - Serve your CSS, JS and fonts via CloudFront or another CDN
33
  * [WooCommerce integration](https://deliciousbrains.com/wp-offload-media/?utm_campaign=WP%2BOffload%2BS3&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=woocommerce%2Baddon#integrations)
34
  * [Easy Digital Downloads integration](https://deliciousbrains.com/wp-offload-media/?utm_campaign=WP%2BOffload%2BS3&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=edd%2Baddon#integrations)
35
+ * Priority email support
36
 
37
  [Compare pro vs free →](https://deliciousbrains.com/wp-offload-media/upgrade/?utm_campaign=WP%2BOffload%2BS3&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting)
38
 
89
 
90
  ## Changelog ##
91
 
92
+ ### WP Offload Media Lite 2.4 - 2020-07-14 ###
93
+ * [Release Summary Blog Post](https://deliciousbrains.com/wp-offload-media-2-4-released/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting)
94
+ * New: Setting to choose a Delivery Provider (i.e. S3, CloudFront, another CDN)
95
+ * New: Support for Block All Public Access setting on S3 buckets
96
+ * New: Raw S3 URLs use bucket in domain rather than path where possible as per changes required by AWS
97
+ * New: Raw S3 URLs use dot rather than dash between s3 and region name as per changes required by AWS
98
+ * New: Added S3 regions for Africa (Cape Town), Asia Pacific (Hong Kong), EU (Milan), EU (Stockholm), and Middle East (Bahrain)
99
+ * New: Added GCS regions for Salt Lake City, Las Vegas, Zürich, Osaka, Seoul, EUR4 (dual-region), and NAM4 (dual-region)
100
+ * Improvement: Updated AWS PHP SDK to v3.133.40
101
+ * Improvement: Updated Google Cloud Storage SDK to v1.18.0
102
+ * Improvement: S3 regions for China no longer hidden (configuration via AWS Console still required)
103
+ * Bug fix: Private images not showing in grid mode Media page overlay
104
+ * Bug fix: Public image thumbnails not showing in grid mode Media page when original is private
105
+ * Bug fix: URL rewriting sometimes fails for sites hosted on Windows
106
+ * Bug fix: URL rewrite fails for image when original upload has size in file name
107
+ * Bug fix: External URLs rewritten to local URLs when they shouldn't
108
+ * Bug fix: StreamWrappers don't work with private buckets
109
+ * Bug fix: Database error when inserting media library item and using HyperDB
110
+ * Bug fix: S3 bucket link in settings no longer goes direct to bucket contents
111
+ * Bug fix: New uploads slow with very large Media Library
112
+ * Bug fix: Migration to custom table very slow with large postmeta tables
113
+ * Bug fix: Signed GCS URLs have incorrect expires value
114
+ * Bug fix: The use-server-roles AS3CF_SETTINGS value is not properly reflected in Diagnostic Info
115
+ * Bug fix: Unknown column '2019/12/some-file-name.pdf' in 'where clause' when using managed MySQL on DigitalOcean
116
+ * Bug fix: WordPress database error Expression #1 of ORDER BY clause is not in SELECT list when using MySQL8
117
+ * Bug fix: WordPress forces HTTP in Edit Media page if site is not HTTPS, breaking remote URLs that require HTTPS
118
+ * Tested: WordPress 5.5
119
+
120
  ### WP Offload Media Lite 2.3.2 - 2019-12-09 ###
121
  * Improvement: Reduced database queries when external object cache available
122
  * Bug fix: Uncaught Error: Call to undefined function DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\choose_handler()
assets/css/delivery-provider.css ADDED
@@ -0,0 +1 @@
 
1
+ .as3cf-delivery-provider-select .as3cf-delivery-provider-select-options{margin-bottom:30px}.as3cf-delivery-provider-select .as3cf-delivery-provider-select-options .as3cf-delivery-provider-sub-option{margin-left:25px}.as3cf-delivery-provider-select .as3cf-delivery-provider-select-options .as3cf-delivery-provider-sub-option .as3cf-setting{display:none;margin-left:25px}.as3cf-delivery-provider-select .as3cf-delivery-provider-select-options .as3cf-delivery-provider-sub-option.selected .as3cf-setting{display:block}.as3cf-delivery-provider-select .as3cf-delivery-provider-select-options .as3cf-delivery-provider-sub-option-container>.as3cf-delivery-provider-sub-option{display:none}.as3cf-delivery-provider-select .as3cf-delivery-provider-select-options .as3cf-delivery-provider-sub-option-container.selected>.as3cf-delivery-provider-sub-option{display:block}
assets/css/media.css CHANGED
@@ -1 +1 @@
1
- body.as3cf-pro .attachments-browser .media-toolbar-secondary{max-width:100%}.as3cfpro_remove a.local-warning{color:#a00}.as3cfpro_remove a.local-warning:hover{color:#f00;text-decoration:none;border:none}.media-modal a.local-warning{color:#bc0b0b}.media-modal a.local-warning:hover{color:red}.attachment-info .attachment-s3-details{font-weight:bold;margin-bottom:5px}
1
+ body.as3cf-pro .media-toolbar-mode-select{overflow:visible}body.as3cf-pro .attachments-browser .media-toolbar-secondary{max-width:100%}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons{margin-right:10px;position:relative;display:none !important}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons.visible{display:inline-block !important}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons .button{margin:0;text-align:left}@media screen and (max-width: 782px){body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons .button{min-height:40px}}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons__action-default{width:-webkit-calc(100% - 32px);width:calc(100% - 32px);position:relative;z-index:2}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons__toggle{width:32px;position:relative;border-left:1px solid rgba(255,255,255,0.2);z-index:2}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons__toggle:focus{-webkit-box-shadow:none;box-shadow:none}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons__toggle::after{content:'';display:inline-block;width:0;height:0;vertical-align:0.255em;border-top:0.3em solid;border-right:0.3em solid transparent;border-bottom:0;border-left:0.3em solid transparent;-webkit-transition:0.2s all ease;transition:0.2s all ease}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons__toggle.opened::after{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons__submenu{position:absolute;left:0;top:0;z-index:1;-webkit-transform:translateY(33px);-ms-transform:translateY(33px);transform:translateY(33px);border-radius:3px;overflow:hidden;-webkit-box-shadow:0 2px 5px 2px rgba(0,0,0,0.3);box-shadow:0 2px 5px 2px rgba(0,0,0,0.3)}@media screen and (max-width: 782px){body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons__submenu{-webkit-transform:translateY(41px);-ms-transform:translateY(41px);transform:translateY(41px)}}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons__action{display:block;width:100%;margin:0;border-radius:0;-moz-text-align-last:left;text-align-last:left;border:none;border-bottom:1px solid rgba(255,255,255,0.2)}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons__action:last-child{border:none}body.as3cf-pro .attachments-browser .media-toolbar-secondary .offload-buttons__action:focus{-webkit-box-shadow:none;box-shadow:none}.as3cfpro_remove a.local-warning{color:#a00}.as3cfpro_remove a.local-warning:hover{color:#f00;text-decoration:none;border:none}.media-modal a.local-warning{color:#bc0b0b}.media-modal a.local-warning:hover{color:red}.attachment-info .attachment-s3-details{font-weight:bold;margin-bottom:5px}
assets/css/styles.css CHANGED
@@ -1 +1 @@
1
- .as3cf-content,.as3cf-updated,.as3cf-compatibility-notice{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:650px}.settings_page_amazon-s3-and-cloudfront .error,.settings_page_amazon-s3-and-cloudfront .notice,.settings_page_amazon-s3-and-cloudfront .updated{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:650px}.as3cf-main.wrap{position:relative}.as3cf-main.wrap>h1{float:left}.as3cf-main.wrap .as3cf-notice,.as3cf-main.wrap .as3cf-updated,.as3cf-main.wrap .as3cf-error{-webkit-box-sizing:border-box;box-sizing:border-box}.as3cf-main.wrap .as3cf-error.fatal{clear:both}.as3cf-main.wrap h2.nav-tab-wrapper{float:none;margin-bottom:15px;width:650px;margin-top:10px;padding:9px 0 0 5px}.as3cf-main.wrap h2.nav-tab-wrapper .nav-tab-container{float:right}.as3cf-main.wrap h2.nav-tab-wrapper .nav-tab-container :last-child{margin-right:5px}.as3cf-main.wrap h2.nav-tab-wrapper a.nav-tab-active{color:#464646;cursor:default}.as3cf-main.wrap h2.nav-tab-wrapper a:focus{-webkit-box-shadow:none;box-shadow:none}.as3cf-main.wrap .more-info{white-space:nowrap}.as3cf-main.wrap .error pre{background:#eaeaea;background:rgba(0,0,0,0.07);display:block;padding:10px 15px}.as3cf-main.wrap .error pre code{padding:0;background:none}.as3cf-main.wrap[data-tab="support"] .as3cf-notice,.as3cf-main.wrap[data-tab="support"] .error,.as3cf-main.wrap[data-tab="support"] .updated,.as3cf-main.wrap[data-tab="support"] .updated.show{display:none}.as3cf-main.wrap[data-tab="support"] .fatal .error,.as3cf-main.wrap[data-tab="support"] .as3cf-notice.important,.as3cf-main.wrap[data-tab="support"] .dbrains-api-down{display:block}.as3cf-main.wrap .as3cf-notice,.as3cf-main.wrap .error,.as3cf-main.wrap .updated{max-width:650px;margin-top:15px;-webkit-box-sizing:border-box;box-sizing:border-box}.as3cf-main.wrap .as3cf-updated{display:none}.as3cf-main.wrap .as3cf-updated.as3cf-notice,.as3cf-main.wrap .as3cf-updated.show{display:block}.as3cf-main.wrap .alignleft{margin-right:20px;margin-bottom:20px}.as3cf-main.wrap .spinner{min-width:20px}.as3cf-tab .as3cf-main-settings .as3cf-provider-select{display:none}.as3cf-tab .as3cf-main-settings .as3cf-bucket-container{display:none}.as3cf-tab .as3cf-main-settings .as3cf-bucket-container a.as3cf-change-provider{display:none}.as3cf-tab .as3cf-main-settings .as3cf-media-settings{display:none}.as3cf-tab.as3cf-needs-access-keys .as3cf-can-write-error,.as3cf-tab.as3cf-has-access-keys.as3cf-change-provider .as3cf-can-write-error{display:none}.as3cf-tab.as3cf-needs-access-keys .as3cf-main-settings .as3cf-provider-select,.as3cf-tab.as3cf-has-access-keys.as3cf-change-provider .as3cf-main-settings .as3cf-provider-select{display:block}.as3cf-tab.as3cf-needs-access-keys .as3cf-main-settings .as3cf-bucket-container,.as3cf-tab.as3cf-has-access-keys.as3cf-change-provider .as3cf-main-settings .as3cf-bucket-container{display:none}.as3cf-tab.as3cf-needs-access-keys .as3cf-main-settings .as3cf-media-settings,.as3cf-tab.as3cf-has-access-keys.as3cf-change-provider .as3cf-main-settings .as3cf-media-settings{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider) .as3cf-can-write-error,.as3cf-tab.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) .as3cf-can-write-error{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-provider-select,.as3cf-tab.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-provider-select{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-bucket-container,.as3cf-tab.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-bucket-container{display:block}.as3cf-tab.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-media-settings,.as3cf-tab.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-media-settings{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket:not(.as3cf-change-provider):not(.as3cf-change-bucket) .as3cf-main-settings .as3cf-provider-select{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket:not(.as3cf-change-provider):not(.as3cf-change-bucket) .as3cf-main-settings .as3cf-bucket-container{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket:not(.as3cf-change-provider):not(.as3cf-change-bucket) .as3cf-main-settings .as3cf-media-settings{display:block}.as3cf-content>section{margin-bottom:20px}.as3cf-content>section+section.as3cf-access-keys{padding-top:20px;border-top:1px solid #d3d3d3}.as3cf-content>section+section.as3cf-access-keys .as3cf-section-heading{margin-top:0}.as3cf-tab{display:none;position:relative;width:650px}.as3cf-tab .as3cf-main-settings p{font-size:13px}.as3cf-tab .as3cf-main-settings p a{color:#444}.as3cf-tab .object-prefix-desc em{white-space:nowrap}.as3cf-tab .as3cf-url-preview-wrap{background:#fff;text-align:center;padding:20px 0 0;max-width:650px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.as3cf-tab .as3cf-url-preview-wrap .as3cf-url-preview{margin-top:10px;padding:0 20px 10px;overflow-x:scroll}.as3cf-tab .as3cf-url-preview-wrap span{color:#aaa;text-transform:uppercase;font-weight:bold}.as3cf-tab .as3cf-radio-group label{display:block;margin-bottom:10px}.as3cf-tab .as3cf-radio-group label.disabled,.as3cf-tab .as3cf-radio-group label.disabled p{color:#bbb;cursor:default}.as3cf-tab .as3cf-radio-group p{padding-left:25px;color:#6b6b6b;margin:0;font-size:12px}.as3cf-tab .as3cf-radio-group p.as3cf-setting{margin-top:5px}.as3cf-tab .as3cf-switch{position:relative;display:inline-block;padding:2px;overflow:hidden;border-radius:2px;background-color:#d4d3d3;cursor:pointer}.as3cf-tab .as3cf-switch.on{background-color:#ade7b5}.as3cf-tab .as3cf-switch span{visibility:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;float:left;display:inline-block;height:100%;font-size:12px;line-height:20px;border-radius:2px;font-weight:bold;padding:4px 8px;background:#fff;color:#8d8d8d;z-index:1}.as3cf-tab .as3cf-switch span.on{color:#82d78b}.as3cf-tab .as3cf-switch span.checked{visibility:visible}.as3cf-tab .as3cf-switch.disabled{cursor:default;background:#e6e6e6}.as3cf-tab .as3cf-switch.disabled span{background:#f1f1f1;color:#d6d6d6}.as3cf-tab .as3cf-switch input[type="checkbox"]{position:absolute !important;top:0;left:0;opacity:0;filter:alpha(opacity=0);z-index:-1}.as3cf-tab .as3cf-setting.hide{display:none}.as3cf-tab div.as3cf-setting{margin-top:4px}.as3cf-tab h3{font-weight:normal;text-transform:uppercase}.as3cf-tab .form-table{margin:0}.as3cf-tab .form-table tr.as3cf-border-bottom td{border-bottom:1px solid #ddd;padding:20px 0px}.as3cf-tab .form-table tr.as3cf-setting-title td{padding-bottom:0}.as3cf-tab .form-table tr.as3cf-setting-title:first-child td{padding-top:20px}.as3cf-tab .form-table tr.configure-url:first-child td{padding-top:5px;padding-bottom:0}.as3cf-tab .form-table tr td{padding:15px 0}.as3cf-tab .form-table tr td:first-child{vertical-align:top;min-width:120px;padding-top:20px}.as3cf-tab .form-table tr td .as3cf-notice:last-child{margin-bottom:0}.as3cf-tab .form-table tr td>p:first-child{margin-top:0}.as3cf-tab .form-table h3{padding:0;margin:0}.as3cf-tab .form-table h4{margin:0}.as3cf-tab .as3cf-active-region{font-style:italic}.as3cf-tab .as3cf-view-bucket{color:#444;text-decoration:none;margin-right:10px}.as3cf-tab .as3cf-view-bucket:hover,.as3cf-tab .as3cf-view-bucket:active{color:#00a0d2}.as3cf-tab .as3cf-view-bucket:focus{-webkit-box-shadow:none;box-shadow:none}.as3cf-tab .as3cf-view-bucket .dashicons-external{margin-top:-2px}.as3cf-tab .tooltip{position:relative;z-index:2;cursor:pointer}.as3cf-tab .tooltip:before,.as3cf-tab .tooltip:after{visibility:hidden;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);opacity:0;pointer-events:none}.as3cf-tab .tooltip:before{position:absolute;bottom:150%;left:50%;margin-bottom:5px;margin-left:-250px;padding:10px;width:500px;border-radius:3px;background-color:#000;background-color:rgba(51,51,51,0.9);color:#fff;content:attr(data-tooltip);text-align:center;font-size:14px;line-height:1.3}.as3cf-tab .tooltip:after{position:absolute;bottom:150%;left:50%;margin-left:-5px;width:0;border-top:5px solid #000;border-top:5px solid rgba(51,51,51,0.9);border-right:5px solid transparent;border-left:5px solid transparent;content:" ";font-size:0;line-height:0}.as3cf-tab .tooltip:hover:before,.as3cf-tab .tooltip:hover:after{visibility:visible;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);opacity:1}.as3cf-tab .as3cf-defined-in-config{background:#ccc;color:#fff;padding:2px 5px;margin:0 0 5px 5px;float:right;white-space:nowrap}.as3cf-tab .as3cf-defined-setting{color:#bbb}.as3cf-tab .as3cf-defined-setting label{cursor:default}.as3cf-tab .as3cf-defined-setting p .more-info a{color:#bbb}.as3cf-tab .as3cf-defined-setting .as3cf-radio-group p{color:#bbb}.as3cf-tab .as3cf-defined-setting .as3cf-notice{display:none !important}.as3cf-tab p.actions{margin:20px -30px -30px;padding:20px 30px;border-top:none;overflow:hidden}.as3cf-tab p.actions .right{margin-left:15px}.as3cf-tab p.actions .right:last-of-type{margin-left:0}.as3cf-tab p.actions button{min-width:90px}#tab-media{display:block}#tab-media .as3cf-provider-setting td{padding-top:20px;padding-bottom:5px}#tab-media .as3cf-bucket-setting td{padding:5px 0}.as3cf-bucket-container h3{line-height:1.3;text-transform:none}.as3cf-bucket-container a:focus{-webkit-box-shadow:none;box-shadow:none;outline:none}.as3cf-bucket-container input[type=text]{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%}.as3cf-bucket-container select{-webkit-box-sizing:border-box;box-sizing:border-box;width:50%}.as3cf-bucket-container .form-table .as3cf-provider-setting h4{font-weight:inherit;margin:0}.as3cf-bucket-container .form-table .as3cf-bucket-list{margin:5px 0 0 0}.as3cf-bucket-container .form-table td{padding:5px 0}.as3cf-bucket-container .form-table td:first-child{width:100px;line-height:30px;vertical-align:top}.as3cf-bucket-container .bucket-actions{margin:15px 0;border-top:1px solid #ccc;padding-top:15px;overflow:hidden}.as3cf-bucket-container .bucket-actions button,.as3cf-bucket-container .bucket-actions .right{float:right;margin-right:0}.as3cf-bucket-container .bucket-actions span{display:inline-block;margin-right:20px;line-height:28px}.as3cf-bucket-container .as3cf-bucket-list{padding:15px;max-height:200px;overflow-x:hidden;overflow-y:auto;background-color:#fff;font-size:14px}.as3cf-bucket-container .as3cf-bucket-list li:last-of-type{margin-bottom:0}.as3cf-bucket-container .as3cf-bucket-list a{color:#444;text-decoration:none}.as3cf-bucket-container .as3cf-bucket-list a:hover{color:#0074a2}.as3cf-bucket-container .as3cf-bucket-list a.selected{font-weight:bold;color:#0074a2}.as3cf-bucket-container .as3cf-bucket-list a .dashicons{margin-right:5px}#tab-media{display:block}#tab-support{min-height:900px}#tab-support .as3cf-sidebar{top:11px}#tab-support .support-section{border-bottom:1px solid #ccc;padding-bottom:20px;margin-bottom:20px}#tab-support .support-section h3{font-size:20px}#tab-support .debug textarea{width:100%;min-height:200px;font-family:Consolas, Monaco, monospace;margin-bottom:5px}.as3cf-sidebar{position:absolute;top:9px;left:670px;width:292px}.as3cf-sidebar .block{padding:20px;border:1px solid #ccc}.as3cf-sidebar .subscribe{border-top:none}.as3cf-sidebar .subscribe h2{padding:0;margin:0;margin-bottom:0.5em;color:#666;font-size:20px;line-height:1.2em;float:none}.as3cf-sidebar .subscribe h3{font-size:16px;margin:0}.as3cf-sidebar .subscribe p{margin:0}.as3cf-sidebar .subscribe .intro{margin-bottom:1em;line-height:1.4}.as3cf-sidebar .subscribe li{line-height:1.4}.as3cf-sidebar .subscribe .links{margin-bottom:2em}.as3cf-sidebar .subscribe .links a{text-decoration:none}.as3cf-sidebar .subscribe .promise{color:#999;font-size:12px;line-height:1.4em}.as3cf-sidebar .subscribe .field{margin-bottom:0.5em}.as3cf-sidebar .subscribe .field p{margin-bottom:0.3em}.as3cf-sidebar .subscribe .field input[type=text],.as3cf-sidebar .subscribe .field input[type=email]{width:100%}.as3cf-sidebar .subscribe .field.submit-button{margin-bottom:1em}.as3cf-sidebar .credits{border-top:0}.as3cf-sidebar .credits h4{font-size:16px;margin-top:0;margin-bottom:10px}.as3cf-sidebar .credits ul{margin:0}.as3cf-sidebar .credits li{overflow:hidden}.as3cf-sidebar .credits li:last-child{margin-bottom:0}.as3cf-sidebar .credits img{float:left;margin-right:10px}.as3cf-sidebar .credits span{float:left;display:block;line-height:32px}.as3cf-sidebar .credits a{display:block;text-decoration:none;color:#444;font-size:16px;text-align:center}.as3cf-sidebar .credits a:hover{color:#888}@media screen and (max-width: 1052px){.as3cf-sidebar{position:relative;top:auto;right:auto}}.as3cf-active-provider,.as3cf-active-bucket{font-weight:bold;margin-right:10px}.as3cf-banner{margin-top:35px;width:292px;height:200px;display:block;background:#f8cfae url(../img/os3-banner.svg) left bottom/220px 220px no-repeat}.as3cf-banner:focus{-webkit-box-shadow:none;box-shadow:none}.wrap .as3cf-upgrade-details{background-color:#4e0d33;padding:10px 20px 20px 20px;color:#eee;font-size:13px;margin:0;display:block;text-decoration:none}.wrap .as3cf-upgrade-details h1{font-size:28px;color:#eee;margin:0 0 15px 0;padding:0;text-decoration:none;font-weight:200;line-height:1}.wrap .as3cf-upgrade-details p{margin:0}.wrap .as3cf-upgrade-details a{color:#eee;font-weight:bold;text-decoration:none;font-size:16px;-webkit-box-shadow:none;box-shadow:none}.wrap .as3cf-upgrade-details a:hover{color:#fff}.wrap .as3cf-upgrade-details ul{margin-top:0;margin-left:16px;list-style-type:disc}.as3cf-compatibility-notice.error{clear:both;margin:5px 20px 5px 0}.as3cf-bucket-error span.title{font-weight:bold}.as3cf-invalid-bucket-name,.as3cf-validation-error{display:block;margin-top:2px;font-size:12px;color:#a00}.as3cf-notice-toggle-content{max-height:100px;overflow-y:scroll}.as3cf-notice-toggle-content .as3cf-notice-toggle-list{margin-top:0;margin-left:0;padding-left:40px;color:#dc3232}.as3cf-need-help{background-color:white;font-size:16px;font-weight:bold;padding:1em}.as3cf-need-help a{text-decoration:none}.as3cf-settings h3{font-size:20px}.as3cf-settings p{font-size:14px}.as3cf-addons,.as3cf-tab .as3cf-compatibility-notice{max-width:cover}textarea.as3cf-access-key-constants-snippet.code{width:100%;white-space:pre;overflow:hidden;font-size:12px;padding:10px;height:53px}.as3cf-addons .as3cf-addons-list{margin:20px 0 200px;padding-top:5px}.as3cf-addons .as3cf-addon{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:20px;font-size:14px}.as3cf-addons .as3cf-addon-info{min-height:100px}.as3cf-addons .as3cf-addon-links{float:right}.as3cf-addons .as3cf-addon-links span{padding:4px 6px}.as3cf-addons .as3cf-addon-icon{float:left;margin-right:20px}.as3cf-addons .as3cf-addon-details{white-space:nowrap}.as3cf-addons .as3cf-addon-title,.as3cf-addons .as3cf-addon-description{font-weight:100}.as3cf-addons .as3cf-addon+.as3cf-addon{margin-top:20px}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull{background-color:#0769ad;color:white}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .as3cf-addon-title,.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .as3cf-addon-description,.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull a{color:white}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .extra{background:white}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .extra a{color:#0769ad;text-decoration:none}
1
+ .as3cf-content,.as3cf-updated,.as3cf-compatibility-notice{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:650px}.settings_page_amazon-s3-and-cloudfront .error,.settings_page_amazon-s3-and-cloudfront .notice,.settings_page_amazon-s3-and-cloudfront .updated{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:650px}.as3cf-main.wrap{position:relative}.as3cf-main.wrap>h1{float:left}.as3cf-main.wrap .as3cf-notice,.as3cf-main.wrap .as3cf-updated,.as3cf-main.wrap .as3cf-error{-webkit-box-sizing:border-box;box-sizing:border-box}.as3cf-main.wrap .as3cf-error.fatal{clear:both}.as3cf-main.wrap h2.nav-tab-wrapper{float:none;margin-bottom:15px;width:650px;margin-top:10px;padding:9px 0 0 5px}.as3cf-main.wrap h2.nav-tab-wrapper .nav-tab-container{float:right}.as3cf-main.wrap h2.nav-tab-wrapper .nav-tab-container :last-child{margin-right:5px}.as3cf-main.wrap h2.nav-tab-wrapper a.nav-tab-active{color:#464646;cursor:default}.as3cf-main.wrap h2.nav-tab-wrapper a:focus{-webkit-box-shadow:none;box-shadow:none}.as3cf-main.wrap .more-info{white-space:nowrap}.as3cf-main.wrap .error pre{background:#eaeaea;background:rgba(0,0,0,0.07);display:block;padding:10px 15px}.as3cf-main.wrap .error pre code{padding:0;background:none}.as3cf-main.wrap[data-tab="support"] .as3cf-notice,.as3cf-main.wrap[data-tab="support"] .error,.as3cf-main.wrap[data-tab="support"] .updated,.as3cf-main.wrap[data-tab="support"] .updated.show{display:none}.as3cf-main.wrap[data-tab="support"] .fatal .error,.as3cf-main.wrap[data-tab="support"] .as3cf-notice.important,.as3cf-main.wrap[data-tab="support"] .dbrains-api-down{display:block}.as3cf-main.wrap .as3cf-notice,.as3cf-main.wrap .error,.as3cf-main.wrap .updated{max-width:650px;margin-top:15px;-webkit-box-sizing:border-box;box-sizing:border-box}.as3cf-main.wrap .as3cf-updated{display:none}.as3cf-main.wrap .as3cf-updated.as3cf-notice,.as3cf-main.wrap .as3cf-updated.show{display:block}.as3cf-main.wrap .alignleft{margin-right:20px;margin-bottom:20px}.as3cf-main.wrap .spinner{min-width:20px}.as3cf-tab .as3cf-main-settings .as3cf-provider-select{display:none}.as3cf-tab .as3cf-main-settings .as3cf-bucket-container,.as3cf-tab .as3cf-main-settings .as3cf-change-bucket-access-prompt{display:none}.as3cf-tab .as3cf-main-settings .as3cf-bucket-container h3,.as3cf-tab .as3cf-main-settings .as3cf-change-bucket-access-prompt h3{margin-bottom:-0.5em}.as3cf-tab .as3cf-main-settings a.as3cf-change-provider{display:none}.as3cf-tab .as3cf-main-settings .as3cf-delivery-provider-select{display:none}.as3cf-tab .as3cf-main-settings .as3cf-media-settings{display:none}.as3cf-tab.as3cf-needs-access-keys .as3cf-can-write-error,.as3cf-tab.as3cf-has-access-keys.as3cf-change-provider .as3cf-can-write-error{display:none}.as3cf-tab.as3cf-needs-access-keys .as3cf-main-settings .as3cf-provider-select,.as3cf-tab.as3cf-has-access-keys.as3cf-change-provider .as3cf-main-settings .as3cf-provider-select{display:block}.as3cf-tab.as3cf-needs-access-keys .as3cf-main-settings .as3cf-bucket-container,.as3cf-tab.as3cf-has-access-keys.as3cf-change-provider .as3cf-main-settings .as3cf-bucket-container{display:none}.as3cf-tab.as3cf-needs-access-keys .as3cf-main-settings .as3cf-change-bucket-access-prompt,.as3cf-tab.as3cf-has-access-keys.as3cf-change-provider .as3cf-main-settings .as3cf-change-bucket-access-prompt{display:none}.as3cf-tab.as3cf-needs-access-keys .as3cf-main-settings .as3cf-delivery-provider-select,.as3cf-tab.as3cf-has-access-keys.as3cf-change-provider .as3cf-main-settings .as3cf-delivery-provider-select{display:none}.as3cf-tab.as3cf-needs-access-keys .as3cf-main-settings .as3cf-media-settings,.as3cf-tab.as3cf-has-access-keys.as3cf-change-provider .as3cf-main-settings .as3cf-media-settings{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider) .as3cf-can-write-error,.as3cf-tab.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) .as3cf-can-write-error{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-provider-select,.as3cf-tab.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-provider-select{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-bucket-container,.as3cf-tab.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-bucket-container{display:block}.as3cf-tab.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-change-bucket-access-prompt,.as3cf-tab.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-change-bucket-access-prompt{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-delivery-provider-select,.as3cf-tab.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-delivery-provider-select{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-media-settings,.as3cf-tab.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) .as3cf-main-settings .as3cf-media-settings{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-bucket-access .as3cf-can-write-error{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-bucket-access .as3cf-main-settings .as3cf-provider-select{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-bucket-access .as3cf-main-settings .as3cf-bucket-container{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-bucket-access .as3cf-main-settings .as3cf-change-bucket-access-prompt{display:block}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-bucket-access .as3cf-main-settings .as3cf-delivery-provider-select{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-bucket-access .as3cf-main-settings .as3cf-media-settings{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-delivery-provider .as3cf-can-write-error{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-delivery-provider .as3cf-main-settings .as3cf-provider-select{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-delivery-provider .as3cf-main-settings .as3cf-bucket-container{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-delivery-provider .as3cf-main-settings .as3cf-change-bucket-access-prompt{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-delivery-provider .as3cf-main-settings .as3cf-delivery-provider-select{display:block}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-delivery-provider .as3cf-main-settings .as3cf-media-settings{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket:not(.as3cf-change-provider):not(.as3cf-change-bucket):not(.as3cf-change-bucket-access):not(.as3cf-change-delivery-provider) .as3cf-main-settings .as3cf-provider-select{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket:not(.as3cf-change-provider):not(.as3cf-change-bucket):not(.as3cf-change-bucket-access):not(.as3cf-change-delivery-provider) .as3cf-main-settings .as3cf-bucket-container{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket:not(.as3cf-change-provider):not(.as3cf-change-bucket):not(.as3cf-change-bucket-access):not(.as3cf-change-delivery-provider) .as3cf-main-settings .as3cf-change-bucket-access-prompt{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket:not(.as3cf-change-provider):not(.as3cf-change-bucket):not(.as3cf-change-bucket-access):not(.as3cf-change-delivery-provider) .as3cf-main-settings .as3cf-delivery-provider-select{display:none}.as3cf-tab.as3cf-has-access-keys.as3cf-has-bucket:not(.as3cf-change-provider):not(.as3cf-change-bucket):not(.as3cf-change-bucket-access):not(.as3cf-change-delivery-provider) .as3cf-main-settings .as3cf-media-settings{display:block}.as3cf-content>section{margin-bottom:20px}.as3cf-content>section+section.as3cf-access-keys{padding-top:20px;border-top:1px solid #d3d3d3}.as3cf-content>section+section.as3cf-access-keys .as3cf-section-heading{margin-top:0}.as3cf-tab{display:none;position:relative;width:650px}.as3cf-tab .as3cf-main-settings p{font-size:13px}.as3cf-tab .as3cf-main-settings p a{color:#444}.as3cf-tab .object-prefix-desc em{white-space:nowrap}.as3cf-tab .as3cf-url-preview-wrap{background:#fff;text-align:center;padding:20px 0 0;max-width:650px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.as3cf-tab .as3cf-url-preview-wrap .as3cf-url-preview{margin-top:10px;padding:0 20px 10px;overflow-x:scroll}.as3cf-tab .as3cf-url-preview-wrap span{color:#aaa;text-transform:uppercase;font-weight:bold}.as3cf-tab .as3cf-radio-group label{display:block;margin-bottom:10px}.as3cf-tab .as3cf-radio-group label.disabled,.as3cf-tab .as3cf-radio-group label.disabled p{color:#bbb;cursor:default}.as3cf-tab .as3cf-radio-group p{padding-left:25px;color:#6b6b6b;margin:0;font-size:12px}.as3cf-tab .as3cf-radio-group p.as3cf-setting{margin-top:5px}.as3cf-tab .as3cf-switch{position:relative;display:inline-block;padding:2px;overflow:hidden;border-radius:2px;background-color:#d4d3d3;cursor:pointer}.as3cf-tab .as3cf-switch.on{background-color:#ade7b5}.as3cf-tab .as3cf-switch span{visibility:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;float:left;display:inline-block;height:100%;font-size:12px;line-height:20px;border-radius:2px;font-weight:bold;padding:4px 8px;background:#fff;color:#8d8d8d;z-index:1}.as3cf-tab .as3cf-switch span.on{color:#82d78b}.as3cf-tab .as3cf-switch span.checked{visibility:visible}.as3cf-tab .as3cf-switch.disabled{cursor:default;background:#e6e6e6}.as3cf-tab .as3cf-switch.disabled span{background:#f1f1f1;color:#d6d6d6}.as3cf-tab .as3cf-switch input[type="checkbox"]{position:absolute !important;top:0;left:0;opacity:0;filter:alpha(opacity=0);z-index:-1}.as3cf-tab .as3cf-setting.hide{display:none}.as3cf-tab .as3cf-setting .as3cf-sub-setting .as3cf-sub-setting-heading{padding-top:15px}.as3cf-tab .as3cf-setting .as3cf-sub-setting .as3cf-defined-in-config{margin-top:15px}.as3cf-tab div.as3cf-setting{margin-top:4px}.as3cf-tab h3{font-weight:normal;text-transform:uppercase}.as3cf-tab .form-table{margin:0}.as3cf-tab .form-table tr.as3cf-border-bottom td{border-bottom:1px solid #ddd;padding:20px 0px}.as3cf-tab .form-table tr.as3cf-setting-title td{padding-bottom:0}.as3cf-tab .form-table tr.as3cf-setting-title:first-child td{padding-top:20px}.as3cf-tab .form-table tr.configure-url:first-child td{padding-top:5px;padding-bottom:0}.as3cf-tab .form-table tr.hide{display:none}.as3cf-tab .form-table tr td{padding:15px 0}.as3cf-tab .form-table tr td:first-child{vertical-align:top;min-width:120px;padding-top:20px}.as3cf-tab .form-table tr td .as3cf-notice:last-child{margin-bottom:0}.as3cf-tab .form-table tr td>p:first-child{margin-top:0}.as3cf-tab .form-table h3{padding:0;margin:0}.as3cf-tab .form-table h4{margin:0}.as3cf-tab .as3cf-active-region{font-style:italic}.as3cf-tab .as3cf-view-bucket{color:#444;text-decoration:none;margin-right:10px}.as3cf-tab .as3cf-view-bucket:hover,.as3cf-tab .as3cf-view-bucket:active{color:#00a0d2}.as3cf-tab .as3cf-view-bucket:focus{-webkit-box-shadow:none;box-shadow:none}.as3cf-tab .as3cf-view-bucket .dashicons-external{margin-top:-2px}.as3cf-tab .tooltip{position:relative;z-index:2;cursor:pointer}.as3cf-tab .tooltip:before,.as3cf-tab .tooltip:after{visibility:hidden;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);opacity:0;pointer-events:none}.as3cf-tab .tooltip:before{position:absolute;bottom:150%;left:50%;margin-bottom:5px;margin-left:-250px;padding:10px;width:500px;border-radius:3px;background-color:#000;background-color:rgba(51,51,51,0.9);color:#fff;content:attr(data-tooltip);text-align:center;font-size:14px;line-height:1.3}.as3cf-tab .tooltip:after{position:absolute;bottom:150%;left:50%;margin-left:-5px;width:0;border-top:5px solid #000;border-top:5px solid rgba(51,51,51,0.9);border-right:5px solid transparent;border-left:5px solid transparent;content:" ";font-size:0;line-height:0}.as3cf-tab .tooltip:hover:before,.as3cf-tab .tooltip:hover:after{visibility:visible;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);opacity:1}.as3cf-tab .as3cf-defined-in-config{background:#ccc;color:#fff;padding:2px 5px;margin:0 0 3px 5px;float:right;white-space:nowrap;clear:right}.as3cf-tab .as3cf-defined-setting,.as3cf-tab .as3cf-locked-setting{color:#bbb}.as3cf-tab .as3cf-defined-setting label,.as3cf-tab .as3cf-locked-setting label{cursor:default}.as3cf-tab .as3cf-defined-setting p .more-info a,.as3cf-tab .as3cf-locked-setting p .more-info a{color:#bbb}.as3cf-tab .as3cf-defined-setting .as3cf-radio-group p,.as3cf-tab .as3cf-locked-setting .as3cf-radio-group p{color:#bbb}.as3cf-tab .as3cf-defined-setting .as3cf-notice,.as3cf-tab .as3cf-locked-setting .as3cf-notice{display:none !important}.as3cf-tab p.actions{margin:30px 0;border-top:1px solid #ccc;padding-top:15px;overflow:hidden}.as3cf-tab p.actions button,.as3cf-tab p.actions .right{float:right;margin-left:15px;margin-right:0;min-width:90px}.as3cf-tab p.actions button:last-of-type,.as3cf-tab p.actions .right:last-of-type{margin-left:0}.as3cf-tab p.actions span{display:inline-block;margin-right:20px;line-height:28px}.as3cf-tab .locked .as3cf-radio-group label,.as3cf-tab .locked .as3cf-radio-group label p{color:#bbb;cursor:default}.as3cf-tab .locked .as3cf-switch{cursor:default;background:#e6e6e6}.as3cf-tab .locked .as3cf-switch span{background:#f1f1f1;color:#d6d6d6}#tab-media{display:block}#tab-media .as3cf-provider-setting td{padding-top:20px;padding-bottom:5px}#tab-media .as3cf-bucket-setting td{padding:5px 0}.as3cf-bucket-container h3{line-height:1.3;text-transform:none}.as3cf-bucket-container a:focus{-webkit-box-shadow:none;box-shadow:none;outline:none}.as3cf-bucket-container input[type=text]{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%}.as3cf-bucket-container select{-webkit-box-sizing:border-box;box-sizing:border-box;width:50%}.as3cf-bucket-container .form-table .as3cf-provider-setting h4{font-weight:inherit;margin:0}.as3cf-bucket-container .form-table .as3cf-bucket-list{margin:5px 0 0 0}.as3cf-bucket-container .form-table td{padding:5px 0}.as3cf-bucket-container .form-table td:first-child{width:100px;line-height:30px;vertical-align:top}.as3cf-bucket-container .form-table td .as3cf-defined-in-config{margin-top:-1.75em}.as3cf-bucket-container .as3cf-bucket-list{padding:15px;max-height:200px;overflow-x:hidden;overflow-y:auto;background-color:#fff;font-size:14px}.as3cf-bucket-container .as3cf-bucket-list li:last-of-type{margin-bottom:0}.as3cf-bucket-container .as3cf-bucket-list a{color:#444;text-decoration:none}.as3cf-bucket-container .as3cf-bucket-list a:hover{color:#0074a2}.as3cf-bucket-container .as3cf-bucket-list a.selected{font-weight:bold;color:#0074a2}.as3cf-bucket-container .as3cf-bucket-list a .dashicons{margin-right:5px}.as3cf-change-bucket-access-prompt h3{line-height:1.3;text-transform:none}.as3cf-change-bucket-access-prompt .as3cf-radio-group{margin-bottom:25px}.as3cf-change-bucket-access-prompt .note{color:#999}.as3cf-delivery-provider-select h3{line-height:1.3;text-transform:none}.as3cf-delivery-provider-select .note{color:#999}#tab-media{display:block}#tab-support{min-height:900px}#tab-support .as3cf-sidebar{top:11px}#tab-support .support-section{border-bottom:1px solid #ccc;padding-bottom:20px;margin-bottom:20px}#tab-support .support-section h3{font-size:20px}#tab-support .debug textarea{width:100%;min-height:200px;font-family:Consolas, Monaco, monospace;margin-bottom:5px}.as3cf-sidebar{position:absolute;top:9px;left:670px;width:292px}.as3cf-sidebar .block{padding:20px;border:1px solid #ccc}.as3cf-sidebar .subscribe{border-top:none}.as3cf-sidebar .subscribe h2{padding:0;margin:0;margin-bottom:0.5em;color:#666;font-size:20px;line-height:1.2em;float:none}.as3cf-sidebar .subscribe h3{font-size:16px;margin:0}.as3cf-sidebar .subscribe p{margin:0}.as3cf-sidebar .subscribe .intro{margin-bottom:1em;line-height:1.4}.as3cf-sidebar .subscribe li{line-height:1.4}.as3cf-sidebar .subscribe .links{margin-bottom:2em}.as3cf-sidebar .subscribe .links a{text-decoration:none}.as3cf-sidebar .subscribe .promise{color:#999;font-size:12px;line-height:1.4em}.as3cf-sidebar .subscribe .field{margin-bottom:0.5em}.as3cf-sidebar .subscribe .field p{margin-bottom:0.3em}.as3cf-sidebar .subscribe .field input[type=text],.as3cf-sidebar .subscribe .field input[type=email]{width:100%}.as3cf-sidebar .subscribe .field.submit-button{margin-bottom:1em}.as3cf-sidebar .credits{border-top:0}.as3cf-sidebar .credits h4{font-size:16px;margin-top:0;margin-bottom:10px}.as3cf-sidebar .credits ul{margin:0}.as3cf-sidebar .credits li{overflow:hidden}.as3cf-sidebar .credits li:last-child{margin-bottom:0}.as3cf-sidebar .credits img{float:left;margin-right:10px}.as3cf-sidebar .credits span{float:left;display:block;line-height:32px}.as3cf-sidebar .credits a{display:block;text-decoration:none;color:#444;font-size:16px;text-align:center}.as3cf-sidebar .credits a:hover{color:#888}@media screen and (max-width: 1052px){.as3cf-sidebar{position:relative;top:auto;right:auto}}.as3cf-active-provider,.as3cf-active-bucket{font-weight:bold;margin-right:10px}.as3cf-banner{margin-top:35px;width:292px;height:200px;display:block;background:#f8cfae url(../img/os3-banner.svg) left bottom/220px 220px no-repeat}.as3cf-banner:focus{-webkit-box-shadow:none;box-shadow:none}.wrap .as3cf-upgrade-details{background-color:#4e0d33;padding:10px 20px 20px 20px;color:#eee;font-size:13px;margin:0;display:block;text-decoration:none}.wrap .as3cf-upgrade-details h1{font-size:28px;color:#eee;margin:0 0 15px 0;padding:0;text-decoration:none;font-weight:200;line-height:1}.wrap .as3cf-upgrade-details p{margin:0}.wrap .as3cf-upgrade-details a{color:#eee;font-weight:bold;text-decoration:none;font-size:16px;-webkit-box-shadow:none;box-shadow:none}.wrap .as3cf-upgrade-details a:hover{color:#fff}.wrap .as3cf-upgrade-details ul{margin-top:0;margin-left:16px;list-style-type:disc}.as3cf-compatibility-notice.error{clear:both;margin:5px 20px 5px 0}.as3cf-bucket-error span.title{font-weight:bold}.as3cf-invalid-bucket-name,.as3cf-validation-error{display:block;margin-top:2px;font-size:12px;color:#a00}.as3cf-notice-toggle-content{max-height:100px;overflow-y:scroll}.as3cf-notice-toggle-content .as3cf-notice-toggle-list{margin-top:0;margin-left:0;padding-left:40px;color:#dc3232}.as3cf-need-help{background-color:white;font-size:16px;font-weight:bold;padding:1em}.as3cf-need-help a{text-decoration:none}.as3cf-settings h3{font-size:20px}.as3cf-settings p{font-size:14px}.as3cf-addons,.as3cf-tab .as3cf-compatibility-notice{max-width:cover}textarea.as3cf-access-key-constants-snippet.code{width:100%;white-space:pre;overflow:hidden;font-size:12px;padding:10px;height:53px}.as3cf-addons .as3cf-addons-list{margin:20px 0 200px;padding-top:5px}.as3cf-addons .as3cf-addon{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:20px;font-size:14px}.as3cf-addons .as3cf-addon-info{min-height:100px}.as3cf-addons .as3cf-addon-links{float:right}.as3cf-addons .as3cf-addon-links span{padding:4px 6px}.as3cf-addons .as3cf-addon-icon{float:left;margin-right:20px}.as3cf-addons .as3cf-addon-details{white-space:nowrap}.as3cf-addons .as3cf-addon-title,.as3cf-addons .as3cf-addon-description{font-weight:100}.as3cf-addons .as3cf-addon+.as3cf-addon{margin-top:20px}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull{background-color:#0769ad;color:white}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .as3cf-addon-title,.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .as3cf-addon-description,.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull a{color:white}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .extra{background:white}.as3cf-addons .as3cf-addon.amazon-s3-and-cloudfront-assets-pull .extra a{color:#0769ad;text-decoration:none}
assets/js/delivery-provider.js ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ) {
2
+ var $body = $( 'body' );
3
+
4
+ var as3cf = as3cf || {};
5
+
6
+ /**
7
+ * Handle changes to the selected Delivery Provider.
8
+ */
9
+ as3cf.deliveryProvider = {
10
+ changed: function() {
11
+ var provider = $( 'input[name="delivery-provider"]:checked' ).val();
12
+ var parent = $( 'input[name="delivery-provider"]:checked' ).attr( 'data-delivery-provider-parent' );
13
+
14
+ // De-select all providers.
15
+ $( '.as3cf-delivery-provider' ).each( function() {
16
+ $( this ).removeClass( 'selected' );
17
+ } );
18
+
19
+ // De-select all sub option containers.
20
+ $( '.as3cf-delivery-provider-sub-option-container' ).each( function() {
21
+ $( this ).removeClass( 'selected' );
22
+ } );
23
+
24
+ // Select chosen provider.
25
+ $( '.as3cf-delivery-provider[data-delivery-provider="' + provider + '"]' ).each( function() {
26
+ $( this ).addClass( 'selected' );
27
+ } );
28
+
29
+ if ( 0 < parent.length ) {
30
+ // If switching sub options, re-select container and parent too.
31
+ $( '.as3cf-delivery-provider-sub-option-container[data-delivery-provider="' + parent + '"]' ).each( function() {
32
+ $( this ).addClass( 'selected' );
33
+ } );
34
+ $( '.as3cf-delivery-provider[data-delivery-provider="' + parent + '"]' ).each( function() {
35
+ $( this ).addClass( 'selected' );
36
+ } );
37
+ } else {
38
+ // Switching top level provider, de-select any sub option container...
39
+ $( '.as3cf-delivery-provider-sub-option-container' ).each( function() {
40
+ $( this ).removeClass( 'selected' );
41
+ } );
42
+
43
+ // ... and select the dummy hidden radio button.
44
+ $( 'input#as3cf-delivery-provider-dummy-parent[name="delivery-provider-sub-option-parent"]' ).each( function() {
45
+ $( this ).prop( 'checked', true );
46
+ $( this ).trigger( 'change' );
47
+ } );
48
+ }
49
+ },
50
+
51
+ subOptionParentChanged: function() {
52
+ var parent = $( 'input[name="delivery-provider-sub-option-parent"]:checked' ).val();
53
+
54
+ // De-select all other top level options.
55
+ $( '.as3cf-delivery-provider-option' ).each( function() {
56
+ $( this ).removeClass( 'selected' );
57
+ } );
58
+
59
+ // Select chosen sub option container.
60
+ $( '.as3cf-delivery-provider-sub-option-container[data-delivery-provider="' + parent + '"]' ).each( function() {
61
+ $( this ).addClass( 'selected' );
62
+ } );
63
+
64
+ // Select chosen sub option parent.
65
+ $( '.as3cf-delivery-provider-option[data-delivery-provider="' + parent + '"]' ).each( function() {
66
+ $( this ).addClass( 'selected' );
67
+ } );
68
+
69
+ // Find default sub option to select.
70
+ $( 'input[data-delivery-provider-parent="' + parent + '"]' ).first().each( function() {
71
+ $( this ).prop( 'checked', true );
72
+ $( this ).trigger( 'change' );
73
+ } );
74
+ }
75
+ };
76
+
77
+ $( document ).ready( function() {
78
+ // Switch displayed delivery provider content.
79
+ $body.on( 'change', 'input[name="delivery-provider"]', function( e ) {
80
+ e.preventDefault();
81
+ as3cf.deliveryProvider.changed();
82
+ } );
83
+ $body.on( 'change', 'input[name="delivery-provider-sub-option-parent"]', function( e ) {
84
+ e.preventDefault();
85
+ as3cf.deliveryProvider.subOptionParentChanged();
86
+ } );
87
+ } );
88
+
89
+ })( jQuery );
assets/js/delivery-provider.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a){var b=a("body"),c=c||{};c.deliveryProvider={changed:function(){var b=a('input[name="delivery-provider"]:checked').val(),c=a('input[name="delivery-provider"]:checked').attr("data-delivery-provider-parent");a(".as3cf-delivery-provider").each(function(){a(this).removeClass("selected")}),a(".as3cf-delivery-provider-sub-option-container").each(function(){a(this).removeClass("selected")}),a('.as3cf-delivery-provider[data-delivery-provider="'+b+'"]').each(function(){a(this).addClass("selected")}),0<c.length?(a('.as3cf-delivery-provider-sub-option-container[data-delivery-provider="'+c+'"]').each(function(){a(this).addClass("selected")}),a('.as3cf-delivery-provider[data-delivery-provider="'+c+'"]').each(function(){a(this).addClass("selected")})):(a(".as3cf-delivery-provider-sub-option-container").each(function(){a(this).removeClass("selected")}),a('input#as3cf-delivery-provider-dummy-parent[name="delivery-provider-sub-option-parent"]').each(function(){a(this).prop("checked",!0),a(this).trigger("change")}))},subOptionParentChanged:function(){var b=a('input[name="delivery-provider-sub-option-parent"]:checked').val();a(".as3cf-delivery-provider-option").each(function(){a(this).removeClass("selected")}),a('.as3cf-delivery-provider-sub-option-container[data-delivery-provider="'+b+'"]').each(function(){a(this).addClass("selected")}),a('.as3cf-delivery-provider-option[data-delivery-provider="'+b+'"]').each(function(){a(this).addClass("selected")}),a('input[data-delivery-provider-parent="'+b+'"]').first().each(function(){a(this).prop("checked",!0),a(this).trigger("change")})}},a(document).ready(function(){b.on("change",'input[name="delivery-provider"]',function(a){a.preventDefault(),c.deliveryProvider.changed()}),b.on("change",'input[name="delivery-provider-sub-option-parent"]',function(a){a.preventDefault(),c.deliveryProvider.subOptionParentChanged()})})}(jQuery);
assets/js/script.js CHANGED
@@ -53,6 +53,63 @@
53
  }
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  as3cf.tabs = {
57
  defaultTab: 'media',
58
  /**
@@ -376,6 +433,40 @@
376
  $( document ).trigger( 'wp-updates-notice-added' ); // Hack to run WP Core's makeNoticesDismissible() function.
377
  };
378
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  /**
380
  * Get the link to the bucket on the AWS Console and update the DOM
381
  *
@@ -538,7 +629,7 @@
538
  } );
539
 
540
  $( '.as3cf-switch' ).on( 'click', function( e ) {
541
- if ( ! $( this ).hasClass( 'disabled' ) ) {
542
  setCheckbox( $( this ).attr( 'id' ) );
543
  }
544
  } );
@@ -548,14 +639,6 @@
548
  $( '.as3cf-setting.' + setting ).toggleClass( 'hide' );
549
  } );
550
 
551
- $( '.as3cf-domain' ).on( 'change', 'input[type="radio"]', function( e ) {
552
- var $selected = $( this ).closest( 'input:radio[name="domain"]:checked' );
553
- var domain = $selected.val();
554
- var $cloudfront = $( this ).parents( '.as3cf-domain' ).find( '.as3cf-setting.cloudfront' );
555
- var cloudfrontSelected = ( 'cloudfront' === domain );
556
- $cloudfront.toggleClass( 'hide', ! cloudfrontSelected );
557
- } );
558
-
559
  $( '.url-preview' ).on( 'change', 'input', function( e ) {
560
  generateUrlPreview();
561
  } );
@@ -579,20 +662,87 @@
579
  }
580
  } );
581
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
582
  // Validate custom domain
583
- $( 'input[name="cloudfront"]' ).on( 'keyup', function( e ) {
584
  validateCustomDomain( $( this ) );
585
  } );
586
 
587
- // Re-enable submit button on domain change
588
- $( 'input[name="domain"]' ).on( 'change', function( e ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
589
  var $input = $( this );
590
  var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );
591
 
592
- if ( 'cloudfront' !== $input.val() ) {
593
  $submit.prop( 'disabled', false );
594
  } else {
595
- validateCustomDomain( $input.next( '.as3cf-setting' ).find( 'input[name="cloudfront"]' ) );
596
  }
597
  } );
598
 
@@ -663,6 +813,16 @@
663
  return false;
664
  }
665
  } );
 
 
 
 
 
 
 
 
 
 
666
  } );
667
 
668
  } )( jQuery, as3cfModal );
53
  }
54
  }
55
 
56
+ /**
57
+ * Validate Signed URLs Key ID.
58
+ *
59
+ * @param {object} $input
60
+ */
61
+ function validateSignedUrlsKeyID( $input ) {
62
+ var $error = $input.next( '.as3cf-validation-error' );
63
+ var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );
64
+ var pattern = /[^a-zA-Z0-9]/; // Letters & Numbers only at present (CloudFront).
65
+
66
+ if ( pattern.test( $input.val() ) ) {
67
+ $error.show();
68
+ $submit.prop( 'disabled', true );
69
+ } else {
70
+ $error.hide();
71
+ $submit.prop( 'disabled', false );
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Validate Signed URLs Key File Path.
77
+ *
78
+ * @param {object} $input
79
+ */
80
+ function validateSignedUrlsKeyFilePath( $input ) {
81
+ var $error = $input.next( '.as3cf-validation-error' );
82
+ var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );
83
+ var pattern = /[^a-zA-Z0-9\.\-\\:\/ ]/;
84
+
85
+ if ( pattern.test( $input.val() ) ) {
86
+ $error.show();
87
+ $submit.prop( 'disabled', true );
88
+ } else {
89
+ $error.hide();
90
+ $submit.prop( 'disabled', false );
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Validate Signed URLs Object Prefix.
96
+ *
97
+ * @param {object} $input
98
+ */
99
+ function validateSignedUrlsObjectPrefix( $input ) {
100
+ var $error = $input.next( '.as3cf-validation-error' );
101
+ var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );
102
+ var pattern = /[^a-zA-Z0-9\-\/ ]/;
103
+
104
+ if ( pattern.test( $input.val() ) ) {
105
+ $error.show();
106
+ $submit.prop( 'disabled', true );
107
+ } else {
108
+ $error.hide();
109
+ $submit.prop( 'disabled', false );
110
+ }
111
+ }
112
+
113
  as3cf.tabs = {
114
  defaultTab: 'media',
115
  /**
433
  $( document ).trigger( 'wp-updates-notice-added' ); // Hack to run WP Core's makeNoticesDismissible() function.
434
  };
435
 
436
+ as3cf.Settings = as3cf.Settings ? as3cf.Settings : {};
437
+
438
+ /**
439
+ * The object that handles locking and unlocking the Media settings.
440
+ */
441
+ as3cf.Settings.Media = {
442
+ /**
443
+ * Lock settings.
444
+ */
445
+ lock: function( key ) {
446
+ $( '#as3cf-media-settings-locked-' + key ).show();
447
+ $( '.as3cf-media-settings' ).addClass( 'locked locked-' + key );
448
+ $( '.as3cf-media-settings.locked-' + key ).each( function() {
449
+ $( this ).find( 'input,button' ).prop( 'disabled', true );
450
+ $( this ).find( '.as3cf-settings-container' ).addClass( 'as3cf-locked-setting' );
451
+ $( this ).find( 'a.as3cf-change-settings' ).hide();
452
+ } );
453
+ },
454
+
455
+ /**
456
+ * Unlock settings.
457
+ */
458
+ unlock: function( key ) {
459
+ $( '.as3cf-media-settings.locked-' + key ).each( function() {
460
+ $( this ).find( 'input,button' ).filter( ':not(.disabled)' ).prop( 'disabled', false );
461
+ $( this ).find( '.as3cf-settings-container' ).removeClass( 'as3cf-locked-setting' );
462
+ $( this ).find( 'a.as3cf-change-settings' ).show();
463
+ $( this ).removeClass( 'locked locked-' + key );
464
+ } );
465
+ $( '#as3cf-media-settings-locked-' + key ).hide();
466
+ }
467
+
468
+ };
469
+
470
  /**
471
  * Get the link to the bucket on the AWS Console and update the DOM
472
  *
629
  } );
630
 
631
  $( '.as3cf-switch' ).on( 'click', function( e ) {
632
+ if ( ! $( this ).hasClass( 'disabled' ) && ! $( this ).parents().hasClass( 'locked' ) ) {
633
  setCheckbox( $( this ).attr( 'id' ) );
634
  }
635
  } );
639
  $( '.as3cf-setting.' + setting ).toggleClass( 'hide' );
640
  } );
641
 
 
 
 
 
 
 
 
 
642
  $( '.url-preview' ).on( 'change', 'input', function( e ) {
643
  generateUrlPreview();
644
  } );
662
  }
663
  } );
664
 
665
+ // Show or hide Custom Domain input and Enable Signed URLs section based on custom domain toggle switch.
666
+ $( '.as3cf-enable-delivery-domain-container' ).on( 'change', 'input[type="checkbox"]', function( e ) {
667
+ var deliveryDomainEnabled = $( this ).is( ':checked' );
668
+ var $deliveryDomain = $( this ).parents( '.as3cf-enable-delivery-domain-container' ).find( '.as3cf-setting.as3cf-delivery-domain' );
669
+ $deliveryDomain.toggleClass( 'hide', ! deliveryDomainEnabled );
670
+ var $signedUrlsEnabled = $( this ).parents( '.as3cf-enable-delivery-domain-container' ).siblings( '.as3cf-enable-signed-urls-container' );
671
+ $signedUrlsEnabled.toggleClass( 'hide', ! deliveryDomainEnabled );
672
+ } );
673
+
674
+ // Re-enable submit button on domain change
675
+ $( 'input[name="enable-delivery-domain"]' ).on( 'change', function( e ) {
676
+ var $input = $( this );
677
+ var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );
678
+
679
+ if ( '1' !== $input.val() ) {
680
+ $submit.prop( 'disabled', false );
681
+ } else {
682
+ validateCustomDomain( $input.next( '.as3cf-setting' ).find( 'input[name="delivery-domain"]' ) );
683
+ }
684
+ } );
685
+
686
  // Validate custom domain
687
+ $( 'input[name="delivery-domain"]' ).on( 'keyup', function( e ) {
688
  validateCustomDomain( $( this ) );
689
  } );
690
 
691
+ // Show or hide Signed URLs fields based on Enable Signed URLs toggle switch.
692
+ $( '.as3cf-enable-signed-urls-container' ).on( 'change', 'input[type="checkbox"]', function( e ) {
693
+ var signedUrlsEnabled = $( this ).is( ':checked' );
694
+ var $signedUrls = $( this ).parents( '.as3cf-enable-signed-urls-container' ).find( '.as3cf-setting.as3cf-signed-urls' );
695
+ $signedUrls.toggleClass( 'hide', ! signedUrlsEnabled );
696
+ } );
697
+
698
+ // Validate Signed URLs Key ID.
699
+ $( 'input[name="signed-urls-key-id"]' ).on( 'keyup', function( e ) {
700
+ validateSignedUrlsKeyID( $( this ) );
701
+ } );
702
+
703
+ // Re-enable submit button on Signed URLs Key ID change
704
+ $( 'input[name="enable-signed-urls-key-id"]' ).on( 'change', function( e ) {
705
+ var $input = $( this );
706
+ var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );
707
+
708
+ if ( '1' !== $input.val() ) {
709
+ $submit.prop( 'disabled', false );
710
+ } else {
711
+ validateSignedUrlsKeyID( $input.next( '.as3cf-setting' ).find( 'input[name="signed-urls-key-id"]' ) );
712
+ }
713
+ } );
714
+
715
+ // Validate Signed URLs Key File Path.
716
+ $( 'input[name="signed-urls-key-file-path"]' ).on( 'keyup', function( e ) {
717
+ validateSignedUrlsKeyFilePath( $( this ) );
718
+ } );
719
+
720
+ // Re-enable submit button on Signed URLs Key File Path change
721
+ $( 'input[name="enable-signed-urls-key-file-path"]' ).on( 'change', function( e ) {
722
+ var $input = $( this );
723
+ var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );
724
+
725
+ if ( '1' !== $input.val() ) {
726
+ $submit.prop( 'disabled', false );
727
+ } else {
728
+ validateSignedUrlsKeyFilePath( $input.next( '.as3cf-setting' ).find( 'input[name="signed-urls-key-file-path"]' ) );
729
+ }
730
+ } );
731
+
732
+ // Validate Signed URLs Object Prefix.
733
+ $( 'input[name="signed-urls-object-prefix"]' ).on( 'keyup', function( e ) {
734
+ validateSignedUrlsObjectPrefix( $( this ) );
735
+ } );
736
+
737
+ // Re-enable submit button on Signed URLs Object Prefix change
738
+ $( 'input[name="enable-signed-urls-object-prefix"]' ).on( 'change', function( e ) {
739
  var $input = $( this );
740
  var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );
741
 
742
+ if ( '1' !== $input.val() ) {
743
  $submit.prop( 'disabled', false );
744
  } else {
745
+ validateSignedUrlsObjectPrefix( $input.next( '.as3cf-setting' ).find( 'input[name="signed-urls-object-prefix"]' ) );
746
  }
747
  } );
748
 
813
  return false;
814
  }
815
  } );
816
+
817
+ // Enable/Disable Block All Public Access button during setup depending on checkbox.
818
+ $( '.as3cf-change-bucket-access-prompt' ).on( 'change', '#origin-access-identity-confirmation', function( e ) {
819
+ $( '#block-public-access-confirmed' ).prop( 'disabled', ! $( this ).prop( 'checked' ) );
820
+ } );
821
+
822
+ // If there's an upgrade in progress when the page loads, ensure settings are locked.
823
+ $( '.as3cf-media-settings.locked.locked-upgrade' ).each( function() {
824
+ as3cf.Settings.Media.lock( 'upgrade' );
825
+ } );
826
  } );
827
 
828
  } )( jQuery, as3cfModal );
assets/js/script.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,b){function c(b){return a("#"+b+" .as3cf-main-settings form").find("input:not(.no-compare)").serialize()}function d(a){var b=l.find("#"+a),c=b.find("input[type=checkbox]");b.toggleClass("on").find("span").toggleClass("checked");var d=b.find("span.on").hasClass("checked");c.prop("checked",d).trigger("change")}function e(b){var c=b.next(".as3cf-validation-error"),d=a("#"+l.attr("id")+' form button[type="submit"]'),e=/[^a-zA-Z0-9\.\-]/;e.test(b.val())?(c.show(),d.prop("disabled",!0)):(c.hide(),d.prop("disabled",!1))}function f(){var c=a("#"+b.prefix+"-bucket").val(),d=l.find('input[name="object-prefix"]'),e=d.val();""!==e&&(e=as3cf.provider_console_url_prefix_param+encodeURIComponent(e));var f=as3cf.provider_console_url+c+e;a("#"+b.prefix+"-view-bucket").attr("href",f)}function g(){a("#as3cf-remove-local-file").is(":checked")&&a("#as3cf-serve-from-s3").is(":not(:checked)")?a("#as3cf-lost-files-notice").show():a("#as3cf-lost-files-notice").hide()}function h(){a("#as3cf-remove-local-file").is(":checked")?a("#as3cf-remove-local-notice").show():a("#as3cf-remove-local-notice").hide()}function i(b){!0!==b?a("#as3cf-seo-friendly-url-notice").show():a("#as3cf-seo-friendly-url-notice").hide()}function j(){a(".as3cf-url-preview").html("Generating...");var b={_nonce:as3cf.nonces.get_url_preview};a.each(a("#tab-"+as3cf.tabs.defaultTab+" .as3cf-main-settings form").serializeArray(),function(c,d){var e=d.name,f=d.value;e=e.replace("[]",""),b[e]=void 0===b[e]?f:a.isArray(b[e])?b[e].concat(f):[b[e],f]}),b.action="as3cf-get-url-preview",a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:b,error:function(a,b,c){alert(as3cf.strings.get_url_preview_error+c)},success:function(b,c,d){"undefined"!=typeof b.success?(a(".as3cf-url-preview").html(b.url),i(b.seo_friendly)):alert(as3cf.strings.get_url_preview_error+b.error)}})}function k(){return"#"+as3cf.tabs.defaultTab===location.hash?void(location.hash=""):(as3cf.tabs.toggle(location.hash.replace("#",""),!0),void a(document).trigger("as3cf.tabRendered",[location.hash.replace("#","")]))}var l,m={},n=/[^a-z0-9.-]/,o=a("body"),p=a(".as3cf-tab");a(".as3cf-settings");as3cf.tabs={defaultTab:"media",toggle:function(c,d){c=as3cf.tabs.sanitizeHash(c),p.hide(),l=a("#tab-"+c),l.show(),a(".nav-tab").removeClass("nav-tab-active"),a('a.nav-tab[data-tab="'+c+'"]').addClass("nav-tab-active"),a(".as3cf-main").data("tab",c),l.data("prefix")&&(b.prefix=l.data("prefix")),d||a(".as3cf-updated").removeClass("show"),"support"===c&&as3cf.tabs.getDiagnosticInfo()},getDiagnosticInfo:function(){var b=a(".debug-log-textarea");b.html(as3cf.strings.get_diagnostic_info);var c={action:"as3cf-get-diagnostic-info",_nonce:as3cf.nonces.get_diagnostic_info};a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:c,error:function(a,c,d){b.html(d)},success:function(a,c,d){"undefined"!=typeof a.success?b.html(a.diagnostic_info):(b.html(as3cf.strings.get_diagnostic_info_error),b.append(a.error))}})},sanitizeHash:function(b){var c=a("#tab-"+b);return 0===c.length&&(b=as3cf.tabs.defaultTab),b}},as3cf.buckets={validLength:3,bucketSelectLock:!1,loadList:function(c){"undefined"==typeof c&&(c=!1);var d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select"),e=d.find(".bucket-select-region"),f=d.find(".as3cf-bucket-list"),g=a("#"+b.prefix+"-bucket").val();if(!1===c&&f.find("li").length>1)return a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+g+'"]').addClass("selected"),void this.scrollToSelected();f.html('<li class="loading">'+f.data("working")+"</li>"),this.disabledButtons();var h={action:b.prefix+"-get-buckets",_nonce:window[b.prefix.replace(/-/g,"_")].nonces.get_buckets};e.val()&&(h.region=e.val());var i=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:h,error:function(a,b,c){f.html(""),i.showError(as3cf.strings.get_buckets_error,c,"as3cf-bucket-select")},success:function(b,c,d){f.html(""),"undefined"!=typeof b.success?(a(".as3cf-bucket-error").hide(),0===b.buckets.length?f.html('<li class="loading">'+f.data("nothing-found")+"</li>"):(a(b.buckets).each(function(a,b){var c=b.Name===g?"selected":"";f.append('<li><a class="'+c+'" href="#" data-bucket="'+b.Name+'"><span class="bucket"><span class="dashicons dashicons-portfolio"></span> '+b.Name+'</span><span class="spinner"></span></span></a></li>')}),i.scrollToSelected(),i.disabledButtons())):i.showError(as3cf.strings.get_buckets_error,b.error,"as3cf-bucket-select")}})},scrollToSelected:function(){if(a(".as3cf-bucket-list a.selected").length){var b=a("ul.as3cf-bucket-list li").first().position().top+150;a(".as3cf-bucket-list").animate({scrollTop:a("ul.as3cf-bucket-list li a.selected").position().top-b})}},setSelected:function(c){a(".as3cf-bucket-list a").removeClass("selected"),c.addClass("selected"),a("#"+b.prefix+"-bucket-select-name").val(c.data("bucket"))},disabledButtons:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-create"),d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-manual"),e=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select");0===c.length&&0===d.length&&0===e.length||(0<c.length&&this.isValidName(c.find(".as3cf-bucket-name").val())?c.find("button[type=submit]").prop("disabled",!1):c.find("button[type=submit]").prop("disabled",!0),0<d.length&&this.isValidName(d.find(".as3cf-bucket-name").val())?d.find("button[type=submit]").prop("disabled",!1):d.find("button[type=submit]").prop("disabled",!0),0<e.length&&1===e.find(".as3cf-bucket-list a.selected").length?e.find("button[type=submit]").prop("disabled",!1):e.find("button[type=submit]").prop("disabled",!0))},showError:function(b,c,d){var e=a(".as3cf-bucket-container").children(":visible"),f=e.find(".as3cf-bucket-error");d="undefined"==typeof d?null:d,d&&!e.hasClass(d)||(f.find("span.title").html(b+" &mdash;"),f.find("span.message").html(c),f.show(),this.bucketSelectLock=!1)},isValidName:function(a){return!(a.length<3||a.length>63)&&!0!==n.test(a)},updateNameNotice:function(b){var c=null;!0===n.test(b)?c=as3cf.strings.create_bucket_invalid_chars:b.length<3?c=as3cf.strings.create_bucket_name_short:b.length>63&&(c=as3cf.strings.create_bucket_name_long),c&&b.length>0?a(".as3cf-invalid-bucket-name").html(c):a(".as3cf-invalid-bucket-name").html("")}},as3cf.reloadUpdated=function(){var a=location.pathname+location.search;location.search.match(/[?&]updated=/)||(a+="&updated=1"),a+=location.hash,location.assign(a)},as3cf.showSettingsSavedNotice=function(){if(!(0<a("#setting-error-settings_updated:visible").length||0<a("#as3cf-settings_updated:visible").length)){var b='<div id="as3cf-settings_updated" class="updated settings-error notice is-dismissible"><p><strong>'+as3cf.strings.settings_saved+"</strong></p></div>";a("h2.nav-tab-wrapper").after(b),a(document).trigger("wp-updates-notice-added")}},a(document).ready(function(){k(),window.onhashchange=function(a){"function"==typeof history.replaceState&&"#"===location.href.slice(-1)&&history.replaceState({},"",location.href.slice(0,-1)),k()};var i=a(".as3cf-main .nav-tab-wrapper");a(".as3cf-compatibility-notice, div.updated, div.error, div.notice").not(".below-h2, .inline").insertAfter(i),p.length&&p.each(function(a,b){m[b.id]=c(b.id)}),a(window).on("beforeunload.as3cf-settings",function(){if(!a.isEmptyObject(m)){var b=l.attr("id");return c(b)!==m[b]?as3cf.strings.save_alert:void 0}}),a(document).on("submit",".as3cf-main-settings form",function(b){a(window).off("beforeunload.as3cf-settings")}),a(".as3cf-switch").on("click",function(b){a(this).hasClass("disabled")||d(a(this).attr("id"))}),p.on("change",".sub-toggle",function(b){var c=a(this).attr("id");a(".as3cf-setting."+c).toggleClass("hide")}),a(".as3cf-domain").on("change",'input[type="radio"]',function(b){var c=a(this).closest('input:radio[name="domain"]:checked'),d=c.val(),e=a(this).parents(".as3cf-domain").find(".as3cf-setting.cloudfront"),f="cloudfront"===d;e.toggleClass("hide",!f)}),a(".url-preview").on("change","input",function(a){j()}),g(),a("#as3cf-serve-from-s3,#as3cf-remove-local-file").on("change",function(a){g()}),h(),a("#as3cf-remove-local-file").on("change",function(a){h()}),a('.as3cf-setting input[type="text"]').keypress(function(a){if(13===a.which)return a.preventDefault(),!1}),a('input[name="cloudfront"]').on("keyup",function(b){e(a(this))}),a('input[name="domain"]').on("change",function(b){var c=a(this),d=a("#"+l.attr("id")+' form button[type="submit"]');"cloudfront"!==c.val()?d.prop("disabled",!1):e(c.next(".as3cf-setting").find('input[name="cloudfront"]'))}),a('input[name="object-prefix"]').on("change",function(a){f()}),a("#tab-media > .as3cf-bucket-error").detach().insertAfter(".as3cf-bucket-container h3"),as3cf.buckets.disabledButtons(),o.on("click",".bucket-action-refresh",function(a){a.preventDefault(),as3cf.buckets.loadList(!0)}),o.on("change",".bucket-select-region",function(a){a.preventDefault(),as3cf.buckets.loadList(!0)}),0<a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select").length&&as3cf.buckets.loadList(!0),o.on("click",".as3cf-bucket-list a",function(b){b.preventDefault(),as3cf.buckets.setSelected(a(this)),as3cf.buckets.disabledButtons()}),a(".as3cf-bucket-container").on("click","a.js-link",function(b){return b.preventDefault(),window.open(a(this).attr("href")),!1}),o.on("input keyup",".as3cf-bucket-create .as3cf-bucket-name",function(b){var c=a(this).val();as3cf.buckets.updateNameNotice(c),as3cf.buckets.disabledButtons()}),o.on("input keyup",".as3cf-bucket-manual .as3cf-bucket-name",function(b){var c=a(this).val();as3cf.buckets.updateNameNotice(c),as3cf.buckets.disabledButtons()}),a('.as3cf-bucket-container input[type="text"]').keypress(function(a){if(13===a.which)return a.preventDefault(),!1})})}(jQuery,as3cfModal);
1
+ !function(a,b){function c(b){return a("#"+b+" .as3cf-main-settings form").find("input:not(.no-compare)").serialize()}function d(a){var b=o.find("#"+a),c=b.find("input[type=checkbox]");b.toggleClass("on").find("span").toggleClass("checked");var d=b.find("span.on").hasClass("checked");c.prop("checked",d).trigger("change")}function e(b){var c=b.next(".as3cf-validation-error"),d=a("#"+o.attr("id")+' form button[type="submit"]'),e=/[^a-zA-Z0-9\.\-]/;e.test(b.val())?(c.show(),d.prop("disabled",!0)):(c.hide(),d.prop("disabled",!1))}function f(b){var c=b.next(".as3cf-validation-error"),d=a("#"+o.attr("id")+' form button[type="submit"]'),e=/[^a-zA-Z0-9]/;e.test(b.val())?(c.show(),d.prop("disabled",!0)):(c.hide(),d.prop("disabled",!1))}function g(b){var c=b.next(".as3cf-validation-error"),d=a("#"+o.attr("id")+' form button[type="submit"]'),e=/[^a-zA-Z0-9\.\-\\:\/ ]/;e.test(b.val())?(c.show(),d.prop("disabled",!0)):(c.hide(),d.prop("disabled",!1))}function h(b){var c=b.next(".as3cf-validation-error"),d=a("#"+o.attr("id")+' form button[type="submit"]'),e=/[^a-zA-Z0-9\-\/ ]/;e.test(b.val())?(c.show(),d.prop("disabled",!0)):(c.hide(),d.prop("disabled",!1))}function i(){var c=a("#"+b.prefix+"-bucket").val(),d=o.find('input[name="object-prefix"]'),e=d.val();""!==e&&(e=as3cf.provider_console_url_prefix_param+encodeURIComponent(e));var f=as3cf.provider_console_url+c+e;a("#"+b.prefix+"-view-bucket").attr("href",f)}function j(){a("#as3cf-remove-local-file").is(":checked")&&a("#as3cf-serve-from-s3").is(":not(:checked)")?a("#as3cf-lost-files-notice").show():a("#as3cf-lost-files-notice").hide()}function k(){a("#as3cf-remove-local-file").is(":checked")?a("#as3cf-remove-local-notice").show():a("#as3cf-remove-local-notice").hide()}function l(b){!0!==b?a("#as3cf-seo-friendly-url-notice").show():a("#as3cf-seo-friendly-url-notice").hide()}function m(){a(".as3cf-url-preview").html("Generating...");var b={_nonce:as3cf.nonces.get_url_preview};a.each(a("#tab-"+as3cf.tabs.defaultTab+" .as3cf-main-settings form").serializeArray(),function(c,d){var e=d.name,f=d.value;e=e.replace("[]",""),b[e]=void 0===b[e]?f:a.isArray(b[e])?b[e].concat(f):[b[e],f]}),b.action="as3cf-get-url-preview",a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:b,error:function(a,b,c){alert(as3cf.strings.get_url_preview_error+c)},success:function(b,c,d){"undefined"!=typeof b.success?(a(".as3cf-url-preview").html(b.url),l(b.seo_friendly)):alert(as3cf.strings.get_url_preview_error+b.error)}})}function n(){return"#"+as3cf.tabs.defaultTab===location.hash?void(location.hash=""):(as3cf.tabs.toggle(location.hash.replace("#",""),!0),void a(document).trigger("as3cf.tabRendered",[location.hash.replace("#","")]))}var o,p={},q=/[^a-z0-9.-]/,r=a("body"),s=a(".as3cf-tab");a(".as3cf-settings");as3cf.tabs={defaultTab:"media",toggle:function(c,d){c=as3cf.tabs.sanitizeHash(c),s.hide(),o=a("#tab-"+c),o.show(),a(".nav-tab").removeClass("nav-tab-active"),a('a.nav-tab[data-tab="'+c+'"]').addClass("nav-tab-active"),a(".as3cf-main").data("tab",c),o.data("prefix")&&(b.prefix=o.data("prefix")),d||a(".as3cf-updated").removeClass("show"),"support"===c&&as3cf.tabs.getDiagnosticInfo()},getDiagnosticInfo:function(){var b=a(".debug-log-textarea");b.html(as3cf.strings.get_diagnostic_info);var c={action:"as3cf-get-diagnostic-info",_nonce:as3cf.nonces.get_diagnostic_info};a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:c,error:function(a,c,d){b.html(d)},success:function(a,c,d){"undefined"!=typeof a.success?b.html(a.diagnostic_info):(b.html(as3cf.strings.get_diagnostic_info_error),b.append(a.error))}})},sanitizeHash:function(b){var c=a("#tab-"+b);return 0===c.length&&(b=as3cf.tabs.defaultTab),b}},as3cf.buckets={validLength:3,bucketSelectLock:!1,loadList:function(c){"undefined"==typeof c&&(c=!1);var d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select"),e=d.find(".bucket-select-region"),f=d.find(".as3cf-bucket-list"),g=a("#"+b.prefix+"-bucket").val();if(!1===c&&f.find("li").length>1)return a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+g+'"]').addClass("selected"),void this.scrollToSelected();f.html('<li class="loading">'+f.data("working")+"</li>"),this.disabledButtons();var h={action:b.prefix+"-get-buckets",_nonce:window[b.prefix.replace(/-/g,"_")].nonces.get_buckets};e.val()&&(h.region=e.val());var i=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:h,error:function(a,b,c){f.html(""),i.showError(as3cf.strings.get_buckets_error,c,"as3cf-bucket-select")},success:function(b,c,d){f.html(""),"undefined"!=typeof b.success?(a(".as3cf-bucket-error").hide(),0===b.buckets.length?f.html('<li class="loading">'+f.data("nothing-found")+"</li>"):(a(b.buckets).each(function(a,b){var c=b.Name===g?"selected":"";f.append('<li><a class="'+c+'" href="#" data-bucket="'+b.Name+'"><span class="bucket"><span class="dashicons dashicons-portfolio"></span> '+b.Name+'</span><span class="spinner"></span></span></a></li>')}),i.scrollToSelected(),i.disabledButtons())):i.showError(as3cf.strings.get_buckets_error,b.error,"as3cf-bucket-select")}})},scrollToSelected:function(){if(a(".as3cf-bucket-list a.selected").length){var b=a("ul.as3cf-bucket-list li").first().position().top+150;a(".as3cf-bucket-list").animate({scrollTop:a("ul.as3cf-bucket-list li a.selected").position().top-b})}},setSelected:function(c){a(".as3cf-bucket-list a").removeClass("selected"),c.addClass("selected"),a("#"+b.prefix+"-bucket-select-name").val(c.data("bucket"))},disabledButtons:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-create"),d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-manual"),e=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select");0===c.length&&0===d.length&&0===e.length||(0<c.length&&this.isValidName(c.find(".as3cf-bucket-name").val())?c.find("button[type=submit]").prop("disabled",!1):c.find("button[type=submit]").prop("disabled",!0),0<d.length&&this.isValidName(d.find(".as3cf-bucket-name").val())?d.find("button[type=submit]").prop("disabled",!1):d.find("button[type=submit]").prop("disabled",!0),0<e.length&&1===e.find(".as3cf-bucket-list a.selected").length?e.find("button[type=submit]").prop("disabled",!1):e.find("button[type=submit]").prop("disabled",!0))},showError:function(b,c,d){var e=a(".as3cf-bucket-container").children(":visible"),f=e.find(".as3cf-bucket-error");d="undefined"==typeof d?null:d,d&&!e.hasClass(d)||(f.find("span.title").html(b+" &mdash;"),f.find("span.message").html(c),f.show(),this.bucketSelectLock=!1)},isValidName:function(a){return!(a.length<3||a.length>63)&&!0!==q.test(a)},updateNameNotice:function(b){var c=null;!0===q.test(b)?c=as3cf.strings.create_bucket_invalid_chars:b.length<3?c=as3cf.strings.create_bucket_name_short:b.length>63&&(c=as3cf.strings.create_bucket_name_long),c&&b.length>0?a(".as3cf-invalid-bucket-name").html(c):a(".as3cf-invalid-bucket-name").html("")}},as3cf.reloadUpdated=function(){var a=location.pathname+location.search;location.search.match(/[?&]updated=/)||(a+="&updated=1"),a+=location.hash,location.assign(a)},as3cf.showSettingsSavedNotice=function(){if(!(0<a("#setting-error-settings_updated:visible").length||0<a("#as3cf-settings_updated:visible").length)){var b='<div id="as3cf-settings_updated" class="updated settings-error notice is-dismissible"><p><strong>'+as3cf.strings.settings_saved+"</strong></p></div>";a("h2.nav-tab-wrapper").after(b),a(document).trigger("wp-updates-notice-added")}},as3cf.Settings=as3cf.Settings?as3cf.Settings:{},as3cf.Settings.Media={lock:function(b){a("#as3cf-media-settings-locked-"+b).show(),a(".as3cf-media-settings").addClass("locked locked-"+b),a(".as3cf-media-settings.locked-"+b).each(function(){a(this).find("input,button").prop("disabled",!0),a(this).find(".as3cf-settings-container").addClass("as3cf-locked-setting"),a(this).find("a.as3cf-change-settings").hide()})},unlock:function(b){a(".as3cf-media-settings.locked-"+b).each(function(){a(this).find("input,button").filter(":not(.disabled)").prop("disabled",!1),a(this).find(".as3cf-settings-container").removeClass("as3cf-locked-setting"),a(this).find("a.as3cf-change-settings").show(),a(this).removeClass("locked locked-"+b)}),a("#as3cf-media-settings-locked-"+b).hide()}},a(document).ready(function(){n(),window.onhashchange=function(a){"function"==typeof history.replaceState&&"#"===location.href.slice(-1)&&history.replaceState({},"",location.href.slice(0,-1)),n()};var l=a(".as3cf-main .nav-tab-wrapper");a(".as3cf-compatibility-notice, div.updated, div.error, div.notice").not(".below-h2, .inline").insertAfter(l),s.length&&s.each(function(a,b){p[b.id]=c(b.id)}),a(window).on("beforeunload.as3cf-settings",function(){if(!a.isEmptyObject(p)){var b=o.attr("id");return c(b)!==p[b]?as3cf.strings.save_alert:void 0}}),a(document).on("submit",".as3cf-main-settings form",function(b){a(window).off("beforeunload.as3cf-settings")}),a(".as3cf-switch").on("click",function(b){a(this).hasClass("disabled")||a(this).parents().hasClass("locked")||d(a(this).attr("id"))}),s.on("change",".sub-toggle",function(b){var c=a(this).attr("id");a(".as3cf-setting."+c).toggleClass("hide")}),a(".url-preview").on("change","input",function(a){m()}),j(),a("#as3cf-serve-from-s3,#as3cf-remove-local-file").on("change",function(a){j()}),k(),a("#as3cf-remove-local-file").on("change",function(a){k()}),a('.as3cf-setting input[type="text"]').keypress(function(a){if(13===a.which)return a.preventDefault(),!1}),a(".as3cf-enable-delivery-domain-container").on("change",'input[type="checkbox"]',function(b){var c=a(this).is(":checked"),d=a(this).parents(".as3cf-enable-delivery-domain-container").find(".as3cf-setting.as3cf-delivery-domain");d.toggleClass("hide",!c);var e=a(this).parents(".as3cf-enable-delivery-domain-container").siblings(".as3cf-enable-signed-urls-container");e.toggleClass("hide",!c)}),a('input[name="enable-delivery-domain"]').on("change",function(b){var c=a(this),d=a("#"+o.attr("id")+' form button[type="submit"]');"1"!==c.val()?d.prop("disabled",!1):e(c.next(".as3cf-setting").find('input[name="delivery-domain"]'))}),a('input[name="delivery-domain"]').on("keyup",function(b){e(a(this))}),a(".as3cf-enable-signed-urls-container").on("change",'input[type="checkbox"]',function(b){var c=a(this).is(":checked"),d=a(this).parents(".as3cf-enable-signed-urls-container").find(".as3cf-setting.as3cf-signed-urls");d.toggleClass("hide",!c)}),a('input[name="signed-urls-key-id"]').on("keyup",function(b){f(a(this))}),a('input[name="enable-signed-urls-key-id"]').on("change",function(b){var c=a(this),d=a("#"+o.attr("id")+' form button[type="submit"]');"1"!==c.val()?d.prop("disabled",!1):f(c.next(".as3cf-setting").find('input[name="signed-urls-key-id"]'))}),a('input[name="signed-urls-key-file-path"]').on("keyup",function(b){g(a(this))}),a('input[name="enable-signed-urls-key-file-path"]').on("change",function(b){var c=a(this),d=a("#"+o.attr("id")+' form button[type="submit"]');"1"!==c.val()?d.prop("disabled",!1):g(c.next(".as3cf-setting").find('input[name="signed-urls-key-file-path"]'))}),a('input[name="signed-urls-object-prefix"]').on("keyup",function(b){h(a(this))}),a('input[name="enable-signed-urls-object-prefix"]').on("change",function(b){var c=a(this),d=a("#"+o.attr("id")+' form button[type="submit"]');"1"!==c.val()?d.prop("disabled",!1):h(c.next(".as3cf-setting").find('input[name="signed-urls-object-prefix"]'))}),a('input[name="object-prefix"]').on("change",function(a){i()}),a("#tab-media > .as3cf-bucket-error").detach().insertAfter(".as3cf-bucket-container h3"),as3cf.buckets.disabledButtons(),r.on("click",".bucket-action-refresh",function(a){a.preventDefault(),as3cf.buckets.loadList(!0)}),r.on("change",".bucket-select-region",function(a){a.preventDefault(),as3cf.buckets.loadList(!0)}),0<a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select").length&&as3cf.buckets.loadList(!0),r.on("click",".as3cf-bucket-list a",function(b){b.preventDefault(),as3cf.buckets.setSelected(a(this)),as3cf.buckets.disabledButtons()}),a(".as3cf-bucket-container").on("click","a.js-link",function(b){return b.preventDefault(),window.open(a(this).attr("href")),!1}),r.on("input keyup",".as3cf-bucket-create .as3cf-bucket-name",function(b){var c=a(this).val();as3cf.buckets.updateNameNotice(c),as3cf.buckets.disabledButtons()}),r.on("input keyup",".as3cf-bucket-manual .as3cf-bucket-name",function(b){var c=a(this).val();as3cf.buckets.updateNameNotice(c),as3cf.buckets.disabledButtons()}),a('.as3cf-bucket-container input[type="text"]').keypress(function(a){if(13===a.which)return a.preventDefault(),!1}),a(".as3cf-change-bucket-access-prompt").on("change","#origin-access-identity-confirmation",function(b){a("#block-public-access-confirmed").prop("disabled",!a(this).prop("checked"))}),a(".as3cf-media-settings.locked.locked-upgrade").each(function(){as3cf.Settings.Media.lock("upgrade")})})}(jQuery,as3cfModal);
assets/sass/delivery-provider.scss ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .as3cf-delivery-provider-select {
2
+ .as3cf-delivery-provider-select-options {
3
+ margin-bottom: 30px;
4
+
5
+ .as3cf-delivery-provider-sub-option {
6
+ margin-left: 25px;
7
+
8
+ .as3cf-setting {
9
+ display: none;
10
+ margin-left: 25px;
11
+ }
12
+
13
+ &.selected {
14
+ .as3cf-setting {
15
+ display: block;
16
+ }
17
+ }
18
+ }
19
+
20
+ .as3cf-delivery-provider-sub-option-container > .as3cf-delivery-provider-sub-option {
21
+ display: none;
22
+ }
23
+
24
+ .as3cf-delivery-provider-sub-option-container.selected > .as3cf-delivery-provider-sub-option {
25
+ display: block;
26
+ }
27
+ }
28
+ }
assets/sass/media.scss CHANGED
@@ -1,6 +1,98 @@
1
  body.as3cf-pro {
 
 
 
 
2
  .attachments-browser .media-toolbar-secondary {
3
  max-width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
5
  }
6
 
@@ -23,4 +115,4 @@ body.as3cf-pro {
23
  .attachment-info .attachment-s3-details {
24
  font-weight: bold;
25
  margin-bottom: 5px;
26
- }
1
  body.as3cf-pro {
2
+ .media-toolbar-mode-select {
3
+ overflow: visible;
4
+ }
5
+
6
  .attachments-browser .media-toolbar-secondary {
7
  max-width: 100%;
8
+
9
+ .offload-buttons {
10
+ margin-right: 10px;
11
+ position: relative;
12
+ display: none !important;
13
+
14
+ &.visible {
15
+ display: inline-block !important;
16
+ }
17
+
18
+ .button {
19
+ margin: 0;
20
+ text-align: left;
21
+
22
+ @media screen and (max-width: 782px) {
23
+ min-height: 40px;
24
+ }
25
+ }
26
+ }
27
+
28
+ .offload-buttons__action-default {
29
+ width: calc(100% - 32px);
30
+ position: relative;
31
+ z-index: 2;
32
+ }
33
+
34
+ .offload-buttons__toggle {
35
+ width: 32px;
36
+ position: relative;
37
+ border-left: 1px solid rgba(255, 255, 255, 0.2);
38
+ z-index: 2;
39
+
40
+ &:focus {
41
+ box-shadow: none;
42
+ }
43
+
44
+ &::after {
45
+ content: '';
46
+ display: inline-block;
47
+ width: 0;
48
+ height: 0;
49
+ vertical-align: 0.255em;
50
+ border-top: 0.3em solid;
51
+ border-right: 0.3em solid transparent;
52
+ border-bottom: 0;
53
+ border-left: 0.3em solid transparent;
54
+ transition: 0.2s all ease;
55
+ }
56
+
57
+ &.opened {
58
+ &::after {
59
+ transform: rotate(180deg);
60
+ }
61
+ }
62
+ }
63
+
64
+ .offload-buttons__submenu {
65
+ position: absolute;
66
+ left: 0;
67
+ top: 0;
68
+ z-index: 1;
69
+ transform: translateY(33px);
70
+ border-radius: 3px;
71
+ overflow: hidden;
72
+ box-shadow: 0 2px 5px 2px rgba(0, 0, 0, 0.3);
73
+
74
+ @media screen and (max-width: 782px) {
75
+ transform: translateY(41px);
76
+ }
77
+ }
78
+
79
+ .offload-buttons__action {
80
+ display: block;
81
+ width: 100%;
82
+ margin: 0;
83
+ border-radius: 0;
84
+ text-align-last: left;
85
+ border: none;
86
+ border-bottom: 1px solid rgba(255, 255, 255, 0.2);
87
+
88
+ &:last-child {
89
+ border: none;
90
+ }
91
+
92
+ &:focus {
93
+ box-shadow: none;
94
+ }
95
+ }
96
  }
97
  }
98
 
115
  .attachment-info .attachment-s3-details {
116
  font-weight: bold;
117
  margin-bottom: 5px;
118
+ }
assets/sass/styles.scss CHANGED
@@ -78,10 +78,12 @@ $as3cf_assets: #0769ad;
78
  .as3cf-notice, .error, .updated, .updated.show {
79
  display: none;
80
  }
 
81
  .fatal .error, .as3cf-notice.important, .dbrains-api-down {
82
  display: block;
83
  }
84
  }
 
85
  .as3cf-notice, .error, .updated {
86
  max-width: 650px;
87
  margin-top: 15px;
@@ -90,6 +92,7 @@ $as3cf_assets: #0769ad;
90
 
91
  .as3cf-updated {
92
  display: none;
 
93
  &.as3cf-notice, &.show {
94
  display: block;
95
  }
@@ -106,27 +109,38 @@ $as3cf_assets: #0769ad;
106
  }
107
 
108
  /**
109
- * Show Storage Provider / Bucket Select / media Settings
110
  */
111
  .as3cf-tab {
 
112
  .as3cf-main-settings {
113
  .as3cf-provider-select {
114
  display: none;
115
  }
116
 
117
- .as3cf-bucket-container {
 
118
  display: none;
119
 
120
- a.as3cf-change-provider {
121
- display: none;
122
  }
123
  }
124
 
 
 
 
 
 
 
 
 
125
  .as3cf-media-settings {
126
  display: none;
127
  }
128
  }
129
 
 
130
  &.as3cf-needs-access-keys, &.as3cf-has-access-keys.as3cf-change-provider {
131
  .as3cf-can-write-error {
132
  display: none;
@@ -141,12 +155,21 @@ $as3cf_assets: #0769ad;
141
  display: none;
142
  }
143
 
 
 
 
 
 
 
 
 
144
  .as3cf-media-settings {
145
  display: none;
146
  }
147
  }
148
  }
149
 
 
150
  &.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider), &.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) {
151
  .as3cf-can-write-error {
152
  display: none;
@@ -161,13 +184,55 @@ $as3cf_assets: #0769ad;
161
  display: block;
162
  }
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  .as3cf-media-settings {
165
  display: none;
166
  }
167
  }
168
  }
169
 
170
- &.as3cf-has-access-keys.as3cf-has-bucket:not(.as3cf-change-provider):not(.as3cf-change-bucket) {
 
 
 
 
 
171
  .as3cf-main-settings {
172
  .as3cf-provider-select {
173
  display: none;
@@ -177,6 +242,39 @@ $as3cf_assets: #0769ad;
177
  display: none;
178
  }
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  .as3cf-media-settings {
181
  display: block;
182
  }
@@ -210,6 +308,7 @@ $as3cf_assets: #0769ad;
210
  .as3cf-main-settings {
211
  p {
212
  font-size: 13px;
 
213
  a {
214
  color: #444;
215
  }
@@ -235,6 +334,7 @@ $as3cf_assets: #0769ad;
235
  padding: 0 20px 10px;
236
  overflow-x: scroll;
237
  }
 
238
  span {
239
  color: #aaa;
240
  text-transform: uppercase;
@@ -246,6 +346,7 @@ $as3cf_assets: #0769ad;
246
  label {
247
  display: block;
248
  margin-bottom: 10px;
 
249
  &.disabled, &.disabled p {
250
  color: #bbb;
251
  cursor: default;
@@ -257,6 +358,7 @@ $as3cf_assets: #0769ad;
257
  color: #6b6b6b;
258
  margin: 0;
259
  font-size: 12px;
 
260
  &.as3cf-setting {
261
  margin-top: 5px;
262
  }
@@ -324,6 +426,16 @@ $as3cf_assets: #0769ad;
324
  &.hide {
325
  display: none;
326
  }
 
 
 
 
 
 
 
 
 
 
327
  }
328
 
329
  div.as3cf-setting {
@@ -343,18 +455,27 @@ $as3cf_assets: #0769ad;
343
  border-bottom: 1px solid #ddd;
344
  padding: 20px 0px;
345
  }
 
346
  &.as3cf-setting-title td {
347
  padding-bottom: 0;
348
  }
 
349
  &.as3cf-setting-title:first-child td {
350
  padding-top: 20px;
351
  }
 
352
  &.configure-url:first-child td {
353
  padding-top: 5px;
354
  padding-bottom: 0;
355
  }
 
 
 
 
 
356
  td {
357
  padding: 15px 0;
 
358
  &:first-child {
359
  vertical-align: top;
360
  min-width: 120px;
@@ -375,6 +496,7 @@ $as3cf_assets: #0769ad;
375
  padding: 0;
376
  margin: 0;
377
  }
 
378
  h4 {
379
  margin: 0;
380
  }
@@ -388,12 +510,15 @@ $as3cf_assets: #0769ad;
388
  color: #444;
389
  text-decoration: none;
390
  margin-right: 10px;
 
391
  &:hover, &:active {
392
  color: #00a0d2;
393
  }
 
394
  &:focus {
395
  box-shadow: none;
396
  }
 
397
  .dashicons-external {
398
  margin-top: -2px;
399
  }
@@ -463,12 +588,13 @@ $as3cf_assets: #0769ad;
463
  background: #ccc;
464
  color: #fff;
465
  padding: 2px 5px;
466
- margin: 0 0 5px 5px;
467
  float: right;
468
  white-space: nowrap;
 
469
  }
470
 
471
- .as3cf-defined-setting {
472
  color: #bbb;
473
 
474
  label {
@@ -489,21 +615,50 @@ $as3cf_assets: #0769ad;
489
  }
490
 
491
  p.actions {
492
- margin: 20px -30px -30px;
493
- padding: 20px 30px;
494
- border-top: none;
 
495
  overflow: hidden;
496
 
 
497
  .right {
 
498
  margin-left: 15px;
 
 
499
 
500
  &:last-of-type {
501
  margin-left: 0;
502
  }
503
  }
504
 
505
- button {
506
- min-width: 90px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
507
  }
508
  }
509
  }
@@ -555,9 +710,11 @@ $as3cf_assets: #0769ad;
555
  margin: 0;
556
  }
557
  }
 
558
  .as3cf-bucket-list {
559
  margin: 5px 0 0 0;
560
  }
 
561
  td {
562
  padding: 5px 0;
563
 
@@ -566,10 +723,14 @@ $as3cf_assets: #0769ad;
566
  line-height: 30px;
567
  vertical-align: top;
568
  }
 
 
 
 
569
  }
570
  }
571
 
572
- .bucket-actions {
573
  margin: 15px 0;
574
  border-top: 1px solid #ccc;
575
  padding-top: 15px;
@@ -586,7 +747,7 @@ $as3cf_assets: #0769ad;
586
  margin-right: 20px;
587
  line-height: 28px;
588
  }
589
- }
590
 
591
  .as3cf-bucket-list {
592
  padding: 15px;
@@ -620,12 +781,45 @@ $as3cf_assets: #0769ad;
620
  }
621
  }
622
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
623
  #tab-media {
624
  display: block;
625
  }
626
 
627
  #tab-support {
628
  min-height: 900px;
 
629
  .as3cf-sidebar {
630
  top: 11px;
631
  }
@@ -962,6 +1156,7 @@ textarea.as3cf-access-key-constants-snippet.code {
962
 
963
  .extra {
964
  background: white;
 
965
  a {
966
  color: $as3cf_assets;
967
  text-decoration: none;
78
  .as3cf-notice, .error, .updated, .updated.show {
79
  display: none;
80
  }
81
+
82
  .fatal .error, .as3cf-notice.important, .dbrains-api-down {
83
  display: block;
84
  }
85
  }
86
+
87
  .as3cf-notice, .error, .updated {
88
  max-width: 650px;
89
  margin-top: 15px;
92
 
93
  .as3cf-updated {
94
  display: none;
95
+
96
  &.as3cf-notice, &.show {
97
  display: block;
98
  }
109
  }
110
 
111
  /**
112
+ * Show Storage Provider / Bucket Select / Delivery Provider Select / media Settings
113
  */
114
  .as3cf-tab {
115
+ /* Initial State: Show Nothing (overridden below) */
116
  .as3cf-main-settings {
117
  .as3cf-provider-select {
118
  display: none;
119
  }
120
 
121
+ .as3cf-bucket-container,
122
+ .as3cf-change-bucket-access-prompt {
123
  display: none;
124
 
125
+ h3 {
126
+ margin-bottom: -0.5em;
127
  }
128
  }
129
 
130
+ a.as3cf-change-provider {
131
+ display: none;
132
+ }
133
+
134
+ .as3cf-delivery-provider-select {
135
+ display: none;
136
+ }
137
+
138
  .as3cf-media-settings {
139
  display: none;
140
  }
141
  }
142
 
143
+ /* Need/Change Storage Provider */
144
  &.as3cf-needs-access-keys, &.as3cf-has-access-keys.as3cf-change-provider {
145
  .as3cf-can-write-error {
146
  display: none;
155
  display: none;
156
  }
157
 
158
+ .as3cf-change-bucket-access-prompt {
159
+ display: none;
160
+ }
161
+
162
+ .as3cf-delivery-provider-select {
163
+ display: none;
164
+ }
165
+
166
  .as3cf-media-settings {
167
  display: none;
168
  }
169
  }
170
  }
171
 
172
+ /* Need/Change Bucket */
173
  &.as3cf-has-access-keys.as3cf-needs-bucket:not(.as3cf-change-provider), &.as3cf-has-access-keys.as3cf-change-bucket:not(.as3cf-change-provider) {
174
  .as3cf-can-write-error {
175
  display: none;
184
  display: block;
185
  }
186
 
187
+ .as3cf-change-bucket-access-prompt {
188
+ display: none;
189
+ }
190
+
191
+ .as3cf-delivery-provider-select {
192
+ display: none;
193
+ }
194
+
195
+ .as3cf-media-settings {
196
+ display: none;
197
+ }
198
+ }
199
+ }
200
+
201
+ /* Change Bucket Access */
202
+ &.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-bucket-access {
203
+ .as3cf-can-write-error {
204
+ display: none;
205
+ }
206
+
207
+ .as3cf-main-settings {
208
+ .as3cf-provider-select {
209
+ display: none;
210
+ }
211
+
212
+ .as3cf-bucket-container {
213
+ display: none;
214
+ }
215
+
216
+ .as3cf-change-bucket-access-prompt {
217
+ display: block;
218
+ }
219
+
220
+ .as3cf-delivery-provider-select {
221
+ display: none;
222
+ }
223
+
224
  .as3cf-media-settings {
225
  display: none;
226
  }
227
  }
228
  }
229
 
230
+ /* Change Delivery Provider */
231
+ &.as3cf-has-access-keys.as3cf-has-bucket.as3cf-change-delivery-provider {
232
+ .as3cf-can-write-error {
233
+ display: none;
234
+ }
235
+
236
  .as3cf-main-settings {
237
  .as3cf-provider-select {
238
  display: none;
242
  display: none;
243
  }
244
 
245
+ .as3cf-change-bucket-access-prompt {
246
+ display: none;
247
+ }
248
+
249
+ .as3cf-delivery-provider-select {
250
+ display: block;
251
+ }
252
+
253
+ .as3cf-media-settings {
254
+ display: none;
255
+ }
256
+ }
257
+ }
258
+
259
+ /* Normal Media Settings */
260
+ &.as3cf-has-access-keys.as3cf-has-bucket:not(.as3cf-change-provider):not(.as3cf-change-bucket):not(.as3cf-change-bucket-access):not(.as3cf-change-delivery-provider) {
261
+ .as3cf-main-settings {
262
+ .as3cf-provider-select {
263
+ display: none;
264
+ }
265
+
266
+ .as3cf-bucket-container {
267
+ display: none;
268
+ }
269
+
270
+ .as3cf-change-bucket-access-prompt {
271
+ display: none;
272
+ }
273
+
274
+ .as3cf-delivery-provider-select {
275
+ display: none;
276
+ }
277
+
278
  .as3cf-media-settings {
279
  display: block;
280
  }
308
  .as3cf-main-settings {
309
  p {
310
  font-size: 13px;
311
+
312
  a {
313
  color: #444;
314
  }
334
  padding: 0 20px 10px;
335
  overflow-x: scroll;
336
  }
337
+
338
  span {
339
  color: #aaa;
340
  text-transform: uppercase;
346
  label {
347
  display: block;
348
  margin-bottom: 10px;
349
+
350
  &.disabled, &.disabled p {
351
  color: #bbb;
352
  cursor: default;
358
  color: #6b6b6b;
359
  margin: 0;
360
  font-size: 12px;
361
+
362
  &.as3cf-setting {
363
  margin-top: 5px;
364
  }
426
  &.hide {
427
  display: none;
428
  }
429
+
430
+ .as3cf-sub-setting {
431
+ .as3cf-sub-setting-heading {
432
+ padding-top: 15px;
433
+ }
434
+
435
+ .as3cf-defined-in-config {
436
+ margin-top: 15px;
437
+ }
438
+ }
439
  }
440
 
441
  div.as3cf-setting {
455
  border-bottom: 1px solid #ddd;
456
  padding: 20px 0px;
457
  }
458
+
459
  &.as3cf-setting-title td {
460
  padding-bottom: 0;
461
  }
462
+
463
  &.as3cf-setting-title:first-child td {
464
  padding-top: 20px;
465
  }
466
+
467
  &.configure-url:first-child td {
468
  padding-top: 5px;
469
  padding-bottom: 0;
470
  }
471
+
472
+ &.hide {
473
+ display: none;
474
+ }
475
+
476
  td {
477
  padding: 15px 0;
478
+
479
  &:first-child {
480
  vertical-align: top;
481
  min-width: 120px;
496
  padding: 0;
497
  margin: 0;
498
  }
499
+
500
  h4 {
501
  margin: 0;
502
  }
510
  color: #444;
511
  text-decoration: none;
512
  margin-right: 10px;
513
+
514
  &:hover, &:active {
515
  color: #00a0d2;
516
  }
517
+
518
  &:focus {
519
  box-shadow: none;
520
  }
521
+
522
  .dashicons-external {
523
  margin-top: -2px;
524
  }
588
  background: #ccc;
589
  color: #fff;
590
  padding: 2px 5px;
591
+ margin: 0 0 3px 5px;
592
  float: right;
593
  white-space: nowrap;
594
+ clear: right;
595
  }
596
 
597
+ .as3cf-defined-setting, .as3cf-locked-setting {
598
  color: #bbb;
599
 
600
  label {
615
  }
616
 
617
  p.actions {
618
+ margin: 30px 0;
619
+ border-top: 1px solid #ccc;
620
+ //padding: 20px 30px;
621
+ padding-top: 15px;
622
  overflow: hidden;
623
 
624
+ button,
625
  .right {
626
+ float: right;
627
  margin-left: 15px;
628
+ margin-right: 0;
629
+ min-width: 90px;
630
 
631
  &:last-of-type {
632
  margin-left: 0;
633
  }
634
  }
635
 
636
+ span {
637
+ display: inline-block;
638
+ margin-right: 20px;
639
+ line-height: 28px;
640
+ }
641
+ }
642
+
643
+ /**
644
+ * When entire tab's settings are locked.
645
+ */
646
+ .locked {
647
+ .as3cf-radio-group {
648
+ label, label p {
649
+ color: #bbb;
650
+ cursor: default;
651
+ }
652
+ }
653
+
654
+ .as3cf-switch {
655
+ cursor: default;
656
+ background: #e6e6e6;
657
+
658
+ span {
659
+ background: #f1f1f1;
660
+ color: #d6d6d6;
661
+ }
662
  }
663
  }
664
  }
710
  margin: 0;
711
  }
712
  }
713
+
714
  .as3cf-bucket-list {
715
  margin: 5px 0 0 0;
716
  }
717
+
718
  td {
719
  padding: 5px 0;
720
 
723
  line-height: 30px;
724
  vertical-align: top;
725
  }
726
+
727
+ .as3cf-defined-in-config {
728
+ margin-top: -1.75em;
729
+ }
730
  }
731
  }
732
 
733
+ /*.bucket-actions {
734
  margin: 15px 0;
735
  border-top: 1px solid #ccc;
736
  padding-top: 15px;
747
  margin-right: 20px;
748
  line-height: 28px;
749
  }
750
+ }*/
751
 
752
  .as3cf-bucket-list {
753
  padding: 15px;
781
  }
782
  }
783
 
784
+ /**
785
+ * Change Bucket Access
786
+ */
787
+ .as3cf-change-bucket-access-prompt {
788
+ h3 {
789
+ line-height: 1.3;
790
+ text-transform: none;
791
+ }
792
+
793
+ .as3cf-radio-group {
794
+ margin-bottom: 25px;
795
+ }
796
+
797
+ .note {
798
+ color: #999;
799
+ }
800
+ }
801
+
802
+ /**
803
+ * Change Delivery Provider
804
+ */
805
+ .as3cf-delivery-provider-select {
806
+ h3 {
807
+ line-height: 1.3;
808
+ text-transform: none;
809
+ }
810
+
811
+ .note {
812
+ color: #999;
813
+ }
814
+ }
815
+
816
  #tab-media {
817
  display: block;
818
  }
819
 
820
  #tab-support {
821
  min-height: 900px;
822
+
823
  .as3cf-sidebar {
824
  top: 11px;
825
  }
1156
 
1157
  .extra {
1158
  background: white;
1159
+
1160
  a {
1161
  color: $as3cf_assets;
1162
  text-decoration: none;
classes/amazon-s3-and-cloudfront.php CHANGED
@@ -1,11 +1,23 @@
1
  <?php
2
 
3
  use DeliciousBrains\WP_Offload_Media\Items\Media_Library_Item;
4
- use DeliciousBrains\WP_Offload_Media\Providers\AWS_Provider;
5
- use DeliciousBrains\WP_Offload_Media\Providers\DigitalOcean_Provider;
6
- use DeliciousBrains\WP_Offload_Media\Providers\GCP_Provider;
7
- use DeliciousBrains\WP_Offload_Media\Providers\Null_Provider;
 
 
 
 
 
 
8
  use DeliciousBrains\WP_Offload_Media\Providers\Provider;
 
 
 
 
 
 
9
  use DeliciousBrains\WP_Offload_Media\Upgrades\Upgrade_Content_Replace_URLs;
10
  use DeliciousBrains\WP_Offload_Media\Upgrades\Upgrade_EDD_Replace_URLs;
11
  use DeliciousBrains\WP_Offload_Media\Upgrades\Upgrade_File_Sizes;
@@ -18,12 +30,12 @@ use DeliciousBrains\WP_Offload_Media\Upgrades\Upgrade_WPOS3_To_AS3CF;
18
  class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
19
 
20
  /**
21
- * @var Provider
22
  */
23
- private $provider;
24
 
25
  /**
26
- * @var Provider
27
  */
28
  private $provider_client;
29
 
@@ -32,6 +44,11 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
32
  */
33
  private $provider_client_region;
34
 
 
 
 
 
 
35
  /**
36
  * @var array
37
  */
@@ -85,12 +102,22 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
85
  /**
86
  * @var string
87
  */
88
- protected static $default_provider = 'aws';
 
 
 
 
 
 
 
 
 
 
89
 
90
  /**
91
- * @var array Known provider classes.
92
  */
93
- protected static $provider_classes = array();
94
 
95
  /**
96
  * @var AS3CF_Plugin_Compatibility
@@ -138,15 +165,30 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
138
  $this->plugin_title = __( 'Offload Media Lite', 'amazon-s3-and-cloudfront' );
139
  $this->plugin_menu_title = __( 'Offload Media Lite', 'amazon-s3-and-cloudfront' );
140
 
141
- static::$provider_classes = array(
142
- AWS_Provider::get_provider_key_name() => 'DeliciousBrains\WP_Offload_Media\Providers\AWS_Provider',
143
- DigitalOcean_Provider::get_provider_key_name() => 'DeliciousBrains\WP_Offload_Media\Providers\DigitalOcean_Provider',
144
- GCP_Provider::get_provider_key_name() => 'DeliciousBrains\WP_Offload_Media\Providers\GCP_Provider',
145
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
147
  Media_Library_Item::init_cache();
148
 
149
- $this->set_provider();
 
150
 
151
  // Bundled SDK may require AWS setup before data migrations.
152
  $this->handle_aws_access_key_migration();
@@ -184,6 +226,7 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
184
 
185
  // Rewriting URLs, doesn't depend on plugin being setup
186
  add_filter( 'wp_get_attachment_url', array( $this, 'wp_get_attachment_url' ), 99, 2 );
 
187
  add_filter( 'get_image_tag', array( $this, 'maybe_encode_get_image_tag' ), 99, 6 );
188
  add_filter( 'wp_get_attachment_image_src', array( $this, 'maybe_encode_wp_get_attachment_image_src' ), 99, 4 );
189
  add_filter( 'wp_prepare_attachment_for_js', array( $this, 'maybe_encode_wp_prepare_attachment_for_js', ), 99, 3 );
@@ -217,50 +260,114 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
217
 
218
  // Register storage provider scripts and styles
219
  $this->register_storage_provider_assets();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  }
221
 
222
  /**
223
- * @return Provider
224
  */
225
- public function get_provider() {
226
- return $this->provider;
227
  }
228
 
229
  /**
230
- * @param Provider|string|null $provider
231
  *
232
  * @throws Exception
233
  */
234
- public function set_provider( $provider = null ) {
235
- if ( empty( $provider ) ) {
236
- $provider = $this->get_core_setting( 'provider', static::$default_provider );
 
 
 
 
 
237
  }
238
 
239
- if ( is_string( $provider ) ) {
240
- $provider = new self::$provider_classes[ $provider ]( $this );
241
  }
242
 
243
- $this->provider = $provider;
 
 
 
 
 
244
  }
245
 
246
  /**
247
  * Returns the currently supported Providers.
248
  *
 
 
249
  * @return array
250
  */
251
- public function get_provider_classes() {
252
- return self::$provider_classes;
 
 
 
 
 
 
 
 
 
 
 
253
  }
254
 
255
  /**
256
  * Returns provider class name for given key.
257
  *
258
  * @param string $key_name
 
259
  *
260
- * @return mixed|null
261
  */
262
- public function get_provider_class( $key_name ) {
263
- $classes = $this->get_provider_classes();
 
 
 
264
 
265
  return empty( $classes[ $key_name ] ) ? null : $classes[ $key_name ];
266
  }
@@ -269,12 +376,15 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
269
  * Provider name for given key.
270
  *
271
  * @param string $key_name
 
272
  *
273
  * @return string
274
  */
275
- public function get_provider_name( $key_name ) {
276
- /** @var Provider $class */
277
- $class = $this->get_provider_class( $key_name );
 
 
278
 
279
  return empty( $class ) ? __( 'Unknown', 'amazon-s3-and-cloudfront' ) : $class::get_provider_name();
280
  }
@@ -283,12 +393,15 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
283
  * Provider & Service name for given key.
284
  *
285
  * @param string $key_name
 
286
  *
287
  * @return string
288
  */
289
- public function get_provider_service_name( $key_name ) {
290
- /** @var Provider $class */
291
- $class = $this->get_provider_class( $key_name );
 
 
292
 
293
  return empty( $class ) ? __( 'Unknown', 'amazon-s3-and-cloudfront' ) : $class::get_provider_service_name();
294
  }
@@ -352,7 +465,7 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
352
  'key' => $key,
353
  'disabled' => false,
354
  'disabled_attr' => '',
355
- 'tr_class' => str_replace( '_', '-', $this->get_plugin_prefix() . '-' . $key . '-container' ),
356
  'setting_msg' => '',
357
  'is_defined' => false,
358
  );
@@ -520,6 +633,52 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
520
  return $aws_secret_access_key;
521
  }
522
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
523
  $value = parent::get_setting( $key, $default );
524
 
525
  // Provider
@@ -532,6 +691,11 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
532
  return $bucket;
533
  }
534
 
 
 
 
 
 
535
  return apply_filters( 'as3cf_setting_' . $key, $value );
536
  }
537
 
@@ -589,14 +753,14 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
589
 
590
  // Region of bucket translation
591
  if ( 'region' === $key && isset( $settings['region'] ) ) {
592
- return $this->get_provider()->sanitize_region( $settings['region'] );
593
  }
594
 
595
  return false;
596
  }
597
 
598
  /**
599
- * Get the bucket and if a constant save to database and clear region
600
  *
601
  * @param string $key
602
  * @param string $value
@@ -646,9 +810,58 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
646
  */
647
  public function bucket_changed() {
648
  $this->remove_setting( 'region' );
 
649
  $this->save_settings();
650
  }
651
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
652
  /**
653
  * Filter in defined settings with sensible defaults.
654
  *
@@ -734,10 +947,18 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
734
  $defined_settings = ! empty( $defined_settings ) ? $defined_settings : $this->get_defined_settings();
735
  $whitelisted_settings = $this->get_settings_whitelist();
736
  $settings_to_skip = array(
 
 
 
 
 
737
  'bucket',
738
  'region',
739
- 'permissions',
 
740
  'virtual-host',
 
 
741
  );
742
 
743
  foreach ( $whitelisted_settings as $setting ) {
@@ -745,16 +966,41 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
745
  continue;
746
  }
747
 
748
- if ( 'object-prefix' === $setting ) {
749
- if ( isset( $defined_settings['enable-object-prefix'] ) && '0' === $defined_settings['enable-object-prefix'] ) {
750
- continue;
751
- }
 
 
752
  }
753
 
754
- if ( 'cloudfront' === $setting ) {
755
- if ( isset( $defined_settings['domain'] ) && 'cloudfront' !== $defined_settings['domain'] ) {
756
- continue;
757
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
758
  }
759
 
760
  if ( ! isset( $defined_settings[ $setting ] ) ) {
@@ -867,17 +1113,21 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
867
  * @return string
868
  */
869
  function get_url_preview( $escape = true, $suffix = 'photo.jpg' ) {
870
- $scheme = $this->get_url_scheme();
871
- $bucket = $this->get_setting( 'bucket' );
872
- $path = $this->maybe_update_cloudfront_path( $this->get_file_prefix() );
873
- $region = $this->get_setting( 'region' );
874
- if ( is_wp_error( $region ) ) {
875
- $region = '';
876
- }
 
 
877
 
878
- $domain = $this->get_provider()->get_url_domain( $bucket, $region, null, array(), true );
879
 
880
- $url = $scheme . '://' . $domain . '/' . $path . $suffix;
 
 
881
 
882
  // Replace hyphens with non breaking hyphens for formatting
883
  if ( $escape ) {
@@ -982,9 +1232,10 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
982
  * to cope with possible different regions
983
  */
984
  function remove_attachment_files_from_provider( $post_id, Media_Library_Item $as3cf_item, $include_backups = true, $log_error = false, $return_on_error = false, $force_new_provider_client = false ) {
985
- $prefix = $as3cf_item->normalized_path_dir();
986
- $paths = AS3CF_Utils::get_attachment_file_paths( $post_id, false, false, $include_backups );
987
- $paths = apply_filters( 'as3cf_remove_attachment_paths', $paths, $post_id, $as3cf_item, $include_backups );
 
988
 
989
  // If another item in current site shares full size *local* paths, only remove remote files not referenced by duplicates.
990
  // We reference local paths as they should be reflected one way or another remotely, including backups.
@@ -1009,9 +1260,9 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
1009
 
1010
  $objects_to_remove = array();