Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Virtual Keyboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Escriptorium
Virtual Keyboard
Commits
b938c676
Commit
b938c676
authored
3 years ago
by
Eva Bardou
Committed by
Valentin Rigal
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Rename store mutations
parent
eb9ba04e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!19
Rename store mutations
Pipeline
#5660
passed with warnings
3 years ago
Stage: test
Stage: build
Stage: deploy
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/KeyboardConfiguration.vue
+3
-3
3 additions, 3 deletions
src/components/KeyboardConfiguration.vue
src/components/KeyboardManager.vue
+6
-6
6 additions, 6 deletions
src/components/KeyboardManager.vue
src/store/index.js
+4
-4
4 additions, 4 deletions
src/store/index.js
with
13 additions
and
13 deletions
src/components/KeyboardConfiguration.vue
+
3
−
3
View file @
b938c676
...
@@ -77,11 +77,11 @@ export default {
...
@@ -77,11 +77,11 @@ export default {
displayUTF8
,
displayUTF8
,
},
},
methods
:
{
methods
:
{
...
mapMutations
([
"
updateKey
"
]),
...
mapMutations
([
"
updateKey
boardKey
"
]),
replace
()
{
replace
()
{
if
(
!
this
.
selectedKey
||
!
this
.
selectedChar
)
return
;
if
(
!
this
.
selectedKey
||
!
this
.
selectedChar
)
return
;
// Update the keyboard
// Update the keyboard
this
.
updateKey
({
this
.
updateKey
boardKey
({
index
:
this
.
keyboardIndex
,
index
:
this
.
keyboardIndex
,
...
this
.
selectedKey
,
...
this
.
selectedKey
,
character
:
displayUTF8
(
this
.
selectedChar
.
code
),
character
:
displayUTF8
(
this
.
selectedChar
.
code
),
...
@@ -91,7 +91,7 @@ export default {
...
@@ -91,7 +91,7 @@ export default {
this
.
picker
=
false
;
this
.
picker
=
false
;
},
},
updateKeyBinding
()
{
updateKeyBinding
()
{
this
.
updateKey
({
this
.
updateKey
boardKey
({
index
:
this
.
keyboardIndex
,
index
:
this
.
keyboardIndex
,
...
this
.
selectedKey
,
...
this
.
selectedKey
,
keyboard_code
:
this
.
keyBinding
?
this
.
keyBinding
.
charCodeAt
()
:
null
,
keyboard_code
:
this
.
keyBinding
?
this
.
keyBinding
.
charCodeAt
()
:
null
,
...
...
This diff is collapsed.
Click to expand it.
src/components/KeyboardManager.vue
+
6
−
6
View file @
b938c676
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
⏴
⏴
</a>
</a>
<input
type=
"text"
v-model=
"keyboardName"
/>
<input
type=
"text"
v-model=
"keyboardName"
/>
<button
type=
"button"
v-on:click=
"
updat
eKeyboardName"
>
Save
</button>
<button
type=
"button"
v-on:click=
"
chang
eKeyboardName"
>
Save
</button>
<KeyboardConfiguration
:keyboard-index=
"editedKeyboard"
/>
<KeyboardConfiguration
:keyboard-index=
"editedKeyboard"
/>
</div>
</div>
<div
v-else-if=
"selectedKeyboard !== null"
>
<div
v-else-if=
"selectedKeyboard !== null"
>
...
@@ -104,18 +104,18 @@ export default {
...
@@ -104,18 +104,18 @@ export default {
...
mapState
([
"
keyboards
"
]),
...
mapState
([
"
keyboards
"
]),
},
},
methods
:
{
methods
:
{
...
mapMutations
([
"
add
"
,
"
delete
"
,
"
updateName
"
]),
...
mapMutations
([
"
add
Keyboard
"
,
"
removeKeyboard
"
,
"
update
Keyboard
Name
"
]),
updat
eKeyboardName
()
{
chang
eKeyboardName
()
{
this
.
updateName
({
this
.
update
Keyboard
Name
({
index
:
this
.
editedKeyboard
,
index
:
this
.
editedKeyboard
,
name
:
this
.
keyboardName
,
name
:
this
.
keyboardName
,
});
});
},
},
createKeyboard
()
{
createKeyboard
()
{
this
.
add
();
this
.
add
Keyboard
();
},
},
deleteKeyboard
()
{
deleteKeyboard
()
{
this
.
delete
(
this
.
keyboardToDelete
);
this
.
removeKeyboard
(
this
.
keyboardToDelete
);
this
.
keyboardToDelete
=
null
;
this
.
keyboardToDelete
=
null
;
this
.
deleteModal
=
false
;
this
.
deleteModal
=
false
;
},
},
...
...
This diff is collapsed.
Click to expand it.
src/store/index.js
+
4
−
4
View file @
b938c676
...
@@ -44,17 +44,17 @@ export default new Vuex.Store({
...
@@ -44,17 +44,17 @@ export default new Vuex.Store({
setSelectedScript
(
state
,
{
name
,
page
})
{
setSelectedScript
(
state
,
{
name
,
page
})
{
state
.
selectedScript
=
{
name
,
page
};
state
.
selectedScript
=
{
name
,
page
};
},
},
add
(
state
)
{
add
Keyboard
(
state
)
{
state
.
keyboards
=
[...
state
.
keyboards
,
{
...
NEW_KEYBOARD
}];
state
.
keyboards
=
[...
state
.
keyboards
,
{
...
NEW_KEYBOARD
}];
},
},
delete
(
state
,
index
)
{
removeKeyboard
(
state
,
index
)
{
state
.
keyboards
.
splice
(
index
,
1
);
state
.
keyboards
.
splice
(
index
,
1
);
},
},
updateName
(
state
,
{
index
,
name
})
{
update
Keyboard
Name
(
state
,
{
index
,
name
})
{
if
(
!
state
.
keyboards
[
index
])
return
;
if
(
!
state
.
keyboards
[
index
])
return
;
state
.
keyboards
[
index
].
name
=
name
;
state
.
keyboards
[
index
].
name
=
name
;
},
},
updateKey
(
state
,
{
index
,
...
newKey
})
{
updateKey
boardKey
(
state
,
{
index
,
...
newKey
})
{
// Copy the keyboard if the index is correct to avoid modifying it directly in the state
// Copy the keyboard if the index is correct to avoid modifying it directly in the state
const
keyboard
=
state
.
keyboards
[
index
]
&&
{
...
state
.
keyboards
[
index
]
};
const
keyboard
=
state
.
keyboards
[
index
]
&&
{
...
state
.
keyboards
[
index
]
};
if
(
!
keyboard
)
return
;
if
(
!
keyboard
)
return
;
...
...
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