Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Memorekall Member New
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Rekall
Memorekall Member New
Commits
519a8f63
Commit
519a8f63
authored
3 years ago
by
Sebastien
Browse files
Options
Downloads
Patches
Plain Diff
Fix edit popup TC for notes
parent
a80ed85a
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!98
refresh the mosaic on annotation modification
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
capsule-prototype/js/PopupPanelWidget.js
+42
-17
42 additions, 17 deletions
capsule-prototype/js/PopupPanelWidget.js
with
42 additions
and
17 deletions
capsule-prototype/js/PopupPanelWidget.js
+
42
−
17
View file @
519a8f63
...
...
@@ -178,6 +178,10 @@ function TCPanelInputEditor(data) {
}
TCPanelInputEditor
.
prototype
=
Object
.
create
(
PanelInputEditor
.
prototype
);
TCPanelInputEditor
.
prototype
.
appendInputEditorDiv
=
function
(
parentDiv
)
{
function
onlyNumber
(
event
)
{
$
(
this
).
val
(
$
(
this
).
val
().
replace
(
/
[^
0-9
]
/g
,
''
));
}
let
that
=
this
;
this
.
readonlyDiv
=
$
(
'
<div>
'
);
...
...
@@ -194,7 +198,7 @@ TCPanelInputEditor.prototype.appendInputEditorDiv = function (parentDiv) {
this
.
popupTcInDiv
.
attr
(
'
id
'
,
'
popupTCin
'
)
.
addClass
(
'
popupTCdisplay
'
)
.
html
(
convertToTime
(
that
.
tag
.
getTime
End
()))
.
html
(
convertToTime
(
that
.
tag
.
getTime
Start
()))
this
.
readonlyDiv
.
append
(
this
.
popupTcInDiv
);
this
.
popupTcOutDiv
=
$
(
'
<div>
'
);
...
...
@@ -215,15 +219,21 @@ TCPanelInputEditor.prototype.appendInputEditorDiv = function (parentDiv) {
})
this
.
editDiv
.
append
(
$
(
'
<span>
'
).
addClass
(
'
popupTClabel
'
).
html
(
'
start
'
));
this
.
popupTCeditDivMinStart
=
$
(
'
<input class="popupTCeditfield" id="popupTCinMin" maxLength="2" type="text" value="">
'
);
this
.
popupTCeditDivMinStart
.
click
(
function
(
event
)
{
this
.
popupTCeditDivMinStart
.
val
(
Math
.
floor
(
that
.
tag
.
getTimeStart
()
/
60
).
toString
(
10
).
padStart
(
2
,
'
0
'
))
.
click
(
function
(
event
)
{
event
.
stopPropagation
();
});
})
.
on
(
'
input
'
,
onlyNumber
);
this
.
editDiv
.
append
(
this
.
popupTCeditDivMinStart
);
this
.
editDiv
.
append
(
'
:
'
);
this
.
popupTCeditDivSecStart
=
$
(
'
<input class="popupTCeditfield" id="popupTCinSec" maxLength="2" type="text" value="">
'
);
this
.
popupTCeditDivSecStart
.
click
(
function
(
event
)
{
this
.
popupTCeditDivSecStart
.
val
((
that
.
tag
.
getTimeStart
()
%
60
).
toString
(
10
).
padStart
(
2
,
'
0
'
))
.
click
(
function
(
event
)
{
event
.
stopPropagation
();
});
})
.
on
(
'
input
'
,
onlyNumber
);
this
.
editDiv
.
append
(
this
.
popupTCeditDivSecStart
);
let
popupTCeditStartDivNow
=
$
(
'
<div class="nowTCbtn" id="nowTCin">now</div>
'
);
popupTCeditStartDivNow
.
click
(
function
(
event
)
{
...
...
@@ -232,7 +242,7 @@ TCPanelInputEditor.prototype.appendInputEditorDiv = function (parentDiv) {
that
.
popupTCeditDivMinStart
.
val
(
timeCurrent
.
split
(
"
:
"
)[
0
]);
that
.
popupTCeditDivSecStart
.
val
(
timeCurrent
.
split
(
"
:
"
)[
1
]);
});
this
.
editDiv
.
append
(
popupTCeditStartDivNow
)
;
this
.
editDiv
.
append
(
popupTCeditStartDivNow
)
this
.
editDiv
.
append
(
$
(
'
<br>
'
));
this
.
editDiv
.
append
(
$
(
'
<span>
'
).
addClass
(
'
popupTClabel
'
).
html
(
'
end
'
));
...
...
@@ -242,7 +252,9 @@ TCPanelInputEditor.prototype.appendInputEditorDiv = function (parentDiv) {
.
attr
(
'
maxlength
'
,
'
2
'
)
.
attr
(
'
type
'
,
'
text
'
)
.
addClass
(
'
popupTCeditfield
'
)
.
val
(
''
);
.
val
(
Math
.
floor
(
that
.
tag
.
getTimeEnd
()
/
60
).
toString
(
10
).
padStart
(
2
,
'
0
'
))
.
on
(
'
input
'
,
onlyNumber
);
this
.
popupTCeditDivMinEnd
.
click
(
function
(
event
)
{
event
.
stopPropagation
();
});
...
...
@@ -254,10 +266,11 @@ TCPanelInputEditor.prototype.appendInputEditorDiv = function (parentDiv) {
.
attr
(
'
maxlength
'
,
'
2
'
)
.
attr
(
'
type
'
,
'
text
'
)
.
addClass
(
'
popupTCeditfield
'
)
.
val
(
'
'
)
.
val
(
Math
.
floor
(
that
.
tag
.
getTimeEnd
()
%
60
).
toString
(
10
).
padStart
(
2
,
'
0
'
)
)
.
click
(
function
(
event
)
{
event
.
stopPropagation
();
});
})
.
on
(
'
input
'
,
onlyNumber
);
this
.
editDiv
.
append
(
this
.
popupTCeditDivSecEnd
);
let
popupTCeditEndDivNow
=
$
(
'
<div class="nowTCbtn" id="nowTCin">now</div>
'
);
popupTCeditEndDivNow
.
click
(
function
(
event
)
{
...
...
@@ -282,10 +295,18 @@ TCPanelInputEditor.prototype.appendInputEditorDiv = function (parentDiv) {
}
TCPanelInputEditor
.
prototype
.
closeEdition
=
function
()
{
if
(
this
.
canEdit
)
{
let
tcInMin
=
this
.
popupTCeditDivMinStart
.
val
();
let
tcInSec
=
this
.
popupTCeditDivSecStart
.
val
();
let
tcOutMin
=
this
.
popupTCeditDivMinEnd
.
val
();
let
tcOutSec
=
this
.
popupTCeditDivSecEnd
.
val
();
let
isNaN
=
(
maybeNaN
)
=>
maybeNaN
!=
maybeNaN
;
let
ensureNotNaN
=
(
text
,
defaultValue
=
0
)
=>
{
let
tempVal
=
parseInt
(
text
);
if
(
isNaN
(
tempVal
))
{
return
defaultValue
;
}
return
tempVal
;
}
let
tcInMin
=
ensureNotNaN
(
this
.
popupTCeditDivMinStart
.
val
());
let
tcInSec
=
ensureNotNaN
(
this
.
popupTCeditDivSecStart
.
val
());
let
tcOutMin
=
ensureNotNaN
(
this
.
popupTCeditDivMinEnd
.
val
());
let
tcOutSec
=
ensureNotNaN
(
this
.
popupTCeditDivSecEnd
.
val
());
let
tcIn
=
(
60
*
tcInMin
)
+
tcInSec
;
let
tcOut
=
(
60
*
tcOutMin
)
+
tcOutSec
;
...
...
@@ -306,8 +327,12 @@ TCPanelInputEditor.prototype.closeEdition = function () {
}
else
{
this
.
tag
.
setTimeStart
(
tcIn
);
this
.
tag
.
setTimeEnd
(
tcOut
);
this
.
popupTcInDiv
.
html
(
tcInMin
+
"
:
"
+
tcInSec
);
this
.
popupTcOutDiv
.
html
(
tcOutMin
+
"
:
"
+
tcOutSec
);
this
.
popupTcInDiv
.
html
(
tcInMin
.
toString
().
padStart
(
2
,
'
0
'
)
+
"
:
"
+
tcInSec
.
toString
().
padStart
(
2
,
'
0
'
));
this
.
popupTcOutDiv
.
html
(
tcOutMin
.
toString
().
padStart
(
2
,
'
0
'
)
+
"
:
"
+
tcOutSec
.
toString
().
padStart
(
2
,
'
0
'
));
this
.
popupTCeditDivMinStart
.
val
(
tcInMin
.
toString
().
padStart
(
2
,
'
0
'
));
this
.
popupTCeditDivSecStart
.
val
(
tcInSec
.
toString
().
padStart
(
2
,
'
0
'
));
this
.
popupTCeditDivMinEnd
.
val
(
tcOutMin
.
toString
().
padStart
(
2
,
'
0
'
));
this
.
popupTCeditDivSecEnd
.
val
(
tcOutSec
.
toString
().
padStart
(
2
,
'
0
'
));
window
.
app
.
rekall
.
Rekall
(
'
pubSub
'
).
publish
(
'
tag.tc.updated
'
,
{
tag
:
this
.
tag
});
}
}
...
...
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