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
vidjil
vidjil
Commits
6e39dd8c
Commit
6e39dd8c
authored
Mar 16, 2015
by
Marc Duez
Browse files
com.js : rework myConsole > console ( override default javascript console)
parent
19ebae45
Changes
14
Hide whitespace changes
Inline
Side-by-side
browser/index.html
View file @
6e39dd8c
...
...
@@ -38,7 +38,7 @@
<body>
<div
id=
"popup-container"
>
<span
class=
"closeButton"
onclick=
"
myC
onsole.closePopupMsg()"
>
X
</span>
<span
class=
"closeButton"
onclick=
"
c
onsole.closePopupMsg()"
>
X
</span>
<div
id=
"popup-msg"
>
<noscript>
<style
type=
"text/css"
>
...
...
@@ -231,12 +231,12 @@
<div
id=
"adminSelector"
class=
"selector"
><div>
<input
type=
"checkbox"
onclick=
"$('.menu-highlight').toggle()"
>
highlight menu
</input><br>
<input
type=
"checkbox"
onclick=
" this.checked ? $('#fps').css('display', '') : $('#fps').css('display', 'none');"
>
display fps
</input></br>
<input
type=
"checkbox"
onclick=
" this.checked ?
myC
onsole.openLog() :
myC
onsole.closeLog() ;"
>
log
</input>
<input
type=
"checkbox"
onclick=
" this.checked ?
c
onsole.openLog() :
c
onsole.closeLog() ;"
>
log
</input>
<div
class=
"buttonSelector"
onclick=
"m.changeTimeFormat('delta_date_no_zero', true)"
><input
type=
"radio"
name=
"time"
value=
"delta_date_no_zero"
>
day after first sample (no zero)
</input></div>
</div></div>
</div>
<div
id=
"logo"
style=
"float: right;"
onclick=
"
myC
onsole.
popupMsg(myConsole.msg.
welcome)"
>
Vidjil
<span
class=
'logo'
>
(beta)
</span></div>
<div
id=
"logo"
style=
"float: right;"
onclick=
"
c
onsole.
log({'type': 'popup', 'default':'
welcome
'}
)"
>
Vidjil
<span
class=
'logo'
>
(beta)
</span></div>
<div
class=
"menu"
style=
"float: right"
>
<a
href=
"help"
target=
"_blank"
>
help
</a></div>
...
...
@@ -307,16 +307,22 @@
<div
id=
"frame-container"
></div>
<div
id=
"data-container"
>
<span
class=
"closeButton"
onclick=
"
myC
onsole.closeDataBox()"
>
X
</span>
<span
class=
"closeButton"
onclick=
"
c
onsole.closeDataBox()"
>
X
</span>
<div
id=
"data-msg"
></div>
</div>
<div
id=
"db_div"
>
<span
class=
"closeButton"
onclick=
"db.close()"
>
X
</span>
<div
id=
"db_msg"
></div>
</div>
<div
id=
"flash_container"
></div>
<div
id=
"log_container"
></div>
<form
id=
"form"
></form>
...
...
browser/js/app.js
View file @
6e39dd8c
...
...
@@ -5,7 +5,7 @@ requirejs.config({
jquery
:
'
jquery-2.1.1.min
'
}
});
require
([
"
d3.v3
"
,
"
jquery.form
"
,
"
StackBlur
"
,
...
...
@@ -35,10 +35,15 @@ require(["d3.v3",
"
../crossDomain
"
,
"
../pdf
"
,
"
../database
"
,
"
../conf
"
,
"
../stats
"
,
"
../shortcut
"
,
"
../export
"
],
function
(){
require
([
"
../main
"
]);
});
try
{
require
([
"
../conf
"
],
function
(){
require
([
"
../main
"
]);
})
}
catch
(
err
)
{
require
([
"
../main
"
]);
}
});
\ No newline at end of file
browser/js/builder.js
View file @
6e39dd8c
...
...
@@ -260,7 +260,7 @@ Builder.prototype = {
.
hide
(
'
fast
'
)
self
.
build_settings
()
}
else
{
myC
onsole
.
popupMsg
(
"
expected input between 0.0001 and 1
"
)
c
onsole
.
log
({
"
type
"
:
"
popup
"
,
"
msg
"
:
"
expected input between 0.0001 and 1
"
});
}
}
...
...
@@ -535,7 +535,6 @@ Builder.prototype = {
},
toggle_left_container
:
function
()
{
console
.
log
(
"
plop
"
)
var
self
=
this
var
elem
=
$
(
"
#left-container
"
)
...
...
@@ -659,7 +658,7 @@ Builder.prototype = {
infoTime
.
appendChild
(
document
.
createTextNode
(
"
Info
"
));
infoTime
.
className
=
"
button_right
"
infoTime
.
onclick
=
function
()
{
myC
onsole
.
dataBox
(
self
.
m
.
getPointHtmlInfo
(
self
.
m
.
t
));
c
onsole
.
dataBox
(
self
.
m
.
getPointHtmlInfo
(
self
.
m
.
t
));
}
div_point
.
appendChild
(
infoTime
)
...
...
browser/js/clone.js
View file @
6e39dd8c
...
...
@@ -97,7 +97,7 @@ Clone.prototype = {
*
* */
changeName
:
function
(
newName
)
{
myC
onsole
.
log
(
"
changeName() (clone
"
+
this
.
hash
+
"
<<
"
+
newName
+
"
)
"
);
c
onsole
.
log
(
"
changeName() (clone
"
+
this
.
hash
+
"
<<
"
+
newName
+
"
)
"
);
this
.
c_name
=
newName
;
this
.
m
.
updateElem
([
this
.
hash
]);
this
.
m
.
analysisHasChanged
=
true
...
...
@@ -354,7 +354,7 @@ Clone.prototype = {
changeTag
:
function
(
newTag
)
{
newTag
=
""
+
newTag
newTag
=
newTag
.
replace
(
"
tag
"
,
""
);
myC
onsole
.
log
(
"
changeTag() (clone
"
+
this
.
hash
+
"
<<
"
+
newTag
+
"
)
"
);
c
onsole
.
log
(
"
changeTag() (clone
"
+
this
.
hash
+
"
<<
"
+
newTag
+
"
)
"
);
this
.
tag
=
newTag
;
this
.
m
.
updateElem
([
this
.
hash
]);
this
.
m
.
analysisHasChanged
=
true
;
...
...
@@ -546,7 +546,7 @@ Clone.prototype = {
},
unselect
:
function
()
{
myC
onsole
.
log
(
"
unselect() (clone
"
+
this
.
hash
+
"
)
"
)
c
onsole
.
log
(
"
unselect() (clone
"
+
this
.
hash
+
"
)
"
)
if
(
this
.
select
)
{
this
.
select
=
false
;
}
...
...
browser/js/com.js
View file @
6e39dd8c
...
...
@@ -24,17 +24,18 @@
/* Com object display/store system message
*
* */
function
Com
(
flash_id
,
log_id
,
popup_id
,
data_id
)
{
function
Com
(
flash_id
,
log_id
,
popup_id
,
data_id
,
default_console
)
{
this
.
flash_id
=
flash_id
;
this
.
log_id
=
log_id
;
this
.
popup_id
=
popup_id
;
this
.
data_id
=
data_id
;
this
.
default
=
default_console
;
this
.
min_priority
=
1
;
// minimum required to display message
this
.
min_priority_console
=
0
;
this
.
log_container
=
document
.
getElementById
(
this
.
log_id
);
BUTTON_CLOSE_POPUP
=
"
</br></br> <div class='center' > <button onclick='
myC
onsole.closePopupMsg()'>ok</button></div>
"
,
BUTTON_CLOSE_POPUP
=
"
</br></br> <div class='center' > <button onclick='
c
onsole.closePopupMsg()'>ok</button></div>
"
,
this
.
msg
=
{
"
align_error
"
:
"
Error – connection to align server (
"
+
return_URL_CGI
()
+
"
) failed
"
...
...
@@ -81,13 +82,13 @@ function Com(flash_id, log_id, popup_id, data_id) {
+
"
</br> <a href='http://www.mozilla.org/'> Firefox </a>
"
+
"
</br> <a href='www.google.com/chrome/'> Chrome </a>
"
+
"
</br> <a href='http://www.chromium.org/getting-involved/download-chromium'> Chromium </a>
"
+
"
</br></br> <div class='center' > <button onclick='popupMsg(msg.welcome)'>I want to try anyway</button></div>
"
,
+
"
</br></br> <div class='center' > <button onclick='popupMsg(msg.welcome)'>I want to try anyway</button></div>
"
,
"
database_timeout
"
:
"
Cannot connect database, please retry in a few seconds
"
,
"
database_timeout
"
:
"
Cannot connect database, please retry in a few seconds
"
,
"
save_analysis
"
:
"
You made some changes in the analysis of the previous patient
"
+
"
</br>that were not saved (patients → save analysis).
"
+
"
</br>These changes will now be lost, do you want to proceed anyway?
"
+
"
</br>These changes will now be lost, do you want to proceed anyway?
"
}
...
...
@@ -95,6 +96,28 @@ function Com(flash_id, log_id, popup_id, data_id) {
Com
.
prototype
=
{
log
:
function
(
obj
){
if
(
typeof
obj
!==
'
object
'
){
this
.
default
.
log
(
obj
)
}
else
{
var
text
=
""
if
(
typeof
obj
.
default
!=
"
undefined
"
)
text
+=
this
.
msg
[
obj
.
default
]
if
(
typeof
obj
.
msg
!=
"
undefined
"
)
text
+=
obj
.
msg
switch
(
obj
.
type
)
{
case
"
flash
"
:
this
.
flash
(
obj
.
msg
,
obj
.
priority
)
break
;
case
"
popup
"
:
this
.
popupMsg
(
obj
.
msg
)
break
;
case
"
log
"
:
this
.
customLog
(
obj
.
msg
,
obj
.
priority
)
break
;
}
}
},
/* display a flash message if priority level is sufficient
* and print message in log
* */
...
...
@@ -124,7 +147,7 @@ Com.prototype = {
/* print message in log_container if priority level is sufficient
*
* */
l
og
:
function
(
str
,
priority
){
customL
og
:
function
(
str
,
priority
){
priority
=
typeof
priority
!==
'
undefined
'
?
priority
:
0
;
var
self
=
this
;
...
...
@@ -144,7 +167,7 @@ Com.prototype = {
}
else
{
if
(
priority
>=
this
.
min_priority_console
)
console
.
log
(
str
)
this
.
default
.
log
(
str
)
}
},
...
...
browser/js/database.js
View file @
6e39dd8c
...
...
@@ -88,7 +88,7 @@ Database.prototype = {
},
error
:
function
(
request
,
status
,
error
)
{
if
(
status
===
"
timeout
"
)
{
myC
onsole
.
flash
(
myConsole
.
msg
.
database_timeout
,
2
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
default
"
:
"
database_timeout
"
,
"
priority
"
:
2
});
}
else
{
self
.
check_cert
()
}
...
...
@@ -103,7 +103,7 @@ Database.prototype = {
+
"
Your browser currently does not recognize our SSL certificate. </br>
"
+
"
To use the sample database, you need to accept this certificate and/or tag this website as a trusted one. </br>
"
+
"
<a href='
"
+
DB_ADDRESS
+
"
'>Follow this link<a/>
"
myC
onsole
.
popupMsg
(
msg
)
c
onsole
.
log
({
"
type
"
:
"
popup
"
,
"
msg
"
:
msg
}
)
}
},
...
...
@@ -163,7 +163,7 @@ Database.prototype = {
}
//TODO server need to return message priority too ( 0=console, 1=ok, 2=error)
if
(
res
.
message
)
myC
onsole
.
flash
(
"
database :
"
+
res
.
message
,
1
)
if
(
res
.
message
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
"
database :
"
+
res
.
message
,
"
priority
"
:
1
}
)
return
res
...
...
@@ -193,9 +193,9 @@ Database.prototype = {
},
error
:
function
(
request
,
status
,
error
)
{
if
(
status
===
"
timeout
"
)
{
myC
onsole
.
flash
(
myConsole
.
msg
.
database_timeout
,
2
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
default
"
:
"
database_timeout
"
,
"
priority
"
:
2
});
}
else
{
myC
onsole
.
popupMsg
(
request
.
responseText
)
;
c
onsole
.
log
({
"
type
"
:
"
popup
"
,
"
msg
"
:
request
.
responseText
}
)
}
}
});
...
...
@@ -218,7 +218,7 @@ Database.prototype = {
},
error
:
function
(
request
,
status
,
error
)
{
if
(
status
===
"
timeout
"
)
{
myC
onsole
.
flash
(
myConsole
.
msg
.
database_timeout
,
2
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
default
"
:
"
database_timeout
"
,
"
priority
"
:
2
});
}
else
{
var
nexts
=
$
(
'
#login_form
'
).
attr
(
'
action
'
).
split
(
"
&
"
)
var
next
=
"
patient/index
"
...
...
@@ -289,9 +289,9 @@ Database.prototype = {
},
error
:
function
(
request
,
status
,
error
)
{
if
(
status
===
"
timeout
"
)
{
myC
onsole
.
flash
(
myConsole
.
msg
.
database_timeout
,
2
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
default
"
:
"
database_timeout
"
,
"
priority
"
:
2
});
}
else
{
myC
onsole
.
popupMsg
(
request
+
"
"
+
status
+
"
"
+
error
);
c
onsole
.
log
({
"
type
"
:
"
popup
"
,
"
msg
"
:
request
+
"
"
+
status
+
"
"
+
error
}
);
}
}
});
...
...
@@ -335,11 +335,11 @@ Database.prototype = {
url
:
self
.
db_address
+
controller_name
+
"
?
"
+
this
.
argsToStr
(
args
),
xhrFields
:
{
withCredentials
:
true
},
success
:
function
(
result
)
{
myC
onsole
.
flash
(
result
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
result
,
"
priority
"
:
1
});
},
error
:
function
(
request
,
status
,
error
)
{
if
(
status
===
"
timeout
"
)
{
myC
onsole
.
flash
(
myConsole
.
msg
.
database_timeout
,
2
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
default
"
:
"
database_timeout
"
,
"
priority
"
:
2
});
}
else
{
self
.
call
(
"
patient/index
"
)
}
...
...
@@ -371,13 +371,13 @@ Database.prototype = {
list
.
appendChild
(
a
);
}
myConsole
.
closePopupMsg
()
if
(
m
.
analysisHasChanged
){
m
.
analysisHasChanged
=
false
;
myConsole
.
popupMsg
(
myConsole
.
msg
.
save_analysis
+
"
<div class=
\
'center
\
'> <button onclick=
\
'db.load_data(
"
+
JSON
.
stringify
(
args
)
+
"
,
\"
"
+
filename
+
"
\"
)
\
'>Continue</button>
"
+
"
<button onclick='myConsole.closePopupMsg()'>Cancel</button> </div>
"
)
console
.
log
({
"
type
"
:
"
popup
"
,
"
default
"
:
"
save_analysis
"
,
"
msg
"
:
"
<div class=
\
'center
\
'> <button onclick=
\
'db.load_data(
"
+
JSON
.
stringify
(
args
)
+
"
,
\"
"
+
filename
+
"
\"
)
\
'>Continue</button>
"
+
"
<button onclick='console.closePopupMsg()'>Cancel</button> </div>
"
,
"
priority
"
:
2
});
return
}
...
...
@@ -396,9 +396,9 @@ Database.prototype = {
},
error
:
function
(
request
,
status
,
error
)
{
if
(
status
===
"
timeout
"
)
{
myC
onsole
.
flash
(
myConsole
.
msg
.
database_timeout
+
"
- unable to access patient data
"
,
1
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
default
"
:
"
database_timeout
"
,
"
msg
"
:
"
- unable to access patient data
"
,
"
priority
"
:
1
});
}
else
{
myC
onsole
.
popupMsg
(
request
.
responseText
);
c
onsole
.
log
({
"
type
"
:
"
popup
"
,
"
msg
"
:
request
.
responseText
}
);
}
}
});
...
...
@@ -418,13 +418,12 @@ Database.prototype = {
load_custom_data
:
function
(
args
)
{
var
self
=
this
;
myConsole
.
closePopupMsg
()
if
(
m
.
analysisHasChanged
){
m
.
analysisHasChanged
=
false
;
myC
onsole
.
popupMsg
(
myConsole
.
msg
.
save_analysis
+
"
<div class=
\
'center
\
'> <button onclick=
\
'db.load_data(
"
+
JSON
.
stringify
(
args
)
+
"
,
\"
"
+
filename
+
"
\"
)
\
'>Continue</button>
"
+
"
<button onclick='myConsole.closePopupMsg()'>Cancel
</button>
</div>
"
)
c
onsole
.
log
({
"
type
"
:
"
popup
"
,
"
default
"
:
"
save_analysis
"
,
"
msg
"
:
"
<div class=
\
'center
\
'> <button onclick=
\
'db.load_data(
"
+
JSON
.
stringify
(
args
)
+
"
,
\"
"
+
filename
+
"
\"
)
\
'>Continue
</button>
"
+
"
<button onclick='console.closePopupMsg()'>Cancel</button> </div>
"
});
return
}
...
...
@@ -454,9 +453,9 @@ Database.prototype = {
error
:
function
(
request
,
status
,
error
)
{
self
.
m
.
resume
()
if
(
status
===
"
timeout
"
)
{
myC
onsole
.
flash
(
myConsole
.
msg
.
database_timeout
+
"
- unable to access patient data
"
,
1
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
default
"
:
"
database_timeout
"
,
"
msg
"
:
"
- unable to access patient data
"
,
"
priority
"
:
1
});
}
else
{
myC
onsole
.
popupMsg
(
request
.
responseText
);
c
onsole
.
log
({
"
type
"
:
"
popup
"
,
"
msg
"
:
request
.
responseText
}
);
}
}
});
...
...
@@ -477,9 +476,9 @@ Database.prototype = {
},
error
:
function
(
request
,
status
,
error
)
{
if
(
status
===
"
timeout
"
)
{
myC
onsole
.
flash
(
myConsole
.
msg
.
database_timeout
+
"
- unable to access
saved analysis
"
,
1
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
default
"
:
"
database_timeout
"
,
"
msg
"
:
"
- unable to access
patient data
"
,
"
priority
"
:
1
});
}
else
{
myC
onsole
.
popupMsg
(
request
.
responseText
);
c
onsole
.
log
({
"
type
"
:
"
popup
"
,
"
msg
"
:
request
.
responseText
}
);
}
}
});
...
...
@@ -509,21 +508,21 @@ Database.prototype = {
success
:
function
(
result
)
{
try
{
var
res
=
jQuery
.
parseJSON
(
result
);
if
(
res
.
message
)
myC
onsole
.
flash
(
"
database :
"
+
res
.
message
,
1
)
if
(
res
.
message
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
"
database :
"
+
res
.
message
,
"
priority
"
:
1
});
self
.
m
.
analysisHasChanged
=
false
}
catch
(
err
){}
},
error
:
function
(
request
,
status
,
error
)
{
if
(
status
===
"
timeout
"
)
{
myC
onsole
.
flash
(
myConsole
.
msg
.
database_timeout
+
"
- unable to save analysis
"
,
2
);
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
default
"
:
"
database_timeout
"
,
"
msg
"
:
"
- unable to save analysis
"
,
"
priority
"
:
2
}
);
}
else
{
myC
onsole
.
flash
(
"
server : save analysis error :
"
+
request
.
responseText
,
2
);
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
"
server : save analysis error :
"
+
request
.
responseText
,
"
priority
"
:
2
}
);
}
}
});
}
else
{
myC
onsole
.
flash
(
"
server : save analysis error : this file is nor from the database
"
,
2
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
"
server : save analysis error : this file is nor from the database
"
,
"
priority
"
:
2
});
}
},
...
...
@@ -739,11 +738,11 @@ Uploader.prototype = {
},
error
:
function
(
request
,
status
,
error
)
{
if
(
status
===
"
timeout
"
)
{
myC
onsole
.
flash
(
myConsole
.
msg
.
database_timeout
,
2
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
default
"
:
"
database_timeout
"
,
"
priority
"
:
2
});
}
else
{
if
(
status
!==
"
abort
"
){
self
.
queue
[
id
].
status
=
"
upload_error
"
myC
onsole
.
flash
(
"
upload
"
+
self
.
queue
[
id
].
filename
+
"
:
"
+
status
,
2
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
"
upload
"
+
self
.
queue
[
id
].
filename
+
"
:
"
+
status
,
"
priority
"
:
2
});
}
}
self
.
display
();
...
...
@@ -752,7 +751,7 @@ Uploader.prototype = {
},
cancel
:
function
(
id
)
{
myC
onsole
.
flash
(
"
cancel upload :
"
+
this
.
queue
[
id
].
filename
,
1
);
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
"
cancel upload :
"
+
this
.
queue
[
id
].
filename
,
"
priority
"
:
1
}
);
this
.
queue
[
id
].
jqXHR
.
abort
()
this
.
queue
[
id
].
status
=
"
canceled
"
this
.
reload
(
id
)
...
...
browser/js/germline_builder.js
View file @
6e39dd8c
...
...
@@ -47,12 +47,11 @@ GermlineList.prototype = {
self
.
list
=
jQuery
.
parseJSON
(
json
);
}
catch
(
err
){
myConsole
.
flash
(
"
germlines.data malformed, use local js file instead (can be outdated)
"
,
2
);
console
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
"
germlines.data malformed, use local js file instead (can be outdated)
"
,
"
priority
"
:
2
});
}
},
error
:
function
(
request
,
status
,
error
)
{
myC
onsole
.
flash
(
"
impossible to retrieve germline.data, using local germline.js
"
,
0
);
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
"
impossible to retrieve germline.data, using local germline.js
"
,
"
priority
"
:
0
}
);
},
dataType
:
"
text
"
});
...
...
@@ -65,7 +64,7 @@ GermlineList.prototype = {
this
.
list
=
germline_data
}
catch
(
err
){
myC
onsole
.
popupMsg
(
"
Incorrect browser installation, 'js/germline.js' is not found<br />please run 'make' in 'germline/'
"
)
c
onsole
.
log
({
"
type
"
:
"
popup
"
,
"
msg
"
:
"
Incorrect browser installation, 'js/germline.js' is not found<br />please run 'make' in 'germline/'
"
});
}
},
...
...
@@ -137,7 +136,7 @@ Germline.prototype = {
this
.
allele
[
key
]
=
germline
[
filename
][
key
]
}
}
else
{
myC
onsole
.
flash
(
"
warning : this browser version doesn't have the
"
+
filename
+
"
germline file
"
,
2
);
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
"
warning : this browser version doesn't have the
"
+
filename
+
"
germline file
"
,
"
priority
"
:
2
}
);
}
}
}
...
...
browser/js/graph.js
View file @
6e39dd8c
...
...
@@ -311,7 +311,7 @@ Graph.prototype = {
elapsedTime
=
new
Date
()
.
getTime
()
-
startTime
;
myC
onsole
.
log
(
"
update Graph:
"
+
elapsedTime
+
"
ms
"
,
-
1
);
c
onsole
.
log
(
"
update Graph:
"
+
elapsedTime
+
"
ms
"
);
return
this
},
...
...
@@ -859,8 +859,6 @@ Graph.prototype = {
if
(
this
.
m
.
samples
.
order
.
length
>=
3
)
{
deltas
=
this
.
m
.
dateDiffMinMax
()
myConsole
.
log
(
deltas
)
myConsole
.
log
(
deltas
.
min
)
/* only if there are enough different dates */
if
((
deltas
.
min
>=
0
)
&&
(
deltas
.
max
>=
2
))
...
...
browser/js/list.js
View file @
6e39dd8c
...
...
@@ -261,7 +261,7 @@ List.prototype = {
elapsedTime
=
new
Date
()
.
getTime
()
-
startTime
;
myC
onsole
.
log
(
"
update Liste:
"
+
elapsedTime
+
"
ms
"
,
-
1
);
c
onsole
.
log
(
"
update Liste:
"
+
elapsedTime
+
"
ms
"
);
//TODO check order
document
.
getElementById
(
"
list_sort_select
"
).
selectedIndex
=
0
;
...
...
@@ -339,7 +339,7 @@ List.prototype = {
var
span_info
=
document
.
createElement
(
'
span
'
)
span_info
.
className
=
"
infoBox
"
;
span_info
.
onclick
=
function
()
{
myC
onsole
.
dataBox
(
self
.
m
.
clone
(
cloneID
).
getHtmlInfo
());
c
onsole
.
dataBox
(
self
.
m
.
clone
(
cloneID
).
getHtmlInfo
());
}
span_info
.
appendChild
(
document
.
createTextNode
(
"
I
"
));
...
...
@@ -421,7 +421,7 @@ List.prototype = {
var
span_info
=
document
.
createElement
(
'
span
'
)
span_info
.
className
=
"
infoBox
"
;
span_info
.
onclick
=
function
()
{
myC
onsole
.
dataBox
(
self
.
m
.
clone
(
this
.
parentNode
.
id2
).
getHtmlInfo
());
c
onsole
.
dataBox
(
self
.
m
.
clone
(
this
.
parentNode
.
id2
).
getHtmlInfo
());
}
span_info
.
appendChild
(
document
.
createTextNode
(
"
I
"
));
...
...
browser/js/main.js
View file @
6e39dd8c
var
myConsole
=
new
Com
(
"
flash_container
"
,
"
log_container
"
,
"
popup-container
"
,
"
data-container
"
)
initMenu
(
)
//console = new Com("flash_container", "log_container", "popup-container", "data-container", console
)
/* Model
/* Model
*/
var
m
=
new
Model
();
/*
v
iews
/*
V
iews
/Modules
*/
var
graph
=
new
Graph
(
"
visu2
"
,
m
);
var
list_clones
=
new
List
(
"
list
"
,
"
data
"
,
m
);
...
...
@@ -19,6 +18,8 @@ var pdf = new PDF(m, "visu2_svg")
var
report
=
new
Report
(
m
)
var
db
=
new
Database
(
"
plop!
"
,
m
);
initMenu
();
/*
*/
var
shortcut
=
new
Shortcut
()
browser/js/menu.js
View file @
6e39dd8c
...
...
@@ -52,7 +52,7 @@ function initMenu () {
}
},
error
:
function
()
{
myC
onsole
.
flash
(
"
Files are not available
"
,
1
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
"
Files are not available
"
,
"
priority
"
:
1
});
}
});
...
...
@@ -72,13 +72,11 @@ function changeStyle(newStyle){
function
loadData
()
{
myConsole
.
closePopupMsg
()
if
(
m
.
analysisHasChanged
){
m
.
analysisHasChanged
=
false
;
myConsole
.
popupMsg
(
myConsole
.
msg
.
save_analysis
+
"
<div class=
\
'center
\
'> <button onclick=
\
'loadData()
\
'>Continue</button>
"
+
"
<button onclick='myConsole.closePopupMsg()'>Cancel</button> </div>
"
)
console
.
log
({
"
type
"
:
"
popup
"
,
"
default
"
:
"
save_analysis
"
,
"
msg
"
:
"
<div class=
\
'center
\
'> <button onclick=
\
'loadData()
\
'>Continue</button>
"
+
"
<button onclick='console.closePopupMsg()'>Cancel</button> </div>
"
});
return
}
...
...
browser/js/model.js
View file @
6e39dd8c
...
...
@@ -35,7 +35,7 @@ VIDJIL_JSON_VERSION = '2014.09';
*
* */
function
Model
()
{
myC
onsole
.
log
(
"
creation Model
"
)
c
onsole
.
log
(
"
creation Model
"
)
this
.
view
=
[];
this
.
reset
();
this
.
checkBrowser
();
...
...
@@ -189,7 +189,7 @@ Model.prototype = {
//wait 1sec to check ssl
setTimeout
(
function
()
{
db
.
call
(
"
patient/index.html
"
)},
1000
);
}
else
{
myC
onsole
.
popupMsg
(
myConsole
.
msg
.
welcome
)
c
onsole
.
log
({
"
type
"
:
"
popup
"
,
"
default
"
:
"
welcome
"
}
)
}
},
...
...
@@ -201,7 +201,7 @@ Model.prototype = {
load
:
function
(
id
,
analysis
,
limit
)
{
var
self
=
this
;
myC
onsole
.
log
(
"
load()
"
);
c
onsole
.
log
(
"
load()
"
);
if
(
document
.
getElementById
(
id
)
.
files
.
length
===
0
)
{
...
...
@@ -233,7 +233,7 @@ Model.prototype = {
var
input
=
document
.
getElementById
(
analysis
)
myC
onsole
.
log
(
"
loadAnalysis()
"
);
c
onsole
.
log
(
"
loadAnalysis()
"
);
if
(
input
.
files
.
length
!=
0
)
{
var
oFReader
=
new
FileReader
();
var
oFile
=
input
...
...
@@ -266,8 +266,8 @@ Model.prototype = {
loadDataUrl
:
function
(
url
,
callback
)
{
var
self
=
this
;
callback
=
typeof
callback
!==
'
undefined
'
?
callback
:
function
(){
self
.
loadAnalysisUrl
(
url
)}
myC
onsole
.
flash
(
"
loadDataUrl:
"
+
url
)
c
onsole
.
log
({
"
type
"
:
"
flash
"
,
"
msg
"
:
"
loadDataUrl:
"
+
url
,
"
priority
"
:
1
});
var
url_split
=
url
.
split
(
'
/
'
)
...