Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
5c7e7eaf
Commit
5c7e7eaf
authored
Feb 25, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove duplicate base_url composition
parent
61e2a609
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
18 deletions
+10
-18
gadget_erp5_page_slap_load_schema.js
gadget_erp5_page_slap_load_schema.js
+10
-18
No files found.
gadget_erp5_page_slap_load_schema.js
View file @
5c7e7eaf
...
...
@@ -22,8 +22,14 @@
return
base_url
;
}
function
getJSON
(
url
)
{
function
getJSON
(
url
,
base_url
)
{
var
protocol
=
URI
(
url
).
protocol
();
if
(
protocol
===
""
)
{
if
(
base_url
&&
!
url
.
startsWith
(
"
/
"
))
{
url
=
base_url
+
"
/
"
+
url
;
protocol
=
URI
(
url
).
protocol
();
}
}
if
(
protocol
===
"
http
"
||
protocol
===
"
https
"
)
{
if
(
URI
(
window
.
location
).
protocol
()
!==
protocol
)
{
throw
new
Error
(
"
You cannot mixed http and https calls
"
);
...
...
@@ -71,14 +77,7 @@
});
}
return
RSVP
.
Queue
().
push
(
function
()
{
if
(
URI
(
ref
).
protocol
()
===
""
)
{
if
(
base_url
&&
!
ref
.
startsWith
(
"
/
"
))
{
ref
=
base_url
+
"
/
"
+
ref
;
}
}
return
getJSON
(
ref
);
})
return
getJSON
(
ref
,
base_url
)
.
push
(
function
(
external_schema
)
{
parts
=
ref
.
split
(
"
#
"
);
ref
=
"
#
"
+
parts
[
1
];
...
...
@@ -227,7 +226,7 @@
.
push
(
function
(
json_object
)
{
var
parameter_schema_url
,
st
,
base_url
;
base_url
=
getBaseUrl
(
schema_url
)
;
for
(
st
in
json_object
[
"
software-type
"
])
{
if
(
json_object
[
"
software-type
"
].
hasOwnProperty
(
st
))
{
...
...
@@ -237,14 +236,7 @@
}
}
if
(
URI
(
parameter_schema_url
).
protocol
()
===
""
)
{
base_url
=
getBaseUrl
(
schema_url
);
if
(
base_url
!==
undefined
)
{
parameter_schema_url
=
base_url
+
"
/
"
+
parameter_schema_url
;
}
}
return
getJSON
(
parameter_schema_url
)
return
getJSON
(
parameter_schema_url
,
base_url
)
.
push
(
function
(
schema
)
{
return
expandSchema
(
schema
,
schema
,
base_url
)
.
push
(
function
(
loaded_json
)
{
...
...
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