Skip to content

Commit

Permalink
Deploying version 0.9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
polevaultweb committed Aug 27, 2015
1 parent a0659e0 commit 6e4239f
Show file tree
Hide file tree
Showing 21 changed files with 1,431 additions and 749 deletions.
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# WP Offload S3 #
**Contributors:** bradt
**Donate link:** https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5VPMGLLK94XJC
**Contributors:** bradt, deliciousbrains
**Tags:** uploads, amazon, s3, mirror, admin, media, cdn, cloudfront
**Requires at least:** 3.7
**Tested up to:** 4.3
**Stable tag:** 0.9.3
**Stable tag:** 0.9.4
**License:** GPLv3

Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
Expand All @@ -17,19 +16,21 @@ This plugin automatically copies images, videos, documents, and any other media

Uploading files *directly* to your S3 account is not currently supported by this plugin. They are uploaded to your server first, then copied to S3. There is an option to automatically remove the files from your server once they are copied to S3 however.

If you're adding this plugin to a site that's been around for a while, your existing media files will not be copied or served from S3. Only newly uploaded files will be copied and served from S3.
If you're adding this plugin to a site that's been around for a while, your existing media files will not be copied or served from S3. Only newly uploaded files will be copied and served from S3. The pro upgrade has an upload tool to handle existing media files.

**PRO Upgrade with Email Support and More Features**

