Skip to content

Commit

Permalink
Merge pull request #3324 from WordImpress/release/2.1.4
Browse files Browse the repository at this point in the history
Release 2.1.4 merge to master
  • Loading branch information
Devin Walker authored Jun 5, 2018
2 parents bf1f6f3 + a5f8b96 commit eece2d7
Show file tree
Hide file tree
Showing 39 changed files with 1,159 additions and 596 deletions.
97 changes: 63 additions & 34 deletions assets/src/css/admin/export.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,40 +30,6 @@
}
}

ul.give-export-option {
border: 1px solid #e5e5e5;
display: flex;
margin: 0;

li.give-export-option-fields {
width: 33%;

ul {
li{
padding-left: 25px;
}

li.give-export-option-label {
border-bottom: 1px solid #e5e5e5;
padding: 15px 0 15px 0;
span {
margin: 15px 15px 15px 25px;
font-size: 15px;
font-weight: 500;
}
}

li.give-export-option-start {
margin-top: 20px;
}

li:last-child {
margin-bottom: 20px;
}
}
}
}

p.give-field-description {
display: table;
width: 100%;
Expand All @@ -88,6 +54,49 @@
}
}
}

.give-export-option {
display: flex;
flex-flow: row wrap;
border-top: 1px solid #e5e5e5;
border-left: 1px solid #e5e5e5;

ul {
margin-bottom: 1rem;

li {
position: relative;
margin-bottom: .70rem;
padding: 0 1rem;

label {
display: block;
padding-left: 22px;

input {
position: absolute;
top: 6px;
left: 15px;
}
}
}

.give-export-option-label {
font-size: 15px;
font-weight: 500;
border-bottom: 1px solid #e5e5e5;
margin-bottom: 1rem;
padding: 1rem;
}
}

& > li {
border-right: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
width: 33%;
margin-bottom: 0;
}
}
}

.give-export-donors {
Expand Down Expand Up @@ -132,3 +141,23 @@
border: 1px solid #ddd;
}
}

@media only screen and ( max-width: 1080px ) {
.give-tools-setting-page #give-export_donations-form .give-export-option > li {
width: 49.5%;
}
}

@media only screen and ( max-width: 782px ) {
.give-tools-setting-page #give-export_donations-form .give-export-option > li {
width: 49.5%;
}

.give-tools-setting-page #give-export_donations-form .give-export-option ul li label {
padding-left: 32px;
}

.give-tools-setting-page #give-export_donations-form .give-export-option ul li label input {
top: 0;
}
}
32 changes: 32 additions & 0 deletions assets/src/css/admin/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,34 @@
overflow: visible;
}

.give-subsubsub {
list-style: none;
margin: 8px 0 0;
padding: 0;
font-size: 13px;
float: left;
color: #666;

li{
display: inline-block;
margin: 0;
padding: 0;
white-space: nowrap;
}

a{
line-height: 2;
padding: .2em;
text-decoration: none;
}

a.current {
color: #000;
font-weight: 600;
border: none;
}
}

.cmb2-wrap .cmb-type-checkbox input[type="checkbox"] {
display: block;
margin-bottom: 5px;
Expand Down Expand Up @@ -153,6 +181,10 @@ div.give-field-description,
display: none;
}

.tablenav {
height: auto;
}

// CMB2 Checkbox Revised Styles
.cmb-type-checkbox .cmb-td {
width: 80%;
Expand Down
5 changes: 4 additions & 1 deletion assets/src/css/frontend/modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
height: 85vh;
overflow-y: auto;

#give-payment-mode-select,
#give_purchase_form_wrap {
display: block !important;
}
Expand All @@ -136,6 +135,10 @@
.give-btn-modal {
display: none !important;
}

.give-form-title {
display: none;
}
}

