Skip to content

Commit

Permalink
Merge branch 'branch-1.8.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Screenfeed committed Jul 18, 2018
2 parents 026fbeb + be24de5 commit c5c004f
Show file tree
Hide file tree
Showing 58 changed files with 6,741 additions and 524 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.editorconfig export-ignore
.eslintrc.json export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.jshintrc export-ignore
Expand Down
9 changes: 5 additions & 4 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1028,12 +1028,12 @@ p.imagify-section-title.imagify-section-title {
vertical-align: middle;
}
.column-imagify_optimized_file > * {
max-width: 235px;
max-width: 21em;
margin: 0 auto;
}
@media (min-width: 1151px) and (max-width: 1800px) {
.column-imagify_optimized_file.column-imagify_optimized_file {
width: 235px;
width: 21em;
}
}
@media (min-width: 783px) and (max-width: 1150px) {
Expand Down Expand Up @@ -1097,14 +1097,15 @@ li.imagify-data-item {
ul.imagify-datas-list .imagify-data-item span.data,
ul.imagify-datas-list .imagify-data-item strong {
float: left;
width: 50%;
width: 38%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
ul.imagify-datas-list .imagify-data-item span.data {
text-align: left;
width: 62%;
padding-right: 5px;
text-align: left;
}
.compat-field-imagify .imagify-datas-list .imagify-data-item .data {
width: 130px;
Expand Down
1,470 changes: 1,469 additions & 1 deletion assets/css/admin.min.css

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions assets/css/pricing-modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,10 @@ span.imagify-price-by {
border-color: #FFF;
background: #40B1D0;
}
.imagify-offer-selected .imagify-checkbox.imagify-checkbox:not(:checked) + label:after,
.imagify-offer-selected .imagify-checkbox.imagify-checkbox:checked + label:after {
color: #FFF;
}
.imagify-offer-selected .imagify-offer-by {
color: #2E3243;
}
Expand Down Expand Up @@ -954,7 +958,7 @@ div.imagify-col-price {
-ms-flex-positive: 1;
flex-grow: 1;
}
p.imagify-modal-sidebar-title {
p.imagify-modal-sidebar-title.imagify-modal-sidebar-title {
margin-top: 5px;
padding-right: 40px;
font-size: 18px;
Expand Down Expand Up @@ -1000,7 +1004,7 @@ p.imagify-modal-sidebar-title {
font-size: 10px;
color: #7A8996;
}
.imagify-modal-testimony-content p {
.imagify-modal-testimony-content.imagify-modal-testimony-content p {
font-size: 13px;
font-style: italic;
line-height: 1.7;
Expand Down Expand Up @@ -1143,4 +1147,4 @@ p.imagify-modal-sidebar-title {
color: #40b1d0;
float: right;
font-weight: bold;
}
}
1,151 changes: 1,150 additions & 1 deletion assets/css/pricing-modal.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jQuery.extend( window.imagify, {
};

return function() {
compiled = compiled || _.template( jQuery( '#tmpl-' + id ).html(), options );
compiled = compiled || _.template( jQuery( '#tmpl-' + id ).html(), null, options );
data = data || {};
return compiled( data );
};
Expand Down
104 changes: 103 additions & 1 deletion assets/js/admin.min.js
Original file line number Diff line number Diff line change
@@ -1 +1,103 @@
window.imagify=window.imagify||{},jQuery.extend(window.imagify,{concat:ajaxurl.indexOf("?")>0?"&":"?",log:function(a){void 0!==console&&console.log(a)},info:function(a){void 0!==console&&console.info(a)},openModal:function(a){var b=a.data("target")||a.attr("href");jQuery(b).css("display","flex").hide().fadeIn(400).attr({"aria-hidden":"false",tabindex:"0"}).focus().removeAttr("tabindex").addClass("modal-is-open"),jQuery("body").addClass("imagify-modal-is-open")},template:function(a){return void 0===_?"":_.memoize(function(b){var c,d={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^}]+?)\}\}(?!\})/g,variable:"data"};return function(){return c=c||_.template(jQuery("#tmpl-"+a).html(),d),b=b||{},c(b)}})},humanSize:function(a){var b,c=["B","kB","MB"];return 0===a?"0 kB":(b=parseInt(Math.floor(Math.log(a)/Math.log(1024)),10),(a/Math.pow(1024,b)).toFixed(2)+" "+c[b])}}),function(a,b,c,d){a(".imagify-modal").attr("aria-hidden","true"),a(b).on("click.imagify",".imagify-modal-trigger",function(b){b.preventDefault(),c.imagify.openModal(a(this))}).on("click.imagify",".imagify-modal .close-btn",function(){a(this).closest(".imagify-modal").fadeOut(400).attr("aria-hidden","true").removeClass("modal-is-open").trigger("modalClosed.imagify"),a("body").removeClass("imagify-modal-is-open")}).on("blur.imagify",".imagify-modal .close-btn",function(){var b=a(this).closest(".imagify-modal");"false"===b.attr("aria-hidden")&&b.attr("tabindex","0").focus().removeAttr("tabindex")}).on("click.imagify",".imagify-modal",function(b){a(b.target).filter(".modal-is-open").find(".close-btn").trigger("click.imagify")}).on("keydown.imagify",function(b){27===b.keyCode&&a(".imagify-modal.modal-is-open").length>0&&(b.preventDefault(),a(".imagify-modal.modal-is-open").find(".close-btn").trigger("click.imagify"))})}(jQuery,document,window);
window.imagify = window.imagify || {};

jQuery.extend( window.imagify, {
concat: ajaxurl.indexOf( '?' ) > 0 ? '&' : '?',
log: function( content ) {
if ( undefined !== console ) {
console.log( content ); // eslint-disable-line no-console
}
},
info: function( content ) {
if ( undefined !== console ) {
console.info( content ); // eslint-disable-line no-console
}
},
openModal: function( $link ) {
var target = $link.data( 'target' ) || $link.attr( 'href' );

jQuery( target ).css( 'display', 'flex' ).hide().fadeIn( 400 ).attr( {
'aria-hidden': 'false',
'tabindex': '0'
} ).focus().removeAttr( 'tabindex' ).addClass( 'modal-is-open' );

jQuery( 'body' ).addClass( 'imagify-modal-is-open' );
},
template: function( id ) {
if ( undefined === _ ) {
// No need to load underscore everywhere if we don't use it.
return '';
}

return _.memoize( function( data ) {
var compiled,
options = {
evaluate: /<#([\s\S]+?)#>/g,
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
escape: /\{\{([^}]+?)\}\}(?!\})/g,
variable: 'data'
};

return function() {
compiled = compiled || _.template( jQuery( '#tmpl-' + id ).html(), null, options );
data = data || {};
return compiled( data );
};
} );
},
humanSize: function( bytes ) {
var sizes = ['B', 'kB', 'MB'],
i;

if ( 0 === bytes ) {
return '0\xA0kB';
}

i = parseInt( Math.floor( Math.log( bytes ) / Math.log( 1024 ) ), 10 );

return ( bytes / Math.pow( 1024, i ) ).toFixed( 2 ) + '\xA0' + sizes[ i ];
}
} );


