Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nodenogg-duplicate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Adam Procter
nodenogg-duplicate
Commits
570cbca8
Commit
570cbca8
authored
4 years ago
by
Adam Procter
Browse files
Options
Downloads
Patches
Plain Diff
updated
added readmode to state, added icon for iOS home screen.
parent
bce6dbaa
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/src/components/NodesLayer.vue
+69
-47
69 additions, 47 deletions
app/src/components/NodesLayer.vue
app/src/store/index.js
+24
-18
24 additions, 18 deletions
app/src/store/index.js
app/src/views/Sandbox.vue
+1
-1
1 addition, 1 deletion
app/src/views/Sandbox.vue
with
94 additions
and
66 deletions
app/src/components/NodesLayer.vue
+
69
−
47
View file @
570cbca8
<
template
>
<
template
>
<div
ref=
"nodes"
class=
"node"
>
<div
ref=
"nodes"
class=
"node"
>
<div
v-for=
"(value, index) in configPositions"
v-bind:key=
"index"
>
<div
v-for=
"(
pos
value, index) in configPositions"
v-bind:key=
"index"
>
<div
v-if=
"toolmode == 'move'"
>
<div
v-if=
"toolmode == 'move'"
>
<!-- make draggable false as we are panning around -->
<vue-draggable-resizable
<vue-draggable-resizable
class=
"innernode"
class=
"innernode"
v-if=
"nodeid == value.node_id"
v-if=
"nodeid ==
pos
value.node_id"
:w=
"value.width"
:w=
"
pos
value.width"
:h=
"value.height"
:h=
"
pos
value.height"
:x=
"value.x_pos"
:x=
"
pos
value.x_pos"
:y=
"value.y_pos"
:y=
"
pos
value.y_pos"
:z=
"value.z_index"
:z=
"
pos
value.z_index"
:draggable=
"false"
:draggable=
"false"
style=
"background-color: rgb(205, 234, 255);"
style=
"background-color: rgb(205, 234, 255);"
>
>
<form>
<form>
<!--
<div
v-if=
"readmode == false"
>
-->
<div
v-if=
"posvalue.read_mode == false"
>
<div
v-for=
"value in myNodes"
v-bind:key=
"value.node_id"
>
<div
v-for=
"value in myNodes"
v-bind:key=
"value.node_id"
>
<div
v-if=
"value.readmode == false"
>
<textarea
<textarea
v-if=
"nodeid == value.node_id"
v-if=
"nodeid == value.node_id"
@
focus=
"editTrue(true)"
@
focus=
"editTrue(true)"
...
@@ -31,11 +29,11 @@
...
@@ -31,11 +29,11 @@
placeholder=
"Idea goes here!"
placeholder=
"Idea goes here!"
></textarea>
></textarea>
</div>
</div>
<!-- FIXME: What is this doing below now ? Looks old -->
<div
v-else
>
<p
:id=
"nodeid"
:inner-html.prop=
"nodetext | marked"
></p>
</div>
</div>
</div>
<div
v-if=
"posvalue.read_mode == true"
>
<p
:id=
"nodeid"
:inner-html.prop=
"nodetext | marked"
></p>
</div>
<h3>
Reactions
</h3>
<h3>
Reactions
</h3>
<div
v-for=
"(emojis, index) in configEmoji"
:key=
"index"
>
<div
v-for=
"(emojis, index) in configEmoji"
:key=
"index"
>
...
@@ -49,26 +47,38 @@
...
@@ -49,26 +47,38 @@
<BaseButton
buttonClass=
"danger"
@
click=
"deleteFlag()"
<BaseButton
buttonClass=
"danger"
@
click=
"deleteFlag()"
>
Delete
</BaseButton
>
Delete
</BaseButton
>
>
<BaseButton
<div
v-if=
"posvalue.read_mode == true"
>
class=
"read"
<BaseButton
buttonClass=
"action"
class=
"read"
@
click=
"readFlag()"
buttonClass=
"action"
>
{{
mode
}}
</BaseButton
@
click=
"readFlag()"
>
>
Edit
</BaseButton>
</div>
<div
v-else
>
<BaseButton
class=
"read"
buttonClass=
"action"
@
click=
"readFlag()"
>
Read
</BaseButton
>
</div>
</div>
</div>
</form>
</form>
</vue-draggable-resizable>
</vue-draggable-resizable>
</div>
</div>
<!-- Same code as above when in any other mode other than move so you can drag nodes-->
<div
v-else
>
<div
v-else
>
<vue-draggable-resizable
<vue-draggable-resizable
class=
"innernode"
class=
"innernode"
v-if=
"nodeid == value.node_id"
v-if=
"nodeid ==
pos
value.node_id"
:w=
"value.width"
:w=
"
pos
value.width"
:h=
"value.height"
:h=
"
pos
value.height"
:x=
"value.x_pos"
:x=
"
pos
value.x_pos"
:y=
"value.y_pos"
:y=
"
pos
value.y_pos"
:z=
"value.z_index"
:z=
"
pos
value.z_index"
@
activated=
"onActivated"
@
activated=
"onActivated"
@
dragging=
"onDrag"
@
dragging=
"onDrag"
@
resizing=
"onResize"
@
resizing=
"onResize"
...
@@ -78,8 +88,8 @@
...
@@ -78,8 +88,8 @@
style=
"background-color: rgb(205, 234, 255);"
style=
"background-color: rgb(205, 234, 255);"
>
>
<form>
<form>
<div
v-
for=
"value in myNodes"
v-bind:key=
"value.node_id
"
>
<div
v-
if=
"posvalue.read_mode == false
"
>
<div
v-
i
f=
"value
.readmode == false
"
>
<div
v-f
or
=
"value
in myNodes"
v-bind:key=
"value.node_id
"
>
<textarea
<textarea
v-if=
"nodeid == value.node_id"
v-if=
"nodeid == value.node_id"
@
focus=
"editTrue(true)"
@
focus=
"editTrue(true)"
...
@@ -93,15 +103,11 @@
...
@@ -93,15 +103,11 @@
placeholder=
"Idea goes here!"
placeholder=
"Idea goes here!"
></textarea>
></textarea>
</div>
</div>
<!--
</div>
-->
<!-- FIXME: What is this doing below now ? Looks old -->
<div
v-else
>
<p
:id=
"nodeid"
:inner-html.prop=
"nodetext | marked"
>
<!--
{{
nodeid
}}
-->
</p>
</div>
</div>
</div>
<div
v-if=
"posvalue.read_mode == true"
>
<p
:id=
"nodeid"
:inner-html.prop=
"nodetext | marked"
></p>
</div>
<h3>
Reactions
</h3>
<h3>
Reactions
</h3>
<div
v-for=
"(emojis, index) in configEmoji"
:key=
"index"
>
<div
v-for=
"(emojis, index) in configEmoji"
:key=
"index"
>
...
@@ -115,12 +121,22 @@
...
@@ -115,12 +121,22 @@
<BaseButton
buttonClass=
"danger"
@
click=
"deleteFlag()"
<BaseButton
buttonClass=
"danger"
@
click=
"deleteFlag()"
>
Delete
</BaseButton
>
Delete
</BaseButton
>
>
<BaseButton
<div
v-if=
"posvalue.read_mode == true"
>
class=
"read"
<BaseButton
buttonClass=
"action"
class=
"read"
@
click=
"readFlag()"
buttonClass=
"action"
>
{{
mode
}}
</BaseButton
@
click=
"readFlag()"
>
>
Edit
</BaseButton>
</div>
<div
v-else
>
<BaseButton
class=
"read"
buttonClass=
"action"
@
click=
"readFlag()"
>
Read
</BaseButton
>
</div>
</div>
</div>
</form>
</form>
</vue-draggable-resizable>
</vue-draggable-resizable>
...
@@ -143,14 +159,13 @@ export default {
...
@@ -143,14 +159,13 @@ export default {
nodewidth
:
Number
,
nodewidth
:
Number
,
nodeheight
:
Number
,
nodeheight
:
Number
,
deleted
:
Boolean
,
deleted
:
Boolean
,
readmode
:
Boolean
,
},
},
data
()
{
data
()
{
return
{
return
{
pickupz
:
99
,
pickupz
:
99
,
//
localreadmode:
this.readmod
e,
localreadmode
:
fals
e
,
mode
:
'
Read
'
,
mode
:
''
,
}
}
},
},
...
@@ -261,7 +276,14 @@ export default {
...
@@ -261,7 +276,14 @@ export default {
readFlag
(
e
)
{
readFlag
(
e
)
{
e
=
this
.
nodeid
e
=
this
.
nodeid
if
(
readmode
==
true
)
{
var
i
for
(
i
=
0
;
i
<
Object
.
keys
(
this
.
configPositions
).
length
;
i
++
)
{
if
(
this
.
configPositions
[
i
].
node_id
==
this
.
nodeid
)
{
this
.
localreadmode
=
this
.
configPositions
[
i
].
read_mode
}
}
if
(
this
.
localreadmode
==
true
)
{
readmode
=
false
readmode
=
false
this
.
$store
.
dispatch
(
'
readFlag
'
,
{
e
,
readmode
})
this
.
$store
.
dispatch
(
'
readFlag
'
,
{
e
,
readmode
})
this
.
mode
=
'
Read
'
this
.
mode
=
'
Read
'
...
...
This diff is collapsed.
Click to expand it.
app/src/store/index.js
+
24
−
18
View file @
570cbca8
...
@@ -185,7 +185,6 @@ const store = new Vuex.Store({
...
@@ -185,7 +185,6 @@ const store = new Vuex.Store({
content_type
:
'
sheet
'
,
content_type
:
'
sheet
'
,
// NOTE: first node is hidden due to no position
// NOTE: first node is hidden due to no position
deleted
:
true
,
deleted
:
true
,
readmode
:
false
,
attachment_name
:
''
,
attachment_name
:
''
,
},
},
],
],
...
@@ -325,7 +324,6 @@ const store = new Vuex.Store({
...
@@ -325,7 +324,6 @@ const store = new Vuex.Store({
node_owner
:
state
.
myclient
,
node_owner
:
state
.
myclient
,
content_type
:
'
sheet
'
,
content_type
:
'
sheet
'
,
deleted
:
false
,
deleted
:
false
,
readmode
:
false
,
attachment_name
:
e
,
attachment_name
:
e
,
})
})
}
}
...
@@ -363,6 +361,7 @@ const store = new Vuex.Store({
...
@@ -363,6 +361,7 @@ const store = new Vuex.Store({
width
:
200
,
width
:
200
,
height
:
275
,
height
:
275
,
z_index
:
1
,
z_index
:
1
,
read_mode
:
false
,
})
})
return
pouchdb
return
pouchdb
.
put
({
.
put
({
...
@@ -443,27 +442,29 @@ const store = new Vuex.Store({
...
@@ -443,27 +442,29 @@ const store = new Vuex.Store({
READ_FLAG
(
state
,
e
)
{
READ_FLAG
(
state
,
e
)
{
var
i
var
i
for
(
i
=
0
;
i
<
Object
.
keys
(
state
.
myNodes
).
length
;
i
++
)
{
console
.
log
(
e
.
e
)
if
(
e
.
e
==
state
.
myNodes
[
i
].
node_id
)
{
for
(
i
=
0
;
i
<
Object
.
keys
(
state
.
configPositions
).
length
;
i
++
)
{
state
.
myNodes
[
i
].
readmode
=
e
.
readmode
if
(
e
.
e
==
state
.
configPositions
[
i
].
node_id
)
{
state
.
configPositions
[
i
].
read_mode
=
e
.
readmode
}
}
}
}
pouchdb
pouchdb
.
get
(
state
.
myclient
)
.
get
(
state
.
global_pos_name
)
.
then
(
function
(
doc
)
{
.
then
(
function
(
doc
)
{
// console.log(doc)
// put the store into pouchdb
// put the store into pouchdb
return
pouchdb
.
bulkDocs
([
return
pouchdb
.
bulkDocs
([
{
{
_id
:
state
.
myclient
,
_id
:
state
.
global_pos_name
,
_rev
:
doc
.
_rev
,
_rev
:
doc
.
_rev
,
_attachments
:
doc
.
_attachments
,
positions
:
state
.
configPositions
,
nodes
:
state
.
myNodes
,
},
},
])
])
})
})
.
then
(
function
()
{
.
then
(
function
()
{
return
pouchdb
.
get
(
state
.
myclient
).
then
(
function
(
doc
)
{
return
pouchdb
.
get
(
state
.
global_pos_name
).
then
(
function
(
doc
)
{
state
.
myNodes
=
doc
.
node
s
state
.
configPositions
=
doc
.
position
s
})
})
})
})
.
catch
(
function
(
err
)
{
.
catch
(
function
(
err
)
{
...
@@ -472,6 +473,7 @@ const store = new Vuex.Store({
...
@@ -472,6 +473,7 @@ const store = new Vuex.Store({
}
}
})
})
},
},
GET_EMOJI
(
state
)
{
GET_EMOJI
(
state
)
{
console
.
log
console
.
log
pouchdb
pouchdb
...
@@ -528,7 +530,12 @@ const store = new Vuex.Store({
...
@@ -528,7 +530,12 @@ const store = new Vuex.Store({
store
.
commit
(
'
GET_EMOJI
'
)
store
.
commit
(
'
GET_EMOJI
'
)
// turn on two-way, continuous, retriable sync
// turn on two-way, continuous, retriable sync
pouchdb
pouchdb
.
sync
(
remote
,
{
live
:
true
,
retry
:
true
,
attachments
:
true
})
.
sync
(
remote
,
{
live
:
true
,
since
:
'
now
'
,
retry
:
true
,
attachments
:
true
,
})
.
on
(
'
change
'
,
function
()
{
.
on
(
'
change
'
,
function
()
{
// pop info into function to find out more
// pop info into function to find out more
store
.
commit
(
'
GET_ALL_NODES
'
)
store
.
commit
(
'
GET_ALL_NODES
'
)
...
@@ -550,7 +557,6 @@ const store = new Vuex.Store({
...
@@ -550,7 +557,6 @@ const store = new Vuex.Store({
})
})
.
on
(
'
complete
'
,
function
()
{
.
on
(
'
complete
'
,
function
()
{
// handle complete
// handle complete
//console.log('complete')
})
})
.
on
(
'
error
'
,
function
(
err
)
{
.
on
(
'
error
'
,
function
(
err
)
{
console
.
log
(
err
)
console
.
log
(
err
)
...
@@ -567,7 +573,10 @@ const store = new Vuex.Store({
...
@@ -567,7 +573,10 @@ const store = new Vuex.Store({
movePos
:
({
commit
},
nodeid
,
xpos
,
ypos
,
width
,
height
,
zindex
)
=>
{
movePos
:
({
commit
},
nodeid
,
xpos
,
ypos
,
width
,
height
,
zindex
)
=>
{
commit
(
'
MOVE_POS
'
,
nodeid
,
xpos
,
ypos
,
width
,
height
,
zindex
)
commit
(
'
MOVE_POS
'
,
nodeid
,
xpos
,
ypos
,
width
,
height
,
zindex
)
},
},
readFlag
:
({
commit
},
e
)
=>
{
// var text = e.target.value
commit
(
'
READ_FLAG
'
,
e
)
},
addNode
:
({
commit
},
e
)
=>
{
addNode
:
({
commit
},
e
)
=>
{
commit
(
'
ADD_NODE
'
,
e
)
commit
(
'
ADD_NODE
'
,
e
)
},
},
...
@@ -597,10 +606,7 @@ const store = new Vuex.Store({
...
@@ -597,10 +606,7 @@ const store = new Vuex.Store({
// var text = e.target.value
// var text = e.target.value
commit
(
'
DELETE_FLAG
'
,
e
)
commit
(
'
DELETE_FLAG
'
,
e
)
},
},
readFlag
:
({
commit
},
e
)
=>
{
// var text = e.target.value
commit
(
'
READ_FLAG
'
,
e
)
},
addEmoji
:
({
commit
},
{
nodeid
,
emojitext
})
=>
{
addEmoji
:
({
commit
},
{
nodeid
,
emojitext
})
=>
{
commit
(
'
ADD_EMOJI
'
,
{
commit
(
'
ADD_EMOJI
'
,
{
nodeid
,
nodeid
,
...
...
This diff is collapsed.
Click to expand it.
app/src/views/Sandbox.vue
+
1
−
1
View file @
570cbca8
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
v-bind:key=
"value.node_id"
v-bind:key=
"value.node_id"
v-bind:nodeid=
"value.node_id"
v-bind:nodeid=
"value.node_id"
v-bind:nodetext=
"value.node_text"
v-bind:nodetext=
"value.node_text"
v-bind:readmode=
"value.readmode"
/>
/>
</PanZoomContainer>
</PanZoomContainer>
<!--
<SelectionLayer
<!--
<SelectionLayer
...
...
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