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
838d23ac
Commit
838d23ac
authored
Jul 02, 2015
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update static version
parent
55a86c81
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
8 deletions
+80
-8
dream/platform/static/dream/index.html
dream/platform/static/dream/index.html
+4
-5
dream/platform/static/dream/index.js
dream/platform/static/dream/index.js
+57
-2
dream/platform/static/jsplumb/jsplumb.js
dream/platform/static/jsplumb/jsplumb.js
+18
-0
dream/platform/static/manifest.appcache
dream/platform/static/manifest.appcache
+1
-1
No files found.
dream/platform/static/dream/index.html
View file @
838d23ac
...
...
@@ -67,12 +67,11 @@
<h1>
Dream Simulation
</h1>
<div
data-role=
"controlgroup"
data-type=
"horizontal"
class=
"ui-btn-right"
>
<!-- Next button to cycle through the results, similar to ERP5 navigation -->
<a
data-icon=
"forward"
style=
"display: none"
<a
data-icon=
"forward"
class=
"next_step_link ui-btn ui-icon-forward ui-btn-icon-right"
>
Continue
</a>
<a
data-icon=
"forward"
class=
"next_link ui-btn ui-icon-forward ui-btn-icon-right"
>
Next
</a>
</div>
</header>
...
...
dream/platform/static/dream/index.js
View file @
838d23ac
...
...
@@ -93,10 +93,38 @@
return
gadget
.
aq_pleasePublishMyState
(
forward_kw
);
});
}
function
getNextStepLink
(
gadget
,
portal_type
,
options
)
{
//if (options.action === "view_machine_shift_spreadsheet") {
if
(
options
.
action
===
"
view
"
)
{
var
forward_kw
=
{
action
:
"
view_machine_shift_spreadsheet
"
,
id
:
options
.
id
};
return
gadget
.
aq_pleasePublishMyState
(
forward_kw
);
}
else
if
(
options
.
action
===
"
view_machine_shift_spreadsheet
"
)
{
var
forward_kw1
=
{
action
:
"
view_operator_shift_spreadsheet
"
,
id
:
options
.
id
};
return
gadget
.
aq_pleasePublishMyState
(
forward_kw1
);
}
else
if
(
options
.
action
===
"
view_operator_shift_spreadsheet
"
)
{
var
forward_kw2
=
{
action
:
"
view_wip_spreadsheet
"
,
id
:
options
.
id
};
return
gadget
.
aq_pleasePublishMyState
(
forward_kw2
);
}
else
if
(
options
.
action
===
"
view_wip_spreadsheet
"
)
{
var
forward_kw3
=
{
action
:
"
view_run_simulation
"
,
id
:
options
.
id
};
return
gadget
.
aq_pleasePublishMyState
(
forward_kw3
);
}
}
function
getTitle
(
gadget
,
portal_type
,
options
)
{
var
title
;
if
(
portal_type
===
"
Input Module
"
)
{
title
=
"
Documents
"
;
title
=
"
Document
a
s
"
;
}
else
if
(
portal_type
===
"
Input
"
)
{
title
=
gadget
.
getDeclaredGadget
(
"
jio
"
).
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
get
({
...
...
@@ -320,7 +348,7 @@
return
page_gadget
.
render
(
options
);
}
}).
push
(
function
()
{
return
RSVP
.
all
([
page_gadget
.
getElement
(),
calculateNavigationHTML
(
gadget
,
portal_type
,
options
),
gadget
.
aq_pleasePublishMyState
(
back_kw
),
getTitle
(
gadget
,
portal_type
,
options
),
getNextLink
(
gadget
,
portal_type
,
options
)
]);
return
RSVP
.
all
([
page_gadget
.
getElement
(),
calculateNavigationHTML
(
gadget
,
portal_type
,
options
),
gadget
.
aq_pleasePublishMyState
(
back_kw
),
getTitle
(
gadget
,
portal_type
,
options
),
getNextLink
(
gadget
,
portal_type
,
options
)
,
getNextStepLink
(
gadget
,
portal_type
,
options
)
]);
}).
push
(
function
(
result_list
)
{
var
nav_html
=
result_list
[
1
],
page_element
=
result_list
[
0
];
// Update title
...
...
@@ -348,6 +376,33 @@
}
element
.
appendChild
(
page_element
);
$
(
element
).
trigger
(
"
create
"
);
return
result_list
[
5
];
}).
push
(
function
(
next_step_link
)
{
var
button
=
gadget
.
props
.
element
.
getElementsByClassName
(
"
next_step_link
"
)[
0
];
$
(
button
).
hide
();
var
idle_timer
;
var
stop_timer
;
function
resetTimer
()
{
clearTimeout
(
idle_timer
);
idle_timer
=
setTimeout
(
function
()
{
$
(
button
).
show
();
},
idle_seconds
*
1
e3
);
}
function
hideButton
()
{
clearTimeout
(
stop_timer
);
stop_timer
=
setTimeout
(
function
()
{
$
(
button
).
hide
();
},
idle_seconds2
*
1
e3
);
}
if
(
next_step_link
!==
false
)
{
button
.
href
=
next_step_link
;
var
idle_seconds
=
5
;
$
(
document
.
body
).
on
(
"
keydown click
"
,
resetTimer
);
var
idle_seconds2
=
12
;
$
(
document
.
body
).
on
(
"
keydown click
"
,
hideButton
);
}
else
{
$
(
document
.
body
).
off
(
"
keydown click
"
,
resetTimer
);
}
// XXX RenderJS hack to start sub gadget services
// Only work if this gadget has no parent.
if
(
page_gadget
.
startService
!==
undefined
)
{
...
...
dream/platform/static/jsplumb/jsplumb.js
View file @
838d23ac
...
...
@@ -117,6 +117,7 @@
edge_data
.
destination
=
getNodeId
(
gadget
,
connection
.
targetId
);
gadget
.
props
.
data
.
graph
.
edge
[
connection
.
id
]
=
edge_data
;
}
checkNodeConstraint
(
gadget
,
getNodeId
(
gadget
,
connection
.
targetId
));
gadget
.
notifyDataChanged
();
}
function
convertToAbsolutePosition
(
gadget
,
x
,
y
)
{
...
...
@@ -217,6 +218,20 @@
});
gadget
.
notifyDataChanged
();
}
function
checkNodeConstraint
(
gadget
,
node_id
)
{
var
element_id
=
gadget
.
props
.
node_id_to_dom_element_id
[
node_id
],
element
=
$
(
gadget
.
props
.
element
).
find
(
"
#
"
+
element_id
),
jsplumb_instance
=
gadget
.
props
.
jsplumb_instance
,
node_class
=
gadget
.
props
.
data
.
graph
.
node
[
node_id
].
_class
;
if
(
jsplumb_instance
.
getConnections
({
target
:
element_id
}).
length
===
0
&&
node_class
.
toLowerCase
().
search
(
"
source
"
)
===
-
1
)
{
var
warning
=
$
(
"
<div></div>
"
).
attr
({
"
class
"
:
"
alert_no_input ui-btn-icon-notext ui-icon-alert
"
,
title
:
"
No input defined!
"
});
element
.
append
(
warning
);
}
else
{
element
.
find
(
"
.alert_no_input
"
).
remove
();
}
}
function
updateElementData
(
gadget
,
node_id
,
data
)
{
var
element_id
=
gadget
.
props
.
node_id_to_dom_element_id
[
node_id
],
new_id
=
data
.
id
;
$
(
gadget
.
props
.
element
).
find
(
"
#
"
+
element_id
).
text
(
data
.
data
.
name
||
new_id
).
attr
(
"
title
"
,
data
.
data
.
name
||
new_id
).
append
(
'
<div class="ep"></div></div>
'
);
...
...
@@ -638,6 +653,9 @@
$
.
each
(
this
.
props
.
data
.
graph
.
edge
,
function
(
key
,
value
)
{
addEdge
(
gadget
,
key
,
value
);
});
$
.
each
(
this
.
props
.
data
.
graph
.
node
,
function
(
key
,
value
)
{
checkNodeConstraint
(
gadget
,
key
);
});
return
RSVP
.
all
([
waitForDrop
(
gadget
),
waitForConnection
(
gadget
),
waitForConnectionDetached
(
gadget
),
waitForConnectionClick
(
gadget
),
gadget
.
props
.
nodes_click_monitor
]);
});
})(
RSVP
,
rJS
,
$
,
jsPlumb
,
Handlebars
,
loopEventListener
,
promiseEventListener
,
DOMParser
);
\ No newline at end of file
dream/platform/static/manifest.appcache
View file @
838d23ac
CACHE MANIFEST
# This manifest was generated by grunt-manifest HTML5 Cache Manifest Generator
# Time: T
ue Jun 23 2015 11:38:13 GMT+0200 (CES
T)
# Time: T
hu Jul 02 2015 16:15:53 GMT+0000 (GM
T)
CACHE:
dream/InputModule_viewAddDocumentDialog.js
...
...
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