Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Motion Bank
MB.js
Quasar Components MoSys
Commits
d84d698d
Commit
d84d698d
authored
Apr 10, 2019
by
Anton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace all model property occurrences of uuid with _uuid
parent
95691431
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
49 deletions
+47
-49
partials/CellEditor.vue
partials/CellEditor.vue
+5
-6
partials/GridDisplay.vue
partials/GridDisplay.vue
+6
-6
partials/GridEditor.vue
partials/GridEditor.vue
+29
-29
partials/GridEditorSourcePieceMaker.vue
partials/GridEditorSourcePieceMaker.vue
+4
-4
partials/cells/CellAnnotationList.vue
partials/cells/CellAnnotationList.vue
+2
-3
partials/cells/CellVideo.vue
partials/cells/CellVideo.vue
+1
-1
No files found.
partials/CellEditor.vue
View file @
d84d698d
...
...
@@ -7,7 +7,7 @@
q-item-separator
template(v-for="(cell, index) in cells", :key="cell.uuid")
template(v-for="(cell, index) in cells", :key="cell.
_
uuid")
template(v-if="index > 0")
q-item-separator
...
...
@@ -257,13 +257,12 @@
}
},
async
updateCellContent
(
value
,
cell
,
path
)
{
const
destUuid
=
cell
.
uuid
const
destUuid
=
cell
.
_
uuid
if
(
destUuid
)
{
const
annotations
=
await
this
.
$store
.
dispatch
(
'
annotations/find
'
,
{
'
uuid
'
:
destUuid
})
const
a
=
annotations
.
items
.
shift
()
const
annotation
=
await
this
.
$store
.
dispatch
(
'
annotations/get
'
,
destUuid
)
cell
[
path
]
=
value
a
.
body
.
value
=
JSON
.
stringify
(
cell
)
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
destUuid
,
{
body
:
a
.
body
,
target
:
a
.
target
}])
a
nnotation
.
body
.
value
=
JSON
.
stringify
(
cell
)
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
destUuid
,
{
body
:
a
nnotation
.
body
,
target
:
a
nnotation
.
target
}])
}
}
}
...
...
partials/GridDisplay.vue
View file @
d84d698d
...
...
@@ -10,7 +10,7 @@
cell(:cell="cell", display="display")
q-page-sticky(position="top-right", :offset="[18, 18]", v-if="$store.state.auth.user")
q-btn(round, color="primary", small, @click="$router.push(`/mosys/grids/${$route.params.id}/annotate`)")
q-btn(round, color="primary", small, @click="$router.push(`/mosys/grids/${$route.params.
uu
id}/annotate`)")
q-icon(name="edit")
style-tag(v-if="styles || stylesheetUrl", :styles="styles", :url="stylesheetUrl")
...
...
@@ -60,7 +60,7 @@
}
},
async
mounted
()
{
await
this
.
loadGrid
(
this
.
$route
.
params
.
id
)
await
this
.
loadGrid
(
this
.
$route
.
params
.
uu
id
)
},
methods
:
{
onScroll
()
{
...
...
@@ -111,7 +111,7 @@
this
.
cells
=
this
.
annotations
.
map
(
annotation
=>
{
try
{
const
cell
=
JSON
.
parse
(
annotation
.
body
.
value
)
cell
.
uuid
=
annotation
.
uuid
cell
.
_
uuid
=
annotation
.
_
uuid
cell
.
id
=
annotation
.
id
cell
.
styleClass
=
annotation
.
target
?
annotation
.
target
.
styleClass
:
undefined
return
cell
...
...
@@ -136,7 +136,7 @@
catch
(
e
)
{
console
.
debug
(
'
Failed to parse grid metadata annotation body
'
,
e
)
}
if
(
metadata
)
this
.
gridMetadata
=
Object
.
assign
(
metadata
,
{
uuid
:
annotation
.
uuid
})
if
(
metadata
)
this
.
gridMetadata
=
Object
.
assign
(
metadata
,
{
_
uuid
:
annotation
.
_
uuid
})
}
else
{
this
.
gridMetadata
=
{
...
...
@@ -152,7 +152,7 @@
{
dispatch
}
=
this
.
$store
,
annotation
=
this
.
getGridCellAnnotation
(
cell
)
if
(
cell
.
uuid
)
await
dispatch
(
'
annotations/patch
'
,
[
cell
.
uuid
,
annotation
])
if
(
cell
.
_
uuid
)
await
dispatch
(
'
annotations/patch
'
,
[
cell
.
_
uuid
,
annotation
])
else
await
dispatch
(
'
annotations/post
'
,
annotation
)
},
async
updateGridMetadataStore
()
{
...
...
@@ -160,7 +160,7 @@
{
dispatch
}
=
this
.
$store
,
mapAnnotation
=
this
.
getGridMetadataAnnotation
(
this
.
grid
.
id
,
this
.
gridMetadata
)
if
(
this
.
gridMetadata
.
uuid
)
await
dispatch
(
'
annotations/patch
'
,
[
this
.
gridMetadata
.
uuid
,
mapAnnotation
])
if
(
this
.
gridMetadata
.
_
uuid
)
await
dispatch
(
'
annotations/patch
'
,
[
this
.
gridMetadata
.
_
uuid
,
mapAnnotation
])
else
await
dispatch
(
'
annotations/post
'
,
mapAnnotation
)
this
.
updateGridDimensions
()
...
...
partials/GridEditor.vue
View file @
d84d698d
...
...
@@ -23,7 +23,7 @@
template(v-for="(cell, index) in cells")
.cell-item(
v-if="cellUIStates[cell.uuid] && !cellUIStates[cell.uuid].beingDragged",
v-if="cellUIStates[cell.
_
uuid] && !cellUIStates[cell.
_
uuid].beingDragged",
draggable="true",
@dragstart="event => {handleCellDragStart(event, cell)}",
@dragend="event => {handleCellDragEnd(event, cell)}",
...
...
@@ -31,7 +31,7 @@
:style="getCellStyle(cell)",
:title="cell.title",
@click.prevent="event => {handleCellClick(event, cell)}",
:class="{selected: cellUIStates[cell.uuid] ? cellUIStates[cell.uuid].selected : false}",
:class="{selected: cellUIStates[cell.
_
uuid] ? cellUIStates[cell.
_
uuid].selected : false}",
:key="`cell-${index}`")
cell(:cell="cell", preview)
div.cell-item-resize-handle(
...
...
@@ -66,7 +66,7 @@
div.fixed-top-right(style="right:18px; top:68px", v-if="!$store.state.mosys.showSources")
q-btn(round, color="primary", small, @click="handleGridButtonClickEdit", style="margin-right: 0.5em")
q-icon(name="add")
q-btn(round, color="primary", small, @click="$router.push(`/mosys/grids/${$route.params.id}`)")
q-btn(round, color="primary", small, @click="$router.push(`/mosys/grids/${$route.params.
uu
id}`)")
q-icon(name="remove red eye")
</
template
>
...
...
@@ -191,7 +191,7 @@
},
handleCellResizerDragStart
(
event
,
cell
)
{
event
.
dataTransfer
.
setDragImage
(
nullImage
,
0
,
0
)
this
.
cellUIStates
[
cell
.
uuid
].
beingResized
=
true
this
.
cellUIStates
[
cell
.
_
uuid
].
beingResized
=
true
let
tmpCell
=
this
.
getTmpCell
(
cell
)
this
.
tmpCells
.
push
(
tmpCell
)
},
...
...
@@ -199,16 +199,16 @@
let
position
=
this
.
getGridPositionForEvent
(
event
)
cell
.
width
=
Math
.
max
(
1
,
1
+
position
.
x
-
cell
.
x
)
cell
.
height
=
Math
.
max
(
1
,
1
+
position
.
y
-
cell
.
y
)
this
.
cellUIStates
[
cell
.
uuid
].
beingResized
=
false
this
.
cellUIStates
[
cell
.
_
uuid
].
beingResized
=
false
this
.
tmpCells
=
[]
this
.
updateCellStore
(
cell
)
},
handleCellClick
(
event
,
cell
)
{
this
.
cellUIStates
[
cell
.
uuid
].
selected
=
!
this
.
cellUIStates
[
cell
.
uuid
].
selected
this
.
cellUIStates
[
cell
.
_
uuid
].
selected
=
!
this
.
cellUIStates
[
cell
.
_
uuid
].
selected
this
.
updateSelectedCells
()
},
handleCellDragStart
(
event
,
cell
)
{
if
(
this
.
cellUIStates
[
cell
.
uuid
].
beingResized
)
{
if
(
this
.
cellUIStates
[
cell
.
_
uuid
].
beingResized
)
{
}
else
{
event
.
dataTransfer
.
setData
(
'
text/plain
'
,
JSON
.
stringify
(
cell
))
...
...
@@ -219,14 +219,14 @@
x
:
(
event
.
clientX
-
elContainerBoundingBox
.
x
)
-
(
elBoundingBox
.
x
-
elContainerBoundingBox
.
x
),
y
:
(
event
.
clientY
-
elContainerBoundingBox
.
y
)
-
(
elBoundingBox
.
y
-
elContainerBoundingBox
.
y
)
}
this
.
cellUIStates
[
cell
.
uuid
].
draggingOffset
=
offset
this
.
cellUIStates
[
cell
.
uuid
].
beginDragged
=
true
this
.
cellUIStates
[
cell
.
_
uuid
].
draggingOffset
=
offset
this
.
cellUIStates
[
cell
.
_
uuid
].
beginDragged
=
true
}
let
tmpCell
=
this
.
getTmpCell
(
cell
)
this
.
tmpCells
.
push
(
tmpCell
)
},
handleCellDragEnd
(
event
,
cell
)
{
this
.
cellUIStates
[
cell
.
uuid
].
beingDragged
=
false
this
.
cellUIStates
[
cell
.
_
uuid
].
beingDragged
=
false
},
// handleCellContextMenuClick () {
// },
...
...
@@ -235,10 +235,10 @@
// // this.$store.commit('mosys/setSourcesTab', 'tab-default-cells')
// },
async
handleCellContextMenuDelete
(
event
,
cell
)
{
this
.
cellUIStates
[
cell
.
uuid
].
selected
=
false
this
.
cellUIStates
[
cell
.
_
uuid
].
selected
=
false
this
.
updateSelectedCells
()
this
.
cells
=
this
.
cells
.
filter
(
c
=>
c
!==
cell
)
await
this
.
$store
.
dispatch
(
'
annotations/delete
'
,
cell
.
uuid
)
await
this
.
$store
.
dispatch
(
'
annotations/delete
'
,
cell
.
_
uuid
)
this
.
fetchCellAnnotations
()
},
handleCellContextMenu
(
event
)
{
...
...
@@ -260,7 +260,7 @@
else
if
(
styleClass
.
indexOf
(
'
.
'
)
===
0
)
styleClass
=
styleClass
.
substr
(
1
)
}
cell
.
styleClass
=
styleClass
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
uuid
,
{
target
:
{
styleClass
:
styleClass
||
null
}
}])
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
_
uuid
,
{
target
:
{
styleClass
:
styleClass
||
null
}
}])
}
catch
(
e
)
{
/* dialog canceled */
}
},
...
...
@@ -283,7 +283,7 @@
position
=
this
.
getGridPositionForEvent
(
event
)
}
else
{
offset
=
this
.
cellUIStates
[
cell
.
uuid
].
draggingOffset
offset
=
this
.
cellUIStates
[
cell
.
_
uuid
].
draggingOffset
position
=
this
.
getGridPositionForEvent
(
event
,
offset
)
}
let
tmpCell
=
this
.
tmpCells
[
0
]
...
...
@@ -309,10 +309,10 @@
let
cellDropped
=
event
.
dataTransfer
.
getData
(
'
text/plain
'
)
if
(
cellDropped
)
{
cellDropped
=
JSON
.
parse
(
cellDropped
)
let
cell
=
this
.
cells
.
find
(
c
=>
c
.
uuid
===
cellDropped
.
uuid
)
let
cell
=
this
.
cells
.
find
(
c
=>
c
.
_
uuid
===
cellDropped
.
_
uuid
)
let
offset
,
position
if
(
cell
)
{
offset
=
this
.
cellUIStates
[
cell
.
uuid
].
draggingOffset
offset
=
this
.
cellUIStates
[
cell
.
_
uuid
].
draggingOffset
position
=
this
.
getGridPositionForEvent
(
event
,
offset
)
}
else
{
...
...
@@ -349,7 +349,7 @@
if
(
cell
.
x
>=
position
.
x
)
{
cell
.
x
+=
1
let
annotation
=
this
.
getGridCellAnnotation
(
cell
)
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
uuid
,
annotation
])
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
_
uuid
,
annotation
])
await
this
.
fetchCellAnnotations
()
}
}
...
...
@@ -363,7 +363,7 @@
if
(
cell
.
x
>
position
.
x
)
{
cell
.
x
-=
1
let
annotation
=
this
.
getGridCellAnnotation
(
cell
)
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
uuid
,
annotation
])
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
_
uuid
,
annotation
])
await
this
.
fetchCellAnnotations
()
}
}
...
...
@@ -377,7 +377,7 @@
if
(
cell
.
y
>=
position
.
y
)
{
cell
.
y
+=
1
let
annotation
=
this
.
getGridCellAnnotation
(
cell
)
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
uuid
,
annotation
])
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
_
uuid
,
annotation
])
await
this
.
fetchCellAnnotations
()
}
}
...
...
@@ -391,7 +391,7 @@
if
(
cell
.
y
>
position
.
y
)
{
cell
.
y
-=
1
let
annotation
=
this
.
getGridCellAnnotation
(
cell
)
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
uuid
,
annotation
])
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
_
uuid
,
annotation
])
await
this
.
fetchCellAnnotations
()
}
}
...
...
@@ -407,14 +407,14 @@
let
selectedCells
=
Object
.
keys
(
this
.
cellUIStates
).
filter
(
k
=>
{
return
_this
.
cellUIStates
[
k
].
selected
}).
map
(
k
=>
{
return
_this
.
cells
.
find
(
c
=>
c
.
uuid
===
k
)
return
_this
.
cells
.
find
(
c
=>
c
.
_
uuid
===
k
)
})
this
.
$store
.
commit
(
'
mosys/setSelectedCells
'
,
selectedCells
)
},
updateCellUIStates
()
{
let
newCellUIStates
=
{}
this
.
cells
.
map
(
c
=>
{
newCellUIStates
[
c
.
uuid
]
=
{
newCellUIStates
[
c
.
_
uuid
]
=
{
selected
:
false
,
beingResized
:
false
,
cell
:
c
...
...
@@ -425,7 +425,7 @@
},
getTmpCell
(
cell
,
type
=
'
UIFeedback
'
)
{
return
{
srcUuid
:
cell
.
uuid
,
srcUuid
:
cell
.
_
uuid
,
type
:
type
,
x
:
cell
.
x
,
y
:
cell
.
y
,
...
...
@@ -509,7 +509,7 @@
this
.
cells
=
result
.
items
.
map
(
annotation
=>
{
let
cell
=
JSON
.
parse
(
annotation
.
body
.
value
)
if
(
cell
)
{
cell
.
uuid
=
annotation
.
uuid
cell
.
_
uuid
=
annotation
.
_
uuid
cell
.
id
=
annotation
.
id
cell
.
styleClass
=
annotation
.
target
?
annotation
.
target
.
styleClass
:
undefined
cell
.
author
=
annotation
.
author
...
...
@@ -528,7 +528,7 @@
let
annotation
=
result
.
items
.
shift
()
if
(
annotation
)
{
let
metadata
=
JSON
.
parse
(
annotation
.
body
.
value
)
metadata
.
uuid
=
annotation
.
uuid
metadata
.
_
uuid
=
annotation
.
_
uuid
if
(
metadata
)
{
this
.
gridMetadata
=
metadata
}
...
...
@@ -574,8 +574,8 @@
},
async
updateCellStore
(
cell
)
{
let
annotation
=
this
.
getGridCellAnnotation
(
cell
)
if
(
cell
.
uuid
)
{
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
uuid
,
annotation
])
if
(
cell
.
_
uuid
)
{
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
cell
.
_
uuid
,
annotation
])
}
else
{
await
this
.
$store
.
dispatch
(
'
annotations/post
'
,
annotation
)
...
...
@@ -585,8 +585,8 @@
async
updateGridMetadataStore
()
{
let
mapAnnotation
=
this
.
getGridMetadataAnnotation
(
this
.
grid
.
id
,
this
.
gridMetadata
)
if
(
this
.
gridMetadata
.
uuid
)
{
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
this
.
gridMetadata
.
uuid
,
mapAnnotation
])
if
(
this
.
gridMetadata
.
_
uuid
)
{
await
this
.
$store
.
dispatch
(
'
annotations/patch
'
,
[
this
.
gridMetadata
.
_
uuid
,
mapAnnotation
])
}
await
this
.
$store
.
dispatch
(
'
annotations/post
'
,
mapAnnotation
)
this
.
updateGridDimensions
()
...
...
partials/GridEditorSourcePieceMaker.vue
View file @
d84d698d
...
...
@@ -40,7 +40,7 @@
@dragstart.native="event => {handleItemDragStart(event, entry.annotation, 'Annotation-List')}",
name="comment", style="font-size: 1.8rem")
q-item-main
a(@click.prevent="event => {handleVideoItemClick(event, entry.annotation)}")
{{
entry
.
title
||
entry
.
annotation
.
uuid
}}
a(@click.prevent="event => {handleVideoItemClick(event, entry.annotation)}")
{{
entry
.
title
||
entry
.
annotation
.
_
uuid
}}
// timelines list
template(v-else)
...
...
@@ -110,14 +110,14 @@
},
handleItemDragStart
(
event
,
item
,
type
=
'
Video
'
)
{
let
videoCell
=
{
uuid
:
null
,
_
uuid
:
null
,
type
:
type
,
x
:
1
,
y
:
1
,
width
:
1
,
height
:
1
,
content
:
type
===
'
Video
'
?
item
.
body
.
source
.
id
:
item
.
uuid
,
sourceUuid
:
item
.
uuid
content
:
type
===
'
Video
'
?
item
.
body
.
source
.
id
:
item
.
_
uuid
,
sourceUuid
:
item
.
_
uuid
}
event
.
dataTransfer
.
setData
(
'
text/plain
'
,
JSON
.
stringify
(
videoCell
))
}
...
...
partials/cells/CellAnnotationList.vue
View file @
d84d698d
...
...
@@ -204,14 +204,13 @@ export default {
return
index
===
this
.
inputIndex
},
async
fetchAnnotations
()
{
const
result
=
await
this
.
$store
.
dispatch
(
'
annotations/find
'
,
{
uuid
:
this
.
videoUuid
})
const
videoAnnotation
=
result
.
items
.
shift
()
const
videoAnnotation
=
await
this
.
$store
.
dispatch
(
'
annotations/get
'
,
this
.
videoUuid
)
if
(
videoAnnotation
)
{
this
.
video
=
videoAnnotation
this
.
contextTime
=
this
.
videoTime
const
query
=
{
type
:
constants
.
MAP_TYPE_TIMELINE
,
uu
id
:
videoAnnotation
.
target
.
uu
id
id
:
videoAnnotation
.
target
.
id
}
const
mapResult
=
await
this
.
$store
.
dispatch
(
'
maps/find
'
,
query
)
const
map
=
mapResult
.
items
.
shift
()
...
...
partials/cells/CellVideo.vue
View file @
d84d698d
...
...
@@ -91,7 +91,7 @@
this
.
$root
.
$on
(
'
annotation-trigger
'
,
(
annotation
,
annotationGlobalTime
)
=>
{
if
(
!
_this
.
video
)
return
if
(
_this
.
video
.
target
&&
annotation
.
target
.
id
===
_this
.
video
.
target
.
id
)
{
console
.
debug
(
'
CellVideo: received annotation-trigger
'
,
annotation
.
uu
id
,
annotationGlobalTime
.
toISO
())
console
.
debug
(
'
CellVideo: received annotation-trigger
'
,
annotation
.
id
,
annotationGlobalTime
.
toISO
())
_this
.
setPlayerTimeFromDateTime
(
annotationGlobalTime
)
}
})
...
...
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