Skip to content
This repository was archived by the owner on Sep 25, 2023. It is now read-only.
This repository was archived by the owner on Sep 25, 2023. It is now read-only.

Apply Selected as a Patch operation #41

@eonwarped

Description

@eonwarped

Was in need of this feature and had a bit of a hack to accomplish what I needed. Sometimes I'd want to bulk adjust everyone selected and only adjust for example the timing to 15 minutes. If I wanted to do that now, I'd have to group the accounts by similar settings and handle it that way.

Suggestion: In the "apply selected" dialog, when specifying "empty" settings, have it preserve the existing setting in each row.

Here is what I did as a workaround to mass set everyone's daily limit to 1:

Select a bunch of people.
Set a breakpoint inside the settingsforselectedfans function, and advance to just before the for loop.
Then run the following in the console:

for(var i=0, n=checkboxes.length;i<n;i++) { 
  if(checkboxes[i].checked){
    var user = checkboxes[i].id;

    // preserve minute
    minute = parseInt(checkboxes[i].parentNode.parentNode.getElementsByTagName('td')[5].firstChild.nodeValue);

    // preserve weight
    weight = parseInt(checkboxes[i].parentNode.parentNode.getElementsByTagName('td')[4].firstChild.nodeValue);

    const body = 'fan=' + encodeURIComponent(user) +
        '&weight=' + encodeURIComponent(weight) +
	'&minute=' + encodeURIComponent(minute) +
	'&enable=' + encodeURIComponent(enable) +
	'&dailylimit=' + encodeURIComponent(dailylimit)

        callApi('api/v1/dashboard/fanbase/settings', body)	
  }
}

Obviously it won't necessarily look like this, probably much cleaner ways to identify the correct cell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions