Пользовательские скрипты bookmarklets
Что такое букмарклет
javascript:alert("Hi, I'm a Bookmarklet!");javascript:(function(){$("#floatingtoolbar").css("display",function(i,o){return ('block' === o ? 'none' : 'block');});})();javascript:(function(){$("#zoomslider").css("display","none");$("#floatingtoolbar").css("display","none");$("#sidebarcontrol").click();$("#playerzone").css("display","none");})();javascript:(function(){ var links=$('#libraryview .library-container').map(function(idx,block){ var $block=$(block), img=$block.find('img'),name=$block.find('.library-labelcontainer span').text(), ext = img.attr('src').match(/\b(?:thumb|max|original)\b\.(\w*)/)[1]; return $('<a style="border:1px solid #999;float:left;display:block;width:52px;height:52px;" href="'+img.attr('src').replace(/\b(?:thumb|max)\b/,'original')+'" download="'+name+'.'+ext+'"><img class="UserLibraryImage" style="max-width:50px;max-height:50px;" src="'+img.attr('src').replace(/\b(?:thumb|max)\b/,'original')+'"></a>').click(function(){$(this).css('opacity',0.5);});}).toArray(); $('<div style="position:absolute;width:100%;height:100%;overflow-y:auto;top:0;left0;z-index:1000000;background-color: #ccc;"></div>').html(links).appendTo('body');}());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(); } } } }); }());Firefox
Chromium
Roll20 Clear Ui
javascript:(function(){$("#zoomslider").css("display","none");$("#floatingtoolbar").css("display","none");$("#sidebarcontrol").css("display","none").click();$("#playerzone").css("display","none");$("#initiativewindow").parent().css("left","-10000px")})();Sort Maps
javascript:(function(){ $('#page-toolbar').height('800px');$('#page-toolbar .container').css({height: '800px','white-space': 'normal'});}());Highlight Active Song in Jukebox
javascript:(function(){_.each($('#jukebox').find('tr'),function(r){var $r=$(r),$b=$($r.find('button'));if($b.hasClass('pause')){$r.css({backgroundColor: '#ff0000'});}});}());expand page toolbar
javascript:(function(){ $('#page-toolbar').height('480px') .width('80%');$('#page-toolbar .container').css({height: '480px', 'width':'80%', 'white-space': 'normal'});}());Clear ui gm
Copy all api scripts (only .js)
Copy all active api scripts
User Library Image Download Helper
pages
Macro bar on multiple lines - Roll20 forum
Expand page toolbar
pages
sort maps
sort transmogripher
bookmarklet scripts
roll20:clear UI
roll20:clearUIgm
tes
Highlight Audio Playing Jukebox
Copy ALL API Scripts
Copy Only ACTIVE API Scripts
User Library Image Download Helper
copy api
In Chrome, make a bookmark with that text as the URL. When on an API page, click it and it will append a textarea to the bottom of the page with all the scripts concatenated together into a single block of text (with a nice divider). Then you can just click in and hit ctrl-A (or cmd-A on the Mac) and copy it.
javascript:(function(){$('#textchat-input textarea').val('%{Macros|Game}');$('#textchat-input button').click();})();
...will invoke the ability macro 'Game' on the character 'Macros'. This can be saved to a bookmarklet in Chrome. (it should work in any browser that supports javascript in the URL bar). Basically, create a blank bookmark, and assign the code to it. It must start with "javascript:". Some browsers blank that out unless you specifically type it, so make sure it's there at the beginning. Give the Bookmarklet a unique name. For the one above, I used 'JMGame', for Javascript Menu Game. You can also put in API commands, boilerplate text, or anything you could physically type.
Resize Turn Tracker: a per-session bookmarklet that reduces the size of the turn tracker. ref:(https://app.roll20.net/forum/permalink/2317121/)
javascript:(function(){ $('#initiativewindow .characterlist .name').hide();$('#initiativewindow').parent().css('width','100px'); })(); Here's one that sets it back: javascript:(function(){ $('#initiativewindow .characterlist .name').show();$('#initiativewindow').parent().css('width','200px'); })();
You can actually do this locally via a Bookmarklet:
Sort Transmogrifier list ref.(https://app.roll20.net/forum/permalink/4891027/)
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.
Cycle thru Token Ability Macros ref.(https://app.roll20.net/forum/permalink/4891568/)
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.
[script REQ] Aaron's Roll20 Enhancement pack - Roll20 forum
Last updated
Was this helpful?
