1var navigationEvents = []; 2var flutterFunctions = []; 3var flutterUploadEvent = null; 4window.flutterTriggerEvent = null; 5 6var flutterPushEvent = function(args, pushEvent = false) { 7 8 if(!pushEvent) 9 navigationEvents = []; 10 navigationEvents.push(args); 11 12}; 13 14window.addOnFlutterLoad = function(callback) { 15 flutterFunctions.push(callback); 16} 17 18 19 20window.addEventListener('flutterInAppWebViewPlatformReady', function(event) { 21 22 if(this.flutterFunctions.length) { 23 flutterFunctions.forEach(function(callback) { 24 callback(); 25 }) 26 } 27 28 window.IS_FLUTTER = true; 29 window.flutterPopEvent = function() { 30 31 const currentEvent = navigationEvents.pop(); 32 33 if(currentEvent === undefined) 34 window.flutter_inappwebview.callHandler('exitApp') 35 36 const type = currentEvent.type; 37 38 switch(type) { 39 case 'dialog': currentEvent.dialog.close(); break; 40 case 'url': { 41 if(window.flutterTriggerEvent) { 42 window.flutterTriggerEvent({ 43 type: 'drawer', 44 data: true 45 }) 46 } 47 window.flutter_inappwebview.callHandler('canExitApp') 48 } ; break; 49 default: { 50 window.flutter_inappwebview.callHandler('exitApp') 51 } 52 } 53 54 } 55 56 window.keyboard = function(kHeight) { 57 58 const wHeight = window.innerHeight; 59 const body = document.querySelector('body'); 60 const content = document.querySelector('body app-root > div'); 61 const paddingBottom = kHeight > 0 ? kHeight - 30 : 0; 62 63 kHeight -= paddingBottom 64 content.style.height = (wHeight - kHeight) + 'px'; 65 content.style.overflow = 'auto'; 66 body.style.height = (wHeight - kHeight) + 'px'; 67 body.style.overflow = 'auto'; 68 body.style.paddingBottom = paddingBottom + 'px'; 69 70 } 71 72 window.chooseImageAndUpload = function(source, url, user, action, filename, headerData) { 73 const data = { 74 source: source, 75 url: url, 76 user: user, 77 action: action, 78 filename: filename, 79 headerData: headerData, 80 }; 81 const stringifyData = JSON.stringify(data); 82 window.flutter_inappwebview.callHandler('chooseImageAndUpload',stringifyData); 83 } 84 85 window.generateFocusInput = function() { 86 87 setTimeout(function() { 88 89 const textInputs = document.querySelectorAll('input'); 90 textInputs.forEach(function(input) { 91 input.addEventListener('focus', function() { 92 setTimeout(function() { 93 input.scrollIntoView({ 94 behavior: 'smooth', 95 block: 'center' 96 }); 97 }, 500) 98 }) 99 }) 100 101 }, 1000) 102 103 } 104 105}) 106 107window.flutterExitApp = function() { 108 window.flutter_inappwebview.callHandler('exitApp') 109} 110 111window.launchUrl = function(url) { 112 window.flutter_inappwebview.callHandler('launchUrl', url); 113} 114 115window.setPushEvent = function(args, pushEvent = false) { 116 flutterPushEvent(args, pushEvent); 117} 118 119window.setFlutterUploadEvent = function(callback) { 120 flutterUploadEvent = callback; 121} 122 123window.onFlutterUploadEvent = function() { 124 if(flutterUploadEvent) 125 flutterUploadEvent(); 126}
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.