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
197245d2
Commit
197245d2
authored
Apr 20, 2015
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
POC for next button on user inactivity
parent
92e53cc1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
dream/platform/src/dream/index.html
dream/platform/src/dream/index.html
+2
-0
dream/platform/src/dream/index.js
dream/platform/src/dream/index.js
+37
-2
No files found.
dream/platform/src/dream/index.html
View file @
197245d2
...
@@ -67,6 +67,8 @@
...
@@ -67,6 +67,8 @@
<h1>
Dream Simulation
</h1>
<h1>
Dream Simulation
</h1>
<div
data-role=
"controlgroup"
data-type=
"horizontal"
class=
"ui-btn-right"
>
<div
data-role=
"controlgroup"
data-type=
"horizontal"
class=
"ui-btn-right"
>
<a
data-icon=
"forward"
class=
"next_step_link ui-btn ui-icon-forward ui-btn-icon-right"
>
Next Step
</a>
<a
data-icon=
"forward"
<a
data-icon=
"forward"
class=
"next_link ui-btn ui-icon-forward ui-btn-icon-right"
>
Next
</a>
class=
"next_link ui-btn ui-icon-forward ui-btn-icon-right"
>
Next
</a>
</div>
</div>
...
...
dream/platform/src/dream/index.js
View file @
197245d2
...
@@ -95,6 +95,19 @@
...
@@ -95,6 +95,19 @@
return
gadget
.
aq_pleasePublishMyState
(
forward_kw
);
return
gadget
.
aq_pleasePublishMyState
(
forward_kw
);
});
});
}
}
function
getNextStepLink
(
gadget
,
portal_type
,
options
)
{
if
(
options
.
action
===
"
view_machine_shift_spreadsheet
"
)
{
var
forward_kw
=
{
action
:
"
view_run_simulation
"
,
id
:
options
.
id
};
return
gadget
.
aq_pleasePublishMyState
(
forward_kw
);
}
else
{
return
false
;
}
}
function
getTitle
(
gadget
,
portal_type
,
options
)
{
function
getTitle
(
gadget
,
portal_type
,
options
)
{
var
title
;
var
title
;
...
@@ -402,7 +415,8 @@
...
@@ -402,7 +415,8 @@
calculateNavigationHTML
(
gadget
,
portal_type
,
options
),
calculateNavigationHTML
(
gadget
,
portal_type
,
options
),
gadget
.
aq_pleasePublishMyState
(
back_kw
),
gadget
.
aq_pleasePublishMyState
(
back_kw
),
getTitle
(
gadget
,
portal_type
,
options
),
getTitle
(
gadget
,
portal_type
,
options
),
getNextLink
(
gadget
,
portal_type
,
options
)
getNextLink
(
gadget
,
portal_type
,
options
),
getNextStepLink
(
gadget
,
portal_type
,
options
)
]);
]);
}).
push
(
function
(
result_list
)
{
}).
push
(
function
(
result_list
)
{
var
nav_html
=
result_list
[
1
],
var
nav_html
=
result_list
[
1
],
...
@@ -420,7 +434,6 @@
...
@@ -420,7 +434,6 @@
// Update forward link
// Update forward link
gadget
.
props
.
element
gadget
.
props
.
element
.
getElementsByClassName
(
"
next_link
"
)[
0
].
href
=
result_list
[
4
];
.
getElementsByClassName
(
"
next_link
"
)[
0
].
href
=
result_list
[
4
];
// Update the navigation panel
// Update the navigation panel
// Clear the previous rendering
// Clear the previous rendering
while
(
nav_element
.
firstChild
)
{
while
(
nav_element
.
firstChild
)
{
...
@@ -440,6 +453,28 @@
...
@@ -440,6 +453,28 @@
element
.
appendChild
(
page_element
);
element
.
appendChild
(
page_element
);
$
(
element
).
trigger
(
'
create
'
);
$
(
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
;
function
resetTimer
()
{
clearTimeout
(
idle_timer
);
idle_timer
=
setTimeout
(
function
()
{
$
(
button
).
show
()
},
idle_seconds
*
1000
);
}
if
(
next_step_link
!==
false
)
{
button
.
href
=
next_step_link
;
var
idle_seconds
=
10
;
$
(
document
.
body
).
on
(
'
keydown click
'
,
resetTimer
);
resetTimer
();
}
else
{
$
(
document
.
body
).
off
(
'
keydown click
'
,
resetTimer
);
}
// XXX RenderJS hack to start sub gadget services
// XXX RenderJS hack to start sub gadget services
// Only work if this gadget has no parent.
// Only work if this gadget has no parent.
if
(
page_gadget
.
startService
!==
undefined
)
{
if
(
page_gadget
.
startService
!==
undefined
)
{
...
...
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