Skip to content

Commit

Permalink
Add Toggle all user attributes to export users
Browse files Browse the repository at this point in the history
  • Loading branch information
pro4tlzz committed Aug 2, 2023
1 parent ae1315b commit 3da64d9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions rockstar/rockstar.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@

function addCheckbox(value, text) {
const checked = exportColumns.includes(value) ? "checked" : "";
checkboxDiv.html(checkboxDiv.html() + `<label><input type=checkbox value='${e(value)}' ${checked}>${e(text)}</label><br>`);
checkboxDiv.html(checkboxDiv.html() + `<label><input type=checkbox value='${e(value)}' class='userProfileAttributeCheckboxes' ${checked}>${e(text)}</label><br>`);
}
const user = {
id: "User Id",
Expand Down Expand Up @@ -643,7 +643,16 @@
for (const p in profile) addCheckbox("profile." + p, profile[p]);
errorBox.html('Unable to fetch custom attributes. Use an account with more privileges.<br>Only base attributes shown below.');
});

selectAllAttributesButton = exportPopup.append(`<br><input type='button' button class='link-button' id='selectAllAttributes' value='Toggle All'>`);
$('#selectAllAttributes').on("click", function () {
if ($(this).val() == 'Toggle All' || $(this).val() == 'Check All') {
$('.userProfileAttributeCheckboxes').prop('checked', true);
$(this).val('Uncheck All');
} else {
$('.userProfileAttributeCheckboxes').prop('checked', false);
$(this).val('Check All');
}
});
if (filter) {
var exportArgs = localStorage.rockstarExportUserArgs || "";
exportPopup.append(
Expand Down

0 comments on commit 3da64d9

Please sign in to comment.