Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bye bye Qtip2 and hello Hint.css Tooltips #1596

Merged
merged 70 commits into from
Jun 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
daaa008
Merge pull request #1 from WordImpress/release/1.9
mathetos Jan 5, 2017
c0afd08
Removing all qtip JS and CSS files from being enqueued at all.
mathetos Jan 5, 2017
f6ed893
Remove qtip from the gulp.js file
mathetos Jan 5, 2017
c3ea71c
Remove qtip.scss from assets/plugins
mathetos Jan 5, 2017
69989a2
Add hint.css to gulp and bower files.
mathetos Jan 5, 2017
43014d0
Remove qtip JS files completely.
mathetos Jan 5, 2017
64e3d3f
General implementation of hint.css throughout assets.
mathetos Jan 5, 2017
1b1453c
Completely remove qtip.css from assets
mathetos Jan 5, 2017
3e3752c
Remove qtips from admin-scripts.js
mathetos Jan 5, 2017
24cb2d6
hint.css customizations
mathetos Jan 5, 2017
2393f31
Markup changes implemented for the Admin System Info Page
mathetos Jan 5, 2017
7080659
Added markup for tooltip on the donation details screen.
mathetos Jan 5, 2017
7e2bda7
Added markup for gateway error list table tooltips.
mathetos Jan 5, 2017
287bbbc
Added tooltip markup for the "Refresh Reports" button on the reports …
mathetos Jan 5, 2017
5236556
Added tooltip markup for all tooltips on the Donations screen.
mathetos Jan 5, 2017
6b5b9cf
Added tooltip markup to the Donations Logs screen.
mathetos Jan 5, 2017
8b96b75
Added markup for all frontend tooltips.
mathetos Jan 5, 2017
d7cd530
Fix unit test searching for qtip.scss
mathetos Jan 9, 2017
a3feaed
Resolve conflicts with current 1.9.
mathetos Feb 17, 2017
18a8349
Merge branch 'release/1.9' of https://github.com/mathetos/Give into m…
Mar 29, 2017
c4afd09
Removed leftover qtip tooltip code
Mar 30, 2017
df9112f
Ran gulp
Mar 30, 2017
730aa83
Merge branch 'release/1.8.6' into mathetos-release/1.9
Mar 30, 2017
84f8219
Merge branch 'master' into mathetos-release/1.9
Apr 10, 2017
7d1bc62
Merge branch 'release/1.8.7' into mathetos-release/1.9
DevinWalker Apr 27, 2017
ea0eea1
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker Apr 28, 2017
1c13df6
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker Apr 28, 2017
3ac0ef2
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker May 4, 2017
8d85de1
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker May 16, 2017
35898b5
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker May 18, 2017
05b5e25
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker May 18, 2017
02c5b0f
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker May 22, 2017
66f5674
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker May 25, 2017
a75dcb6
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker May 25, 2017
22cc469
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker May 25, 2017
fbb0243
Merge branch 'release/2.0' into mathetos-release/1.9
ravinderk Jun 10, 2017
ae2941f
Update: add Give_Tooltips class
ravinderk Jun 10, 2017
de41598
Update: Add update to Give_Tooltips
ravinderk Jun 11, 2017
27eef5e
Refactor: render test payment tag with tooltip
ravinderk Jun 11, 2017
e678a85
fix: remove error_log code
ravinderk Jun 11, 2017
b203dfc
Refactor: render donation id with new tooltip
ravinderk Jun 11, 2017
4e0f469
Refactor: render donation detail with new tooltip
ravinderk Jun 11, 2017
c4ff24c
add: give_tooltip as default class
ravinderk Jun 12, 2017
1342d95
Update: remove echo param fronr render_* fs
ravinderk Jun 12, 2017
ee250cc
Add: render_help fx
ravinderk Jun 12, 2017
d754821
Update: auto set width on tooltip
ravinderk Jun 12, 2017
44e126d
Refactor: render help tooltip with Give_Tooltips
ravinderk Jun 12, 2017
8fb1a0c
Update: test_includes test
ravinderk Jun 12, 2017
6c4e0d2
Refactor: render help tooltip with Give_Tooltips pass2
ravinderk Jun 12, 2017
0300c5b
Refactor: remove give_tooltip default class
ravinderk Jun 12, 2017
7b972dc
Refactor: render help tooltip with Give_Tooltips pass3
ravinderk Jun 12, 2017
8961087
add: rel tootltip attribute
ravinderk Jun 12, 2017
caec1f2
Merge branch 'release/2.0' into mathetos-release/1.9
ravinderk Jun 12, 2017
2f898e8
Add: fake hint js
ravinderk Jun 12, 2017
61818d5
Fix: sanitize amoutn before showing on frontend
ravinderk Jun 12, 2017
5c70c01
Add: fake hint js pass2
ravinderk Jun 12, 2017
9cf0823
Refactor: remove fake from custom hint.css js
ravinderk Jun 13, 2017
1d37520
Fix: add backward compatibility for qtip
ravinderk Jun 13, 2017
daa31f8
Refactor: remove fake from custom hint.css js pass2
ravinderk Jun 13, 2017
42c342b
Fix: Modify edit email link tooltip to hintcss
ravinderk Jun 13, 2017
b511cc8
Fix: allow string param when render span tooltip
ravinderk Jun 13, 2017
8e78cfb
Fix: add missing email api refactor js
ravinderk Jun 13, 2017
976b8d5
Add: give_get_attribute_str helper function
ravinderk Jun 13, 2017
35ed4bf
Fix: email listing page tooltip issues
ravinderk Jun 13, 2017
df174b9
Refactor: use core function to get attribute string
ravinderk Jun 13, 2017
686c0ea
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker Jun 22, 2017
d5d9e05
Merge branch 'release/1.8.9' into mathetos-release/1.9
DevinWalker Jun 22, 2017
9b09d8f
Merge branch 'release/2.0' into mathetos-release/1.9
DevinWalker Jun 22, 2017
f38ed16
Merged changes from 1.8.9 core loading
DevinWalker Jun 22, 2017
b8a70b6
Merged from 1.8.9
DevinWalker Jun 22, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
842 changes: 360 additions & 482 deletions assets/css/give-admin-rtl.css

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion assets/css/give-admin-rtl.min.css

