Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Essem
Sharkey
Commits
d2d3f781
Unverified
Commit
d2d3f781
authored
6 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
2b07b3a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/client/app/app.vue
+1
-1
1 addition, 1 deletion
src/client/app/app.vue
src/client/app/common/scripts/theme.ts
+10
-8
10 additions, 8 deletions
src/client/app/common/scripts/theme.ts
src/client/app/init.ts
+7
-1
7 additions, 1 deletion
src/client/app/init.ts
with
18 additions
and
10 deletions
src/client/app/app.vue
+
1
−
1
View file @
d2d3f781
...
...
@@ -6,7 +6,7 @@
import
Vue
from
'
vue
'
;
import
{
url
,
lang
}
from
'
./config
'
;
import
applyTheme
from
'
./common/scripts/theme
'
;
impor
t
darkTheme
from
'
../theme/dark
.json
'
;
cons
t
darkTheme
=
require
(
'
../theme/dark
'
)
;
export
default
Vue
.
extend
({
computed
:
{
...
...
This diff is collapsed.
Click to expand it.
src/client/app/common/scripts/theme.ts
+
10
−
8
View file @
d2d3f781
...
...
@@ -5,6 +5,8 @@ export default function(theme: { [key: string]: string }) {
if
(
k
==
'
meta
'
)
return
;
document
.
documentElement
.
style
.
setProperty
(
`--
${
k
}
`
,
v
.
toString
());
});
localStorage
.
setItem
(
'
theme
'
,
JSON
.
stringify
(
props
));
}
function
compile
(
theme
:
{
[
key
:
string
]:
string
}):
{
[
key
:
string
]:
string
}
{
...
...
@@ -17,24 +19,24 @@ function compile(theme: { [key: string]: string }): { [key: string]: string } {
let
m
;
//#region #RGB
m
=
code
.
match
(
/^#
([
0-9a-f
]{3})
$/i
)
[
1
]
;
m
=
code
.
match
(
/^#
([
0-9a-f
]{3})
$/i
);
if
(
m
)
{
return
[
parseInt
(
m
.
charAt
(
0
),
16
)
*
0x11
,
parseInt
(
m
.
charAt
(
1
),
16
)
*
0x11
,
parseInt
(
m
.
charAt
(
2
),
16
)
*
0x11
,
parseInt
(
m
[
1
]
.
charAt
(
0
),
16
)
*
0x11
,
parseInt
(
m
[
1
]
.
charAt
(
1
),
16
)
*
0x11
,
parseInt
(
m
[
1
]
.
charAt
(
2
),
16
)
*
0x11
,
255
];
}
//#endregion
//#region #RRGGBB
m
=
code
.
match
(
/^#
([
0-9a-f
]{6})
$/i
)
[
1
]
;
m
=
code
.
match
(
/^#
([
0-9a-f
]{6})
$/i
);
if
(
m
)
{
return
[
parseInt
(
m
.
substr
(
0
,
2
),
16
),
parseInt
(
m
.
substr
(
2
,
2
),
16
),
parseInt
(
m
.
substr
(
4
,
2
),
16
),
parseInt
(
m
[
1
]
.
substr
(
0
,
2
),
16
),
parseInt
(
m
[
1
]
.
substr
(
2
,
2
),
16
),
parseInt
(
m
[
1
]
.
substr
(
4
,
2
),
16
),
255
];
}
...
...
This diff is collapsed.
Click to expand it.
src/client/app/init.ts
+
7
−
1
View file @
d2d3f781
...
...
@@ -8,12 +8,18 @@ import VueRouter from 'vue-router';
import
*
as
TreeView
from
'
vue-json-tree-view
'
;
import
VAnimateCss
from
'
v-animate-css
'
;
import
VModal
from
'
vue-js-modal
'
;
import
VueHotkey
from
'
./common/hotkey
'
;
import
VueHotkey
from
'
./common/hotkey
'
;
import
App
from
'
./app.vue
'
;
import
checkForUpdate
from
'
./common/scripts/check-for-update
'
;
import
MiOS
,
{
API
}
from
'
./mios
'
;
import
{
version
,
codename
,
lang
}
from
'
./config
'
;
import
applyTheme
from
'
./common/scripts/theme
'
;
const
defaultTheme
=
require
(
'
../theme/light.json
'
);
if
(
localStorage
.
getItem
(
'
theme
'
)
==
null
)
{
applyTheme
(
defaultTheme
);
}
Vue
.
use
(
Vuex
);
Vue
.
use
(
VueRouter
);
...
...
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