Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
2e3a1582
Commit
2e3a1582
authored
May 28, 2014
by
Leigh B Stoller
Browse files
Add text countdown for extend modal textarea.
parent
7ed19c20
Changes
3
Hide whitespace changes
Inline
Side-by-side
www/aptui/js/status.js
View file @
2e3a1582
...
...
@@ -106,6 +106,20 @@ function (_, sup, moment, ShowImagingModal,
var
win
=
window
.
open
(
url
,
'
_blank
'
);
win
.
focus
();
});
// Setup the extend modal.
$
(
'
button#extend_button
'
).
click
(
function
(
event
)
{
event
.
preventDefault
();
$
(
'
#why_extend
'
).
val
(
''
);
// Countdown characters needed for a good story.
$
(
'
#why_extend
'
).
on
(
'
focus keyup
'
,
function
(
e
)
{
var
len
=
$
(
'
#why_extend
'
).
val
().
length
;
var
left
=
120
-
len
;
var
msg
=
"
You need at least
"
+
left
+
"
more characters
"
;
$
(
'
#extend_counter_msg
'
).
html
(
msg
);
});
sup
.
ShowModal
(
'
#extend_modal
'
);
});
// Handler for the Clone button.
$
(
'
button#clone_button
'
).
click
(
function
(
event
)
{
...
...
www/aptui/template/extend-modal.html
View file @
2e3a1582
...
...
@@ -31,7 +31,10 @@
</textarea>
</div>
</div>
<br>
<span
style=
"font:normal 11px sans-serif;color:#B00400;"
>
<span
id=
'extend_counter_msg'
>
&
nbsp
</span>
</span>
<br>
<button
class=
'btn btn-primary btn-sm align-center'
id=
'request-extension'
type=
'submit'
name=
'request'
>
Request Extension
</button>
...
...
www/aptui/template/status.html
View file @
2e3a1582
...
...
@@ -65,8 +65,7 @@
Snapshot
</button>
<
%
}
%
>
<button
class=
'btn btn-xs btn-success'
disabled
id=
'extend_button'
type=
button
data-toggle=
'modal'
data-target=
'#extend_modal'
>
id=
'extend_button'
type=
button
>
Extend
</button>
<button
class=
'btn btn-xs btn-danger'
disabled
id=
'terminate_button'
type=
button
...
...
Write
Preview
Supports
Markdown
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