Skip to content

Commit

Permalink
Deploying version 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmjones committed Nov 20, 2017
1 parent 761e98d commit 340ad2c
Show file tree
Hide file tree
Showing 18 changed files with 408 additions and 145 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
**Contributors:** bradt, deliciousbrains
**Tags:** uploads, amazon, s3, amazon s3, mirror, admin, media, cdn, cloudfront
**Requires at least:** 4.6
**Tested up to:** 4.8
**Stable tag:** 1.2
**Tested up to:** 4.9
**Stable tag:** 1.2.1
**License:** GPLv3

Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
Expand Down Expand Up @@ -69,6 +69,17 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin

## Changelog ##

### WP Offload S3 Lite 1.2.1 - 2017-11-20 ###
* New: Compatibility with HTML Widget
* New: Dismissible admin notice that WP Offload S3 Lite will soon require PHP 5.5+
* Improvement: Compatibility with WordPress 4.9
* Bug fix: Incorrect region used when changing bucket by defining it in WPOS3_SETTINGS
* Bug fix: Media library notices render inside the upload tool
* Bug fix: Save notices disappear on settings page
* Bug fix: Improper use of jQuery.attr logged to browser console
* Bug fix: "Content Filtering Upgrade" URL in notice incorrect
* Bug fix: "More info" links can be broken across two lines

### WP Offload S3 Lite 1.2 - 2017-06-19 ###
* New: Compatibility with WordPress 4.8
* New: Support for WP CLI `wp media regenerate`
Expand Down
2 changes: 1 addition & 1 deletion assets/css/notice.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.as3cf-notice p,.aws-compatibility-notice p{max-width:800px}
.as3cf-notice p,.aws-compatibility-notice p{max-width:800px}.as3cf-license-notice p:not(.as3cf-before):before{display:none}
6 changes: 3 additions & 3 deletions assets/js/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ var test = {};
event.preventDefault();

var toggle = $( '#as3cfpro-toggle-acl' );
var currentACL = toggle.attr( 'data-currentACL' );
var currentACL = toggle.data( 'currentacl' );
var newACL = as3cfpro_media.settings.private_acl;

toggle.hide();
Expand All @@ -124,7 +124,7 @@ var test = {};

wp.ajax.send( 'as3cfpro_update_acl', {
data: {
_nonce: as3cfpro_media.nonces.update_acl,
_ajax_nonce: as3cfpro_media.nonces.singular_update_acl,
id: this.model.get( 'id' ),
acl: newACL
}
Expand Down Expand Up @@ -155,7 +155,7 @@ var test = {};

toggle.text( response.acl_display );
toggle.attr( 'title', response.title );
toggle.attr( 'data-currentACL', response.acl );
toggle.data( 'currentacl', response.acl );
toggle.show();
}
} );
Expand Down
2 changes: 1 addition & 1 deletion assets/js/media.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 33 additions & 28 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

$switch.toggleClass( 'on' ).find( 'span' ).toggleClass( 'checked' );
var switchOn = $switch.find( 'span.on' ).hasClass( 'checked' );
$checkbox.attr( 'checked', switchOn ).trigger( 'change' );
$checkbox.prop( 'checked', switchOn ).trigger( 'change' );
}

