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
7b7a7213
Unverified
Commit
7b7a7213
authored
May 06, 2019
by
yann300
Committed by
GitHub
May 06, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1919 from ethereum/fixConfig
Fix config
parents
9a3295bc
b47e40e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
14 deletions
+10
-14
app.js
src/app.js
+3
-3
settings-tab.js
src/app/tabs/settings-tab.js
+1
-6
theme-module.js
src/app/tabs/theme-module.js
+6
-5
No files found.
src/app.js
View file @
7b7a7213
...
@@ -123,10 +123,10 @@ class App {
...
@@ -123,10 +123,10 @@ class App {
var
fileStorage
=
new
Storage
(
'sol:'
)
var
fileStorage
=
new
Storage
(
'sol:'
)
registry
.
put
({
api
:
fileStorage
,
name
:
'fileStorage'
})
registry
.
put
({
api
:
fileStorage
,
name
:
'fileStorage'
})
var
configStorage
=
new
Storage
(
'config:'
)
var
configStorage
=
new
Storage
(
'config
-v0.8
:'
)
registry
.
put
({
api
:
configStorage
,
name
:
'configStorage'
})
registry
.
put
({
api
:
configStorage
,
name
:
'configStorage'
})
self
.
_components
.
config
=
new
Config
(
file
Storage
)
self
.
_components
.
config
=
new
Config
(
config
Storage
)
registry
.
put
({
api
:
self
.
_components
.
config
,
name
:
'config'
})
registry
.
put
({
api
:
self
.
_components
.
config
,
name
:
'config'
})
self
.
_components
.
gistHandler
=
new
GistHandler
()
self
.
_components
.
gistHandler
=
new
GistHandler
()
...
@@ -335,7 +335,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -335,7 +335,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
registry
.
put
({
api
:
networkModule
,
name
:
'network'
})
registry
.
put
({
api
:
networkModule
,
name
:
'network'
})
// ----------------- theme module ----------------------------
// ----------------- theme module ----------------------------
const
themeModule
=
new
ThemeModule
()
const
themeModule
=
new
ThemeModule
(
registry
)
registry
.
put
({
api
:
themeModule
,
name
:
'themeModule'
})
registry
.
put
({
api
:
themeModule
,
name
:
'themeModule'
})
// ----------------- editor panel ----------------------
// ----------------- editor panel ----------------------
...
...
src/app/tabs/settings-tab.js
View file @
7b7a7213
...
@@ -35,11 +35,6 @@ module.exports = class SettingsTab extends BaseApi {
...
@@ -35,11 +35,6 @@ module.exports = class SettingsTab extends BaseApi {
}
}
}
/* eslint-enable */
}
/* eslint-enable */
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
this
.
initTheme
()
}
initTheme
()
{
this
.
currentTheme
=
this
.
_deps
.
themeModule
.
currentTheme
()
}
}
createThemeCheckies
()
{
createThemeCheckies
()
{
...
@@ -54,7 +49,7 @@ module.exports = class SettingsTab extends BaseApi {
...
@@ -54,7 +49,7 @@ module.exports = class SettingsTab extends BaseApi {
<input type="radio" onchange=
${
event
=>
{
onswitchTheme
(
event
,
aTheme
.
name
)
}}
class
=
"align-middle form-check-input"
name
=
"theme"
id
=
"${aTheme.name}"
>
<input type="radio" onchange=
${
event
=>
{
onswitchTheme
(
event
,
aTheme
.
name
)
}}
class
=
"align-middle form-check-input"
name
=
"theme"
id
=
"${aTheme.name}"
>
<
label
class
=
"form-check-label"
for
=
"${aTheme.name}"
>
$
{
aTheme
.
name
}
(
${
aTheme
.
quality
}
)</label>
<
label
class
=
"form-check-label"
for
=
"${aTheme.name}"
>
$
{
aTheme
.
name
}
(
${
aTheme
.
quality
}
)</label>
</div>`
</div>`
if
(
this
.
currentThem
e
===
aTheme
.
name
)
el
.
querySelector
(
'input'
).
setAttribute
(
'checked'
,
'checked'
)
if
(
this
.
_deps
.
themeModule
.
activ
e
===
aTheme
.
name
)
el
.
querySelector
(
'input'
).
setAttribute
(
'checked'
,
'checked'
)
return
el
return
el
})}
})}
</div>`
</div>`
...
...
src/app/tabs/theme-module.js
View file @
7b7a7213
import
{
BaseApi
}
from
'remix-plugin'
import
{
BaseApi
}
from
'remix-plugin'
import
{
EventEmitter
}
from
'events'
import
{
EventEmitter
}
from
'events'
const
Storage
=
require
(
'remix-lib'
).
Storage
const
themes
=
[
const
themes
=
[
{
name
:
'Cerulean'
,
quality
:
'light'
,
url
:
'https://bootswatch.com/4/cerulean/bootstrap.min.css'
},
{
name
:
'Cerulean'
,
quality
:
'light'
,
url
:
'https://bootswatch.com/4/cerulean/bootstrap.min.css'
},
...
@@ -25,12 +24,14 @@ const profile = {
...
@@ -25,12 +24,14 @@ const profile = {
export
class
ThemeModule
extends
BaseApi
{
export
class
ThemeModule
extends
BaseApi
{
constructor
()
{
constructor
(
registry
)
{
super
(
profile
)
super
(
profile
)
this
.
events
=
new
EventEmitter
()
this
.
events
=
new
EventEmitter
()
this
.
storage
=
new
Storage
(
'style:'
)
this
.
_deps
=
{
config
:
registry
.
get
(
'config'
).
api
}
this
.
themes
=
themes
.
reduce
((
acc
,
theme
)
=>
({
...
acc
,
[
theme
.
name
]:
theme
}),
{})
this
.
themes
=
themes
.
reduce
((
acc
,
theme
)
=>
({
...
acc
,
[
theme
.
name
]:
theme
}),
{})
this
.
active
=
this
.
storage
.
exists
(
'theme'
)
?
this
.
storage
.
get
(
'theme'
)
:
'Cerulean
'
this
.
active
=
this
.
_deps
.
config
.
get
(
'settings/theme'
)
?
this
.
_deps
.
config
.
get
(
'settings/theme'
)
:
'Flatly
'
}
}
/** Return the active theme */
/** Return the active theme */
...
@@ -53,7 +54,7 @@ export class ThemeModule extends BaseApi {
...
@@ -53,7 +54,7 @@ export class ThemeModule extends BaseApi {
}
}
const
next
=
themeName
||
this
.
active
// Name
const
next
=
themeName
||
this
.
active
// Name
const
nextTheme
=
this
.
themes
[
next
]
// Theme
const
nextTheme
=
this
.
themes
[
next
]
// Theme
this
.
storage
.
set
(
'
theme'
,
next
)
this
.
_deps
.
config
.
set
(
'settings/
theme'
,
next
)
document
.
getElementById
(
'theme-link'
).
setAttribute
(
'href'
,
nextTheme
.
url
)
document
.
getElementById
(
'theme-link'
).
setAttribute
(
'href'
,
nextTheme
.
url
)
document
.
documentElement
.
style
.
setProperty
(
'--theme'
,
nextTheme
.
quality
)
document
.
documentElement
.
style
.
setProperty
(
'--theme'
,
nextTheme
.
quality
)
if
(
themeName
)
this
.
active
=
themeName
if
(
themeName
)
this
.
active
=
themeName
...
...
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