diff --git a/docs/ScreenCapLibrary.html b/docs/ScreenCapLibrary.html index 2af13e5..b204008 100644 --- a/docs/ScreenCapLibrary.html +++ b/docs/ScreenCapLibrary.html @@ -5,7 +5,7 @@ - + + @@ -571,18 +638,26 @@

Opening library documentation failed

$(document).ready(function() { parseTemplates(); document.title = libdoc.name; + storage.init('libdoc'); renderTemplate('base', libdoc, $('body')); if (libdoc.inits.length) { renderTemplate('importing', libdoc); } renderTemplate('shortcuts', libdoc); + initShortcutListStyle('shortcut', libdoc.keywords); if (libdoc.contains_tags) { renderTemplate('tags', libdoc); + initShortcutListStyle('tag', libdoc.all_tags); } renderTemplate('keywords', libdoc); renderTemplate('footer', libdoc); + params = util.parseQueryString(window.location.search.slice(1)); + if ("tag" in params) { + tagSearch(params["tag"], window.location.hash); + } scrollToHash(); - $(document).bind('keydown', handleKeydown); + $(document).bind('keydown', handleKeyDown); + workaroundFirefoxWidthBug(); }); function parseTemplates() { @@ -602,7 +677,27 @@

Opening library documentation failed

$.tmpl(name + '-template', arguments).appendTo(container); } - function handleKeydown(event) { + function workaroundFirefoxWidthBug() { + // https://github.com/robotframework/robotframework/issues/3456 + // https://bugzilla.mozilla.org/show_bug.cgi?id=1613163 + $('.shortcuts a').width('max-content'); + } + + function initShortcutListStyle(name, items) { + var style = storage.get(name + '-list-style', 'compact'); + if (style != 'compact' && items.length > 1) { + $('.' + name + '-list-separator').html('
'); + $('.' + name + '-list-toggle .switch').prop('checked', true); + } + } + + function setShortcutListStyle(name) { + var compact = !$('.' + name + '-list-toggle .switch').prop('checked'); + $('.' + name + '-list-separator').html(compact ? '·' : '
'); + storage.set(name + '-list-style', compact ? 'compact' : 'expanded'); + } + + function handleKeyDown(event) { event = event || window.event; var keyCode = event.keyCode || event.which; if (keyCode === 27) // esc @@ -619,11 +714,14 @@

Opening library documentation failed

} } - function tagSearch(tag) { + function tagSearch(tag, hash) { var include = {tags: true, tagsExact: true}; + var url = window.location.pathname + "?tag=" + tag + (hash || ""); markMatches(tag, include); highlightMatches(tag, include); $('#keywords-container').find('.kw-row').addClass('hide-unmatched'); + history.replaceState && history.replaceState(null, '', url); + document.getElementById('Shortcuts').scrollIntoView(); } function doSearch() { @@ -693,6 +791,7 @@

Opening library documentation failed

$('#altogether-count').hide(); if (matchCount == 0) $('#keywords-container').find('table').empty(); + setTimeout(workaroundFirefoxWidthBug, 100); } function highlightMatches(string, include) { @@ -734,10 +833,7 @@

Opening library documentation failed

function resetSearch() { $('#search-string').val(''); - $('#include-name').prop('checked', true); - $('#include-args').prop('checked', true); - $('#include-doc').prop('checked', true); - $('#hide-unmatched').prop('checked', false); + $('#search input:checkbox').prop({'checked': true, 'disabled': false}); resetKeywords(); } @@ -749,6 +845,9 @@

Opening library documentation failed

} $('#match-count').hide(); $('#altogether-count').show(); + history.replaceState && history.replaceState(null, '', location.pathname + location.hash); + setTimeout(workaroundFirefoxWidthBug, 100); + scrollToHash(); } function setMatchVisibility() { @@ -825,7 +924,7 @@

Importing

{{each args}} - ${$value}{{if $index < args.length-1}}, {{/if}} + ${$value}{{if $index < args.length-1}},
{{/if}} {{/each}} {{html $value.doc}} @@ -836,25 +935,48 @@

Importing

@@ -883,14 +1005,14 @@

Keywords

{{each args}} - ${$value}{{if $index < args.length-1}}, {{/if}} + ${$value}{{if $index < args.length-1}},
{{/if}} {{/each}} {{if libdoc.contains_tags}} {{each tags}} ${$value}{{if $index < tags.length-1}}, {{/if}} + title="Show keywords with this tag">${$value}{{if $index < tags.length-1}},
{{/if}} {{/each}} {{/if}}