Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
a60f6f9e
Commit
a60f6f9e
authored
Jul 16, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[jitsi meet] external api in our sources, this works initially
parent
21a3b34a
Pipeline
#1602
canceled with stage
Changes
5
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
21 deletions
+45
-21
index.html
dist/index.html
+0
-1
Frame.purs
src/Gargantext/Components/Nodes/Frame.purs
+10
-20
JitsiMeet.js
src/Gargantext/Utils/JitsiMeet.js
+10
-0
JitsiMeet.purs
src/Gargantext/Utils/JitsiMeet.purs
+21
-0
JitsiMeetAPI.js
src/external-deps/JitsiMeetAPI.js
+4
-0
No files found.
dist/index.html
View file @
a60f6f9e
...
@@ -14,6 +14,5 @@
...
@@ -14,6 +14,5 @@
<div
id=
"app"
class =
"container-fluid"
></div>
<div
id=
"app"
class =
"container-fluid"
></div>
<div
id=
"portal"
></div>
<div
id=
"portal"
></div>
<script
src=
"bundle.js"
></script>
<script
src=
"bundle.js"
></script>
<script
src=
'https://visio.gargantext.org/external_api.js'
></script>
<!-- FIXME to be removed -->
</body>
</body>
</html>
</html>
src/Gargantext/Components/Nodes/Frame.purs
View file @
a60f6f9e
...
@@ -8,7 +8,7 @@ import Data.Eq.Generic (genericEq)
...
@@ -8,7 +8,7 @@ import Data.Eq.Generic (genericEq)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype)
import Data.Newtype (class Newtype)
import Data.Nullable (Nullable, null)
import Data.Nullable (Nullable, null
, toMaybe
)
import Data.Show.Generic (genericShow)
import Data.Show.Generic (genericShow)
import DOM.Simple as DOM
import DOM.Simple as DOM
import Effect.Aff (Aff)
import Effect.Aff (Aff)
...
@@ -24,6 +24,7 @@ import Gargantext.Hooks.Loader (useLoader)
...
@@ -24,6 +24,7 @@ import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session, get, sessionId)
import Gargantext.Sessions (Session, get, sessionId)
import Gargantext.Types (NodeType(..))
import Gargantext.Types (NodeType(..))
import Gargantext.Utils.JitsiMeet as JM
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
import Gargantext.Utils.Toestand as T2
...
@@ -130,30 +131,19 @@ nodeFrameVisioCpt = here.component "nodeFrameVisio" cpt
...
@@ -130,30 +131,19 @@ nodeFrameVisioCpt = here.component "nodeFrameVisio" cpt
, reload
, reload
, url } _ = do
, url } _ = do
-- api = new JitsiMeetExternalAPI("visio.gargantext.org", {roomName: frame_id})
-- api = new JitsiMeetExternalAPI("visio.gargantext.org", {roomName: frame_id})
api <- T.useBox (Nothing :: Maybe JM.JitsiMeet)
ref <- R.useRef (null :: Nullable DOM.Element)
ref <- R.useRef (null :: Nullable DOM.Element)
R.useEffect' $ do
R.useEffect' $ do
here.log2 "[nodeFrameVisio] ref" $ R.readRef ref
here.log2 "[nodeFrameVisio] ref" $ R.readRef ref
here.log2 "[nodeFrameVisio] JM.api" JM._api
case toMaybe (R.readRef ref) of
Nothing -> pure unit
Just r -> do
api <- JM.jitsiMeetAPI (WURL.host url) { parentNode: r, roomName: frame_id }
here.log2 "[nodeFrameVisio] api" api
pure $ H.div { ref } [ nodeFrameVisioPlaceholder { frame_id, ref, reload, url } ]
pure $ H.div { ref } [ H.text $ WURL.host url ]
type NodeFrameVisioPlaceholderProps =
( ref :: R.Ref (Nullable DOM.Element)
| NodeFrameVisioProps
)
nodeFrameVisioPlaceholder :: R2.Leaf NodeFrameVisioPlaceholderProps
nodeFrameVisioPlaceholder props = R.createElement nodeFrameVisioPlaceholderCpt props []
nodeFrameVisioPlaceholder :: R.Component NodeFrameVisioPlaceholderProps
nodeFrameVisioPlaceholder = here.component "nodeFrameVisioPlaceholder" cpt
where
cpt { frame_id
, ref
, url } _ = do
R.useEffect' $ do
here.log2 "[nodeFrameVisioPlaceholder] ref" $ R.readRef ref
pure $ H.text $ WURL.host url
type LoadProps = ( nodeId :: Int
type LoadProps = ( nodeId :: Int
, session :: Session )
, session :: Session )
...
...
src/Gargantext/Utils/JitsiMeet.js
0 → 100644
View file @
a60f6f9e
'use strict'
;
var
API
=
require
(
'../../src/external-deps/JitsiMeetAPI.js'
);
console
.
log
(
'API'
,
API
);
exports
.
_api
=
API
;
exports
.
_jitsiMeetAPI
=
function
(
host
,
options
)
{
return
new
API
(
host
,
options
);
};
src/Gargantext/Utils/JitsiMeet.purs
0 → 100644
View file @
a60f6f9e
module Gargantext.Utils.JitsiMeet where
import Data.Function.Uncurried (Fn2, runFn2)
import DOM.Simple as DOM
import Effect (Effect)
import Effect.Uncurried (EffectFn2, runEffectFn2)
foreign import data JitsiMeet :: Type
type Jitsi =
{ parentNode :: DOM.Element
, roomName :: String }
foreign import _api :: JitsiMeet
foreign import _jitsiMeetAPI :: EffectFn2 String Jitsi JitsiMeet
jitsiMeetAPI :: String -> Jitsi -> Effect JitsiMeet
jitsiMeetAPI = runEffectFn2 _jitsiMeetAPI
--jitsiMeetAPIFn :: String -> Jitsi -> JitsiMeet
--jitsiMeetAPIFn = runFn2 _jitsiMeetAPI
src/external-deps/JitsiMeetAPI.js
0 → 100644
View file @
a60f6f9e
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment