Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
bc0ca923
Commit
bc0ca923
authored
Jan 26, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jsplumb cleanups
parent
4e9fdd04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
67 deletions
+5
-67
dream/platform/src/jsplumb/jsplumb.js
dream/platform/src/jsplumb/jsplumb.js
+5
-67
No files found.
dream/platform/src/jsplumb/jsplumb.js
View file @
bc0ca923
...
...
@@ -385,7 +385,7 @@
// 2 here is for #/
var
i
,
ref_path
=
ref
.
substr
(
2
,
ref
.
length
),
parts
=
ref_path
.
split
(
"
/
"
);
for
(
i
=
0
;
i
<
parts
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
parts
.
length
;
i
+=
1
)
{
schema
=
schema
[
parts
[
i
]];
}
return
schema
;
...
...
@@ -396,15 +396,12 @@
// references
// XXX this should probably be moved to fieldset ( and not handle
// class_definition here)
// XXX known limitation: we do not expand refs inside oneOf
var
property
,
referenced
,
i
,
var
referenced
,
i
,
expanded_class_definition
=
{
properties
:
class_definition
.
properties
||
{}};
console
.
log
(
'
expandSchema
'
,
class_definition
);
// expand direct ref
if
(
class_definition
.
$ref
)
{
console
.
log
(
'
DI
'
,
class_definition
.
$ref
);
referenced
=
expandSchema
(
resolveReference
(
class_definition
.
$ref
,
full_schema
.
class_definition
),
full_schema
);
...
...
@@ -412,25 +409,8 @@
delete
referenced
.
properties
;
}
$
.
extend
(
expanded_class_definition
,
referenced
);
console
.
log
(
"
after direct expand
"
,
Object
.
create
(
referenced
));
}
/*
// expand refs inside properties
for (property in expanded_class_definition.properties) {
if (expanded_class_definition.properties.hasOwnProperty(property)) {
referenced = expanded_class_definition.properties[property];
if (referenced.$ref) {
if (!expanded_class_definition.properties[property]){
expanded_class_definition.properties[property] = {};
}
$.extend(expanded_class_definition.properties[property], expandSchema(
resolveReference(referenced.$ref, full_schema.class_definition),
full_schema));
}
}
}
*/
if
(
class_definition
.
oneOf
)
{
expanded_class_definition
.
oneOf
=
[];
for
(
i
=
0
;
i
<
class_definition
.
oneOf
.
length
;
i
+=
1
)
{
...
...
@@ -443,7 +423,9 @@
for
(
i
=
0
;
i
<
class_definition
.
allOf
.
length
;
i
+=
1
)
{
referenced
=
expandSchema
(
class_definition
.
allOf
[
i
],
full_schema
);
if
(
referenced
.
properties
)
{
$
.
extend
(
expanded_class_definition
.
properties
,
referenced
.
properties
);
$
.
extend
(
expanded_class_definition
.
properties
,
referenced
.
properties
);
delete
referenced
.
properties
;
}
$
.
extend
(
expanded_class_definition
,
referenced
);
...
...
@@ -452,50 +434,7 @@
if
(
expanded_class_definition
.
$ref
)
{
delete
expanded_class_definition
.
$ref
;
}
console
.
log
(
'
R
'
,
expanded_class_definition
);
return
Object
.
create
(
expanded_class_definition
);
// expand refs directly in allOf
if
(
class_definition
.
xallOf
)
{
for
(
i
=
0
;
i
<
class_definition
.
allOf
.
length
;
i
+=
1
)
{
referenced
=
class_definition
.
allOf
[
i
];
if
(
referenced
.
$ref
)
{
referenced
=
Object
.
create
(
referenced
);
$
.
extend
(
referenced
,
expandSchema
(
resolveReference
(
referenced
.
$ref
,
full_schema
.
class_definition
),
full_schema
));
}
if
(
referenced
.
properties
)
{
for
(
property
in
referenced
.
properties
)
{
if
(
referenced
.
properties
.
hasOwnProperty
(
property
))
{
//console.log('property2', property, referenced.properties[property]);
// and in allOf references. XXX I guess this can be merged with
// "expand ref inside properties"
if
(
referenced
.
properties
[
property
].
$ref
)
{
expanded_class_definition
.
properties
[
property
]
=
referenced
.
properties
[
property
];
$
.
extend
(
expanded_class_definition
.
properties
[
property
],
expandSchema
(
resolveReference
(
referenced
.
properties
[
property
].
$ref
,
full_schema
.
class_definition
),
full_schema
));
}
if
(
referenced
.
properties
[
property
].
type
)
{
if
(
!
expanded_class_definition
.
properties
[
property
]
)
{
expanded_class_definition
.
properties
[
property
]
=
{};
}
$
.
extend
(
expanded_class_definition
.
properties
[
property
],
referenced
.
properties
[
property
]);
}
}
}
}
}
}
return
expanded_class_definition
;
}
function
openEdgeEditionDialog
(
gadget
,
connection
)
{
...
...
@@ -615,7 +554,6 @@
gadget
.
props
.
data
.
class_definition
[
node_data
.
_class
],
gadget
.
props
.
data
);
console
.
log
(
'
editing node with
'
,
schema
);
if
(
node_edit_popup
.
length
!==
0
)
{
node_edit_popup
.
remove
();
...
...
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