1 2function buildIOSMeta(){ 3 4 var aMetaTags = [ 5 { name : "viewport", 6 content : 'width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no'}, 7 { name: 'apple-mobile-web-app-capable', 8 content: 'yes'}, 9 { name: 'apple-mobile-web-app-status-bar-style', 10 content: 'black'} 11 ]; 12 13 for( var i = 0; i < aMetaTags.length; i++ ){ 14 var oNewMeta = document.createElement('meta'); 15 oNewMeta.name = aMetaTags[i].name; 16 oNewMeta.content = aMetaTags[i].content; 17 18 var oOldMeta = window.document.head.querySelector('meta[name="'+oNewMeta.name+'"]'); 19 if (oOldMeta) { 20 oOldMeta.parentNode.removeChild(oOldMeta); 21 } 22 window.document.head.appendChild(oNewMeta); 23 } 24 25}; 26 27function hideIOSFullscreenPanel(){ 28 jQuery(".xxx-ios-fullscreen-message").css("display","none"); 29 jQuery(".xxx-ios-fullscreen-scroll").css("display","none"); 30 31 jQuery(".xxx-game-iframe-full").removeClass("xxx-game-iframe-iphone-se"); 32}; 33 34function buildIOSFullscreenPanel(){ 35 var html = ''; 36 37 html += '<div class="xxx-ios-fullscreen-message">'; 38 html += '<div class="xxx-ios-fullscreen-swipe">'; 39 html += '</div>'; 40 html += '</div>'; 41 42 html += '<div class="xxx-ios-fullscreen-scroll">'; 43 html += '</div>'; 44 45 jQuery("body").append(html); 46}; 47 48function showIOSFullscreenPanel(){ 49 jQuery(".xxx-ios-fullscreen-message").css("display","block"); 50 jQuery(".xxx-ios-fullscreen-scroll").css("display","block"); 51}; 52 53function __iosResize(){ 54 55 window.scrollTo(0, 0); 56 57 console.log(window.devicePixelRatio); 58 console.log(window.innerWidth); 59 console.log(window.innerHeight); 60 61 if( platform.product === "iPhone" ){ 62 switch(window.devicePixelRatio){ 63 case 2:{ 64 switch(window.innerWidth){ 65 case 568:{ 66 //console.log("iPhone 5/5s/5c/se"); 67 if( window.innerHeight === 320 ){ 68 //console.log("fullscreen"); 69 //this.hideIOSFullscreenPanel(); 70 }else{ 71 jQuery(".xxx-game-iframe-full").addClass("xxx-game-iframe-iphone-se"); 72 //console.log("windowed"); 73 // this.showIOSFullscreenPanel(); 74 } 75 }break; 76 case 667:{ 77 //console.log("iPhone 6/6s/7/8"); 78 if( window.innerHeight === 375 ){ 79 // console.log("fullscreen"); 80 hideIOSFullscreenPanel(); 81 }else{ 82 //console.log("windowed"); 83 showIOSFullscreenPanel(); 84 } 85 }break; 86 case 808:{ 87 //console.log("iPhone Xr"); 88 if( window.innerHeight === 414 ){ 89 hideIOSFullscreenPanel(); 90 }else{ 91 showIOSFullscreenPanel(); 92 } 93 }break; 94 default:{ 95 hideIOSFullscreenPanel(); 96 } 97 } 98 }break; 99 case 3:{ 100 switch(window.innerWidth){ 101 case 736:{ 102 //console.log("iPhone 6/6s/7/8 plus"); 103 if( window.innerHeight === 414 ){ 104 // console.log("fullscreen"); 105 hideIOSFullscreenPanel(); 106 }else{ 107 showIOSFullscreenPanel(); 108 } 109 }break; 110 // iphone X 111 case 724:{ 112 // console.log("iPhone X/Xs"); 113 if( window.innerHeight === 375 ){ 114 hideIOSFullscreenPanel(); 115 }else{ 116 showIOSFullscreenPanel(); 117 } 118 }break; 119 case 808:{ 120 //console.log("iPhone Xs Max"); 121 if( window.innerHeight === 414 ){ 122 hideIOSFullscreenPanel(); 123 }else{ 124 showIOSFullscreenPanel(); 125 } 126 }break; 127 default:{ 128 hideIOSFullscreenPanel(); 129 } 130 } 131 }break; 132 default:{ 133 hideIOSFullscreenPanel(); 134 } 135 } 136 } 137}; 138 139function iosResize(){ 140 __iosResize(); 141 142 setTimeout(function(){ 143 __iosResize(); 144 },500); 145}; 146 147function iosInIframe() { 148 try { 149 return window.self !== window.top; 150 } catch (e) { 151 return true; 152 } 153} 154 155function isIOSLessThen13(){ 156 var oOs = platform.os; 157 var szFamily = oOs.family.toLowerCase(); 158 var iVersion = parseFloat( oOs.version ); 159 160 if(szFamily === "ios"){ 161 if(iVersion < 13){ 162 return true; 163 } 164 } 165 return false;
166} 167 168$(document).ready(function () { 169 if(platform && 170 platform.product === "iPhone" && 171 platform.name.toLowerCase() === "safari" && 172 ////AND < ver 13 173 isIOSLessThen13() && 174 175 !iosInIframe()){ 176 buildIOSFullscreenPanel(); 177 buildIOSMeta(); 178 } 179}); 180 181jQuery(window).resize(function() { 182 183 if(platform && 184 platform.product === "iPhone" && 185 platform.name.toLowerCase() === "safari" && 186 ////AND < ver 13 187 isIOSLessThen13() && 188 189 !iosInIframe()){ 190 iosResize(); 191 } 192});
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.