* Upload existing Media Library to S3
* Find & replace file URLs in content
* Control S3 files from the Media Library
* [Assets addon](https://deliciousbrains.com/wp-offload-s3/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=freeplugin#assets-addon) - Serve your CSS & JS from S3/CloudFront
* [WooCommerce addon](https://deliciousbrains.com/wp-offload-s3/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=freeplugin#woocommerce-addon)
* [Easy Digital Downloads addon](https://deliciousbrains.com/wp-offload-s3/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=freeplugin#edd-addon)
* [Assets addon](https://deliciousbrains.com/wp-offload-s3/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=os3-free-plugin#assets-addon) - Serve your CSS & JS from S3/CloudFront
* [WooCommerce addon](https://deliciousbrains.com/wp-offload-s3/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=os3-free-plugin#woocommerce-addon)
* [Easy Digital Downloads addon](https://deliciousbrains.com/wp-offload-s3/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=os3-free-plugin#edd-addon)
* PriorityExpert™ email support

See the video below or [visit the web site](http://deliciousbrains.com/wp-offload-s3/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=freeplugin) to learn more about the pro version.
[Compare pro vs free →](http://deliciousbrains.com/wp-offload-s3/upgrade/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=os3-free-plugin)

The video below runs through the pro upgrade features...

https://www.youtube.com/watch?v=55xNGnbJ_CY

Expand Down Expand Up @@ -66,6 +67,17 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin

## Changelog ##

### 0.9.4 - 2015-08-27 ###
* New: Update all existing attachments with missing file sizes when the 'Remove Files From Server' option is enabled (automatically runs in the background)
* Improvement: Show when constants are used to set bucket and region options
* Improvement: Don't show compatibility notices on plugin update screen
* Improvement: On Multisite installs don't call `restore_current_blog()` on successive loop iterations
* Bug fix: 'Error getting URL preview' alert shown when enter key pressed on settings screen
* Bug fix: Unable to crop header images when the 'Remove Files From Server' option is enabled
* Bug fix: Incorrect storage space shown on Multisite installs when the 'Remove Files From Server' option is enabled
* Bug fix: Upload attempted to non existent bucket when defined by constant
* Bug fix: 'SignatureDoesNotMatch' error shown when using signed URLs with bucket names containing '.' characters

### 0.9.3 - 2015-08-17 ###
* New: Pro upgrade sidebar
* Bug fix: Create buckets in US standard region causing S3 URLs to 404 errors
Expand Down
132 changes: 27 additions & 105 deletions assets/js/modal.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
var as3cfModal = (function ( $ ) {

var modal = {
prefix: 'as3cf'
prefix: 'as3cf',
loading: false
};

var modals = {};

/**
* Target to key
*
* @param string target
* @param {string} target
*
* @return string
* @return {string}
*/
function targetToKey( target ) {
return target.replace( /[^a-z]/g, '' );
Expand All @@ -20,10 +21,11 @@ var as3cfModal = (function ( $ ) {
/**
* Open modal
*
* @param string target
* @param function callback
* @param {string} target
* @param {function} callback
* @param {string} customClass
*/
modal.open = function ( target, callback ) {
modal.open = function ( target, callback, customClass ) {
var key = targetToKey( target );

// Overlay
Expand All @@ -41,6 +43,10 @@ var as3cfModal = (function ( $ ) {
}
$modal.data( 'as3cf-modal-target', target ).append( modals[ key ] );

if ( undefined !== customClass ) {
$modal.addClass( customClass );
}

if ( 'function' === typeof callback ) {
callback( target );
}
Expand All @@ -58,9 +64,13 @@ var as3cfModal = (function ( $ ) {
/**
* Close modal
*
* @param function callback
* @param {function} callback
*/
modal.close = function ( callback ) {
if ( modal.loading ) {
return;
}

var target = $( '#as3cf-modal' ).data( 'as3cf-modal-target' );

$( '#as3cf-overlay' ).fadeOut( 150, function () {
Expand All @@ -76,6 +86,15 @@ var as3cfModal = (function ( $ ) {
$( 'body' ).trigger( 'as3cf-modal-close', [ target ] );
};

/**
* Set loading state
*
* @param {bool} state
*/
modal.setLoadingState = function ( state ) {
modal.loading = state;
};

// Setup click handlers
$( document ).ready( function () {

Expand All @@ -99,101 +118,4 @@ var as3cfModal = (function ( $ ) {

return modal;

})( jQuery );

var as3cfFindAndReplaceModal = (function ( $, as3cfModal ) {

var modal = {
selector: '.as3cf-find-replace-container',
isBulk: false,
link: null,
payload: {}
};

/**
* Open modal
*
* @param string link
* @param mixed payload
*/
modal.open = function ( link, payload ) {
if ( typeof link !== 'undefined' ) {
modal.link = link;
}
if ( typeof payload !== 'undefined' ) {
modal.payload = payload;
}

as3cfModal.open( modal.selector );

$( modal.selector ).find( '.single-file' ).show();
$( modal.selector ).find( '.multiple-files' ).hide();
if ( modal.isBulk ) {
$( modal.selector ).find( '.single-file' ).hide();
$( modal.selector ).find( '.multiple-files' ).show();
}
};

/**
* Close modal
*/
modal.close = function () {
as3cfModal.close( modal.selector );
};

/**
* Set the isBulk flag
*/
modal.setBulk = function ( isBulk ) {
modal.isBulk = isBulk;
};

/**
* Create the loading state
*/
modal.startLoading = function () {
$( modal.selector + ' [data-find-replace]' ).prop( 'disabled', true ).siblings( '.spinner' ).css( 'visibility', 'visible' ).show();
};

/**
* Remove the loading state
*/
modal.stopLoading = function () {
$( modal.selector + ' [data-find-replace]' ).prop( 'disabled', false ).siblings( '.spinner' ).css( 'visibility', 'hidden' ).hide();
};

// Setup click handlers
$( document ).ready( function () {

$( 'body' ).on( 'click', modal.selector + ' [data-find-replace]', function ( e ) {
var findAndReplace = $( this ).data( 'find-replace' );

if ( !modal.link ) {
// If there is no link set then this must be an AJAX
// request so trigger an event instead
$( modal.selector ).trigger( 'as3cf-find-and-replace', [ findAndReplace, modal.payload ] );
return;
}

if ( findAndReplace ) {
modal.link += '&find_and_replace=1';
}

modal.startLoading();

window.location = modal.link;
} );

$( 'body' ).on( 'as3cf-modal-close', function ( e ) {
modal.isBulk = false;
modal.link = null;
modal.payload = {};
} );

} );

return modal;

})( jQuery, as3cfModal );


})( jQuery );
2 changes: 1 addition & 1 deletion assets/js/modal.min.js

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

13 changes: 13 additions & 0 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@
savedSettings[ id ] = serializedForm( id );
}

// Remove previous permission errors
$( '.as3cf-error.fatal' ).hide();

$activeBucket.text( bucket );
$manualBucketForm.find( '.as3cf-bucket-name' ).val( bucket );
$( '#' + as3cfModal.prefix + '-bucket' ).val( bucket );
Expand Down Expand Up @@ -627,6 +630,16 @@
generateUrlPreview();
} );

// Don't allow 'enter' key to submit form on text input settings
$( '.as3cf-setting input[type="text"]' ).keypress( function( event ) {
if ( 13 === event.which ) {
event.preventDefault();

return false;
}

} );

// Bucket select
// --------------------

Expand Down
Loading

0 comments on commit 6e4239f

Please sign in to comment.