Module: LazyMobileTester::Helper

Defined in:
lib/lazy_mobile_tester/helper.rb

Constant Summary collapse

IMG =
"<img width='16' height='16' src='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaGVpZ2h0PSI0NjcuMzgiIGlkPSJzdmczNiIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgNDY3LjM5ODAxIDQ2Ny4zOCIgd2lkdGg9IjQ2Ny4zOTgwMSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOmlua3NjYXBlPSJodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy9uYW1lc3BhY2VzL2lua3NjYXBlIiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnMgaWQ9ImRlZnM0MCIvPjxnIGlkPSJMY2RfV2l0aF9UYWJsZXRfYW5kX21vYmlsZV9pY29uIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjIuMzAxLC0yMi4zMSkiPjxnIGlkPSJnMzIiPjxwYXRoIGQ9Im0gMjU2LjAwMSwyMi4zMSBjIDEyOS4xMjEsMCAyMzMuNjk4LDEwNC45MTEgMjMzLjY5OCwyMzMuNjkgMCwxMjkuMTEzIC0xMDQuNTc3LDIzMy42OSAtMjMzLjY5OCwyMzMuNjkgLTEyOS4xMTgsMCAtMjMzL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NTcgMS42NzUsNC4zNzEgNC4zNzEsNC4zNzEgMi4zNTMsMCA0LjM2NiwtMi4wMTQgNC4zNjYsLTQuMzcxIDAsLTIuNjgyIC0yLjAxMywtNC42OTUgLTQuMzY2LC00LjY5NSB6IiBpZD0icGF0aDI2IiBzdHlsZT0iY2xpcC1ydWxlOmV2ZW5vZGQ7ZmlsbDojZmZmZmZmO2ZpbGwtcnVsZTpldmVub2RkIi8+PHBhdGggZD0ibSAxMTkuODIxLDI1My45ODYgaCAzOC42NyBjIDAuNjc4LDAgMS4zNDEsLTAuMzM0IDEuMzQxLC0xLjAwMiAwLC0wLjY3OCAtMC42NjMsLTEuMDEyIC0xLjM0MSwtMS4wMTIgaCAtMzguNjcgYyAtMC42NjgsMCAtMS4wMDcsMC4zMzQgLTEuMDA3LDEuMDEyIDAsMC42NjggMC4zMzksMS4wMDIgMS4wMDcsMS4wMDIgeiIgaWQ9InBhdGgyOCIgc3R5bGU9ImNsaXAtcnVsZTpldmVub2RkO2ZpbGw6I2ZmZmZmZjtmaWxsLXJ1bGU6ZXZlbm9kZCIvPjxyZWN0IGhlaWdodD0iMTAwLjUzIiBpZD0icmVjdDMwIiBzdHlsZT0iY2xpcC1ydWxlOmV2ZW5vZGQ7ZmlsbDojZmZmZmZmO2ZpbGwtcnVsZTpldmVub2RkIiB3aWR0aD0iODMuNzI4OTk2IiB4PSI5Ny4yODkwMDEiIHk9IjI1OS4zNjg5OSIvPjwvZz48L2c+PGcgaWQ9IkxheWVyXzEiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMi4zMDEsLTIyLjMxKSIvPjwvc3ZnPg=='/>".html_safe
SCRIPT =
"<script>if (window != window.parent) { document.getElementById('lazy_mobile_tester_button').remove(); } </script>".html_safe

Instance Method Summary collapse

Instance Method Details

#lazy_mobile_tester_buttonObject



6
7
8
9
# File 'lib/lazy_mobile_tester/helper.rb', line 6

def lazy_mobile_tester_button
  button = button_to(IMG, url_for(params.permit!), method: :get, params: { _lazy: 1 }, data: { turbo: false, turbolinks: false }, style: LazyMobileTester.style, id: 'lazy_mobile_tester_button')
  button + SCRIPT
end