Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
57ce7ab1
Unverified
Commit
57ce7ab1
authored
Mar 02, 2020
by
yann300
Committed by
GitHub
Mar 02, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2599 from ethereum/themeImgs
added filter invert to images
parents
56eecb30
934acf5c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
37 deletions
+64
-37
tab-proxy.js
src/app/panels/tab-proxy.js
+15
-0
compile-tab.js
src/app/tabs/compile-tab.js
+2
-6
settings-tab.js
src/app/tabs/settings-tab.js
+1
-1
settings-tab-styles.js
src/app/tabs/styles/settings-tab-styles.js
+1
-1
theme-module.js
src/app/tabs/theme-module.js
+11
-0
landing-page.js
src/app/ui/landing-page/landing-page.js
+2
-6
persmission-handler.js
src/app/ui/persmission-handler.js
+31
-22
publishContract.js
test-browser/tests/publishContract.js
+1
-1
No files found.
src/app/panels/tab-proxy.js
View file @
57ce7ab1
var
yo
=
require
(
'yo-yo'
)
var
yo
=
require
(
'yo-yo'
)
var
$
=
require
(
'jquery'
)
var
$
=
require
(
'jquery'
)
const
EventEmitter
=
require
(
'events'
)
const
EventEmitter
=
require
(
'events'
)
const
globalRegistry
=
require
(
'../../global/registry'
)
require
(
'remix-tabs'
)
require
(
'remix-tabs'
)
...
@@ -14,6 +15,11 @@ export class TabProxy {
...
@@ -14,6 +15,11 @@ export class TabProxy {
this
.
_view
=
{}
this
.
_view
=
{}
this
.
_handlers
=
{}
this
.
_handlers
=
{}
globalRegistry
.
get
(
'themeModule'
).
api
.
events
.
on
(
'themeChanged'
,
(
theme
)
=>
{
// update invert for all icons
this
.
updateImgStyles
()
})
fileManager
.
events
.
on
(
'fileRemoved'
,
(
name
)
=>
{
fileManager
.
events
.
on
(
'fileRemoved'
,
(
name
)
=>
{
this
.
removeTab
(
name
)
this
.
removeTab
(
name
)
})
})
...
@@ -77,6 +83,14 @@ export class TabProxy {
...
@@ -77,6 +83,14 @@ export class TabProxy {
}
}
})
})
}
}
updateImgStyles
()
{
const
images
=
this
.
_view
.
filetabs
.
getElementsByClassName
(
'image'
)
if
(
images
.
length
!==
0
)
{
for
(
let
element
of
images
)
{
globalRegistry
.
get
(
'themeModule'
).
api
.
fixInvert
(
element
)
};
}
}
switchTab
(
tabName
)
{
switchTab
(
tabName
)
{
if
(
this
.
_handlers
[
tabName
])
{
if
(
this
.
_handlers
[
tabName
])
{
...
@@ -129,6 +143,7 @@ export class TabProxy {
...
@@ -129,6 +143,7 @@ export class TabProxy {
icon
,
icon
,
tooltip
:
name
tooltip
:
name
})
})
this
.
updateImgStyles
()
this
.
_handlers
[
name
]
=
{
switchTo
,
close
}
this
.
_handlers
[
name
]
=
{
switchTo
,
close
}
}
}
...
...
src/app/tabs/compile-tab.js
View file @
57ce7ab1
...
@@ -168,12 +168,8 @@ class CompileTab extends ViewPlugin {
...
@@ -168,12 +168,8 @@ class CompileTab extends ViewPlugin {
}
}
})
})
globalRegistry
.
get
(
'themeModule'
).
api
.
events
.
on
(
'themeChanged'
,
(
theme
)
=>
{
globalRegistry
.
get
(
'themeModule'
).
api
.
events
.
on
(
'themeChanged'
,
()
=>
{
const
invert
=
theme
.
quality
===
'dark'
?
1
:
0
globalRegistry
.
get
(
'themeModule'
).
api
.
fixInvert
(
document
.
getElementById
(
'swarmLogo'
))
const
img
=
document
.
getElementById
(
'swarmLogo'
)
if
(
img
)
{
img
.
style
.
filter
=
`invert(
${
invert
}
)`
}
})
})
// Run the compiler instead of trying to save the website
// Run the compiler instead of trying to save the website
...
...
src/app/tabs/settings-tab.js
View file @
57ce7ab1
...
@@ -68,7 +68,7 @@ module.exports = class SettingsTab extends ViewPlugin {
...
@@ -68,7 +68,7 @@ module.exports = class SettingsTab extends ViewPlugin {
if
(
self
.
_view
.
el
)
return
self
.
_view
.
el
if
(
self
.
_view
.
el
)
return
self
.
_view
.
el
// Gist settings
// Gist settings
var
gistAccessToken
=
yo
`<input id="gistaccesstoken" type="password" class="form-control mb-2
${
css
.
inline
}
" placeholder="Token">`
var
gistAccessToken
=
yo
`<input id="gistaccesstoken" type="password" class="
border
form-control mb-2
${
css
.
inline
}
" placeholder="Token">`
var
token
=
this
.
config
.
get
(
'settings/gist-access-token'
)
var
token
=
this
.
config
.
get
(
'settings/gist-access-token'
)
if
(
token
)
gistAccessToken
.
value
=
token
if
(
token
)
gistAccessToken
.
value
=
token
var
gistAddToken
=
yo
`<input class="
${
css
.
savegisttoken
}
btn btn-sm btn-primary" id="savegisttoken" onclick=
${()
=>
{
this
.
config
.
set
(
'settings/gist-access-token'
,
gistAccessToken
.
value
);
tooltip
(
'Access token saved'
)
}}
value
=
"Save"
type
=
"button"
>
`
var
gistAddToken
=
yo
`<input class="
${
css
.
savegisttoken
}
btn btn-sm btn-primary" id="savegisttoken" onclick=
${()
=>
{
this
.
config
.
set
(
'settings/gist-access-token'
,
gistAccessToken
.
value
);
tooltip
(
'Access token saved'
)
}}
value
=
"Save"
type
=
"button"
>
`
...
...
src/app/tabs/styles/settings-tab-styles.js
View file @
57ce7ab1
...
@@ -85,7 +85,7 @@ const css = csjs`
...
@@ -85,7 +85,7 @@ const css = csjs`
}
}
.inline {
.inline {
display: inline;
display: inline;
width:
5
0%;
width:
4
0%;
}
}
`
`
...
...
src/app/tabs/theme-module.js
View file @
57ce7ab1
...
@@ -84,4 +84,15 @@ export class ThemeModule extends Plugin {
...
@@ -84,4 +84,15 @@ export class ThemeModule extends Plugin {
this
.
emit
(
'themeChanged'
,
nextTheme
)
this
.
emit
(
'themeChanged'
,
nextTheme
)
this
.
events
.
emit
(
'themeChanged'
,
nextTheme
)
this
.
events
.
emit
(
'themeChanged'
,
nextTheme
)
}
}
/**
* fixes the invertion for images since this should be adjusted when we switch between dark/light qualified themes
* @param {element} [image] - the dom element which invert should be fixed to increase visibility
*/
fixInvert
(
image
)
{
const
invert
=
this
.
currentTheme
().
quality
===
'dark'
?
1
:
0
if
(
image
)
{
image
.
style
.
filter
=
`invert(
${
invert
}
)`
}
}
}
}
src/app/ui/landing-page/landing-page.js
View file @
57ce7ab1
...
@@ -163,12 +163,8 @@ export class LandingPage extends ViewPlugin {
...
@@ -163,12 +163,8 @@ export class LandingPage extends ViewPlugin {
this
.
verticalIcons
.
select
(
'fileExplorers'
)
this
.
verticalIcons
.
select
(
'fileExplorers'
)
}
}
globalRegistry
.
get
(
'themeModule'
).
api
.
events
.
on
(
'themeChanged'
,
(
theme
)
=>
{
globalRegistry
.
get
(
'themeModule'
).
api
.
events
.
on
(
'themeChanged'
,
()
=>
{
const
invert
=
theme
.
quality
===
'dark'
?
1
:
0
globalRegistry
.
get
(
'themeModule'
).
api
.
fixInvert
(
document
.
getElementById
(
'remixLogo'
))
const
img
=
document
.
getElementById
(
'remixLogo'
)
if
(
img
)
{
img
.
style
.
filter
=
`invert(
${
invert
}
)`
}
})
})
let
switchToPreviousVersion
=
()
=>
{
let
switchToPreviousVersion
=
()
=>
{
...
...
src/app/ui/persmission-handler.js
View file @
57ce7ab1
...
@@ -3,6 +3,7 @@ const yo = require('yo-yo')
...
@@ -3,6 +3,7 @@ const yo = require('yo-yo')
const
csjs
=
require
(
'csjs-inject'
)
const
csjs
=
require
(
'csjs-inject'
)
const
addTooltip
=
require
(
'./tooltip'
)
const
addTooltip
=
require
(
'./tooltip'
)
const
modalDialog
=
require
(
'./modaldialog'
)
const
modalDialog
=
require
(
'./modaldialog'
)
const
globalRegistry
=
require
(
'../../global/registry'
)
const
css
=
csjs
`
const
css
=
csjs
`
.permission h4 {
.permission h4 {
...
@@ -140,37 +141,45 @@ export class PermissionHandler {
...
@@ -140,37 +141,45 @@ export class PermissionHandler {
:
delete
this
.
permissions
[
to
.
name
][
from
.
name
]
:
delete
this
.
permissions
[
to
.
name
][
from
.
name
]
}
}
const
rememberSwitch
=
remember
const
rememberSwitch
=
remember
?
yo
`<input type="checkbox" onchange="
${
switchMode
}
" checkbox class="
custom-control
-input" id="remember" data-id="permissionHandlerRememberChecked">`
?
yo
`<input type="checkbox" onchange="
${
switchMode
}
" checkbox class="
form-check
-input" id="remember" data-id="permissionHandlerRememberChecked">`
:
yo
`<input type="checkbox" onchange="
${
switchMode
}
" class="
custom-control
-input" id="remember" data-id="permissionHandlerRememberUnchecked">`
:
yo
`<input type="checkbox" onchange="
${
switchMode
}
" class="
form-check
-input" id="remember" data-id="permissionHandlerRememberUnchecked">`
const
message
=
remember
const
message
=
remember
?
`"
${
fromName
}
" has changed and would like to access "
${
toName
}
"`
?
`"
${
fromName
}
" has changed and would like to access "
${
toName
}
"`
:
`"
${
fromName
}
" would like to access "
${
toName
}
"`
:
`"
${
fromName
}
" would like to access "
${
toName
}
"`
return
yo
`
const
imgFrom
=
yo
`<img id="permissionModalImagesFrom" src="
${
from
.
icon
}
" />`
<section class="
${
css
.
permission
}
">
const
imgTo
=
yo
`<img id="permissionModalImagesTo" src="
${
to
.
icon
}
" />`
const
pluginsImages
=
yo
`
<article class="
${
css
.
images
}
">
<article class="
${
css
.
images
}
">
<img src="
${
from
.
icon
}
" />
${
imgFrom
}
<i class="fas fa-arrow-right"></i>
<i class="fas fa-arrow-right"></i>
<img src="
${
to
.
icon
}
" />
${
imgTo
}
</article>
<article>
<h4 data-id="permissionHandlerMessage">
${
message
}
:</h4>
<h6>
${
fromName
}
</h6>
<p>
${
from
.
description
||
yo
`<i>No description Provided</i>`
}
</p>
<h6>
${
toName
}
:</p>
<p>
${
to
.
description
||
yo
`<i>No description Provided</i>`
}
</p>
</article>
</article>
<article class="
${
css
.
remember
}
">
`
<div class="custom-control custom-checkbox">
${
rememberSwitch
}
globalRegistry
.
get
(
'themeModule'
).
api
.
fixInvert
(
imgFrom
)
<label class="custom-control-label" for="remember" data-id="permissionHandlerRememberChoice">Remember this choice</label>
globalRegistry
.
get
(
'themeModule'
).
api
.
fixInvert
(
imgTo
)
</div>
<button class="btn btn-sm" onclick="
${
_
=>
this
.
clear
()}
">Reset all Permissions</button>
return
yo
`
</article>
<section class="
${
css
.
permission
}
">
${
pluginsImages
}
<article>
<h4 data-id="permissionHandlerMessage">
${
message
}
:</h4>
<h6>
${
fromName
}
</h6>
<p>
${
from
.
description
||
yo
`<i>No description Provided</i>`
}
</p>
<h6>
${
toName
}
:</p>
<p>
${
to
.
description
||
yo
`<i>No description Provided</i>`
}
</p>
</article>
</section>
<article class="
${
css
.
remember
}
">
<div class="form-check">
${
rememberSwitch
}
<label class="form-check-label" for="remember" data-id="permissionHandlerRememberChoice">Remember this choice</label>
</div>
<button class="btn btn-sm" onclick="
${
_
=>
this
.
clear
()}
">Reset all Permissions</button>
</article>
</section>
`
`
}
}
}
}
test-browser/tests/publishContract.js
View file @
57ce7ab1
...
@@ -23,7 +23,7 @@ module.exports = {
...
@@ -23,7 +23,7 @@ module.exports = {
})
})
.
modalFooterOKClick
()
.
modalFooterOKClick
()
},
},
'Publish on Swarm'
:
function
(
browser
)
{
'Publish on Swarm'
:
''
+
function
(
browser
)
{
browser
browser
.
click
(
'#publishOnSwarm'
)
.
click
(
'#publishOnSwarm'
)
.
getModalBody
((
value
,
done
)
=>
{
.
getModalBody
((
value
,
done
)
=>
{
...
...
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