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
60c7da6b
Commit
60c7da6b
authored
Nov 18, 2014
by
Jérome Perrin
Committed by
Ioannis Papagiannopoulos
Dec 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
graph editor: (partially) update to new json format
parent
7c11c968
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
194 deletions
+121
-194
dream/platform/src/dream/Input_viewProductionLine.js
dream/platform/src/dream/Input_viewProductionLine.js
+3
-17
dream/platform/src/jsplumb/jsplumb.js
dream/platform/src/jsplumb/jsplumb.js
+116
-176
dream/platform/src/toolbox/toolbox.js
dream/platform/src/toolbox/toolbox.js
+2
-1
No files found.
dream/platform/src/dream/Input_viewProductionLine.js
View file @
60c7da6b
...
...
@@ -15,28 +15,14 @@
return
gadget
.
getDeclaredGadget
(
"
productionline_graph
"
);
})
.
push
(
function
(
graph_gadget
)
{
return
graph_gadget
.
getData
();
})
.
push
(
function
(
data
)
{
graph_data
=
data
;
// Always get a fresh version, to prevent deleting spreadsheet & co
return
gadget
.
aq_getAttachment
({
"
_id
"
:
gadget
.
props
.
jio_key
,
"
_attachment
"
:
"
body.json
"
});
return
graph_gadget
.
getContent
();
})
.
push
(
function
(
body
)
{
var
data
=
JSON
.
parse
(
body
),
json_graph_data
=
JSON
.
parse
(
graph_data
);
data
.
nodes
=
json_graph_data
.
nodes
;
data
.
edges
=
json_graph_data
.
edges
;
data
.
preference
=
json_graph_data
.
preference
;
console
.
log
(
"
saving
"
,
JSON
.
parse
(
body
));
return
gadget
.
aq_putAttachment
({
"
_id
"
:
gadget
.
props
.
jio_key
,
"
_attachment
"
:
"
body.json
"
,
"
_data
"
:
JSON
.
stringify
(
data
,
null
,
2
),
"
_data
"
:
body
,
//
JSON.stringify(data, null, 2),
"
_mimetype
"
:
"
application/json
"
});
})
...
...
dream/platform/src/jsplumb/jsplumb.js
View file @
60c7da6b
This diff is collapsed.
Click to expand it.
dream/platform/src/toolbox/toolbox.js
View file @
60c7da6b
...
...
@@ -42,13 +42,14 @@
tools_container
.
className
=
'
tools-container
'
;
Object
.
keys
(
data
.
class_definition
).
forEach
(
function
(
key
)
{
var
_class
=
data
.
class_definition
[
key
],
tool
;
// XXX "expand" the json schema "allOF" etc
if
(
_class
.
_class
===
'
node
'
)
{
tool
=
document
.
createElement
(
'
div
'
);
// XXX maybe allow to configure the class name ?
tool
.
className
=
"
tool
"
+
key
;
tool
.
textContent
=
_class
.
name
||
key
;
tool
.
draggable
=
true
;
tool
.
dataset
.
class_definition
=
JSON
.
stringify
(
_class
);
tool
.
dataset
.
class_definition
=
JSON
.
stringify
(
[
key
,
_class
]
);
Object
.
keys
(
_class
.
css
||
{}).
forEach
(
function
(
k
)
{
tool
.
style
[
k
]
=
_class
.
css
[
k
];
});
...
...
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