Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jake Read
rndmc
Commits
e9252031
Commit
e9252031
authored
Nov 25, 2018
by
Jake Read
Browse files
slowly figuring out how to module-ify bower
parent
15d7b772
Changes
3
Hide whitespace changes
Inline
Side-by-side
client/client.js
View file @
e9252031
...
...
@@ -516,7 +516,7 @@ document.onkeydown = function(evt) {
function
writeModuleOptionMenu
(
modRep
)
{
var
menuDom
=
document
.
createElement
(
'
div
'
)
menuDom
.
id
=
'
perModuleMenu
'
menuDom
.
style
.
left
=
10
+
mod
r
ep
.
dom
.
domElem
.
offsetLeft
+
mod
r
ep
.
dom
.
domElem
.
offsetWidth
+
'
px
'
menuDom
.
style
.
left
=
10
+
mod
R
ep
.
dom
.
domElem
.
offsetLeft
+
mod
R
ep
.
dom
.
domElem
.
offsetWidth
+
'
px
'
menuDom
.
style
.
top
=
modRep
.
dom
.
domElem
.
offsetTop
+
'
px
'
// future: rm all inputs, rm all outputs, rename, open (heirarchy)
var
opts
=
[
'
delete
'
,
'
copy
'
]
...
...
client/divtools.js
View file @
e9252031
...
...
@@ -256,42 +256,29 @@ function writeUiElement(container, rep, key) {
// pull the representation object from what we were sent
var
ui
=
rep
.
ui
[
key
]
console
.
log
(
'
write ui
'
,
ui
)
console
.
log
(
'
at rep
'
,
rep
)
//import script from ui.clientPath
// load this thing,
ui
.
script
=
document
.
createElement
(
'
script
'
)
container
.
appendChild
(
ui
.
script
)
// it loads and executes when this is set
ui
.
script
.
src
=
ui
.
clientPath
// events
ui
.
script
.
onerror
=
function
(
err
){
console
.
log
(
'
ERR from ui script
'
,
err
)
}
ui
.
script
.
onload
=
function
(
msg
){
console
.
log
(
'
script loaded ?
'
)
}
container
.
appendChild
(
ui
.
script
)
ui
.
script
.
src
=
ui
.
clientPath
// make an xhttp request for the code
/*
var request = new XMLHttpRequest()
request.open('GET', ui.clientPath)
request.responseType = 'text/javascript'
request.onLoad = function() {
console.log(request.response)
ui
.
script
.
onload
=
function
(
msg
){
console
.
log
(
'
script loaded
'
)
// how many of these functions exist ?
registerNewModule
(
rep
.
description
.
id
,
key
)
}
request.send()
fetch(ui.clientPath).then(function(response) {
response.text().then(function(text) {
console.log(text)
console.log(ui)
ui.script.appendChild(document.createTextNode(text))
container.apppendChild(ui.script)
})
})
*/
// now we'll hook it up to the socket ?
/*
// give it access to the socket,
...
...
client/ui/uiButton.js
View file @
e9252031
console
.
log
(
'
hello lib load
'
)
\ No newline at end of file
(
function
(){
socketSend
(
'
console
'
,
'
loading new iife
'
)
this
.
init
=
function
(){
socketSend
(
'
console
'
,
'
hello from
'
+
this
.
parentId
+
this
.
key
)
}
// expect this to only be used once
window
.
registerNewModule
=
function
(
id
,
key
){
this
.
parentId
=
id
this
.
key
=
key
this
.
init
()
}
})()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment