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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. import { WebView } from 'react-native-webview';
  2. import React, { PureComponent,Component,Button as Button_v0, } from 'react';
  3. // import { Button as Button_v0,} from 'react';
  4. import { Button } from 'react-native-paper';
  5. // Button as R_Button
  6. import { Button as Button_v2, useTheme } from 'react-native-paper';
  7. import {
  8. Animated,
  9. Keyboard,
  10. SafeAreaView,
  11. TextInput,
  12. TouchableHighlight,
  13. TouchableOpacity,
  14. View,
  15. Button as Button_v1,
  16. // Text,
  17. } from 'react-native';
  18. import * as rn from 'react-native';
  19. var Text2 = rn.Text
  20. import {AbstractButton} from '../react/features/base/toolbox/components';
  21. import { Header, LoadingIndicator, Text } from '../react/features/base/react';
  22. // clog("glob_vhook:",)
  23. glob_vhook.btns = {
  24. Button_v0,
  25. Button_v1,
  26. Button_v2,
  27. }
  28. function onMsg(event ){
  29. clog("OBMSG>>>>")
  30. var onMsg = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("onMsg",{that:this,event},{}) : {}
  31. }
  32. type Props = {}
  33. // class Wview_ui extends AbstractButton<Props> {
  34. class Wview_ui extends PureComponent<Props> {
  35. // class Wview_ui extends AbstractButton<Props, any> {
  36. // icon = "IconMessage";
  37. constructor(props) {
  38. super(props);
  39. this.v1="a"
  40. clog("Wview_v1 init")
  41. glob_vhook.nodes.wvui = this
  42. }
  43. render() {
  44. // return
  45. }
  46. }
  47. function fncb_only_v2(fn_name,arg1){
  48. var that0 = this
  49. // var ret = function(arg2){
  50. return function(arg2){
  51. // return tglob_au.run_dev_cbs(fn_name,{arg1,arg2,argx:arguments})
  52. var ret2 = tglob_au.run_dev_cbs(fn_name,{arg1,arg2,argx:arguments,thats:{that0,that1:this}})
  53. return ret2.o.ret
  54. }
  55. // return ret
  56. }
  57. function fncb_only(fn_name){
  58. var ret
  59. if (window.glob_vhook.rcb[fn_name]){
  60. // ret = window.glob_vhook.rcb[fn_name](fn_name,o,dflt_ret)
  61. // (fn_name,o,dflt_ret)
  62. ret = {status:1,fn:window.glob_vhook.rcb[fn_name]}
  63. } else {
  64. ret = {status:0,fn:window.nop}
  65. }
  66. return ret
  67. }
  68. class Wview_btns extends Component<Props> {
  69. constructor(props) {
  70. super(props);
  71. }
  72. render(){
  73. // wview_btns = tglob_au.run_dev_cbs("wview_btns",{that:this})
  74. var x1 = tglob_au.run_dev_cbs("wview_btns",{that:this}) || {o:{}}
  75. var wview_btns = x1.o.ret || {}
  76. clog("\n\n\n\nwview_btns",wview_btns)
  77. // wview_btns.style_b1 || {}
  78. // wview_btns.style_b2 || {}
  79. // wview_btns.style_v0 || {}
  80. // color = { wv0_styles_dev.vb1_color || "#00ffffff" }
  81. // onPress = {fncb_only("vbx_press").fn.bind(this)}
  82. // style={wview_btns.style_v0 || {}}
  83. // prop_id = "b1"
  84. // prop_id = "b2"
  85. // style={ {} }
  86. return (
  87. <View style={wview_btns.style_v0 || {}}>
  88. <Button_v2
  89. prop_id = "b1"
  90. style = { wview_btns.style_b1 || {}}
  91. onPress = {fncb_only_v2("vbx_press")}
  92. >
  93. {wview_btns.b1_txt || "udef1"}
  94. </Button_v2>
  95. <Button_v2
  96. prop_id = "b2"
  97. style = { wview_btns.style_b2 || {}}
  98. onPress = {fncb_only_v2("vbx_press")}
  99. >
  100. {wview_btns.b2_txt || "udef2"}
  101. </Button_v2>
  102. </View>
  103. )
  104. }
  105. }
  106. class Wview_vx extends Component<Props> {
  107. constructor(props) {
  108. super(props);
  109. }
  110. render(){
  111. var wb_url
  112. tglob_au.run_dev_cbs("render_vvx",{that:this,args:arguments,a:"z?"})
  113. if (glob_vhook?.fns?.gen_xcal_room3) {
  114. wb_url = glob_vhook.fns.gen_xcal_room3().room_url
  115. } else {
  116. // wb_url = "https://excalidraw.videocorners.com/#room=4zmaf7d5jtcx4pqgruba,4zmaf7BMXbI6tCEiW7rbgy"
  117. wb_url = "https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"
  118. }
  119. var webview_style = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("webview_style",{that:this},{}) : {}
  120. var wv0_styles = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_styles",{that:this},{}) : {}
  121. // <View
  122. // style = {wv0_styles.v1 || {}}
  123. // >
  124. var wv0_styles_dev = this.wv0_styles_dev || {}
  125. // window.postMessage("Your message");
  126. // console.log(">>>>>>>..?")
  127. var injectedJs = `(function(){
  128. console.log(">>>>>>>..")
  129. this.webView.postMessage("ZZ")
  130. return "Send me back!"}());
  131. `;
  132. injectedJs =`
  133. setTimeout(function () {
  134. window.ReactNativeWebView.postMessage("Hello!")
  135. console.log("QWETUI\n")
  136. window.top.postMessage('hello2', '*')
  137. }, 2000)
  138. `
  139. // clog("VVX:")
  140. return (
  141. <View style={wv0_styles_dev.vx_v}>
  142. <WebView source = {{uri:wb_url}}
  143. style = {wv0_styles_dev.webview_style || {}}
  144. injectedJavaScript={injectedJs}
  145. startInLoadingState
  146. javaScriptEnabledAndroid={true}
  147. javaScriptEnabled={true}
  148. onMessage={onMsg}
  149. ></WebView>
  150. </View>
  151. )
  152. return (
  153. <View style={this.props.vx_v}>
  154. <Text style={this.props.vx_tx} >Wview_vx</Text>
  155. </View>
  156. )
  157. }
  158. }
  159. // class Wview_vx
  160. // class Wview_v1 extends PureComponent<Props> {
  161. class Wview_v1 extends Component<Props> {
  162. constructor(props) {
  163. super(props);
  164. // const { palette } = useTheme();
  165. this.v1="a"
  166. // this.palette=palette
  167. tglob_au.reg_qxi_cb(this.rs_state.bind(this),"SET_TILE_VIEW_DIMENSIONS","RS_STATE")
  168. tglob_au.reg_dev_cb(this.rs_state2.bind(this),"rerender_Wview_v1","rerender")
  169. clog("Wview_v1 init")
  170. }
  171. rs_state2(a1,a2,a3,a4,a5){
  172. this.setState(() => {
  173. return { unseen3: Math.random() }
  174. });
  175. }
  176. rs_state(a1,a2,a3,a4,a5){
  177. // clog("RS_STATE",this,{a1,a2,a3,a4,a5})
  178. // clog("RS_STATE",{a1,a2,a3,a4,a5})
  179. this.setState(() => {
  180. // console.log('setting state');
  181. var wv0_dev = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_dev",{that:this},{}) : {}
  182. // return { unseen: "does not display" }
  183. return { unseen2: wv0_dev.ret }
  184. });
  185. /*
  186. try {
  187. // var s = this.props
  188. var s = this.state
  189. clog("::::",s)
  190. } catch (err){
  191. console.error("ERR:,")
  192. }
  193. */
  194. }
  195. /*
  196. componentDidMount() {
  197. setInterval(() => {
  198. this.setState(() => {
  199. // console.log('setting state');
  200. var wv0_dev = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_dev",{that:this},{}) : {}
  201. return { unseen: "does not display" }
  202. // return { unseen: wv0_dev.ret }
  203. });
  204. }, 1000);
  205. }
  206. */
  207. render() {
  208. var wb_url
  209. clog("Wview_v1 render")
  210. // console.log("wview_v1 render.")
  211. if (glob_vhook?.fns?.gen_xcal_room3) {
  212. wb_url = glob_vhook.fns.gen_xcal_room3().room_url
  213. } else {
  214. // wb_url = "https://excalidraw.videocorners.com/#room=4zmaf7d5jtcx4pqgruba,4zmaf7BMXbI6tCEiW7rbgy"
  215. wb_url = "https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"
  216. }
  217. var webview_style = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("webview_style",{that:this},{}) : {}
  218. var wv0_styles = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_styles",{that:this},{}) : {}
  219. // <View
  220. // style = {wv0_styles.v1 || {}}
  221. // >
  222. var wv0_styles_dev = this.wv0_styles_dev || {}
  223. // window.postMessage("Your message");
  224. // console.log(">>>>>>>..?")
  225. var injectedJs = `(function(){
  226. console.log(">>>>>>>..")
  227. this.webView.postMessage("ZZ")
  228. return "Send me back!"}());
  229. `;
  230. injectedJs =`
  231. setTimeout(function () {
  232. window.ReactNativeWebView.postMessage("Hello!")
  233. console.log("QWETUI\n")
  234. window.top.postMessage('hello2', '*')
  235. }, 2000)
  236. `
  237. // <View style = { wv0_styles.v1 || {} }>
  238. // style = {webview_style}
  239. // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
  240. // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
  241. // {t('polls.create.create')}
  242. // <Wview_ui style = { wv0_styles_dev.vb1 || {}} />
  243. // vx_v
  244. // vx_tx
  245. return (
  246. <View style = { wv0_styles_dev.v1 || {} }>
  247. <Text style = { wv0_styles_dev.txt || {} }
  248. >
  249. Z??
  250. </Text>
  251. <Wview_vx
  252. vx_tx = { wv0_styles_dev.vx_tx || {} }
  253. vx_v = { wv0_styles_dev.vx_v || {} }
  254. ></Wview_vx>
  255. <Wview_btns
  256. pt0 = { wv0_styles_dev.wv_b || {}}
  257. ></Wview_btns>
  258. <Button_v2
  259. title = "Cheems"
  260. style = { wv0_styles_dev.vb1 || {}}
  261. color = { wv0_styles_dev.vb1_color || "#00ffffff" }
  262. onPress = {fncb_only("vb1_press").fn.bind(this)}
  263. >
  264. {wv0_styles_dev.vb1_txt || "udef"}
  265. </Button_v2>
  266. <Text2 style = { wv0_styles_dev.txt2 || {} }
  267. >
  268. Z2
  269. </Text2>
  270. </View>
  271. )
  272. }
  273. }
  274. // color = { this.palette.screen01Header }
  275. export {Wview_v1}