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 4.3KB

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