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
88bfb6c0
Commit
88bfb6c0
authored
Oct 28, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update static version
parent
b2d0aa6e
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
139 additions
and
31 deletions
+139
-31
dream/platform/static/dream/InputModule_viewInputList.js
dream/platform/static/dream/InputModule_viewInputList.js
+5
-1
dream/platform/static/dream/Input_viewAvailableCapacitySpreadsheet.js
...rm/static/dream/Input_viewAvailableCapacitySpreadsheet.js
+13
-3
dream/platform/static/dream/Input_viewDemandPlanningCapacitySpreadsheet.js
...atic/dream/Input_viewDemandPlanningCapacitySpreadsheet.js
+13
-3
dream/platform/static/dream/Input_viewDemandPlanningRouteSpreadsheet.js
.../static/dream/Input_viewDemandPlanningRouteSpreadsheet.js
+13
-3
dream/platform/static/dream/Input_viewProductionLine.html
dream/platform/static/dream/Input_viewProductionLine.html
+1
-0
dream/platform/static/dream/Input_viewProductionLine.js
dream/platform/static/dream/Input_viewProductionLine.js
+19
-9
dream/platform/static/dream/Input_viewRequiredCapacitySpreadsheet.js
...orm/static/dream/Input_viewRequiredCapacitySpreadsheet.js
+13
-3
dream/platform/static/dream/Input_viewShiftSpreadsheet.js
dream/platform/static/dream/Input_viewShiftSpreadsheet.js
+13
-3
dream/platform/static/dream/Input_viewSimulation.html
dream/platform/static/dream/Input_viewSimulation.html
+1
-1
dream/platform/static/dream/Input_viewSimulation.js
dream/platform/static/dream/Input_viewSimulation.js
+1
-1
dream/platform/static/dream/Input_viewWipPartSpreadsheet.js
dream/platform/static/dream/Input_viewWipPartSpreadsheet.js
+13
-3
dream/platform/static/dream/index.css
dream/platform/static/dream/index.css
+1
-1
dream/platform/static/jsplumb/index.html
dream/platform/static/jsplumb/index.html
+1
-0
dream/platform/static/jsplumb/jsplumb.js
dream/platform/static/jsplumb/jsplumb.js
+15
-0
dream/platform/static/lib/pubsub.js
dream/platform/static/lib/pubsub.js
+17
-0
No files found.
dream/platform/static/dream/InputModule_viewInputList.js
View file @
88bfb6c0
...
...
@@ -31,9 +31,13 @@
doc
=
document_list
[
i
];
parameter_list
[
i
]
=
{
link
:
doc
[
0
],
title
:
doc
[
1
]
+
"
(
"
+
doc
[
2
]
+
"
)
"
title
:
doc
[
1
]
+
"
(
"
+
doc
[
2
]
+
"
)
"
,
date
:
new
Date
(
doc
[
2
])
};
}
parameter_list
.
sort
(
function
(
a
,
b
)
{
return
b
.
date
-
a
.
date
;
});
// gadget.props.element.querySelector('a').href = document_list[0];
gadget
.
props
.
element
.
querySelector
(
"
.document_list
"
).
innerHTML
=
table_template
({
documentlist
:
parameter_list
...
...
dream/platform/static/dream/Input_viewAvailableCapacitySpreadsheet.js
View file @
88bfb6c0
...
...
@@ -5,7 +5,9 @@
var
gadget
=
this
,
editor_data
,
editor_gadget
;
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
)
{
editor_gadget
=
tablegadget
;
...
...
@@ -27,7 +29,9 @@
_mimetype
:
"
application/json
"
});
}).
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
function
waitForSave
(
gadget
)
{
...
...
@@ -46,7 +50,13 @@
}).
push
(
function
(
result_list
)
{
return
result_list
[
1
].
render
(
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
);
}
});
});
}).
declareMethod
(
"
startService
"
,
function
()
{
...
...
dream/platform/static/dream/Input_viewDemandPlanningCapacitySpreadsheet.js
View file @
88bfb6c0
...
...
@@ -5,7 +5,9 @@
var
gadget
=
this
,
editor_data
,
editor_gadget
;
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
)
{
editor_gadget
=
tablegadget
;
...
...
@@ -27,7 +29,9 @@
_mimetype
:
"
application/json
"
});
}).
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
function
waitForSave
(
gadget
)
{
...
...
@@ -46,7 +50,13 @@
}).
push
(
function
(
result_list
)
{
return
result_list
[
1
].
render
(
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
);
}
});
});
}).
declareMethod
(
"
startService
"
,
function
()
{
...
...
dream/platform/static/dream/Input_viewDemandPlanningRouteSpreadsheet.js
View file @
88bfb6c0
...
...
@@ -5,7 +5,9 @@
var
gadget
=
this
,
editor_data
,
editor_gadget
;
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
)
{
editor_gadget
=
tablegadget
;
...
...
@@ -27,7 +29,9 @@
_mimetype
:
"
application/json
"
});
}).
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
function
waitForSave
(
gadget
)
{
...
...
@@ -46,7 +50,13 @@
}).
push
(
function
(
result_list
)
{
return
result_list
[
1
].
render
(
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
);
}
});
});
}).
declareMethod
(
"
startService
"
,
function
()
{
...
...
dream/platform/static/dream/Input_viewProductionLine.html
View file @
88bfb6c0
...
...
@@ -6,6 +6,7 @@
<title>
Edit table
</title>
<script
src=
"../lib/rsvp.min.js"
type=
"text/javascript"
></script>
<script
src=
"../lib/renderjs.min.js"
type=
"text/javascript"
></script>
<script
src=
"../lib/pubsub.js"
type=
"text/javascript"
></script>
<script
src=
"mixin_promise.js"
type=
"text/javascript"
></script>
...
...
dream/platform/static/dream/Input_viewProductionLine.js
View file @
88bfb6c0
...
...
@@ -3,13 +3,14 @@
"
use strict
"
;
var
gadget_klass
=
rJS
(
window
);
function
saveGraph
(
evt
)
{
var
gadget
=
this
,
graph_data
,
graph_gadget
;
var
gadget
=
this
,
graph_data
;
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
(
graphgadget
)
{
graph_gadget
=
graphgadget
;
}).
push
(
function
(
graph_gadget
)
{
return
graph_gadget
.
getData
();
}).
push
(
function
(
data
)
{
graph_data
=
data
;
...
...
@@ -19,10 +20,10 @@
_attachment
:
"
body.json
"
});
}).
push
(
function
(
body
)
{
var
data
=
JSON
.
parse
(
body
);
data
.
nodes
=
JSON
.
parse
(
graph_data
)
.
nodes
;
data
.
edges
=
JSON
.
parse
(
graph_data
)
.
edges
;
data
.
preference
=
JSON
.
parse
(
graph_data
)
.
preference
;
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
;
return
gadget
.
aq_putAttachment
({
_id
:
gadget
.
props
.
jio_key
,
_attachment
:
"
body.json
"
,
...
...
@@ -30,7 +31,9 @@
_mimetype
:
"
application/json
"
});
}).
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
function
waitForSave
(
gadget
)
{
...
...
@@ -60,6 +63,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
;
return
g
.
getDeclaredGadget
(
"
productionline_toolbox
"
);
...
...
dream/platform/static/dream/Input_viewRequiredCapacitySpreadsheet.js
View file @
88bfb6c0
...
...
@@ -5,7 +5,9 @@
var
gadget
=
this
,
editor_data
,
editor_gadget
;
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
)
{
editor_gadget
=
tablegadget
;
...
...
@@ -27,7 +29,9 @@
_mimetype
:
"
application/json
"
});
}).
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
function
waitForSave
(
gadget
)
{
...
...
@@ -45,7 +49,13 @@
}),
gadget
.
getDeclaredGadget
(
"
tableeditor
"
)
]);
}).
push
(
function
(
result_list
)
{
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
);
}
});
});
}).
declareMethod
(
"
startService
"
,
function
()
{
...
...
dream/platform/static/dream/Input_viewShiftSpreadsheet.js
View file @
88bfb6c0
...
...
@@ -5,7 +5,9 @@
var
gadget
=
this
,
editor_data
,
editor_gadget
;
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
)
{
editor_gadget
=
tablegadget
;
...
...
@@ -27,7 +29,9 @@
_mimetype
:
"
application/json
"
});
}).
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
function
waitForSave
(
gadget
)
{
...
...
@@ -45,7 +49,13 @@
}),
gadget
.
getDeclaredGadget
(
"
tableeditor
"
)
]);
}).
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
);
}
});
});
}).
declareMethod
(
"
startService
"
,
function
()
{
...
...
dream/platform/static/dream/Input_viewSimulation.html
View file @
88bfb6c0
...
...
@@ -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/static/dream/Input_viewSimulation.js
View file @
88bfb6c0
...
...
@@ -60,7 +60,7 @@
function
waitForRunSimulation
(
gadget
)
{
var
submit_evt
;
return
new
RSVP
.
Queue
().
push
(
function
()
{
return
promiseEventListener
(
gadget
.
props
.
element
.
getElementsByClassName
(
"
save
_form
"
)[
0
],
"
submit
"
,
false
);
return
promiseEventListener
(
gadget
.
props
.
element
.
getElementsByClassName
(
"
run
_form
"
)[
0
],
"
submit
"
,
false
);
}).
push
(
function
(
evt
)
{
submit_evt
=
evt
;
// Prevent double click
...
...
dream/platform/static/dream/Input_viewWipPartSpreadsheet.js
View file @
88bfb6c0
...
...
@@ -5,7 +5,9 @@
var
gadget
=
this
,
editor_data
,
editor_gadget
;
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
)
{
editor_gadget
=
tablegadget
;
...
...
@@ -27,7 +29,9 @@
_mimetype
:
"
application/json
"
});
}).
push
(
function
()
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
if
(
evt
)
{
evt
.
target
.
getElementsByClassName
(
"
ui-btn
"
)[
0
].
disabled
=
false
;
}
});
}
function
waitForSave
(
gadget
)
{
...
...
@@ -45,7 +49,13 @@
}),
gadget
.
getDeclaredGadget
(
"
tableeditor
"
)
]);
}).
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
);
}
});
});
}).
declareMethod
(
"
startService
"
,
function
()
{
...
...
dream/platform/static/dream/index.css
View file @
88bfb6c0
@media
(
min-width
:
110em
){
.jqm-navmenu-panel.ui-panel-closed
{
visibility
:
visible
!important
;
width
:
17em
;
-webkit-transition
:
none
!important
;
-moz-transition
:
none
!important
;
transition
:
none
!important
;
-webkit-transform
:
none
!important
;
-moz-transform
:
none
!important
;
transform
:
none
!important
;
-webkit-box-shadow
:
none
;
-moz-box-shadow
:
none
;
box-shadow
:
none
;
height
:
100%
;
position
:
absolute
;
display
:
block
}
.ui-panel-page-content-open
{
width
:
auto
}
.ui-panel-page-content-open.ui-panel-page-content-position-left
{
margin-right
:
17em
}
.ui-panel-dismiss
,
.menu_link
{
display
:
none
!important
}
.gadget_container
,
header
,
nav
{
margin-left
:
17em
}
.close-entry
{
display
:
none
!important
}
.gadget_container
{
padding
:
1em
}}
[
data-gadget-scope
=
productionline_toolbox
]
{
position
:
relative
;
width
:
19.5%
;
float
:
left
}
[
data-gadget-scope
=
productionline_graph
]
{
position
:
relative
;
width
:
79.5%
;
float
:
right
}
\ No newline at end of file
@media
(
min-width
:
110em
){
.jqm-navmenu-panel.ui-panel-closed
{
visibility
:
visible
!important
;
width
:
17em
;
-webkit-transition
:
none
!important
;
-moz-transition
:
none
!important
;
transition
:
none
!important
;
-webkit-transform
:
none
!important
;
-moz-transform
:
none
!important
;
transform
:
none
!important
;
-webkit-box-shadow
:
none
;
-moz-box-shadow
:
none
;
box-shadow
:
none
;
height
:
100%
;
position
:
absolute
;
display
:
block
}
.ui-panel-page-content-open
{
width
:
auto
}
.ui-panel-page-content-open.ui-panel-page-content-position-left
{
margin-right
:
17em
}
.ui-panel-dismiss
,
.menu_link
{
display
:
none
!important
}
.gadget_container
,
header
,
nav
{
margin-left
:
17em
}
.close-entry
{
display
:
none
!important
}
.gadget_container
{
padding
:
1em
}}
[
data-gadget-scope
=
productionline_toolbox
]
{
position
:
relative
;
width
:
19.5%
;
float
:
left
}
[
data-gadget-scope
=
productionline_graph
]
{
position
:
relative
;
width
:
79.5%
;
float
:
right
}
form
.save_form
{
display
:
none
}
\ No newline at end of file
dream/platform/static/jsplumb/index.html
View file @
88bfb6c0
...
...
@@ -11,6 +11,7 @@
<script
src=
"../lib/renderjs.min.js"
></script>
<script
src=
"../lib/jquery.jsplumb.min.js"
></script>
<script
src=
"../lib/handlebars.min.js"
></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/static/jsplumb/jsplumb.js
View file @
88bfb6c0
...
...
@@ -84,12 +84,18 @@
}
return
"
DreamNode_
"
+
n
;
}
function
onDataChange
(
g
)
{
g
.
getData
().
then
(
function
(
data
)
{
$
.
publish
(
"
Dream.Gui.onDataChange
"
,
data
);
});
}
function
updateConnectionData
(
gadget
,
connection
,
remove
,
edge_data
)
{
if
(
remove
)
{
delete
gadget
.
props
.
edge_container
[
connection
.
id
];
}
else
{
gadget
.
props
.
edge_container
[
connection
.
id
]
=
[
getNodeId
(
gadget
.
props
.
node_container
,
connection
.
sourceId
),
getNodeId
(
gadget
.
props
.
node_container
,
connection
.
targetId
),
edge_data
||
{}
];
}
onDataChange
(
gadget
);
}
// bind to connection/connectionDetached events,
// and update the list of connections on screen.
...
...
@@ -129,6 +135,7 @@
}
coordinates
[
node_id
]
=
coordinate
;
gadget
.
props
.
preference_container
.
coordinates
=
coordinates
;
onDataChange
(
gadget
);
return
coordinate
;
}
function
draggable
(
gadget
)
{
...
...
@@ -190,6 +197,7 @@
// return undefined;
// });
// split in 2 methods ? one for events one for manip
onDataChange
(
gadget
);
draggable
(
gadget
);
}
function
updateNodeStyle
(
gadget
,
element_id
)
{
...
...
@@ -268,6 +276,7 @@
// 1.1111;
// setZoom(gadget, zoom_level);
// gadget.props.preference_container.zoom_level = zoom_level;
// onDataChange();
// redraw(gadget);
// }
// function zoom_out(gadget) {
...
...
@@ -275,6 +284,7 @@
// 0.9;
// setZoom(gadget, zoom_level);
// gadget.props.preference_container.zoom_level = zoom_level;
// onDataChange();
// redraw(gadget);
// }
function
removeElement
(
gadget
,
node_id
)
{
...
...
@@ -288,6 +298,7 @@
delete
gadget
.
props
.
edge_container
[
k
];
}
});
onDataChange
(
gadget
);
}
function
updateElementData
(
gadget
,
node_id
,
data
)
{
var
element_id
=
gadget
.
props
.
node_container
[
node_id
].
element_id
,
new_id
=
data
.
id
;
...
...
@@ -312,6 +323,7 @@
gadget
.
props
.
preference_container
.
coordinates
[
new_id
]
=
gadget
.
props
.
preference_container
.
coordinates
[
node_id
];
delete
gadget
.
props
.
preference_container
.
coordinates
[
node_id
];
}
onDataChange
(
gadget
);
}
// function clearAll(gadget) {
// $.each(gadget.props.node_container, function (node_id) {
...
...
@@ -353,9 +365,11 @@
// }
// function setGeneralProperties(gadget, properties) {
// gadget.props.general_container = properties;
// onDataChange();
// }
// function updateGeneralProperties(gadget, properties) {
// $.extend(gadget.props.general_container, properties);
// onDataChange();
// }
function
openNodeDialog
(
gadget
,
element
,
config_dict
)
{
var
node_id
=
getNodeId
(
gadget
.
props
.
node_container
,
element
.
id
),
node_data
=
gadget
.
props
.
node_container
[
node_id
],
element_type
=
node_data
.
_class
.
replace
(
"
.
"
,
"
-
"
),
property_list
=
config_dict
[
element_type
].
property_list
||
[],
node_edit_popup
=
$
(
gadget
.
props
.
element
).
find
(
"
#popup-edit-template
"
),
fieldset_element
,
delete_promise
;
...
...
@@ -454,6 +468,7 @@
box
.
css
(
"
left
"
,
absolute_position
[
0
]);
updateNodeStyle
(
gadget
,
element
.
element_id
);
draggable
(
gadget
);
onDataChange
(
gadget
);
}
function
waitForDragover
(
gadget
)
{
return
loopEventListener
(
gadget
.
props
.
main
,
"
dragover
"
,
false
,
function
()
{
...
...
dream/platform/static/lib/pubsub.js
0 → 100644
View file @
88bfb6c0
/*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
);
\ No newline at end of file
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