Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rndmc
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jake Read
rndmc
Commits
b5901bfe
Commit
b5901bfe
authored
Nov 14, 2018
by
Paloma GR
Browse files
Options
Downloads
Patches
Plain Diff
popup description
parent
d9325673
No related branches found
No related tags found
1 merge request
!1
pop-up description
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
client/client.js
+584
-534
584 additions, 534 deletions
client/client.js
client/style.css
+8
-0
8 additions, 0 deletions
client/style.css
package-lock.json
+5
-0
5 additions, 0 deletions
package-lock.json
with
597 additions
and
534 deletions
client/client.js
+
584
−
534
View file @
b5901bfe
...
...
@@ -232,6 +232,8 @@ UI -> HEAP ---------------------------------------------------
*/
// push new state from UI to server
function
putState
(
rep
,
key
)
{
var
data
=
{
...
...
@@ -434,6 +436,8 @@ onmousedown = function(evt) {
window
.
addEventListener
(
'
mousemove
'
,
mouseMoveDragListener
)
window
.
addEventListener
(
'
mouseup
'
,
mouseUpDragListener
)
}
// removes any popup descriptions for list items in Module Menu
rmDescription
()
}
function
mouseMoveDragListener
(
evt
)
{
...
...
@@ -478,6 +482,7 @@ oncontextmenu = function(evt) {
return
false
}
onmousemove
=
function
(
evt
)
{
var
cT
=
getCurrentTransform
()
lastPos
.
x
=
cT
.
ox
-
cT
.
tx
+
(
evt
.
pageX
-
cT
.
ox
)
/
cT
.
s
...
...
@@ -546,6 +551,7 @@ function writeModuleOptionMenu(modRep) {
document
.
addEventListener
(
'
click
'
,
rmListener
)
}
// return ul element with name and alt and link?
// TODO: not properly a tree, see note @ reciprocal fn in views.js
function
heapSendsModuleMenu
(
tree
)
{
...
...
@@ -559,12 +565,21 @@ function heapSendsModuleMenu(tree) {
menuDom
.
appendChild
(
title
)
for
(
key
in
tree
)
{
var
ul
=
document
.
createElement
(
'
ul
'
)
ul
.
innerHTML
=
key
.
toString
()
var
header
=
document
.
createElement
(
'
h4
'
)
//ul.innerHTML = key.toString()
// create header for ul
header
.
innerHTML
=
key
.
toString
()
ul
.
append
(
header
)
for
(
subkey
in
tree
[
key
])
{
var
li
=
document
.
createElement
(
'
li
'
)
var
path
=
tree
[
key
][
subkey
].
path
li
.
innerHTML
=
subkey
.
toString
()
li
.
id
=
path
li
.
addEventListener
(
'
mouseover
'
,
function
(
evt
){
rmDescription
()
//
writeModuleDescription
(
evt
)
//
})
//////////////////////////////////////////////////////////
li
.
addEventListener
(
'
click
'
,
function
(
evt
)
{
var
data
=
this
.
id
socketSend
(
'
put module
'
,
data
)
...
...
@@ -617,3 +632,38 @@ function heapSendsProgramMenu(tree) {
document
.
addEventListener
(
'
click
'
,
rmListener
)
}
// Paloma adds
// module descriptions
const
moduleDescriptionsObj
=
{
and
:
'
this is the description for and
'
,
atkbreadboard
:
'
this is the description for atkbreadboard
'
,
atkseriallink
:
'
this is the description for atkseriallink
'
,
atkstepper
:
'
this is the description for akstepper
'
,
webcam
:
'
this is description for webcam
'
,
planner
:
'
this is the description for planner
'
,
rawmove
:
'
this is the description for rawmove
'
,
gcode
:
'
this is the descriprion for gcode
'
}
function
writeModuleDescription
(
evt
)
{
let
liRect
=
evt
.
target
.
getBoundingClientRect
();
let
menuDes
=
document
.
createElement
(
'
div
'
)
menuDes
.
id
=
'
moduleDescription
'
menuDes
.
style
.
left
=
255
+
liRect
.
left
+
'
px
'
menuDes
.
style
.
top
=
liRect
.
top
-
18
+
'
px
'
let
parentEl
=
evt
.
target
.
parentElement
let
headerKey
=
parentEl
.
firstChild
.
innerHTML
menuDes
.
innerHTML
=
moduleDescriptionsObj
[
evt
.
target
.
innerHTML
]
wrapper
.
append
(
menuDes
)
}
function
rmDescription
()
{
let
modDes
=
document
.
getElementById
(
'
moduleDescription
'
)
if
(
modDes
!=
null
)
{
wrapper
.
removeChild
(
modDes
)
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
client/style.css
+
8
−
0
View file @
b5901bfe
...
...
@@ -122,6 +122,14 @@ li:active{
background-color
:
#303030
;
}
#moduleDescription
{
position
:
absolute
;
width
:
245px
;
padding
:
10px
;
background-color
:
#303030
;
color
:
white
;
}
#programMenu
{
position
:
absolute
;
width
:
245px
;
...
...
This diff is collapsed.
Click to expand it.
package-lock.json
+
5
−
0
View file @
b5901bfe
...
...
@@ -784,6 +784,11 @@
"resolved"
:
"https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz"
,
"integrity"
:
"sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
},
"http"
:
{
"version"
:
"0.0.0"
,
"resolved"
:
"https://registry.npmjs.org/http/-/http-0.0.0.tgz"
,
"integrity"
:
"sha1-huYybSnF0Dnen6xYSkVon5KfT3I="
},
"http-errors"
:
{
"version"
:
"1.6.3"
,
"resolved"
:
"https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz"
,
...
...
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