Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Chatterbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
element-hq
Chatterbox
Commits
49d29cdc
Commit
49d29cdc
authored
3 years ago
by
Midhun Suresh
Browse files
Options
Downloads
Patches
Plain Diff
Give sane names to variables
parent
18f6f56a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/parent.ts
+5
-6
5 additions, 6 deletions
src/parent.ts
with
5 additions
and
6 deletions
src/parent.ts
+
5
−
6
View file @
49d29cdc
import
"
./parent-style.css
"
;
let
isIframeLoaded
=
false
;
const
parent
RootHos
t
=
(
document
.
querySelector
(
"
#chatterbox-script
"
)
as
HTMLScriptElement
).
src
;
const
parent
Root
HostURL
=
new
URL
(
parent
RootHos
t
);
const
rootHos
t
=
`
${
parent
Root
HostURL
.
protocol
}${
parent
Root
HostURL
.
host
}
`
;
const
parent
HostRoo
t
=
(
document
.
querySelector
(
"
#chatterbox-script
"
)
as
HTMLScriptElement
).
src
;
const
parentHos
Roo
tURL
=
new
URL
(
parent
HostRoo
t
);
const
hostRoo
t
=
`
${
parentHos
Roo
tURL
.
protocol
}${
parentHos
Roo
tURL
.
host
}
`
;
const
sizeCollection
=
{
"
desktop
"
:
{
...
...
@@ -46,8 +46,7 @@ function renderStartButton() {
function
loadCSS
()
{
const
linkElement
=
document
.
createElement
(
"
link
"
)
as
HTMLLinkElement
;
linkElement
.
rel
=
"
stylesheet
"
;
const
urlFixed
=
new
URL
(
"
CSS_FILE_NAME
"
,
parentRootHost
);
linkElement
.
href
=
urlFixed
.
href
;
linkElement
.
href
=
new
URL
(
"
CSS_FILE_NAME
"
,
parentHostRoot
).
href
;
document
.
head
.
appendChild
(
linkElement
);
}
...
...
@@ -57,7 +56,7 @@ function loadChatterboxIframe() {
if
(
!
configLocation
)
{
throw
new
Error
(
"
CONFIG_LOCATION is not set
"
);
}
iframe
.
src
=
new
URL
(
"
../chatterbox.html?config=
"
+
configLocation
,
rootHos
t
).
href
;
iframe
.
src
=
new
URL
(
"
../chatterbox.html?config=
"
+
configLocation
,
hostRoo
t
).
href
;
iframe
.
className
=
"
chatterbox-iframe
"
;
document
.
body
.
appendChild
(
iframe
);
isIframeLoaded
=
true
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment