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

Apply Selected as a Patch operation #41

Open
eonwarped opened this issue Oct 5, 2018 · 0 comments
Open

Apply Selected as a Patch operation #41

eonwarped opened this issue Oct 5, 2018 · 0 comments

Comments

@eonwarped
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant