-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
107 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.blinking-dot { | ||
display: inline-block; | ||
width: 10px; | ||
height: 10px; | ||
background-color: #00ff00; | ||
border-radius: 50%; | ||
animation: blink 1s infinite; | ||
} | ||
|
||
@keyframes blink { | ||
0% { | ||
opacity: 0; | ||
} | ||
|
||
50% { | ||
opacity: 1; | ||
} | ||
|
||
100% { | ||
opacity: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
jQuery(document).ready(function($) { | ||
var originalValues = {}; | ||
|
||
// Store original values | ||
$('form#mmg-checkout-settings-form :input').each(function() { | ||
originalValues[this.id] = $(this).val(); | ||
}); | ||
|
||
$('.toggle-secret-key').click(function() { | ||
var targetId = $(this).data('target'); | ||
var secretKeyInput = $('#' + targetId); | ||
if (secretKeyInput.attr('type') === 'password') { | ||
secretKeyInput.attr('type', 'text'); | ||
$(this).text('Hide'); | ||
} else { | ||
secretKeyInput.attr('type', 'password'); | ||
$(this).text('Show'); | ||
} | ||
}); | ||
|
||
function toggleLiveModeIndicator() { | ||
if ($('#mmg_mode').val() === 'live') { | ||
$('#live-mode-indicator').show(); | ||
} else { | ||
$('#live-mode-indicator').hide(); | ||
} | ||
} | ||
|
||
$('#mmg_mode').on('change', toggleLiveModeIndicator); | ||
toggleLiveModeIndicator(); // Initial state | ||
|
||
$('form#mmg-checkout-settings-form').submit(function(e) { | ||
var changedFields = []; | ||
$('form#mmg-checkout-settings-form :input').each(function() { | ||
if ($(this).val() !== originalValues[this.id]) { | ||
changedFields.push($(this).closest('tr').find('th').text()); | ||
} | ||
}); | ||
|
||
if (changedFields.length > 0) { | ||
var confirmMessage = ''; | ||
if (changedFields.includes('Mode')) { | ||
var oldMode = originalValues['mmg_mode']; | ||
var newMode = $('#mmg_mode').val(); | ||
confirmMessage = 'You have switched from ' + oldMode + ' to ' + newMode + '.\n\nAre you sure you want to save this change?'; | ||
} else { | ||
confirmMessage += 'You have changed the following fields:\n' + changedFields.join('\n') + '\nAre you sure you want to save these changes?'; | ||
} | ||
if (!confirm(confirmMessage)) { | ||
e.preventDefault(); | ||
} | ||
} | ||
}); | ||
}); | ||
|
||
function copyToClipboard(text) { | ||
var tempInput = document.createElement('input'); | ||
tempInput.value = text; | ||
document.body.appendChild(tempInput); | ||
tempInput.select(); | ||
document.execCommand('copy'); | ||
document.body.removeChild(tempInput); | ||
|
||
var successMessage = document.getElementById('copy-success'); | ||
successMessage.style.display = 'inline'; | ||
setTimeout(function() { | ||
successMessage.style.display = 'none'; | ||
}, 2000); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes