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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jake Read
rndmc
Commits
1d01f0c1
Commit
1d01f0c1
authored
6 years ago
by
Jake Read
Browse files
Options
Downloads
Patches
Plain Diff
comments
parent
096c9730
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/ui/uiButton.js
+14
-2
14 additions, 2 deletions
client/ui/uiButton.js
with
14 additions
and
2 deletions
client/ui/uiButton.js
+
14
−
2
View file @
1d01f0c1
(
function
(){
// client-side button object
/* KRITICAL STEP */
// this is our object, that we will later append
// to the .lump position
var
btn
=
{}
//
make the dom object
//
our dom element
var
li
=
document
.
createElement
(
'
li
'
)
li
.
innerHTML
=
'
button test
'
li
.
addEventListener
(
'
click
'
,
function
(
evt
){
...
...
@@ -15,9 +17,17 @@
socketSend
(
'
put ui change
'
,
data
)
})
/* KRITICAL STEP */
// we have to give our 'lump' object a .domElem, this
// will be referenced upstream to append to the right module
// append it to the dom so that it can be appended on init
btn
.
domElem
=
li
/* KRITICAL STEP */
// whatever is posted to .lump will receive messages through
// .onMessage, so if we don't write one, we'll cause errors
// upstream, and besides, wouldn't be able to get anything from
// the server
btn
.
onMessage
=
function
(
msg
){
console
.
log
(
'
got message in client side ui object
'
,
msg
)
if
(
msg
.
call
==
'
setText
'
){
...
...
@@ -25,8 +35,10 @@
}
}
/* KRITICAL STEP */
// expect this to only be used once
// it's basically our init function
// and gets called once the module is loaded
window
.
registerNewModule
=
function
(
id
,
key
){
btn
.
parentId
=
id
btn
.
key
=
key
...
...
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