File Editor
Directories:
.. (Back)
externals
languages
Files:
academy.js
addon-installation.js
admin-global.js
admin-modules.js
analysis-worker.js
api-client.js
block-editor.js
bulk-editor.js
classic-editor.js
crawl-settings.js
dashboard-widget.js
dynamic-blocks.js
edit-page.js
editor-modules.js
elementor.js
externals-components.js
externals-contexts.js
externals-redux.js
faq-block.js
filter-explanation.js
first-time-configuration.js
frontend-inspector-resources.js
general-page.js
help-scout-beacon.js
how-to-block.js
import.js
indexation.js
installation-success.js
integrations-page.js
introductions.js
network-admin.js
new-settings.js
post-edit.js
quick-edit-handler.js
react-select.js
redirect-old-features-tab.js
reindex-links.js
settings.js
support.js
term-edit.js
used-keywords-assessment.js
wincher-dashboard-widget.js
workouts.js
Create New File
Create
Edit File: bulk-editor.js
(()=>{"use strict";var e={n:n=>{var s=n&&n.__esModule?()=>n.default:()=>n;return e.d(s,{a:s}),s},d:(n,s)=>{for(var t in s)e.o(s,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:s[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n)};const n=window.jQuery;var s,t=e.n(n);s=function(e){var n=e.find("[class^=wpseo-new]").first().attr("class"),s="#"+n+"-",i=s.replace("new","existing"),a=e.find("th[id^=col_existing_yoast]").first().text().replace("Existing ",""),o=n.replace("-new-","_save_"),l="wpseo_save_all_"+e.attr("class").split("wpseo_bulk_")[1],r=o.replace("wpseo_save_",""),c={newClass:"."+n,newId:s,existingId:i},d={submit_new:function(e){d.submitNew(e)},submitNew:function(e){var n,s=c.newId+e,i=c.existingId+e;n="select-one"===t()(c.newId+e).prop("type")?t()(s).find(":selected").text():t()(s).val();var l=t()(i).html();if(n===l)t()(s).val("");else{if(""===n&&!window.confirm("Are you sure you want to remove the existing "+a+"?"))return void t()(s).val("");var r={action:o,_ajax_nonce:wpseoBulkEditorNonce,wpseo_post_id:e,new_value:n,existing_value:l};t().post(ajaxurl,r,d.handleResponse)}},submit_all:function(e){d.submitAll(e)},submitAll:function(e){e.preventDefault();var n={action:l,_ajax_nonce:wpseoBulkEditorNonce,send:!1,items:{},existingItems:{}};t()(c.newClass).each((function(){var e=t()(this).data("id"),s=t()(this).val(),i=t()(c.existingId+e).html();""!==s&&(s===i?t()(c.newId+e).val(""):(n.send=!0,n.items[e]=s,n.existingItems[e]=i))})),n.send&&t().post(ajaxurl,n,d.handleResponses)},handle_response:function(e,n){d.handleResponse(e,n)},handleResponse:function(e,n){if("success"===n){var s=e;if("string"==typeof s&&(s=JSON.parse(s)),s instanceof Array)t().each(s,(function(){d.handleResponse(this,n)}));else if("success"===s.status){var i=s["new_"+r];t()(c.existingId+s.post_id).text(i.replace(/\\(?!\\)/g,"")),t()(c.newId+s.post_id).val("")}}},handle_responses:function(e,n){d.handleResponses(e,n)},handleResponses:function(e,n){var s=t().parseJSON(e);t().each(s,(function(){d.handleResponse(this,n)}))},set_events:function(){d.setEvents()},setEvents:function(){e.find(".wpseo-save").click((function(e){var n=t()(this).data("id");e.preventDefault(),d.submitNew(n,this)})),e.find(".wpseo-save-all").click(d.submitAll),e.find(c.newClass).keydown((function(e){if(13===e.which){e.preventDefault();var n=t()(this).data("id");d.submitNew(n,this)}}))}};return d},window.bulk_editor=s,window.bulkEditor=s,t()(document).ready((function(){t()('table[class*="wpseo_bulk"]').each((function(e,n){var i=t()(n);s(i).setEvents()}))}))})();
Save Changes
Rename File
Rename