1// Print link 2(function ($) { 3 var settings = { 4 defaultLanguage: 'sv', 5 icon: '<svg aria-hidden="true" class="lp-icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/rest-api/svg-sources/lp-icons.svg#lp-print"></use></svg>', 6 translations: { 7 sv: 'Skriv ut', 8 en: 'Print', 9 de: 'Drucken' 10 } 11 }; 12 13 $.printLink = function(options) { 14 options = options || {}; 15 var pageLanguage = $('html').attr('lang') || settings.defaultLanguage; 16 var printLabel = settings.translations[pageLanguage] || settings.translations[settings.defaultLanguage]; 17 18 var htmlClass = options.htmlClass ? ' class="' + options.htmlClass + '"' : ''; 19 var link = $('<a href="#"' + htmlClass + '>' + settings.icon + printLabel + '</a>'); 20 21 link.on('click', function (event) { 22 event.preventDefault(); 23 window.print(); 24 }); 25 26 return link; 27 }; 28}(jQuery)); 29 30jQuery(function($) { 31 $.printLink({ htmlClass: 'normal' }).prependTo('.lp-pagetools > *:first-child').wrap('<div class="lp-print-link"></div>'); 32});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.