/**
Expand All @@ -45,10 +45,10 @@

if ( pattern.test( $input.val() ) ) {
$error.show();
$submit.attr( 'disabled', true );
$submit.prop( 'disabled', true );
} else {
$error.hide();
$submit.attr( 'disabled', false );
$submit.prop( 'disabled', false );
}
}

Expand All @@ -68,9 +68,9 @@
$activeTab.show();
$( '.nav-tab' ).removeClass( 'nav-tab-active' );
$( 'a.nav-tab[data-tab="' + hash + '"]' ).addClass( 'nav-tab-active' );
$( '.aws-main' ).attr( 'data-tab', hash );
if ( $activeTab.attr( 'data-prefix' ) ) {
as3cfModal.prefix = $activeTab.attr( 'data-prefix' );
$( '.aws-main' ).data( 'tab', hash );
if ( $activeTab.data( 'prefix' ) ) {
as3cfModal.prefix = $activeTab.data( 'prefix' );
}
if ( ! persist_updated_notice ) {
$( '.as3cf-updated' ).removeClass( 'show' );
Expand Down Expand Up @@ -167,7 +167,7 @@
return;
}

$bucketList.html( '<li class="loading">' + $bucketList.attr( 'data-working' ) + '</li>' );
$bucketList.html( '<li class="loading">' + $bucketList.data( 'working' ) + '</li>' );

var data = {
action: as3cfModal.prefix + '-get-buckets',
Expand Down Expand Up @@ -264,7 +264,7 @@
return;
}
$( '.as3cf-bucket-error' ).hide();
$manualBucketButton.text( $manualBucketButton.attr( 'data-working' ) );
$manualBucketButton.text( $manualBucketButton.data( 'working' ) );
$manualBucketButton.prop( 'disabled', true );

var data = {
Expand Down Expand Up @@ -324,14 +324,14 @@
return;
}

var previousBucket = $( '.as3cf-bucket-list a.selected' ).attr( 'data-bucket' );
var previousBucket = $( '.as3cf-bucket-list a.selected' ).data( 'bucket' );

$( '.as3cf-bucket-list a' ).removeClass( 'selected' );
$link.addClass( 'selected' );

$bucketList.addClass( 'saving' );
$link.find( '.spinner' ).show().css( 'visibility', 'visible' );
var bucketName = $link.attr( 'data-bucket' );
var bucketName = $link.data( 'bucket' );

var data = {
action: as3cfModal.prefix + '-save-bucket',
Expand Down Expand Up @@ -379,15 +379,15 @@
var $manualBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-manual-save-bucket-form' );

if ( $createBucketForm.find( '.as3cf-bucket-name' ).val().length < 3 ) {
$createBucketForm.find( 'button[type=submit]' ).attr( 'disabled', true );
$createBucketForm.find( 'button[type=submit]' ).prop( 'disabled', true );
} else {
$createBucketForm.find( 'button[type=submit]' ).attr( 'disabled', false );
$createBucketForm.find( 'button[type=submit]' ).prop( 'disabled', false );
}

if ( $manualBucketForm.find( '.as3cf-bucket-name' ).val().length < 3 ) {
$manualBucketForm.find( 'button[type=submit]' ).attr( 'disabled', true );
$manualBucketForm.find( 'button[type=submit]' ).prop( 'disabled', true );
} else {
$manualBucketForm.find( 'button[type=submit]' ).attr( 'disabled', false );
$manualBucketForm.find( 'button[type=submit]' ).prop( 'disabled', false );
}
},

Expand Down Expand Up @@ -480,7 +480,7 @@
var origButtonText = $createBucketButton.text();

$( '.as3cf-bucket-error' ).hide();
$createBucketButton.text( $createBucketButton.attr( 'data-working' ) );
$createBucketButton.text( $createBucketButton.data( 'working' ) );
$createBucketButton.prop( 'disabled', true );

var data = {
Expand Down Expand Up @@ -512,9 +512,9 @@

// Tidy up create bucket form
$( '.as3cf-bucket-select-region' ).hide();
$( '.as3cf-bucket-select-region' ).removeAttr( 'selected' );
$( '.as3cf-bucket-select-region' ).prop( 'selected', false );
$createBucketInput.val( '' );
$createBucketButton.attr( 'disabled', true );
$createBucketButton.prop( 'disabled', true );

// Make sure the bucket list will refresh the next time the modal loads
refreshBucketListOnLoad = true;
Expand Down Expand Up @@ -662,12 +662,9 @@
return;
}

// Strip the # if still on the end of the URL
if ( 'function' === typeof history.replaceState && '#' === location.href.slice( -1 ) ) {
history.replaceState( {}, '', location.href.slice( 0, -1 ) );
}

as3cf.tabs.toggle( location.hash.replace( '#', '' ), true );

$( document ).trigger( 'as3cf.tabRendered', [ location.hash.replace( '#', '' ) ] );
}

$( document ).ready( function() {
Expand All @@ -679,7 +676,15 @@
/**
* Set the hashchange callback to update the rendered active tab.
*/
window.onhashchange = renderCurrentTab;
window.onhashchange = function( event ) {

// Strip the # if still on the end of the URL
if ( 'function' === typeof history.replaceState && '#' === location.href.slice( -1 ) ) {
history.replaceState( {}, '', location.href.slice( 0, -1 ) );
}

renderCurrentTab();
};

// Move any compatibility errors below the nav tabs
var $navTabs = $( '.wrap.aws-main .nav-tab-wrapper' );
Expand Down Expand Up @@ -768,7 +773,7 @@
var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );

if ( 'cloudfront' !== $input.val() ) {
$submit.attr( 'disabled', false );
$submit.prop( 'disabled', false );
} else {
validateCustomDomain( $input.next( '.as3cf-setting' ).find( 'input[name="cloudfront"]' ) );
}
Expand Down Expand Up @@ -862,9 +867,9 @@
var $createBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-create-bucket-form' );

if ( as3cf.buckets.isValidName( bucketName ) ) {
$createBucketForm.find( 'button[type=submit]' ).removeAttr( 'disabled' );
$createBucketForm.find( 'button[type=submit]' ).prop( 'disabled', false );
} else {
$createBucketForm.find( 'button[type=submit]' ).attr( 'disabled', true );
$createBucketForm.find( 'button[type=submit]' ).prop( 'disabled', true );
}
as3cf.buckets.updateNameNotice( bucketName );
} );
Expand All @@ -874,9 +879,9 @@
var $manualBucketForm = $( '.as3cf-bucket-container.' + as3cfModal.prefix + ' .as3cf-manual-save-bucket-form' );

if ( $manualBucketForm.find( '.as3cf-bucket-name' ).val().length < as3cf.buckets.validLength ) {
$manualBucketForm.find( 'button[type=submit]' ).attr( 'disabled', true );
$manualBucketForm.find( 'button[type=submit]' ).prop( 'disabled', true );
} else {
$manualBucketForm.find( 'button[type=submit]' ).removeAttr( 'disabled' );
$manualBucketForm.find( 'button[type=submit]' ).prop( 'disabled', false );
}
} );

Expand Down
Loading

0 comments on commit 340ad2c

Please sign in to comment.