1/** 2 * This file contains modifications to Highslide JS for optimizing the display on mobile user agents. 3 * 4 * @author Torstein Hønsi 5 */ 6if (/(Android|BlackBerry|iPhone|iPod|Palm|Symbian)/.test(navigator.userAgent)) { 7//if (true) { 8 hs.addEventListener(document, 'ready', function() { 9 10 // Add a meta tag to have the iPhone render the page 1:1 11 hs.createElement('meta', { 12 name: 'viewport', 13 content: 'width=device-width; initial-scale=1.0; maximum-scale=1.0;' 14 }, null, document.getElementsByTagName('head')[0]); 15 16 // Add CSS rules 17 var stylesheet = document.getElementsByTagName('style')[0]; 18 stylesheet.appendChild(document.createTextNode( 19 '.highslide img {'+ 20 ' width: 50px; '+ 21 '}'+ 22 '.highslide-wrapper div.navbutton {'+ 23 ' color: white;'+ 24 ' font-size: 64px;'+ 25 '}'+ 26 '.highslide-full-expand {'+ 27 ' display: none !important;'+ 28 '}'+ 29 '.highslide-wrapper {'+ 30 ' background: none !important;'+ 31 '}'+ 32 '.highslide-caption {'+ 33 ' border: none !important;'+ 34 ' color: white !important;'+ 35 ' background: none !important;'+ 36 '}' 37 )); 38 39 // add some options that make sense on a small touchscreen 40 hs.outlineType = null; // outlines look distorted at normal zoom 41 hs.expandDuration = 0; // animation is too slow anyway 42 hs.restoreDuration = 0; 43 hs.transitionDuration = 0; 44 hs.wrapperClassName = 'borderless draggable-header mobile'; // take all the space available for the image 45 hs.marginTop = 0; 46 hs.marginRight = 0; 47 hs.marginBottom = 0; 48 hs.marginLeft = 0; 49 hs.captionOverlay.fade = false;
50 hs.allowHeightReduction = false; // t=10503 51 52 // Remove any slideshows with too small controls 53 hs.slideshows = []; 54 55 // Create custom previous and next overlays 56 hs.registerOverlay({ 57 position: 'middle left', 58 width: '20%', 59 html: '<div class="navbutton" onclick="hs.previous()" title="'+ 60 hs.lang.previousTitle +'">‹</div>', 61 hideOnMouseOut: false 62 }); 63 hs.registerOverlay({ 64 position: 'middle right', 65 width: '20%', 66 html: '<div class="navbutton" style="text-align: right" onclick="hs.next()" title="'+ 67 hs.lang.nextTitle +'">›</div>', 68 hideOnMouseOut: false 69 }); 70 71 }); 72 73}
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.