Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
Rocket.Chat.Electron
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
RocketChat
Rocket.Chat.Electron
Commits
8d1dcf6a
Commit
8d1dcf6a
authored
Sep 19, 2018
by
Tasso Evangelista
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move about dialog styles to the stylesheets
parent
51b2f588
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
113 deletions
+107
-113
src/public/about.html
src/public/about.html
+55
-112
src/stylesheets/main.less
src/stylesheets/main.less
+2
-1
src/stylesheets/pages/about.less
src/stylesheets/pages/about.less
+50
-0
No files found.
src/public/about.html
View file @
8d1dcf6a
<!doctype html>
<html>
<head>
<title></title>
<meta
charset=
"utf-8"
/>
<style>
html
{
background-color
:
#ececec
;
font-family
:
helvetica
;
padding
:
10px
;
}
body
{
margin
:
0px
;
text-align
:
center
;
}
img
{
height
:
60px
;
margin-bottom
:
5px
;
}
.app-name
{
font-size
:
14px
;
font-weight
:
bold
;
}
.app-version
{
margin-top
:
15px
;
font-size
:
11px
;
}
.app-version
.version
{
font-weight
:
bold
;
}
.update
{
margin-top
:
5px
;
}
.copyright
{
font-size
:
10px
;
position
:
absolute
;
bottom
:
0
;
margin-left
:
auto
;
margin-right
:
auto
;
left
:
0
;
right
:
0
;
}
.update-container
{
display
:
none
;
}
.update-container.update-container--enabled
{
display
:
block
;
}
.auto-update-container
{
margin
:
auto
0
;
}
</style>
<script>
const
i18n
=
require
(
'
../i18n/index
'
);
</script>
<link
rel=
"stylesheet"
href=
"../stylesheets/main.css"
/>
<script>
const
i18n
=
require
(
'
../i18n/index
'
);
</script>
</head>
<body>
<img
src=
"images/icon.png"
>
<div
class=
"app-name"
></div>
<div
class=
"app-version"
></div>
<div
class=
"update-container"
>
<span
class=
"update-spin icon-spin3 animate-spin"
style=
"display:none;"
></span>
<button
class=
"update"
><script>
document
.
write
(
i18n
.
__
(
'
Check_for_Updates
'
))
</script></button>
<p
class=
"auto-update-container"
><input
type=
"checkbox"
id=
"auto-update"
checked
/>
<script>
document
.
write
(
i18n
.
__
(
'
Check_for_Updates_on_Start
'
))
</script></p>
</div>
<p
class=
"copyright"
><script>
document
.
write
(
i18n
.
__
(
'
Copyright
'
,
require
(
'
../../package.json
'
).
copyright
))
</script></p>
<script>
const
{
remote
,
ipcRenderer
}
=
require
(
'
electron
'
);
document
.
querySelector
(
'
.app-name
'
).
innerHTML
=
remote
.
app
.
getName
();
document
.
querySelector
(
'
.app-version
'
).
innerHTML
=
`
${
i18n
.
__
(
'
Version
'
)}
<span class="version">
${
remote
.
app
.
getVersion
()}
</span>`
;
const
canUpdate
=
ipcRenderer
.
sendSync
(
'
can-update
'
);
if
(
canUpdate
)
{
const
canAutoUpdate
=
ipcRenderer
.
sendSync
(
'
can-auto-update
'
);
<body
class=
"about-page"
>
<img
src=
"./images/icon.png"
>
<div
class=
"app-name"
></div>
<div
class=
"app-version"
></div>
<div
class=
"update-container"
>
<span
class=
"update-spin icon-spin3 animate-spin"
style=
"display:none;"
></span>
<button
class=
"update"
><script>
document
.
write
(
i18n
.
__
(
'
Check_for_Updates
'
))
</script></button>
<p
class=
"auto-update-container"
><input
type=
"checkbox"
id=
"auto-update"
checked
/>
<script>
document
.
write
(
i18n
.
__
(
'
Check_for_Updates_on_Start
'
))
</script></p>
</div>
<p
class=
"copyright"
><script>
document
.
write
(
i18n
.
__
(
'
Copyright
'
,
require
(
'
../../package.json
'
).
copyright
))
</script></p>
<script>
const
{
remote
,
ipcRenderer
}
=
require
(
'
electron
'
);
document
.
querySelector
(
'
.app-name
'
).
innerHTML
=
remote
.
app
.
getName
();
document
.
querySelector
(
'
.app-version
'
).
innerHTML
=
`
${
i18n
.
__
(
'
Version
'
)}
<span class="version">
${
remote
.
app
.
getVersion
()}
</span>`
;
const
canUpdate
=
ipcRenderer
.
sendSync
(
'
can-update
'
);
if
(
canUpdate
)
{
const
canAutoUpdate
=
ipcRenderer
.
sendSync
(
'
can-auto-update
'
);
if
(
canAutoUpdate
)
{
document
.
querySelector
(
'
#auto-update
'
).
setAttribute
(
'
checked
'
,
'
checked
'
);
}
else
{
document
.
querySelector
(
'
#auto-update
'
).
removeAttribute
(
'
checked
'
);
}
if
(
canAutoUpdate
)
{
document
.
querySelector
(
'
#auto-update
'
).
setAttribute
(
'
checked
'
,
'
checked
'
);
}
else
{
document
.
querySelector
(
'
#auto-update
'
).
removeAttribute
(
'
checked
'
);
}
const
canSetAutoUpdate
=
ipcRenderer
.
sendSync
(
'
can-set-auto-update
'
);
if
(
canSetAutoUpdate
)
{
document
.
querySelector
(
'
#auto-update
'
).
addEventListener
(
'
change
'
,
(
event
)
=>
{
ipcRenderer
.
send
(
'
set-auto-update
'
,
event
.
target
.
checked
);
});
}
else
{
document
.
querySelector
(
'
#auto-update
'
).
setAttribute
(
'
disabled
'
,
'
disabled
'
);
}
const
canSetAutoUpdate
=
ipcRenderer
.
sendSync
(
'
can-set-auto-update
'
);
if
(
canSetAutoUpdate
)
{
document
.
querySelector
(
'
#auto-update
'
).
addEventListener
(
'
change
'
,
(
event
)
=>
{
ipcRenderer
.
send
(
'
set-auto-update
'
,
event
.
target
.
checked
);
});
}
else
{
document
.
querySelector
(
'
#auto-update
'
).
setAttribute
(
'
disabled
'
,
'
disabled
'
);
document
.
querySelector
(
'
.update
'
).
onclick
=
function
(
e
)
{
document
.
querySelector
(
'
.update-spin
'
).
setAttribute
(
'
style
'
,
''
);
document
.
querySelector
(
'
.update
'
).
setAttribute
(
'
disabled
'
,
'
disabled
'
);
ipcRenderer
.
send
(
'
check-for-updates
'
);
};
ipcRenderer
.
on
(
'
update-result
'
,
(
e
,
updateAvailable
)
=>
{
document
.
querySelector
(
'
.update-spin
'
).
setAttribute
(
'
style
'
,
'
display:none
'
);
document
.
querySelector
(
'
.update
'
).
removeAttribute
(
'
disabled
'
);
if
(
!
updateAvailable
)
{
alert
(
'
No updates are available.
'
);
}
});
document
.
querySelector
(
'
.update
'
).
onclick
=
function
(
e
)
{
document
.
querySelector
(
'
.update-spin
'
).
setAttribute
(
'
style
'
,
''
);
document
.
querySelector
(
'
.update
'
).
setAttribute
(
'
disabled
'
,
'
disabled
'
);
ipcRenderer
.
send
(
'
check-for-updates
'
);
};
ipcRenderer
.
on
(
'
update-result
'
,
(
e
,
updateAvailable
)
=>
{
document
.
querySelector
(
'
.update-spin
'
).
setAttribute
(
'
style
'
,
'
display:none
'
);
document
.
querySelector
(
'
.update
'
).
removeAttribute
(
'
disabled
'
);
if
(
!
updateAvailable
)
{
alert
(
'
No updates are available.
'
);
}
});
document
.
querySelector
(
'
.update-container
'
).
classList
.
add
(
'
update-container--enabled
'
);
}
</script>
</body>
document
.
querySelector
(
'
.update-container
'
).
classList
.
add
(
'
update-container--enabled
'
);
}
</script>
</body>
</html>
src/stylesheets/main.less
View file @
8d1dcf6a
...
...
@@ -4,6 +4,7 @@
@import "../branding/branding.less";
@import "fontello.less";
@import "utils/_loading.import.less";
@import "pages/about.less";
*,
*:before,
...
...
@@ -305,7 +306,7 @@ input[type='password'] {
.loading-error {
height: 100%;
color: white;
color: white;
text-align: center;
background-color: @primary-background-color;
background-position: center bottom;
...
...
src/stylesheets/pages/about.less
0 → 100644
View file @
8d1dcf6a
.about-page {
background-color: #ececec;
padding: 10px;
text-align: center;
img {
height: 60px;
margin-bottom: 5px;
}
.app-name {
font-size: 14px;
font-weight: bold;
}
.app-version {
margin-top: 15px;
font-size: 11px;
}
.app-version .version {
font-weight: bold;
}
.update {
margin-top:5px;
}
.copyright {
font-size: 10px;
position: absolute;
bottom: 0;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
}
.update-container {
display: none;
}
.update-container.update-container--enabled {
display: block;
}
.auto-update-container {
margin: auto 0;
}
}
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