-
diff --git src/wp-admin/js/color-picker.js src/wp-admin/js/color-picker.js
index 8b4bc603f..a3bca29df 100644
|
|
|
10 | 10 | _wrappingLabelText = '<span class="screen-reader-text"></span>'; |
11 | 11 | |
12 | 12 | /** |
13 | | * @summary Creates a jQuery UI color picker. |
14 | | * |
15 | 13 | * Creates a jQuery UI color picker that is used in the theme customizer. |
16 | 14 | * |
17 | 15 | * @class $.widget.wp.wpColorPicker |
… |
… |
|
31 | 29 | slider: 'horizontal' |
32 | 30 | }, |
33 | 31 | /** |
34 | | * @summary Creates a color picker that only allows you to adjust the hue. |
| 32 | * Creates a color picker that only allows you to adjust the hue. |
35 | 33 | * |
36 | 34 | * @since 3.5.0 |
37 | 35 | * |
… |
… |
|
56 | 54 | hide: false, |
57 | 55 | color: color, |
58 | 56 | /** |
59 | | * @summary Handles the onChange event if one has been defined in the options. |
| 57 | * Handles the onChange event if one has been defined in the options. |
60 | 58 | * |
61 | 59 | * @ignore |
62 | 60 | * |
… |
… |
|
75 | 73 | } ); |
76 | 74 | }, |
77 | 75 | /** |
78 | | * @summary Creates the color picker. |
79 | | * |
80 | 76 | * Creates the color picker, sets default values, css classes and wraps it all in HTML. |
81 | 77 | * |
82 | 78 | * @since 3.5.0 |
… |
… |
|
176 | 172 | mode: self.options.mode, |
177 | 173 | palettes: self.options.palettes, |
178 | 174 | /** |
179 | | * @summary Handles the onChange event if one has been defined in the options. |
180 | | * |
181 | 175 | * Handles the onChange event if one has been defined in the options and additionally |
182 | 176 | * sets the background color for the toggler element. |
183 | 177 | * |
… |
… |
|
208 | 202 | } |
209 | 203 | }, |
210 | 204 | /** |
211 | | * @summary Binds event listeners to the color picker. |
| 205 | * Binds event listeners to the color picker. |
212 | 206 | * |
213 | 207 | * @since 3.5.0 |
214 | 208 | * |
… |
… |
|
220 | 214 | var self = this; |
221 | 215 | |
222 | 216 | /** |
223 | | * @summary Prevent any clicks inside this widget from leaking to the top and closing it. |
| 217 | * Prevent any clicks inside this widget from leaking to the top and closing it. |
224 | 218 | * |
225 | 219 | * @since 3.5.0 |
226 | 220 | * |
… |
… |
|
233 | 227 | }); |
234 | 228 | |
235 | 229 | /** |
236 | | * @summary Open or close the color picker depending on the class. |
| 230 | * Open or close the color picker depending on the class. |
237 | 231 | * |
238 | 232 | * @since 3.5 |
239 | 233 | */ |
… |
… |
|
246 | 240 | }); |
247 | 241 | |
248 | 242 | /** |
249 | | * @summary Checks if value is empty when changing the color in the color picker. |
250 | | * |
251 | 243 | * Checks if value is empty when changing the color in the color picker. |
252 | 244 | * If so, the background color is cleared. |
253 | 245 | * |
… |
… |
|
271 | 263 | }); |
272 | 264 | |
273 | 265 | /** |
274 | | * @summary Enables the user to clear or revert the color in the color picker. |
275 | | * |
276 | 266 | * Enables the user to either clear the color in the color picker or revert back to the default color. |
277 | 267 | * |
278 | 268 | * @since 3.5.0 |
… |
… |
|
295 | 285 | }); |
296 | 286 | }, |
297 | 287 | /** |
298 | | * @summary Opens the color picker dialog. |
| 288 | * Opens the color picker dialog. |
299 | 289 | * |
300 | 290 | * @since 3.5.0 |
301 | 291 | * |
… |
… |
|
311 | 301 | $( 'body' ).trigger( 'click.wpcolorpicker' ).on( 'click.wpcolorpicker', this.close ); |
312 | 302 | }, |
313 | 303 | /** |
314 | | * @summary Closes the color picker dialog. |
| 304 | * Closes the color picker dialog. |
315 | 305 | * |
316 | 306 | * @since 3.5.0 |
317 | 307 | * |
… |
… |
|
327 | 317 | $( 'body' ).off( 'click.wpcolorpicker', this.close ); |
328 | 318 | }, |
329 | 319 | /** |
330 | | * @summary Returns iris object or sets new color. |
331 | | * |
332 | 320 | * Returns the iris object if no new color is provided. If a new color is provided, it sets the new color. |
333 | 321 | * |
334 | 322 | * @param newColor {string|*} The new color to use. Can be undefined. |
… |
… |
|
344 | 332 | this.element.iris( 'option', 'color', newColor ); |
345 | 333 | }, |
346 | 334 | /** |
347 | | * @summary Returns iris object or sets new default color. |
348 | | * |
349 | 335 | * Returns the iris object if no new default color is provided. |
350 | 336 | * If a new default color is provided, it sets the new default color. |
351 | 337 | * |
-
diff --git src/wp-admin/js/comment.js src/wp-admin/js/comment.js
index 3541a2f68..6308d8e83 100644
|
|
|
1 | 1 | /* global postboxes, commentL10n */ |
2 | 2 | |
3 | 3 | /** |
4 | | * @summary Binds to the document ready event. |
| 4 | * Binds to the document ready event. |
5 | 5 | * |
6 | 6 | * @since 2.5.0 |
7 | 7 | * |
… |
… |
jQuery(document).ready( function($) { |
18 | 18 | $edittimestamp = $timestampdiv.siblings( 'a.edit-timestamp' ); |
19 | 19 | |
20 | 20 | /** |
21 | | * @summary Adds event that opens the time stamp form if the form is hidden. |
| 21 | * Adds event that opens the time stamp form if the form is hidden. |
22 | 22 | * |
23 | 23 | * @listens $edittimestamp:click |
24 | 24 | * |
… |
… |
jQuery(document).ready( function($) { |
37 | 37 | }); |
38 | 38 | |
39 | 39 | /** |
40 | | * @summary Resets the time stamp values when the cancel button is clicked. |
| 40 | * Resets the time stamp values when the cancel button is clicked. |
41 | 41 | * |
42 | 42 | * @listens .cancel-timestamp:click |
43 | 43 | * |
… |
… |
jQuery(document).ready( function($) { |
59 | 59 | }); |
60 | 60 | |
61 | 61 | /** |
62 | | * @summary Sets the time stamp values when the ok button is clicked. |
| 62 | * Sets the time stamp values when the ok button is clicked. |
63 | 63 | * |
64 | 64 | * @listens .save-timestamp:click |
65 | 65 | * |
-
diff --git src/wp-admin/js/common.js src/wp-admin/js/common.js
index c9e50d706..394648bef 100644
|
|
|
2 | 2 | var showNotice, adminMenu, columns, validateForm, screenMeta; |
3 | 3 | |
4 | 4 | /** |
5 | | * @summary Adds common WordPress functionality to the window. |
| 5 | * Adds common WordPress functionality to the window. |
6 | 6 | * |
7 | 7 | * @param {jQuery} $ jQuery object. |
8 | 8 | * @param {Object} window The window object. |
… |
… |
var showNotice, adminMenu, columns, validateForm, screenMeta; |
14 | 14 | $body = $( document.body ); |
15 | 15 | |
16 | 16 | /** |
17 | | * @summary Removed in 3.3.0, needed for back-compatibility. |
| 17 | * Removed in 3.3.0, needed for back-compatibility. |
18 | 18 | * |
19 | 19 | * @since 2.7.0 |
20 | 20 | * @deprecated 3.3.0 |
… |
… |
adminMenu = { |
31 | 31 | columns = { |
32 | 32 | |
33 | 33 | /** |
34 | | * @summary Initializes the column toggles in the screen options. |
| 34 | * Initializes the column toggles in the screen options. |
35 | 35 | * |
36 | 36 | * Binds an onClick event to the checkboxes to show or hide the table columns |
37 | 37 | * based on their toggled state. And persists the toggled state. |
… |
… |
columns = { |
54 | 54 | }, |
55 | 55 | |
56 | 56 | /** |
57 | | * @summary Saves the toggled state for the columns. |
| 57 | * Saves the toggled state for the columns. |
58 | 58 | * |
59 | 59 | * Saves whether the columns should be shown or hidden on a page. |
60 | 60 | * |
… |
… |
columns = { |
73 | 73 | }, |
74 | 74 | |
75 | 75 | /** |
76 | | * @summary Makes a column visible and adjusts the column span for the table. |
| 76 | * Makes a column visible and adjusts the column span for the table. |
77 | 77 | * |
78 | 78 | * @since 3.0.0 |
79 | 79 | * @param {string} column The column name. |
… |
… |
columns = { |
86 | 86 | }, |
87 | 87 | |
88 | 88 | /** |
89 | | * @summary Hides a column and adjusts the column span for the table. |
| 89 | * Hides a column and adjusts the column span for the table. |
90 | 90 | * |
91 | 91 | * @since 3.0.0 |
92 | 92 | * @param {string} column The column name. |
… |
… |
columns = { |
99 | 99 | }, |
100 | 100 | |
101 | 101 | /** |
102 | | * @summary Get all hidden columns. |
| 102 | * Gets all hidden columns. |
103 | 103 | * |
104 | 104 | * @since 3.0.0 |
105 | 105 | * |
… |
… |
columns = { |
112 | 112 | }, |
113 | 113 | |
114 | 114 | /** |
115 | | * @summary Gets the checked column toggles from the screen options. |
| 115 | * Gets the checked column toggles from the screen options. |
116 | 116 | * |
117 | 117 | * @since 3.0.0 |
118 | 118 | * |
… |
… |
columns = { |
128 | 128 | }, |
129 | 129 | |
130 | 130 | /** |
131 | | * @summary Adjusts the column span for the table. |
| 131 | * Adjusts the column span for the table. |
132 | 132 | * |
133 | 133 | * @since 3.1.0 |
134 | 134 | * |
… |
… |
columns = { |
146 | 146 | $document.ready(function(){columns.init();}); |
147 | 147 | |
148 | 148 | /** |
149 | | * @summary Validates that the required form fields are not empty. |
| 149 | * Validates that the required form fields are not empty. |
150 | 150 | * |
151 | 151 | * @since 2.9.0 |
152 | 152 | * |
… |
… |
validateForm = function( form ) { |
166 | 166 | |
167 | 167 | // stub for doing better warnings |
168 | 168 | /** |
169 | | * @summary Shows message pop-up notice or confirmation message. |
| 169 | * Shows message pop-up notice or confirmation message. |
170 | 170 | * |
171 | 171 | * @since 2.7.0 |
172 | 172 | * |
… |
… |
validateForm = function( form ) { |
177 | 177 | showNotice = { |
178 | 178 | |
179 | 179 | /** |
180 | | * @summary Shows a delete confirmation pop-up message. |
| 180 | * Shows a delete confirmation pop-up message. |
181 | 181 | * |
182 | 182 | * @since 2.7.0 |
183 | 183 | * |
… |
… |
showNotice = { |
193 | 193 | }, |
194 | 194 | |
195 | 195 | /** |
196 | | * @summary Shows an alert message. |
| 196 | * Shows an alert message. |
197 | 197 | * |
198 | 198 | * @since 2.7.0 |
199 | 199 | * |
… |
… |
showNotice = { |
205 | 205 | }; |
206 | 206 | |
207 | 207 | /** |
208 | | * @summary Represents the functions for the meta screen options panel. |
| 208 | * Represents the functions for the meta screen options panel. |
209 | 209 | * |
210 | 210 | * @since 3.2.0 |
211 | 211 | * |
… |
… |
screenMeta = { |
221 | 221 | page: null, // #wpcontent |
222 | 222 | |
223 | 223 | /** |
224 | | * @summary Initializes the screen meta options panel. |
| 224 | * Initializes the screen meta options panel. |
225 | 225 | * |
226 | 226 | * @since 3.2.0 |
227 | 227 | * |
… |
… |
screenMeta = { |
236 | 236 | }, |
237 | 237 | |
238 | 238 | /** |
239 | | * @summary Toggles the screen meta options panel. |
| 239 | * Toggles the screen meta options panel. |
240 | 240 | * |
241 | 241 | * @since 3.2.0 |
242 | 242 | * |
… |
… |
screenMeta = { |
255 | 255 | }, |
256 | 256 | |
257 | 257 | /** |
258 | | * @summary Opens the screen meta options panel. |
| 258 | * Opens the screen meta options panel. |
259 | 259 | * |
260 | 260 | * @since 3.2.0 |
261 | 261 | * |
… |
… |
screenMeta = { |
271 | 271 | panel.parent().show(); |
272 | 272 | |
273 | 273 | /** |
274 | | * @summary Sets the focus to the meta options panel and adds the necessary CSS classes. |
| 274 | * Sets the focus to the meta options panel and adds the necessary CSS classes. |
275 | 275 | * |
276 | 276 | * @since 3.2.0 |
277 | 277 | * |
… |
… |
screenMeta = { |
286 | 286 | }, |
287 | 287 | |
288 | 288 | /** |
289 | | * @summary Closes the screen meta options panel. |
| 289 | * Closes the screen meta options panel. |
290 | 290 | * |
291 | 291 | * @since 3.2.0 |
292 | 292 | * |
… |
… |
screenMeta = { |
297 | 297 | */ |
298 | 298 | close: function( panel, button ) { |
299 | 299 | /** |
300 | | * @summary Hides the screen meta options panel. |
| 300 | * Hides the screen meta options panel. |
301 | 301 | * |
302 | 302 | * @since 3.2.0 |
303 | 303 | * |
… |
… |
screenMeta = { |
314 | 314 | }; |
315 | 315 | |
316 | 316 | /** |
317 | | * @summary Initializes the help tabs in the help panel. |
| 317 | * Initializes the help tabs in the help panel. |
318 | 318 | * |
319 | 319 | * @param {Event} e The event object. |
320 | 320 | * |
… |
… |
$document.ready( function() { |
495 | 495 | $headerEnd = $( '.wp-header-end' ); |
496 | 496 | |
497 | 497 | /** |
498 | | * @summary Makes the fly-out submenu header clickable, when the menu is folded. |
| 498 | * Makes the fly-out submenu header clickable, when the menu is folded. |
499 | 499 | * |
500 | 500 | * @param {Event} e The event object. |
501 | 501 | * |
… |
… |
$document.ready( function() { |
506 | 506 | }); |
507 | 507 | |
508 | 508 | /** |
509 | | * @summary Collapses the admin menu. |
| 509 | * Collapses the admin menu. |
510 | 510 | * |
511 | 511 | * @returns {void} |
512 | 512 | */ |
… |
… |
$document.ready( function() { |
543 | 543 | }); |
544 | 544 | |
545 | 545 | /** |
546 | | * @summary Handles the `aria-haspopup` attribute on the current menu item when it has a submenu. |
| 546 | * Handles the `aria-haspopup` attribute on the current menu item when it has a submenu. |
547 | 547 | * |
548 | 548 | * @since 4.4.0 |
549 | 549 | * |
… |
… |
$document.ready( function() { |
564 | 564 | $document.on( 'wp-menu-state-set wp-collapse-menu wp-responsive-activate wp-responsive-deactivate', currentMenuItemHasPopup ); |
565 | 565 | |
566 | 566 | /** |
567 | | * @summary Ensures an admin submenu is within the visual viewport. |
| 567 | * Ensures an admin submenu is within the visual viewport. |
568 | 568 | * |
569 | 569 | * @since 4.1.0 |
570 | 570 | * |
… |
… |
$document.ready( function() { |
605 | 605 | mobileEvent = isIOS ? 'touchstart' : 'click'; |
606 | 606 | |
607 | 607 | /** |
608 | | * @summary Closes any open submenus when touch/click is not on the menu. |
| 608 | * Closes any open submenus when touch/click is not on the menu. |
609 | 609 | * |
610 | 610 | * @param {Event} e The event object. |
611 | 611 | * |
… |
… |
$document.ready( function() { |
622 | 622 | }); |
623 | 623 | |
624 | 624 | /** |
625 | | * @summary Handles the opening or closing the submenu based on the mobile click|touch event. |
| 625 | * Handles the opening or closing the submenu based on the mobile click|touch event. |
626 | 626 | * |
627 | 627 | * @param {Event} event The event object. |
628 | 628 | * |
… |
… |
$document.ready( function() { |
651 | 651 | $adminmenu.find( 'li.wp-has-submenu' ).hoverIntent({ |
652 | 652 | |
653 | 653 | /** |
654 | | * @summary Opens the submenu when hovered over the menu item for desktops. |
| 654 | * Opens the submenu when hovered over the menu item for desktops. |
655 | 655 | * |
656 | 656 | * @returns {void} |
657 | 657 | */ |
… |
… |
$document.ready( function() { |
675 | 675 | }, |
676 | 676 | |
677 | 677 | /** |
678 | | * @summary Closes the submenu when no longer hovering the menu item. |
| 678 | * Closes the submenu when no longer hovering the menu item. |
679 | 679 | * |
680 | 680 | * @returns {void} |
681 | 681 | */ |
… |
… |
$document.ready( function() { |
693 | 693 | }); |
694 | 694 | |
695 | 695 | /** |
696 | | * @summary Opens the submenu on when focused on the menu item. |
| 696 | * Opens the submenu on when focused on the menu item. |
697 | 697 | * |
698 | 698 | * @param {Event} event The event object. |
699 | 699 | * |
… |
… |
$document.ready( function() { |
708 | 708 | $( event.target ).closest( 'li.menu-top' ).addClass( 'opensub' ); |
709 | 709 | |
710 | 710 | /** |
711 | | * @summary Closes the submenu on blur from the menu item. |
| 711 | * Closes the submenu on blur from the menu item. |
712 | 712 | * |
713 | 713 | * @param {Event} event The event object. |
714 | 714 | * |
… |
… |
$document.ready( function() { |
722 | 722 | $( event.target ).closest( 'li.menu-top' ).removeClass( 'opensub' ); |
723 | 723 | |
724 | 724 | /** |
725 | | * @summary Adjusts the size for the submenu. |
| 725 | * Adjusts the size for the submenu. |
726 | 726 | * |
727 | 727 | * @returns {void} |
728 | 728 | */ |
… |
… |
$document.ready( function() { |
743 | 743 | $( 'div.updated, div.error, div.notice' ).not( '.inline, .below-h2' ).insertAfter( $headerEnd ); |
744 | 744 | |
745 | 745 | /** |
746 | | * @summary Make notices dismissible. |
| 746 | * Makes notices dismissible. |
747 | 747 | * |
748 | 748 | * @since 4.4.0 |
749 | 749 | * |
… |
… |
$document.ready( function() { |
776 | 776 | screenMeta.init(); |
777 | 777 | |
778 | 778 | /** |
779 | | * @summary Checks a checkbox. |
| 779 | * Checks a checkbox. |
780 | 780 | * |
781 | 781 | * This event needs to be delegated. Ticket #37973. |
782 | 782 | * |
… |
… |
$document.ready( function() { |
807 | 807 | var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible:enabled').not(':checked'); |
808 | 808 | |
809 | 809 | /** |
810 | | * @summary Determines if all checkboxes are checked. |
| 810 | * Determines if all checkboxes are checked. |
811 | 811 | * |
812 | 812 | * @returns {boolean} Returns true if there are no unchecked checkboxes. |
813 | 813 | */ |
… |
… |
$document.ready( function() { |
819 | 819 | }); |
820 | 820 | |
821 | 821 | /** |
822 | | * @summary Controls all the toggles on bulk toggle change. |
| 822 | * Controls all the toggles on bulk toggle change. |
823 | 823 | * |
824 | 824 | * When the bulk checkbox is changed, all the checkboxes in the tables are changed accordingly. |
825 | 825 | * When the shift-button is pressed while changing the bulk checkbox the checkboxes in the table are inverted. |
… |
… |
$document.ready( function() { |
839 | 839 | $table.children( 'tbody' ).filter(':visible') |
840 | 840 | .children().children('.check-column').find(':checkbox') |
841 | 841 | /** |
842 | | * @summary Updates the checked state on the checkbox in the table. |
| 842 | * Updates the checked state on the checkbox in the table. |
843 | 843 | * |
844 | 844 | * @returns {boolean} True checks the checkbox, False unchecks the checkbox. |
845 | 845 | */ |
… |
… |
$document.ready( function() { |
861 | 861 | .children().children('.check-column').find(':checkbox') |
862 | 862 | |
863 | 863 | /** |
864 | | * @summary Syncs the bulk checkboxes on the top and bottom of the table. |
| 864 | * Syncs the bulk checkboxes on the top and bottom of the table. |
865 | 865 | * |
866 | 866 | * @returns {boolean} True checks the checkbox, False unchecks the checkbox. |
867 | 867 | */ |
… |
… |
$document.ready( function() { |
877 | 877 | }); |
878 | 878 | |
879 | 879 | /** |
880 | | * @summary Shows row actions on focus of its parent container element or any other elements contained within. |
| 880 | * Shows row actions on focus of its parent container element or any other elements contained within. |
881 | 881 | * |
882 | 882 | * @returns {void} |
883 | 883 | */ |
… |
… |
$document.ready( function() { |
910 | 910 | }); |
911 | 911 | |
912 | 912 | /** |
913 | | * @summary Handles tab keypresses in theme and plugin editor textareas. |
| 913 | * Handles tab keypresses in theme and plugin editor textareas. |
914 | 914 | * |
915 | 915 | * @param {Event} e The event object. |
916 | 916 | * |
… |
… |
$document.ready( function() { |
964 | 964 | if ( pageInput.length ) { |
965 | 965 | |
966 | 966 | /** |
967 | | * @summary Handles pagination variable when filtering the list table. |
| 967 | * Handles pagination variable when filtering the list table. |
968 | 968 | * |
969 | 969 | * Set the pagination argument to the first page when the post-filter form is submitted. |
970 | 970 | * This happens when pressing the 'filter' button on the list table page. |
… |
… |
$document.ready( function() { |
986 | 986 | } |
987 | 987 | |
988 | 988 | /** |
989 | | * @summary Resets the bulk actions when the search button is clicked. |
| 989 | * Resets the bulk actions when the search button is clicked. |
990 | 990 | * |
991 | 991 | * @returns {void} |
992 | 992 | */ |
… |
… |
$document.ready( function() { |
995 | 995 | }); |
996 | 996 | |
997 | 997 | /** |
998 | | * @summary Scrolls into view when focus.scroll-into-view is triggered. |
| 998 | * Scrolls into view when focus.scroll-into-view is triggered. |
999 | 999 | * |
1000 | 1000 | * @param {Event} e The event object. |
1001 | 1001 | * |
… |
… |
$document.ready( function() { |
1007 | 1007 | }); |
1008 | 1008 | |
1009 | 1009 | /** |
1010 | | * @summary Disables the submit upload buttons when no data is entered. |
| 1010 | * Disables the submit upload buttons when no data is entered. |
1011 | 1011 | * |
1012 | 1012 | * @returns {void} |
1013 | 1013 | */ |
… |
… |
$document.ready( function() { |
1022 | 1022 | input = form.find('input[type="file"]'); |
1023 | 1023 | |
1024 | 1024 | /** |
1025 | | * @summary Determines if any data is entered in any file upload input. |
| 1025 | * Determines if any data is entered in any file upload input. |
1026 | 1026 | * |
1027 | 1027 | * @since 3.5.0 |
1028 | 1028 | * |
… |
… |
$document.ready( function() { |
1042 | 1042 | })(); |
1043 | 1043 | |
1044 | 1044 | /** |
1045 | | * @summary Pins the menu while distraction-free writing is enabled. |
| 1045 | * Pins the menu while distraction-free writing is enabled. |
1046 | 1046 | * |
1047 | 1047 | * @param {Event} event Event data. |
1048 | 1048 | * |
… |
… |
$document.ready( function() { |
1187 | 1187 | } |
1188 | 1188 | |
1189 | 1189 | /** |
1190 | | * @summary Determines the height of certain elements. |
| 1190 | * Determines the height of certain elements. |
1191 | 1191 | * |
1192 | 1192 | * @since 4.1.0 |
1193 | 1193 | * |
… |
… |
$document.ready( function() { |
1203 | 1203 | } |
1204 | 1204 | |
1205 | 1205 | /** |
1206 | | * @summary Unpins the menu. |
| 1206 | * Unpins the menu. |
1207 | 1207 | * |
1208 | 1208 | * @since 4.1.0 |
1209 | 1209 | * |
… |
… |
$document.ready( function() { |
1223 | 1223 | } |
1224 | 1224 | |
1225 | 1225 | /** |
1226 | | * @summary Pins and unpins the menu when applicable. |
| 1226 | * Pins and unpins the menu when applicable. |
1227 | 1227 | * |
1228 | 1228 | * @since 4.1.0 |
1229 | 1229 | * |
… |
… |
$document.ready( function() { |
1252 | 1252 | } |
1253 | 1253 | |
1254 | 1254 | /** |
1255 | | * @summary Changes properties of metaboxes and body. |
1256 | | * |
1257 | 1255 | * Changes the sortables and responsiveness of metaboxes. |
1258 | 1256 | * |
1259 | 1257 | * @since 3.8.0 |
… |
… |
$document.ready( function() { |
1263 | 1261 | window.wpResponsive = { |
1264 | 1262 | |
1265 | 1263 | /** |
1266 | | * @summary Initializes the wpResponsive object. |
| 1264 | * Initializes the wpResponsive object. |
1267 | 1265 | * |
1268 | 1266 | * @since 3.8.0 |
1269 | 1267 | * |
… |
… |
$document.ready( function() { |
1321 | 1319 | }, |
1322 | 1320 | |
1323 | 1321 | /** |
1324 | | * @summary Changes properties of body and admin menu. |
| 1322 | * Changes properties of body and admin menu. |
1325 | 1323 | * |
1326 | 1324 | * Pins and unpins the menu and adds the auto-fold class to the body. |
1327 | 1325 | * Makes the admin menu responsive and disables the metabox sortables. |
… |
… |
$document.ready( function() { |
1342 | 1340 | }, |
1343 | 1341 | |
1344 | 1342 | /** |
1345 | | * @summary Changes properties of admin menu and enables metabox sortables. |
| 1343 | * Changes properties of admin menu and enables metabox sortables. |
1346 | 1344 | * |
1347 | 1345 | * Pin and unpin the menu. |
1348 | 1346 | * Removes the responsiveness of the admin menu and enables the metabox sortables. |
… |
… |
$document.ready( function() { |
1358 | 1356 | }, |
1359 | 1357 | |
1360 | 1358 | /** |
1361 | | * @summary Sets the responsiveness and enables the overlay based on the viewport width. |
| 1359 | * Sets the responsiveness and enables the overlay based on the viewport width. |
1362 | 1360 | * |
1363 | 1361 | * @since 3.8.0 |
1364 | 1362 | * |
… |
… |
$document.ready( function() { |
1392 | 1390 | }, |
1393 | 1391 | |
1394 | 1392 | /** |
1395 | | * @summary Inserts a responsive overlay and toggles the window. |
| 1393 | * Inserts a responsive overlay and toggles the window. |
1396 | 1394 | * |
1397 | 1395 | * @since 3.8.0 |
1398 | 1396 | * |
… |
… |
$document.ready( function() { |
1415 | 1413 | }, |
1416 | 1414 | |
1417 | 1415 | /** |
1418 | | * @summary Disables the responsive overlay and removes the overlay. |
| 1416 | * Disables the responsive overlay and removes the overlay. |
1419 | 1417 | * |
1420 | 1418 | * @since 3.8.0 |
1421 | 1419 | * |
… |
… |
$document.ready( function() { |
1427 | 1425 | }, |
1428 | 1426 | |
1429 | 1427 | /** |
1430 | | * @summary Disables sortables. |
| 1428 | * Disables sortables. |
1431 | 1429 | * |
1432 | 1430 | * @since 3.8.0 |
1433 | 1431 | * |
… |
… |
$document.ready( function() { |
1442 | 1440 | }, |
1443 | 1441 | |
1444 | 1442 | /** |
1445 | | * @summary Enables sortables. |
| 1443 | * Enables sortables. |
1446 | 1444 | * |
1447 | 1445 | * @since 3.8.0 |
1448 | 1446 | * |
… |
… |
$document.ready( function() { |
1458 | 1456 | }; |
1459 | 1457 | |
1460 | 1458 | /** |
1461 | | * @summary Add an ARIA role `button` to elements that behave like UI controls when JavaScript is on. |
| 1459 | * Add an ARIA role `button` to elements that behave like UI controls when JavaScript is on. |
1462 | 1460 | * |
1463 | 1461 | * @since 4.5.0 |
1464 | 1462 | * |
… |
… |
$document.ready( function() { |
1473 | 1471 | }); |
1474 | 1472 | |
1475 | 1473 | /** |
1476 | | * @summary Get the viewport width. |
| 1474 | * Get the viewport width. |
1477 | 1475 | * |
1478 | 1476 | * @since 4.7.0 |
1479 | 1477 | * |
… |
… |
$document.ready( function() { |
1492 | 1490 | } |
1493 | 1491 | |
1494 | 1492 | /** |
1495 | | * @summary Sets the admin menu collapsed/expanded state. |
| 1493 | * Sets the admin menu collapsed/expanded state. |
1496 | 1494 | * |
1497 | 1495 | * Sets the global variable `menuState` and triggers a custom event passing |
1498 | 1496 | * the current menu state. |
… |
… |
$document.ready( function() { |
1519 | 1517 | $document.on( 'wp-window-resized.set-menu-state', setMenuState ); |
1520 | 1518 | |
1521 | 1519 | /** |
1522 | | * @summary Sets ARIA attributes on the collapse/expand menu button. |
| 1520 | * Sets ARIA attributes on the collapse/expand menu button. |
1523 | 1521 | * |
1524 | 1522 | * When the admin menu is open or folded, updates the `aria-expanded` and |
1525 | 1523 | * `aria-label` attributes of the button to give feedback to assistive |
… |
… |
$document.ready( function() { |
1582 | 1580 | var timeout; |
1583 | 1581 | |
1584 | 1582 | /** |
1585 | | * @summary Triggers the WP window-resize event. |
| 1583 | * Triggers the WP window-resize event. |
1586 | 1584 | * |
1587 | 1585 | * @since 3.8.0 |
1588 | 1586 | * |
… |
… |
$document.ready( function() { |
1593 | 1591 | } |
1594 | 1592 | |
1595 | 1593 | /** |
1596 | | * @summary Fires the trigger event again after 200 ms. |
| 1594 | * Fires the trigger event again after 200 ms. |
1597 | 1595 | * |
1598 | 1596 | * @since 3.8.0 |
1599 | 1597 | * |
-
diff --git src/wp-admin/js/custom-background.js src/wp-admin/js/custom-background.js
index 9e96015e7..472ff321a 100644
|
|
|
1 | 1 | /* global ajaxurl */ |
2 | 2 | |
3 | 3 | /** |
4 | | * @summary Registers all events for customizing the background. |
| 4 | * Registers all events for customizing the background. |
5 | 5 | * |
6 | 6 | * @since 3.0.0 |
7 | 7 | * |
… |
… |
|
13 | 13 | bgImage = $( '#custom-background-image' ); |
14 | 14 | |
15 | 15 | /** |
16 | | * @summary Instantiates the WordPress color picker and binds the change and clear events. |
| 16 | * Instantiates the WordPress color picker and binds the change and clear events. |
17 | 17 | * |
18 | 18 | * @since 3.5.0 |
19 | 19 | * |
… |
… |
|
29 | 29 | }); |
30 | 30 | |
31 | 31 | /** |
32 | | * @summary Alters the background size CSS property whenever the background size input has changed. |
| 32 | * Alters the background size CSS property whenever the background size input has changed. |
33 | 33 | * |
34 | 34 | * @since 4.7.0 |
35 | 35 | * |
… |
… |
|
40 | 40 | }); |
41 | 41 | |
42 | 42 | /** |
43 | | * @summary Alters the background position CSS property whenever the background position input has changed. |
| 43 | * Alters the background position CSS property whenever the background position input has changed. |
44 | 44 | * |
45 | 45 | * @since 4.7.0 |
46 | 46 | * |
… |
… |
|
51 | 51 | }); |
52 | 52 | |
53 | 53 | /** |
54 | | * @summary Alters the background repeat CSS property whenever the background repeat input has changed. |
| 54 | * Alters the background repeat CSS property whenever the background repeat input has changed. |
55 | 55 | * |
56 | 56 | * @since 3.0.0 |
57 | 57 | * |
… |
… |
|
62 | 62 | }); |
63 | 63 | |
64 | 64 | /** |
65 | | * @summary Alters the background attachment CSS property whenever the background attachment input has changed. |
| 65 | * Alters the background attachment CSS property whenever the background attachment input has changed. |
66 | 66 | * |
67 | 67 | * @since 4.7.0 |
68 | 68 | * |
… |
… |
|
73 | 73 | }); |
74 | 74 | |
75 | 75 | /** |
76 | | * @summary Binds the event for opening the WP Media dialog. |
| 76 | * Binds the event for opening the WP Media dialog. |
77 | 77 | * |
78 | 78 | * @since 3.5.0 |
79 | 79 | * |
… |
… |
|
113 | 113 | }); |
114 | 114 | |
115 | 115 | /** |
116 | | * @summary When an image is selected, run a callback. |
| 116 | * When an image is selected, run a callback. |
117 | 117 | * |
118 | 118 | * @since 3.5.0 |
119 | 119 | * |
-
diff --git src/wp-admin/js/custom-header.js src/wp-admin/js/custom-header.js
index ffe462354..5138e0cdb 100644
|
|
|
1 | 1 | /* global isRtl */ |
2 | 2 | |
3 | 3 | /** |
4 | | * @summary Initializes the custom header selection page. |
| 4 | * Initializes the custom header selection page. |
5 | 5 | * |
6 | 6 | * @since 3.5.0 |
7 | 7 | * |
… |
… |
|
27 | 27 | }); |
28 | 28 | |
29 | 29 | /** |
30 | | * @summary Opens the 'choose from library' frame and creates it if it doesn't |
31 | | * exist. |
| 30 | * Opens the 'choose from library' frame and creates it if it doesn't exist. |
32 | 31 | * |
33 | 32 | * @since 3.5.0 |
34 | 33 | * @deprecated 4.1.0 |
… |
… |
|
66 | 65 | }); |
67 | 66 | |
68 | 67 | /** |
69 | | * @summary Updates the window location to include the selected attachment. |
| 68 | * Updates the window location to include the selected attachment. |
70 | 69 | * |
71 | 70 | * @since 3.5.0 |
72 | 71 | * @deprecated 4.1.0 |
-
diff --git src/wp-admin/js/editor-expand.js src/wp-admin/js/editor-expand.js
index 3a5626c78..852ac6e54 100644
|
|
|
7 | 7 | $footer = $( '#wpfooter' ); |
8 | 8 | |
9 | 9 | /** |
10 | | * @summary Handles the resizing of the editor. |
| 10 | * Handles the resizing of the editor. |
11 | 11 | * |
12 | 12 | * @since 4.0.0 |
13 | 13 | * |
… |
… |
|
60 | 60 | }; |
61 | 61 | |
62 | 62 | /** |
63 | | * @summary Resizes textarea based on scroll height and width. |
64 | | * |
65 | | * Resizes textarea based on scroll height and width. Doesn't shrink the |
66 | | * editor size below the 300px auto resize minimum height. |
| 63 | * Resizes textarea based on scroll height and width. |
| 64 | * Doesn't shrink the editor size below the 300px auto resize minimum height. |
67 | 65 | * |
68 | 66 | * @since 4.6.1 |
69 | 67 | * |
… |
… |
|
90 | 88 | }, 300 ); |
91 | 89 | |
92 | 90 | /** |
93 | | * @summary Resizes the text editor depending on the old text length. |
| 91 | * Resizes the text editor depending on the old text length. |
94 | 92 | * |
95 | 93 | * If there is an mceEditor and it is hidden, it resizes the editor depending |
96 | 94 | * on the old text length. If the current length of the text is smaller than |
… |
… |
|
123 | 121 | } |
124 | 122 | |
125 | 123 | /** |
126 | | * @summary Gets the height and widths of elements. |
| 124 | * Gets the height and widths of elements. |
127 | 125 | * |
128 | 126 | * Gets the heights of the window, the adminbar, the tools, the menu, |
129 | 127 | * the visualTop, the textTop, the bottom, the statusbar and sideSortables |
… |
… |
|
158 | 156 | |
159 | 157 | // We need to wait for TinyMCE to initialize. |
160 | 158 | /** |
161 | | * @summary Binds all necessary functions for editor expand to the editor |
162 | | * when the editor is initialized. |
| 159 | * Binds all necessary functions for editor expand to the editor when the editor is initialized. |
163 | 160 | * |
164 | 161 | * @since 4.0.0 |
165 | 162 | * |
… |
… |
|
172 | 169 | // VK contains the type of key pressed. VK = virtual keyboard. |
173 | 170 | var VK = window.tinymce.util.VK, |
174 | 171 | /** |
175 | | * @summary Hides any float panel with a hover state. Additionally hides tooltips. |
| 172 | * Hides any float panel with a hover state. Additionally hides tooltips. |
176 | 173 | * |
177 | 174 | * @returns {void} |
178 | 175 | */ |
… |
… |
|
199 | 196 | $menuBar = $contentWrap.find( '.mce-menubar' ); |
200 | 197 | |
201 | 198 | /** |
202 | | * @summary Gets the offset of the editor. |
| 199 | * Gets the offset of the editor. |
203 | 200 | * |
204 | 201 | * @returns {Number|Boolean} Returns the offset of the editor |
205 | 202 | * or false if there is no offset height. |
… |
… |
|
232 | 229 | } |
233 | 230 | |
234 | 231 | /** |
235 | | * @summary Filters the special keys that should not be used for scrolling. |
| 232 | * Filters the special keys that should not be used for scrolling. |
236 | 233 | * |
237 | 234 | * @since 4.0.0 |
238 | 235 | * |
… |
… |
|
255 | 252 | } |
256 | 253 | |
257 | 254 | /** |
258 | | * @summary Makes sure the cursor is always visible in the editor. |
| 255 | * Makes sure the cursor is always visible in the editor. |
259 | 256 | * |
260 | 257 | * Makes sure the cursor is kept between the toolbars of the editor and scrolls |
261 | 258 | * the window when the cursor moves out of the viewport to a wpview. |
… |
… |
|
322 | 319 | } |
323 | 320 | |
324 | 321 | /** |
325 | | * @summary If the editor is fullscreen, calls adjust. |
| 322 | * If the editor is fullscreen, calls adjust. |
326 | 323 | * |
327 | 324 | * @since 4.1.0 |
328 | 325 | * |
… |
… |
|
338 | 335 | } |
339 | 336 | |
340 | 337 | /** |
341 | | * @summary Shows the editor when scrolled. |
| 338 | * Shows the editor when scrolled. |
342 | 339 | * |
343 | 340 | * Binds the hideFloatPanels function on the window scroll.mce-float-panels event. |
344 | 341 | * Executes the wpAutoResize on the active editor. |
… |
… |
|
357 | 354 | } |
358 | 355 | |
359 | 356 | /** |
360 | | * @summary Resizes the editor. |
| 357 | * Resizes the editor. |
361 | 358 | * |
362 | 359 | * Removes all functions from the window scroll.mce-float-panels event. |
363 | 360 | * Resizes the text editor and scrolls to a position based on the pageXOffset and adminBarHeight. |
… |
… |
|
384 | 381 | } |
385 | 382 | |
386 | 383 | /** |
387 | | * @summary Toggles advanced states. |
| 384 | * Toggles advanced states. |
388 | 385 | * |
389 | 386 | * @since 4.1.0 |
390 | 387 | * |
… |
… |
|
395 | 392 | } |
396 | 393 | |
397 | 394 | /** |
398 | | * @summary Binds events of the editor and window. |
| 395 | * Binds events of the editor and window. |
399 | 396 | * |
400 | 397 | * @since 4.0.0 |
401 | 398 | * |
… |
… |
|
420 | 417 | }; |
421 | 418 | |
422 | 419 | /** |
423 | | * @summary Unbinds the events of the editor and window. |
| 420 | * Unbinds the events of the editor and window. |
424 | 421 | * |
425 | 422 | * @since 4.0.0 |
426 | 423 | * |
… |
… |
|
447 | 444 | } ); |
448 | 445 | |
449 | 446 | /** |
450 | | * @summary Adjusts the toolbars heights and positions. |
451 | | * |
452 | | * Adjusts the toolbar heights and positions based on the scroll position on the page, |
| 447 | * Adjusts the toolbars heights and positions based on the scroll position on the page, |
453 | 448 | * the active editor mode and the heights of the editor, admin bar and side bar. |
454 | 449 | * |
455 | 450 | * @since 4.0.0 |
… |
… |
|
764 | 759 | } |
765 | 760 | |
766 | 761 | /** |
767 | | * @summary Resizes the editor and adjusts the toolbars. |
| 762 | * Resizes the editor and adjusts the toolbars. |
768 | 763 | * |
769 | 764 | * @since 4.0.0 |
770 | 765 | * |
… |
… |
|
776 | 771 | } |
777 | 772 | |
778 | 773 | /** |
779 | | * @summary Runs the passed function with 500ms intervals. |
| 774 | * Runs the passed function with 500ms intervals. |
780 | 775 | * |
781 | 776 | * @since 4.0.0 |
782 | 777 | * |
… |
… |
|
791 | 786 | } |
792 | 787 | |
793 | 788 | /** |
794 | | * @summary Runs adjust after 100ms. |
| 789 | * Runs adjust after 100ms. |
795 | 790 | * |
796 | 791 | * @since 4.0.0 |
797 | 792 | * |
… |
… |
|
803 | 798 | } |
804 | 799 | |
805 | 800 | /** |
806 | | * @summary Binds editor expand events on elements. |
| 801 | * Binds editor expand events on elements. |
807 | 802 | * |
808 | 803 | * @since 4.0.0 |
809 | 804 | * |
… |
… |
|
873 | 868 | } |
874 | 869 | |
875 | 870 | /** |
876 | | * @summary Unbinds editor expand events. |
| 871 | * Unbinds editor expand events. |
877 | 872 | * |
878 | 873 | * @since 4.0.0 |
879 | 874 | * |
… |
… |
|
967 | 962 | } ); |
968 | 963 | |
969 | 964 | /** |
970 | | * @summary Handles the distraction free writing of TinyMCE. |
| 965 | * Handles the distraction free writing of TinyMCE. |
971 | 966 | * |
972 | 967 | * @since 4.1.0 |
973 | 968 | * |
… |
… |
|
1017 | 1012 | } ); |
1018 | 1013 | |
1019 | 1014 | /** |
1020 | | * @summary Recalculates the bottom and right position of the editor in the DOM. |
| 1015 | * Recalculates the bottom and right position of the editor in the DOM. |
1021 | 1016 | * |
1022 | 1017 | * @since 4.1.0 |
1023 | 1018 | * |
… |
… |
|
1030 | 1025 | } |
1031 | 1026 | |
1032 | 1027 | /** |
1033 | | * @summary Activates the distraction free writing mode. |
| 1028 | * Activates the distraction free writing mode. |
1034 | 1029 | * |
1035 | 1030 | * @since 4.1.0 |
1036 | 1031 | * |
… |
… |
|
1046 | 1041 | } |
1047 | 1042 | |
1048 | 1043 | /** |
1049 | | * @summary Deactivates the distraction free writing mode. |
| 1044 | * Deactivates the distraction free writing mode. |
1050 | 1045 | * |
1051 | 1046 | * @since 4.1.0 |
1052 | 1047 | * |
… |
… |
|
1064 | 1059 | } |
1065 | 1060 | |
1066 | 1061 | /** |
1067 | | * @summary Returns _isActive. |
| 1062 | * Returns _isActive. |
1068 | 1063 | * |
1069 | 1064 | * @since 4.1.0 |
1070 | 1065 | * |
… |
… |
|
1075 | 1070 | } |
1076 | 1071 | |
1077 | 1072 | /** |
1078 | | * @summary Binds events on the editor for distraction free writing. |
| 1073 | * Binds events on the editor for distraction free writing. |
1079 | 1074 | * |
1080 | 1075 | * @since 4.1.0 |
1081 | 1076 | * |
… |
… |
|
1098 | 1093 | } |
1099 | 1094 | |
1100 | 1095 | /** |
1101 | | * @summary Unbinds events on the editor for distraction free writing. |
| 1096 | * Unbinds events on the editor for distraction free writing. |
1102 | 1097 | * |
1103 | 1098 | * @since 4.1.0 |
1104 | 1099 | * |
… |
… |
|
1121 | 1116 | } |
1122 | 1117 | |
1123 | 1118 | /** |
1124 | | * @summary Binds or unbinds the editor expand events. |
| 1119 | * Binds or unbinds the editor expand events. |
1125 | 1120 | * |
1126 | 1121 | * @since 4.1.0 |
1127 | 1122 | * |
… |
… |
|
1136 | 1131 | } |
1137 | 1132 | |
1138 | 1133 | /** |
1139 | | * @summary Returns the value of _isOn. |
| 1134 | * Returns the value of _isOn. |
1140 | 1135 | * |
1141 | 1136 | * @since 4.1.0 |
1142 | 1137 | * |
… |
… |
|
1147 | 1142 | } |
1148 | 1143 | |
1149 | 1144 | /** |
1150 | | * @summary Fades out all elements except for the editor. |
| 1145 | * Fades out all elements except for the editor. |
1151 | 1146 | * |
1152 | 1147 | * The fading is done based on key presses and mouse movements. |
1153 | 1148 | * Also calls the fadeIn on certain key presses |
… |
… |
|
1290 | 1285 | } |
1291 | 1286 | |
1292 | 1287 | /** |
1293 | | * @summary Fades all elements back in. |
| 1288 | * Fades all elements back in. |
1294 | 1289 | * |
1295 | 1290 | * @since 4.1.0 |
1296 | 1291 | * |
… |
… |
|
1338 | 1333 | } |
1339 | 1334 | |
1340 | 1335 | /** |
1341 | | * @summary Fades in if the focused element based on it position. |
| 1336 | * Fades in if the focused element based on it position. |
1342 | 1337 | * |
1343 | 1338 | * @since 4.1.0 |
1344 | 1339 | * |
… |
… |
|
1360 | 1355 | } |
1361 | 1356 | |
1362 | 1357 | /** |
1363 | | * @summary Fades out the admin bar based on focus on the admin bar. |
| 1358 | * Fades out the admin bar based on focus on the admin bar. |
1364 | 1359 | * |
1365 | 1360 | * @since 4.1.0 |
1366 | 1361 | * |
… |
… |
|
1381 | 1376 | } |
1382 | 1377 | |
1383 | 1378 | /** |
1384 | | * @summary Fades in the admin bar. |
| 1379 | * Fades in the admin bar. |
1385 | 1380 | * |
1386 | 1381 | * @since 4.1.0 |
1387 | 1382 | * |
… |
… |
|
1396 | 1391 | } |
1397 | 1392 | |
1398 | 1393 | /** |
1399 | | * @summary Fades out the edit slug box. |
| 1394 | * Fades out the edit slug box. |
1400 | 1395 | * |
1401 | 1396 | * @since 4.1.0 |
1402 | 1397 | * |
… |
… |
|
1413 | 1408 | } |
1414 | 1409 | |
1415 | 1410 | /** |
1416 | | * @summary Fades in the edit slug box. |
| 1411 | * Fades in the edit slug box. |
1417 | 1412 | * |
1418 | 1413 | * @since 4.1.0 |
1419 | 1414 | * |
… |
… |
|
1430 | 1425 | } |
1431 | 1426 | |
1432 | 1427 | /** |
1433 | | * @summary Triggers the toggle on Alt + Shift + W. |
| 1428 | * Triggers the toggle on Alt + Shift + W. |
1434 | 1429 | * |
1435 | 1430 | * Keycode 87 = w. |
1436 | 1431 | * |
… |
… |
|
1451 | 1446 | } |
1452 | 1447 | |
1453 | 1448 | /** |
1454 | | * @summary Adds the distraction free writing button when setting up TinyMCE. |
| 1449 | * Adds the distraction free writing button when setting up TinyMCE. |
1455 | 1450 | * |
1456 | 1451 | * @since 4.1.0 |
1457 | 1452 | * |
… |
… |
|
1492 | 1487 | } ); |
1493 | 1488 | |
1494 | 1489 | /** |
1495 | | * @summary Binds and unbinds events on the editor. |
| 1490 | * Binds and unbinds events on the editor. |
1496 | 1491 | * |
1497 | 1492 | * @since 4.1.0 |
1498 | 1493 | * |
… |
… |
|
1549 | 1544 | } ); |
1550 | 1545 | |
1551 | 1546 | /** |
1552 | | * @summary Binds events on quicktags init. |
| 1547 | * Binds events on quicktags init. |
1553 | 1548 | * |
1554 | 1549 | * @since 4.1.0 |
1555 | 1550 | * |
-
diff --git src/wp-admin/js/editor.js src/wp-admin/js/editor.js
index 3d6b453ae..6010e8f7f 100644
|
|
window.wp = window.wp || {}; |
4 | 4 | wp.editor = wp.editor || {}; |
5 | 5 | |
6 | 6 | /** |
7 | | * @summary Utility functions for the editor. |
| 7 | * Utility functions for the editor. |
8 | 8 | * |
9 | 9 | * @since 2.5.0 |
10 | 10 | */ |
… |
… |
window.wp = window.wp || {}; |
18 | 18 | $$ = tinymce.$; |
19 | 19 | |
20 | 20 | /** |
21 | | * @summary Handles onclick events for the Visual/Text tabs. |
| 21 | * Handles onclick events for the Visual/Text tabs. |
22 | 22 | * |
23 | 23 | * @since 4.3.0 |
24 | 24 | * |
… |
… |
window.wp = window.wp || {}; |
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
41 | | * @summary Returns the height of the editor toolbar(s) in px. |
| 41 | * Returns the height of the editor toolbar(s) in px. |
42 | 42 | * |
43 | 43 | * @since 3.9.0 |
44 | 44 | * |
… |
… |
window.wp = window.wp || {}; |
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
61 | | * @summary Switches the editor between Visual and Text mode. |
| 61 | * Switches the editor between Visual and Text mode. |
62 | 62 | * |
63 | 63 | * @since 2.5.0 |
64 | 64 | * |
… |
… |
window.wp = window.wp || {}; |
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
187 | | * @summary Checks if a cursor is inside an HTML tag. |
| 187 | * Checks if a cursor is inside an HTML tag. |
188 | 188 | * |
189 | 189 | * In order to prevent breaking HTML tags when selecting text, the cursor |
190 | 190 | * must be moved to either the start or end of the tag. |
… |
… |
window.wp = window.wp || {}; |
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
230 | | * @summary Check if the cursor is inside a shortcode |
| 230 | * Checks if the cursor is inside a shortcode |
231 | 231 | * |
232 | 232 | * If the cursor is inside a shortcode wrapping tag, e.g. `[caption]` it's better to |
233 | 233 | * move the selection marker to before or after the shortcode. |
… |
… |
window.wp = window.wp || {}; |
281 | 281 | } |
282 | 282 | |
283 | 283 | /** |
284 | | * @summary Check if a shortcode has Live Preview enabled for it. |
| 284 | * Checks if a shortcode has Live Preview enabled for it. |
285 | 285 | * |
286 | 286 | * Previewable shortcodes here refers to shortcodes that have Live Preview enabled. |
287 | 287 | * |
… |
… |
window.wp = window.wp || {}; |
305 | 305 | } |
306 | 306 | |
307 | 307 | /** |
308 | | * @summary Get all shortcodes and their positions in the content |
| 308 | * Gets all shortcodes and their positions in the content |
309 | 309 | * |
310 | 310 | * This function returns all the shortcodes that could be found in the textarea content |
311 | 311 | * along with their character positions and boundaries. |
… |
… |
window.wp = window.wp || {}; |
414 | 414 | } |
415 | 415 | |
416 | 416 | /** |
417 | | * @summary Get adjusted selection cursor positions according to HTML tags/shortcodes |
| 417 | * Gets adjusted selection cursor positions according to HTML tags/shortcodes |
418 | 418 | * |
419 | 419 | * Shortcodes and HTML codes are a bit of a special case when selecting, since they may render |
420 | 420 | * content in Visual mode. If we insert selection markers somewhere inside them, it's really possible |
… |
… |
window.wp = window.wp || {}; |
497 | 497 | } |
498 | 498 | |
499 | 499 | /** |
500 | | * @summary Adds text selection markers in the editor textarea. |
| 500 | * Adds text selection markers in the editor textarea. |
501 | 501 | * |
502 | 502 | * Adds selection markers in the content of the editor `textarea`. |
503 | 503 | * The method directly manipulates the `textarea` content, to allow TinyMCE plugins |
… |
… |
window.wp = window.wp || {}; |
547 | 547 | } |
548 | 548 | |
549 | 549 | /** |
550 | | * @summary Focus the selection markers in Visual mode. |
| 550 | * Focuses the selection markers in Visual mode. |
551 | 551 | * |
552 | 552 | * The method checks for existing selection markers inside the editor DOM (Visual mode) |
553 | 553 | * and create a selection between the two nodes using the DOM `createRange` selection API |
… |
… |
window.wp = window.wp || {}; |
586 | 586 | } |
587 | 587 | |
588 | 588 | /** |
589 | | * @summary Remove selection marker and the parent node if it is an empty paragraph. |
| 589 | * Removes selection marker and the parent node if it is an empty paragraph. |
590 | 590 | * |
591 | 591 | * By default TinyMCE wraps loose inline tags in a `<p>`. |
592 | 592 | * When removing selection markers an empty `<p>` may be left behind, remove it. |
… |
… |
window.wp = window.wp || {}; |
605 | 605 | } |
606 | 606 | |
607 | 607 | /** |
608 | | * @summary Scrolls the content to place the selected element in the center of the screen. |
| 608 | * Scrolls the content to place the selected element in the center of the screen. |
609 | 609 | * |
610 | 610 | * Takes an element, that is usually the selection start element, selected in |
611 | 611 | * `focusHTMLBookmarkInVisualEditor()` and scrolls the screen so the element appears roughly |
… |
… |
window.wp = window.wp || {}; |
680 | 680 | } |
681 | 681 | |
682 | 682 | /** |
683 | | * @summary Finds the current selection position in the Visual editor. |
| 683 | * Finds the current selection position in the Visual editor. |
684 | 684 | * |
685 | 685 | * Find the current selection in the Visual editor by inserting marker elements at the start |
686 | 686 | * and end of the selection. |
… |
… |
window.wp = window.wp || {}; |
847 | 847 | } |
848 | 848 | |
849 | 849 | /** |
850 | | * @summary Selects text in the TinyMCE `textarea`. |
| 850 | * Selects text in the TinyMCE `textarea`. |
851 | 851 | * |
852 | 852 | * Selects the text in TinyMCE's textarea that's between `selection.start` and `selection.end`. |
853 | 853 | * |
… |
… |
window.wp = window.wp || {}; |
888 | 888 | } ); |
889 | 889 | |
890 | 890 | /** |
891 | | * @summary Replaces <p> tags with two line breaks. "Opposite" of wpautop(). |
| 891 | * Replaces <p> tags with two line breaks. "Opposite" of wpautop(). |
892 | 892 | * |
893 | 893 | * Replaces <p> tags with two line breaks except where the <p> has attributes. |
894 | 894 | * Unifies whitespace. |
… |
… |
window.wp = window.wp || {}; |
1027 | 1027 | } |
1028 | 1028 | |
1029 | 1029 | /** |
1030 | | * @summary Replaces two line breaks with a paragraph tag and one line break with a <br>. |
| 1030 | * Replaces two line breaks with a paragraph tag and one line break with a <br>. |
1031 | 1031 | * |
1032 | 1032 | * Similar to `wpautop()` in formatting.php. |
1033 | 1033 | * |
… |
… |
window.wp = window.wp || {}; |
1156 | 1156 | } |
1157 | 1157 | |
1158 | 1158 | /** |
1159 | | * @summary Fires custom jQuery events `beforePreWpautop` and `afterPreWpautop` when jQuery is available. |
| 1159 | * Fires custom jQuery events `beforePreWpautop` and `afterPreWpautop` when jQuery is available. |
1160 | 1160 | * |
1161 | 1161 | * @since 2.9.0 |
1162 | 1162 | * |
… |
… |
window.wp = window.wp || {}; |
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | /** |
1185 | | * @summary Fires custom jQuery events `beforeWpautop` and `afterWpautop` when jQuery is available. |
| 1185 | * Fires custom jQuery events `beforeWpautop` and `afterWpautop` when jQuery is available. |
1186 | 1186 | * |
1187 | 1187 | * @since 2.9.0 |
1188 | 1188 | * |
-
diff --git src/wp-admin/js/image-edit.js src/wp-admin/js/image-edit.js
index a570c5429..8cb4aa956 100644
|
|
|
1 | 1 | /* global imageEditL10n, ajaxurl, confirm */ |
2 | 2 | /** |
3 | | * @summary The functions necessary for editing images. |
| 3 | * The functions necessary for editing images. |
4 | 4 | * |
5 | | * @since 2.9.0 |
| 5 | * @since 2.9.0 |
6 | 6 | */ |
7 | 7 | |
8 | 8 | (function($) { |
… |
… |
|
19 | 19 | _view : false, |
20 | 20 | |
21 | 21 | /** |
22 | | * @summary Converts a value to an integer. |
| 22 | * Converts a value to an integer. |
23 | 23 | * |
24 | 24 | * @memberof imageEdit |
25 | 25 | * @since 2.9.0 |
… |
… |
|
37 | 37 | }, |
38 | 38 | |
39 | 39 | /** |
40 | | * @summary Adds the disabled attribute and class to a single form element |
41 | | * or a field set. |
| 40 | * Adds the disabled attribute and class to a single form element or a field set. |
42 | 41 | * |
43 | 42 | * @memberof imageEdit |
44 | 43 | * @since 2.9.0 |
… |
… |
|
67 | 66 | }, |
68 | 67 | |
69 | 68 | /** |
70 | | * @summary Initializes the image editor. |
| 69 | * Initializes the image editor. |
71 | 70 | * |
72 | 71 | * @memberof imageEdit |
73 | 72 | * @since 2.9.0 |
… |
… |
|
110 | 109 | }, |
111 | 110 | |
112 | 111 | /** |
113 | | * @summary Toggles the wait/load icon in the editor. |
| 112 | * Toggles the wait/load icon in the editor. |
114 | 113 | * |
115 | 114 | * @memberof imageEdit |
116 | 115 | * @since 2.9.0 |
… |
… |
|
131 | 130 | }, |
132 | 131 | |
133 | 132 | /** |
134 | | * @summary Shows or hides the image edit help box. |
| 133 | * Shows or hides the image edit help box. |
135 | 134 | * |
136 | 135 | * @memberof imageEdit |
137 | 136 | * @since 2.9.0 |
… |
… |
|
150 | 149 | }, |
151 | 150 | |
152 | 151 | /** |
153 | | * @summary Gets the value from the image edit target. |
| 152 | * Gets the value from the image edit target. |
154 | 153 | * |
155 | 154 | * The image edit target contains the image sizes where the (possible) changes |
156 | 155 | * have to be applied to. |
… |
… |
|
168 | 167 | }, |
169 | 168 | |
170 | 169 | /** |
171 | | * @summary Recalculates the height or width and keeps the original aspect ratio. |
| 170 | * Recalculates the height or width and keeps the original aspect ratio. |
172 | 171 | * |
173 | 172 | * If the original image size is exceeded a red exclamation mark is shown. |
174 | 173 | * |
… |
… |
|
206 | 205 | }, |
207 | 206 | |
208 | 207 | /** |
209 | | * @summary Gets the selected aspect ratio. |
| 208 | * Gets the selected aspect ratio. |
210 | 209 | * |
211 | 210 | * @memberof imageEdit |
212 | 211 | * @since 2.9.0 |
… |
… |
|
232 | 231 | }, |
233 | 232 | |
234 | 233 | /** |
235 | | * @summary Removes the last action from the image edit history |
| 234 | * Removes the last action from the image edit history. |
236 | 235 | * The history consist of (edit) actions performed on the image. |
237 | 236 | * |
238 | 237 | * @memberof imageEdit |
… |
… |
|
296 | 295 | return ''; |
297 | 296 | }, |
298 | 297 | /** |
299 | | * @summary Binds the necessary events to the image. |
| 298 | * Binds the necessary events to the image. |
300 | 299 | * |
301 | 300 | * When the image source is reloaded the image will be reloaded. |
302 | 301 | * |
… |
… |
|
372 | 371 | .attr('src', ajaxurl + '?' + $.param(data)); |
373 | 372 | }, |
374 | 373 | /** |
375 | | * @summary Performs an image edit action. |
| 374 | * Performs an image edit action. |
376 | 375 | * |
377 | 376 | * @memberof imageEdit |
378 | 377 | * @since 2.9.0 |
… |
… |
|
439 | 438 | }, |
440 | 439 | |
441 | 440 | /** |
442 | | * @summary Stores the changes that are made to the image. |
| 441 | * Stores the changes that are made to the image. |
443 | 442 | * |
444 | 443 | * @memberof imageEdit |
445 | 444 | * @since 2.9.0 |
… |
… |
|
504 | 503 | }, |
505 | 504 | |
506 | 505 | /** |
507 | | * @summary Creates the image edit window. |
| 506 | * Creates the image edit window. |
508 | 507 | * |
509 | 508 | * @memberof imageEdit |
510 | 509 | * @since 2.9.0 |
… |
… |
|
561 | 560 | }, |
562 | 561 | |
563 | 562 | /** |
564 | | * @summary Initializes the cropping tool and sets a default cropping selection. |
| 563 | * Initializes the cropping tool and sets a default cropping selection. |
565 | 564 | * |
566 | 565 | * @memberof imageEdit |
567 | 566 | * @since 2.9.0 |
… |
… |
|
586 | 585 | }, |
587 | 586 | |
588 | 587 | /** |
589 | | * @summary Initializes the cropping tool. |
| 588 | * Initializes the cropping tool. |
590 | 589 | * |
591 | 590 | * @memberof imageEdit |
592 | 591 | * @since 2.9.0 |
… |
… |
|
612 | 611 | minHeight: 3, |
613 | 612 | |
614 | 613 | /** |
615 | | * @summary Sets the CSS styles and binds events for locking the aspect ratio. |
| 614 | * Sets the CSS styles and binds events for locking the aspect ratio. |
616 | 615 | * |
617 | 616 | * @ignore |
618 | 617 | * |
… |
… |
|
625 | 624 | $img.next().css( 'position', 'absolute' ) |
626 | 625 | .nextAll( '.imgareaselect-outer' ).css( 'position', 'absolute' ); |
627 | 626 | /** |
628 | | * @summary Binds mouse down event to the cropping container. |
| 627 | * Binds mouse down event to the cropping container. |
629 | 628 | * |
630 | 629 | * @returns {void} |
631 | 630 | */ |
… |
… |
|
645 | 644 | }, |
646 | 645 | |
647 | 646 | /** |
648 | | * @summary Event triggered when starting a selection. |
| 647 | * Event triggered when starting a selection. |
649 | 648 | * |
650 | 649 | * @ignore |
651 | 650 | * |
… |
… |
|
655 | 654 | imageEdit.setDisabled($('#imgedit-crop-sel-' + postid), 1); |
656 | 655 | }, |
657 | 656 | /** |
658 | | * @summary Event triggered when the selection is ended. |
| 657 | * Event triggered when the selection is ended. |
659 | 658 | * |
660 | 659 | * @ignore |
661 | 660 | * |
… |
… |
|
669 | 668 | }, |
670 | 669 | |
671 | 670 | /** |
672 | | * @summary Event triggered when the selection changes. |
| 671 | * Event triggered when the selection changes. |
673 | 672 | * |
674 | 673 | * @ignore |
675 | 674 | * |
… |
… |
|
687 | 686 | }, |
688 | 687 | |
689 | 688 | /** |
690 | | * @summary Stores the current crop selection. |
| 689 | * Stores the current crop selection. |
691 | 690 | * |
692 | 691 | * @memberof imageEdit |
693 | 692 | * @since 2.9.0 |
… |
… |
|
718 | 717 | |
719 | 718 | |
720 | 719 | /** |
721 | | * @summary Closes the image editor. |
| 720 | * Closes the image editor. |
722 | 721 | * |
723 | 722 | * @memberof imageEdit |
724 | 723 | * @since 2.9.0 |
… |
… |
|
759 | 758 | }, |
760 | 759 | |
761 | 760 | /** |
762 | | * @summary Checks if the image edit history is saved. |
| 761 | * Checks if the image edit history is saved. |
763 | 762 | * |
764 | 763 | * @memberof imageEdit |
765 | 764 | * @since 2.9.0 |
… |
… |
|
783 | 782 | }, |
784 | 783 | |
785 | 784 | /** |
786 | | * @summary Adds an image edit action to the history. |
| 785 | * Adds an image edit action to the history. |
787 | 786 | * |
788 | 787 | * @memberof imageEdit |
789 | 788 | * @since 2.9.0 |
… |
… |
|
816 | 815 | }, |
817 | 816 | |
818 | 817 | /** |
819 | | * @summary Rotates the image. |
| 818 | * Rotates the image. |
820 | 819 | * |
821 | 820 | * @memberof imageEdit |
822 | 821 | * @since 2.9.0 |
… |
… |
|
837 | 836 | }, |
838 | 837 | |
839 | 838 | /** |
840 | | * @summary Flips the image. |
| 839 | * Flips the image. |
841 | 840 | * |
842 | 841 | * @memberof imageEdit |
843 | 842 | * @since 2.9.0 |
… |
… |
|
858 | 857 | }, |
859 | 858 | |
860 | 859 | /** |
861 | | * @summary Crops the image. |
| 860 | * Crops the image. |
862 | 861 | * |
863 | 862 | * @memberof imageEdit |
864 | 863 | * @since 2.9.0 |
… |
… |
|
887 | 886 | }, |
888 | 887 | |
889 | 888 | /** |
890 | | * @summary Undoes an image edit action. |
| 889 | * Undoes an image edit action. |
891 | 890 | * |
892 | 891 | * @memberof imageEdit |
893 | 892 | * @since 2.9.0 |
… |
… |
|
950 | 949 | }, |
951 | 950 | |
952 | 951 | /** |
953 | | * @summary Sets the selection for the height and width in pixels. |
| 952 | * Sets the selection for the height and width in pixels. |
954 | 953 | * |
955 | 954 | * @memberof imageEdit |
956 | 955 | * @since 2.9.0 |
-
diff --git src/wp-admin/js/inline-edit-post.js src/wp-admin/js/inline-edit-post.js
index a5b052c25..1839ebc39 100644
|
|
var inlineEditPost; |
26 | 26 | inlineEditPost = { |
27 | 27 | |
28 | 28 | /** |
29 | | * @summary Initializes the inline and bulk post editor. |
| 29 | * Initializes the inline and bulk post editor. |
30 | 30 | * |
31 | 31 | * Binds event handlers to the escape key to close the inline editor |
32 | 32 | * and to the save and close buttons. Changes DOM to be ready for inline |
… |
… |
var inlineEditPost; |
45 | 45 | t.what = '#post-'; |
46 | 46 | |
47 | 47 | /** |
48 | | * @summary Bind escape key to revert the changes and close the quick editor. |
| 48 | * Binds the escape key to revert the changes and close the quick editor. |
49 | 49 | * |
50 | 50 | * @returns {boolean} The result of revert. |
51 | 51 | */ |
… |
… |
var inlineEditPost; |
57 | 57 | }); |
58 | 58 | |
59 | 59 | /** |
60 | | * @summary Bind escape key to revert the changes and close the bulk editor. |
| 60 | * Binds the escape key to revert the changes and close the bulk editor. |
61 | 61 | * |
62 | 62 | * @returns {boolean} The result of revert. |
63 | 63 | */ |
… |
… |
var inlineEditPost; |
69 | 69 | }); |
70 | 70 | |
71 | 71 | /** |
72 | | * @summary Revert changes and close the quick editor if the cancel button is clicked. |
| 72 | * Reverts changes and close the quick editor if the cancel button is clicked. |
73 | 73 | * |
74 | 74 | * @returns {boolean} The result of revert. |
75 | 75 | */ |
… |
… |
var inlineEditPost; |
78 | 78 | }); |
79 | 79 | |
80 | 80 | /** |
81 | | * @summary Save changes in the quick editor if the save(named: update) button is clicked. |
| 81 | * Saves changes in the quick editor if the save(named: update) button is clicked. |
82 | 82 | * |
83 | 83 | * @returns {boolean} The result of save. |
84 | 84 | */ |
… |
… |
var inlineEditPost; |
87 | 87 | }); |
88 | 88 | |
89 | 89 | /** |
90 | | * @summary If enter is pressed, and the target is not the cancel button, save the post. |
| 90 | * If enter is pressed, and the target is not the cancel button, save the post. |
91 | 91 | * |
92 | 92 | * @returns {boolean} The result of save. |
93 | 93 | */ |
… |
… |
var inlineEditPost; |
98 | 98 | }); |
99 | 99 | |
100 | 100 | /** |
101 | | * @summary Revert changes and close the bulk editor if the cancel button is clicked. |
| 101 | * Reverts changes and close the bulk editor if the cancel button is clicked. |
102 | 102 | * |
103 | 103 | * @returns {boolean} The result of revert. |
104 | 104 | */ |
… |
… |
var inlineEditPost; |
107 | 107 | }); |
108 | 108 | |
109 | 109 | /** |
110 | | * @summary Disables the password input field when the private post checkbox is checked. |
| 110 | * Disables the password input field when the private post checkbox is checked. |
111 | 111 | */ |
112 | 112 | $('#inline-edit .inline-edit-private input[value="private"]').click( function(){ |
113 | 113 | var pw = $('input.inline-edit-password-input'); |
… |
… |
var inlineEditPost; |
119 | 119 | }); |
120 | 120 | |
121 | 121 | /** |
122 | | * @summary Bind click event to the .editinline link which opens the quick editor. |
| 122 | * Binds click event to the .editinline link which opens the quick editor. |
123 | 123 | */ |
124 | 124 | $('#the-list').on( 'click', 'a.editinline', function( e ) { |
125 | 125 | e.preventDefault(); |
… |
… |
var inlineEditPost; |
135 | 135 | $('select[name="_status"] option[value="future"]', bulkRow).remove(); |
136 | 136 | |
137 | 137 | /** |
138 | | * @summary Adds onclick events to the apply buttons. |
| 138 | * Adds onclick events to the apply buttons. |
139 | 139 | */ |
140 | 140 | $('#doaction, #doaction2').click(function(e){ |
141 | 141 | var n; |
… |
… |
var inlineEditPost; |
153 | 153 | }, |
154 | 154 | |
155 | 155 | /** |
156 | | * @summary Toggles the quick edit window. |
157 | | * |
158 | | * Hides the window when it's active and shows the window when inactive. |
| 156 | * Toggles the quick edit window, hiding it when it's active and showing it when inactive. |
159 | 157 | * |
160 | 158 | * @memberof inlineEditPost |
161 | 159 | * @since 2.7.0 |
… |
… |
var inlineEditPost; |
168 | 166 | }, |
169 | 167 | |
170 | 168 | /** |
171 | | * @summary Creates the bulk editor row to edit multiple posts at once. |
| 169 | * Creates the bulk editor row to edit multiple posts at once. |
172 | 170 | * |
173 | 171 | * @memberof inlineEditPost |
174 | 172 | * @since 2.7.0 |
… |
… |
var inlineEditPost; |
184 | 182 | $('#bulk-edit').addClass('inline-editor').show(); |
185 | 183 | |
186 | 184 | /** |
187 | | * @summary Create a HTML div with the title and a delete link(cross-icon) for each selected post. |
188 | | * |
189 | 185 | * Get the selected posts based on the checked checkboxes in the post table. |
190 | 186 | * Create a HTML div with the title and a link(delete-icon) for each selected post. |
191 | 187 | */ |
… |
… |
var inlineEditPost; |
208 | 204 | // Add onclick events to the delete-icons in the bulk editors the post title list. |
209 | 205 | $('#bulk-titles').html(te); |
210 | 206 | /** |
211 | | * @summary Binds on click events to the checkboxes before the posts in the table. |
| 207 | * Binds on click events to the checkboxes before the posts in the table. |
212 | 208 | * |
213 | 209 | * @listens click |
214 | 210 | */ |
… |
… |
var inlineEditPost; |
240 | 236 | }, |
241 | 237 | |
242 | 238 | /** |
243 | | * @summary Creates a quick edit window for the post that has been clicked. |
| 239 | * Creates a quick edit window for the post that has been clicked. |
244 | 240 | * |
245 | 241 | * @memberof inlineEditPost |
246 | 242 | * @since 2.7.0 |
… |
… |
var inlineEditPost; |
283 | 279 | val = $('.'+fields[f], rowData); |
284 | 280 | |
285 | 281 | /** |
286 | | * @summary Replaces the image for a Twemoji(Twitter emoji) with it's alternate text. |
| 282 | * Replaces the image for a Twemoji(Twitter emoji) with it's alternate text. |
287 | 283 | * |
288 | 284 | * @returns Alternate text from the image. |
289 | 285 | */ |
… |
… |
var inlineEditPost; |
303 | 299 | } |
304 | 300 | |
305 | 301 | /** |
306 | | * @summary Creates the select boxes for the categories. |
| 302 | * Creates the select boxes for the categories. |
307 | 303 | */ |
308 | 304 | $('.post_category', rowData).each(function(){ |
309 | 305 | var taxname, |
… |
… |
var inlineEditPost; |
316 | 312 | }); |
317 | 313 | |
318 | 314 | /** |
319 | | * @summary Gets all the taxonomies for live auto-fill suggestions. |
320 | | * When typing the name of a tag. |
| 315 | * Gets all the taxonomies for live auto-fill suggestions when typing the name of a tag. |
321 | 316 | */ |
322 | 317 | $('.tags_input', rowData).each(function(){ |
323 | 318 | var terms = $(this), |
… |
… |
var inlineEditPost; |
380 | 375 | }, |
381 | 376 | |
382 | 377 | /** |
383 | | * @summary Saves the changes made in the quick edit window to the post. |
| 378 | * Saves the changes made in the quick edit window to the post. |
384 | 379 | * AJAX saving is only for Quick Edit and not for bulk edit. |
385 | 380 | * |
386 | 381 | * @since 2.7.0 |
… |
… |
var inlineEditPost; |
446 | 441 | }, |
447 | 442 | |
448 | 443 | /** |
449 | | * @summary Hides and empties the Quick Edit and/or Bulk Edit windows. |
| 444 | * Hides and empties the Quick Edit and/or Bulk Edit windows. |
450 | 445 | * |
451 | 446 | * @memberof inlineEditPost |
452 | 447 | * @since 2.7.0 |
… |
… |
var inlineEditPost; |
487 | 482 | }, |
488 | 483 | |
489 | 484 | /** |
490 | | * @summary Gets the id for a the post that you want to quick edit from the row |
491 | | * in the quick edit table. |
| 485 | * Gets the id for a the post that you want to quick edit from the row in the quick edit table. |
492 | 486 | * |
493 | 487 | * @memberof inlineEditPost |
494 | 488 | * @since 2.7.0 |
-
diff --git src/wp-admin/js/inline-edit-tax.js src/wp-admin/js/inline-edit-tax.js
index 797001780..47240f535 100644
|
|
var inlineEditTax; |
21 | 21 | inlineEditTax = { |
22 | 22 | |
23 | 23 | /** |
24 | | * @summary Initializes the inline taxonomy editor. |
25 | | * |
26 | | * Adds event handlers to be able to quick edit. |
| 24 | * Initializes the inline taxonomy editor by adding event handlers to be able to quick edit. |
27 | 25 | * |
28 | 26 | * @since 2.7.0 |
29 | 27 | * |
… |
… |
inlineEditTax = { |
42 | 40 | return false; |
43 | 41 | }); |
44 | 42 | |
45 | | /* |
46 | | * @summary Cancels inline editing when pressing escape inside the inline editor. |
| 43 | /** |
| 44 | * Cancels inline editing when pressing escape inside the inline editor. |
47 | 45 | * |
48 | 46 | * @param {Object} e The keyup event that has been triggered. |
49 | 47 | */ |
… |
… |
inlineEditTax = { |
55 | 53 | }); |
56 | 54 | |
57 | 55 | /** |
58 | | * @summary Cancels inline editing when clicking the cancel button. |
| 56 | * Cancels inline editing when clicking the cancel button. |
59 | 57 | */ |
60 | 58 | $( '.cancel', row ).click( function() { |
61 | 59 | return inlineEditTax.revert(); |
62 | 60 | }); |
63 | 61 | |
64 | 62 | /** |
65 | | * @summary Saves the inline edits when clicking the save button. |
| 63 | * Saves the inline edits when clicking the save button. |
66 | 64 | */ |
67 | 65 | $( '.save', row ).click( function() { |
68 | 66 | return inlineEditTax.save(this); |
69 | 67 | }); |
70 | 68 | |
71 | 69 | /** |
72 | | * @summary Saves the inline edits when pressing enter inside the inline editor. |
| 70 | * Saves the inline edits when pressing enter inside the inline editor. |
73 | 71 | */ |
74 | 72 | $( 'input, select', row ).keydown( function( e ) { |
75 | 73 | // 13 = [enter] |
… |
… |
inlineEditTax = { |
79 | 77 | }); |
80 | 78 | |
81 | 79 | /** |
82 | | * @summary Saves the inline edits on submitting the inline edit form. |
| 80 | * Saves the inline edits on submitting the inline edit form. |
83 | 81 | */ |
84 | 82 | $( '#posts-filter input[type="submit"]' ).mousedown( function() { |
85 | 83 | t.revert(); |
… |
… |
inlineEditTax = { |
149 | 147 | }, |
150 | 148 | |
151 | 149 | /** |
152 | | * @summary Saves the quick edit data. |
153 | | * |
154 | | * Saves the quick edit data to the server and replaces the table row with the |
155 | | * HTML retrieved from the server. |
| 150 | * Saves the quick edit data to the server and replaces the table row with the HTML retrieved from the server. |
156 | 151 | * |
157 | 152 | * @since 2.7.0 |
158 | 153 | * |
… |
… |
inlineEditTax = { |
187 | 182 | // Do the ajax request to save the data to the server. |
188 | 183 | $.post( ajaxurl, params, |
189 | 184 | /** |
190 | | * @summary Handles the response from the server. |
191 | | * |
192 | | * Handles the response from the server, replaces the table row with the response |
193 | | * from the server. |
| 185 | * Handles the response from the server, replaces the table row with the response from the server. |
194 | 186 | * |
195 | 187 | * @param {string} r The string with which to replace the table row. |
196 | 188 | */ |
-
diff --git src/wp-admin/js/media.js src/wp-admin/js/media.js
index 4bd91d5b7..22f6e7105 100644
|
|
|
1 | 1 | /* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings, showNotice */ |
2 | 2 | |
3 | 3 | /** |
4 | | * @summary Creates a dialog containing posts that can have a particular media attached to it. |
| 4 | * Creates a dialog containing posts that can have a particular media attached to it. |
5 | 5 | * |
6 | 6 | * @since 2.7.0 |
7 | 7 | * |
… |
… |
var findPosts; |
14 | 14 | ( function( $ ){ |
15 | 15 | findPosts = { |
16 | 16 | /** |
17 | | * @summary Opens a dialog to attach media to a post. |
18 | | * |
19 | 17 | * Adds an overlay prior to retrieving a list of posts to attach the media to. |
20 | 18 | * |
21 | 19 | * @since 2.7.0 |
… |
… |
var findPosts; |
58 | 56 | }, |
59 | 57 | |
60 | 58 | /** |
61 | | * @summary Clears the found posts lists before hiding the attach media dialog. |
| 59 | * Clears the found posts lists before hiding the attach media dialog. |
62 | 60 | * |
63 | 61 | * @since 2.7.0 |
64 | 62 | * |
… |
… |
var findPosts; |
73 | 71 | }, |
74 | 72 | |
75 | 73 | /** |
76 | | * @summary Binds a click event listener to the overlay which closes the attach media dialog. |
| 74 | * Binds a click event listener to the overlay which closes the attach media dialog. |
77 | 75 | * |
78 | 76 | * @since 3.5.0 |
79 | 77 | * |
… |
… |
var findPosts; |
88 | 86 | }, |
89 | 87 | |
90 | 88 | /** |
91 | | * @summary Retrieves and displays posts based on the search term. |
| 89 | * Retrieves and displays posts based on the search term. |
92 | 90 | * |
93 | 91 | * Sends a post request to the admin_ajax.php, requesting posts based on the search term provided by the user. |
94 | 92 | * Defaults to all posts if no search term is provided. |
… |
… |
var findPosts; |
132 | 130 | }; |
133 | 131 | |
134 | 132 | /** |
135 | | * @summary Initializes the file once the DOM is fully loaded and attaches events to the various form elements. |
| 133 | * Initializes the file once the DOM is fully loaded and attaches events to the various form elements. |
136 | 134 | * |
137 | 135 | * @returns {void} |
138 | 136 | */ |
… |
… |
var findPosts; |
192 | 190 | }); |
193 | 191 | |
194 | 192 | /** |
195 | | * @summary Enables clicking on the entire table row. |
| 193 | * Enables clicking on the entire table row. |
196 | 194 | * |
197 | 195 | * @returns {void} |
198 | 196 | */ |
-
diff --git src/wp-admin/js/post.js src/wp-admin/js/post.js
index f8c2baf4f..049e21354 100644
|
|
|
2 | 2 | /* global theList:true, theExtraList:true, getUserSetting, setUserSetting, commentReply */ |
3 | 3 | |
4 | 4 | /** |
5 | | * Contains all dynamic functionality needed on post and term pages. |
6 | | * |
7 | | * @file Control page and term functionality. |
| 5 | * @file Contains all dynamic functionality needed on post and term pages. |
8 | 6 | */ |
9 | 7 | |
10 | 8 | var commentsBox, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint, makeSlugeditClickable, editPermalink; |
… |
… |
jQuery(document).ready( function($) { |
936 | 934 | /** |
937 | 935 | * Handle the editing of the post_name. Create the required HTML elements and update the changes via AJAX. |
938 | 936 | * |
939 | | * @summary Permalink aka slug aka post_name editing |
940 | | * |
941 | 937 | * @global |
942 | 938 | * |
943 | 939 | * @returns void |
… |
… |
jQuery(document).ready( function($) { |
1041 | 1037 | }); |
1042 | 1038 | |
1043 | 1039 | /** |
1044 | | * Add screen reader text to the title prompt when needed. |
1045 | | * |
1046 | | * @summary Title screen reader text handler. |
| 1040 | * Adds screen reader text to the title prompt when needed. |
1047 | 1041 | * |
1048 | 1042 | * @param {string} id Optional. HTML ID to add the screen reader helper text to. |
1049 | 1043 | * |
-
diff --git src/wp-admin/js/postbox.js src/wp-admin/js/postbox.js
index 97d8ab6e4..f3cc88465 100644
|
|
|
2 | 2 | * Contains the postboxes logic, opening and closing postboxes, reordering and saving |
3 | 3 | * the state and ordering to the database. |
4 | 4 | * |
5 | | * @summary Contains postboxes logic |
6 | | * |
7 | 5 | * @since 2.5.0 |
8 | 6 | * @requires jQuery |
9 | 7 | */ |
… |
… |
var postboxes; |
28 | 26 | postboxes = { |
29 | 27 | |
30 | 28 | /** |
31 | | * @summary Handles a click on either the postbox heading or the postbox open/close icon. |
| 29 | * Handles a click on either the postbox heading or the postbox open/close icon. |
32 | 30 | * |
33 | 31 | * Opens or closes the postbox. Expects `this` to equal the clicked element. |
34 | 32 | * Calls postboxes.pbshow if the postbox has been opened, calls postboxes.pbhide |
… |
… |
var postboxes; |
76 | 74 | } |
77 | 75 | |
78 | 76 | /** |
79 | | * @summary Fires when a postbox has been opened or closed. |
| 77 | * Fires when a postbox has been opened or closed. |
80 | 78 | * |
81 | 79 | * Contains a jQuery object with the relevant postbox element. |
82 | 80 | * |
… |
… |
var postboxes; |
117 | 115 | }); |
118 | 116 | |
119 | 117 | /** |
120 | | * @summary Hides a postbox. |
121 | | * |
122 | 118 | * Event handler for the postbox dismiss button. After clicking the button |
123 | 119 | * the postbox will be hidden. |
124 | 120 | * |
… |
… |
var postboxes; |
133 | 129 | }); |
134 | 130 | |
135 | 131 | /** |
136 | | * @summary Hides the postbox element |
137 | | * |
138 | 132 | * Event handler for the screen options checkboxes. When a checkbox is |
139 | 133 | * clicked this function will hide or show the relevant postboxes. |
140 | 134 | * |
… |
… |
var postboxes; |
173 | 167 | }); |
174 | 168 | |
175 | 169 | /** |
176 | | * @summary Changes the amount of columns based on the layout preferences. |
| 170 | * Changes the amount of columns based on the layout preferences. |
177 | 171 | * |
178 | 172 | * @since 2.8.0 |
179 | 173 | * |
… |
… |
var postboxes; |
190 | 184 | }, |
191 | 185 | |
192 | 186 | /** |
193 | | * @summary Initializes all the postboxes, mainly their sortable behaviour. |
| 187 | * Initializes all the postboxes, mainly their sortable behaviour. |
194 | 188 | * |
195 | 189 | * @since 2.7.0 |
196 | 190 | * @memberof postboxes |
… |
… |
var postboxes; |
269 | 263 | }, |
270 | 264 | |
271 | 265 | /** |
272 | | * @summary Saves the state of the postboxes to the server. |
273 | | * |
274 | 266 | * Saves the state of the postboxes to the server. It sends two lists, one with |
275 | 267 | * all the closed postboxes, one with all the hidden postboxes. |
276 | 268 | * |
… |
… |
var postboxes; |
301 | 293 | }, |
302 | 294 | |
303 | 295 | /** |
304 | | * @summary Saves the order of the postboxes to the server. |
305 | | * |
306 | 296 | * Saves the order of the postboxes to the server. Sends a list of all postboxes |
307 | 297 | * inside a sortable area to the server. |
308 | 298 | * |
… |
… |
var postboxes; |
330 | 320 | }, |
331 | 321 | |
332 | 322 | /** |
333 | | * @summary Marks empty postbox areas. |
| 323 | * Marks empty postbox areas. |
334 | 324 | * |
335 | 325 | * Adds a message to empty sortable areas on the dashboard page. Also adds a |
336 | 326 | * border around the side area on the post edit screen if there are no postboxes |
… |
… |
var postboxes; |
366 | 356 | }, |
367 | 357 | |
368 | 358 | /** |
369 | | * @summary Changes the amount of columns on the post edit page. |
| 359 | * Changes the amount of columns on the post edit page. |
370 | 360 | * |
371 | 361 | * @since 3.3.0 |
372 | 362 | * @memberof postboxes |
… |
… |
var postboxes; |
395 | 385 | }, |
396 | 386 | |
397 | 387 | /** |
398 | | * @summary Changes the amount of columns the postboxes are in based on the |
399 | | * current orientation of the browser. |
| 388 | * Changes the amount of columns the postboxes are in based on the current orientation of the browser. |
400 | 389 | * |
401 | 390 | * @since 3.3.0 |
402 | 391 | * @memberof postboxes |
-
diff --git src/wp-admin/js/tags.js src/wp-admin/js/tags.js
index c35efaa17..dc5e421c6 100644
|
|
|
1 | 1 | /* global ajaxurl, wpAjax, tagsl10n, showNotice, validateForm */ |
2 | 2 | /** |
3 | | * Contains logic for both adding and deleting tags. For deleting tags it makes a request |
4 | | * to the server to delete the tag. For adding tags it makes a request to the server to |
5 | | * add the tag. |
| 3 | * Contains logic for deleting and adding tags. |
6 | 4 | * |
7 | | * @summary Contains logic for deleting and adding tags |
| 5 | * For deleting tags it makes a request to the server to delete the tag. |
| 6 | * For adding tags it makes a request to the server to add the tag. |
8 | 7 | */ |
9 | 8 | |
10 | 9 | jQuery(document).ready(function($) { |
11 | 10 | |
12 | 11 | /** |
13 | | * @summary Adds an event handler to the delete term link on the term overview page. |
14 | | * |
15 | 12 | * Adds an event handler to the delete term link on the term overview page. |
16 | 13 | * Cancels default event handling and event bubbling. |
17 | 14 | * |
… |
… |
jQuery(document).ready(function($) { |
29 | 26 | data = t.attr('href').replace(/[^?]*\?/, '').replace(/action=delete/, 'action=delete-tag'); |
30 | 27 | |
31 | 28 | /** |
32 | | * @summary Makes a request to the server to delete the term that |
33 | | * corresponds to the delete term button. |
| 29 | * Makes a request to the server to delete the term that corresponds to the delete term button. |
34 | 30 | * |
35 | 31 | * @param {string} r The response from the server. |
36 | 32 | * |
… |
… |
jQuery(document).ready(function($) { |
42 | 38 | tr.fadeOut('normal', function(){ tr.remove(); }); |
43 | 39 | |
44 | 40 | /** |
45 | | * @summary Remove the term from the parent box and the tag cloud |
| 41 | * Removes the term from the parent box and the tag cloud. |
46 | 42 | * |
47 | 43 | * `data.match(/tag_ID=(\d+)/)[1]` matches the term id from the data variable. |
48 | 44 | * This term id is then used to select the relevant HTML elements: |
… |
… |
jQuery(document).ready(function($) { |
87 | 83 | }); |
88 | 84 | |
89 | 85 | /** |
90 | | * @summary Adds an event handler tot he form submit on the term overview page. |
| 86 | * Adds an event handler to the form submit on the term overview page. |
91 | 87 | * |
92 | 88 | * Cancels default event handling and event bubbling. |
93 | 89 | * |
-
diff --git src/wp-admin/js/word-count.js src/wp-admin/js/word-count.js
index 6b319ccf2..66a53c459 100644
|
|
|
1 | 1 | /** |
2 | 2 | * Word or character counting functionality. Count words or characters in a provided text string. |
3 | 3 | * |
4 | | * @summary Count words or characters in a text. |
5 | | * |
6 | 4 | * @namespace wp.utils |
7 | 5 | * @since 2.6.0 |
8 | 6 | */ |
… |
… |
|
143 | 141 | /** |
144 | 142 | * Counts the number of words (or other specified type) in the specified text. |
145 | 143 | * |
146 | | * @summary Count the number of elements in a text. |
147 | | * |
148 | 144 | * @since 2.6.0 |
149 | 145 | * @memberof wp.utils.wordcounter |
150 | 146 | * |
-
diff --git src/wp-content/themes/twentyfifteen/js/functions.js src/wp-content/themes/twentyfifteen/js/functions.js
index 2da5cbc34..b9dddc85b 100644
|
|
|
77 | 77 | } )(); |
78 | 78 | |
79 | 79 | /** |
80 | | * @summary Add or remove ARIA attributes. |
| 80 | * Add or remove ARIA attributes. |
| 81 | * |
81 | 82 | * Uses jQuery's width() function to determine the size of the window and add |
82 | 83 | * the default ARIA attributes for the menu toggle if it's visible. |
83 | 84 | * @since Twenty Fifteen 1.1 |
-
diff --git src/wp-content/themes/twentyfourteen/js/functions.js src/wp-content/themes/twentyfourteen/js/functions.js
index a21849ec3..ac4629d77 100644
|
|
|
122 | 122 | } ); |
123 | 123 | |
124 | 124 | /** |
125 | | * @summary Add or remove ARIA attributes. |
| 125 | * Add or remove ARIA attributes. |
| 126 | * |
126 | 127 | * Uses jQuery's width() function to determine the size of the window and add |
127 | 128 | * the default ARIA attributes for the menu toggle if it's visible. |
128 | 129 | * @since Twenty Fourteen 1.4 |
-
diff --git src/wp-content/themes/twentythirteen/js/functions.js src/wp-content/themes/twentythirteen/js/functions.js
index 88e8d0b5a..a8600df66 100644
|
|
|
75 | 75 | } )(); |
76 | 76 | |
77 | 77 | /** |
78 | | * @summary Add or remove ARIA attributes. |
| 78 | * Add or remove ARIA attributes. |
| 79 | * |
79 | 80 | * Uses jQuery's width() function to determine the size of the window and add |
80 | 81 | * the default ARIA attributes for the menu toggle if it's visible. |
| 82 | * |
81 | 83 | * @since Twenty Thirteen 1.5 |
82 | 84 | */ |
83 | 85 | function onResizeARIA() { |
… |
… |
|
162 | 164 | } ); |
163 | 165 | } |
164 | 166 | } ); |
165 | | } )( jQuery ); |
166 | | No newline at end of file |
| 167 | } )( jQuery ); |
-
diff --git src/wp-includes/js/autosave.js src/wp-includes/js/autosave.js
index afd51fbbd..1250c064e 100644
|
|
window.autosave = function() { |
5 | 5 | }; |
6 | 6 | |
7 | 7 | /** |
8 | | * @summary Adds autosave to the window object on dom ready. |
| 8 | * Adds autosave to the window object on dom ready. |
9 | 9 | * |
10 | 10 | * @since 3.9.0 |
11 | 11 | * |
… |
… |
window.autosave = function() { |
15 | 15 | */ |
16 | 16 | ( function( $, window ) { |
17 | 17 | /** |
18 | | * @summary Auto saves the post. |
| 18 | * Auto saves the post. |
19 | 19 | * |
20 | 20 | * @since 3.9.0 |
21 | 21 | * |
… |
… |
window.autosave = function() { |
36 | 36 | $document = $(document); |
37 | 37 | |
38 | 38 | /** |
39 | | * @summary Returns the data saved in both local and remote autosave. |
| 39 | * Returns the data saved in both local and remote autosave. |
40 | 40 | * |
41 | 41 | * @since 3.9.0 |
42 | 42 | * |
… |
… |
window.autosave = function() { |
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
102 | | * @summary Concatenates the title, content and excerpt. |
103 | | * |
104 | | * This is used to track changes when auto-saving. |
| 102 | * Concatenates the title, content and excerpt. This is used to track changes when auto-saving. |
105 | 103 | * |
106 | 104 | * @since 3.9.0 |
107 | 105 | * |
… |
… |
window.autosave = function() { |
118 | 116 | } |
119 | 117 | |
120 | 118 | /** |
121 | | * @summary Disables save buttons. |
| 119 | * Disables save buttons. |
122 | 120 | * |
123 | 121 | * @since 3.9.0 |
124 | 122 | * |
… |
… |
window.autosave = function() { |
132 | 130 | } |
133 | 131 | |
134 | 132 | /** |
135 | | * @summary Enables save buttons. |
| 133 | * Enables save buttons. |
136 | 134 | * |
137 | 135 | * @since 3.9.0 |
138 | 136 | * |
… |
… |
window.autosave = function() { |
143 | 141 | } |
144 | 142 | |
145 | 143 | /** |
146 | | * @summary Gets the content editor. |
| 144 | * Gets the content editor. |
147 | 145 | * |
148 | 146 | * @since 4.6.0 |
149 | 147 | * |
… |
… |
window.autosave = function() { |
155 | 153 | } |
156 | 154 | |
157 | 155 | /** |
158 | | * @summary Autosave in localStorage. |
| 156 | * Autosave in localStorage. |
159 | 157 | * |
160 | 158 | * @since 3.9.0 |
161 | 159 | * |
… |
… |
window.autosave = function() { |
176 | 174 | isSuspended = false; |
177 | 175 | |
178 | 176 | /** |
179 | | * @summary Checks if the browser supports sessionStorage and it's not disabled. |
| 177 | * Checks if the browser supports sessionStorage and it's not disabled. |
180 | 178 | * |
181 | 179 | * @since 3.9.0 |
182 | 180 | * |
… |
… |
window.autosave = function() { |
197 | 195 | } |
198 | 196 | |
199 | 197 | /** |
200 | | * @summary Initializes the local storage. |
| 198 | * Initializes the local storage. |
201 | 199 | * |
202 | 200 | * @since 3.9.0 |
203 | 201 | * |
… |
… |
window.autosave = function() { |
221 | 219 | } |
222 | 220 | |
223 | 221 | /** |
224 | | * @summary Sets the storage for this blog. |
225 | | * |
226 | | * Confirms that the data was saved successfully. |
| 222 | * Sets the storage for this blog. Confirms that the data was saved successfully. |
227 | 223 | * |
228 | 224 | * @since 3.9.0 |
229 | 225 | * |
… |
… |
window.autosave = function() { |
242 | 238 | } |
243 | 239 | |
244 | 240 | /** |
245 | | * @summary Gets the saved post data for the current post. |
| 241 | * Gets the saved post data for the current post. |
246 | 242 | * |
247 | 243 | * @since 3.9.0 |
248 | 244 | * |
… |
… |
window.autosave = function() { |
259 | 255 | } |
260 | 256 | |
261 | 257 | /** |
262 | | * @summary Sets (save or delete) post data in the storage. |
| 258 | * Sets (save or delete) post data in the storage. |
263 | 259 | * |
264 | 260 | * If stored_data evaluates to 'false' the storage key for the current post will be removed. |
265 | 261 | * |
… |
… |
window.autosave = function() { |
288 | 284 | } |
289 | 285 | |
290 | 286 | /** |
291 | | * @summary Sets isSuspended to true. |
| 287 | * Sets isSuspended to true. |
292 | 288 | * |
293 | 289 | * @since 3.9.0 |
294 | 290 | * |
… |
… |
window.autosave = function() { |
299 | 295 | } |
300 | 296 | |
301 | 297 | /** |
302 | | * @summary Sets isSuspended to false. |
| 298 | * Sets isSuspended to false. |
303 | 299 | * |
304 | 300 | * @since 3.9.0 |
305 | 301 | * |
… |
… |
window.autosave = function() { |
310 | 306 | } |
311 | 307 | |
312 | 308 | /** |
313 | | * @summary Saves post data for the current post. |
| 309 | * Saves post data for the current post. |
314 | 310 | * |
315 | 311 | * Runs on a 15 sec. interval, saves when there are differences in the post title or content. |
316 | 312 | * When the optional data is provided, updates the last saved post data. |
… |
… |
window.autosave = function() { |
359 | 355 | } |
360 | 356 | |
361 | 357 | /** |
362 | | * @summary Initializes the auto save function. |
| 358 | * Initializes the auto save function. |
363 | 359 | * |
364 | 360 | * Checks whether the editor is active or not to use the editor events |
365 | 361 | * to autosave, or uses the values from the elements to autosave. |
… |
… |
window.autosave = function() { |
419 | 415 | } |
420 | 416 | |
421 | 417 | /** |
422 | | * @summary Compares 2 strings. |
423 | | * |
424 | | * Removes whitespaces in the strings before comparing them. |
| 418 | * Compares 2 strings. Removes whitespaces in the strings before comparing them. |
425 | 419 | * |
426 | 420 | * @since 3.9.0 |
427 | 421 | * |
… |
… |
window.autosave = function() { |
438 | 432 | } |
439 | 433 | |
440 | 434 | /** |
441 | | * @summary Checks if the saved data for the current post (if any) is different |
442 | | * than the loaded post data on the screen. |
| 435 | * Checks if the saved data for the current post (if any) is different than the loaded post data on the screen. |
443 | 436 | * |
444 | 437 | * Shows a standard message letting the user restore the post data if different. |
445 | 438 | * |
… |
… |
window.autosave = function() { |
507 | 500 | } |
508 | 501 | |
509 | 502 | /** |
510 | | * @summary Restores the current title, content and excerpt from postData. |
| 503 | * Restores the current title, content and excerpt from postData. |
511 | 504 | * |
512 | 505 | * @since 3.9.0 |
513 | 506 | * |
… |
… |
window.autosave = function() { |
575 | 568 | } |
576 | 569 | |
577 | 570 | /** |
578 | | * @summary Auto saves the post on the server. |
| 571 | * Auto saves the post on the server. |
579 | 572 | * |
580 | 573 | * @since 3.9.0 |
581 | 574 | * |
… |
… |
window.autosave = function() { |
596 | 589 | |
597 | 590 | |
598 | 591 | /** |
599 | | * @summary Blocks saving for the next 10 seconds. |
| 592 | * Blocks saving for the next 10 seconds. |
600 | 593 | * |
601 | 594 | * @since 3.9.0 |
602 | 595 | * |
… |
… |
window.autosave = function() { |
612 | 605 | } |
613 | 606 | |
614 | 607 | /** |
615 | | * @summary Sets isSuspended to true. |
| 608 | * Sets isSuspended to true. |
616 | 609 | * |
617 | 610 | * @since 3.9.0 |
618 | 611 | * |
… |
… |
window.autosave = function() { |
623 | 616 | } |
624 | 617 | |
625 | 618 | /** |
626 | | * @summary Sets isSuspended to false. |
| 619 | * Sets isSuspended to false. |
627 | 620 | * |
628 | 621 | * @since 3.9.0 |
629 | 622 | * |
… |
… |
window.autosave = function() { |
634 | 627 | } |
635 | 628 | |
636 | 629 | /** |
637 | | * @summary Triggers the autosave with the post data. |
| 630 | * Triggers the autosave with the post data. |
638 | 631 | * |
639 | 632 | * @since 3.9.0 |
640 | 633 | * |
… |
… |
window.autosave = function() { |
658 | 651 | } |
659 | 652 | |
660 | 653 | /** |
661 | | * @summary Saves immediately. |
| 654 | * Saves immediately. |
662 | 655 | * |
663 | 656 | * Resets the timing and tells heartbeat to connect now. |
664 | 657 | * |
… |
… |
window.autosave = function() { |
672 | 665 | } |
673 | 666 | |
674 | 667 | /** |
675 | | * @summary Checks if the post content in the textarea has changed since page load. |
| 668 | * Checks if the post content in the textarea has changed since page load. |
676 | 669 | * |
677 | 670 | * This also happens when TinyMCE is active and editor.save() is triggered by |
678 | 671 | * wp.autosave.getPostData(). |
… |
… |
window.autosave = function() { |
686 | 679 | } |
687 | 680 | |
688 | 681 | /** |
689 | | * @summary Checks if the post can be saved or not. |
| 682 | * Checks if the post can be saved or not. |
690 | 683 | * |
691 | 684 | * If the post hasn't changed or it cannot be updated, |
692 | 685 | * because the autosave is blocked or suspended, the function returns false. |
… |
… |
window.autosave = function() { |
733 | 726 | } |
734 | 727 | |
735 | 728 | /** |
736 | | * @summary Sets the next run, based on the autosave interval. |
| 729 | * Sets the next run, based on the autosave interval. |
737 | 730 | * |
738 | 731 | * @private |
739 | 732 | * |
… |
… |
window.autosave = function() { |
746 | 739 | } |
747 | 740 | |
748 | 741 | /** |
749 | | * @summary Sets the autosaveData on the autosave heartbeat. |
| 742 | * Sets the autosaveData on the autosave heartbeat. |
750 | 743 | * |
751 | 744 | * @since 3.9.0 |
752 | 745 | * |
… |
… |
window.autosave = function() { |
760 | 753 | } |
761 | 754 | |
762 | 755 | /** |
763 | | * @summary Triggers the autosave of the post with the autosave data |
764 | | * on the autosave heartbeat. |
| 756 | * Triggers the autosave of the post with the autosave data on the autosave heartbeat. |
765 | 757 | * |
766 | 758 | * @since 3.9.0 |
767 | 759 | * |
… |
… |
window.autosave = function() { |
772 | 764 | response( data.wp_autosave ); |
773 | 765 | } |
774 | 766 | /** |
775 | | * @summary Disables buttons and throws a notice when the connection is lost. |
| 767 | * Disables buttons and throws a notice when the connection is lost. |
776 | 768 | * |
777 | 769 | * @since 3.9.0 |
778 | 770 | * |
… |
… |
window.autosave = function() { |
793 | 785 | } |
794 | 786 | |
795 | 787 | /** |
796 | | * @summary Enables buttons when the connection is restored. |
| 788 | * Enables buttons when the connection is restored. |
797 | 789 | * |
798 | 790 | * @since 3.9.0 |
799 | 791 | * |
… |
… |
window.autosave = function() { |
816 | 808 | } |
817 | 809 | |
818 | 810 | /** |
819 | | * @summary Sets the autosave time out. |
| 811 | * Sets the autosave time out. |
820 | 812 | * |
821 | 813 | * Wait for TinyMCE to initialize plus 1 second. for any external css to finish loading, |
822 | 814 | * then save to the textarea before setting initialCompareString. |
-
diff --git src/wp-includes/js/comment-reply.js src/wp-includes/js/comment-reply.js
index 76c5fba70..4626e627b 100644
|
|
|
1 | 1 | /** |
2 | | * @summary Handles the addition of the comment form. |
| 2 | * Handles the addition of the comment form. |
3 | 3 | * |
4 | 4 | * @since 2.7.0 |
5 | 5 | * |
-
diff --git src/wp-includes/js/media-audiovideo.js src/wp-includes/js/media-audiovideo.js
index e939d4945..58abf9273 100644
|
|
var media = wp.media, |
73 | 73 | |
74 | 74 | /** |
75 | 75 | * |
76 | | * @summary Defines the wp.media.mixin object. |
| 76 | * Defines the wp.media.mixin object. |
77 | 77 | * |
78 | 78 | * @mixin |
79 | 79 | * |
… |
… |
wp.media.mixin = { |
83 | 83 | mejsSettings: baseSettings, |
84 | 84 | |
85 | 85 | /** |
86 | | * @summary Pauses and removes all players. |
| 86 | * Pauses and removes all players. |
87 | 87 | * |
88 | 88 | * @since 4.2.0 |
89 | 89 | * |
… |
… |
wp.media.mixin = { |
101 | 101 | }, |
102 | 102 | |
103 | 103 | /** |
104 | | * @summary Removes the player. |
| 104 | * Removes the player. |
105 | 105 | * |
106 | 106 | * Override the MediaElement method for removing a player. |
107 | 107 | * MediaElement tries to pull the audio/video tag out of |
… |
… |
wp.media.mixin = { |
147 | 147 | |
148 | 148 | /** |
149 | 149 | * |
150 | | * @summary Removes and resets all players. |
| 150 | * Removes and resets all players. |
151 | 151 | * |
152 | 152 | * Allows any class that has set 'player' to a MediaElementPlayer |
153 | 153 | * instance to remove the player when listening to events. |
… |
… |
wp.media.mixin = { |
168 | 168 | }; |
169 | 169 | |
170 | 170 | /** |
171 | | * @summary Shortcode modeling for playlists. |
| 171 | * Shortcode modeling for playlists. |
172 | 172 | * |
173 | 173 | * @since 4.2.0 |
174 | 174 | */ |
… |
… |
wp.media.playlist = new wp.media.collection({ |
187 | 187 | }); |
188 | 188 | |
189 | 189 | /** |
190 | | * @summary Shortcode modeling for audio. |
| 190 | * Shortcode modeling for audio. |
191 | 191 | * |
192 | 192 | * `edit()` prepares the shortcode for the media modal. |
193 | 193 | * `shortcode()` builds the new shortcode after an update. |
… |
… |
wp.media.audio = { |
209 | 209 | }, |
210 | 210 | |
211 | 211 | /** |
212 | | * @summary Instantiates a new media object with the next matching shortcode. |
| 212 | * Instantiates a new media object with the next matching shortcode. |
213 | 213 | * |
214 | 214 | * @since 4.2.0 |
215 | 215 | * |
… |
… |
wp.media.audio = { |
229 | 229 | }, |
230 | 230 | |
231 | 231 | /** |
232 | | * @summary Generates an audio shortcode. |
| 232 | * Generates an audio shortcode. |
233 | 233 | * |
234 | 234 | * @since 4.2.0 |
235 | 235 | * |
… |
… |
wp.media.audio = { |
259 | 259 | }; |
260 | 260 | |
261 | 261 | /** |
262 | | * @summary Shortcode modeling for video. |
| 262 | * Shortcode modeling for video. |
263 | 263 | * |
264 | 264 | * `edit()` prepares the shortcode for the media modal. |
265 | 265 | * `shortcode()` builds the new shortcode after update. |
… |
… |
wp.media.video = { |
284 | 284 | }, |
285 | 285 | |
286 | 286 | /** |
287 | | * @summary Instantiates a new media object with the next matching shortcode. |
| 287 | * Instantiates a new media object with the next matching shortcode. |
288 | 288 | * |
289 | 289 | * @since 4.2.0 |
290 | 290 | * |
… |
… |
wp.media.video = { |
309 | 309 | }, |
310 | 310 | |
311 | 311 | /** |
312 | | * @summary Generates an video shortcode. |
| 312 | * Generates an video shortcode. |
313 | 313 | * |
314 | 314 | * @since 4.2.0 |
315 | 315 | * |
… |
… |
module.exports = VideoDetails; |
1102 | 1102 | |
1103 | 1103 | |
1104 | 1104 | /***/ }) |
1105 | | /******/ ]); |
1106 | | No newline at end of file |
| 1105 | /******/ ]); |
-
diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
index 9dbdd5ecb..8e0525116 100644
|
|
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
2320 | 2320 | }, |
2321 | 2321 | |
2322 | 2322 | /** |
2323 | | * @summary Opens the crop image window. |
2324 | | * |
2325 | | * Shows the crop image window when called from the Add new image button. |
| 2323 | * Opens the crop image window. Shows the crop image window when called from the Add new image button. |
2326 | 2324 | * |
2327 | 2325 | * @since 4.2.0 |
2328 | 2326 | * |
… |
… |
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
2335 | 2333 | }, |
2336 | 2334 | |
2337 | 2335 | /** |
2338 | | * @summary Changes the state of the toolbar window to browse mode. |
| 2336 | * Changes the state of the toolbar window to browse mode. |
2339 | 2337 | * |
2340 | 2338 | * @since 4.2.0 |
2341 | 2339 | * |
… |
… |
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
2346 | 2344 | }, |
2347 | 2345 | |
2348 | 2346 | /** |
2349 | | * @summary Creates the crop image window. |
2350 | | * |
2351 | | * Initialized when clicking on the Select and Crop button. |
| 2347 | * Creates the crop image window. Initialized when clicking on the Select and Crop button. |
2352 | 2348 | * |
2353 | 2349 | * @since 4.2.0 |
2354 | 2350 | * |
… |
… |
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
2367 | 2363 | }, |
2368 | 2364 | |
2369 | 2365 | /** |
2370 | | * @summary Removes the image selection and closes the cropping window. |
| 2366 | * Removes the image selection and closes the cropping window. |
2371 | 2367 | * |
2372 | 2368 | * @since 4.2.0 |
2373 | 2369 | * |
… |
… |
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
2381 | 2377 | }, |
2382 | 2378 | |
2383 | 2379 | /** |
2384 | | * @summary Checks if cropping can be skipped and creates crop toolbar accordingly. |
| 2380 | * Checks if cropping can be skipped and creates crop toolbar accordingly. |
2385 | 2381 | * |
2386 | 2382 | * @since 4.2.0 |
2387 | 2383 | * |
… |
… |
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
2443 | 2439 | }, |
2444 | 2440 | |
2445 | 2441 | /** |
2446 | | * @summary Creates an object with the image attachment and crop properties. |
| 2442 | * Creates an object with the image attachment and crop properties. |
2447 | 2443 | * |
2448 | 2444 | * @since 4.2.0 |
2449 | 2445 | * |
… |
… |
module.exports = Spinner; |
9252 | 9248 | |
9253 | 9249 | |
9254 | 9250 | /***/ }) |
9255 | | /******/ ])); |
9256 | | No newline at end of file |
| 9251 | /******/ ])); |
-
diff --git src/wp-includes/js/media/audiovideo.manifest.js src/wp-includes/js/media/audiovideo.manifest.js
index 7981aa75a..c1e4c59f8 100644
|
|
var media = wp.media, |
4 | 4 | |
5 | 5 | /** |
6 | 6 | * |
7 | | * @summary Defines the wp.media.mixin object. |
| 7 | * Defines the wp.media.mixin object. |
8 | 8 | * |
9 | 9 | * @mixin |
10 | 10 | * |
… |
… |
wp.media.mixin = { |
14 | 14 | mejsSettings: baseSettings, |
15 | 15 | |
16 | 16 | /** |
17 | | * @summary Pauses and removes all players. |
| 17 | * Pauses and removes all players. |
18 | 18 | * |
19 | 19 | * @since 4.2.0 |
20 | 20 | * |
… |
… |
wp.media.mixin = { |
32 | 32 | }, |
33 | 33 | |
34 | 34 | /** |
35 | | * @summary Removes the player. |
| 35 | * Removes the player. |
36 | 36 | * |
37 | 37 | * Override the MediaElement method for removing a player. |
38 | 38 | * MediaElement tries to pull the audio/video tag out of |
… |
… |
wp.media.mixin = { |
78 | 78 | |
79 | 79 | /** |
80 | 80 | * |
81 | | * @summary Removes and resets all players. |
| 81 | * Removes and resets all players. |
82 | 82 | * |
83 | 83 | * Allows any class that has set 'player' to a MediaElementPlayer |
84 | 84 | * instance to remove the player when listening to events. |
… |
… |
wp.media.mixin = { |
99 | 99 | }; |
100 | 100 | |
101 | 101 | /** |
102 | | * @summary Shortcode modeling for playlists. |
| 102 | * Shortcode modeling for playlists. |
103 | 103 | * |
104 | 104 | * @since 4.2.0 |
105 | 105 | */ |
… |
… |
wp.media.playlist = new wp.media.collection({ |
118 | 118 | }); |
119 | 119 | |
120 | 120 | /** |
121 | | * @summary Shortcode modeling for audio. |
| 121 | * Shortcode modeling for audio. |
122 | 122 | * |
123 | 123 | * `edit()` prepares the shortcode for the media modal. |
124 | 124 | * `shortcode()` builds the new shortcode after an update. |
… |
… |
wp.media.audio = { |
140 | 140 | }, |
141 | 141 | |
142 | 142 | /** |
143 | | * @summary Instantiates a new media object with the next matching shortcode. |
| 143 | * Instantiates a new media object with the next matching shortcode. |
144 | 144 | * |
145 | 145 | * @since 4.2.0 |
146 | 146 | * |
… |
… |
wp.media.audio = { |
160 | 160 | }, |
161 | 161 | |
162 | 162 | /** |
163 | | * @summary Generates an audio shortcode. |
| 163 | * Generates an audio shortcode. |
164 | 164 | * |
165 | 165 | * @since 4.2.0 |
166 | 166 | * |
… |
… |
wp.media.audio = { |
190 | 190 | }; |
191 | 191 | |
192 | 192 | /** |
193 | | * @summary Shortcode modeling for video. |
| 193 | * Shortcode modeling for video. |
194 | 194 | * |
195 | 195 | * `edit()` prepares the shortcode for the media modal. |
196 | 196 | * `shortcode()` builds the new shortcode after update. |
… |
… |
wp.media.video = { |
215 | 215 | }, |
216 | 216 | |
217 | 217 | /** |
218 | | * @summary Instantiates a new media object with the next matching shortcode. |
| 218 | * Instantiates a new media object with the next matching shortcode. |
219 | 219 | * |
220 | 220 | * @since 4.2.0 |
221 | 221 | * |
… |
… |
wp.media.video = { |
240 | 240 | }, |
241 | 241 | |
242 | 242 | /** |
243 | | * @summary Generates an video shortcode. |
| 243 | * Generates an video shortcode. |
244 | 244 | * |
245 | 245 | * @since 4.2.0 |
246 | 246 | * |
-
diff --git src/wp-includes/js/media/controllers/cropper.js src/wp-includes/js/media/controllers/cropper.js
index be4b7bc53..3418064a6 100644
|
|
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
27 | 27 | }, |
28 | 28 | |
29 | 29 | /** |
30 | | * @summary Opens the crop image window. |
31 | | * |
32 | 30 | * Shows the crop image window when called from the Add new image button. |
33 | 31 | * |
34 | 32 | * @since 4.2.0 |
… |
… |
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
42 | 40 | }, |
43 | 41 | |
44 | 42 | /** |
45 | | * @summary Changes the state of the toolbar window to browse mode. |
| 43 | * Changes the state of the toolbar window to browse mode. |
46 | 44 | * |
47 | 45 | * @since 4.2.0 |
48 | 46 | * |
… |
… |
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
53 | 51 | }, |
54 | 52 | |
55 | 53 | /** |
56 | | * @summary Creates the crop image window. |
| 54 | * Creates the crop image window. |
57 | 55 | * |
58 | 56 | * Initialized when clicking on the Select and Crop button. |
59 | 57 | * |
… |
… |
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
74 | 72 | }, |
75 | 73 | |
76 | 74 | /** |
77 | | * @summary Removes the image selection and closes the cropping window. |
| 75 | * Removes the image selection and closes the cropping window. |
78 | 76 | * |
79 | 77 | * @since 4.2.0 |
80 | 78 | * |
… |
… |
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
88 | 86 | }, |
89 | 87 | |
90 | 88 | /** |
91 | | * @summary Checks if cropping can be skipped and creates crop toolbar accordingly. |
| 89 | * Checks if cropping can be skipped and creates crop toolbar accordingly. |
92 | 90 | * |
93 | 91 | * @since 4.2.0 |
94 | 92 | * |
… |
… |
Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Croppe |
150 | 148 | }, |
151 | 149 | |
152 | 150 | /** |
153 | | * @summary Creates an object with the image attachment and crop properties. |
| 151 | * Creates an object with the image attachment and crop properties. |
154 | 152 | * |
155 | 153 | * @since 4.2.0 |
156 | 154 | * |