You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wv0.native.js 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import { WebView } from 'react-native-webview';
  2. import React, { PureComponent } from 'react';
  3. import {
  4. Animated,
  5. Keyboard,
  6. SafeAreaView,
  7. TextInput,
  8. TouchableHighlight,
  9. TouchableOpacity,
  10. View,
  11. // Text,
  12. } from 'react-native';
  13. import * as rn from 'react-native';
  14. var Text2 = rn.Text
  15. import { Header, LoadingIndicator, Text } from '../react/features/base/react';
  16. function onMsg(event ){
  17. var onMsg = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("onMsg",{that:this,event},{}) : {}
  18. }
  19. type Props = {}
  20. class Wview_v1 extends PureComponent<Props> {
  21. constructor(props) {
  22. super(props);
  23. this.v1="a"
  24. clog("Wview_v1 init")
  25. }
  26. componentDidMount() {
  27. setInterval(() => {
  28. this.setState(() => {
  29. // console.log('setting state');
  30. var wv0_dev = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_dev",{that:this},{}) : {}
  31. // return { unseen: "does not display" }
  32. return { unseen: wv0_dev.ret }
  33. });
  34. }, 1000);
  35. }
  36. render() {
  37. var wb_url
  38. clog("Wview_v1 render")
  39. // console.log("wview_v1 render.")
  40. if (glob_vhook?.fns?.gen_xcal_room3) {
  41. wb_url = glob_vhook.fns.gen_xcal_room3().room_url
  42. } else {
  43. // wb_url = "https://excalidraw.videocorners.com/#room=4zmaf7d5jtcx4pqgruba,4zmaf7BMXbI6tCEiW7rbgy"
  44. wb_url = "https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"
  45. }
  46. var webview_style = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("webview_style",{that:this},{}) : {}
  47. var wv0_styles = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_styles",{that:this},{}) : {}
  48. // <View
  49. // style = {wv0_styles.v1 || {}}
  50. // >
  51. var wv0_styles_dev = this.wv0_styles_dev || {}
  52. // window.postMessage("Your message");
  53. var injectedJs = `(function(){
  54. this.webView.postMessage("ZZ")
  55. return "Send me back!"}());
  56. `;
  57. // <View style = { wv0_styles.v1 || {} }>
  58. // style = {webview_style}
  59. // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
  60. // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
  61. return (
  62. <View style = { wv0_styles_dev.v1 || {} }>
  63. <Text style = { wv0_styles_dev.txt || {} }
  64. >
  65. Z
  66. </Text>
  67. <WebView source = {{uri:wb_url}}
  68. style = {wv0_styles_dev.webview_style || {}}
  69. injectedJavaScript={injectedJs}
  70. startInLoadingState
  71. javaScriptEnabledAndroid={true}
  72. javaScriptEnabled={true}
  73. onMessage={onMsg}
  74. ></WebView>
  75. <Text2 style = { wv0_styles_dev.txt2 || {} }
  76. >
  77. Z2
  78. </Text2>
  79. </View>
  80. )
  81. }
  82. }
  83. export {Wview_v1}