Changeset 3296226
- Timestamp:
- 05/19/2025 07:21:19 AM (11 months ago)
- Location:
- filerobot-digital-asset-management-and-acceleration
- Files:
-
- 31 added
- 4 edited
-
tags/4.0.12 (added)
-
tags/4.0.12/.gitignore (added)
-
tags/4.0.12/LICENSE.txt (added)
-
tags/4.0.12/README.txt (added)
-
tags/4.0.12/assets (added)
-
tags/4.0.12/assets/scripts (added)
-
tags/4.0.12/assets/scripts/core.js (added)
-
tags/4.0.12/assets/scripts/filerobot-enfold-theme.js (added)
-
tags/4.0.12/assets/scripts/fmaw.js (added)
-
tags/4.0.12/assets/scripts/image_editor.js (added)
-
tags/4.0.12/assets/scripts/jquery.initialize.js (added)
-
tags/4.0.12/assets/styles (added)
-
tags/4.0.12/assets/styles/acf-fmaw.css (added)
-
tags/4.0.12/assets/styles/core.css (added)
-
tags/4.0.12/assets/styles/flexboxgrid.min.css (added)
-
tags/4.0.12/assets/styles/gutenberg-fmaw-only.css (added)
-
tags/4.0.12/assets/styles/gutenberg-fmaw.css (added)
-
tags/4.0.12/filerobot_api.php (added)
-
tags/4.0.12/filerobot_class.php (added)
-
tags/4.0.12/filerobot_description_page.php (added)
-
tags/4.0.12/filerobot_fmaw_page.php (added)
-
tags/4.0.12/filerobot_image_edit_page.php (added)
-
tags/4.0.12/filerobot_log_page.php (added)
-
tags/4.0.12/filerobot_main_admin_page.php (added)
-
tags/4.0.12/filerobot_settings_page.php (added)
-
tags/4.0.12/filerobot_support_page.php (added)
-
tags/4.0.12/languages (added)
-
tags/4.0.12/languages/filerobot-en_US.mo (added)
-
tags/4.0.12/languages/filerobot-en_US.po (added)
-
tags/4.0.12/languages/filerobot.pot (added)
-
tags/4.0.12/loader.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/assets/scripts/fmaw.js (modified) (2 diffs)
-
trunk/filerobot_class.php (modified) (previous)
-
trunk/loader.php (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
filerobot-digital-asset-management-and-acceleration/trunk/README.txt
r3294556 r3296226 5 5 Tested up to: 6.8 6 6 Requires at least: 4.8 7 Stable tag: 4.0.1 17 Stable tag: 4.0.12 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 224 224 = 4.0.11 = 225 225 * Fix bug sync assets 226 = 4.0.12 = 227 * Add option keep data when deactivate plugin 226 228 227 229 == Upgrade Notice == -
filerobot-digital-asset-management-and-acceleration/trunk/assets/scripts/fmaw.js
r3174729 r3296226 50 50 51 51 jQuery(document).ready(function($) { 52 $('.deactivate a').click(function(e) { 53 if ($(this).attr('id') === 'deactivate-filerobot-digital-asset-management-and-acceleration') { 54 e.preventDefault(); 55 showModal(); 56 return false; 57 58 } 59 }); 60 52 61 // event resize image in classic editor 53 62 let isClassicEditor = ($('#wp-content-wrap').length > 0 && $('#wp-content-wrap').hasClass('tmce-active')) ? true : false; … … 465 474 } 466 475 } 476 477 function showModal() { 478 // Check if modal is already exists 479 if (document.getElementById("modalOverlay")) return; 480 481 // Create overlay 482 let overlay = document.createElement("div"); 483 overlay.id = "modalOverlay"; 484 overlay.style.position = "fixed"; 485 overlay.style.top = "0"; 486 overlay.style.left = "0"; 487 overlay.style.width = "100%"; 488 overlay.style.height = "100%"; 489 overlay.style.background = "rgba(0, 0, 0, 0.5)"; 490 overlay.style.display = "flex"; 491 overlay.style.justifyContent = "center"; 492 overlay.style.alignItems = "center"; 493 overlay.style.zIndex = "1000"; 494 495 // Create modal 496 let modal = document.createElement("div"); 497 modal.style.background = "white"; 498 modal.style.padding = "20px"; 499 modal.style.borderRadius = "8px"; 500 modal.style.width = "400px"; 501 modal.style.textAlign = "center"; 502 modal.style.boxShadow = "0 4px 10px rgba(0, 0, 0, 0.2)"; 503 504 // Modal header 505 let title = document.createElement("h3"); 506 title.innerText = "Scaleflex DAM"; 507 508 // Content 509 let message = document.createElement("p"); 510 message.setAttribute("id", "sfxMessage"); 511 message.innerText = ""; 512 513 // Question 514 let question = document.createElement("p"); 515 question.innerText = "Are you sure you want to deactivate the plugin?"; 516 517 // Select option text 518 let optionText = document.createElement("p"); 519 optionText.innerText = "Please select an option below to deactivate the plugin:"; 520 521 // Radio button 522 let radioContainer = document.createElement("div"); 523 radioContainer.style.marginTop = "15px"; 524 radioContainer.style.textAlign = "left"; 525 526 let radioWrapper0 = document.createElement("div"); 527 528 let radio0 = document.createElement("input"); 529 radio0.type = "radio"; 530 radio0.name = "keep_data"; 531 radio0.value = "0"; 532 radio0.id = "keep_data_0"; 533 534 let label0 = document.createElement("label"); 535 label0.htmlFor = "keep_data_0"; 536 label0.innerText = "Delete all plugin data."; 537 538 radioWrapper0.appendChild(radio0); 539 radioWrapper0.appendChild(label0); 540 541 let radioWrapper1 = document.createElement("div"); 542 radioWrapper1.style.marginTop = "5px"; 543 544 let radio1 = document.createElement("input"); 545 radio1.type = "radio"; 546 radio1.name = "keep_data"; 547 radio1.value = "1"; 548 radio1.id = "keep_data_1"; 549 radio1.defaultChecked = true; 550 551 let label1 = document.createElement("label"); 552 label1.htmlFor = "keep_data_1"; 553 label1.innerText = "Keep all plugin data."; 554 555 radioWrapper1.appendChild(radio1); 556 radioWrapper1.appendChild(label1); 557 558 radioContainer.appendChild(radioWrapper0); 559 radioContainer.appendChild(radioWrapper1); 560 561 // Submit 562 let submitBtn = document.createElement("button"); 563 submitBtn.innerText = "Yes"; 564 submitBtn.style.background = "#d891ef"; 565 submitBtn.style.padding = "10px"; 566 submitBtn.style.border = "none"; 567 submitBtn.style.cursor = "pointer"; 568 submitBtn.style.marginTop = "15px"; 569 submitBtn.onclick = closeModalAndSendRequest; 570 571 // Cancel 572 let skipBtn = document.createElement("button"); 573 skipBtn.innerText = "No"; 574 skipBtn.style.background = "#ddd"; 575 skipBtn.style.padding = "10px"; 576 skipBtn.style.border = "none"; 577 skipBtn.style.cursor = "pointer"; 578 skipBtn.style.marginLeft = "15px"; 579 skipBtn.onclick = closeModal; 580 581 modal.appendChild(title); 582 modal.appendChild(message); 583 modal.appendChild(question); 584 modal.appendChild(optionText); 585 modal.appendChild(radioContainer); 586 modal.appendChild(submitBtn); 587 modal.appendChild(skipBtn); 588 overlay.appendChild(modal); 589 document.body.appendChild(overlay); 590 } 591 592 function closeModalAndSendRequest() { 593 let keep_data = jQuery('input[name="keep_data"]:checked').val(); 594 const data = { 595 action: 'filerobot_deactivate_plugin', 596 keep_data: keep_data 597 }; 598 599 let overlay = document.getElementById("modalOverlay"); 600 if (overlay) { 601 overlay.remove(); 602 } 603 604 jQuery.ajax({ 605 type: 'POST', 606 url: ajaxurl, 607 data: data, 608 dataType: 'json' 609 }).done(function (res) { 610 if (res.success) { 611 window.location.href = jQuery('#deactivate-filerobot-digital-asset-management-and-acceleration').attr('href'); 612 } else { 613 return false; 614 } 615 }); 616 return true; 617 } 618 619 function closeModal() { 620 let overlay = document.getElementById("modalOverlay"); 621 if (overlay) { 622 overlay.remove(); 623 } 624 }
Note: See TracChangeset
for help on using the changeset viewer.