// Imagify light modal =============================================================================
(function($, d, w, undefined) { // eslint-disable-line no-unused-vars, no-shadow, no-shadow-restricted-names

// Accessibility.
$( '.imagify-modal' ).attr( 'aria-hidden', 'true' );

$( d )
// On click on modal trigger, open modal.
.on( 'click.imagify', '.imagify-modal-trigger', function( e ) {
e.preventDefault();
w.imagify.openModal( $( this ) );
} )
// On click on close button, close modal.
.on( 'click.imagify', '.imagify-modal .close-btn', function() {
var $modal = $( this ).closest( '.imagify-modal' );

$modal.fadeOut( 400 ).attr( 'aria-hidden', 'true' ).removeClass( 'modal-is-open' ).trigger( 'modalClosed.imagify' );

$( 'body' ).removeClass( 'imagify-modal-is-open' );
} )
// On close button blur, improve accessibility.
.on( 'blur.imagify', '.imagify-modal .close-btn', function() {
var $modal = $( this ).closest( '.imagify-modal' );

if ( $modal.attr( 'aria-hidden' ) === 'false' ) {
$modal.attr( 'tabindex', '0' ).focus().removeAttr( 'tabindex' );
}
} )
// On click on dropped layer of modal, close modal.
.on( 'click.imagify', '.imagify-modal', function( e ) {
$( e.target ).filter( '.modal-is-open' ).find( '.close-btn' ).trigger( 'click.imagify' );
} )
// `Esc` key binding, close modal.
.on( 'keydown.imagify', function( e ) {
if ( 27 === e.keyCode && $( '.imagify-modal.modal-is-open' ).length > 0 ) {
e.preventDefault();
// Trigger the event.
$( '.imagify-modal.modal-is-open' ).find( '.close-btn' ).trigger( 'click.imagify' );
}
} );

} )(jQuery, document, window);
3 changes: 2 additions & 1 deletion assets/js/bulk.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,9 @@
* User account.
*/
data.unconsumed_quota = data.unconsumed_quota.toFixed( 1 ); // A mystery where a float rounded on php side is not rounded here anymore. JavaScript is fun, it always surprises you in a manner you didn't expect.
$( '.imagify-meteo-icon' ).html( data.quota_icon );
$( '.imagify-unconsumed-percent' ).html( data.unconsumed_quota + '%' );
$( '.imagify-unconsumed-bar' ).css( 'width', data.unconsumed_quota + '%' );
$( '.imagify-unconsumed-bar' ).css( 'width', data.unconsumed_quota + '%' ).parent().attr( 'class', data.quota_class );

