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
b2d0aa6e
Commit
b2d0aa6e
authored
Oct 28, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove save button. Save data each time it is modified
parent
9d0d47d2
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
159 additions
and
34 deletions
+159
-34
dream/platform/src/dream/Input_viewAvailableCapacitySpreadsheet.js
...tform/src/dream/Input_viewAvailableCapacitySpreadsheet.js
+17
-3
dream/platform/src/dream/Input_viewDemandPlanningCapacitySpreadsheet.js
.../src/dream/Input_viewDemandPlanningCapacitySpreadsheet.js
+17
-3
dream/platform/src/dream/Input_viewDemandPlanningRouteSpreadsheet.js
...orm/src/dream/Input_viewDemandPlanningRouteSpreadsheet.js
+17
-3
dream/platform/src/dream/Input_viewProductionLine.html
dream/platform/src/dream/Input_viewProductionLine.html
+1
-0
dream/platform/src/dream/Input_viewProductionLine.js
dream/platform/src/dream/Input_viewProductionLine.js
+15
-4
dream/platform/src/dream/Input_viewRequiredCapacitySpreadsheet.js
...atform/src/dream/Input_viewRequiredCapacitySpreadsheet.js
+17
-3
dream/platform/src/dream/Input_viewShiftSpreadsheet.js
dream/platform/src/dream/Input_viewShiftSpreadsheet.js
+17
-3
dream/platform/src/dream/Input_viewSimulation.html
dream/platform/src/dream/Input_viewSimulation.html
+1
-1
dream/platform/src/dream/Input_viewSimulation.js
dream/platform/src/dream/Input_viewSimulation.js
+1
-1
dream/platform/src/dream/Input_viewWipPartSpreadsheet.js
dream/platform/src/dream/Input_viewWipPartSpreadsheet.js
+17
-3
dream/platform/src/dream/index.less
dream/platform/src/dream/index.less
+5
-0
dream/platform/src/jsplumb/index.html
dream/platform/src/jsplumb/index.html
+1
-0
dream/platform/src/jsplumb/jsplumb.js
dream/platform/src/jsplumb/jsplumb.js
+10
-10
dream/platform/src/lib/pubsub.js
dream/platform/src/lib/pubsub.js
+23
-0
No files found.
dream/platform/src/dream/Input_viewAvailableCapacitySpreadsheet.js
View file @
b2d0aa6e
...
...
@@ -9,7 +9,9 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
// Prevent double click
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
}
return
gadget
.
getDeclaredGadget
(
"
tableeditor
"
);
})
.
push
(
function
(
tablegadget
)
{
...
...
@@ -35,7 +37,9 @@
});
})
.
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
...
...
@@ -81,7 +85,17 @@
JSON
.
stringify
(
JSON
.
parse
(
result_list
[
0
])
.
capacity_by_station_spreadsheet
),
{
minSpareCols
:
1
,
minSpareRows
:
1
}
minSpareRows
:
1
,
onChange
:
function
()
{
if
(
gadget
.
timeout
)
{
window
.
clearTimeout
(
gadget
.
timeout
);
}
gadget
.
timeout
=
window
.
setTimeout
(
saveSpreadsheet
.
bind
(
gadget
),
100
);
}
}
);
});
})
...
...
dream/platform/src/dream/Input_viewDemandPlanningCapacitySpreadsheet.js
View file @
b2d0aa6e
...
...
@@ -9,7 +9,9 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
// Prevent double click
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
}
return
gadget
.
getDeclaredGadget
(
"
tableeditor
"
);
})
.
push
(
function
(
tablegadget
)
{
...
...
@@ -35,7 +37,9 @@
});
})
.
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
...
...
@@ -81,7 +85,17 @@
JSON
.
stringify
(
JSON
.
parse
(
result_list
[
0
])
.
dp_capacity_spreadsheet
),
{
minSpareCols
:
1
,
minSpareRows
:
1
}
minSpareRows
:
1
,
onChange
:
function
()
{
if
(
gadget
.
timeout
)
{
window
.
clearTimeout
(
gadget
.
timeout
);
}
gadget
.
timeout
=
window
.
setTimeout
(
saveSpreadsheet
.
bind
(
gadget
),
100
);
}
}
);
});
})
...
...
dream/platform/src/dream/Input_viewDemandPlanningRouteSpreadsheet.js
View file @
b2d0aa6e
...
...
@@ -9,7 +9,9 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
// Prevent double click
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
}
return
gadget
.
getDeclaredGadget
(
"
tableeditor
"
);
})
.
push
(
function
(
tablegadget
)
{
...
...
@@ -35,7 +37,9 @@
});
})
.
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
...
...
@@ -81,7 +85,17 @@
JSON
.
stringify
(
JSON
.
parse
(
result_list
[
0
])
.
dp_route_spreadsheet
),
{
minSpareCols
:
1
,
minSpareRows
:
1
}
minSpareRows
:
1
,
onChange
:
function
()
{
if
(
gadget
.
timeout
)
{
window
.
clearTimeout
(
gadget
.
timeout
);
}
gadget
.
timeout
=
window
.
setTimeout
(
saveSpreadsheet
.
bind
(
gadget
),
100
);
}
}
);
});
})
...
...
dream/platform/src/dream/Input_viewProductionLine.html
View file @
b2d0aa6e
...
...
@@ -6,6 +6,7 @@
<title>
Edit table
</title>
<script
src=
"../<%= copy.rsvp.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= copy.renderjs.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../lib/pubsub.js"
type=
"text/javascript"
></script>
<script
src=
"mixin_promise.js"
type=
"text/javascript"
></script>
...
...
dream/platform/src/dream/Input_viewProductionLine.js
View file @
b2d0aa6e
...
...
@@ -9,7 +9,9 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
// Prevent double click
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
}
return
gadget
.
getDeclaredGadget
(
"
productionline_graph
"
);
})
.
push
(
function
(
graph_gadget
)
{
...
...
@@ -25,11 +27,11 @@
})
.
push
(
function
(
body
)
{
var
data
=
JSON
.
parse
(
body
),
json_graph_data
=
JSON
.
parse
(
graph_data
);
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
s
;
data
.
preference
=
json_graph_data
.
preference
;
return
gadget
.
aq_putAttachment
({
"
_id
"
:
gadget
.
props
.
jio_key
,
...
...
@@ -39,7 +41,9 @@
});
})
.
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
...
...
@@ -94,6 +98,13 @@
.
declareMethod
(
"
startService
"
,
function
()
{
var
g
=
this
,
graph
;
// save automatically
window
.
$
.
subscribe
(
"
Dream.Gui.onDataChange
"
,
function
()
{
if
(
g
.
timeout
)
{
window
.
clearTimeout
(
g
.
timeout
);
}
g
.
timeout
=
window
.
setTimeout
(
saveGraph
.
bind
(
g
),
100
);
});
return
g
.
getDeclaredGadget
(
"
productionline_graph
"
)
.
push
(
function
(
graph_gadget
)
{
graph
=
graph_gadget
;
...
...
dream/platform/src/dream/Input_viewRequiredCapacitySpreadsheet.js
View file @
b2d0aa6e
...
...
@@ -9,7 +9,9 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
// Prevent double click
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
}
return
gadget
.
getDeclaredGadget
(
"
tableeditor
"
);
})
.
push
(
function
(
tablegadget
)
{
...
...
@@ -35,7 +37,9 @@
});
})
.
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
...
...
@@ -80,7 +84,17 @@
return
result_list
[
1
].
render
(
JSON
.
stringify
(
JSON
.
parse
(
result_list
[
0
])
.
capacity_by_project_spreadsheet
),
{
minSpareRows
:
1
}
{
minSpareRows
:
1
,
onChange
:
function
()
{
if
(
gadget
.
timeout
)
{
window
.
clearTimeout
(
gadget
.
timeout
);
}
gadget
.
timeout
=
window
.
setTimeout
(
saveSpreadsheet
.
bind
(
gadget
),
100
);
}
}
);
});
})
...
...
dream/platform/src/dream/Input_viewShiftSpreadsheet.js
View file @
b2d0aa6e
...
...
@@ -9,7 +9,9 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
// Prevent double click
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
}
return
gadget
.
getDeclaredGadget
(
"
tableeditor
"
);
})
.
push
(
function
(
tablegadget
)
{
...
...
@@ -35,7 +37,9 @@
});
})
.
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
...
...
@@ -79,7 +83,17 @@
.
push
(
function
(
result_list
)
{
return
result_list
[
1
].
render
(
JSON
.
stringify
(
JSON
.
parse
(
result_list
[
0
]).
shift_spreadsheet
),
{
minSpareRows
:
1
}
{
minSpareRows
:
1
,
onChange
:
function
()
{
if
(
gadget
.
timeout
)
{
window
.
clearTimeout
(
gadget
.
timeout
);
}
gadget
.
timeout
=
window
.
setTimeout
(
saveSpreadsheet
.
bind
(
gadget
),
100
);
}
}
);
});
})
...
...
dream/platform/src/dream/Input_viewSimulation.html
View file @
b2d0aa6e
...
...
@@ -19,7 +19,7 @@
<script
src=
"Input_viewSimulation.js"
type=
"text/javascript"
></script>
</head>
<body>
<form
class=
"
save
_form"
>
<form
class=
"
run
_form"
>
<fieldset>
<div
data-gadget-url=
"../fieldset/index.html"
data-gadget-scope=
"fieldset"
></div>
...
...
dream/platform/src/dream/Input_viewSimulation.js
View file @
b2d0aa6e
...
...
@@ -76,7 +76,7 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
promiseEventListener
(
gadget
.
props
.
element
.
getElementsByClassName
(
"
save
_form
"
)[
0
],
gadget
.
props
.
element
.
getElementsByClassName
(
"
run
_form
"
)[
0
],
'
submit
'
,
false
);
...
...
dream/platform/src/dream/Input_viewWipPartSpreadsheet.js
View file @
b2d0aa6e
...
...
@@ -9,7 +9,9 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
// Prevent double click
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
true
;
}
return
gadget
.
getDeclaredGadget
(
"
tableeditor
"
);
})
.
push
(
function
(
tablegadget
)
{
...
...
@@ -35,7 +37,9 @@
});
})
.
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
...
...
@@ -79,7 +83,17 @@
.
push
(
function
(
result_list
)
{
return
result_list
[
1
].
render
(
JSON
.
stringify
(
JSON
.
parse
(
result_list
[
0
]).
wip_part_spreadsheet
),
{
minSpareRows
:
1
}
{
minSpareRows
:
1
,
onChange
:
function
()
{
if
(
gadget
.
timeout
)
{
window
.
clearTimeout
(
gadget
.
timeout
);
}
gadget
.
timeout
=
window
.
setTimeout
(
saveSpreadsheet
.
bind
(
gadget
),
100
);
}
}
);
});
})
...
...
dream/platform/src/dream/index.less
View file @
b2d0aa6e
...
...
@@ -59,3 +59,8 @@
width: 79.5%;
float: right;
}
// XXX disable save button for now
form.save_form {
display: none;
}
dream/platform/src/jsplumb/index.html
View file @
b2d0aa6e
...
...
@@ -11,6 +11,7 @@
<script
src=
"../<%= copy.renderjs.relative_dest %>"
></script>
<script
src=
"../<%= curl.jsplumbjs.relative_dest %>"
></script>
<script
src=
"../<%= copy.handlebars.relative_dest %>"
></script>
<script
src=
"../lib/pubsub.js"
type=
"text/javascript"
></script>
<script
id=
"node-template"
type=
"text/x-handlebars-template"
>
<
div
class
=
"
window {{class}}
"
...
...
dream/platform/src/jsplumb/jsplumb.js
View file @
b2d0aa6e
...
...
@@ -77,7 +77,6 @@
return
new
RSVP
.
Promise
(
itsANonResolvableTrap
,
canceller
);
}
function
getNodeId
(
node_container
,
element_id
)
{
var
node_id
;
$
.
each
(
node_container
,
function
(
k
,
v
)
{
...
...
@@ -111,9 +110,10 @@
return
'
DreamNode_
'
+
n
;
}
function
onDataChange
()
{
//$.publish("Dream.Gui.onDataChange", g.private.getData());
return
undefined
;
function
onDataChange
(
g
)
{
g
.
getData
().
then
(
function
(
data
)
{
$
.
publish
(
"
Dream.Gui.onDataChange
"
,
data
);
});
}
function
updateConnectionData
(
gadget
,
connection
,
remove
,
edge_data
)
{
...
...
@@ -126,7 +126,7 @@
edge_data
||
{}
];
}
onDataChange
();
onDataChange
(
gadget
);
}
// bind to connection/connectionDetached events,
...
...
@@ -202,7 +202,7 @@
}
coordinates
[
node_id
]
=
coordinate
;
gadget
.
props
.
preference_container
.
coordinates
=
coordinates
;
onDataChange
();
onDataChange
(
gadget
);
return
coordinate
;
}
...
...
@@ -283,7 +283,7 @@
// });
// split in 2 methods ? one for events one for manip
onDataChange
();
onDataChange
(
gadget
);
draggable
(
gadget
);
}
...
...
@@ -399,7 +399,7 @@
delete
gadget
.
props
.
edge_container
[
k
];
}
});
onDataChange
();
onDataChange
(
gadget
);
}
function
updateElementData
(
gadget
,
node_id
,
data
)
{
...
...
@@ -429,7 +429,7 @@
=
gadget
.
props
.
preference_container
.
coordinates
[
node_id
];
delete
gadget
.
props
.
preference_container
.
coordinates
[
node_id
];
}
onDataChange
();
onDataChange
(
gadget
);
}
// function clearAll(gadget) {
...
...
@@ -642,7 +642,7 @@
box
.
css
(
"
left
"
,
absolute_position
[
0
]);
updateNodeStyle
(
gadget
,
element
.
element_id
);
draggable
(
gadget
);
onDataChange
();
onDataChange
(
gadget
);
}
function
waitForDragover
(
gadget
)
{
...
...
dream/platform/src/lib/pubsub.js
0 → 100644
View file @
b2d0aa6e
/*global jQuery */
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(
function
(
$
)
{
"
use strict
"
;
var
o
=
$
({});
$
.
subscribe
=
function
()
{
o
.
on
.
apply
(
o
,
arguments
);
};
$
.
unsubscribe
=
function
()
{
o
.
off
.
apply
(
o
,
arguments
);
};
$
.
publish
=
function
()
{
o
.
trigger
.
apply
(
o
,
arguments
);
};
}(
jQuery
));
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