.modal-fade-slide .give-modal--slide {
Expand Down
2 changes: 1 addition & 1 deletion assets/src/css/plugins/_settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $mfp-shadow: 0 0 8px rgba(0, 0, 0, 0.6) !default; // Sh
$mfp-popup-padding-left: 8px !default; // Padding from left and from right side
$mfp-popup-padding-left-mobile: 6px !default; // Same as above, but is applied when width of window is less than 800px

$mfp-z-index-base: 1040 !default; // Base z-index of popup
$mfp-z-index-base: 999999 !default; // Base z-index of popup

// controls
$mfp-include-arrows: true !default; // Include styles for nav arrows
Expand Down
84 changes: 67 additions & 17 deletions assets/src/js/admin/admin-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,36 +58,45 @@ var give_setting_edit = false;
* @since 1.8.14
*/
var give_dismiss_notice = function () {
$('body').on('click', 'button.notice-dismiss', function () {
if ('give-invalid-license' !== jQuery(this).closest('div.give-notice').data('notice-id')) {
give_remove_give_message();
$( 'body' ).on( 'click', 'button.notice-dismiss', function () {
if ( 'give-invalid-license' !== jQuery( this ).closest( 'div.give-notice' ).data( 'notice-id' ) ) {
give_remove_give_message( jQuery( this ).closest( 'div.give-notice' ).attr( 'id' ) );
}
});
} );
};

/**
* Remove give-message parameter from URL.
*
* @since 1.8.14
* @since 2.1.4 Added new param key which remove the multiple message array from URL.
*
* @param key string to remove from url in multiple notices.
*/
var give_remove_give_message = function () {
var give_remove_give_message = function ( key ) {
var parameter = 'give-message',
url = document.location.href,
urlparts = url.split('?');
urlparts = url.split( '?' ),
key = (
undefined === key
) ? '' : key.replace( 'give-', '' );

if (urlparts.length >= 2) {
if ( urlparts.length >= 2 ) {
var urlBase = urlparts.shift();
var queryString = urlparts.join('?');
var queryString = urlparts.join( '?' );
var prefix = encodeURIComponent( parameter ) + '=';

var pars = queryString.split( /[&;]/g );
for ( var i = pars.length; i -- > 0; ) {

var prefix = encodeURIComponent(parameter) + '=';
var pars = queryString.split(/[&;]/g);
for (var i = pars.length; i-- > 0;) {
if (pars[i].lastIndexOf(prefix, 0) !== -1) {
pars.splice(i, 1);
if ( pars[i].lastIndexOf( prefix, 0 ) !== - 1 || (
'' !== key && pars[i].lastIndexOf( 'give-messages', 0 ) !== - 1 && pars[i].match( key + '$' )
) ) {
pars.splice( i, 1 );
}
}
url = urlBase + '?' + pars.join('&');
window.history.pushState('', document.title, url); // added this line to push the new url directly to url bar .
url = urlBase + '?' + pars.join( '&' );
window.history.pushState( '', document.title, url ); // added this line to push the new url directly to url bar .
}
return url;
};
Expand Down Expand Up @@ -656,6 +665,12 @@ var give_setting_edit = false;
checked_cbs
.prev( '.gateways-radio' )
.attr( 'checked', 'checked' );

if ( this.checked ) {
radio.removeAttr( 'disabled' );
} else {
radio.attr( 'disabled', 'disabled' );
}
} else {
if ( this.checked ) {
radio.removeAttr( 'disabled' );
Expand Down Expand Up @@ -1566,7 +1581,7 @@ var give_setting_edit = false;
).render();
});
}
}
};

/**
* Admin Status Select Field Change
Expand Down Expand Up @@ -2436,9 +2451,35 @@ var give_setting_edit = false;
sortable_options: {
placeholder: 'give-ui-placeholder-state-highlight',
start: function (event, ui) {
// Do not allow any row at position 0.
if (ui.item.next().hasClass('give-template')) {
ui.item.next().after(ui.item);
}

let $rows = $('.give-row', $this).not('.give-template');

if ($rows.length) {
$rows.each(function (index, item) {
// Set name for fields.
let $fields = $('input[type="radio"].give-field', $(item));

// Preserve radio button values.
if ($fields.length) {
$fields.each(function () {
$(this).attr('data-give-checked', $(this).is(':checked') );
});
}
});
}

$('body').trigger('repeater_field_sorting_start', [ui.item]);
},
stop: function (event, ui) {
// Do not allow any row at position 0.
if (ui.item.next().hasClass('give-template')) {
ui.item.next().after(ui.item);
}

$('body').trigger('repeater_field_sorting_stop', [ui.item]);
},
update: function (event, ui) {
Expand All @@ -2447,7 +2488,8 @@ var give_setting_edit = false;
ui.item.next().after(ui.item);
}

var $rows = $('.give-row', $this).not('.give-template');
var $rows = $('.give-row', $this).not('.give-template'),
$container = $(this).closest('.give-repeatable-fields-section-wrapper');

if ($rows.length) {
var row_count = 1;
Expand Down Expand Up @@ -2492,6 +2534,14 @@ var give_setting_edit = false;
row_count++;
});

window.setTimeout( function () {
// Reset radio button values.
$( 'input[data-give-checked]', $container ).each( function ( index, radio ) {
radio = $( radio );
radio.prop( 'checked', 'true' === radio.attr( 'data-give-checked' ) )
} );
}, 100 );

// Fire event.
$this.trigger('repeater_field_row_reordered', [ui.item]);
}
Expand Down
14 changes: 7 additions & 7 deletions assets/src/js/frontend/give-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ jQuery( function( $ ) {
}

// Button to close notices on front-end.
const give_notice_close = jQuery( '.give-notice-close' );
give_notice_close.on( 'click', function() {
$('body').on( 'click', '.give-notice-close', function() {
$(this).hide();
const notice_container = $(this).closest( '.give_notices' );
notice_container.slideUp();
Expand Down Expand Up @@ -200,7 +199,7 @@ window.give_open_form_modal = function ( $form_wrap, $form ) {

// Hide .give-hidden and .give-btn-modal if admin only want to show only button.
if ( $form_wrap.hasClass( 'give-display-button-only' ) ) {
children = $form.children().not( '.give-hidden, .give-btn-modal' );
children = $form.children().not( '.give-btn-modal' );
}

//Hide all form elements besides the ones required for payment
Expand All @@ -219,16 +218,17 @@ window.give_open_form_modal = function ( $form_wrap, $form ) {
} );
};


/**
* Floating Labels Custom Events
*/
window.give_fl_trigger = function() {
if ( give_float_labels instanceof FloatLabels ) {
give_float_labels.rebuild();
window.give_float_labels = 'undefined' === typeof window.give_float_labels ? {} : window.give_float_labels;

if ( window.give_float_labels instanceof FloatLabels ) {
window.give_float_labels.rebuild();
}
else {
var give_float_labels = new FloatLabels( '.float-labels-enabled', {
window.give_float_labels = new FloatLabels( '.float-labels-enabled', {
exclude: '#give-amount, .give-select-level, [multiple]',
prioritize: 'placeholder',
prefix: 'give-fl-',
Expand Down
5 changes: 3 additions & 2 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: WordImpress
* Author URI: https://wordimpress.com
* Version: 2.1.3
* Version: 2.1.4
* Text Domain: give
* Domain Path: /languages
* GitHub Plugin URI: https://github.com/WordImpress/Give
Expand Down Expand Up @@ -395,7 +395,7 @@ private function setup_constants() {

// Plugin version
if ( ! defined( 'GIVE_VERSION' ) ) {
define( 'GIVE_VERSION', '2.1.3' );
define( 'GIVE_VERSION', '2.1.4' );
}

// Plugin Root File
Expand Down Expand Up @@ -466,6 +466,7 @@ private function includes() {
require_once GIVE_PLUGIN_DIR . 'includes/class-give-tooltips.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-translation.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-readme-parser.php';

require_once GIVE_PLUGIN_DIR . 'includes/class-give-scripts.php';
require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
Expand Down
Loading

0 comments on commit eece2d7

Please sign in to comment.