-
Notifications
You must be signed in to change notification settings - Fork 135
Fix jQuery warnings as WordPress upgraded it from 1.12.4-wp to 3.5.1 #649
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if the filtered list always returns a result no matter the search input is upper or lower case.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| return (a.textContent || a.innerText || '').toLowerCase().indexOf(m[3].toLowerCase()) >= 0; | ||
| }; | ||
|
|
||
|
|
@@ -50,7 +50,7 @@ | |
| var $filterTab = $('<li/>') | ||
| .text(filter.label) | ||
| .attr(options._filterIdAttr, i) | ||
| .bind('click', _filterTabEvent) | ||
| .on('click', _filterTabEvent) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| ; | ||
| $tabs.append($filterTab); | ||
| } | ||
|
|
@@ -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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we type some letters in the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| .attr('placeholder', options.inputPlaceholder) | ||
| ; | ||
|
|
||
|
|
@@ -76,7 +76,7 @@ | |
| $input | ||
| .addClass(options.inputPlaceholderClass) | ||
| .val(options.inputPlaceholder) | ||
| .focus(function() { | ||
| .on( 'focus', function() { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See the comment in the L74 above:
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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| var $this = $(this); | ||
| if($this.val() == options.inputPlaceholder) { | ||
| $this | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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' ); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tl;dr - We can ignore finding test cases for this file 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 Relevant line: Even so, jQuery('#ef-post_following_users').length; // return 0
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like the ✅
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(''); | ||
| } | ||
|
|
@@ -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; | ||
| }; | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you meant
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes. Updated! |
||
| }); | ||
| 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(){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we see other posts are expanded for this day.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); | ||
|
|
@@ -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) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we press Note: e.which == 27 here is equal to pressing "Escapce" key.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| if (event.keyCode == '27') { | ||
| edit_flow_calendar_close_overlays(); | ||
| } | ||
|
|
@@ -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){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we click somewhere outside this overlay, it will be removed.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
|
@@ -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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| }, // init | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,19 +7,19 @@ inlineEditCustomStatus = { | |
|
|
||
| t.what = '#term-'; | ||
|
|
||
| $('.editinline').live('click', function(){ | ||
| $( document ).on( 'click', '.editinline', function(){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we're able to see relevant fields to update this status.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); }); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we press Note: e.which == 27 here is equal to pressing "Escapce" key.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we click Note:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. Doesn't appear to be a new problem though, so I added it as a new bug: |
||
|
|
||
| $('#posts-filter input[type="submit"]').mousedown(function(e){ | ||
| $('#posts-filter input[type="submit"]').on( 'mousedown', function(e){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems redundant as there is no element with this ID Then this event is not triggered.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created #664 |
||
| t.revert(); | ||
| }); | ||
| }, | ||
|
|
@@ -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(){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we see a dialog to warn about this deletion.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| if ( !confirm( ef_confirm_delete_status_string ) ) | ||
| return false; | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
✅ if we can click If we do not use Edit Flow, this is how it looks like for contributors:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
| }); | ||
|
|
@@ -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() { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| ef_update_save_button(); | ||
| }); | ||
|
|
||
|
|
@@ -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() { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 As mentioned here, this However, <button type="button" class="button-link editinline" aria-label="Quick edit “Add a new post – set this for future” inline" aria-expanded="false">Quick Edit</button>Also, in the browser console, I can double check that with these functions:
That said, I am not seeing any issue with
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we see
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| jQuery( '#bulk-edit' ).find( 'select[name="_status"] option[value="future"]').remove(); | ||
| } else { | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,19 +7,19 @@ inlineEditMetadataTerm = { | |
|
|
||
| t.what = '#term-'; | ||
|
|
||
| $('.editinline').live('click', function(){ | ||
| $( document ).on( 'click', '.editinline', function(){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we're able to see relevant fields to update this meta.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); }); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we press Note: e.which == 27 here is equal to pressing "Escapce" key.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we click Note:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 This seems redundant and I can not find how this event is triggered.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created #664 |
||
| t.revert(); | ||
| }); | ||
| }, | ||
|
|
@@ -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(){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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(){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ if we can click/toggle
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| if ( jQuery(this).hasClass('button-primary') ) | ||
| var module_action = 'enable'; | ||
| else if ( jQuery(this).hasClass('button-remove') ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
jQuery("#toggle_details")
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like Safe to remove from this! ✅
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ if we can click the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Edit flow has a PRINT button? 🤯 |
||
| window.print(); | ||
| return false; | ||
| }); | ||
|
|
||
| // Hide a single section when directed | ||
| $("h3.hndle,div.handlediv").click(function() { | ||
| $("h3.hndle,div.handlediv").on( 'click', function() { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| $(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() { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ looks good |
||
| var numColumns = parseInt($(this).val()); | ||
| var classPrefix = 'columns-number-'; | ||
| $(".postbox-container").removeClass(function() { | ||
|
|
@@ -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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ if we can click two buttons
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ |
||
| $(this).hide(); | ||
| $('h2 form .form-value').show(); | ||
| $('h2 form input').hide(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,19 +6,19 @@ inlineEditUsergroup = { | |
|
|
||
| t.what = '#usergroup-'; | ||
|
|
||
| $('.editinline').live('click', function(){ | ||
| $( document ).on( 'click', '.editinline', function(){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we're able to see relevant fields to update this group.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); }); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we press Note: e.which == 27 here is equal to pressing "Escapce" key.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✅ if we click Note:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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){ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems redundant as there is no element with this ID Then this event is not triggered.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this seems redundant. It looks like other pages like
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created #664 |
||
| t.revert(); | ||
| }); | ||
| }, | ||
|
|
||












There was a problem hiding this comment.
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
Datefield inEditorial Metadatamodule - related PR #169We 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
There was a problem hiding this comment.
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.
✅
There was a problem hiding this comment.
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