Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions common/js/jquery-ui-timepicker-addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
if (o.altField) {
tp_inst.$altInput = $(o.altField).css({
cursor: 'pointer'
}).focus(function() {
}).on ( 'focus', function() {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a library and it's being used for the Date field in Editorial Metadata module - related PR #169
We can see it in action when editing a post.

I see that the author has not changed this yet. I tried finding a way to test this file but it's not clear how I can replicate these events.

https://github.com/trentrichardson/jQuery-Timepicker-Addon/blob/7160ce59c660462f4d3379951f1e141131bcb02c/src/jquery-ui-timepicker-addon.js#L287

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm yeah this is a tough one....

I think as long as the date picker works we're good. I tested it on the post editing screen and it worked for me.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The author no longer maintains this library so I've created a new GH issue on our end to replace it.

#660

$input.trigger("focus");
});
}
Expand All @@ -276,7 +276,7 @@
if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
}
tp_inst.$input.bind('focus', function() {
tp_inst.$input.on( 'focus', function() {
tp_inst._onFocus();
});

Expand Down Expand Up @@ -412,7 +412,7 @@
marginLeft: o.isRTL? '0' : ((size / (-2 * gridSize[litem])) + "%"),
marginRight: o.isRTL? ((size / (-2 * gridSize[litem])) + "%") : '0',
borderCollapse: 'collapse'
}).find("td").click(function(e){
}).find("td").on( 'click', function(e){
var $t = $(this),
h = $t.html(),
n = parseInt(h.replace(/[^0-9]/g),10),
Expand Down
12 changes: 6 additions & 6 deletions common/js/jquery.listfilterizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// We need :contains to be case insensitive so lets redefine it as containsi (i for case insensitive)
// http://stackoverflow.com/questions/187537/is-there-a-case-insensitive-jquery-contains-selector
jQuery.expr[':'].containsi = function(a, i, m){
jQuery.expr.pseudos.containsi = function(a, i, m){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Try editing a post.
  • Find the Notifications section at the bottom.
  • Search for both upper and lower cases for a specific user.

✅ if the filtered list always returns a result no matter the search input is upper or lower case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return (a.textContent || a.innerText || '').toLowerCase().indexOf(m[3].toLowerCase()) >= 0;
};

Expand Down Expand Up @@ -50,7 +50,7 @@
var $filterTab = $('<li/>')
.text(filter.label)
.attr(options._filterIdAttr, i)
.bind('click', _filterTabEvent)
.on('click', _filterTabEvent)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Try editing a post.
  • Find the Notifications section at the bottom.

✅ if we can click All and Selected and they act properly.

Markup on 2021-06-04 at 15:41:44

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;
$tabs.append($filterTab);
}
Expand All @@ -65,9 +65,9 @@
.attr('type', inputType)
.attr(options.inputAttrs)
.addClass(options.inputClass)
.bind('search', _filterInputSearch)
.bind('keydown', _filterInputKeydown)
.bind('keyup', _filterInputKeyup)
.on('search', _filterInputSearch)
.on('keydown', _filterInputKeydown)
.on('keyup', _filterInputKeyup)
Comment on lines +68 to +70
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Try editing a post.
  • Find the Notifications section at the bottom.

✅ if we type some letters in the Search field and the list below will be filtered in accordance with.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.attr('placeholder', options.inputPlaceholder)
;

Expand All @@ -76,7 +76,7 @@
$input
.addClass(options.inputPlaceholderClass)
.val(options.inputPlaceholder)
.focus(function() {
.on( 'focus', function() {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment in the L74 above:

// Fallback for browsers that don't support placeholders

I think this is a very low risk and we do not need a test case for it. Because it's difficult to find a browser not supporting placeholder nowadays: https://caniuse.com/input-placeholder

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var $this = $(this);
if($this.val() == options.inputPlaceholder) {
$this
Expand Down
14 changes: 7 additions & 7 deletions common/js/jquery.quicksearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ jQuery(function ($) {

function focus_on_load()
{
$('input[rel="' + options.randomElement + '"]').get(0).focus();
$('input[rel="' + options.randomElement + '"]').get(0).trigger( 'focus' );
Copy link
Copy Markdown
Member Author

@htdat htdat Jun 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tl;dr - We can ignore finding test cases for this file common/js/jquery.quicksearch.js as it's not clear how these events are triggered.

I can not find how this file is relevant to the current state of the plugin, therefore I can not find exactly how these events are triggered.

For example, if I comment out this whole file common/js/jquery.quicksearch.js, only post editors (either Classic or Block) are showing an error:

jquery.min.js?ver=3.5.1:2 Uncaught TypeError: jQuery(...).quicksearch is not a function (user-groups.js?ver=0.9.7-dev-1622795075:2)

Relevant line:
https://github.com/Automattic/Edit-Flow/blob/8a52203127b483576410558f940097e583d6ef3d/modules/user-groups/lib/user-groups.js#L2

Even so, ef-post_following_users element does not exist on this page as well. I searched on HTML output and used this code in the browser console:

jQuery('#ef-post_following_users').length; // return 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the ef-post_following_users element was removed in 2011 here:
69d37af#diff-b44786d9772fb20b5bac33f34764ac58b1bbaca4ba7755a28655bd81681c0057L738

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created this issue #661

}

function toggle_text() {
$('input[rel="' + options.randomElement + '"]').focus(function () {
$('input[rel="' + options.randomElement + '"]').on( 'focus', function () {
if ($(this).val() === options.inputText) {
$(this).val('');
}
Expand Down Expand Up @@ -312,17 +312,17 @@ jQuery(function ($) {
});

init();
$('input[rel="' + options.randomElement + '"]').keydown(function (e) {

$('input[rel="' + options.randomElement + '"]').on( 'keydown', function (e) {
var keycode = e.keyCode;
if (!(keycode === 9 || keycode === 13 || keycode === 16 || keycode === 17 || keycode === 18 || keycode === 38 || keycode === 40 || keycode === 224))
{
qs();
}
});
$('form.quicksearch, fieldset.quicksearch').submit( function () { return false; });

$('form.quicksearch, fieldset.quicksearch').on( 'submit', function () { return false; });

return this;
};
});
4 changes: 2 additions & 2 deletions common/js/screen-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jQuery(function($){
params
);
}
$('#screen-options-wrap div.requires-autosave').find('input, select, textarea').change(performAutosave);

$('#screen-options-wrap div.requires-autosave').find('input, select, textarea').on( 'change', performAutosave);
Copy link
Copy Markdown
Member Author

@htdat htdat Jun 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we reload http://valet-vipgo-3279.test/wp-admin/index.php?page=story-budget and this screen respects the option we've chosen for Number of Columns.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you meant http://valet-vipgo-3279.test/wp-admin/index.php?page=story-budget for the first bullet, is that right? If so, then ✅

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you meant http://valet-vipgo-3279.test/wp-admin/index.php?page=story-budget for the first bullet, is that right? If so, then ✅

Yes. Updated!

});
14 changes: 6 additions & 8 deletions modules/calendar/lib/calendar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var dispatch = wp.data.dispatch;

jQuery(document).ready(function ($) {
$('a.show-more').click(function(){

$('a.show-more').on( 'click', function(){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we see other posts are expanded for this day.

Markup on 2021-06-04 at 13:42:16

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var parent = $(this).closest('td.day-unit');
$('ul li', parent).removeClass('hidden');
$(this).hide();
Expand Down Expand Up @@ -109,7 +109,7 @@ jQuery(document).ready(function ($) {

// Close out all of the overlays with your escape key,
// or by clicking anywhere other than inside an existing overlay
$(document).keydown(function(event) {
$(document).on( 'keydown', function(event) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we press Escape key and the overlay created by + sign above will be removed.

Note: e.which == 27 here is equal to pressing "Escapce" key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (event.keyCode == '27') {
edit_flow_calendar_close_overlays();
}
Expand All @@ -118,7 +118,7 @@ jQuery(document).ready(function ($) {
/**
* Somewhat hackish way to close overlays automagically when you click outside an overlay
*/
$(document).click(function(event){
$(document).on( 'click', function(event){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we click somewhere outside this overlay, it will be removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//Did we click on a list item? How do we figure that out?
//First let's see if we directly clicked on a .day-item
var target = $(event.target);
Expand Down Expand Up @@ -259,10 +259,8 @@ jQuery(document).ready(function ($) {
// or to a double click on the calendar square
$day_units.find('.schedule-new-post-button').on('click.editFlow.quickPublish', EFQuickPublish.open_quickpost_dialogue );
$day_units.on('dblclick.editFlow.quickPublish', EFQuickPublish.open_quickpost_dialogue );
$day_units.hover(
function(){ $(this).find('.schedule-new-post-button').stop().delay(500).fadeIn(100);},
function(){ $(this).find('.schedule-new-post-button').stop().hide();}
);
$day_units.on( 'mouseenter', function(){ $(this).find('.schedule-new-post-button').stop().delay(500).fadeIn(100);});
$day_units.on( 'mouseleave', function(){ $(this).find('.schedule-new-post-button').stop().hide();});
Comment on lines +262 to +263
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if the mouse is in the area of any day, in the top-left corner of this day, there will be + sign to add a new post.
✅ if the mouse moves out of this area, this + sign will be removed (hidden).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}, // init

/**
Expand Down
14 changes: 7 additions & 7 deletions modules/custom-status/lib/custom-status-configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ inlineEditCustomStatus = {

t.what = '#term-';

$('.editinline').live('click', function(){
$( document ).on( 'click', '.editinline', function(){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we're able to see relevant fields to update this status.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inlineEditCustomStatus.edit(this);
return false;
});

// prepare the edit row
row.keyup(function(e) { if(e.which == 27) return inlineEditCustomStatus.revert(); });
row.on( 'keyup', function(e) { if(e.which == 27) return inlineEditCustomStatus.revert(); });
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we press Escape key and the Quick Edit fields are closed and their values are reset.

Note: e.which == 27 here is equal to pressing "Escapce" key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


$('a.cancel', row).click(function() { return inlineEditCustomStatus.revert(); });
$('a.save', row).click(function() { return inlineEditCustomStatus.save(this); });
$('input, select', row).keydown(function(e) { if(e.which == 13) return inlineEditCustomStatus.save(this); });
$('a.cancel', row).on( 'click', function() { return inlineEditCustomStatus.revert(); });
$('a.save', row).on( 'click', function() { return inlineEditCustomStatus.save(this); });
$('input, select', row).on( 'keydown', function(e) { if(e.which == 13) return inlineEditCustomStatus.save(this); });
Comment on lines +18 to +20
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we click Cancel button and the Quick Edit fields are closed and their values are reset.
✅ if we click Update Status button and the Quick Edit fields are saved then closed.
✅ if we press Enter key and the Quick Edit fields are saved then closed.

Note: e.which == 13 is for the Enter key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all works, but the name of the Status is not updated when I save it.
ef-custom-status

Doesn't appear to be a new problem though, so I added it as a new bug:
#657


$('#posts-filter input[type="submit"]').mousedown(function(e){
$('#posts-filter input[type="submit"]').on( 'mousedown', function(e){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems redundant as there is no element with this ID posts-filter in this page http://valet-vipgo-3279.test/wp-admin/admin.php?page=ef-custom-status-settings

Then this event is not triggered.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #664

t.revert();
});
},
Expand Down Expand Up @@ -125,7 +125,7 @@ $(document).ready(function(){inlineEditCustomStatus.init();});

jQuery(document).ready(function(){

jQuery('.delete-status a').click(function(){
jQuery('.delete-status a').on( 'click', function(){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we see a dialog to warn about this deletion.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if ( !confirm( ef_confirm_delete_status_string ) )
return false;
});
Expand Down
14 changes: 7 additions & 7 deletions modules/custom-status/lib/custom-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ jQuery(document).ready(function() {
jQuery('#post-status-select').hide();
jQuery('.edit-post-status').show();
}
jQuery('.edit-post-status').click(function() {

jQuery('.edit-post-status').on( 'click', function() {
jQuery('#post-status-select').slideDown();
jQuery('.edit-post-status').hide();
return false;
});
jQuery('.cancel-post-status, .save-post-status').click(function() {
jQuery('.cancel-post-status, .save-post-status').on( 'click', function() {
jQuery('#post-status-select').slideUp();
jQuery('.edit-post-status').show();
return false;
});
jQuery('.save-post-status').click(function() {
jQuery('.save-post-status').on( 'click', function() {
Comment on lines +28 to +39
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To see these jQuery events in action, you need to create a post as a contributor with Classic Editor.

  • Log in as a contributor.
  • Add a new post.
  • Try to change this post to different statuses rather than Draft.

✅ if we can click Edit and Cancel links and OK button.
✅ if these links/buttons act as expected. See this screenshot:

Screen Capture on 2021-06-04 at 11-14-06

If we do not use Edit Flow, this is how it looks like for contributors:

Markup on 2021-06-04 at 11:11:24

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jQuery('#post-status-display').text(jQuery('select[name="post_status"] :selected').text());
return false;
});
Expand All @@ -52,7 +52,7 @@ jQuery(document).ready(function() {
ef_update_save_button(i18n.save);

// Bind event when OK button is clicked
jQuery('.save-post-status').bind('click', function() {
jQuery('.save-post-status').on( 'click', function() {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Create a post in Classic Editor.
  • Try to change status to something like Assigned, In Progress, and click OK.

✅ if we see Save button text changing to Save as Assigned, Save as In Progress respectively.

Screen Capture on 2021-06-04 at 11-30-45

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ef_update_save_button();
});

Expand Down Expand Up @@ -82,12 +82,12 @@ jQuery(document).ready(function() {
} else if ( jQuery('select[name="_status"]').length > 0 ) {
ef_append_to_dropdown('select[name="_status"]');
// Refresh the custom status dropdowns everytime Quick Edit is loaded
jQuery('#the-list a.editinline').bind( 'click', function() {
jQuery('#the-list a.editinline').on( 'click', function() {
Copy link
Copy Markdown
Member Author

@htdat htdat Jun 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tl;dr: We can ignore the test case for this because (1) jQuery selector is no longer found, and (2) there is no issue with custom statuses and Quick Edit right now.

As mentioned here, this click event is triggered if Quick Edit links are clicked in http://valet-vipgo-3279.test/wp-admin/edit.php

However, Quick Edit is currently a button element. Its HTML looks like this:

<button type="button" class="button-link editinline" aria-label="Quick edit “Add a new post – set this for future” inline" aria-expanded="false">Quick&nbsp;Edit</button>

Also, in the browser console, I can double check that with these functions:

  • jQuery('#the-list a.editinline').length returns 0
  • jQuery('#the-list button.editinline').length returns 20

That said, I am not seeing any issue with Quick Edit and custom statuses here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #662

ef_append_to_dropdown('#the-list select[name="_status"]');
} );
// Clean up the bulk edit selector because it's non-standard
jQuery( '#bulk-edit' ).find( 'select[name="_status"]' ).prepend( '<option value="">' + i18n.no_change + '</option>' );
jQuery( '#bulk-edit' ).find( 'select[name="_status"] option' ).removeAttr('selected');
jQuery( '#bulk-edit' ).find( 'select[name="_status"] option' ).prop( 'selected', false );
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we see Status field is showing No Change.

Markup on 2021-06-04 at 12:27:14

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jQuery( '#bulk-edit' ).find( 'select[name="_status"] option[value="future"]').remove();
} else {

Expand Down
4 changes: 2 additions & 2 deletions modules/editorial-comments/lib/editorial-comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ editorialCommentReply = {
var row = jQuery('#ef-replyrow');

// Bind click events to cancel and submit buttons
jQuery('a.ef-replycancel', row).click(function() { return editorialCommentReply.revert(); });
jQuery('a.ef-replysave', row).click(function() { return editorialCommentReply.send(); });
jQuery('a.ef-replycancel', row).on( 'click', function() { return editorialCommentReply.revert(); });
jQuery('a.ef-replysave', row).on( 'click', function() { return editorialCommentReply.send(); });
Comment on lines +22 to +23
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Go to the editor (either Classic or Block Editor is fine) of a post
  • Click Respond to this Post button.

✅ if we can click Cancel and Submit buttons and they act correctly.

Markup on 2021-06-03 at 16:47:30

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


// Watch for changes to the subscribed users.
jQuery( '#ef-post_following_box' ).on( 'following_list_updated', function() {
Expand Down
16 changes: 8 additions & 8 deletions modules/editorial-metadata/lib/editorial-metadata-configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ inlineEditMetadataTerm = {

t.what = '#term-';

$('.editinline').live('click', function(){
$( document ).on( 'click', '.editinline', function(){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we're able to see relevant fields to update this meta.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inlineEditMetadataTerm.edit(this);
return false;
});

// prepare the edit row
row.keyup(function(e) { if(e.which == 27) return inlineEditMetadataTerm.revert(); });
row.on( 'keyup', function(e) { if(e.which == 27) return inlineEditMetadataTerm.revert(); });
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we press Escape key and the Quick Edit fields are closed and their values are reset.

Note: e.which == 27 here is equal to pressing "Escapce" key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


$('a.cancel', row).click(function() { return inlineEditMetadataTerm.revert(); });
$('a.save', row).click(function() { return inlineEditMetadataTerm.save(this); });
$('input, select', row).keydown(function(e) { if(e.which == 13) return inlineEditMetadataTerm.save(this); });
$('a.cancel', row).on( 'click', function() { return inlineEditMetadataTerm.revert(); });
$('a.save', row).on( 'click', function() { return inlineEditMetadataTerm.save(this); });
$('input, select', row).on( 'keydown', function(e) { if(e.which == 13) return inlineEditMetadataTerm.save(this); });
Comment on lines +18 to +20
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we click Cancel button and the Quick Edit fields are closed and their values are reset.
✅ if we click Update Metadata Term button and the Quick Edit fields are saved then closed.
✅ if we press Enter key and the Quick Edit fields are saved then closed.

Note: e.which == 13 is for the Enter key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


$('#posts-filter input[type="submit"]').mousedown(function(e){
$('#posts-filter input[type="submit"]').on( 'mousedown', function(e){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On this page http://valet-vipgo-3279.test/wp-admin/admin.php?page=ef-editorial-metadata-settings, there is no exact $('#posts-filter input[type="submit"]') element though there is an element with #posts-filter.

This seems redundant and I can not find how this event is triggered.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree - probably leftover code. Maybe we should add a new Issue to address all this leftover code?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #664

t.revert();
});
},
Expand Down Expand Up @@ -116,8 +116,8 @@ $(document).ready(function(){inlineEditMetadataTerm.init();});
})(jQuery);

jQuery(document).ready(function(){
jQuery('.delete-status a').click(function(){

jQuery('.delete-status a').on( 'click', function(){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we see a dialog to warn about this deletion.

if ( !confirm( ef_confirm_delete_term_string ) )
return false;
});
Expand Down
2 changes: 1 addition & 1 deletion modules/settings/lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jQuery(document).ready(function(){
setTimeout( edit_flow_hide_message, 8000 );
}

jQuery('.enable-disable-edit-flow-module').click(function(){
jQuery('.enable-disable-edit-flow-module').on( 'click', function(){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we can click/toggle Disable or Enable for each module.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


It is a bit weird how they disappear from the sidebar but they don't re-appear when enabled.

if ( jQuery(this).hasClass('button-primary') )
var module_action = 'enable';
else if ( jQuery(this).hasClass('button-remove') )
Expand Down
18 changes: 9 additions & 9 deletions modules/story-budget/lib/story-budget.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

jQuery(document).ready(function($) {
// Hide all post details when directed
$("#toggle_details").click(function() {
$(".post-title > p").toggle('hidden');
$("#toggle_details").on( 'click', function() {
$(".post-title > p").toggle('hidden');
Comment on lines +5 to +6
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

I am going to remove this function as I am not able to find any element for $("#toggle_details"):

jQuery("#toggle_details")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like toggle_details was removed here:
95c6874

Safe to remove from this! ✅

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #663

});

// Make print link open up print dialog
$("#print_link").click(function() {
$("#print_link").on( 'click', function() {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we can click the Print link and it opens the print dialog.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit flow has a PRINT button? 🤯
Anyway, looks good ✅

window.print();
return false;
});

// Hide a single section when directed
$("h3.hndle,div.handlediv").click(function() {
$("h3.hndle,div.handlediv").on( 'click', function() {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we can click a category heading, and then its content is collapsed. See the difference in the following screenshots.

Markup on 2021-06-03 at 15:23:17

Markup on 2021-06-03 at 15:23:49

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Although, the UI for this is sort of weird - I didn't really expect to be able to click on this? Added an issue: #655

$(this).parent().children("div.inside").toggle();
});

// Change number of columns when choosing a new number from Screen Options

var columnsSwitch = $("input[name=ef_story_budget_screen_columns]");
columnsSwitch.click(function() {
columnsSwitch.on( 'click', function() {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ (See the comment above) if the number of columns changes when choosing a new number from Screen Options

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ looks good
Found another bug: #656

var numColumns = parseInt($(this).val());
var classPrefix = 'columns-number-';
$(".postbox-container").removeClass(function() {
Expand All @@ -31,16 +31,16 @@ jQuery(document).ready(function($) {
}).addClass(classPrefix + numColumns);
});

$('h2 a.change-date').click(function(){

$('h2 a.change-date').on( 'click', function(){
$(this).hide();
$('h2 form .form-value').hide();
$('h2 form input').show();
$('h2 form a.change-date-cancel').show();
return false;
});
$('h2 form a.change-date-cancel').click(function(){

$('h2 form a.change-date-cancel').on( 'click', function(){
Comment on lines +35 to +43
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we can click two buttons Change and Cancel like the following GIF:

Screen Capture on 2021-06-03 at 15-35-52

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


whew, didn't find any new bugs!

$(this).hide();
$('h2 form .form-value').show();
$('h2 form input').hide();
Expand Down
12 changes: 6 additions & 6 deletions modules/user-groups/lib/user-groups-configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ inlineEditUsergroup = {

t.what = '#usergroup-';

$('.editinline').live('click', function(){
$( document ).on( 'click', '.editinline', function(){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we're able to see relevant fields to update this group.

Markup on 2021-06-03 at 14:07:50

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good but I found a bug related to this: #654

inlineEditUsergroup.edit(this);
return false;
});

// prepare the edit row
row.keyup(function(e) { if(e.which == 27) return inlineEditUsergroup.revert(); });
row.on( 'keyup', function(e) { if(e.which == 27) return inlineEditUsergroup.revert(); });
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we press Escape key and the Quick Edit fields are closed and their values are reset.

Note: e.which == 27 here is equal to pressing "Escapce" key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


$('a.cancel', row).click(function() { return inlineEditUsergroup.revert(); });
$('a.save', row).click(function() { return inlineEditUsergroup.save(this); });
$('input, select', row).keydown(function(e) { if(e.which == 13) return inlineEditUsergroup.save(this); });
$('a.cancel', row).on( 'click', function() { return inlineEditUsergroup.revert(); });
$('a.save', row).on( 'click', function() { return inlineEditUsergroup.save(this); });
$('input, select', row).on( 'keydown', function(e) { if(e.which == 13) return inlineEditUsergroup.save(this); });
Comment on lines +17 to +19
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ if we click Cancel button and the Quick Edit fields are closed and their values are reset.
✅ if we click Update User Group button and the Quick Edit fields are saved then closed.
✅ if we press Enter key and the Quick Edit fields are saved then closed.

Note: e.which == 13 is for the Enter key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


$('#posts-filter input[type="submit"]').mousedown(function(e){
$('#posts-filter input[type="submit"]').on( 'mousedown', function(e){
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems redundant as there is no element with this ID posts-filter in this page http://valet-vipgo-3279.test/wp-admin/admin.php?page=ef-user-groups-settings

Then this event is not triggered.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this seems redundant. It looks like other pages like wp-admin/admin.php?page=ef-editorial-metadata-settings use this but not User Groups

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #664

t.revert();
});
},
Expand Down