/
home
/
techb158
/
balacoffee.com
/
wp-content
/
plugins
/
polylang-pro-1
/
js
/
build
/
/home/techb158/balacoffee.com/wp-content/plugins/polylang-pro-1/js/build
mkdir
upload
Name
Size
Mode
Actions
acf.js
1354
0644
edit
dl
rm
acf.min.js
600
0644
edit
dl
rm
admin.js
14301
0644
edit
dl
rm
admin.min.js
4292
0644
edit
dl
rm
block-editor-plugin.js
33407
0644
edit
dl
rm
block-editor-plugin.min.js
5553
0644
edit
dl
rm
block-editor.js
11447
0644
edit
dl
rm
block-editor.min.js
3694
0644
edit
dl
rm
blocks.js
54766
0644
edit
dl
rm
blocks.min.js
12823
0644
edit
dl
rm
bulk-translate.js
2532
0644
edit
dl
rm
bulk-translate.min.js
1322
0644
edit
dl
rm
classic-editor.js
15628
0644
edit
dl
rm
classic-editor.min.js
5225
0644
edit
dl
rm
confirmation-modal.js
4284
0644
edit
dl
rm
confirmation-modal.min.js
1493
0644
edit
dl
rm
languages-step.js
10783
0644
edit
dl
rm
languages-step.min.js
3499
0644
edit
dl
rm
metabox-autocomplete.js
2309
0644
edit
dl
rm
metabox-autocomplete.min.js
897
0644
edit
dl
rm
metabox-button.js
1306
0644
edit
dl
rm
metabox-button.min.js
709
0644
edit
dl
rm
nav-menu.js
3978
0644
edit
dl
rm
nav-menu.min.js
1583
0644
edit
dl
rm
navigation-editor-plugin.js
19194
0644
edit
dl
rm
navigation-editor-plugin.min.js
1666
0644
edit
dl
rm
post.js
5602
0644
edit
dl
rm
post.min.js
2082
0644
edit
dl
rm
sidebar.js
118170
0644
edit
dl
rm
sidebar.min.js
38956
0644
edit
dl
rm
term.js
8046
0644
edit
dl
rm
term.min.js
3049
0644
edit
dl
rm
user.js
1222
0644
edit
dl
rm
user.min.js
452
0644
edit
dl
rm
widget-editor-plugin.js
18433
0644
edit
dl
rm
widget-editor-plugin.min.js
1050
0644
edit
dl
rm
widgets.js
4336
0644
edit
dl
rm
widgets.min.js
1659
0644
edit
dl
rm
Edit:
/home/techb158/balacoffee.com/wp-content/plugins/polylang-pro-1/js/build/term.js
(8046B)
var __webpack_exports__ = {}; /** * @package Polylang */ /** * Quick edit */ jQuery( function( $ ) { const handleQuickEditInsertion = ( mutationsList ) => { for ( const mutation of mutationsList ) { const form = mutation.addedNodes[0]; if ( 0 < mutation.addedNodes.length && form.classList.contains( 'inline-edit-row' ) ) { // WordPress has inserted the quick edit form. const term_id = Number( form.id.substring( 5 ) ); if ( term_id > 0 ) { // Get the language dropdown. const select = form.querySelector( 'select[name="inline_lang_choice"]' ); const lang = document.querySelector( '#lang_' + String( term_id ) ).innerHTML; select.value = lang; // Populates the dropdown with the post language. // Disable the language dropdown for default categories. const default_cat = document.querySelector( `#default_cat_${term_id}` ).innerHTML; if ( term_id == default_cat ) { select.disabled = true; } } } } } const table = document.getElementById( 'the-list' ); if ( null !== table ) { // Ensure the table is displayed before listening to any change. const config = { childList: true, subtree: true }; const observer = new MutationObserver( handleQuickEditInsertion ); observer.observe( table, config); } } ); /** * Update rows of translated terms when adding / deleting a translation or when the language is modified in quick edit. * Acts on ajaxSuccess event. */ jQuery( function( $ ) { $( document ).ajaxSuccess( function( event, xhr, settings ) { function update_rows( term_id ) { // collect old translations var translations = new Array(); $( '.translation_' + term_id ).each( function() { translations.push( $( this ).parent().parent().attr( 'id' ).substring( 4 ) ); } ); var data = { action: 'pll_update_term_rows', term_id: term_id, translations: translations.join( ',' ), taxonomy: $( "input[name='taxonomy']" ).val(), post_type: $( "input[name='post_type']" ).val(), screen: $( "input[name='screen']" ).val(), _pll_nonce: $( '#_pll_nonce' ).val() }; // get the modified rows in ajax and update them $.post( ajaxurl, data, function( response ) { if ( response ) { // Target a non existing WP HTML id to avoid a conflict with WP ajax requests. var res = wpAjax.parseAjaxResponse( response, 'pll-ajax-response' ); $.each( res.responses, function() { if ( 'row' == this.what ) { // data is built with a call to WP_Terms_List_Table::single_row method // which uses internally other WordPress methods which escape correctly values. // For Polylang language columns the HTML code is correctly escaped in PLL_Admin_Filters_Columns::term_column method. $( "#tag-" + this.supplemental.term_id ).replaceWith( this.data ); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.replaceWith } } ); } } ); } var data = wpAjax.unserialize( settings.data ); // what were the data sent by the ajax request? if ( 'undefined' != typeof( data['action'] ) ) { switch ( data['action'] ) { // when adding a term, the new term_id is in the ajax response case 'add-tag': // Target a non existing WP HTML id to avoid a conflict with WP ajax requests. res = wpAjax.parseAjaxResponse( xhr.responseXML, 'pll-ajax-response' ); $.each( res.responses, function() { if ( 'term' == this.what ) { update_rows( this.supplemental.term_id ); } } ); // and also reset translations hidden input fields $( '.htr_lang' ).val( 0 ); break; // when deleting a term case 'delete-tag': update_rows( data['tag_ID'] ); break; // in case the language is modified in quick edit and breaks translations case 'inline-save-tax': update_rows( data['tax_ID'] ); break; } } } ); } ); jQuery( function( $ ) { // translations autocomplete input box function init_translations() { $( '.tr_lang' ).each( function(){ var tr_lang = $( this ).attr( 'id' ).substring( 8 ); var td = $( this ).parent().parent().siblings( '.pll-edit-column' ); $( this ).autocomplete( { minLength: 0, source: ajaxurl + '?action=pll_terms_not_translated' + '&term_language=' + $( '#term_lang_choice' ).val() + '&term_id=' + $( "input[name='tag_ID']" ).val() + '&taxonomy=' + $( "input[name='taxonomy']" ).val() + '&translation_language=' + tr_lang + '&post_type=' + typenow + '&_pll_nonce=' + $( '#_pll_nonce' ).val(), select: function( event, ui ) { $( '#htr_lang_' + tr_lang ).val( ui.item.id ); // ui.item.link is built and come from server side and is well escaped when necessary td.html( ui.item.link ); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html }, } ); // when the input box is emptied $( this ).on( 'blur', function() { if ( ! $( this ).val() ) { $( '#htr_lang_' + tr_lang ).val( 0 ); // Value is retrieved from HTML already generated server side td.html( td.siblings( '.hidden' ).children().clone() ); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html } } ); } ); } init_translations(); // ajax for changing the term's language $( '#term_lang_choice' ).on( 'change', function() { var value = $( this ).val(); var lang = $( this ).children( 'option[value="' + value + '"]' ).attr( 'lang' ); var dir = $( '.pll-translation-column > span[lang="' + lang + '"]' ).attr( 'dir' ); var data = { action: 'term_lang_choice', lang: value, from_tag: $( "input[name='from_tag']" ).val(), term_id: $( "input[name='tag_ID']" ).val(), taxonomy: $( "input[name='taxonomy']" ).val(), post_type: typenow, _pll_nonce: $( '#_pll_nonce' ).val() }; $.post( ajaxurl, data, function( response ) { // Target a non existing WP HTML id to avoid a conflict with WP ajax requests. var res = wpAjax.parseAjaxResponse( response, 'pll-ajax-response' ); $.each( res.responses, function() { switch ( this.what ) { case 'translations': // translations fields // Data is built and come from server side and is well escaped when necessary $( "#term-translations" ).html( this.data ); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html init_translations(); break; case 'parent': // parent dropdown list for hierarchical taxonomies // data correctly escaped in PLL_Admin_Filters_Term::term_lang_choice method which uses wp_dropdown_categories function. $( '#parent' ).replaceWith( this.data ); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.replaceWith break; case 'tag_cloud': // popular items // data correctly escaped in PLL_Admin_Filters_Term::term_lang_choice method which uses wp_tag_cloud and wp_generate_tag_cloud functions. $( '.tagcloud' ).replaceWith( this.data ); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.replaceWith break; case 'flag': // flag in front of the select dropdown // Data is built and come from server side and is well escaped when necessary $( '.pll-select-flag' ).html( this.data ); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html break; } } ); // Modifies the text direction $( 'body' ).removeClass( 'pll-dir-rtl' ).removeClass( 'pll-dir-ltr' ).addClass( 'pll-dir-' + dir ); } ); } ); } );
Save
cmd:
run