Large diffs are not rendered by default.

842 changes: 360 additions & 482 deletions assets/css/give-admin.css

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion assets/css/give-admin.min.css

Large diffs are not rendered by default.

617 changes: 0 additions & 617 deletions assets/css/jquery.qtip.css

This file was deleted.

1 change: 0 additions & 1 deletion assets/css/jquery.qtip.min.css

This file was deleted.

112 changes: 51 additions & 61 deletions assets/js/admin/admin-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1657,25 +1657,6 @@ jQuery.noConflict();
});
};

/**
* Initialize qTips
*/
var initialize_qtips = function () {
jQuery('[data-tooltip!=""]').qtip({ // Grab all elements with a non-blank data-tooltip attr.
content: {
attr: 'data-tooltip' // Tell qTip2 to look inside this attr for its content
},
style : {classes: 'qtip-rounded qtip-tipsy'},
events : {
show: function (event, api) {
var $el = $(api.elements.target[0]);
$el.qtip('option', 'position.my', ($el.data('tooltip-my-position') == undefined) ? 'bottom center' : $el.data('tooltip-my-position'));
$el.qtip('option', 'position.at', ($el.data('tooltip-target-position') == undefined) ? 'top center' : $el.data('tooltip-target-position'));
}
}
})
};

/**
* Payment history listing page js
*/
Expand Down Expand Up @@ -1754,34 +1735,58 @@ jQuery.noConflict();
Edit_Form_Screen.init();
Give_Payment_History.init();

initialize_qtips();

//Footer
$('a.give-rating-link').click(function () {
jQuery(this).parent().text(jQuery(this).data('rated'));
});

/**
* Amount format validation form price field setting
*/
// Ajax user search
$('.give-ajax-user-search').on('keyup', function () {
var user_search = $(this).val();
var exclude = '';

// This function uses for adding qtip to money/price field.
function give_add_qtip($fields) {
// Add qtip to all existing money input fields.
$fields.each(function () {
$(this).qtip({
style : 'qtip-dark qtip-tipsy',
content : {
text: give_vars.price_format_guide.trim()
},
show : '',
position: {
my: 'bottom center',
at: 'top center'
}
});
if ($(this).data('exclude')) {
exclude = $(this).data('exclude');
}

$('.give-ajax').show();
data = {
action : 'give_search_users',
user_name: user_search,
exclude : exclude
};

document.body.style.cursor = 'wait';

$.ajax({
type : "POST",
data : data,
dataType: "json",
url : ajaxurl,
success : function (search_response) {
$('.give-ajax').hide();
$('.give_user_search_results').removeClass('hidden');
$('.give_user_search_results span').html('');
$(search_response.results).appendTo('.give_user_search_results span');
document.body.style.cursor = 'default';
}
});
}
});

$('body').on('click.giveSelectUser', '.give_user_search_results span a', function (e) {
e.preventDefault();
var login = $(this).data('login');
$('.give-ajax-user-search').val(login);
$('.give_user_search_results').addClass('hidden');
$('.give_user_search_results span').html('');
});

$('body').on('click.giveCancelUserSearch', '.give_user_search_results a.give-ajax-user-cancel', function (e) {
e.preventDefault();
$('.give-ajax-user-search').val('');
$('.give_user_search_results').addClass('hidden');
$('.give_user_search_results span').html('');
});

var $give_money_fields = $('input.give-money-field, input.give-price-field');
var thousand_separator = give_vars.thousands_separator,
Expand All @@ -1794,26 +1799,12 @@ jQuery.noConflict();
// If thousand separator is equal to decimal separator then price does not have more then 1 thousand separator otherwise limit is zero.
thousand_separator_limit = ( decimal_separator === thousand_separator ? 1 : 0 );

// Add qtip to all existing money input fields.
give_add_qtip($give_money_fields);

// Add qtip to new created money/price input field.
$('#_give_donation_levels_repeat').on('click', 'button.cmb-add-group-row', function () {
window.setTimeout(
function () {

// Update input filed selector.
$give_money_fields = $('input.give-money-field, input.give-price-field');

// Add qtip to all existing money input fields.
give_add_qtip($give_money_fields);
},
100
)
});

// Check & show message on keyup event.
$('#poststuff').on('keyup', 'input.give-money-field, input.give-price-field', function () {
var tootltip_setting = {
label: give_vars.price_format_guide.trim()
};
// Count thousand separator in price string.
thousand_separator_count = ( $(this).val().match(new RegExp(thousand_separator, 'g')) || [] ).length;
alphabet_count = ( $(this).val().match(new RegExp('[a-z]', 'g')) || [] ).length;
Expand All @@ -1823,12 +1814,11 @@ jQuery.noConflict();
( -1 !== $(this).val().indexOf(thousand_separator) )
&& ( thousand_separator_limit < thousand_separator_count )
) {
$(this).qtip('show');
$(this).give_hintcss('show', tootltip_setting );
} else if (alphabet_count) {
// Show qtip if user entered a number with alphabet letter.
$(this).qtip('show');
$(this).give_hintcss('show', tootltip_setting);
} else {
$(this).qtip('hide');
$(this).give_hintcss('hide', tootltip_setting);
}

// Reset thousand separator count.
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin/admin-scripts.min.js

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions assets/js/admin/admin-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,76 @@ jQuery(document).ready(function ($) {
// Update select html.
$default_gateway.html(active_payment_option_html);
});

/**
* Repeater setting field event.
*/
$( 'a.give-repeat-setting-field' ).on( 'click', function(e){
e.preventDefault();
var parent = $(this).parents('td'),
$first_setting_field_group = $( 'p:first-child', parent ),
$new_setting_field_group = $first_setting_field_group.clone(),
setting_field_count = $( 'p', parent ).not('.give-field-description').length;

// Set id and value for setting field.
$( 'input', $new_setting_field_group ).attr( 'id', $(this).data('id') + '_' + (++setting_field_count) );
$( 'input', $new_setting_field_group ).val( '' );

// Add setting field html to dom.
$(this).before( $new_setting_field_group );

return false;
});

$( '.give-settings-page' ).on( 'click', 'span.give-remove-setting-field', function(e){
$(this).parents('p').remove();
});

/**
* Enabled & disable email notification event.
*/
$( '.give-email-notification-status', 'table.giveemailnotifications' ).on( 'click', function(){
var $this = $(this),
$icon_container = $('i', $this),
$loader = $(this).next(),
set_notification_status = $(this).hasClass( 'give-email-notification-enabled' ) ? 'disabled' : 'enabled',
notification_id = $(this).data('id');

// Bailout if admin can not edit notification status setting.
if( ! parseInt( $this.data('edit') ) ) {
return false;
}

$.ajax({
url: ajaxurl,
method: 'POST',
data: {
action: 'give_set_notification_status',
status: set_notification_status,
notification_id: notification_id
},
beforeSend: function(){
$this.hide();
$loader.addClass('is-active');
},
success: function(res) {
if( res.success ) {
$this.removeClass( 'give-email-notification-' + $this.data('status') );
$this.addClass( 'give-email-notification-' + set_notification_status );
$this.data( 'status', set_notification_status );

if( 'enabled' === set_notification_status ) {
$icon_container.removeClass('dashicons-no-alt');
$icon_container.addClass('dashicons-yes');
} else{
$icon_container.removeClass('dashicons-yes');
$icon_container.addClass('dashicons-no-alt');
}

$loader.removeClass('is-active');
$this.show();
}
}
});
});
});
2 changes: 1 addition & 1 deletion assets/js/admin/admin-settings.min.js

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

17 changes: 0 additions & 17 deletions assets/js/admin/admin-widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,6 @@
jQuery.noConflict();
(function ( $ ) {

var initialize_qtips = function () {
jQuery( '[data-tooltip!=""]' ).qtip( { // Grab all elements with a non-blank data-tooltip attr.
content : {
attr: 'data-tooltip' // Tell qTip2 to look inside this attr for its content
},
style : {classes: 'qtip-rounded qtip-tipsy'},
position: {
my: 'bottom center', // Position my top left...
at: 'top center' // at the bottom right of...
}
} )
};

/**
* Show/Hide continue button tile setting on basis of display setting for Give Form widget.
*/
Expand All @@ -43,16 +30,12 @@ jQuery.noConflict();

//On DOM Ready
$( function () {
initialize_qtips();

continue_button_setting_js();
$( '.give_forms_display_style_setting_row input', '.widget-liquid-right' ).trigger('change');
} );

//Function to Refresh jQuery toggles for Yelp Widget Pro upon saving specific widget
$( document ).ajaxSuccess( function ( e, xhr, settings ) {
initialize_qtips();

continue_button_setting_js();
$( '.give_forms_display_style_setting_row input', '.widget-liquid-right' ).trigger('change');
} );
Expand Down
Loading