Discussion Forum: Thread 331304

 Author: Fizzers View Messages Posted By Fizzers
 Posted: Dec 8, 2022 08:38
 Subject: Counter for Show Temporary Checkboxes
 Viewed: 98 times
 Topic: Suggestions
 Status:Open
 Vote:[Yes|No]
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

Fizzers (447)

Location:  Austria, Niederösterreich
Member Since Contact Type Status
Aug 22, 2018 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Fish and Bricks
At the bottom of the order page there is the function "Show Temporary Checkboxes".
It would be very useful to show a counter beside that how many checkboxes are
checked. So you can easily check if an order is complete especially for orders
with a high lot count.
 Author: peregrinator View Messages Posted By peregrinator
 Posted: Dec 8, 2022 08:49
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 29 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

peregrinator (768)

Location:  USA, New Jersey
Member Since Contact Type Status
Jan 21, 2003 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Faber Family Bricks
In Suggestions, Fizzers writes:
  At the bottom of the order page there is the function "Show Temporary Checkboxes".
It would be very useful to show a counter beside that how many checkboxes are
checked. So you can easily check if an order is complete especially for orders
with a high lot count.

If you're comfortable using the browser console, you can do this:

document.querySelectorAll('input[name="tempBox"]:checked'.length
 Author: peregrinator View Messages Posted By peregrinator
 Posted: Dec 8, 2022 08:50
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 33 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

peregrinator (768)

Location:  USA, New Jersey
Member Since Contact Type Status
Jan 21, 2003 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Faber Family Bricks
In Suggestions, peregrinator writes:
  In Suggestions, Fizzers writes:
  At the bottom of the order page there is the function "Show Temporary Checkboxes".
It would be very useful to show a counter beside that how many checkboxes are
checked. So you can easily check if an order is complete especially for orders
with a high lot count.

If you're comfortable using the browser console, you can do this:

Ugh emojis

document.querySelectorAll( 'input[ name="tempBox" ]:checked' ).length
 Author: peregrinator View Messages Posted By peregrinator
 Posted: Dec 8, 2022 09:24
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 33 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

peregrinator (768)

Location:  USA, New Jersey
Member Since Contact Type Status
Jan 21, 2003 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Faber Family Bricks
In Suggestions, peregrinator writes:
  In Suggestions, peregrinator writes:
  In Suggestions, Fizzers writes:
  At the bottom of the order page there is the function "Show Temporary Checkboxes".
It would be very useful to show a counter beside that how many checkboxes are
checked. So you can easily check if an order is complete especially for orders
with a high lot count.

If you're comfortable using the browser console, you can do this:

Ugh emojis

document.querySelectorAll( 'input[ name="tempBox" ]:checked' ).length

PS I've just tested this on a very large (for me) order and it worked like
a charm. It might also be possible to get the quantity but I haven't attempted
that yet.
 Author: peregrinator View Messages Posted By peregrinator
 Posted: Dec 8, 2022 12:04
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 39 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

peregrinator (768)

Location:  USA, New Jersey
Member Since Contact Type Status
Jan 21, 2003 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Faber Family Bricks
In Suggestions, peregrinator writes:
  PS I've just tested this on a very large (for me) order and it worked like
a charm. It might also be possible to get the quantity but I haven't attempted
that yet.

OK, assuming that BL doesn't change the layout of the page, and that the
quantity is the first column encountered with the specific CSS class, and that
temporary checkboxes are enabled, this will give you the # of lots checked and
the total quantity of lots checked:

let lots = 0;
let qty = 0;
$$( "input[ name='tempBox' ]:checked" ).forEach( (item) = {
++lots;
if ( item.closest("tr").querySelectorAll( "td._bltrightalign" ).length ) {
let itemQty = item.closest("tr").querySelectorAll( "td._bltrightalign" )[0].innerHTML;
if ( !isNaN( itemQty ) ) {
qty += +itemQty;
}
}
});
console.log( `Lots = ${lots}, Quantity = ${qty}` );
 Author: peregrinator View Messages Posted By peregrinator
 Posted: Dec 8, 2022 12:19
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 31 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

peregrinator (768)

Location:  USA, New Jersey
Member Since Contact Type Status
Jan 21, 2003 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Faber Family Bricks
In Suggestions, peregrinator writes:
  $$( "input[ name='tempBox' ]:checked" ).forEach( (item) = {

You may have to replace this line with:

$$( "input[ name='tempBox' ]:checked" ).forEach( function(item) {

The first one worked in one browser but not another
 Author: SylvainLS View Messages Posted By SylvainLS
 Posted: Dec 8, 2022 12:23
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 26 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

SylvainLS (46)

Location:  France, Nouvelle-Aquitaine
Member Since Contact Type Status
Apr 25, 2014 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store Closed Store: BuyerOnly
BrickLink Discussions Moderator (?)
In Suggestions, peregrinator writes:
  In Suggestions, peregrinator writes:
  $$( "input[ name='tempBox' ]:checked" ).forEach( (item) = {

You may have to replace this line with:

$$( "input[ name='tempBox' ]:checked" ).forEach( function(item) {

The first one worked in one browser but not another

The joys of ECMAScript….
 Author: peregrinator View Messages Posted By peregrinator
 Posted: Dec 8, 2022 12:29
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 25 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

peregrinator (768)

Location:  USA, New Jersey
Member Since Contact Type Status
Jan 21, 2003 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Faber Family Bricks
In Suggestions, SylvainLS writes:
  In Suggestions, peregrinator writes:
  In Suggestions, peregrinator writes:
  $$( "input[ name='tempBox' ]:checked" ).forEach( (item) = {

You may have to replace this line with:

$$( "input[ name='tempBox' ]:checked" ).forEach( function(item) {

The first one worked in one browser but not another

The joys of ECMAScript….

Actually, I see what the problem is, I had an arrow but the message board replaced
it with a mere =

Anyway, the latter (old function notation) is more easily copied here.
 Author: SylvainLS View Messages Posted By SylvainLS
 Posted: Dec 8, 2022 12:34
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 21 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

SylvainLS (46)

Location:  France, Nouvelle-Aquitaine
Member Since Contact Type Status
Apr 25, 2014 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store Closed Store: BuyerOnly
BrickLink Discussions Moderator (?)
In Suggestions, peregrinator writes:
  […]
Actually, I see what the problem is, I had an arrow but the message board replaced
it with a mere =

Anyway, the latter (old function notation) is more easily copied here.

Well, using the forum as a copy-paste source sure isn’t the best idea
 Author: 1001bricks View Messages Posted By 1001bricks
 Posted: Dec 8, 2022 13:50
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 37 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

1001bricks (52268)

Location:  France, Provence-Alpes-Côte d'Azur
Member Since Contact Type Status
Sep 6, 2005 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: 1001bricks
  Anyway, the latter (old function notation) is more easily copied here.

Use pastebin or such, things don't go through forum...
https://pastebin.com/
 Author: peregrinator View Messages Posted By peregrinator
 Posted: Dec 8, 2022 15:20
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 21 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

peregrinator (768)

Location:  USA, New Jersey
Member Since Contact Type Status
Jan 21, 2003 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Faber Family Bricks
In Suggestions, 1001bricks writes:
  
  Anyway, the latter (old function notation) is more easily copied here.

Use pastebin or such, things don't go through forum...
https://pastebin.com/

yeah yeah yeah

Anyway it works I'm thinking about the possibility of turning it into
a browser extension (unless there's already one out there).
 Author: 1001bricks View Messages Posted By 1001bricks
 Posted: Dec 8, 2022 12:24
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 25 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

1001bricks (52268)

Location:  France, Provence-Alpes-Côte d'Azur
Member Since Contact Type Status
Sep 6, 2005 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: 1001bricks
  console.log( `Lots = ${lots}, Quantity = ${qty}` );

Do it in ASM or you aren't a real man.
 Author: peregrinator View Messages Posted By peregrinator
 Posted: Dec 8, 2022 12:28
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 19 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

peregrinator (768)

Location:  USA, New Jersey
Member Since Contact Type Status
Jan 21, 2003 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Faber Family Bricks
In Suggestions, 1001bricks writes:
  
  console.log( `Lots = ${lots}, Quantity = ${qty}` );

Do it in ASM or you aren't a real man.

It was very trying to accomplish it in vanilla JS (I'm much more used to
working with jQuery) so I'm afraid I have to say

NON
 Author: Nubs_Select View Messages Posted By Nubs_Select
 Posted: Dec 8, 2022 11:36
 Subject: Re: Counter for Show Temporary Checkboxes
 Viewed: 21 times
 Topic: Suggestions
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

Nubs_Select (3734)

Location:  Canada, Ontario
Member Since Contact Type Status
Mar 15, 2016 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Nub's Select
In Suggestions, peregrinator writes:
  In Suggestions, peregrinator writes:
  In Suggestions, Fizzers writes:
  At the bottom of the order page there is the function "Show Temporary Checkboxes".
It would be very useful to show a counter beside that how many checkboxes are
checked. So you can easily check if an order is complete especially for orders
with a high lot count.

If you're comfortable using the browser console, you can do this:

Ugh emojis

document.querySelectorAll( 'input[ name="tempBox" ]:checked' ).length