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
c80a200a
Commit
c80a200a
authored
Feb 12, 2015
by
Mathieu Giraud
Browse files
main.js: reorganize onStart
parent
a2d92f6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
browser/js/main.js
View file @
c80a200a
...
...
@@ -96,14 +96,19 @@ var stats = new Stats(sp);
var
shortcut
=
new
Shortcut
()
//onStart
if
(
typeof
config
!=
'
undefined
'
&&
location
.
search
!=
''
){
/* prepare onStart
*/
var
dataURL
=
""
var
analysisURL
=
""
var
patient
=
-
1
var
dbconfig
=
-
1
var
custom_list
=
[]
// Process arguments given on the URL
if
(
location
.
search
!=
''
)
{
var
tmp
=
location
.
search
.
substring
(
1
).
split
(
'
&
'
)
var
patient
=
-
1
var
dbconfig
=
-
1
var
dataURL
=
""
var
analysisURL
=
""
var
custom_list
=
[]
for
(
var
i
=
0
;
i
<
tmp
.
length
;
i
++
){
var
tmp2
=
tmp
[
i
].
split
(
'
=
'
)
...
...
@@ -113,8 +118,9 @@ if (typeof config != 'undefined' && location.search != ''){
if
(
tmp2
[
0
]
==
'
config
'
)
dbconfig
=
tmp2
[
1
]
if
(
tmp2
[
0
]
==
'
custom
'
)
custom_list
.
push
(
tmp2
[
1
])
}
}
//onStart
if
(
dataURL
!=
""
)
{
if
(
analysisURL
!=
""
){
var
callback
=
function
()
{
m
.
loadAnalysisUrl
(
analysisURL
)}
...
...
@@ -124,18 +130,17 @@ if (typeof config != 'undefined' && location.search != ''){
}
}
if
(
patient
!=
"
-1
"
&&
dbconfig
!=
"
-1
"
){
else
if
(
patient
!=
"
-1
"
&&
dbconfig
!=
"
-1
"
){
//wait 1sec to check ssl
setTimeout
(
function
()
{
db
.
load_data
(
{
"
patient
"
:
patient
,
"
config
"
:
dbconfig
}
,
""
)
},
1000
);
}
if
(
custom_list
.
length
>
0
){
else
if
(
custom_list
.
length
>
0
){
//wait 1sec to check ssl
setTimeout
(
function
()
{
db
.
load_custom_data
(
{
"
custom
"
:
custom_list
})
},
1000
);
}
}
else
if
(
typeof
config
!=
'
undefined
'
&&
config
.
use_database
){
else
if
(
typeof
config
!=
'
undefined
'
&&
config
.
use_database
){
//wait 1sec to check ssl
setTimeout
(
function
()
{
db
.
call
(
"
patient/index.html
"
)},
1000
);
}
else
{
...
...
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