/**
* Global chart.
Expand Down
1,385 changes: 1,384 additions & 1 deletion assets/js/bulk.min.js

Large diffs are not rendered by default.

85 changes: 39 additions & 46 deletions assets/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,47 +259,44 @@
selected.push( this.value );
} );

$.post( {
url: imagifyOptions.getFilesTree,
dataType: 'json',
data: {
folder: '/',
selected: selected
}
} ).done( function( response ) {
if ( ! response.success ) {
swal( {
title: imagifyOptions.labels.error,
html: response.data || '',
type: 'error',
padding: 0,
customClass: 'imagify-sweet-alert'
} );
return;
}

swal( {
title: imagifyOptions.labels.filesTreeTitle,
html: '<div class="imagify-swal-subtitle">' + imagifyOptions.labels.filesTreeSubTitle + '</div><div class="imagify-swal-content"><p class="imagify-folders-information"><i class="dashicons dashicons-info" aria-hidden="true"></i>' + imagifyOptions.labels.cleaningInfo + '</p><ul id="imagify-folders-tree" class="imagify-folders-tree">' + response.data + '</ul></div>',
type: '',
customClass: 'imagify-sweet-alert imagify-swal-has-subtitle imagify-folders-selection',
showCancelButton: true,
padding: 0,
confirmButtonText: imagifyOptions.labels.confirmFilesTreeBtn,
cancelButtonText: imagifySwal.labels.cancelButtonText,
reverseButtons: true
} ).then( function() {
var values = $( '#imagify-folders-tree input' ).serializeArray(); // Don't do `$( '#imagify-folders-tree' ).find( 'input' )`, it won't work.

if ( ! values.length ) {
$.post( imagifyOptions.getFilesTree, {
folder: '/',
selected: selected
}, null, 'json' )
.done( function( response ) {
if ( ! response.success ) {
swal( {
title: imagifyOptions.labels.error,
html: response.data || '',
type: 'error',
padding: 0,
customClass: 'imagify-sweet-alert'
} );
return;
}

$.each( values, function( i, v ) {
imagifyInsertFolderRow( v.value );
} );
} ).catch( swal.noop );
} )
swal( {
title: imagifyOptions.labels.filesTreeTitle,
html: '<div class="imagify-swal-subtitle">' + imagifyOptions.labels.filesTreeSubTitle + '</div><div class="imagify-swal-content"><p class="imagify-folders-information"><i class="dashicons dashicons-info" aria-hidden="true"></i>' + imagifyOptions.labels.cleaningInfo + '</p><ul id="imagify-folders-tree" class="imagify-folders-tree">' + response.data + '</ul></div>',
type: '',
customClass: 'imagify-sweet-alert imagify-swal-has-subtitle imagify-folders-selection',
showCancelButton: true,
padding: 0,
confirmButtonText: imagifyOptions.labels.confirmFilesTreeBtn,
cancelButtonText: imagifySwal.labels.cancelButtonText,
reverseButtons: true
} ).then( function() {
var values = $( '#imagify-folders-tree input' ).serializeArray(); // Don't do `$( '#imagify-folders-tree' ).find( 'input' )`, it won't work.

if ( ! values.length ) {
return;
}

$.each( values, function( i, v ) {
imagifyInsertFolderRow( v.value );
} );
} ).catch( swal.noop );
} )
.fail( function() {
swal( {
title: imagifyOptions.labels.error,
Expand Down Expand Up @@ -341,14 +338,10 @@
selected.push( this.value );
} );

$.post( {
url: imagifyOptions.getFilesTree,
dataType: 'json',
data: {
folder: $button.data( 'folder' ),
selected: selected
}
} )
$.post( imagifyOptions.getFilesTree, {
folder: $button.data( 'folder' ),
selected: selected
}, null, 'json' )
.done( function( response ) {
if ( ! response.success ) {
swal( {
Expand Down
Loading

0 comments on commit c5c004f

Please sign in to comment.