Server: appserver-7f0f8755-nginx-15961cad18524ec5a9db05f2a6a7e440
Current directory: /code/wp-admin/js
Software: nginx/1.27.5
Shell Command
Create a new file
Upload file
File: inline-edit-tax.js
/** * This file is used on the term overview page to power quick-editing terms. * * @output wp-admin/js/inline-edit-tax.js */ /* global ajaxurl, inlineEditTax */ window.wp = window.wp || {}; /** * Consists of functions relevant to the inline taxonomy editor. * * @namespace inlineEditTax * * @property {string} type The type of inline edit we are currently on. * @property {string} what The type property with a hash prefixed and a dash * suffixed. */ ( function( $, wp ) { window.inlineEditTax = { /** * Initializes the inline taxonomy editor by adding event handlers to be able to * quick edit. * * @since 2.7.0 * * @this inlineEditTax * @memberof inlineEditTax * @return {void} */ init : function() { var t = this, row = $('#inline-edit'); t.type = $('#the-list').attr('data-wp-lists').substr(5); t.what = '#'+t.type+'-'; $( '#the-list' ).on( 'click', '.editinline', function() { $( this ).attr( 'aria-expanded', 'true' ); inlineEditTax.edit( this ); }); /** * Cancels inline editing when pressing Escape inside the inline editor. * * @param {Object} e The keyup event that has been triggered. */ row.on( 'keyup', function( e ) { // 27 = [Escape]. if ( e.which === 27 ) { return inlineEditTax.revert(); } }); /** * Cancels inline editing when clicking the cancel button. */ $( '.cancel', row ).on( 'click', function() { return inlineEditTax.revert(); }); /** * Saves the inline edits when clicking the save button. */ $( '.save', row ).on( 'click', function() { return inlineEditTax.save(this); }); /** * Saves the inline edits when pressing Enter inside the inline editor. */ $( 'input, select', row ).on( 'keydown', function( e ) { // 13 = [Enter]. if ( e.which === 13 ) { return inlineEditTax.save( this ); } }); /** * Saves the inline edits on submitting the inline edit form. */ $( '#posts-filter input[type="submit"]' ).on( 'mousedown', function() { t.revert(); }); }, /** * Toggles the quick edit based on if it is currently shown or hidden. * * @since 2.7.0 * * @this inlineEditTax * @memberof inlineEditTax * * @param {HTMLElement} el An element within the table row or the table row * itself that we want to quick edit. * @return {void} */ toggle : function(el) { var t = this; $(t.what+t.getId(el)).css('display') === 'none' ? t.revert() : t.edit(el); }, /** * Shows the quick editor * * @since 2.7.0 * * @this inlineEditTax * @memberof inlineEditTax * * @param {string|HTMLElement} id The ID of the term we want to quick edit or an * element within the table row or the * table row itself. * @return {boolean} Always returns false. */ edit : function(id) { var editRow, rowData, val, t = this; t.revert(); // Makes sure we can pass an HTMLElement as the ID. if ( typeof(id) === 'object' ) { id = t.getId(id); } editRow = $('#inline-edit').clone(true), rowData = $('#inline_'+id); $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', '.wp-list-table.widefat:first thead' ).length ); $(t.what+id).hide().after(editRow).after('
'); val = $('.name', rowData); val.find( 'img' ).replaceWith( function() { return this.alt; } ); val = val.text(); $(':input[name="name"]', editRow).val( val ); val = $('.slug', rowData); val.find( 'img' ).replaceWith( function() { return this.alt; } ); val = val.text(); $(':input[name="slug"]', editRow).val( val ); $(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show(); $('.ptitle', editRow).eq(0).trigger( 'focus' ); return false; }, /** * Saves the quick edit data. * * Saves the quick edit data to the server and replaces the table row with the * HTML retrieved from the server. * * @since 2.7.0 * * @this inlineEditTax * @memberof inlineEditTax * * @param {string|HTMLElement} id The ID of the term we want to quick edit or an * element within the table row or the * table row itself. * @return {boolean} Always returns false. */ save : function(id) { var params, fields, tax = $('input[name="taxonomy"]').val() || ''; // Makes sure we can pass an HTMLElement as the ID. if( typeof(id) === 'object' ) { id = this.getId(id); } $( 'table.widefat .spinner' ).addClass( 'is-active' ); params = { action: 'inline-save-tax', tax_type: this.type, tax_ID: id, taxonomy: tax }; fields = $('#edit-'+id).find(':input').serialize(); params = fields + '&' + $.param(params); // Do the Ajax request to save the data to the server. $.post( ajaxurl, params, /** * Handles the response from the server * * Handles the response from the server, replaces the table row with the response * from the server. * * @param {string} r The string with which to replace the table row. */ function(r) { var row, new_id, option_value, $errorNotice = $( '#edit-' + id + ' .inline-edit-save .notice-error' ), $error = $errorNotice.find( '.error' ); $( 'table.widefat .spinner' ).removeClass( 'is-active' ); if (r) { if ( -1 !== r.indexOf( '
.
98 Items
Change directory
Remove directory
Rename directory
..
100 Items
Change directory
Remove directory
Rename directory
accordion.js
2.87 KB
Edit
Delete
Copy
Move
Remame
accordion.min.js
0.83 KB
Edit
Delete
Copy
Move
Remame
application-passwords.js
6.24 KB
Edit
Delete
Copy
Move
Remame
application-passwords.min.js
2.95 KB
Edit
Delete
Copy
Move
Remame
auth-app.js
5.66 KB
Edit
Delete
Copy
Move
Remame
auth-app.min.js
2.04 KB
Edit
Delete
Copy
Move
Remame
code-editor.js
11.32 KB
Edit
Delete
Copy
Move
Remame
code-editor.min.js
3.01 KB
Edit
Delete
Copy
Move
Remame
color-picker.js
9.54 KB
Edit
Delete
Copy
Move
Remame
color-picker.min.js
3.4 KB
Edit
Delete
Copy
Move
Remame
comment.js
2.85 KB
Edit
Delete
Copy
Move
Remame
comment.min.js
1.28 KB
Edit
Delete
Copy
Move
Remame
common.js
58.63 KB
Edit
Delete
Copy
Move
Remame
common.min.js
21.93 KB
Edit
Delete
Copy
Move
Remame
custom-background.js
3.35 KB
Edit
Delete
Copy
Move
Remame
custom-background.min.js
1.18 KB
Edit
Delete
Copy
Move
Remame
custom-header.js
1.98 KB
Edit
Delete
Copy
Move
Remame
customize-controls.js
286.52 KB
Edit
Delete
Copy
Move
Remame
customize-controls.min.js
109.03 KB
Edit
Delete
Copy
Move
Remame
customize-nav-menus.js
109.69 KB
Edit
Delete
Copy
Move
Remame
customize-nav-menus.min.js
46.19 KB
Edit
Delete
Copy
Move
Remame
customize-widgets.js
70.05 KB
Edit
Delete
Copy
Move
Remame
customize-widgets.min.js
27.41 KB
Edit
Delete
Copy
Move
Remame
dashboard.js
26.92 KB
Edit
Delete
Copy
Move
Remame
dashboard.min.js
8.59 KB
Edit
Delete
Copy
Move
Remame
edit-comments.js
36.65 KB
Edit
Delete
Copy
Move
Remame
edit-comments.min.js
14.99 KB
Edit
Delete
Copy
Move
Remame
editor-expand.js
41.61 KB
Edit
Delete
Copy
Move
Remame
editor-expand.min.js
13.14 KB
Edit
Delete
Copy
Move
Remame
editor.js
44.25 KB
Edit
Delete
Copy
Move
Remame
editor.min.js
12.87 KB
Edit
Delete
Copy
Move
Remame
farbtastic.js
7.67 KB
Edit
Delete
Copy
Move
Remame
gallery.js
5.41 KB
Edit
Delete
Copy
Move
Remame
gallery.min.js
3.65 KB
Edit
Delete
Copy
Move
Remame
image-edit.js
38.21 KB
Edit
Delete
Copy
Move
Remame
image-edit.min.js
14.3 KB
Edit
Delete
Copy
Move
Remame
inline-edit-post.js
19.8 KB
Edit
Delete
Copy
Move
Remame
inline-edit-post.min.js
9.27 KB
Edit
Delete
Copy
Move
Remame
inline-edit-tax.js
7.61 KB
Edit
Delete
Copy
Move
Remame
inline-edit-tax.min.js
2.93 KB
Edit
Delete
Copy
Move
Remame
iris.min.js
23.09 KB
Edit
Delete
Copy
Move
Remame
language-chooser.js
0.87 KB
Edit
Delete
Copy
Move
Remame
language-chooser.min.js
0.41 KB
Edit
Delete
Copy
Move
Remame
link.js
3.89 KB
Edit
Delete
Copy
Move
Remame
link.min.js
1.7 KB
Edit
Delete
Copy
Move
Remame
media-gallery.js
1.27 KB
Edit
Delete
Copy
Move
Remame
media-gallery.min.js
0.6 KB
Edit
Delete
Copy
Move
Remame
media-upload.js
3.38 KB
Edit
Delete
Copy
Move
Remame
media-upload.min.js
1.13 KB
Edit
Delete
Copy
Move
Remame
media.js
6.26 KB
Edit
Delete
Copy
Move
Remame
media.min.js
2.34 KB
Edit
Delete
Copy
Move
Remame
nav-menu.js
50.68 KB
Edit
Delete
Copy
Move
Remame
nav-menu.min.js
25.69 KB
Edit
Delete
Copy
Move
Remame
password-strength-meter.js
4.14 KB
Edit
Delete
Copy
Move
Remame
password-strength-meter.min.js
1.1 KB
Edit
Delete
Copy
Move
Remame
password-toggle.js
1.31 KB
Edit
Delete
Copy
Move
Remame
password-toggle.min.js
0.83 KB
Edit
Delete
Copy
Move
Remame
plugin-install.js
6.92 KB
Edit
Delete
Copy
Move
Remame
plugin-install.min.js
2.35 KB
Edit
Delete
Copy
Move
Remame
post.js
39.08 KB
Edit
Delete
Copy
Move
Remame
post.min.js
18.59 KB
Edit
Delete
Copy
Move
Remame
postbox.js
18.4 KB
Edit
Delete
Copy
Move
Remame
postbox.min.js
6.55 KB
Edit
Delete
Copy
Move
Remame
privacy-tools.js
10.67 KB
Edit
Delete
Copy
Move
Remame
privacy-tools.min.js
5.03 KB
Edit
Delete
Copy
Move
Remame
revisions.js
33.13 KB
Edit
Delete
Copy
Move
Remame
revisions.min.js
17.45 KB
Edit
Delete
Copy
Move
Remame
set-post-thumbnail.js
0.86 KB
Edit
Delete
Copy
Move
Remame
set-post-thumbnail.min.js
0.61 KB
Edit
Delete
Copy
Move
Remame
site-health.js
13.15 KB
Edit
Delete
Copy
Move
Remame
site-health.min.js
6.13 KB
Edit
Delete
Copy
Move
Remame
site-icon.js
5.91 KB
Edit
Delete
Copy
Move
Remame
site-icon.min.js
2.12 KB
Edit
Delete
Copy
Move
Remame
svg-painter.js
5.39 KB
Edit
Delete
Copy
Move
Remame
svg-painter.min.js
2.33 KB
Edit
Delete
Copy
Move
Remame
tags-box.js
10.88 KB
Edit
Delete
Copy
Move
Remame
tags-box.min.js
3 KB
Edit
Delete
Copy
Move
Remame
tags-suggest.js
5.64 KB
Edit
Delete
Copy
Move
Remame
tags-suggest.min.js
2.22 KB
Edit
Delete
Copy
Move
Remame
tags.js
4.77 KB
Edit
Delete
Copy
Move
Remame
tags.min.js
1.96 KB
Edit
Delete
Copy
Move
Remame
theme-plugin-editor.js
24.79 KB
Edit
Delete
Copy
Move
Remame
theme-plugin-editor.min.js
11.46 KB
Edit
Delete
Copy
Move
Remame
theme.js
54.65 KB
Edit
Delete
Copy
Move
Remame
theme.min.js
26.4 KB
Edit
Delete
Copy
Move
Remame
updates.js
108.36 KB
Edit
Delete
Copy
Move
Remame
updates.min.js
47.1 KB
Edit
Delete
Copy
Move
Remame
user-profile.js
14.2 KB
Edit
Delete
Copy
Move
Remame
user-profile.min.js
6.35 KB
Edit
Delete
Copy
Move
Remame
user-suggest.js
2.25 KB
Edit
Delete
Copy
Move
Remame
user-suggest.min.js
0.66 KB
Edit
Delete
Copy
Move
Remame
widgets
14 Items
Change directory
Remove directory
Rename directory
widgets.js
22.56 KB
Edit
Delete
Copy
Move
Remame
widgets.min.js
12.31 KB
Edit
Delete
Copy
Move
Remame
word-count.js
7.52 KB
Edit
Delete
Copy
Move
Remame
word-count.min.js
1.49 KB
Edit
Delete
Copy
Move
Remame
xfn.js
0.72 KB
Edit
Delete
Copy
Move
Remame
xfn.min.js
0.45 KB
Edit
Delete
Copy
Move
Remame