123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- import { WebView } from 'react-native-webview';
- import React, { PureComponent,Component } from 'react';
- // Button as R_Button
- import { Button, useTheme } from 'react-native-paper';
- import {
- Animated,
- Keyboard,
- SafeAreaView,
- TextInput,
- TouchableHighlight,
- TouchableOpacity,
- View,
- // Text,
- } from 'react-native';
- import * as rn from 'react-native';
-
- var Text2 = rn.Text
-
- import {AbstractButton} from '../react/features/base/toolbox/components';
- import { Header, LoadingIndicator, Text } from '../react/features/base/react';
-
-
-
-
-
-
-
-
- function onMsg(event ){
- clog("OBMSG>>>>")
- var onMsg = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("onMsg",{that:this,event},{}) : {}
- }
-
-
- type Props = {}
- // class Wview_ui extends AbstractButton<Props> {
- class Wview_ui extends PureComponent<Props> {
- // class Wview_ui extends AbstractButton<Props, any> {
- // icon = "IconMessage";
- constructor(props) {
- super(props);
- this.v1="a"
- clog("Wview_v1 init")
- glob_vhook.nodes.wvui = this
- }
-
- render() {
- // return
- }
-
- }
-
-
- function fncb_only(fn_name){
- var ret
- if (window.glob_vhook.rcb[fn_name]){
- // ret = window.glob_vhook.rcb[fn_name](fn_name,o,dflt_ret)
- // (fn_name,o,dflt_ret)
- ret = {status:1,fn:window.glob_vhook.rcb[fn_name]}
- } else {
- ret = {status:0,fn:window.nop}
- }
- return ret
- }
-
-
-
- class Wview_vx extends Component<Props> {
- constructor(props) {
- super(props);
- }
- render(){
- return (
- <View>
- <Text>Wview_vx</Text>
- </View>
- )
- }
- }
- // class Wview_vx
-
-
- // class Wview_v1 extends PureComponent<Props> {
- class Wview_v1 extends Component<Props> {
- constructor(props) {
- super(props);
- // const { palette } = useTheme();
- this.v1="a"
-
- // this.palette=palette
- tglob_au.reg_qxi_cb(this.rs_state.bind(this),"SET_TILE_VIEW_DIMENSIONS","RS_STATE")
- tglob_au.reg_dev_cb(this.rs_state2.bind(this),"rerender_Wview_v1","rerender")
-
- clog("Wview_v1 init")
- }
- rs_state2(a1,a2,a3,a4,a5){
- this.setState(() => {
- return { unseen3: Math.random() }
- });
- }
- rs_state(a1,a2,a3,a4,a5){
- // clog("RS_STATE",this,{a1,a2,a3,a4,a5})
- // clog("RS_STATE",{a1,a2,a3,a4,a5})
-
- this.setState(() => {
- // console.log('setting state');
- var wv0_dev = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_dev",{that:this},{}) : {}
- // return { unseen: "does not display" }
- return { unseen2: wv0_dev.ret }
- });
- /*
- try {
- // var s = this.props
- var s = this.state
- clog("::::",s)
-
- } catch (err){
- console.error("ERR:,")
- }
- */
-
- }
- /*
-
- componentDidMount() {
- setInterval(() => {
- this.setState(() => {
- // console.log('setting state');
- var wv0_dev = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_dev",{that:this},{}) : {}
- return { unseen: "does not display" }
- // return { unseen: wv0_dev.ret }
- });
- }, 1000);
- }
- */
-
- render() {
-
-
- var wb_url
-
- clog("Wview_v1 render")
- // console.log("wview_v1 render.")
-
- if (glob_vhook?.fns?.gen_xcal_room3) {
- wb_url = glob_vhook.fns.gen_xcal_room3().room_url
- } else {
- // wb_url = "https://excalidraw.videocorners.com/#room=4zmaf7d5jtcx4pqgruba,4zmaf7BMXbI6tCEiW7rbgy"
- wb_url = "https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"
- }
-
-
-
-
-
- var webview_style = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("webview_style",{that:this},{}) : {}
- var wv0_styles = window.glob_vhook.fns.glob_dev_fncb ? window.glob_vhook.fns.glob_dev_fncb("wv0_styles",{that:this},{}) : {}
- // <View
- // style = {wv0_styles.v1 || {}}
- // >
- var wv0_styles_dev = this.wv0_styles_dev || {}
-
-
- // window.postMessage("Your message");
- console.log(">>>>>>>..?")
- var injectedJs = `(function(){
- console.log(">>>>>>>..")
- this.webView.postMessage("ZZ")
- return "Send me back!"}());
- `;
- injectedJs =`
- setTimeout(function () {
- window.ReactNativeWebView.postMessage("Hello!")
- console.log("QWETUI\n")
- window.top.postMessage('hello2', '*')
- }, 2000)
- `
-
- // <View style = { wv0_styles.v1 || {} }>
- // style = {webview_style}
-
- // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
- // <WebView source = {{uri:"https://excalidraw.videocorners.com/#room=4zxcald5jtcx4pqgruba,4zxcalBMXbI6tCEiW7rbgy"}}
- // {t('polls.create.create')}
- // <Wview_ui style = { wv0_styles_dev.vb1 || {}} />
- return (
- <View style = { wv0_styles_dev.v1 || {} }>
-
- <Text style = { wv0_styles_dev.txt || {} }
- >
- Z??
- </Text>
- <Wview_vx></Wview_vx>
-
-
-
- <WebView source = {{uri:wb_url}}
- style = {wv0_styles_dev.webview_style || {}}
- injectedJavaScript={injectedJs}
-
- startInLoadingState
- javaScriptEnabledAndroid={true}
- javaScriptEnabled={true}
-
- onMessage={onMsg}
- ></WebView>
- <Button
- style = { wv0_styles_dev.vb1 || {}}
- color = { wv0_styles_dev.vb1_color || "#00ffffff" }
- onPress = {fncb_only("vb1_press").fn.bind(this)}
- >
- {wv0_styles_dev.vb1_txt || "udef"}
- </Button>
- <Text2 style = { wv0_styles_dev.txt2 || {} }
- >
- Z2
- </Text2>
- </View>
- )
- }
- }
-
- // color = { this.palette.screen01Header }
-
-
- export {Wview_v1}
|