Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Bookmarklet] Sort Transmogrifier

April 09 (7 years ago)
The Aaron
Pro
API Scripter
javascript:$('iframe').contents().find('.objects').each((c,e)=>{ let $e=$(e); $e.children().sort( (a,b)=>{ let name1=$(a).find(".name").text().toLowerCase(), name2=$(b).find(".name").text().toLowerCase(), comp = name1.localeCompare(name2); return comp; }) .each((i,c)=>$e.append(c)); });
This is a bookmarklet that will sort your transmogrifier lists.  In Chrome, just make a new bookmark with the above as the link.  When you have the transmogrifier open and select this link, it will sort the currently open lists.  You'll need to run it again when you choose a new list or after dragging things across to get the list back in order.

Happy Rolling!
April 09 (7 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Added to my folder of The Aaron Bookmarklets.
April 09 (7 years ago)
The Aaron
Pro
API Scripter
=D
Yeees. Aaron have you thought of making browser extention with little fixes like that for roll20 site or would it be too much work?
April 09 (7 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Also to the point, do you have a bookmarklet library/depository?
April 09 (7 years ago)
The Aaron
Pro
API Scripter
I have considered a Roll20 Specific browser extension in the past.  I've written several, one a commercial product for the company I work for.

However, it's not risen to the top of the priority stack yet. =D
April 09 (7 years ago)
The Aaron
Pro
API Scripter

keithcurtis said:

Also to the point, do you have a bookmarklet library/depository?

Just this: https://app.roll20.net/forum/post/2344777/slug%7D
April 09 (7 years ago)
vÍnce
Pro
Sheet Author
Added to my list of Aaron's other awesome bookmarklets...
April 09 (7 years ago)
vÍnce
Pro
Sheet Author

The Aaron said:

keithcurtis said:

Also to the point, do you have a bookmarklet library/depository?

Just this: https://app.roll20.net/forum/post/2344777/slug%7D
Added/updated.  ;-)

April 09 (7 years ago)

Edited April 09 (7 years ago)
The Aaron
Pro
API Scripter
You don't have this one:
javascript:(function(){ "use strict"; $('body').keydown(function(e) { var n,o,t; if( e && e.altKey && (48 <= e.keyCode) && (58 >= e.keyCode) ){ n=e.keyCode - ( 48===e.keyCode ? 38 : 49 ); o=$('#secondary-toolbar ul.mode.tokenactions'); if(o && 'none' !== o.css('display')) { t=o.children()[0].children[n]; if(t) { t.click(); } } } }); }());
It lets you hit alt-1 through alt-0 to activate one of the first 10 Token Action buttons on the selected token. =D

Edit: corrected that one...
April 09 (7 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

The Aaron said:

You don't have this one:
javascript:(function(){ "use strict"; $('body').keydown(function(e) { var n,o,t; if( e && e.altKey && (48 <= e.keyCode) && (58 >= e.keyCode) ){ n=e.keyCode - ( 48===e.keyCode ? 38 : 49 ); o=$('#secondary-toolbar ul.mode.tokenactions'); if(o && 'none' !== o.css('display')) { t=o.children()[0].children[n]; if(t) { t.click(); } } } }); }());
It lets you hit alt-1 through alt-0 to activate one of the first 10 Token Action buttons on the selected token. =D

Edit: corrected that one...

Same key on the Mac? Alt/Option doesn't usually invoke a command.
April 09 (7 years ago)
The Aaron
Pro
API Scripter
Yeah, same command (I'm on a Mac!). Have to have the map focused. 
You just saved me a lot of time. The Transmogrifier was such a pain. Aaron gets 5,000 XP!
April 10 (7 years ago)

Edited April 10 (7 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

The Aaron said:

Yeah, same command (I'm on a Mac!). Have to have the map focused. 

Phew. Otherwise, playing my favorite character, Sir ¡™£¢ of ∞§¶•ªº would be difficult.
April 10 (7 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

The Aaron said:

You don't have this one:
javascript:(function(){ "use strict"; $('body').keydown(function(e) { var n,o,t; if( e && e.altKey && (48 <= e.keyCode) && (58 >= e.keyCode) ){ n=e.keyCode - ( 48===e.keyCode ? 38 : 49 ); o=$('#secondary-toolbar ul.mode.tokenactions'); if(o && 'none' !== o.css('display')) { t=o.children()[0].children[n]; if(t) { t.click(); } } } }); }());
It lets you hit alt-1 through alt-0 to activate one of the first 10 Token Action buttons on the selected token. =D

Edit: corrected that one...

*Jaw Dropped*
April 10 (7 years ago)
The Aaron
Pro
API Scripter
BWAHAHAHAHA!!
April 10 (7 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hmm. I think I will need to re-name my token actions for this eventuality...
Too cool for words...thank you :-)
April 11 (7 years ago)

Edited April 11 (7 years ago)
New to the concept of bookmarklets, so probably not doing something that is simple to fix. 

I cannot seem to get the transmogrifier to sort. Created the marklet, have the transmogrifier open, nothing happens. I have gotten the bookmarklet for using alt # with the first 10 macros to work. And the chat size font as well. Both are very welcome utilities. Much appreciated.
I have one player who has trouble reading, the alt# will probably be a game changer for him, he just has to memorize the number associated with what he wants to do. 



April 11 (7 years ago)
The Aaron
Pro
API Scripter
Can you screenshot your bookmarklet and the javascript console?
This is the script I have in the url part

javascript:$('iframe').contents().find('.objects').each((c,e)=>{ let $e=$(e); $e.children().sort( (a,b)=>{ let name1=$(a).find(".name").text().toLowerCase(), name2=$(b).find(".name").text().toLowerCase(), comp = name1.localeCompare(name2); return comp; }) .each((i,c)=>$e.append(c)); });
April 11 (7 years ago)
The Aaron
Pro
API Scripter
hmm... that was less helpful than I was hoping. =/