Version Description
= 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 | WP Offload S3 Lite |
Version | 1.2.1 |
Comparing to | |
See all releases |
Code changes from version 1.2 to 1.2.1
- README.md +13 -2
- assets/css/notice.css +1 -1
- assets/css/styles.css +1 -1
- assets/img/os3-banner.svg +1 -0
- assets/js/media.js +3 -3
- assets/js/media.min.js +1 -1
- assets/js/script.js +33 -28
- assets/js/script.min.js +1 -1
- assets/sass/notice.scss +7 -0
- assets/sass/styles.scss +21 -31
- classes/amazon-s3-and-cloudfront.php +67 -30
- classes/as3cf-filter.php +24 -0
- classes/as3cf-plugin-compatibility.php +45 -0
- classes/as3cf-utils.php +81 -6
- classes/null-s3-client.php +34 -0
- classes/upgrades/upgrade-filter-post.php +2 -2
- classes/wp-aws-compatibility-check.php +2 -2
- languages/amazon-s3-and-cloudfront-en.pot +65 -62
- readme.txt +13 -2
- view/attachment-metabox.php +16 -5
- view/sidebar.php +4 -4
- wordpress-s3.php +3 -3
README.md
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
**Contributors:** bradt, deliciousbrains
|
3 |
**Tags:** uploads, amazon, s3, amazon s3, mirror, admin, media, cdn, cloudfront
|
4 |
**Requires at least:** 4.6
|
5 |
-
**Tested up to:** 4.
|
6 |
-
**Stable tag:** 1.2
|
7 |
**License:** GPLv3
|
8 |
|
9 |
Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
|
@@ -69,6 +69,17 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin
|
|
69 |
|
70 |
## Changelog ##
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
### WP Offload S3 Lite 1.2 - 2017-06-19 ###
|
73 |
* New: Compatibility with WordPress 4.8
|
74 |
* New: Support for WP CLI `wp media regenerate`
|
2 |
**Contributors:** bradt, deliciousbrains
|
3 |
**Tags:** uploads, amazon, s3, amazon s3, mirror, admin, media, cdn, cloudfront
|
4 |
**Requires at least:** 4.6
|
5 |
+
**Tested up to:** 4.9
|
6 |
+
**Stable tag:** 1.2.1
|
7 |
**License:** GPLv3
|
8 |
|
9 |
Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
|
69 |
|
70 |
## Changelog ##
|
71 |
|
72 |
+
### WP Offload S3 Lite 1.2.1 - 2017-11-20 ###
|
73 |
+
* New: Compatibility with HTML Widget
|
74 |
+
* New: Dismissible admin notice that WP Offload S3 Lite will soon require PHP 5.5+
|
75 |
+
* Improvement: Compatibility with WordPress 4.9
|
76 |
+
* Bug fix: Incorrect region used when changing bucket by defining it in WPOS3_SETTINGS
|
77 |
+
* Bug fix: Media library notices render inside the upload tool
|
78 |
+
* Bug fix: Save notices disappear on settings page
|
79 |
+
* Bug fix: Improper use of jQuery.attr logged to browser console
|
80 |
+
* Bug fix: "Content Filtering Upgrade" URL in notice incorrect
|
81 |
+
* Bug fix: "More info" links can be broken across two lines
|
82 |
+
|
83 |
### WP Offload S3 Lite 1.2 - 2017-06-19 ###
|
84 |
* New: Compatibility with WordPress 4.8
|
85 |
* New: Support for WP CLI `wp media regenerate`
|
assets/css/notice.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.as3cf-notice p,.aws-compatibility-notice p{max-width:800px}
|
1 |
+
.as3cf-notice p,.aws-compatibility-notice p{max-width:800px}.as3cf-license-notice p:not(.as3cf-before):before{display:none}
|
assets/css/styles.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.aws-main.wrap{position:relative}.aws-main.wrap>h1{float:left}.aws-main.wrap .as3cf-notice,.aws-main.wrap .as3cf-updated,.aws-main.wrap .as3cf-error{-webkit-box-sizing:border-box;box-sizing:border-box}.aws-main.wrap .as3cf-error.fatal{clear:both}.aws-main.wrap h2.nav-tab-wrapper{float:none;margin-bottom:15px;width:650px;margin-top:10px;padding:9px 0 0 5px}.aws-main.wrap h2.nav-tab-wrapper a.nav-tab-active{color:#464646;cursor:default}.aws-main.wrap h2.nav-tab-wrapper a:focus{-webkit-box-shadow:none;box-shadow:none}.aws-main.wrap .more-info{white-space:nowrap}.aws-main.wrap .error pre{background:#eaeaea;background:rgba(0,0,0,0.07);display:block;padding:10px 15px}.aws-main.wrap .error pre code{padding:0;background:none}.aws-main.wrap[data-tab="support"] .as3cf-notice,.aws-main.wrap[data-tab="support"] .error,.aws-main.wrap[data-tab="support"] .updated,.aws-main.wrap[data-tab="support"] .updated.show{display:none}.aws-main.wrap[data-tab="support"] .fatal .error,.aws-main.wrap[data-tab="support"] .as3cf-notice.important,.aws-main.wrap[data-tab="support"] .dbrains-api-down{display:block}.aws-main.wrap .as3cf-notice,.aws-main.wrap .error,.aws-main.wrap .updated{max-width:650px;margin-top:15px;-webkit-box-sizing:border-box;box-sizing:border-box}.aws-main.wrap .as3cf-updated{display:none}.aws-main.wrap .as3cf-updated.as3cf-notice,.aws-main.wrap .as3cf-updated.show{display:block}.as3cf-tab .as3cf-main-settings{display:none}.as3cf-tab .as3cf-bucket-container{display:block}.as3cf-tab.as3cf-has-bucket .as3cf-main-settings{display:block}.as3cf-tab.as3cf-has-bucket .as3cf-bucket-container{display:none}.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;-webkit-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;-webkit-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;margin:15px 0}.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 td{padding:15px 0}.as3cf-tab .form-table tr td:first-child{vertical-align:top;min-width:120px}.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 tr:first-of-type td{padding-top:5px}.as3cf-tab .form-table tr.as3cf-bucket-setting .as3cf-defined-in-config{float:none}.as3cf-tab .form-table h3{padding:0;margin:0}.as3cf-tab .form-table h4{margin:0}.as3cf-tab .as3cf-active-bucket{font-weight:bold;margin-right:10px}.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}.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}#tab-media{display:block}#tab-media .as3cf-main-settings{display:none}#tab-media .as3cf-bucket-container{display:block}#tab-media.as3cf-has-bucket .as3cf-main-settings{display:block}#tab-media.as3cf-has-bucket .as3cf-bucket-container{display:none}.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 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 .bucket-actions .bucket-action-cancel{color:#a00;text-decoration:none}.as3cf-bucket-container .bucket-actions .bucket-action-cancel:hover{color:red}.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-bucket-container .as3cf-bucket-select,.as3cf-bucket-container .as3cf-bucket-create{display:none}.as3cf-bucket-container .bucket-actions.select{display:none}.as3cf-tab{display:none}#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 .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 (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){.as3cf-sidebar .as3cf-banner{background-image:url(../img/snail-banner@2x.jpg);background-size:292px 156px}}@media screen and (max-width: 1052px){.as3cf-sidebar{position:relative;top:auto;right:auto}}.as3cf-banner{margin-top:35px;width:292px;height:156px;display:block;background-image:url(../img/snail-banner.jpg);position:relative}.as3cf-banner h1{font-size:28px;color:#fff;font-weight:200;margin:0;position:absolute;bottom:25px;left:20px;text-decoration:none}.as3cf-upgrade-details{background-color:#73833b;padding:20px;color:#fff;font-size:13px;margin:0;display:block;text-decoration:none}.as3cf-upgrade-details p{margin:0}.as3cf-upgrade-details a{color:#fff;font-weight:bold;text-decoration:none;font-size:16px}.as3cf-upgrade-details a:hover{color:#fff;opacity:0.9}.as3cf-upgrade-details ul{margin-top:0;margin-left:16px;list-style-type:disc}.aws-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}
|
1 |
+
.aws-main.wrap{position:relative}.aws-main.wrap>h1{float:left}.aws-main.wrap .as3cf-notice,.aws-main.wrap .as3cf-updated,.aws-main.wrap .as3cf-error{-webkit-box-sizing:border-box;box-sizing:border-box}.aws-main.wrap .as3cf-error.fatal{clear:both}.aws-main.wrap h2.nav-tab-wrapper{float:none;margin-bottom:15px;width:650px;margin-top:10px;padding:9px 0 0 5px}.aws-main.wrap h2.nav-tab-wrapper a.nav-tab-active{color:#464646;cursor:default}.aws-main.wrap h2.nav-tab-wrapper a:focus{-webkit-box-shadow:none;box-shadow:none}.aws-main.wrap .more-info{white-space:nowrap}.aws-main.wrap .error pre{background:#eaeaea;background:rgba(0,0,0,0.07);display:block;padding:10px 15px}.aws-main.wrap .error pre code{padding:0;background:none}.aws-main.wrap[data-tab="support"] .as3cf-notice,.aws-main.wrap[data-tab="support"] .error,.aws-main.wrap[data-tab="support"] .updated,.aws-main.wrap[data-tab="support"] .updated.show{display:none}.aws-main.wrap[data-tab="support"] .fatal .error,.aws-main.wrap[data-tab="support"] .as3cf-notice.important,.aws-main.wrap[data-tab="support"] .dbrains-api-down{display:block}.aws-main.wrap .as3cf-notice,.aws-main.wrap .error,.aws-main.wrap .updated{max-width:650px;margin-top:15px;-webkit-box-sizing:border-box;box-sizing:border-box}.aws-main.wrap .as3cf-updated{display:none}.aws-main.wrap .as3cf-updated.as3cf-notice,.aws-main.wrap .as3cf-updated.show{display:block}.as3cf-tab .as3cf-main-settings{display:none}.as3cf-tab .as3cf-bucket-container{display:block}.as3cf-tab.as3cf-has-bucket .as3cf-main-settings{display:block}.as3cf-tab.as3cf-has-bucket .as3cf-bucket-container{display:none}.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;-webkit-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;-webkit-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;margin:15px 0}.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 td{padding:15px 0}.as3cf-tab .form-table tr td:first-child{vertical-align:top;min-width:120px}.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 tr:first-of-type td{padding-top:5px}.as3cf-tab .form-table tr.as3cf-bucket-setting .as3cf-defined-in-config{float:none}.as3cf-tab .form-table h3{padding:0;margin:0}.as3cf-tab .form-table h4{margin:0}.as3cf-tab .as3cf-active-bucket{font-weight:bold;margin-right:10px}.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}.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}#tab-media{display:block}#tab-media .as3cf-main-settings{display:none}#tab-media .as3cf-bucket-container{display:block}#tab-media.as3cf-has-bucket .as3cf-main-settings{display:block}#tab-media.as3cf-has-bucket .as3cf-bucket-container{display:none}.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 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 .bucket-actions .bucket-action-cancel{color:#a00;text-decoration:none}.as3cf-bucket-container .bucket-actions .bucket-action-cancel:hover{color:red}.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-bucket-container .as3cf-bucket-select,.as3cf-bucket-container .as3cf-bucket-create{display:none}.as3cf-bucket-container .bucket-actions.select{display:none}.as3cf-tab{display:none}#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 .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-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}.aws-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}
|
assets/img/os3-banner.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 612 612"><defs><style>.cls-1{fill:#f8cfae;}.cls-2{fill:#ea705e;}.cls-3{fill:#4e0d33;}</style></defs><title>os3-banner</title><g id="Layer.-1"><rect class="cls-1" width="612" height="612"/><path class="cls-2" d="M225.29,365.31a58.21,58.21,0,0,1,7-13.23c.21-.29.39-.6.6-.89a32.4,32.4,0,0,1-3.75-3.93c-4.42-5.48-6.59-11.94-6.18-17.88a17.86,17.86,0,0,1,3.8-10.09l13.7,11,8.07,6.46c.76-.47,1.55-.89,2.34-1.33a54.6,54.6,0,0,1,12.61-5.05c.53-.14,1-.31,1.6-.44a54.72,54.72,0,0,1,14.32-1.35h0A63.68,63.68,0,0,0,164.13,370.5h59.51c.47-1.75,1-3.46,1.64-5.15"/><path class="cls-2" d="M317.33,478.61s-3.45,6.56-21.24,13.19c-2.36.89-4.95,1.77-7.83,2.63l-.83.24c-.68.2-1.32.37-1.94.53l-1.05.28-17,5.64-18.3,6.1-.56.18a16.93,16.93,0,0,1-.85-6.16,20.22,20.22,0,0,1,2-7.78A23.79,23.79,0,0,1,251,491.2c.4-.66.85-1.31,1.33-1.95A28.25,28.25,0,0,1,259,483a31.61,31.61,0,0,1,16.93-5.59,28.24,28.24,0,0,1,8.68,1,23.66,23.66,0,0,1,2.73.92,38.42,38.42,0,0,0,5.54-5.79,32.35,32.35,0,0,0,4.87-8.77,26.47,26.47,0,0,0,.85-2.75l5.7,5,13.1,11.55ZM193.77,494.8a6.65,6.65,0,0,1-.11,1,6.51,6.51,0,0,1-12.86,0,5.57,5.57,0,0,1-.11-1,6.28,6.28,0,0,1,.64-2.76,6.54,6.54,0,0,1,12.44,2.76m-29.28-58.95h-10a6.61,6.61,0,0,1-1.09-.12,6.69,6.69,0,0,1-1.58-.47,6.53,6.53,0,0,1,2.67-12.49h10a6.54,6.54,0,0,1,0,13.08M338.7,488.34h0l-46.42-41.52-3.88-3.46a54.41,54.41,0,0,1-19.09.07A55.77,55.77,0,0,1,249.49,436l-.21-.12H210.05a6.54,6.54,0,0,1,0-13.08h30.79a6.54,6.54,0,0,0,0-13.08H133.11a6.54,6.54,0,0,1,0-13.08h92.61a6.54,6.54,0,0,0,.51-13.07H65.33c.18.7.37,1.39.53,2.1a76,76,0,0,1-.76,37.13H86.75a6.56,6.56,0,0,1,6.54,6.54,6.46,6.46,0,0,1-1.69,4.36,6.62,6.62,0,0,1-4.14,2.11H48.9a6.55,6.55,0,0,0-5.7,3.41,5.87,5.87,0,0,0-.42,1,6.1,6.1,0,0,0-.42,2.11,6.55,6.55,0,0,0,6.54,6.53H200.6a6.54,6.54,0,1,1,0,13.08H44.07a6.54,6.54,0,0,0,0,13.08h76.61a6.57,6.57,0,0,1,6,3.94,6.35,6.35,0,0,1-.56,6.18,6.6,6.6,0,0,1-3.91,2.76,6.3,6.3,0,0,1-1.5.2H86.54a5.58,5.58,0,0,0-.82.11,5.12,5.12,0,0,0-1.22.33,6.33,6.33,0,0,0-1,.52,6.55,6.55,0,0,0-3.1,5.54V495a6.24,6.24,0,0,0,1.27,3.51c.14.18.27.37.42.53a6.46,6.46,0,0,0,4.8,2.13h61.63a6.51,6.51,0,0,1,5.39,2.87,6.45,6.45,0,0,1-.72,8.22v.07l-.08.06a6.48,6.48,0,0,1-4.54,1.86H116a6.54,6.54,0,0,0,0,13.08h6.43c.86,0,1.7.06,2.55.11h1.1c.68.07,1.36.17,2,.28a35.37,35.37,0,0,1,8.36,2.4,34.63,34.63,0,0,1,18.7,19.65,32.79,32.79,0,0,1,1.36,4.46,2.94,2.94,0,0,0,.14.64c.47-.1,1-.17,1.42-.25a34.68,34.68,0,0,1,7.74-.45,69.31,69.31,0,0,1,23.47-13.62c1-.33,2-.63,3-.93l.82-.22c1-.28,2-.54,3-.77A68.54,68.54,0,0,1,245.61,546a69.71,69.71,0,0,1,10.43,7.3A68.89,68.89,0,0,1,267,565c1.44-.07,2.88-.08,4.31-.1,3.72,0,7.41.08,11.07.37,3,.23,6,.54,8.9,1,1.18.18,2.33.44,3.49.65,3,.54,5.95,1.2,8.87,2,1.16.31,2.33.56,3.48.89l.39.12.63.19A74.43,74.43,0,0,1,335,556.61c1-.28,2.05-.57,3.09-.8a74.42,74.42,0,0,1,40.4,2,73,73,0,0,0-51.42-47.07,74.74,74.74,0,0,0,19.29-20.46l-.93-.23-6.75-1.66Z"/><path class="cls-2" d="M356.15,433.66A74.05,74.05,0,0,0,341,402.91c-.58-.73-1.17-1.45-1.79-2.17-.23-.27-.47-.53-.71-.8-.45-.52-.9-1-1.36-1.53-.79-.84-1.61-1.63-2.42-2.42-.36-.34-.7-.71-1.06-1.05a71.65,71.65,0,0,0-21.5-14c-16.27-6.8-34-6.8-48.66.36-.52.25-1,.46-1.56.74a59.79,59.79,0,0,1,19.34-.63c14.53,1.8,29.63,8.51,42.48,20a83.64,83.64,0,0,1,17.44,21.73c6.8,12.23,9.83,25.39,8.84,37.58a49.66,49.66,0,0,1-4,16.21c.22-.19.47-.34.69-.52.49-.38,1-.76,1.49-1.11a28.56,28.56,0,0,1,4.86-2.49c.55-.23,1.08-.49,1.64-.69h0a74.46,74.46,0,0,0,3.13-26.66h0a75.52,75.52,0,0,0-1.72-11.78"/><path class="cls-2" d="M288.05,298a8.26,8.26,0,1,0-9.91-6.21,8.26,8.26,0,0,0,9.91,6.21h0"/><path class="cls-2" d="M149.87,336.92a5.25,5.25,0,1,0-6.29-3.95,5.26,5.26,0,0,0,6.29,3.95"/><path class="cls-3" d="M164.49,422.77h-10a6.53,6.53,0,0,0-2.67,12.49,6.83,6.83,0,0,0,1.58.47,6.61,6.61,0,0,0,1.09.12h10a6.54,6.54,0,0,0,0-13.08"/><path class="cls-3" d="M187.23,488.26a6.54,6.54,0,0,0-5.9,3.77,6.42,6.42,0,0,0-.64,2.76h0a6.64,6.64,0,0,0,.1,1,6.51,6.51,0,0,0,12.17,2,6.47,6.47,0,0,0,.7-2,5.56,5.56,0,0,0,.1-1h0a6.41,6.41,0,0,0-.63-2.76,6.54,6.54,0,0,0-5.9-3.77"/><path class="cls-3" d="M333.5,264.36l17.42,21.39h0L427,379.18h0v.05a31.21,31.21,0,0,1,6.93,6.93A31.9,31.9,0,0,1,416.14,437a31.5,31.5,0,0,1-24.65-4.57h0c-.13,0-25.3,2.71-33.61,13h0a75.52,75.52,0,0,0-1.72-11.78A74,74,0,0,0,341,402.91c-.58-.73-1.17-1.46-1.79-2.17-.23-.27-.47-.53-.71-.8-.45-.52-.9-1-1.36-1.54-.79-.84-1.61-1.62-2.43-2.41-.35-.34-.69-.71-1-1.05a71.84,71.84,0,0,0-21.5-14c-16.27-6.8-34-6.8-48.66.37-.52.25-1,.46-1.57.74a59.79,59.79,0,0,1,19.34-.63c14.54,1.8,29.64,8.52,42.49,20a83.64,83.64,0,0,1,17.44,21.73c6.8,12.23,9.83,25.39,8.84,37.59a49.29,49.29,0,0,1-4,16.2h0c.22-.19.47-.34.69-.52.49-.37,1-.76,1.5-1.1a28.56,28.56,0,0,1,4.85-2.51c.55-.22,1.07-.48,1.64-.68h0a36,36,0,0,1,20.23-.68c16.76,4.13,27.68,18.41,24.4,31.88l-53-13.07-.92-.23-6.75-1.66h0l-46.43-41.52-3.87-3.46a54.47,54.47,0,0,1-19.1.07A55.87,55.87,0,0,1,249.49,436l-.2-.12H210.06a6.54,6.54,0,0,1,0-13.08h30.78a6.54,6.54,0,0,0,0-13.08H133.11a6.54,6.54,0,1,1,0-13.07h92.61a6.54,6.54,0,0,0,0-13.08H65.33c.18.7.38,1.39.54,2.1a76.13,76.13,0,0,1-.77,37.13H86.75a6.52,6.52,0,0,1,.71,13H48.9a6.53,6.53,0,0,0-5.7,3.41,8.06,8.06,0,0,0-.84,3.11,6.55,6.55,0,0,0,6.54,6.53H200.6a6.54,6.54,0,1,1,0,13.08H44.07a6.54,6.54,0,0,0,0,13.08h76.61a6.57,6.57,0,0,1,6,3.94,6.35,6.35,0,0,1-.56,6.18,6.6,6.6,0,0,1-3.91,2.76,6.29,6.29,0,0,1-1.5.19H86.53a5.71,5.71,0,0,0-.83.11,5.09,5.09,0,0,0-1.2.33,6.33,6.33,0,0,0-1,.52,6.55,6.55,0,0,0-3.1,5.54v.36a7.4,7.4,0,0,0,.17,1.24,6.67,6.67,0,0,0,1.11,2.27,5.34,5.34,0,0,0,.41.53,6.46,6.46,0,0,0,4.8,2.13h61.63a6.57,6.57,0,0,1,5.4,2.87,6.47,6.47,0,0,1-.73,8.22v.07a.13.13,0,0,0-.07.06,6.56,6.56,0,0,1-4.55,1.86H116a6.54,6.54,0,0,0,0,13.08h6.43c.86,0,1.7.06,2.54.11h1.11c.68.07,1.36.17,2,.28a34.59,34.59,0,0,1,27.07,22.05,35.19,35.19,0,0,1,1.35,4.46c.06.21.09.43.14.65.47-.11,1-.18,1.43-.26a34.72,34.72,0,0,1,7.75-.45,69.07,69.07,0,0,1,23.46-13.61c1-.34,2-.64,3-.94l.82-.22c1-.28,2-.54,3-.76A68.82,68.82,0,0,1,267,565h0c1.44-.07,2.88-.08,4.31-.1,3.72,0,7.41.08,11.08.37,3,.23,5.95.54,8.89,1,1.18.18,2.33.44,3.49.65q4.49.83,8.87,2c1.16.31,2.34.56,3.48.89l.39.12.63.2A74.33,74.33,0,0,1,335,556.61c1-.28,2.06-.57,3.11-.8a74.38,74.38,0,0,1,40.39,2h0A74.81,74.81,0,0,1,427.77,612H0V326.76a75.56,75.56,0,0,1,14.33,3.05,76.55,76.55,0,0,1,20,9.72,76,76,0,0,1,26.34,30.93h163c.47-1.75,1-3.46,1.65-5.15a57.54,57.54,0,0,1,7-13.22c.21-.3.39-.61.6-.9a31,31,0,0,1-3.75-3.93c-4.42-5.47-6.59-11.94-6.18-17.88a17.76,17.76,0,0,1,3.8-10.08l13.7,11,8.07,6.45c.76-.47,1.55-.89,2.34-1.32a53.48,53.48,0,0,1,12.6-5.05c.54-.15,1.06-.32,1.61-.44a54.31,54.31,0,0,1,14.32-1.36h0a55,55,0,0,1,20,4.59h0c22.06,9.08,47.26,28.2,58.68,52.36h0v.07c.23.52.47,1,.7,1.57,2.43,5.08,10.51,19.81,19.36,11.53h0a32.06,32.06,0,0,1,8.35-15.16c-14.83-5.08-30.27-15.94-42.94-31.5-25.85-31.74-30.38-71-10.13-87.62ZM422.55,402.7a4.67,4.67,0,0,0,8,3.89,4.34,4.34,0,0,0,.56-.72,4.63,4.63,0,0,0-1-6.1,5.85,5.85,0,0,0-.49-.38,4.7,4.7,0,0,0-6.44,1.49,4.48,4.48,0,0,0-.61,1.54.3.3,0,0,1,0,.2c-.05.07,0,.06,0,.08Z"/><path class="cls-2" d="M424.68,407.34a4.72,4.72,0,0,0,5.89-.75,4.34,4.34,0,0,0,.56-.72,4.63,4.63,0,0,0-1-6.1c-.16-.13-.31-.26-.49-.38a4.64,4.64,0,0,0-7.05,3,.3.3,0,0,1,0,.2c-.05.07,0,.06,0,.08a4.69,4.69,0,0,0,2.13,4.64"/><path class="cls-3" d="M304.23,467.06l-5.69-5a27,27,0,0,1-.85,2.75,32.12,32.12,0,0,1-4.88,8.77,38.42,38.42,0,0,1-5.54,5.79,23.66,23.66,0,0,0-2.73-.92,28.24,28.24,0,0,0-8.68-1,31.57,31.57,0,0,0-16.93,5.6,28.44,28.44,0,0,0-6.62,6.24,19.91,19.91,0,0,0-1.34,2,24.35,24.35,0,0,0-1.21,2.25,20.22,20.22,0,0,0-2,7.78,16.93,16.93,0,0,0,.85,6.16l.55-.18,18.31-6.1,17-5.64,1-.28c.62-.15,1.27-.33,1.94-.53l.83-.24c2.88-.86,5.47-1.74,7.83-2.62,17.76-6.64,21.24-13.17,21.25-13.2h0l-13.11-11.55Z"/><path class="cls-2" d="M427,379.18h0L364.2,269.89a31.73,31.73,0,0,0-13.27,15.87h0Z"/><path class="cls-2" d="M66.93,346.46c-1-1.31-2.1-2.57-3.22-3.79a24.46,24.46,0,0,0-7.25-6.75A63.11,63.11,0,0,0,3,323.77c-1,.23-2,.5-3,.78v2.23a75.21,75.21,0,0,1,14.3,3,76.86,76.86,0,0,1,20,9.72,76,76,0,0,1,26.34,30.93h91.58A63.73,63.73,0,0,0,66.93,346.46Z"/></g></svg>
|
assets/js/media.js
CHANGED
@@ -112,7 +112,7 @@ var test = {};
|
|
112 |
event.preventDefault();
|
113 |
|
114 |
var toggle = $( '#as3cfpro-toggle-acl' );
|
115 |
-
var currentACL = toggle.
|
116 |
var newACL = as3cfpro_media.settings.private_acl;
|
117 |
|
118 |
toggle.hide();
|
@@ -124,7 +124,7 @@ var test = {};
|
|
124 |
|
125 |
wp.ajax.send( 'as3cfpro_update_acl', {
|
126 |
data: {
|
127 |
-
|
128 |
id: this.model.get( 'id' ),
|
129 |
acl: newACL
|
130 |
}
|
@@ -155,7 +155,7 @@ var test = {};
|
|
155 |
|
156 |
toggle.text( response.acl_display );
|
157 |
toggle.attr( 'title', response.title );
|
158 |
-
toggle.
|
159 |
toggle.show();
|
160 |
}
|
161 |
} );
|
112 |
event.preventDefault();
|
113 |
|
114 |
var toggle = $( '#as3cfpro-toggle-acl' );
|
115 |
+
var currentACL = toggle.data( 'currentacl' );
|
116 |
var newACL = as3cfpro_media.settings.private_acl;
|
117 |
|
118 |
toggle.hide();
|
124 |
|
125 |
wp.ajax.send( 'as3cfpro_update_acl', {
|
126 |
data: {
|
127 |
+
_ajax_nonce: as3cfpro_media.nonces.singular_update_acl,
|
128 |
id: this.model.get( 'id' ),
|
129 |
acl: newACL
|
130 |
}
|
155 |
|
156 |
toggle.text( response.acl_display );
|
157 |
toggle.attr( 'title', response.title );
|
158 |
+
toggle.data( 'currentacl', response.acl );
|
159 |
toggle.show();
|
160 |
}
|
161 |
} );
|
assets/js/media.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var test={};!function(a,b){var c=wp.media,d=c.view.Attachment.Details.TwoColumn;c.view.Attachment.Details.TwoColumn=d.extend({events:function(){return b.extend({},d.prototype.events,{"click .local-warning":"confirmS3Removal","click #as3cfpro-toggle-acl":"toggleACL"})},render:function(){this.fetchS3Details(this.model.get("id"))},fetchS3Details:function(a){wp.ajax.send("as3cf_get_attachment_s3_details",{data:{_nonce:as3cf_media.nonces.get_attachment_s3_details,id:a}}).done(b.bind(this.renderView,this))},renderView:function(a){d.prototype.render.apply(this),this.renderActionLinks(a),this.renderS3Details(a)},renderActionLinks:function(c){var d=c&&c.links||[],e=this.$el.find(".actions"),f=a("<div />",{"class":"s3-actions"}),g=[];b(d).each(function(a){g.push(a)}),f.append(g.join(" | ")),e.append(f)},renderS3Details:function(a){if(a&&a.s3object){var b=this.$el.find(".attachment-info .details"),c=this.generateDetails(a,["bucket","key","region","acl"]);b.append(c)}},generateDetails:function(a,c){var d="",e=b.template('<div class="<%= key %>"><strong><%= label %>:</strong> <%= value %></div>');return b(c).each(function(c){if(a.s3object[c]){var f=a.s3object[c];if("acl"===c&&(f=a.s3object[c].name,a.acl_toggle)){var g=b.template('<a href="#" id="as3cfpro-toggle-acl" title="<%= title %>" data-currentACL="<%= acl %>"><%= value %></a>');f=g({title:a.s3object[c].title,acl:a.s3object[c].acl,value:f})}d+=e({key:c,label:as3cf_media.strings[c],value:f})}}),d},confirmS3Removal:function(a){if(!confirm(as3cfpro_media.strings.local_warning))return a.preventDefault(),a.stopImmediatePropagation(),!1},toggleACL:function(c){c.preventDefault();var d=a("#as3cfpro-toggle-acl"),e=d.
|
1 |
+
var test={};!function(a,b){var c=wp.media,d=c.view.Attachment.Details.TwoColumn;c.view.Attachment.Details.TwoColumn=d.extend({events:function(){return b.extend({},d.prototype.events,{"click .local-warning":"confirmS3Removal","click #as3cfpro-toggle-acl":"toggleACL"})},render:function(){this.fetchS3Details(this.model.get("id"))},fetchS3Details:function(a){wp.ajax.send("as3cf_get_attachment_s3_details",{data:{_nonce:as3cf_media.nonces.get_attachment_s3_details,id:a}}).done(b.bind(this.renderView,this))},renderView:function(a){d.prototype.render.apply(this),this.renderActionLinks(a),this.renderS3Details(a)},renderActionLinks:function(c){var d=c&&c.links||[],e=this.$el.find(".actions"),f=a("<div />",{"class":"s3-actions"}),g=[];b(d).each(function(a){g.push(a)}),f.append(g.join(" | ")),e.append(f)},renderS3Details:function(a){if(a&&a.s3object){var b=this.$el.find(".attachment-info .details"),c=this.generateDetails(a,["bucket","key","region","acl"]);b.append(c)}},generateDetails:function(a,c){var d="",e=b.template('<div class="<%= key %>"><strong><%= label %>:</strong> <%= value %></div>');return b(c).each(function(c){if(a.s3object[c]){var f=a.s3object[c];if("acl"===c&&(f=a.s3object[c].name,a.acl_toggle)){var g=b.template('<a href="#" id="as3cfpro-toggle-acl" title="<%= title %>" data-currentACL="<%= acl %>"><%= value %></a>');f=g({title:a.s3object[c].title,acl:a.s3object[c].acl,value:f})}d+=e({key:c,label:as3cf_media.strings[c],value:f})}}),d},confirmS3Removal:function(a){if(!confirm(as3cfpro_media.strings.local_warning))return a.preventDefault(),a.stopImmediatePropagation(),!1},toggleACL:function(c){c.preventDefault();var d=a("#as3cfpro-toggle-acl"),e=d.data("currentacl"),f=as3cfpro_media.settings.private_acl;d.hide(),d.after('<span id="as3cfpro-updating">'+as3cfpro_media.strings.updating_acl+"</span>"),e===as3cfpro_media.settings.private_acl&&(f=as3cfpro_media.settings.default_acl),wp.ajax.send("as3cfpro_update_acl",{data:{_ajax_nonce:as3cfpro_media.nonces.singular_update_acl,id:this.model.get("id"),acl:f}}).done(b.bind(this.updateACL,this)).fail(b.bind(this.renderACLError,this))},renderACLError:function(){a("#as3cfpro-updating").remove(),a("#as3cfpro-toggle-acl").show(),alert(as3cfpro_media.strings.change_acl_error)},updateACL:function(b){if(null==b.acl_display||null==b.title||null==b.acl||null==b.url)return void this.renderACLError();this.model.set("url",b.url),this.render();var c=a("#as3cfpro-toggle-acl");a("#as3cfpro-updating").remove(),c.text(b.acl_display),c.attr("title",b.title),c.data("currentacl",b.acl),c.show()}})}(jQuery,_);
|
assets/js/script.js
CHANGED
@@ -30,7 +30,7 @@
|
|
30 |
|
31 |
$switch.toggleClass( 'on' ).find( 'span' ).toggleClass( 'checked' );
|
32 |
var switchOn = $switch.find( 'span.on' ).hasClass( 'checked' );
|
33 |
-
$checkbox.
|
34 |
}
|
35 |
|
36 |
/**
|
@@ -45,10 +45,10 @@
|
|
45 |
|
46 |
if ( pattern.test( $input.val() ) ) {
|
47 |
$error.show();
|
48 |
-
$submit.
|
49 |
} else {
|
50 |
$error.hide();
|
51 |
-
$submit.
|
52 |
}
|
53 |
}
|
54 |
|
@@ -68,9 +68,9 @@
|
|
68 |
$activeTab.show();
|
69 |
$( '.nav-tab' ).removeClass( 'nav-tab-active' );
|
70 |
$( 'a.nav-tab[data-tab="' + hash + '"]' ).addClass( 'nav-tab-active' );
|
71 |
-
$( '.aws-main' ).
|
72 |
-
if ( $activeTab.
|
73 |
-
as3cfModal.prefix = $activeTab.
|
74 |
}
|
75 |
if ( ! persist_updated_notice ) {
|
76 |
$( '.as3cf-updated' ).removeClass( 'show' );
|
@@ -167,7 +167,7 @@
|
|
167 |
return;
|
168 |
}
|
169 |
|
170 |
-
$bucketList.html( '<li class="loading">' + $bucketList.
|
171 |
|
172 |
var data = {
|
173 |
action: as3cfModal.prefix + '-get-buckets',
|
@@ -264,7 +264,7 @@
|
|
264 |
return;
|
265 |
}
|
266 |
$( '.as3cf-bucket-error' ).hide();
|
267 |
-
$manualBucketButton.text( $manualBucketButton.
|
268 |
$manualBucketButton.prop( 'disabled', true );
|
269 |
|
270 |
var data = {
|
@@ -324,14 +324,14 @@
|
|
324 |
return;
|
325 |
}
|
326 |
|
327 |
-
var previousBucket = $( '.as3cf-bucket-list a.selected' ).
|
328 |
|
329 |
$( '.as3cf-bucket-list a' ).removeClass( 'selected' );
|
330 |
$link.addClass( 'selected' );
|
331 |
|
332 |
$bucketList.addClass( 'saving' );
|
333 |
$link.find( '.spinner' ).show().css( 'visibility', 'visible' );
|
334 |
-
var bucketName = $link.
|
335 |
|
336 |
var data = {
|
337 |
action: as3cfModal.prefix + '-save-bucket',
|
@@ -379,15 +379,15 @@
|
|
379 |
var $manualBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-manual-save-bucket-form' );
|
380 |
|
381 |
if ( $createBucketForm.find( '.as3cf-bucket-name' ).val().length < 3 ) {
|
382 |
-
$createBucketForm.find( 'button[type=submit]' ).
|
383 |
} else {
|
384 |
-
$createBucketForm.find( 'button[type=submit]' ).
|
385 |
}
|
386 |
|
387 |
if ( $manualBucketForm.find( '.as3cf-bucket-name' ).val().length < 3 ) {
|
388 |
-
$manualBucketForm.find( 'button[type=submit]' ).
|
389 |
} else {
|
390 |
-
$manualBucketForm.find( 'button[type=submit]' ).
|
391 |
}
|
392 |
},
|
393 |
|
@@ -480,7 +480,7 @@
|
|
480 |
var origButtonText = $createBucketButton.text();
|
481 |
|
482 |
$( '.as3cf-bucket-error' ).hide();
|
483 |
-
$createBucketButton.text( $createBucketButton.
|
484 |
$createBucketButton.prop( 'disabled', true );
|
485 |
|
486 |
var data = {
|
@@ -512,9 +512,9 @@
|
|
512 |
|
513 |
// Tidy up create bucket form
|
514 |
$( '.as3cf-bucket-select-region' ).hide();
|
515 |
-
$( '.as3cf-bucket-select-region' ).
|
516 |
$createBucketInput.val( '' );
|
517 |
-
$createBucketButton.
|
518 |
|
519 |
// Make sure the bucket list will refresh the next time the modal loads
|
520 |
refreshBucketListOnLoad = true;
|
@@ -662,12 +662,9 @@
|
|
662 |
return;
|
663 |
}
|
664 |
|
665 |
-
// Strip the # if still on the end of the URL
|
666 |
-
if ( 'function' === typeof history.replaceState && '#' === location.href.slice( -1 ) ) {
|
667 |
-
history.replaceState( {}, '', location.href.slice( 0, -1 ) );
|
668 |
-
}
|
669 |
-
|
670 |
as3cf.tabs.toggle( location.hash.replace( '#', '' ), true );
|
|
|
|
|
671 |
}
|
672 |
|
673 |
$( document ).ready( function() {
|
@@ -679,7 +676,15 @@
|
|
679 |
/**
|
680 |
* Set the hashchange callback to update the rendered active tab.
|
681 |
*/
|
682 |
-
window.onhashchange =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
683 |
|
684 |
// Move any compatibility errors below the nav tabs
|
685 |
var $navTabs = $( '.wrap.aws-main .nav-tab-wrapper' );
|
@@ -768,7 +773,7 @@
|
|
768 |
var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );
|
769 |
|
770 |
if ( 'cloudfront' !== $input.val() ) {
|
771 |
-
$submit.
|
772 |
} else {
|
773 |
validateCustomDomain( $input.next( '.as3cf-setting' ).find( 'input[name="cloudfront"]' ) );
|
774 |
}
|
@@ -862,9 +867,9 @@
|
|
862 |
var $createBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-create-bucket-form' );
|
863 |
|
864 |
if ( as3cf.buckets.isValidName( bucketName ) ) {
|
865 |
-
$createBucketForm.find( 'button[type=submit]' ).
|
866 |
} else {
|
867 |
-
$createBucketForm.find( 'button[type=submit]' ).
|
868 |
}
|
869 |
as3cf.buckets.updateNameNotice( bucketName );
|
870 |
} );
|
@@ -874,9 +879,9 @@
|
|
874 |
var $manualBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-manual-save-bucket-form' );
|
875 |
|
876 |
if ( $manualBucketForm.find( '.as3cf-bucket-name' ).val().length < as3cf.buckets.validLength ) {
|
877 |
-
$manualBucketForm.find( 'button[type=submit]' ).
|
878 |
} else {
|
879 |
-
$manualBucketForm.find( 'button[type=submit]' ).
|
880 |
}
|
881 |
} );
|
882 |
|
30 |
|
31 |
$switch.toggleClass( 'on' ).find( 'span' ).toggleClass( 'checked' );
|
32 |
var switchOn = $switch.find( 'span.on' ).hasClass( 'checked' );
|
33 |
+
$checkbox.prop( 'checked', switchOn ).trigger( 'change' );
|
34 |
}
|
35 |
|
36 |
/**
|
45 |
|
46 |
if ( pattern.test( $input.val() ) ) {
|
47 |
$error.show();
|
48 |
+
$submit.prop( 'disabled', true );
|
49 |
} else {
|
50 |
$error.hide();
|
51 |
+
$submit.prop( 'disabled', false );
|
52 |
}
|
53 |
}
|
54 |
|
68 |
$activeTab.show();
|
69 |
$( '.nav-tab' ).removeClass( 'nav-tab-active' );
|
70 |
$( 'a.nav-tab[data-tab="' + hash + '"]' ).addClass( 'nav-tab-active' );
|
71 |
+
$( '.aws-main' ).data( 'tab', hash );
|
72 |
+
if ( $activeTab.data( 'prefix' ) ) {
|
73 |
+
as3cfModal.prefix = $activeTab.data( 'prefix' );
|
74 |
}
|
75 |
if ( ! persist_updated_notice ) {
|
76 |
$( '.as3cf-updated' ).removeClass( 'show' );
|
167 |
return;
|
168 |
}
|
169 |
|
170 |
+
$bucketList.html( '<li class="loading">' + $bucketList.data( 'working' ) + '</li>' );
|
171 |
|
172 |
var data = {
|
173 |
action: as3cfModal.prefix + '-get-buckets',
|
264 |
return;
|
265 |
}
|
266 |
$( '.as3cf-bucket-error' ).hide();
|
267 |
+
$manualBucketButton.text( $manualBucketButton.data( 'working' ) );
|
268 |
$manualBucketButton.prop( 'disabled', true );
|
269 |
|
270 |
var data = {
|
324 |
return;
|
325 |
}
|
326 |
|
327 |
+
var previousBucket = $( '.as3cf-bucket-list a.selected' ).data( 'bucket' );
|
328 |
|
329 |
$( '.as3cf-bucket-list a' ).removeClass( 'selected' );
|
330 |
$link.addClass( 'selected' );
|
331 |
|
332 |
$bucketList.addClass( 'saving' );
|
333 |
$link.find( '.spinner' ).show().css( 'visibility', 'visible' );
|
334 |
+
var bucketName = $link.data( 'bucket' );
|
335 |
|
336 |
var data = {
|
337 |
action: as3cfModal.prefix + '-save-bucket',
|
379 |
var $manualBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-manual-save-bucket-form' );
|
380 |
|
381 |
if ( $createBucketForm.find( '.as3cf-bucket-name' ).val().length < 3 ) {
|
382 |
+
$createBucketForm.find( 'button[type=submit]' ).prop( 'disabled', true );
|
383 |
} else {
|
384 |
+
$createBucketForm.find( 'button[type=submit]' ).prop( 'disabled', false );
|
385 |
}
|
386 |
|
387 |
if ( $manualBucketForm.find( '.as3cf-bucket-name' ).val().length < 3 ) {
|
388 |
+
$manualBucketForm.find( 'button[type=submit]' ).prop( 'disabled', true );
|
389 |
} else {
|
390 |
+
$manualBucketForm.find( 'button[type=submit]' ).prop( 'disabled', false );
|
391 |
}
|
392 |
},
|
393 |
|
480 |
var origButtonText = $createBucketButton.text();
|
481 |
|
482 |
$( '.as3cf-bucket-error' ).hide();
|
483 |
+
$createBucketButton.text( $createBucketButton.data( 'working' ) );
|
484 |
$createBucketButton.prop( 'disabled', true );
|
485 |
|
486 |
var data = {
|
512 |
|
513 |
// Tidy up create bucket form
|
514 |
$( '.as3cf-bucket-select-region' ).hide();
|
515 |
+
$( '.as3cf-bucket-select-region' ).prop( 'selected', false );
|
516 |
$createBucketInput.val( '' );
|
517 |
+
$createBucketButton.prop( 'disabled', true );
|
518 |
|
519 |
// Make sure the bucket list will refresh the next time the modal loads
|
520 |
refreshBucketListOnLoad = true;
|
662 |
return;
|
663 |
}
|
664 |
|
|
|
|
|
|
|
|
|
|
|
665 |
as3cf.tabs.toggle( location.hash.replace( '#', '' ), true );
|
666 |
+
|
667 |
+
$( document ).trigger( 'as3cf.tabRendered', [ location.hash.replace( '#', '' ) ] );
|
668 |
}
|
669 |
|
670 |
$( document ).ready( function() {
|
676 |
/**
|
677 |
* Set the hashchange callback to update the rendered active tab.
|
678 |
*/
|
679 |
+
window.onhashchange = function( event ) {
|
680 |
+
|
681 |
+
// Strip the # if still on the end of the URL
|
682 |
+
if ( 'function' === typeof history.replaceState && '#' === location.href.slice( -1 ) ) {
|
683 |
+
history.replaceState( {}, '', location.href.slice( 0, -1 ) );
|
684 |
+
}
|
685 |
+
|
686 |
+
renderCurrentTab();
|
687 |
+
};
|
688 |
|
689 |
// Move any compatibility errors below the nav tabs
|
690 |
var $navTabs = $( '.wrap.aws-main .nav-tab-wrapper' );
|
773 |
var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );
|
774 |
|
775 |
if ( 'cloudfront' !== $input.val() ) {
|
776 |
+
$submit.prop( 'disabled', false );
|
777 |
} else {
|
778 |
validateCustomDomain( $input.next( '.as3cf-setting' ).find( 'input[name="cloudfront"]' ) );
|
779 |
}
|
867 |
var $createBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-create-bucket-form' );
|
868 |
|
869 |
if ( as3cf.buckets.isValidName( bucketName ) ) {
|
870 |
+
$createBucketForm.find( 'button[type=submit]' ).prop( 'disabled', false );
|
871 |
} else {
|
872 |
+
$createBucketForm.find( 'button[type=submit]' ).prop( 'disabled', true );
|
873 |
}
|
874 |
as3cf.buckets.updateNameNotice( bucketName );
|
875 |
} );
|
879 |
var $manualBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-manual-save-bucket-form' );
|
880 |
|
881 |
if ( $manualBucketForm.find( '.as3cf-bucket-name' ).val().length < as3cf.buckets.validLength ) {
|
882 |
+
$manualBucketForm.find( 'button[type=submit]' ).prop( 'disabled', true );
|
883 |
} else {
|
884 |
+
$manualBucketForm.find( 'button[type=submit]' ).prop( 'disabled', false );
|
885 |
}
|
886 |
} );
|
887 |
|
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=k.find("#"+a),c=b.find("input[type=checkbox]");b.toggleClass("on").find("span").toggleClass("checked");var d=b.find("span.on").hasClass("checked");c.attr("checked",d).trigger("change")}function e(b){var c=b.next(".as3cf-validation-error"),d=a("#"+k.attr("id")+' form button[type="submit"]'),e=/[^a-zA-Z0-9\.\-]/;e.test(b.val())?(c.show(),d.attr("disabled",!0)):(c.hide(),d.attr("disabled",!1))}function f(){var c=a("#"+b.prefix+"-bucket").val(),d=k.find('input[name="object-prefix"]'),e=d.val();""!==e&&(e="&prefix="+encodeURIComponent(e));var f=as3cf.aws_bucket_link+c+e;a("#"+b.prefix+"-view-bucket").attr("href",f)}function g(){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):alert(as3cf.strings.get_url_preview_error+b.error)}})}function h(){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 i(){a("#as3cf-remove-local-file").is(":checked")?a("#as3cf-remove-local-notice").show():a("#as3cf-remove-local-notice").hide()}function j(){return"#"+as3cf.tabs.defaultTab===location.hash?void(location.hash=""):("function"==typeof history.replaceState&&"#"===location.href.slice(-1)&&history.replaceState({},"",location.href.slice(0,-1)),void as3cf.tabs.toggle(location.hash.replace("#",""),!0))}var k,l={},m=/[^a-z0-9.-]/,n=!1,o=a(".as3cf-tab");as3cf.tabs={defaultTab:"media",toggle:function(c,d){c=as3cf.tabs.sanitizeHash(c),o.hide(),k=a("#tab-"+c),k.show(),a(".nav-tab").removeClass("nav-tab-active"),a('a.nav-tab[data-tab="'+c+'"]').addClass("nav-tab-active"),a(".aws-main").attr("data-tab",c),k.attr("data-prefix")&&(b.prefix=k.attr("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-list"),e=a("#"+b.prefix+"-bucket").val();if(!1===c&&d.find("li").length>1)return a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"),void this.scrollToSelected();d.html('<li class="loading">'+d.attr("data-working")+"</li>");var f={action:b.prefix+"-get-buckets",_nonce:window[b.prefix.replace(/-/g,"_")].nonces.get_buckets},g=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:f,error:function(a,b,c){d.html(""),g.showError(as3cf.strings.get_buckets_error,c,"as3cf-bucket-select")},success:function(b,c,f){d.html(""),"undefined"!=typeof b.success?(a(".as3cf-bucket-error").hide(),a(b.buckets).each(function(a,b){var c=b.Name===e?"selected":"";d.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>')}),g.scrollToSelected()):g.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})}},resetModal:function(){var c=a(".as3cf-bucket-container."+b.prefix);!1===k.hasClass("as3cf-has-bucket")||"manual"===a("#"+b.prefix+"-bucket-select").val()?(c.find(".as3cf-bucket-manual").show().siblings().hide(),c.find(".bucket-actions.manual").show().siblings(".bucket-actions").hide()):(c.find(".as3cf-bucket-select").show().siblings().hide(),c.find(".bucket-actions.select").show().siblings(".bucket-actions").hide(),this.loadList(n),n=!1),c.find(".as3cf-bucket-error").hide();var d=a("#"+b.prefix+"-bucket").val();c.find(".as3cf-bucket-manual .as3cf-bucket-name").val(d),this.bucketSelectLock=!1},saveManual:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find("button[type=submit]"),f=d.val(),g=e.first().text();if(f===a("#"+b.prefix+"-active-bucket").text())return a(".as3cf-bucket-error").hide(),k.addClass("as3cf-has-bucket"),void b.close();a(".as3cf-bucket-error").hide(),e.text(e.attr("data-working")),e.prop("disabled",!0);var h={action:b.prefix+"-manual-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.manual_bucket},i=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:h,error:function(a,b,c){e.text(g),i.showError(as3cf.strings.save_bucket_error,c,"as3cf-bucket-manual")},success:function(c,d,h){e.text(g),e.prop("disabled",!1),"undefined"!=typeof c.success?(i.set(f,c.region,c.can_write),a("#"+b.prefix+"-bucket-select").val("manual"),a(".as3cf-bucket-list a").removeClass("selected").filter('[data-bucket="'+f+'"]').addClass("selected"),n=!0):i.showError(as3cf.strings.save_bucket_error,c.error,"as3cf-bucket-manual")}})},saveSelected:function(c){var d=a(".as3cf-bucket-list");if(!this.bucketSelectLock){if(this.bucketSelectLock=!0,c.hasClass("selected"))return k.addClass("as3cf-has-bucket"),void b.close();var e=a(".as3cf-bucket-list a.selected").attr("data-bucket");a(".as3cf-bucket-list a").removeClass("selected"),c.addClass("selected"),d.addClass("saving"),c.find(".spinner").show().css("visibility","visible");var f=c.attr("data-bucket"),g={action:b.prefix+"-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.save_bucket},h=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:g,error:function(b,c,f){d.removeClass("saving"),h.showError(as3cf.strings.save_bucket_error,f,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected")},success:function(g,i,j){c.find(".spinner").hide().css("visibility","hidden"),d.removeClass("saving"),"undefined"!=typeof g.success?(h.set(f,g.region,g.can_write),a("#"+b.prefix+"-bucket-select").val("")):(h.showError(as3cf.strings.save_bucket_error,g.error,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"))}})}},disabledButtons:function(){if(0!==a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form").length){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");c.find(".as3cf-bucket-name").val().length<3?c.find("button[type=submit]").attr("disabled",!0):c.find("button[type=submit]").attr("disabled",!1),d.find(".as3cf-bucket-name").val().length<3?d.find("button[type=submit]").attr("disabled",!0):d.find("button[type=submit]").attr("disabled",!1)}},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+" —"),f.find("span.message").html(c),f.show(),this.bucketSelectLock=!1)},set:function(e,h,i){var j=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),m=a("#"+b.prefix+"-active-bucket");if("as3cf"===b.prefix&&0===m.text().trim().length){d("as3cf-copy-to-s3-wrap"),d("as3cf-serve-from-s3-wrap");var n=k.attr("id");l[n]=c(n)}a(".as3cf-error.fatal").hide(),m.text(e),j.find(".as3cf-bucket-name").val(e),a("#"+b.prefix+"-bucket").val(e),a("#"+b.prefix+"-region").val(h),a(".updated").not(".as3cf-notice").show(),k.addClass("as3cf-has-bucket"),k.find(".as3cf-can-write-error").toggle(!i),k.find(".as3cf-bucket-error").hide(),"as3cf"===b.prefix&&g(),f(),b.close(function(){k.trigger("bucket-change",[i]),as3cf.buckets.bucketSelectLock=!1})},create:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find(".bucket-create-region"),f=c.find("button[type=submit]"),g=d.val(),h=f.text();a(".as3cf-bucket-error").hide(),f.text(f.attr("data-working")),f.prop("disabled",!0);var i={action:b.prefix+"-create-bucket",bucket_name:g,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.create_bucket};e.val()&&(i.region=e.val());var j=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:i,error:function(a,b,c){f.text(h),j.showError(as3cf.strings.create_bucket_error,c,"as3cf-bucket-create")},success:function(b,c,e){f.text(h),f.prop("disabled",!1),"undefined"!=typeof b.success?(j.set(g,b.region,b.can_write),a(".as3cf-bucket-select-region").hide(),a(".as3cf-bucket-select-region").removeAttr("selected"),d.val(""),f.attr("disabled",!0),n=!0):j.showError(as3cf.strings.create_bucket_error,b.error,"as3cf-bucket-create")}})},isValidName:function(a){return!(a.length<3||a.length>63)&&!0!==m.test(a)},updateNameNotice:function(b){var c=null;!0===m.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("")}},a(document).ready(function(){j(),window.onhashchange=j;var m=a(".wrap.aws-main .nav-tab-wrapper");a(".aws-compatibility-notice, div.updated, div.error, div.notice").not(".below-h2, .inline").insertAfter(m),o.length&&o.each(function(a,b){l[b.id]=c(b.id)}),a(window).on("beforeunload.as3cf-settings",function(){if(!a.isEmptyObject(l)){var b=k.attr("id");return c(b)!==l[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"))}),o.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){g()}),h(),a("#as3cf-serve-from-s3,#as3cf-remove-local-file").on("change",function(a){h()}),i(),a("#as3cf-remove-local-file").on("change",function(a){i()}),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("#"+k.attr("id")+' form button[type="submit"]');"cloudfront"!==c.val()?d.attr("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"),a("body").on("click",".bucket-action-manual",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-manual").show().siblings().hide()}),a("body").on("click",".bucket-action-browse",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select").show().siblings().hide(),as3cf.buckets.loadList(n),n=!1}),a("body").on("click",".bucket-action-create",function(c){c.preventDefault(),a(".as3cf-bucket-name").val(""),a(".as3cf-invalid-bucket-name").html(""),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-create").show().siblings().hide()}),a("body").on("click",".bucket-action-cancel",function(a){a.preventDefault(),as3cf.buckets.resetModal()}),a("body").on("click",".bucket-action-save",function(a){a.preventDefault(),as3cf.buckets.saveManual()}),a("body").on("click",'.as3cf-create-bucket-form button[type="submit"]',function(a){a.preventDefault(),as3cf.buckets.create()}),a("body").on("click",".bucket-action-refresh",function(a){a.preventDefault(),as3cf.buckets.loadList(!0)}),a("body").on("click",".as3cf-bucket-list a",function(b){b.preventDefault(),as3cf.buckets.saveSelected(a(this))}),a(".as3cf-bucket-container").on("click","a.js-link",function(b){return b.preventDefault(),window.open(a(this).attr("href")),!1}),a("body").on("as3cf-modal-open",function(c,d){if(".as3cf-bucket-container."+b.prefix===d){as3cf.buckets.resetModal();var e=a(".as3cf-bucket-manual h3").data("modal-title");a(".as3cf-bucket-manual h3").text(e),as3cf.buckets.disabledButtons()}}),as3cf.buckets.disabledButtons(),a("body").on("input keyup",".as3cf-create-bucket-form .as3cf-bucket-name",function(c){var d=a(this).val(),e=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form");as3cf.buckets.isValidName(d)?e.find("button[type=submit]").removeAttr("disabled"):e.find("button[type=submit]").attr("disabled",!0),as3cf.buckets.updateNameNotice(d)}),a("body").on("input keyup",".as3cf-manual-save-bucket-form .as3cf-bucket-name",function(c){var d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");d.find(".as3cf-bucket-name").val().length<as3cf.buckets.validLength?d.find("button[type=submit]").attr("disabled",!0):d.find("button[type=submit]").removeAttr("disabled")})})}(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=k.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("#"+k.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=k.find('input[name="object-prefix"]'),e=d.val();""!==e&&(e="&prefix="+encodeURIComponent(e));var f=as3cf.aws_bucket_link+c+e;a("#"+b.prefix+"-view-bucket").attr("href",f)}function g(){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):alert(as3cf.strings.get_url_preview_error+b.error)}})}function h(){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 i(){a("#as3cf-remove-local-file").is(":checked")?a("#as3cf-remove-local-notice").show():a("#as3cf-remove-local-notice").hide()}function j(){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 k,l={},m=/[^a-z0-9.-]/,n=!1,o=a(".as3cf-tab");as3cf.tabs={defaultTab:"media",toggle:function(c,d){c=as3cf.tabs.sanitizeHash(c),o.hide(),k=a("#tab-"+c),k.show(),a(".nav-tab").removeClass("nav-tab-active"),a('a.nav-tab[data-tab="'+c+'"]').addClass("nav-tab-active"),a(".aws-main").data("tab",c),k.data("prefix")&&(b.prefix=k.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-list"),e=a("#"+b.prefix+"-bucket").val();if(!1===c&&d.find("li").length>1)return a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"),void this.scrollToSelected();d.html('<li class="loading">'+d.data("working")+"</li>");var f={action:b.prefix+"-get-buckets",_nonce:window[b.prefix.replace(/-/g,"_")].nonces.get_buckets},g=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:f,error:function(a,b,c){d.html(""),g.showError(as3cf.strings.get_buckets_error,c,"as3cf-bucket-select")},success:function(b,c,f){d.html(""),"undefined"!=typeof b.success?(a(".as3cf-bucket-error").hide(),a(b.buckets).each(function(a,b){var c=b.Name===e?"selected":"";d.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>')}),g.scrollToSelected()):g.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})}},resetModal:function(){var c=a(".as3cf-bucket-container."+b.prefix);!1===k.hasClass("as3cf-has-bucket")||"manual"===a("#"+b.prefix+"-bucket-select").val()?(c.find(".as3cf-bucket-manual").show().siblings().hide(),c.find(".bucket-actions.manual").show().siblings(".bucket-actions").hide()):(c.find(".as3cf-bucket-select").show().siblings().hide(),c.find(".bucket-actions.select").show().siblings(".bucket-actions").hide(),this.loadList(n),n=!1),c.find(".as3cf-bucket-error").hide();var d=a("#"+b.prefix+"-bucket").val();c.find(".as3cf-bucket-manual .as3cf-bucket-name").val(d),this.bucketSelectLock=!1},saveManual:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find("button[type=submit]"),f=d.val(),g=e.first().text();if(f===a("#"+b.prefix+"-active-bucket").text())return a(".as3cf-bucket-error").hide(),k.addClass("as3cf-has-bucket"),void b.close();a(".as3cf-bucket-error").hide(),e.text(e.data("working")),e.prop("disabled",!0);var h={action:b.prefix+"-manual-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.manual_bucket},i=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:h,error:function(a,b,c){e.text(g),i.showError(as3cf.strings.save_bucket_error,c,"as3cf-bucket-manual")},success:function(c,d,h){e.text(g),e.prop("disabled",!1),"undefined"!=typeof c.success?(i.set(f,c.region,c.can_write),a("#"+b.prefix+"-bucket-select").val("manual"),a(".as3cf-bucket-list a").removeClass("selected").filter('[data-bucket="'+f+'"]').addClass("selected"),n=!0):i.showError(as3cf.strings.save_bucket_error,c.error,"as3cf-bucket-manual")}})},saveSelected:function(c){var d=a(".as3cf-bucket-list");if(!this.bucketSelectLock){if(this.bucketSelectLock=!0,c.hasClass("selected"))return k.addClass("as3cf-has-bucket"),void b.close();var e=a(".as3cf-bucket-list a.selected").data("bucket");a(".as3cf-bucket-list a").removeClass("selected"),c.addClass("selected"),d.addClass("saving"),c.find(".spinner").show().css("visibility","visible");var f=c.data("bucket"),g={action:b.prefix+"-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.save_bucket},h=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:g,error:function(b,c,f){d.removeClass("saving"),h.showError(as3cf.strings.save_bucket_error,f,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected")},success:function(g,i,j){c.find(".spinner").hide().css("visibility","hidden"),d.removeClass("saving"),"undefined"!=typeof g.success?(h.set(f,g.region,g.can_write),a("#"+b.prefix+"-bucket-select").val("")):(h.showError(as3cf.strings.save_bucket_error,g.error,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"))}})}},disabledButtons:function(){if(0!==a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form").length){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");c.find(".as3cf-bucket-name").val().length<3?c.find("button[type=submit]").prop("disabled",!0):c.find("button[type=submit]").prop("disabled",!1),d.find(".as3cf-bucket-name").val().length<3?d.find("button[type=submit]").prop("disabled",!0):d.find("button[type=submit]").prop("disabled",!1)}},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+" —"),f.find("span.message").html(c),f.show(),this.bucketSelectLock=!1)},set:function(e,h,i){var j=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),m=a("#"+b.prefix+"-active-bucket");if("as3cf"===b.prefix&&0===m.text().trim().length){d("as3cf-copy-to-s3-wrap"),d("as3cf-serve-from-s3-wrap");var n=k.attr("id");l[n]=c(n)}a(".as3cf-error.fatal").hide(),m.text(e),j.find(".as3cf-bucket-name").val(e),a("#"+b.prefix+"-bucket").val(e),a("#"+b.prefix+"-region").val(h),a(".updated").not(".as3cf-notice").show(),k.addClass("as3cf-has-bucket"),k.find(".as3cf-can-write-error").toggle(!i),k.find(".as3cf-bucket-error").hide(),"as3cf"===b.prefix&&g(),f(),b.close(function(){k.trigger("bucket-change",[i]),as3cf.buckets.bucketSelectLock=!1})},create:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find(".bucket-create-region"),f=c.find("button[type=submit]"),g=d.val(),h=f.text();a(".as3cf-bucket-error").hide(),f.text(f.data("working")),f.prop("disabled",!0);var i={action:b.prefix+"-create-bucket",bucket_name:g,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.create_bucket};e.val()&&(i.region=e.val());var j=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:i,error:function(a,b,c){f.text(h),j.showError(as3cf.strings.create_bucket_error,c,"as3cf-bucket-create")},success:function(b,c,e){f.text(h),f.prop("disabled",!1),"undefined"!=typeof b.success?(j.set(g,b.region,b.can_write),a(".as3cf-bucket-select-region").hide(),a(".as3cf-bucket-select-region").prop("selected",!1),d.val(""),f.prop("disabled",!0),n=!0):j.showError(as3cf.strings.create_bucket_error,b.error,"as3cf-bucket-create")}})},isValidName:function(a){return!(a.length<3||a.length>63)&&!0!==m.test(a)},updateNameNotice:function(b){var c=null;!0===m.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("")}},a(document).ready(function(){j(),window.onhashchange=function(a){"function"==typeof history.replaceState&&"#"===location.href.slice(-1)&&history.replaceState({},"",location.href.slice(0,-1)),j()};var m=a(".wrap.aws-main .nav-tab-wrapper");a(".aws-compatibility-notice, div.updated, div.error, div.notice").not(".below-h2, .inline").insertAfter(m),o.length&&o.each(function(a,b){l[b.id]=c(b.id)}),a(window).on("beforeunload.as3cf-settings",function(){if(!a.isEmptyObject(l)){var b=k.attr("id");return c(b)!==l[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"))}),o.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){g()}),h(),a("#as3cf-serve-from-s3,#as3cf-remove-local-file").on("change",function(a){h()}),i(),a("#as3cf-remove-local-file").on("change",function(a){i()}),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("#"+k.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"),a("body").on("click",".bucket-action-manual",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-manual").show().siblings().hide()}),a("body").on("click",".bucket-action-browse",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select").show().siblings().hide(),as3cf.buckets.loadList(n),n=!1}),a("body").on("click",".bucket-action-create",function(c){c.preventDefault(),a(".as3cf-bucket-name").val(""),a(".as3cf-invalid-bucket-name").html(""),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-create").show().siblings().hide()}),a("body").on("click",".bucket-action-cancel",function(a){a.preventDefault(),as3cf.buckets.resetModal()}),a("body").on("click",".bucket-action-save",function(a){a.preventDefault(),as3cf.buckets.saveManual()}),a("body").on("click",'.as3cf-create-bucket-form button[type="submit"]',function(a){a.preventDefault(),as3cf.buckets.create()}),a("body").on("click",".bucket-action-refresh",function(a){a.preventDefault(),as3cf.buckets.loadList(!0)}),a("body").on("click",".as3cf-bucket-list a",function(b){b.preventDefault(),as3cf.buckets.saveSelected(a(this))}),a(".as3cf-bucket-container").on("click","a.js-link",function(b){return b.preventDefault(),window.open(a(this).attr("href")),!1}),a("body").on("as3cf-modal-open",function(c,d){if(".as3cf-bucket-container."+b.prefix===d){as3cf.buckets.resetModal();var e=a(".as3cf-bucket-manual h3").data("modal-title");a(".as3cf-bucket-manual h3").text(e),as3cf.buckets.disabledButtons()}}),as3cf.buckets.disabledButtons(),a("body").on("input keyup",".as3cf-create-bucket-form .as3cf-bucket-name",function(c){var d=a(this).val(),e=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form");as3cf.buckets.isValidName(d)?e.find("button[type=submit]").prop("disabled",!1):e.find("button[type=submit]").prop("disabled",!0),as3cf.buckets.updateNameNotice(d)}),a("body").on("input keyup",".as3cf-manual-save-bucket-form .as3cf-bucket-name",function(c){var d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");d.find(".as3cf-bucket-name").val().length<as3cf.buckets.validLength?d.find("button[type=submit]").prop("disabled",!0):d.find("button[type=submit]").prop("disabled",!1)})})}(jQuery,as3cfModal);
|
assets/sass/notice.scss
CHANGED
@@ -7,3 +7,10 @@
|
|
7 |
max-width: 800px;
|
8 |
}
|
9 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
max-width: 800px;
|
8 |
}
|
9 |
}
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Prevent WP from adding the circular arrow icon to all P tags inside the notice html.
|
13 |
+
*/
|
14 |
+
.as3cf-license-notice p:not(.as3cf-before):before {
|
15 |
+
display: none;
|
16 |
+
}
|
assets/sass/styles.scss
CHANGED
@@ -686,18 +686,6 @@
|
|
686 |
}
|
687 |
}
|
688 |
|
689 |
-
@media (min--moz-device-pixel-ratio: 1.3),
|
690 |
-
(-o-min-device-pixel-ratio: 2.6/2),
|
691 |
-
(-webkit-min-device-pixel-ratio: 1.3),
|
692 |
-
(min-device-pixel-ratio: 1.3),
|
693 |
-
(min-resolution: 1.3dppx) {
|
694 |
-
|
695 |
-
.as3cf-banner {
|
696 |
-
background-image: url(../img/snail-banner@2x.jpg);
|
697 |
-
background-size: 292px 156px;
|
698 |
-
}
|
699 |
-
}
|
700 |
-
|
701 |
@media screen and (max-width: 1052px) {
|
702 |
position: relative;
|
703 |
top: auto;
|
@@ -711,45 +699,47 @@
|
|
711 |
.as3cf-banner {
|
712 |
margin-top: 35px;
|
713 |
width: 292px;
|
714 |
-
height:
|
715 |
display: block;
|
716 |
-
background
|
717 |
-
|
718 |
|
719 |
-
|
720 |
-
|
721 |
-
color: #fff;
|
722 |
-
font-weight: 200;
|
723 |
-
margin: 0;
|
724 |
-
position: absolute;
|
725 |
-
bottom: 25px;
|
726 |
-
left: 20px;
|
727 |
-
text-decoration: none;
|
728 |
-
}
|
729 |
}
|
730 |
|
731 |
-
.as3cf-upgrade-details {
|
732 |
-
background-color: #
|
733 |
-
padding: 20px;
|
734 |
-
color: #
|
735 |
font-size: 13px;
|
736 |
margin: 0;
|
737 |
display: block;
|
738 |
text-decoration: none;
|
739 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
740 |
p {
|
741 |
margin: 0;
|
742 |
}
|
743 |
|
744 |
a {
|
745 |
-
color: #
|
746 |
font-weight: bold;
|
747 |
text-decoration: none;
|
748 |
font-size: 16px;
|
|
|
749 |
|
750 |
&:hover {
|
751 |
color: #fff;
|
752 |
-
opacity: 0.9;
|
753 |
}
|
754 |
}
|
755 |
|
686 |
}
|
687 |
}
|
688 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
689 |
@media screen and (max-width: 1052px) {
|
690 |
position: relative;
|
691 |
top: auto;
|
699 |
.as3cf-banner {
|
700 |
margin-top: 35px;
|
701 |
width: 292px;
|
702 |
+
height: 200px;
|
703 |
display: block;
|
704 |
+
background: #f8cfae url(../img/os3-banner.svg) left bottom / 220px 220px no-repeat;
|
705 |
+
}
|
706 |
|
707 |
+
.as3cf-banner:focus {
|
708 |
+
box-shadow: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
709 |
}
|
710 |
|
711 |
+
.wrap .as3cf-upgrade-details {
|
712 |
+
background-color: #4e0d33;
|
713 |
+
padding: 10px 20px 20px 20px;
|
714 |
+
color: #eee;
|
715 |
font-size: 13px;
|
716 |
margin: 0;
|
717 |
display: block;
|
718 |
text-decoration: none;
|
719 |
|
720 |
+
h1 {
|
721 |
+
font-size: 28px;
|
722 |
+
color: #eee;
|
723 |
+
margin: 0 0 15px 0;
|
724 |
+
padding: 0;
|
725 |
+
text-decoration: none;
|
726 |
+
font-weight: 200;
|
727 |
+
line-height: 1;
|
728 |
+
}
|
729 |
+
|
730 |
p {
|
731 |
margin: 0;
|
732 |
}
|
733 |
|
734 |
a {
|
735 |
+
color: #eee;
|
736 |
font-weight: bold;
|
737 |
text-decoration: none;
|
738 |
font-size: 16px;
|
739 |
+
box-shadow: none;
|
740 |
|
741 |
&:hover {
|
742 |
color: #fff;
|
|
|
743 |
}
|
744 |
}
|
745 |
|
classes/amazon-s3-and-cloudfront.php
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
<?php
|
2 |
|
|
|
3 |
use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_Content_Replace_URLs;
|
4 |
use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_EDD_Replace_URLs;
|
5 |
use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_File_Sizes;
|
@@ -167,6 +168,9 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
167 |
add_filter( 'delete_attachment', array( $this, 'delete_attachment' ), 20 );
|
168 |
add_filter( 'update_attached_file', array( $this, 'update_attached_file' ), 100, 2 );
|
169 |
|
|
|
|
|
|
|
170 |
// Content filtering
|
171 |
$this->filter_local = new AS3CF_Local_To_S3( $this );
|
172 |
$this->filter_s3 = new AS3CF_S3_To_Local( $this );
|
@@ -223,9 +227,11 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
223 |
'disabled_attr' => '',
|
224 |
'tr_class' => str_replace( '_', '-', $this->plugin_prefix . '-' . $key . '-container' ),
|
225 |
'setting_msg' => '',
|
|
|
226 |
);
|
227 |
|
228 |
if ( false !== $is_defined ) {
|
|
|
229 |
$args['disabled'] = true;
|
230 |
$args['disabled_attr'] = 'disabled="disabled"';
|
231 |
$args['tr_class'] .= ' as3cf-defined-setting';
|
@@ -452,12 +458,18 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
452 |
}
|
453 |
|
454 |
if ( false !== $value && $bucket !== $value ) {
|
455 |
-
|
456 |
-
$this->remove_setting( 'region' );
|
457 |
-
$this->save_settings();
|
458 |
}
|
459 |
}
|
460 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
/**
|
462 |
* Filter in defined settings with sensible defaults.
|
463 |
*
|
@@ -890,16 +902,14 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
890 |
}
|
891 |
|
892 |
// Allow S3 upload to be hijacked / cancelled for any reason
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
}
|
899 |
-
|
900 |
-
$error_msg = is_string( $pre ) ? $pre : __( 'Upload aborted by filter \'as3cf_pre_upload_attachment\'', 'amazon-s3-and-cloudfront' );
|
901 |
|
902 |
-
|
|
|
903 |
}
|
904 |
|
905 |
if ( is_null( $file_path ) ) {
|
@@ -1507,7 +1517,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
1507 |
* @return bool
|
1508 |
*/
|
1509 |
function is_plugin_setup() {
|
1510 |
-
if (
|
1511 |
// AWS not configured
|
1512 |
return false;
|
1513 |
}
|
@@ -2467,8 +2477,13 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
2467 |
$args['signature'] = self::AWS_SIGNATURE;
|
2468 |
}
|
2469 |
|
2470 |
-
|
2471 |
-
|
|
|
|
|
|
|
|
|
|
|
2472 |
}
|
2473 |
|
2474 |
return $this->s3client;
|
@@ -2477,7 +2492,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
2477 |
/**
|
2478 |
* Setter for S3 client
|
2479 |
*
|
2480 |
-
* @param Aws\S3\S3Client $client
|
2481 |
*/
|
2482 |
public function set_client( $client ) {
|
2483 |
$this->s3client = $client;
|
@@ -2486,11 +2501,22 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
2486 |
/**
|
2487 |
* Get the region of a bucket
|
2488 |
*
|
2489 |
-
* @param string
|
|
|
2490 |
*
|
2491 |
* @return string|WP_Error
|
2492 |
*/
|
2493 |
-
function get_bucket_region( $bucket ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2494 |
try {
|
2495 |
$region = $this->get_s3client()->getBucketLocation( array( 'Bucket' => $bucket ) );
|
2496 |
} catch ( Exception $e ) {
|
@@ -2503,6 +2529,11 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
2503 |
|
2504 |
$region = $this->translate_region( $region['Location'] );
|
2505 |
|
|
|
|
|
|
|
|
|
|
|
2506 |
return $region;
|
2507 |
}
|
2508 |
|
@@ -2859,15 +2890,14 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
2859 |
function render_page() {
|
2860 |
$this->aws->render_view( 'header', array( 'page_title' => $this->get_plugin_page_title(), 'page' => 'as3cf' ) );
|
2861 |
|
2862 |
-
|
2863 |
-
|
2864 |
-
if ( is_wp_error( $aws_client ) ) {
|
2865 |
-
$this->render_view( 'error-fatal', array( 'message' => $aws_client->get_error_message() ) );
|
2866 |
-
} else {
|
2867 |
$this->render_view( 'settings-tabs' );
|
2868 |
do_action( 'as3cf_pre_settings_render' );
|
2869 |
$this->render_view( 'settings' );
|
2870 |
do_action( 'as3cf_post_settings_render' );
|
|
|
|
|
2871 |
}
|
2872 |
|
2873 |
$this->aws->render_view( 'footer' );
|
@@ -3405,10 +3435,6 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
3405 |
$output .= esc_html( ( defined( 'AS3CF_BUCKET' ) ) ? AS3CF_BUCKET : 'Not defined' );
|
3406 |
$output .= "\r\n";
|
3407 |
|
3408 |
-
$output .= 'AS3CF_ASSETS_BUCKET: ';
|
3409 |
-
$output .= esc_html( ( defined( 'AS3CF_ASSETS_BUCKET' ) ) ? AS3CF_ASSETS_BUCKET : 'Not defined' );
|
3410 |
-
$output .= "\r\n";
|
3411 |
-
|
3412 |
$output .= 'AS3CF_REGION: ';
|
3413 |
$output .= esc_html( ( defined( 'AS3CF_REGION' ) ) ? AS3CF_REGION : 'Not defined' );
|
3414 |
$output .= "\r\n\r\n";
|
@@ -3936,10 +3962,10 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
3936 |
}
|
3937 |
|
3938 |
$url = $this->dbrains_url( $path, $args, $hash );
|
3939 |
-
$text = __( 'More
|
3940 |
$link = AS3CF_Utils::dbrains_link( $url, $text );
|
3941 |
|
3942 |
-
return sprintf( '<span class="more-info">%s
|
3943 |
}
|
3944 |
|
3945 |
/**
|
@@ -4081,6 +4107,17 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
4081 |
return false;
|
4082 |
}
|
4083 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4084 |
/**
|
4085 |
* Render the S3 attachment meta box
|
4086 |
*/
|
@@ -4092,7 +4129,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
|
|
4092 |
's3object' => $this->get_formatted_s3_info( $post->ID ),
|
4093 |
'post' => $post,
|
4094 |
'local_file_exists' => file_exists( $file ),
|
4095 |
-
'
|
4096 |
'sendback' => 'post.php?post=' . $post->ID . '&action=edit',
|
4097 |
);
|
4098 |
|
1 |
<?php
|
2 |
|
3 |
+
use DeliciousBrains\WP_Offload_S3\Null_S3_Client;
|
4 |
use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_Content_Replace_URLs;
|
5 |
use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_EDD_Replace_URLs;
|
6 |
use DeliciousBrains\WP_Offload_S3\Upgrades\Upgrade_File_Sizes;
|
168 |
add_filter( 'delete_attachment', array( $this, 'delete_attachment' ), 20 );
|
169 |
add_filter( 'update_attached_file', array( $this, 'update_attached_file' ), 100, 2 );
|
170 |
|
171 |
+
// Listen for settings changes
|
172 |
+
add_action( 'as3cf_constant_' . static::SETTINGS_CONSTANT . '_changed_bucket', array( $this, 'bucket_changed' ) );
|
173 |
+
|
174 |
// Content filtering
|
175 |
$this->filter_local = new AS3CF_Local_To_S3( $this );
|
176 |
$this->filter_s3 = new AS3CF_S3_To_Local( $this );
|
227 |
'disabled_attr' => '',
|
228 |
'tr_class' => str_replace( '_', '-', $this->plugin_prefix . '-' . $key . '-container' ),
|
229 |
'setting_msg' => '',
|
230 |
+
'is_defined' => false,
|
231 |
);
|
232 |
|
233 |
if ( false !== $is_defined ) {
|
234 |
+
$args['is_defined'] = true;
|
235 |
$args['disabled'] = true;
|
236 |
$args['disabled_attr'] = 'disabled="disabled"';
|
237 |
$args['tr_class'] .= ' as3cf-defined-setting';
|
458 |
}
|
459 |
|
460 |
if ( false !== $value && $bucket !== $value ) {
|
461 |
+
$this->bucket_changed();
|
|
|
|
|
462 |
}
|
463 |
}
|
464 |
|
465 |
+
/**
|
466 |
+
* Perform necessary actions when the chosen bucket is changed.
|
467 |
+
*/
|
468 |
+
public function bucket_changed() {
|
469 |
+
$this->remove_setting( 'region' );
|
470 |
+
$this->save_settings();
|
471 |
+
}
|
472 |
+
|
473 |
/**
|
474 |
* Filter in defined settings with sensible defaults.
|
475 |
*
|
902 |
}
|
903 |
|
904 |
// Allow S3 upload to be hijacked / cancelled for any reason
|
905 |
+
try {
|
906 |
+
$pre = apply_filters( 'as3cf_pre_upload_attachment', false, $post_id, $data );
|
907 |
+
} catch ( \Exception $e ) {
|
908 |
+
return $this->return_upload_error( $e->getMessage() );
|
909 |
+
}
|
|
|
|
|
|
|
910 |
|
911 |
+
if ( false !== $pre ) {
|
912 |
+
return $data;
|
913 |
}
|
914 |
|
915 |
if ( is_null( $file_path ) ) {
|
1517 |
* @return bool
|
1518 |
*/
|
1519 |
function is_plugin_setup() {
|
1520 |
+
if ( $this->aws->needs_access_keys() ) {
|
1521 |
// AWS not configured
|
1522 |
return false;
|
1523 |
}
|
2477 |
$args['signature'] = self::AWS_SIGNATURE;
|
2478 |
}
|
2479 |
|
2480 |
+
try {
|
2481 |
+
$aws_client = $this->aws->get_client();
|
2482 |
+
$this->set_client( $aws_client->get( 's3', $args ) );
|
2483 |
+
} catch ( \Exception $e ) {
|
2484 |
+
AS3CF_Error::log( $e->getMessage() );
|
2485 |
+
$this->set_client( new Null_S3_Client );
|
2486 |
+
}
|
2487 |
}
|
2488 |
|
2489 |
return $this->s3client;
|
2492 |
/**
|
2493 |
* Setter for S3 client
|
2494 |
*
|
2495 |
+
* @param Aws\S3\S3Client|Null_S3_Client $client
|
2496 |
*/
|
2497 |
public function set_client( $client ) {
|
2498 |
$this->s3client = $client;
|
2501 |
/**
|
2502 |
* Get the region of a bucket
|
2503 |
*
|
2504 |
+
* @param string $bucket
|
2505 |
+
* @param boolean $use_cache
|
2506 |
*
|
2507 |
* @return string|WP_Error
|
2508 |
*/
|
2509 |
+
public function get_bucket_region( $bucket, $use_cache = false ) {
|
2510 |
+
$regions = get_site_transient( 'as3cf_regions_cache' );
|
2511 |
+
|
2512 |
+
if ( ! is_array( $regions ) ) {
|
2513 |
+
$regions = array();
|
2514 |
+
}
|
2515 |
+
|
2516 |
+
if ( $use_cache && isset( $regions[ $bucket ] ) ) {
|
2517 |
+
return $regions[ $bucket ];
|
2518 |
+
}
|
2519 |
+
|
2520 |
try {
|
2521 |
$region = $this->get_s3client()->getBucketLocation( array( 'Bucket' => $bucket ) );
|
2522 |
} catch ( Exception $e ) {
|
2529 |
|
2530 |
$region = $this->translate_region( $region['Location'] );
|
2531 |
|
2532 |
+
if ( is_string( $region ) ) {
|
2533 |
+
$regions[ $bucket ] = $region;
|
2534 |
+
set_site_transient( 'as3cf_regions_cache', $regions, 5 * MINUTE_IN_SECONDS );
|
2535 |
+
}
|
2536 |
+
|
2537 |
return $region;
|
2538 |
}
|
2539 |
|
2890 |
function render_page() {
|
2891 |
$this->aws->render_view( 'header', array( 'page_title' => $this->get_plugin_page_title(), 'page' => 'as3cf' ) );
|
2892 |
|
2893 |
+
try {
|
2894 |
+
$this->aws->get_client();
|
|
|
|
|
|
|
2895 |
$this->render_view( 'settings-tabs' );
|
2896 |
do_action( 'as3cf_pre_settings_render' );
|
2897 |
$this->render_view( 'settings' );
|
2898 |
do_action( 'as3cf_post_settings_render' );
|
2899 |
+
} catch ( \Exception $e ) {
|
2900 |
+
$this->render_view( 'error-fatal', array( 'message' => $e->getMessage() ) );
|
2901 |
}
|
2902 |
|
2903 |
$this->aws->render_view( 'footer' );
|
3435 |
$output .= esc_html( ( defined( 'AS3CF_BUCKET' ) ) ? AS3CF_BUCKET : 'Not defined' );
|
3436 |
$output .= "\r\n";
|
3437 |
|
|
|
|
|
|
|
|
|
3438 |
$output .= 'AS3CF_REGION: ';
|
3439 |
$output .= esc_html( ( defined( 'AS3CF_REGION' ) ) ? AS3CF_REGION : 'Not defined' );
|
3440 |
$output .= "\r\n\r\n";
|
3962 |
}
|
3963 |
|
3964 |
$url = $this->dbrains_url( $path, $args, $hash );
|
3965 |
+
$text = __( 'More info', 'amazon-s3-and-cloudfront' );
|
3966 |
$link = AS3CF_Utils::dbrains_link( $url, $text );
|
3967 |
|
3968 |
+
return sprintf( '<span class="more-info">%s »</span>', $link );
|
3969 |
}
|
3970 |
|
3971 |
/**
|
4107 |
return false;
|
4108 |
}
|
4109 |
|
4110 |
+
/**
|
4111 |
+
* Get a list of available media actions which can be performed according to plugin and user capability requirements.
|
4112 |
+
*
|
4113 |
+
* @param string|null $scope
|
4114 |
+
*
|
4115 |
+
* @return array
|
4116 |
+
*/
|
4117 |
+
public function get_available_media_actions( $scope = '' ) {
|
4118 |
+
return array();
|
4119 |
+
}
|
4120 |
+
|
4121 |
/**
|
4122 |
* Render the S3 attachment meta box
|
4123 |
*/
|
4129 |
's3object' => $this->get_formatted_s3_info( $post->ID ),
|
4130 |
'post' => $post,
|
4131 |
'local_file_exists' => file_exists( $file ),
|
4132 |
+
'available_actions' => $this->get_available_media_actions( 'singular' ),
|
4133 |
'sendback' => 'post.php?post=' . $post->ID . '&action=edit',
|
4134 |
);
|
4135 |
|
classes/as3cf-filter.php
CHANGED
@@ -174,6 +174,10 @@ abstract class AS3CF_Filter {
|
|
174 |
return $this->filter_text_widget( $instance, $update_cache );
|
175 |
}
|
176 |
|
|
|
|
|
|
|
|
|
177 |
return $instance;
|
178 |
}
|
179 |
|
@@ -226,6 +230,26 @@ abstract class AS3CF_Filter {
|
|
226 |
return $instance;
|
227 |
}
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
/**
|
230 |
* Process content.
|
231 |
*
|
174 |
return $this->filter_text_widget( $instance, $update_cache );
|
175 |
}
|
176 |
|
177 |
+
if ( $class instanceof WP_Widget_Custom_HTML ) {
|
178 |
+
return $this->filter_custom_html_widget( $instance, $update_cache );
|
179 |
+
}
|
180 |
+
|
181 |
return $instance;
|
182 |
}
|
183 |
|
230 |
return $instance;
|
231 |
}
|
232 |
|
233 |
+
/**
|
234 |
+
* Filter custom html widget.
|
235 |
+
*
|
236 |
+
* @param array $instance
|
237 |
+
* @param bool $update_cache
|
238 |
+
*
|
239 |
+
* @return array
|
240 |
+
*/
|
241 |
+
protected function filter_custom_html_widget( $instance, $update_cache ) {
|
242 |
+
$cache = $this->get_option_cache();
|
243 |
+
$to_cache = array();
|
244 |
+
$instance['content'] = $this->process_content( $instance['content'], $cache, $to_cache );
|
245 |
+
|
246 |
+
if ( $update_cache ) {
|
247 |
+
$this->maybe_update_option_cache( $to_cache );
|
248 |
+
}
|
249 |
+
|
250 |
+
return $instance;
|
251 |
+
}
|
252 |
+
|
253 |
/**
|
254 |
* Process content.
|
255 |
*
|
classes/as3cf-plugin-compatibility.php
CHANGED
@@ -63,6 +63,9 @@ class AS3CF_Plugin_Compatibility {
|
|
63 |
add_filter( 'wp_calculate_image_srcset', array( $this, 'wp_calculate_image_srcset' ), 10, 5 );
|
64 |
add_filter( 'wp_calculate_image_srcset_meta', array( $this, 'wp_calculate_image_srcset_meta' ), 10, 4 );
|
65 |
|
|
|
|
|
|
|
66 |
if ( $this->as3cf->is_plugin_setup() ) {
|
67 |
$this->compatibility_init_if_setup();
|
68 |
}
|
@@ -818,4 +821,46 @@ class AS3CF_Plugin_Compatibility {
|
|
818 |
|
819 |
return $filename;
|
820 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
821 |
}
|
63 |
add_filter( 'wp_calculate_image_srcset', array( $this, 'wp_calculate_image_srcset' ), 10, 5 );
|
64 |
add_filter( 'wp_calculate_image_srcset_meta', array( $this, 'wp_calculate_image_srcset_meta' ), 10, 4 );
|
65 |
|
66 |
+
// Maybe warn about PHP version if in admin screens.
|
67 |
+
add_action( 'admin_init', array( $this, 'maybe_warn_about_php_version' ) );
|
68 |
+
|
69 |
if ( $this->as3cf->is_plugin_setup() ) {
|
70 |
$this->compatibility_init_if_setup();
|
71 |
}
|
821 |
|
822 |
return $filename;
|
823 |
}
|
824 |
+
|
825 |
+
/**
|
826 |
+
* Display an admin message if PHP version is soon to be unsupported by plugin.
|
827 |
+
*
|
828 |
+
* NOTE: This is not added to AWS SDK compatibility checks as it is remaining compatible with earlier PHP versions.
|
829 |
+
* This function should be removed or reworked once PHP 5.5 is required.
|
830 |
+
*/
|
831 |
+
public function maybe_warn_about_php_version() {
|
832 |
+
$key_base = 'php-version-55';
|
833 |
+
|
834 |
+
if ( version_compare( PHP_VERSION, '5.5', '<' ) ) {
|
835 |
+
$message = sprintf(
|
836 |
+
__( '<strong>Warning:</strong> This site is using PHP %1$s, in a future update WP Offload S3 will require PHP %2$s or later. %3$s', 'amazon-s3-and-cloudfront' ),
|
837 |
+
PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION,
|
838 |
+
'5.5',
|
839 |
+
$this->as3cf->more_info_link( '/wp-offload-s3/doc/php-version-requirements/', 'upgrade-php-version' )
|
840 |
+
);
|
841 |
+
|
842 |
+
// Show notice to user if not already dismissed.
|
843 |
+
$args = array(
|
844 |
+
'custom_id' => $key_base . '-site',
|
845 |
+
'type' => 'notice-warning',
|
846 |
+
'flash' => false,
|
847 |
+
'only_show_to_user' => false,
|
848 |
+
);
|
849 |
+
|
850 |
+
if ( ! in_array( $args['custom_id'], $this->as3cf->notices->get_dismissed_notices() ) ) {
|
851 |
+
$this->as3cf->notices->add_notice( $message, $args );
|
852 |
+
} else {
|
853 |
+
// If user has dismissed site-wide notice but we're in settings pages, show notice.
|
854 |
+
$args['custom_id'] = $key_base . '-settings';
|
855 |
+
$args['dismissible'] = false;
|
856 |
+
$args['only_show_in_settings'] = true;
|
857 |
+
|
858 |
+
$this->as3cf->notices->add_notice( $message, $args );
|
859 |
+
}
|
860 |
+
} else {
|
861 |
+
// If PHP version (now) OK, make sure notices not shown.
|
862 |
+
$this->as3cf->notices->remove_notice_by_id( $key_base . '-site' );
|
863 |
+
$this->as3cf->notices->remove_notice_by_id( $key_base . '-settings' );
|
864 |
+
}
|
865 |
+
}
|
866 |
}
|
classes/as3cf-utils.php
CHANGED
@@ -168,11 +168,13 @@ if ( ! class_exists( 'AS3CF_Utils' ) ) {
|
|
168 |
/**
|
169 |
* Parses a URL into its components. Compatible with PHP < 5.4.7.
|
170 |
*
|
171 |
-
* @param
|
172 |
*
|
173 |
-
* @
|
|
|
|
|
174 |
*/
|
175 |
-
public static function parse_url( $url ) {
|
176 |
$url = trim( $url );
|
177 |
$no_scheme = 0 === strpos( $url, '//' );
|
178 |
|
@@ -180,9 +182,13 @@ if ( ! class_exists( 'AS3CF_Utils' ) ) {
|
|
180 |
$url = 'http:' . $url;
|
181 |
}
|
182 |
|
183 |
-
$parts = parse_url( $url );
|
184 |
|
185 |
-
if ( $
|
|
|
|
|
|
|
|
|
186 |
unset( $parts['scheme'] );
|
187 |
}
|
188 |
|
@@ -197,13 +203,30 @@ if ( ! class_exists( 'AS3CF_Utils' ) ) {
|
|
197 |
* @return bool
|
198 |
*/
|
199 |
public static function is_url( $string ) {
|
200 |
-
if ( preg_match( '@^(?:https?:)
|
201 |
return true;
|
202 |
}
|
203 |
|
204 |
return false;
|
205 |
}
|
206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
/**
|
208 |
* Get file paths for all attachment versions.
|
209 |
*
|
@@ -357,5 +380,57 @@ if ( ! class_exists( 'AS3CF_Utils' ) ) {
|
|
357 |
public static function dbrains_link( $url, $text ) {
|
358 |
return sprintf( '<a href="%s">%s</a>', esc_url( $url ), esc_html( $text ) );
|
359 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
}
|
361 |
}
|
168 |
/**
|
169 |
* Parses a URL into its components. Compatible with PHP < 5.4.7.
|
170 |
*
|
171 |
+
* @param $url string The URL to parse.
|
172 |
*
|
173 |
+
* @param int $component PHP_URL_ constant for URL component to return.
|
174 |
+
*
|
175 |
+
* @return mixed An array of the parsed components, mixed for a requested component, or false on error.
|
176 |
*/
|
177 |
+
public static function parse_url( $url, $component = -1 ) {
|
178 |
$url = trim( $url );
|
179 |
$no_scheme = 0 === strpos( $url, '//' );
|
180 |
|
182 |
$url = 'http:' . $url;
|
183 |
}
|
184 |
|
185 |
+
$parts = parse_url( $url, $component );
|
186 |
|
187 |
+
if ( 0 < $component ) {
|
188 |
+
return $parts;
|
189 |
+
}
|
190 |
+
|
191 |
+
if ( $no_scheme && is_array( $parts ) ) {
|
192 |
unset( $parts['scheme'] );
|
193 |
}
|
194 |
|
203 |
* @return bool
|
204 |
*/
|
205 |
public static function is_url( $string ) {
|
206 |
+
if ( preg_match( '@^(?:https?:)?//[a-zA-Z0-9\-]+@', $string ) ) {
|
207 |
return true;
|
208 |
}
|
209 |
|
210 |
return false;
|
211 |
}
|
212 |
|
213 |
+
/**
|
214 |
+
* Is the string a relative URL?
|
215 |
+
*
|
216 |
+
* @param $string
|
217 |
+
*
|
218 |
+
* @return bool
|
219 |
+
*/
|
220 |
+
public static function is_relative_url( $string ) {
|
221 |
+
if ( empty( $string ) || ! is_string( $string ) ) {
|
222 |
+
return false;
|
223 |
+
}
|
224 |
+
|
225 |
+
$url = static::parse_url( $string );
|
226 |
+
|
227 |
+
return ( empty( $url['scheme'] ) && empty( $url['host'] ) );
|
228 |
+
}
|
229 |
+
|
230 |
/**
|
231 |
* Get file paths for all attachment versions.
|
232 |
*
|
380 |
public static function dbrains_link( $url, $text ) {
|
381 |
return sprintf( '<a href="%s">%s</a>', esc_url( $url ), esc_html( $text ) );
|
382 |
}
|
383 |
+
|
384 |
+
/**
|
385 |
+
* Check whether two URLs share the same domain.
|
386 |
+
*
|
387 |
+
* @param string $url_a
|
388 |
+
* @param string $url_b
|
389 |
+
*
|
390 |
+
* @return bool
|
391 |
+
*/
|
392 |
+
public static function url_domains_match( $url_a, $url_b ) {
|
393 |
+
if ( ! static::is_url( $url_a ) || ! static::is_url( $url_b ) ) {
|
394 |
+
return false;
|
395 |
+
}
|
396 |
+
|
397 |
+
return static::parse_url( $url_a, PHP_URL_HOST ) === static::parse_url( $url_b, PHP_URL_HOST );
|
398 |
+
}
|
399 |
+
|
400 |
+
/**
|
401 |
+
* Get the current domain.
|
402 |
+
*
|
403 |
+
* @return string|false
|
404 |
+
*/
|
405 |
+
public static function current_domain() {
|
406 |
+
return parse_url( home_url(), PHP_URL_HOST );
|
407 |
+
}
|
408 |
+
|
409 |
+
/**
|
410 |
+
* Get the base domain of the current domain.
|
411 |
+
*
|
412 |
+
* @return string
|
413 |
+
*/
|
414 |
+
public static function current_base_domain() {
|
415 |
+
$domain = static::current_domain();
|
416 |
+
$parts = explode( '.', $domain, 2 );
|
417 |
+
|
418 |
+
if ( isset( $parts[1] ) && in_array( $parts[0], array( 'www' ) ) ) {
|
419 |
+
return $parts[1];
|
420 |
+
}
|
421 |
+
|
422 |
+
return $domain;
|
423 |
+
}
|
424 |
+
|
425 |
+
/**
|
426 |
+
* A safe wrapper for deactivate_plugins()
|
427 |
+
*/
|
428 |
+
public static function deactivate_plugins() {
|
429 |
+
if ( ! function_exists( 'deactivate_plugins' ) ) {
|
430 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
431 |
+
}
|
432 |
+
|
433 |
+
call_user_func_array( 'deactivate_plugins', func_get_args() );
|
434 |
+
}
|
435 |
}
|
436 |
}
|
classes/null-s3-client.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace DeliciousBrains\WP_Offload_S3;
|
4 |
+
|
5 |
+
use AS3CF_Error;
|
6 |
+
|
7 |
+
class Null_S3_Client {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Log and fail calls to instance methods.
|
11 |
+
*
|
12 |
+
* @param $name
|
13 |
+
* @param $arguments
|
14 |
+
*
|
15 |
+
* @throws \Exception
|
16 |
+
*/
|
17 |
+
public function __call( $name, $arguments ) {
|
18 |
+
AS3CF_Error::log( $arguments, __CLASS__ . "->$name()" );
|
19 |
+
throw new \Exception( 'Failed to instantiate the AWS S3 client. Check your error log.' );
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Log and fail calls to static methods.
|
24 |
+
*
|
25 |
+
* @param $name
|
26 |
+
* @param $arguments
|
27 |
+
*
|
28 |
+
* @throws \Exception
|
29 |
+
*/
|
30 |
+
public static function __callStatic( $name, $arguments ) {
|
31 |
+
AS3CF_Error::log( $arguments, __CLASS__ . "::$name()" );
|
32 |
+
throw new \Exception( 'Failed to instantiate the AWS S3 client. Check your error log.' );
|
33 |
+
}
|
34 |
+
}
|
classes/upgrades/upgrade-filter-post.php
CHANGED
@@ -395,7 +395,7 @@ abstract class Upgrade_Filter_Post extends Upgrade {
|
|
395 |
*/
|
396 |
protected function get_generic_message() {
|
397 |
$link_text = __( 'See our documentation', 'amazon-s3-and-cloudfront' );
|
398 |
-
$url = $this->as3cf->dbrains_url( '/wp-offload-s3/doc/
|
399 |
'utm_campaign' => 'support+docs',
|
400 |
) );
|
401 |
$link = AS3CF_Utils::dbrains_link( $url, $link_text );
|
@@ -453,4 +453,4 @@ abstract class Upgrade_Filter_Post extends Upgrade {
|
|
453 |
|
454 |
return $this->get_highest_post_id();
|
455 |
}
|
456 |
-
}
|
395 |
*/
|
396 |
protected function get_generic_message() {
|
397 |
$link_text = __( 'See our documentation', 'amazon-s3-and-cloudfront' );
|
398 |
+
$url = $this->as3cf->dbrains_url( '/wp-offload-s3/doc/content-filtering-upgrade', array(
|
399 |
'utm_campaign' => 'support+docs',
|
400 |
) );
|
401 |
$link = AS3CF_Utils::dbrains_link( $url, $link_text );
|
453 |
|
454 |
return $this->get_highest_post_id();
|
455 |
}
|
456 |
+
}
|
classes/wp-aws-compatibility-check.php
CHANGED
@@ -304,7 +304,7 @@ if ( ! class_exists( 'WP_AWS_Compatibility_Check' ) ) {
|
|
304 |
/**
|
305 |
* Get the compatibility error message
|
306 |
*
|
307 |
-
* @return string|
|
308 |
*/
|
309 |
function get_error_msg() {
|
310 |
if ( is_null( $this->parent_plugin_slug ) ) {
|
@@ -521,4 +521,4 @@ if ( ! class_exists( 'WP_AWS_Compatibility_Check' ) ) {
|
|
521 |
return self::$is_installing_or_updating_plugins;
|
522 |
}
|
523 |
}
|
524 |
-
}
|
304 |
/**
|
305 |
* Get the compatibility error message
|
306 |
*
|
307 |
+
* @return string|bool
|
308 |
*/
|
309 |
function get_error_msg() {
|
310 |
if ( is_null( $this->parent_plugin_slug ) ) {
|
521 |
return self::$is_installing_or_updating_plugins;
|
522 |
}
|
523 |
}
|
524 |
+
}
|
languages/amazon-s3-and-cloudfront-en.pot
CHANGED
@@ -8,7 +8,7 @@ msgid ""
|
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: amazon-s3-and-cloudfront\n"
|
10 |
"Report-Msgid-Bugs-To: nom@deliciousbrains.com\n"
|
11 |
-
"POT-Creation-Date:
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -17,137 +17,133 @@ msgstr ""
|
|
17 |
"Content-Type: text/plain; charset=UTF-8\n"
|
18 |
"Content-Transfer-Encoding: 8bit\n"
|
19 |
|
20 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
21 |
msgid "Offload S3 Lite"
|
22 |
msgstr ""
|
23 |
|
24 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
25 |
msgid "S3 and CloudFront"
|
26 |
msgstr ""
|
27 |
|
28 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
29 |
#: view/bucket-setting.php:18
|
30 |
msgid "defined in wp-config.php"
|
31 |
msgstr ""
|
32 |
|
33 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
34 |
-
|
35 |
-
msgstr ""
|
36 |
-
|
37 |
-
#: classes/amazon-s3-and-cloudfront.php:911
|
38 |
-
#: classes/amazon-s3-and-cloudfront.php:1071
|
39 |
#, php-format
|
40 |
msgid "File %s does not exist"
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
44 |
#, php-format
|
45 |
msgid "Mime type %s is not allowed"
|
46 |
msgstr ""
|
47 |
|
48 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
49 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
50 |
#, php-format
|
51 |
msgid "Error uploading %s to S3: %s"
|
52 |
msgstr ""
|
53 |
|
54 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
55 |
msgid "Cheatin’ eh?"
|
56 |
msgstr ""
|
57 |
|
58 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
59 |
msgid "You do not have sufficient permissions to access this page."
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
63 |
msgid "No bucket name provided."
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
67 |
msgid "Error Getting Bucket Region"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
71 |
#, php-format
|
72 |
msgid "There was an error attempting to get the region of the bucket %s: %s"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
76 |
msgid ""
|
77 |
"This is a test file to check if the user has write permission to S3. Delete "
|
78 |
"me if found."
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
82 |
#, php-format
|
83 |
msgid ""
|
84 |
"There was an error attempting to check the permissions of the bucket %s: %s"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
88 |
msgid "Error creating bucket"
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
92 |
msgid "Bucket name too short."
|
93 |
msgstr ""
|
94 |
|
95 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
96 |
msgid "Bucket name too long."
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
100 |
msgid ""
|
101 |
"Invalid character. Bucket names can contain lowercase letters, numbers, "
|
102 |
"periods and hyphens."
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
106 |
msgid "Error saving bucket"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
110 |
msgid "Error fetching buckets"
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
114 |
msgid "Error getting URL preview: "
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
118 |
msgid "The changes you made will be lost if you navigate away from this page"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
122 |
msgid "Getting diagnostic info..."
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
126 |
msgid "Error getting diagnostic info: "
|
127 |
msgstr ""
|
128 |
|
129 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
130 |
msgid "Cheatin' eh?"
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
134 |
msgctxt "Show the media library tab"
|
135 |
msgid "Media Library"
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
139 |
msgctxt "Show the support tab"
|
140 |
msgid "Support"
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
144 |
#, php-format
|
145 |
msgid ""
|
146 |
"<strong>WP Offload S3</strong> — The file %s has been given %s "
|
147 |
"permissions on Amazon S3."
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
151 |
msgid ""
|
152 |
"<strong>WP Offload S3 Requirement Missing</strong> — Looks like you "
|
153 |
"don't have an image manipulation library installed on this server and "
|
@@ -155,11 +151,11 @@ msgid ""
|
|
155 |
"Please setup GD or ImageMagick."
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
159 |
msgid "Quick Start Guide"
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
163 |
#, php-format
|
164 |
msgid ""
|
165 |
"Looks like we don't have write access to this bucket. It's likely that the "
|
@@ -168,7 +164,7 @@ msgid ""
|
|
168 |
"correctly."
|
169 |
msgstr ""
|
170 |
|
171 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
172 |
#, php-format
|
173 |
msgid ""
|
174 |
"Looks like we don't have access to the buckets. It's likely that the user "
|
@@ -176,39 +172,39 @@ msgid ""
|
|
176 |
"Please see our %s for instructions on setting up permissions correctly."
|
177 |
msgstr ""
|
178 |
|
179 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
180 |
msgid "WP Offload S3 Activation"
|
181 |
msgstr ""
|
182 |
|
183 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
184 |
msgid ""
|
185 |
"WP Offload S3 Lite and WP Offload S3 cannot both be active. We've "
|
186 |
"automatically deactivated WP Offload S3 Lite."
|
187 |
msgstr ""
|
188 |
|
189 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
190 |
msgid "WP Offload S3 Lite Activation"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
194 |
msgid ""
|
195 |
"WP Offload S3 Lite and WP Offload S3 cannot both be active. We've "
|
196 |
"automatically deactivated WP Offload S3."
|
197 |
msgstr ""
|
198 |
|
199 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
200 |
-
msgid "More
|
201 |
msgstr ""
|
202 |
|
203 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
204 |
msgid "this doc"
|
205 |
msgstr ""
|
206 |
|
207 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
208 |
msgid "WP Offload S3 Feature Removed"
|
209 |
msgstr ""
|
210 |
|
211 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
212 |
#, php-format
|
213 |
msgid ""
|
214 |
"You had the \"Always non-SSL\" option selected in your settings, but we've "
|
@@ -219,32 +215,32 @@ msgid ""
|
|
219 |
"to the old behavior."
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
223 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
224 |
msgid "Amazon S3"
|
225 |
msgstr ""
|
226 |
|
227 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
228 |
msgctxt "Amazon S3 bucket"
|
229 |
msgid "Bucket"
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
233 |
msgctxt "Path to file on Amazon S3"
|
234 |
msgid "Path"
|
235 |
msgstr ""
|
236 |
|
237 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
238 |
msgctxt "Location of Amazon S3 bucket"
|
239 |
msgid "Region"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
243 |
msgctxt "Access control list of the file on Amazon S3"
|
244 |
msgid "Access"
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: classes/amazon-s3-and-cloudfront.php:
|
248 |
msgid "URL"
|
249 |
msgstr ""
|
250 |
|
@@ -256,18 +252,25 @@ msgstr ""
|
|
256 |
msgid "Invalid notice ID."
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: classes/as3cf-plugin-compatibility.php:
|
260 |
#, php-format
|
261 |
msgid "The local directory %s does not exist and could not be created."
|
262 |
msgstr ""
|
263 |
|
264 |
-
#: classes/as3cf-plugin-compatibility.php:
|
265 |
-
#: classes/as3cf-plugin-compatibility.php:
|
266 |
#: classes/upgrades/upgrade-meta-wp-error.php:81
|
267 |
#, php-format
|
268 |
msgid "There was an error attempting to download the file %s from S3: %s"
|
269 |
msgstr ""
|
270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
#: classes/upgrades/upgrade-content-replace-urls.php:36
|
272 |
msgid "and ensuring that only the local URL exists in post content."
|
273 |
msgstr ""
|
@@ -455,11 +458,11 @@ msgstr ""
|
|
455 |
msgid "The %s plugin has been deactivated."
|
456 |
msgstr ""
|
457 |
|
458 |
-
#: view/attachment-metabox.php:
|
459 |
msgid "This item has not been copied to S3 yet."
|
460 |
msgstr ""
|
461 |
|
462 |
-
#: view/attachment-metabox.php:
|
463 |
msgid "File does not exist on server"
|
464 |
msgstr ""
|
465 |
|
@@ -725,15 +728,15 @@ msgid "Manage S3 files in WordPress"
|
|
725 |
msgstr ""
|
726 |
|
727 |
#: view/sidebar.php:15
|
728 |
-
msgid "Assets addon - Serve your CSS & JS from
|
729 |
msgstr ""
|
730 |
|
731 |
#: view/sidebar.php:16
|
732 |
-
msgid "WooCommerce
|
733 |
msgstr ""
|
734 |
|
735 |
#: view/sidebar.php:17
|
736 |
-
msgid "Easy Digital Downloads
|
737 |
msgstr ""
|
738 |
|
739 |
#: view/sidebar.php:18
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: amazon-s3-and-cloudfront\n"
|
10 |
"Report-Msgid-Bugs-To: nom@deliciousbrains.com\n"
|
11 |
+
"POT-Creation-Date: 2018-01-26 12:18+0000\n"
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
17 |
"Content-Type: text/plain; charset=UTF-8\n"
|
18 |
"Content-Transfer-Encoding: 8bit\n"
|
19 |
|
20 |
+
#: classes/amazon-s3-and-cloudfront.php:123
|
21 |
msgid "Offload S3 Lite"
|
22 |
msgstr ""
|
23 |
|
24 |
+
#: classes/amazon-s3-and-cloudfront.php:124
|
25 |
msgid "S3 and CloudFront"
|
26 |
msgstr ""
|
27 |
|
28 |
+
#: classes/amazon-s3-and-cloudfront.php:238
|
29 |
#: view/bucket-setting.php:18
|
30 |
msgid "defined in wp-config.php"
|
31 |
msgstr ""
|
32 |
|
33 |
+
#: classes/amazon-s3-and-cloudfront.php:921
|
34 |
+
#: classes/amazon-s3-and-cloudfront.php:1081
|
|
|
|
|
|
|
|
|
35 |
#, php-format
|
36 |
msgid "File %s does not exist"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: classes/amazon-s3-and-cloudfront.php:932
|
40 |
#, php-format
|
41 |
msgid "Mime type %s is not allowed"
|
42 |
msgstr ""
|
43 |
|
44 |
+
#: classes/amazon-s3-and-cloudfront.php:1017
|
45 |
+
#: classes/amazon-s3-and-cloudfront.php:1089
|
46 |
#, php-format
|
47 |
msgid "Error uploading %s to S3: %s"
|
48 |
msgstr ""
|
49 |
|
50 |
+
#: classes/amazon-s3-and-cloudfront.php:2233
|
51 |
msgid "Cheatin’ eh?"
|
52 |
msgstr ""
|
53 |
|
54 |
+
#: classes/amazon-s3-and-cloudfront.php:2237
|
55 |
msgid "You do not have sufficient permissions to access this page."
|
56 |
msgstr ""
|
57 |
|
58 |
+
#: classes/amazon-s3-and-cloudfront.php:2243
|
59 |
msgid "No bucket name provided."
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: classes/amazon-s3-and-cloudfront.php:2523
|
63 |
msgid "Error Getting Bucket Region"
|
64 |
msgstr ""
|
65 |
|
66 |
+
#: classes/amazon-s3-and-cloudfront.php:2524
|
67 |
#, php-format
|
68 |
msgid "There was an error attempting to get the region of the bucket %s: %s"
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: classes/amazon-s3-and-cloudfront.php:2657
|
72 |
msgid ""
|
73 |
"This is a test file to check if the user has write permission to S3. Delete "
|
74 |
"me if found."
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: classes/amazon-s3-and-cloudfront.php:2676
|
78 |
#, php-format
|
79 |
msgid ""
|
80 |
"There was an error attempting to check the permissions of the bucket %s: %s"
|
81 |
msgstr ""
|
82 |
|
83 |
+
#: classes/amazon-s3-and-cloudfront.php:2730
|
84 |
msgid "Error creating bucket"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: classes/amazon-s3-and-cloudfront.php:2731
|
88 |
msgid "Bucket name too short."
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: classes/amazon-s3-and-cloudfront.php:2732
|
92 |
msgid "Bucket name too long."
|
93 |
msgstr ""
|
94 |
|
95 |
+
#: classes/amazon-s3-and-cloudfront.php:2733
|
96 |
msgid ""
|
97 |
"Invalid character. Bucket names can contain lowercase letters, numbers, "
|
98 |
"periods and hyphens."
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: classes/amazon-s3-and-cloudfront.php:2734
|
102 |
msgid "Error saving bucket"
|
103 |
msgstr ""
|
104 |
|
105 |
+
#: classes/amazon-s3-and-cloudfront.php:2735
|
106 |
msgid "Error fetching buckets"
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: classes/amazon-s3-and-cloudfront.php:2736
|
110 |
msgid "Error getting URL preview: "
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: classes/amazon-s3-and-cloudfront.php:2737
|
114 |
msgid "The changes you made will be lost if you navigate away from this page"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: classes/amazon-s3-and-cloudfront.php:2738
|
118 |
msgid "Getting diagnostic info..."
|
119 |
msgstr ""
|
120 |
|
121 |
+
#: classes/amazon-s3-and-cloudfront.php:2739
|
122 |
msgid "Error getting diagnostic info: "
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: classes/amazon-s3-and-cloudfront.php:2807
|
126 |
msgid "Cheatin' eh?"
|
127 |
msgstr ""
|
128 |
|
129 |
+
#: classes/amazon-s3-and-cloudfront.php:2913
|
130 |
msgctxt "Show the media library tab"
|
131 |
msgid "Media Library"
|
132 |
msgstr ""
|
133 |
|
134 |
+
#: classes/amazon-s3-and-cloudfront.php:2914
|
135 |
msgctxt "Show the support tab"
|
136 |
msgid "Support"
|
137 |
msgstr ""
|
138 |
|
139 |
+
#: classes/amazon-s3-and-cloudfront.php:3131
|
140 |
#, php-format
|
141 |
msgid ""
|
142 |
"<strong>WP Offload S3</strong> — The file %s has been given %s "
|
143 |
"permissions on Amazon S3."
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: classes/amazon-s3-and-cloudfront.php:3150
|
147 |
msgid ""
|
148 |
"<strong>WP Offload S3 Requirement Missing</strong> — Looks like you "
|
149 |
"don't have an image manipulation library installed on this server and "
|
151 |
"Please setup GD or ImageMagick."
|
152 |
msgstr ""
|
153 |
|
154 |
+
#: classes/amazon-s3-and-cloudfront.php:3755
|
155 |
msgid "Quick Start Guide"
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: classes/amazon-s3-and-cloudfront.php:3757
|
159 |
#, php-format
|
160 |
msgid ""
|
161 |
"Looks like we don't have write access to this bucket. It's likely that the "
|
164 |
"correctly."
|
165 |
msgstr ""
|
166 |
|
167 |
+
#: classes/amazon-s3-and-cloudfront.php:3759
|
168 |
#, php-format
|
169 |
msgid ""
|
170 |
"Looks like we don't have access to the buckets. It's likely that the user "
|
172 |
"Please see our %s for instructions on setting up permissions correctly."
|
173 |
msgstr ""
|
174 |
|
175 |
+
#: classes/amazon-s3-and-cloudfront.php:3909
|
176 |
msgid "WP Offload S3 Activation"
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: classes/amazon-s3-and-cloudfront.php:3910
|
180 |
msgid ""
|
181 |
"WP Offload S3 Lite and WP Offload S3 cannot both be active. We've "
|
182 |
"automatically deactivated WP Offload S3 Lite."
|
183 |
msgstr ""
|
184 |
|
185 |
+
#: classes/amazon-s3-and-cloudfront.php:3912
|
186 |
msgid "WP Offload S3 Lite Activation"
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: classes/amazon-s3-and-cloudfront.php:3913
|
190 |
msgid ""
|
191 |
"WP Offload S3 Lite and WP Offload S3 cannot both be active. We've "
|
192 |
"automatically deactivated WP Offload S3."
|
193 |
msgstr ""
|
194 |
|
195 |
+
#: classes/amazon-s3-and-cloudfront.php:3965
|
196 |
+
msgid "More info"
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: classes/amazon-s3-and-cloudfront.php:4060
|
200 |
msgid "this doc"
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: classes/amazon-s3-and-cloudfront.php:4062
|
204 |
msgid "WP Offload S3 Feature Removed"
|
205 |
msgstr ""
|
206 |
|
207 |
+
#: classes/amazon-s3-and-cloudfront.php:4063
|
208 |
#, php-format
|
209 |
msgid ""
|
210 |
"You had the \"Always non-SSL\" option selected in your settings, but we've "
|
215 |
"to the old behavior."
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: classes/amazon-s3-and-cloudfront.php:4093
|
219 |
+
#: classes/amazon-s3-and-cloudfront.php:4202
|
220 |
msgid "Amazon S3"
|
221 |
msgstr ""
|
222 |
|
223 |
+
#: classes/amazon-s3-and-cloudfront.php:4203
|
224 |
msgctxt "Amazon S3 bucket"
|
225 |
msgid "Bucket"
|
226 |
msgstr ""
|
227 |
|
228 |
+
#: classes/amazon-s3-and-cloudfront.php:4204
|
229 |
msgctxt "Path to file on Amazon S3"
|
230 |
msgid "Path"
|
231 |
msgstr ""
|
232 |
|
233 |
+
#: classes/amazon-s3-and-cloudfront.php:4205
|
234 |
msgctxt "Location of Amazon S3 bucket"
|
235 |
msgid "Region"
|
236 |
msgstr ""
|
237 |
|
238 |
+
#: classes/amazon-s3-and-cloudfront.php:4206
|
239 |
msgctxt "Access control list of the file on Amazon S3"
|
240 |
msgid "Access"
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: classes/amazon-s3-and-cloudfront.php:4207
|
244 |
msgid "URL"
|
245 |
msgstr ""
|
246 |
|
252 |
msgid "Invalid notice ID."
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: classes/as3cf-plugin-compatibility.php:515
|
256 |
#, php-format
|
257 |
msgid "The local directory %s does not exist and could not be created."
|
258 |
msgstr ""
|
259 |
|
260 |
+
#: classes/as3cf-plugin-compatibility.php:516
|
261 |
+
#: classes/as3cf-plugin-compatibility.php:528
|
262 |
#: classes/upgrades/upgrade-meta-wp-error.php:81
|
263 |
#, php-format
|
264 |
msgid "There was an error attempting to download the file %s from S3: %s"
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: classes/as3cf-plugin-compatibility.php:836
|
268 |
+
#, php-format
|
269 |
+
msgid ""
|
270 |
+
"<strong>Warning:</strong> This site is using PHP %1$s, in a future update WP "
|
271 |
+
"Offload S3 will require PHP %2$s or later. %3$s"
|
272 |
+
msgstr ""
|
273 |
+
|
274 |
#: classes/upgrades/upgrade-content-replace-urls.php:36
|
275 |
msgid "and ensuring that only the local URL exists in post content."
|
276 |
msgstr ""
|
458 |
msgid "The %s plugin has been deactivated."
|
459 |
msgstr ""
|
460 |
|
461 |
+
#: view/attachment-metabox.php:14
|
462 |
msgid "This item has not been copied to S3 yet."
|
463 |
msgstr ""
|
464 |
|
465 |
+
#: view/attachment-metabox.php:39
|
466 |
msgid "File does not exist on server"
|
467 |
msgstr ""
|
468 |
|
728 |
msgstr ""
|
729 |
|
730 |
#: view/sidebar.php:15
|
731 |
+
msgid "Assets addon - Serve your CSS & JS from CloudFront or another CDN"
|
732 |
msgstr ""
|
733 |
|
734 |
#: view/sidebar.php:16
|
735 |
+
msgid "WooCommerce integration"
|
736 |
msgstr ""
|
737 |
|
738 |
#: view/sidebar.php:17
|
739 |
+
msgid "Easy Digital Downloads integration"
|
740 |
msgstr ""
|
741 |
|
742 |
#: view/sidebar.php:18
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: bradt, deliciousbrains
|
3 |
Tags: uploads, amazon, s3, amazon s3, mirror, admin, media, cdn, cloudfront
|
4 |
Requires at least: 4.6
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 1.2
|
7 |
License: GPLv3
|
8 |
|
9 |
Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
|
@@ -65,6 +65,17 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin
|
|
65 |
|
66 |
== Changelog ==
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
= WP Offload S3 Lite 1.2 - 2017-06-19 =
|
69 |
* New: Compatibility with WordPress 4.8
|
70 |
* New: Support for WP CLI `wp media regenerate`
|
2 |
Contributors: bradt, deliciousbrains
|
3 |
Tags: uploads, amazon, s3, amazon s3, mirror, admin, media, cdn, cloudfront
|
4 |
Requires at least: 4.6
|
5 |
+
Tested up to: 4.9
|
6 |
+
Stable tag: 1.2.1
|
7 |
License: GPLv3
|
8 |
|
9 |
Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
|
65 |
|
66 |
== Changelog ==
|
67 |
|
68 |
+
= WP Offload S3 Lite 1.2.1 - 2017-11-20 =
|
69 |
+
* New: Compatibility with HTML Widget
|
70 |
+
* New: Dismissible admin notice that WP Offload S3 Lite will soon require PHP 5.5+
|
71 |
+
* Improvement: Compatibility with WordPress 4.9
|
72 |
+
* Bug fix: Incorrect region used when changing bucket by defining it in WPOS3_SETTINGS
|
73 |
+
* Bug fix: Media library notices render inside the upload tool
|
74 |
+
* Bug fix: Save notices disappear on settings page
|
75 |
+
* Bug fix: Improper use of jQuery.attr logged to browser console
|
76 |
+
* Bug fix: "Content Filtering Upgrade" URL in notice incorrect
|
77 |
+
* Bug fix: "More info" links can be broken across two lines
|
78 |
+
|
79 |
= WP Offload S3 Lite 1.2 - 2017-06-19 =
|
80 |
* New: Compatibility with WordPress 4.8
|
81 |
* New: Support for WP CLI `wp media regenerate`
|
view/attachment-metabox.php
CHANGED
@@ -1,3 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div class="s3-details">
|
2 |
<?php if ( ! $s3object ) : ?>
|
3 |
<div class="misc-pub-section">
|
@@ -24,7 +34,7 @@
|
|
24 |
<?php echo $this->get_acl_value_string( $s3object['acl'] ); ?>
|
25 |
</div>
|
26 |
</div>
|
27 |
-
<?php if ( $
|
28 |
<div class="misc-pub-section">
|
29 |
<div class="not-copied"><?php _e( 'File does not exist on server', 'amazon-s3-and-cloudfront' ); ?></div>
|
30 |
<a id="as3cf-download-action" href="<?php echo $this->get_media_action_url( 'download', $post->ID, $sendback ); ?>">
|
@@ -35,16 +45,17 @@
|
|
35 |
<?php endif; ?>
|
36 |
<div class="clear"></div>
|
37 |
</div>
|
38 |
-
|
|
|
39 |
<div class="s3-actions">
|
40 |
-
<?php if ( $
|
41 |
<div class="remove-action">
|
42 |
-
<a id="as3cf-remove-action" href="<?php echo $this->get_media_action_url( 'remove', $post->ID, $sendback ); ?>"
|
43 |
<?php echo $this->get_media_action_strings( 'remove' ); ?>
|
44 |
</a>
|
45 |
</div>
|
46 |
<?php endif; ?>
|
47 |
-
<?php if ( $
|
48 |
<div class="copy-action">
|
49 |
<a id="as3cf-copy-action" href="<?php echo $this->get_media_action_url( 'copy', $post->ID, $sendback ); ?>" class="button button-secondary">
|
50 |
<?php echo $this->get_media_action_strings( 'copy' ); ?>
|
1 |
+
<?php
|
2 |
+
/** @var array|bool $s3object */
|
3 |
+
/** @var WP_Post $post */
|
4 |
+
/** @var array $available_actions */
|
5 |
+
/** @var bool $local_file_exists */
|
6 |
+
/** @var string $sendback */
|
7 |
+
$is_removable = $s3object && in_array( 'remove', $available_actions );
|
8 |
+
$is_copyable = $local_file_exists && in_array( 'copy', $available_actions );
|
9 |
+
$is_downloadable = ! $local_file_exists && in_array( 'download', $available_actions );
|
10 |
+
?>
|
11 |
<div class="s3-details">
|
12 |
<?php if ( ! $s3object ) : ?>
|
13 |
<div class="misc-pub-section">
|
34 |
<?php echo $this->get_acl_value_string( $s3object['acl'] ); ?>
|
35 |
</div>
|
36 |
</div>
|
37 |
+
<?php if ( $is_downloadable ) : ?>
|
38 |
<div class="misc-pub-section">
|
39 |
<div class="not-copied"><?php _e( 'File does not exist on server', 'amazon-s3-and-cloudfront' ); ?></div>
|
40 |
<a id="as3cf-download-action" href="<?php echo $this->get_media_action_url( 'download', $post->ID, $sendback ); ?>">
|
45 |
<?php endif; ?>
|
46 |
<div class="clear"></div>
|
47 |
</div>
|
48 |
+
|
49 |
+
<?php if ( $is_removable || $is_copyable ) : ?>
|
50 |
<div class="s3-actions">
|
51 |
+
<?php if ( $is_removable ) : ?>
|
52 |
<div class="remove-action">
|
53 |
+
<a id="as3cf-remove-action" href="<?php echo $this->get_media_action_url( 'remove', $post->ID, $sendback ); ?>">
|
54 |
<?php echo $this->get_media_action_strings( 'remove' ); ?>
|
55 |
</a>
|
56 |
</div>
|
57 |
<?php endif; ?>
|
58 |
+
<?php if ( $is_copyable ) : ?>
|
59 |
<div class="copy-action">
|
60 |
<a id="as3cf-copy-action" href="<?php echo $this->get_media_action_url( 'copy', $post->ID, $sendback ); ?>" class="button button-secondary">
|
61 |
<?php echo $this->get_media_action_strings( 'copy' ); ?>
|
view/sidebar.php
CHANGED
@@ -4,17 +4,17 @@
|
|
4 |
'utm_campaign' => 'WP+Offload+S3',
|
5 |
'utm_content' => 'sidebar',
|
6 |
) ); ?>">
|
7 |
-
<h1>Upgrade</h1>
|
8 |
</a>
|
9 |
|
10 |
<div class="as3cf-upgrade-details">
|
|
|
11 |
|
12 |
<ul>
|
13 |
<li><?php echo wptexturize( __( 'Upload existing Media Library to S3', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
|
14 |
<li><?php echo wptexturize( __( 'Manage S3 files in WordPress', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
|
15 |
-
<li><?php echo wptexturize( __( 'Assets addon - Serve your CSS & JS from
|
16 |
-
<li><?php echo wptexturize( __( 'WooCommerce
|
17 |
-
<li><?php echo wptexturize( __( 'Easy Digital Downloads
|
18 |
<li><?php echo wptexturize( __( 'PriorityExpert™ email support', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
|
19 |
</ul>
|
20 |
|
4 |
'utm_campaign' => 'WP+Offload+S3',
|
5 |
'utm_content' => 'sidebar',
|
6 |
) ); ?>">
|
|
|
7 |
</a>
|
8 |
|
9 |
<div class="as3cf-upgrade-details">
|
10 |
+
<h1>Upgrade</h1>
|
11 |
|
12 |
<ul>
|
13 |
<li><?php echo wptexturize( __( 'Upload existing Media Library to S3', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
|
14 |
<li><?php echo wptexturize( __( 'Manage S3 files in WordPress', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
|
15 |
+
<li><?php echo wptexturize( __( 'Assets addon - Serve your CSS & JS from CloudFront or another CDN', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
|
16 |
+
<li><?php echo wptexturize( __( 'WooCommerce integration', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
|
17 |
+
<li><?php echo wptexturize( __( 'Easy Digital Downloads integration', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
|
18 |
<li><?php echo wptexturize( __( 'PriorityExpert™ email support', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
|
19 |
</ul>
|
20 |
|
wordpress-s3.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Offload S3 Lite
|
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/amazon-s3-and-cloudfront/
|
5 |
Description: Automatically copies media uploads to Amazon S3 for storage and delivery. Optionally configure Amazon CloudFront for even faster delivery.
|
6 |
Author: Delicious Brains
|
7 |
-
Version: 1.2
|
8 |
Author URI: https://deliciousbrains.com/
|
9 |
Network: True
|
10 |
Text Domain: amazon-s3-and-cloudfront
|
@@ -26,9 +26,9 @@ Domain Path: /languages/
|
|
26 |
// Then completely rewritten.
|
27 |
*/
|
28 |
|
29 |
-
$GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] = '1.2';
|
30 |
|
31 |
-
$aws_plugin_version_required = '1.0.
|
32 |
|
33 |
require_once dirname( __FILE__ ) . '/classes/wp-aws-compatibility-check.php';
|
34 |
require_once dirname( __FILE__ ) . '/classes/as3cf-utils.php';
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/amazon-s3-and-cloudfront/
|
5 |
Description: Automatically copies media uploads to Amazon S3 for storage and delivery. Optionally configure Amazon CloudFront for even faster delivery.
|
6 |
Author: Delicious Brains
|
7 |
+
Version: 1.2.1
|
8 |
Author URI: https://deliciousbrains.com/
|
9 |
Network: True
|
10 |
Text Domain: amazon-s3-and-cloudfront
|
26 |
// Then completely rewritten.
|
27 |
*/
|
28 |
|
29 |
+
$GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] = '1.2.1';
|
30 |
|
31 |
+
$aws_plugin_version_required = '1.0.4';
|
32 |
|
33 |
require_once dirname( __FILE__ ) . '/classes/wp-aws-compatibility-check.php';
|
34 |
require_once dirname( __FILE__ ) . '/classes/as3cf-utils.php';
|