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
f147f800
Commit
f147f800
authored
Nov 25, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jslint
parent
20d45a93
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
93 deletions
+94
-93
dream/platform/src/fieldset/fieldset.js
dream/platform/src/fieldset/fieldset.js
+2
-3
dream/platform/src/jsplumb/jsplumb.js
dream/platform/src/jsplumb/jsplumb.js
+10
-8
dream/platform/src/jsplumb/test.js
dream/platform/src/jsplumb/test.js
+81
-81
dream/platform/static/dream/Input_viewProductionLine.js
dream/platform/static/dream/Input_viewProductionLine.js
+1
-1
No files found.
dream/platform/src/fieldset/fieldset.js
View file @
f147f800
...
@@ -21,8 +21,7 @@
...
@@ -21,8 +21,7 @@
// XXX node_id is added like a property so that one can change the node
// XXX node_id is added like a property so that one can change the node
// id
// id
var
gadget
=
this
,
var
gadget
=
this
,
queue
,
queue
;
property
;
gadget
.
props
.
key
=
options
.
key
;
// used for recursive fieldsets
gadget
.
props
.
key
=
options
.
key
;
// used for recursive fieldsets
gadget
.
props
.
field_gadget_list
=
[];
gadget
.
props
.
field_gadget_list
=
[];
...
@@ -78,7 +77,7 @@
...
@@ -78,7 +77,7 @@
).
forEach
(
function
(
property_name
)
{
).
forEach
(
function
(
property_name
)
{
var
property_definition
=
var
property_definition
=
options
.
property_definition
.
properties
[
property_name
],
options
.
property_definition
.
properties
[
property_name
],
value
=
(
options
.
value
||
{})[
property_name
]
===
undefined
value
=
(
options
.
value
||
{})[
property_name
]
===
undefined
?
property_definition
.
_default
:
options
.
value
[
property_name
];
?
property_definition
.
_default
:
options
.
value
[
property_name
];
// XXX some properties are not editable
// XXX some properties are not editable
if
(
property_name
!==
'
coordinate
'
&&
property_name
!==
'
_class
'
)
{
if
(
property_name
!==
'
coordinate
'
&&
property_name
!==
'
_class
'
)
{
...
...
dream/platform/src/jsplumb/jsplumb.js
View file @
f147f800
...
@@ -416,7 +416,7 @@
...
@@ -416,7 +416,7 @@
function
expandSchema
(
class_definition
,
full_schema
)
{
function
expandSchema
(
class_definition
,
full_schema
)
{
// minimal expanding of json schema, supports merging allOf and $ref
// minimal expanding of json schema, supports merging allOf and $ref
// references
// references
var
name
,
property
,
referenced
,
i
,
var
property
,
referenced
,
i
,
expanded_class_definition
=
{
properties
:
expanded_class_definition
=
{
properties
:
class_definition
.
properties
||
{}};
class_definition
.
properties
||
{}};
if
(
class_definition
.
allOf
)
{
if
(
class_definition
.
allOf
)
{
...
@@ -429,10 +429,14 @@
...
@@ -429,10 +429,14 @@
],
],
full_schema
);
full_schema
);
}
}
for
(
property
in
(
referenced
.
properties
||
[]))
{
if
(
referenced
.
properties
)
{
if
(
referenced
.
properties
[
property
].
type
)
{
for
(
property
in
referenced
.
properties
)
{
expanded_class_definition
.
properties
[
property
]
if
(
referenced
.
properties
.
hasOwnProperty
(
property
))
{
=
referenced
.
properties
[
property
];
if
(
referenced
.
properties
[
property
].
type
)
{
expanded_class_definition
.
properties
[
property
]
=
referenced
.
properties
[
property
];
}
}
}
}
}
}
}
}
...
@@ -551,7 +555,7 @@
...
@@ -551,7 +555,7 @@
gadget
.
props
.
data
.
graph
.
node
[
node_id
]
=
node_data
;
gadget
.
props
.
data
.
graph
.
node
[
node_id
]
=
node_data
;
if
(
coordinate
===
undefined
)
{
if
(
coordinate
===
undefined
)
{
coordinate
=
{
top
:
0
,
left
:
0
}
coordinate
=
{
top
:
0
,
left
:
0
}
;
}
}
node_data
.
coordinate
=
updateElementCoordinate
(
node_data
.
coordinate
=
updateElementCoordinate
(
...
@@ -621,7 +625,6 @@
...
@@ -621,7 +625,6 @@
reject
(
e
);
reject
(
e
);
}
}
};
};
gadget
.
props
.
main
.
addEventListener
(
'
drop
'
,
callback
,
false
);
gadget
.
props
.
main
.
addEventListener
(
'
drop
'
,
callback
,
false
);
}
}
...
@@ -664,7 +667,6 @@
...
@@ -664,7 +667,6 @@
this
.
props
.
main
=
this
.
props
.
element
.
querySelector
(
'
#main
'
);
this
.
props
.
main
=
this
.
props
.
element
.
querySelector
(
'
#main
'
);
initJsPlumb
(
this
);
initJsPlumb
(
this
);
this
.
props
.
nodes_click_monitor
=
RSVP
.
Monitor
();
this
.
props
.
nodes_click_monitor
=
RSVP
.
Monitor
();
$
.
each
(
this
.
props
.
data
.
graph
.
node
,
function
(
key
,
value
)
{
$
.
each
(
this
.
props
.
data
.
graph
.
node
,
function
(
key
,
value
)
{
addNode
(
gadget
,
key
,
value
);
addNode
(
gadget
,
key
,
value
);
});
});
...
...
dream/platform/src/jsplumb/test.js
View file @
f147f800
/*global rJS, JSON, QUnit, jQuery*/
/*global rJS, JSON, QUnit, jQuery
, RSVP, console
*/
(
function
(
rJS
,
JSON
,
QUnit
,
$
)
{
(
function
(
rJS
,
JSON
,
QUnit
,
RSVP
)
{
"
use strict
"
;
"
use strict
"
;
var
start
=
QUnit
.
start
,
var
start
=
QUnit
.
start
,
stop
=
QUnit
.
stop
,
stop
=
QUnit
.
stop
,
test
=
QUnit
.
test
,
test
=
QUnit
.
test
,
equal
=
QUnit
.
equal
,
equal
=
QUnit
.
equal
,
sample_class_definition
=
{
sample_class_definition
=
{
"
edge
"
:
{
"
edge
"
:
{
"
description
"
:
"
Base definition for edge
"
,
"
description
"
:
"
Base definition for edge
"
,
"
properties
"
:
{
"
properties
"
:
{
"
_class
"
:
{
"
_class
"
:
{
"
type
"
:
"
string
"
"
type
"
:
"
string
"
},
},
"
destination
"
:
{
"
destination
"
:
{
"
type
"
:
"
string
"
"
type
"
:
"
string
"
},
},
"
name
"
:
{
"
name
"
:
{
"
type
"
:
"
string
"
"
type
"
:
"
string
"
},
},
"
required
"
:
[
"
required
"
:
[
"
name
"
,
"
name
"
,
"
_class
"
,
"
_class
"
,
"
source
"
,
"
source
"
,
"
destination
"
"
destination
"
],
],
"
source
"
:
{
"
source
"
:
{
"
type
"
:
"
string
"
"
type
"
:
"
string
"
}
}
},
"
type
"
:
"
object
"
},
"
Example.Edge
"
:
{
"
_class
"
:
"
edge
"
,
"
allOf
"
:
[
{
"
$ref
"
:
"
#edge
"
},
{
"
properties
"
:
{
"
color
"
:
{
"
enum
"
:
[
"
red
"
,
"
green
"
,
"
blue
"
]
}
}
}
],
"
description
"
:
"
An example edge with a color property
"
},
"
Example.Node
"
:
{
"
_class
"
:
"
node
"
,
"
allOf
"
:
[
{
"
$ref
"
:
"
#node
"
},
{
"
properties
"
:
{
"
shape
"
:
{
"
type
"
:
"
string
"
}
}
}
],
"
description
"
:
"
An example node with a shape property
"
},
},
"
node
"
:
{
"
type
"
:
"
object
"
"
description
"
:
"
Base definition for node
"
,
},
"
Example.Edge
"
:
{
"
_class
"
:
"
edge
"
,
"
allOf
"
:
[
{
"
$ref
"
:
"
#edge
"
},
{
"
properties
"
:
{
"
properties
"
:
{
"
_class
"
:
{
"
color
"
:
{
"
type
"
:
"
string
"
"
enum
"
:
[
},
"
red
"
,
"
coordinate
"
:
{
"
green
"
,
"
properties
"
:
{
"
blue
"
"
left
"
:
"
number
"
,
"
top
"
:
"
number
"
},
"
type
"
:
"
object
"
},
"
name
"
:
{
"
type
"
:
"
string
"
},
"
required
"
:
[
"
name
"
,
"
_class
"
]
]
}
}
}
],
"
description
"
:
"
An example edge with a color property
"
},
"
Example.Node
"
:
{
"
_class
"
:
"
node
"
,
"
allOf
"
:
[
{
"
$ref
"
:
"
#node
"
},
{
"
properties
"
:
{
"
shape
"
:
{
"
type
"
:
"
string
"
}
}
}
],
"
description
"
:
"
An example node with a shape property
"
},
"
node
"
:
{
"
description
"
:
"
Base definition for node
"
,
"
properties
"
:
{
"
_class
"
:
{
"
type
"
:
"
string
"
},
"
coordinate
"
:
{
"
properties
"
:
{
"
left
"
:
"
number
"
,
"
top
"
:
"
number
"
},
},
"
type
"
:
"
object
"
"
type
"
:
"
object
"
}
},
"
name
"
:
{
"
type
"
:
"
string
"
},
"
required
"
:
[
"
name
"
,
"
_class
"
]
},
"
type
"
:
"
object
"
}
},
},
sample_graph
=
{
sample_graph
=
{
"
edge
"
:
{
"
edge
"
:
{
...
@@ -185,4 +185,4 @@
...
@@ -185,4 +185,4 @@
});
});
}(
rJS
,
JSON
,
QUnit
,
jQuery
));
}(
rJS
,
JSON
,
QUnit
,
RSVP
));
dream/platform/static/dream/Input_viewProductionLine.js
View file @
f147f800
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
"
use strict
"
;
"
use strict
"
;
var
gadget_klass
=
rJS
(
window
);
var
gadget_klass
=
rJS
(
window
);
function
saveGraph
(
evt
)
{
function
saveGraph
(
evt
)
{
var
gadget
=
this
,
graph_data
;
var
gadget
=
this
;
return
new
RSVP
.
Queue
().
push
(
function
()
{
return
new
RSVP
.
Queue
().
push
(
function
()
{
// Prevent double click
// Prevent double click
if
(
evt
)
{
if
(
evt
)
{
...
...
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