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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. import { WebView } from 'react-native-webview';
  2. import React, { PureComponent,Component,Button as R_Button } 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 {AbstractButton} from '../react/features/base/toolbox/components';
  16. import { Header, LoadingIndicator, Text } from '../react/features/base/react';
  17. function onMsg(event ){
  18. clog("OBMSG>>>>")
  19. var onMsg = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("onMsg",{that:this,event},{}) : {}
  20. }
  21. type Props = {}
  22. // class Wview_ui extends AbstractButton<Props> {
  23. class Wview_ui extends AbstractButton<Props, any> {
  24. // icon = "IconMessage";
  25. constructor(props) {
  26. super(props);
  27. this.v1="a"
  28. clog("Wview_v1 init")
  29. }
  30. // render() { }
  31. }
  32. class Wview_v1 extends PureComponent<Props> {
  33. constructor(props) {
  34. super(props);
  35. this.v1="a"
  36. clog("Wview_v1 init")
  37. }
  38. componentDidMount() {
  39. setInterval(() => {
  40. this.setState(() => {
  41. // console.log('setting state');
  42. var wv0_dev = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_dev",{that:this},{}) : {}
  43. // return { unseen: "does not display" }
  44. return { unseen: wv0_dev.ret }
  45. });
  46. }, 1000);
  47. }
  48. render() {
  49. var wb_url
  50. clog("Wview_v1 render")
  51. // console.log("wview_v1 render.")
  52. if (glob_vhook?.fns?.gen_xcal_room3) {
  53. wb_url = glob_vhook.fns.gen_xcal_room3().room_url
  54. } else {
  55. // wb_url = "https://excalidraw.videocorners.com/#room=4zmaf7d5jtcx4pqgruba,4zmaf7BMXbI6tCEiW7rbgy"
  56. wb_url = "https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"
  57. }
  58. var webview_style = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("webview_style",{that:this},{}) : {}
  59. var wv0_styles = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_styles",{that:this},{}) : {}
  60. // <View
  61. // style = {wv0_styles.v1 || {}}
  62. // >
  63. var wv0_styles_dev = this.wv0_styles_dev || {}
  64. // window.postMessage("Your message");
  65. console.log(">>>>>>>..?")
  66. var injectedJs = `(function(){
  67. console.log(">>>>>>>..")
  68. this.webView.postMessage("ZZ")
  69. return "Send me back!"}());
  70. `;
  71. injectedJs =`
  72. setTimeout(function () {
  73. window.ReactNativeWebView.postMessage("Hello!")
  74. console.log("QWETUI\n")
  75. window.top.postMessage('hello2', '*')
  76. }, 2000)
  77. `
  78. // <View style = { wv0_styles.v1 || {} }>
  79. // style = {webview_style}
  80. // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
  81. // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
  82. // <Wview_ui style = { wv0_styles_dev.vb1 || {}} />
  83. return (
  84. <View style = { wv0_styles_dev.v1 || {} }>
  85. <Text style = { wv0_styles_dev.txt || {} }
  86. >
  87. Z??
  88. </Text>
  89. <WebView source = {{uri:wb_url}}
  90. style = {wv0_styles_dev.webview_style || {}}
  91. injectedJavaScript={injectedJs}
  92. startInLoadingState
  93. javaScriptEnabledAndroid={true}
  94. javaScriptEnabled={true}
  95. onMessage={onMsg}
  96. ></WebView>
  97. <Text2 style = { wv0_styles_dev.txt2 || {} }
  98. >
  99. Z2
  100. </Text2>
  101. </View>
  102. )
  103. }
  104. }
  105. export {Wview_v1}