Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Main
Synchronet
Commits
d8dd9b5e
Commit
d8dd9b5e
authored
4 years ago
by
Kayz
Browse files
Options
Downloads
Patches
Plain Diff
fix issues with favorites menu/add favorites when user has no favorites
parent
6cbf4034
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/xtrnmenu.js
+6
-2
6 additions, 2 deletions
exec/xtrnmenu.js
with
6 additions
and
2 deletions
exec/xtrnmenu.js
+
6
−
2
View file @
d8dd9b5e
...
@@ -1830,7 +1830,7 @@ function favorites_menu(title, itemcount) {
...
@@ -1830,7 +1830,7 @@ function favorites_menu(title, itemcount) {
bbs
.
menu
(
"
xtrn_head
"
,
P_NOERROR
);
bbs
.
menu
(
"
xtrn_head
"
,
P_NOERROR
);
}
}
menuitemsfiltered
=
typeof
menuobj
.
items
!==
"
undefined
"
?
menuobj
.
items
:
{}
;
menuitemsfiltered
=
typeof
menuobj
.
items
!==
"
undefined
"
?
menuobj
.
items
:
[]
;
// The quit item is intended to aid in the lightbar navigation
// The quit item is intended to aid in the lightbar navigation
menuitemsfiltered
.
unshift
({
menuitemsfiltered
.
unshift
({
...
@@ -2022,8 +2022,10 @@ function favorites_menu(title, itemcount) {
...
@@ -2022,8 +2022,10 @@ function favorites_menu(title, itemcount) {
return
;
return
;
}
else
if
(
menuitemsfiltered
[
selected_index
].
type
==
"
add
"
)
{
}
else
if
(
menuitemsfiltered
[
selected_index
].
type
==
"
add
"
)
{
add_favorite
();
add_favorite
();
continue
;
}
else
if
(
menuitemsfiltered
[
selected_index
].
type
==
"
remove
"
)
{
}
else
if
(
menuitemsfiltered
[
selected_index
].
type
==
"
remove
"
)
{
remove_favorite
();
remove_favorite
();
continue
;
}
}
}
else
if
((
keyin
==
'
q
'
)
||
(
keyin
==
"
\
x1B
"
))
{
}
else
if
((
keyin
==
'
q
'
)
||
(
keyin
==
"
\
x1B
"
))
{
console
.
clear
();
console
.
clear
();
...
@@ -2240,6 +2242,7 @@ function add_favorite()
...
@@ -2240,6 +2242,7 @@ function add_favorite()
key
=
console
.
getkey
(
K_NOSPIN
);
key
=
console
.
getkey
(
K_NOSPIN
);
if
(
key
==
"
\
x0d
"
)
{
if
(
key
==
"
\
x0d
"
)
{
// hit enter, item is selected
// hit enter, item is selected
xtrn
=
tree
.
currentItem
;
break
;
break
;
}
else
if
((
key
.
toLowerCase
()
==
'
q
'
)
||
(
key
==
"
\
x1B
"
))
{
}
else
if
((
key
.
toLowerCase
()
==
'
q
'
)
||
(
key
==
"
\
x1B
"
))
{
return
;
return
;
...
@@ -2248,6 +2251,7 @@ function add_favorite()
...
@@ -2248,6 +2251,7 @@ function add_favorite()
break
;
break
;
}
else
{
}
else
{
selection
=
tree
.
getcmd
({
key
:
key
,
mouse
:
false
});
selection
=
tree
.
getcmd
({
key
:
key
,
mouse
:
false
});
xtrn
=
tree
.
currentItem
;
if
(
key
==
KEY_UP
||
key
==
KEY_DOWN
||
key
==
KEY_HOME
||
key
==
KEY_END
)
{
if
(
key
==
KEY_UP
||
key
==
KEY_DOWN
||
key
==
KEY_HOME
||
key
==
KEY_END
)
{
if
((
key
==
KEY_UP
)
&&
(
tree
.
line
==
1
))
{
if
((
key
==
KEY_UP
)
&&
(
tree
.
line
==
1
))
{
...
@@ -2267,7 +2271,7 @@ function add_favorite()
...
@@ -2267,7 +2271,7 @@ function add_favorite()
s
.
cycle
();
s
.
cycle
();
}
}
if
(
typeof
xtrn
.
code
!==
"
undefined
"
)
{
if
((
typeof
xtrn
!==
"
undefined
"
)
&&
(
typeof
xtrn
.
code
!==
"
undefined
"
)
)
{
jsonData
.
push
(
xtrn
.
code
);
jsonData
.
push
(
xtrn
.
code
);
jsonClient
.
write
(
"
xtrnmenu
"
,
"
favorites_
"
+
user
.
alias
,
jsonData
,
2
);
jsonClient
.
write
(
"
xtrnmenu
"
,
"
favorites_
"
+
user
.
alias
,
jsonData
,
2
);
}
}
...
...
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