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
e83244b1
Commit
e83244b1
authored
Mar 17, 2015
by
Marc Duez
Browse files
database.js : update args > can take a database url as arg
parent
1300c30f
Changes
1
Hide whitespace changes
Inline
Side-by-side
browser/js/database.js
View file @
e83244b1
DB_ADDRESS
=
""
function
Database
(
id
,
model
)
{
function
Database
(
model
,
address
)
{
var
self
=
this
;
if
(
typeof
config
!=
'
undefined
'
&&
config
.
use_database
!=
undefined
&&
config
.
use_database
)
{
if
(
config
.
db_address
)
{
DB_ADDRESS
=
config
.
db_address
}
if
(
config
.
db_address
==
"
default
"
)
DB_ADDRESS
=
"
https://
"
+
window
.
location
.
hostname
+
"
/vidjil/
"
}
if
(
typeof
address
!=
"
undefined
"
){
DB_ADDRESS
=
address
}
if
(
DB_ADDRESS
!=
""
){
console
.
log
(
"
plapipo
"
+
DB_ADDRESS
)
var
fileref
=
document
.
createElement
(
'
script
'
)
fileref
.
setAttribute
(
"
type
"
,
"
text/javascript
"
)
fileref
.
setAttribute
(
"
src
"
,
DB_ADDRESS
+
"
static/js/checkSSL.js
"
)
document
.
getElementsByTagName
(
"
head
"
)[
0
].
appendChild
(
fileref
)
this
.
db_address
=
DB_ADDRESS
;
this
.
id
=
id
;
this
.
upload
=
{};
this
.
url
=
[]
this
.
m
=
model
...
...
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