PluginProbe ʕ •ᴥ•ʔ
Nested Pages / 3.2.14
Nested Pages v3.2.14
3.2.15 3.2.14 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.3.0 1.3.1 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.2 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.3.1 1.6.3.2 1.6.4 1.6.5 1.6.5.1 1.6.5.2 1.6.6 1.6.7 1.6.8 1.7.0 1.7.1 2.0.1 2.0.2 2.0.3 2.0.4 3.0.1 3.0.10 3.0.11 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.21 3.1.22 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7
wp-nested-pages / assets / js / lib / nestedpages.confirm-delete.js
wp-nested-pages / assets / js / lib Last commit date
jquery.mjs.nestedSortable.js 4 years ago jquery.ui.touch-punch.min.js 11 years ago nestedpages-factory.js 3 years ago nestedpages.bulk-actions.js 4 years ago nestedpages.check-all.js 9 years ago nestedpages.clone.js 3 years ago nestedpages.confirm-delete.js 8 years ago nestedpages.dropdowns.js 8 years ago nestedpages.formatter.js 3 years ago nestedpages.hidden-item-count.js 9 years ago nestedpages.manual-sync.js 9 years ago nestedpages.menu-links.js 3 years ago nestedpages.menu-search.js 4 days ago nestedpages.menu-toggle.js 8 years ago nestedpages.modals.js 8 years ago nestedpages.move-post.js 8 years ago nestedpages.nesting.js 3 years ago nestedpages.new-post.js 6 years ago nestedpages.page-toggle.js 4 years ago nestedpages.post-search.js 9 years ago nestedpages.quickedit-link.js 8 years ago nestedpages.quickedit-post.js 3 years ago nestedpages.settings-admin-customization.js 6 years ago nestedpages.settings-reset.js 6 years ago nestedpages.settings.js 3 years ago nestedpages.sync-menu-setting.js 8 years ago nestedpages.tabs.js 6 years ago nestedpages.trash-with-children.js 6 years ago nestedpages.trash.js 8 years ago nestedpages.userprefs-reset.js 7 years ago nestedpages.wpml.js 8 years ago
nestedpages.confirm-delete.js
70 lines
1 var NestedPages = NestedPages || {};
2
3 /**
4 * Confirm deletion of links
5 * @package Nested Pages
6 * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
7 */
8 NestedPages.ConfirmDelete = function()
9 {
10 var plugin = this;
11 var $ = jQuery;
12
13 // JS Data
14 plugin.deleteLink = ''; // Link for deleting the item
15
16 plugin.bindEvents = function()
17 {
18 $(document).on('click', NestedPages.selectors.linkDeleteButton, function(e){
19 e.preventDefault();
20 plugin.confirmSingle($(this));
21 });
22 $(document).on('click', NestedPages.selectors.linkDeleteConfirmationButton, function(e){
23 e.preventDefault();
24 if ( !$(this).hasClass('bulk') ){
25 plugin.deleteSingle();
26 return;
27 }
28 plugin.deleteMultiple();
29 });
30 $(document).on('submit', NestedPages.selectors.bulkActionsForm, function(e){
31 plugin.confirmMultiple(e);
32 });
33 }
34
35 // Confirm a single link deletion
36 plugin.confirmSingle = function(button)
37 {
38 plugin.deleteLink = $(button).attr('href');
39 $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation_singular);
40 $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.delete).removeClass('bulk');
41 $(document).trigger('open-modal-manual', NestedPages.selectors.linkDeleteConfirmationModal);
42 }
43
44 // Confirm Multiple link deletion
45 plugin.confirmMultiple = function(event)
46 {
47 if ( $('select[name="np_bulk_action"]').val() !== 'trash' ) return;
48 var linkCount = $(NestedPages.selectors.bulkActionRedirectIds).val();
49 if ( linkCount === '' ) return;
50 event.preventDefault();
51 $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation);
52 $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.trash_delete_links).addClass('bulk');
53 $(document).trigger('open-modal-manual', [NestedPages.selectors.linkDeleteConfirmationModal]);
54 }
55
56 // Submit the form to delete multiple
57 plugin.deleteMultiple = function()
58 {
59 $(NestedPages.selectors.bulkActionsForm)[0].submit();
60 }
61
62 // Delete the single
63 plugin.deleteSingle = function()
64 {
65 window.location.replace(plugin.deleteLink);
66 }
67
68 return plugin.bindEvents();
69 }
70