Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. clog("OBMSG>>>>")
  18. var onMsg = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("onMsg",{that:this,event},{}) : {}
  19. }
  20. type Props = {}
  21. class Wview_v1 extends PureComponent<Props> {
  22. constructor(props) {
  23. super(props);
  24. this.v1="a"
  25. clog("Wview_v1 init")
  26. }
  27. componentDidMount() {
  28. setInterval(() => {
  29. this.setState(() => {
  30. // console.log('setting state');
  31. var wv0_dev = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_dev",{that:this},{}) : {}
  32. // return { unseen: "does not display" }
  33. return { unseen: wv0_dev.ret }
  34. });
  35. }, 1000);
  36. }
  37. render() {
  38. var wb_url
  39. clog("Wview_v1 render")
  40. // console.log("wview_v1 render.")
  41. if (glob_vhook?.fns?.gen_xcal_room3) {
  42. wb_url = glob_vhook.fns.gen_xcal_room3().room_url
  43. } else {
  44. // wb_url = "https://excalidraw.videocorners.com/#room=4zmaf7d5jtcx4pqgruba,4zmaf7BMXbI6tCEiW7rbgy"
  45. wb_url = "https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"
  46. }
  47. var webview_style = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("webview_style",{that:this},{}) : {}
  48. var wv0_styles = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_styles",{that:this},{}) : {}
  49. // <View
  50. // style = {wv0_styles.v1 || {}}
  51. // >
  52. var wv0_styles_dev = this.wv0_styles_dev || {}
  53. // window.postMessage("Your message");
  54. console.log(">>>>>>>..?")
  55. var injectedJs = `(function(){
  56. console.log(">>>>>>>..")
  57. this.webView.postMessage("ZZ")
  58. return "Send me back!"}());
  59. `;
  60. injectedJs =`
  61. setTimeout(function () {
  62. window.ReactNativeWebView.postMessage("Hello!")
  63. }, 2000)
  64. `
  65. // <View style = { wv0_styles.v1 || {} }>
  66. // style = {webview_style}
  67. // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
  68. // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
  69. return (
  70. <View style = { wv0_styles_dev.v1 || {} }>
  71. <Text style = { wv0_styles_dev.txt || {} }
  72. >
  73. Z??
  74. </Text>
  75. <WebView source = {{uri:wb_url}}
  76. style = {wv0_styles_dev.webview_style || {}}
  77. injectedJavaScript={injectedJs}
  78. startInLoadingState
  79. javaScriptEnabledAndroid={true}
  80. javaScriptEnabled={true}
  81. onMessage={onMsg}
  82. ></WebView>
  83. <Text2 style = { wv0_styles_dev.txt2 || {} }
  84. >
  85. Z2
  86. </Text2>
  87. </View>
  88. )
  89. }
  90. }
  91. export {Wview_v1}