-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to three-state approach (#31)
* # * Switch to three-state approach * Update readme.txt * Use wp_parse_url * Update test-user-meta.php
- Loading branch information
Showing
6 changed files
with
123 additions
and
46 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 |
---|---|---|
|
@@ -55,4 +55,3 @@ label.image-radio-option input { | |
float: none !important; | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -1,7 +1,31 @@ | ||
jQuery(function($){ | ||
$('tr:has(.submitapprove)').css('background-color', '#FFFFE0'); | ||
$('.actions select[name^="action"]').append( | ||
'<option value="wpau_bulk_approve">' + wp_approve_user.approve + '</option>' + | ||
'<option value="wpau_bulk_unapprove">' + wp_approve_user.unapprove + '</option>' | ||
); | ||
}); | ||
document.addEventListener('DOMContentLoaded', function() { | ||
// Select all table rows | ||
document.querySelectorAll('tr').forEach(function(row) { | ||
// Check if the row has an element with class 'submitapprove' | ||
let hasSubmitApprove = row.querySelector('.submitapprove') !== null; | ||
// Check if the row has an element with class 'submitunapprove' | ||
let hasSubmitUnapprove = row.querySelector('.submitunapprove') !== null; | ||
|
||
// If the row has both 'submitapprove' and 'submitunapprove' elements, change background color to '#FFFFE0' | ||
if (hasSubmitApprove && hasSubmitUnapprove) { | ||
row.style.backgroundColor = '#FFFFE0'; | ||
} | ||
// If the row has only 'submitapprove' element, change background color to '#FAAFAA' | ||
else if (hasSubmitApprove) { | ||
row.style.backgroundColor = '#FAAFAA'; | ||
} | ||
}); | ||
|
||
// Append options to the select elements with name starting with 'action' inside elements with class 'actions' | ||
document.querySelectorAll('.actions select[name^="action"]').forEach(function(select) { | ||
var optionApprove = document.createElement('option'); | ||
optionApprove.value = 'wpau_bulk_approve'; | ||
optionApprove.textContent = wp_approve_user.approve; | ||
select.appendChild(optionApprove); | ||
|
||
var optionUnapprove = document.createElement('option'); | ||
optionUnapprove.value = 'wpau_bulk_unapprove'; | ||
optionUnapprove.textContent = wp_approve_user.unapprove; | ||
select.appendChild(optionUnapprove); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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