1var theme = 'light'; 2var app_data; 3 4var initializer = { 5 "loader": pageLoader, 6 "header": setUpHeader, 7 "footer": setUpFooter, 8 "meta": setUpMeta, 9 "content": setUpContent, 10 "all": function () { 11 setUpMeta(); 12 // pageLoader(); 13 setUpHeader(); 14 setUpFooter(); 15 setUpContent(); 16 } 17} 18 19window.mobileAndTabletCheck = function() { 20 let check = false; 21 (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); 22 return check; 23}; 24 25function getMobileOperatingSystem() { 26 var userAgent = navigator.userAgent || navigator.vendor || window.opera; 27 28 // Windows Phone must come first because its UA also contains "Android" 29 if (/windows phone/i.test(userAgent)) { 30 return "Windows Phone"; 31 } 32 33 if (/android/i.test(userAgent)) { 34 return "Android"; 35 } 36 37 // iOS detection from: http://stackoverflow.com/a/9039885/177710 38 if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { 39 return "iOS"; 40 } 41 42 return "unknown"; 43} 44 45function shadeColor(color, percent) { 46 var R = parseInt(color.substring(1,3),16); 47 var G = parseInt(color.substring(3,5),16); 48 var B = parseInt(color.substring(5,7),16); 49 50 R = parseInt(R * (100 + percent) / 100); 51 G = parseInt(G * (100 + percent) / 100); 52 B = parseInt(B * (100 + percent) / 100); 53 54 R = (R<255)?R:255; 55 G = (G<255)?G:255; 56 B = (B<255)?B:255; 57 58 var RR = ((R.toString(16).length==1)?"0"+R.toString(16):R.toString(16)); 59 var GG = ((G.toString(16).length==1)?"0"+G.toString(16):G.toString(16)); 60 var BB = ((B.toString(16).length==1)?"0"+B.toString(16):B.toString(16)); 61 62 return "#"+RR+GG+BB; 63} 64 65//aside 66function setUpMeta() { 67 var id = injected.app.id; 68 $("#kt_aside").css('background-color', injected.app.data.theme.colors.primary ?? "black"); 69 var style = document.createElement('style'); 70 style.type = 'text/css'; 71 style.innerHTML = ` 72 body { 73 --primary-color: ${injected.app.data.theme.colors.primary ?? "#3699ff"}; 74 --secondary-color: ${injected.app.data.theme.colors.secondary ?? "#181C32"}; 75 --secondary-dark-color: ${shadeColor(injected.app.data.theme.colors.secondary,-45) ?? "#1A1C32"}; 76 } 77 ` 78 document.getElementsByTagName('head')[0].appendChild(style); 79} 80 81// Loader 82function pageLoader() { 83 $('.page-loader').html(`<img class="w-125px" src="assets/media/${injected.app.id}/logos/logo-loader.svg" />
84 <span class="font-size-h4 font-weight-boldest w-200px text-center my-4" style="color: #D6DDE7">${injected.app.data.meta.title}</span> 85 <span class="spinner-border" role="status" style="color: #D6DDE7;"> 86 </span>`) 87} 88 89//header 90function setUpHeader() { 91 92 //determines if the user has a set theme 93 function detectColorScheme(){ 94 //local storage is used to override OS theme settings 95 if(localStorage.getItem(injected.app.id + '-theme')){ 96 if(localStorage.getItem(injected.app.id + '-theme') == "dark"){ 97 theme = "dark"; 98 } 99 } else if(!window.matchMedia) { 100 //matchMedia method not supported 101 return false; 102 } else if(window.matchMedia("(prefers-color-scheme: dark)").matches) { 103 //OS theme setting detected as dark 104 theme = "dark"; 105 } 106 107 //dark theme preferred, set document with a `data-theme` attribute 108 if (theme === "dark") { 109 document.documentElement.setAttribute("data-theme", "dark"); 110 } 111 } 112 detectColorScheme(); 113 114 function switchTheme() { 115 if (document.documentElement.getAttribute("data-theme") !== "dark") { 116 localStorage.setItem(injected.app.id + '-theme', 'dark'); 117 theme = 'dark' 118 document.documentElement.setAttribute('data-theme', 'dark'); 119 $('#theme-switch img').attr('src', 'assets/media/icons/light.svg'); 120 $('.external-link-path').attr('src', 'assets/media/icons/path-light.svg'); 121 $('#chapters-list .chapter-card').each(function(e) { 122 $(this).css('backgroundImage', `url('${URL}img.php?id=${injected.app.id}&img=${$(this).attr('data-chapter')}_d')`); 123 }) 124 } else { 125 localStorage.setItem(injected.app.id + '-theme', 'light'); 126 theme = 'light' 127 document.documentElement.setAttribute('data-theme', 'light'); 128 $('#theme-switch img').attr('src', 'assets/media/icons/dark.svg'); 129 $('.external-link-path').attr('src', 'assets/media/icons/path-dark.svg'); 130 $('#chapters-list .chapter-card').each(function(e) { 131 $(this).css('backgroundImage', `url('${URL}img.php?id=${injected.app.id}&img=${$(this).attr('data-chapter')}')`); 132 }) 133 } 134 } 135 136 137 // $('.app-name').text(injected.app.data.landing.header.title) 138 // $('.app-desc').text(injected.app.data.landing.header.subtitle) 139 // $('.app-logo').attr('src', `assets/media/${injected.app.id}/landing/${injected.app.data.landing.header.header_image}`) 140 141 $('body').on('click', '#theme-switch', function(e) { 142 switchTheme() 143 }); 144 145} 146 147//footer 148function setUpFooter() { 149 // $('#kt_footer').html(`<div class="container"> 150 // <div class="bg-secondary rounded-6 row py-0 text-white"> 151 // <div class="col-12 border-bottom border-bottom-2 px8 px-lg-20 py-10 d-flex justify-content-between align-items-center row m-0 text-center text-lg-start" style="border-color: #DFE4EA40 !important;"> 152 // <h1 class="text-white m-0 col-12 col-lg-6 text-center text-lg-start" style="font-size: 3rem;"> 153 // ${injected.app.data.landing.footer.title} 154 // </h1> 155 // <div class="col-12 col-lg-6 d-flex justify-content-center justify-content-lg-end"> 156 // <div class="go-to-app mt-2"></div> 157 // </div> 158 // </div> 159 // <div class="col-12 px-8 px-lg-20 py-10"> 160 // <div class="d-flex align-items-center justify-content-center justify-content-lg-start"> 161 // <div class="app-logo my-2"> 162 // <img class="mh-100px" src="assets/media/${injected.app.id}/landing/${injected.app.data.landing.footer.footer_image}" /> 163 // </div> 164 // </div> 165 // </div> 166 // <div class="col-12 px-8 px-lg-20 d-flex flex-column-reverse flex-lg-row justify-content-between mt-2 mb-10"> 167 // <div class="cp-right fs-5 fw-light col-12 col-lg-6 mt-5 mt-lg-0 text-center text-lg-start"> 168 // © ${moment().format('YYYY')} ${injected.app.data.landing.global.title} by <a class="text-white" target="_blank" href="https://reev.ca/">Reev Tech Inc</a>. All rights reserved. 169 // </div> 170 // <div class="footer-links fs-4 fw-light text-opacity-75 col-12 col-lg-6 d-flex justify-content-center justify-content-lg-end"> 171 // <a class="text-white ml-3" href="${injected.app.data.landing.global.privacy_url}" target="_blank">Privacy Policy</a> 172 // <a class="text-white ml-3" href="${injected.app.data.landing.global.terms_url}" target="_blank">Terms of Service</a> 173 // </div> 174 // </div> 175 // </div> 176 // </div>`) 177 178 179 var date = new Date().getFullYear(); 180 $("#copyright-year").text(date); 181 182 if (injected.app.data.firebaseConfig) { 183 var code = `import { initializeApp }
183 from "https://www.gstatic.com/firebasejs/9.6.1/firebase-app.js"; 184 import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.6.1/firebase-analytics.js"; 185 186 const firebaseConfig = { 187 apiKey: "${injected.app.data.firebaseConfig.apiKey}", 188 authDomain: "${injected.app.data.firebaseConfig.authDomain}", 189 projectId: "${injected.app.data.firebaseConfig.projectId}", 190 storageBucket: "${injected.app.data.firebaseConfig.storageBucket}", 191 messagingSenderId: "${injected.app.data.firebaseConfig.messagingSenderId}", 192 appId: "${injected.app.data.firebaseConfig.appId}", 193 measurementId: "${injected.app.data.firebaseConfig.measurementId}" 194 }; 195 196 const app = initializeApp(firebaseConfig); 197 const analytics = getAnalytics(app);`; 198 var script = document.createElement("script"); 199 script.setAttribute("type", "module"); 200 script.appendChild(document.createTextNode(code)); 201 document.body.appendChild(script); 202 } 203 204} 205 206// Reev Custom XML Parser 207function customXMLParser(xml_doc) { 208 var parser = new DOMParser(); 209 var xmlDoc = parser.parseFromString(xml_doc,"text/xml"); 210 211 // Redefine color Tag 212 for (var color_element of xmlDoc.getElementsByTagName("color")) { 213 var bg_color = 'background-color: #' + color_element.getAttribute('background') + ';' 214 var text_color = 'color: #' + color_element.getAttribute('foreground') + ';' 215 color_element.setAttribute("style", bg_color + text_color); 216 } 217 218 // Redefine img Tag 219 for (var img_element of xmlDoc.getElementsByTagName("image")) { 220 var org_html = img_element.innerHTML; 221 img_element.innerHTML = "<figure class='font-size-h6' style='color: #4D4D4D; padding: 0 1rem 0 0.5rem;'>" + org_html + "</figure>"; 222 img_element.setAttribute('src', img_element.getAttribute('url')); 223 img_element.setAttribute("style", 'display: block; width: 100%; margin: 1.5rem 0 0 0;'); 224 img_element.classList.add('rounded'); 225 } 226 227 // Remove questions Tag from Text 228 for (var question_element of xmlDoc.getElementsByTagName("questions")) { 229 question_element.innerHTML = ""; 230 } 231 232 return new XMLSerializer().serializeToString(xmlDoc) 233} 234 235function setUpContent() { 236 if (window.mobileAndTabletCheck && getMobileOperatingSystem() === 'Android') { 237 $('.go-to-app .desktop-link').addClass('d-none'); 238 $('.go-to-app .android-link').removeClass('d-none').addClass('d-flex'); 239 $('.go-to-reviews').attr('href', app_data.global.play_store_url); 240 } else if (window.mobileAndTabletCheck && getMobileOperatingSystem() === 'iOS') { 241 $('.go-to-app .desktop-link').addClass('d-none'); 242 $('.go-to-app .ios-link').removeClass('d-none').addClass('d-flex'); 243 $('.go-to-reviews').attr('href', app_data.global.app_store_url); 244 } else { 245 $('.go-to-reviews').addClass('d-none'); 246 } 247 248 // injected.app.data.landing.content.forEach(function (content) { 249 // if (content.type === 'bullet') { 250 // $('#kt_content_container').append( 251 // bulletSection( 252 // content.attr.title, 253 // content.attr.array_content, 254 // content.attr.image, 255 // content.attr.direction) 256 // ) 257 // } else if (content.type === 'feature') { 258 // $('#kt_content_container').append( 259 // featureSection(content.attr.array_content) 260 // ) 261 // } else if (content.type === 'preview') { 262 // $('#kt_content_container').append( 263 // previewSection(content.attr.title, 264 // content.attr.array_content 265 // ) 266 // ) 267 // } 268 // }) 269 270 271 $(document).ready(function(){ 272 // document.getElementById('auto-update').innerHTML = 'Updated ' + moment().format('YYYY') 273 274 $("#testimonial-slider").owlCarousel({ 275 items:2, 276 itemsDesktop:[1000,2], 277 itemsDesktopSmall:[980,1], 278 itemsTablet:[768,1], 279 pagination:false, 280 navigation:true, 281 navigationText:['<i class="flaticon2-left-arrow" aria-hidden="true"></i>','<i class="flaticon2-right-arrow" aria-hidden="true"></i>'], 282 autoPlay:true 283 }); 284 });
285} 286 287 288function init() { 289 console.log("injected: ", injected); 290 fetch('/assets/media/' + injected.app.id + '/landing/landing.json') 291 .then((response) => response.json()) 292 .then((json) => { 293 app_data = json; 294 initializer.all(); 295 }); 296 297} 298 299init();
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.