Skip to content
GitLab
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
b015d168
Commit
b015d168
authored
Feb 27, 2014
by
Leigh B Stoller
Browse files
Add a double click handler so render the instructions
when editing/creating a profile.
parent
8eacc948
Changes
2
Hide whitespace changes
Inline
Side-by-side
www/aptui/js/manage_profile.js
View file @
b015d168
...
...
@@ -2,7 +2,7 @@ window.APT_OPTIONS.config();
require
([
'
jquery
'
,
'
js/quickvm_sup
'
,
// jQuery modules
'
bootstrap
'
,
'
filestyle
'
],
'
bootstrap
'
,
'
filestyle
'
,
'
marked
'
],
function
(
$
,
sup
)
{
'
use strict
'
;
...
...
@@ -118,6 +118,17 @@ function ($, sup)
ChangeHandlerAux
(
"
description
"
);
});
/*
* A double click handler that will render the instructions
* in a modal.
*/
$
(
'
#profile_instructions
'
).
dblclick
(
function
()
{
var
text
=
$
(
this
).
val
();
var
marked
=
require
(
"
marked
"
);
$
(
'
#renderer_modal_div
'
).
html
(
marked
(
text
));
sup
.
ShowModal
(
"
#renderer_modal
"
);
});
/*
* If editing, need to suck the description and instructions
* out of the rspec and put them into the text boxes. But
...
...
@@ -136,7 +147,7 @@ function ($, sup)
else
{
/*
* Not editing, so disable the text boxes until we get
* an rspec
.
* an rspec
via the file chooser.
*/
$
(
'
#profile_instructions
'
).
prop
(
"
disabled
"
,
true
);
$
(
'
#profile_description
'
).
prop
(
"
disabled
"
,
true
);
...
...
www/aptui/manage_profile.php
View file @
b015d168
...
...
@@ -273,7 +273,8 @@ function SPITFORM($formfields, $errors)
class='form-control'
placeholder=''
type='textarea'></textarea>"
,
"Briefly describe how to use this profile after it starts"
);
"Briefly describe how to use this profile after it starts. "
.
"Double click to see it rendered."
);
$formatter
(
"profile_listed"
,
"Listed?"
,
"<div class='checkbox'>
...
...
@@ -369,6 +370,28 @@ function SPITFORM($formfields, $errors)
</div>
</div>
\n
"
;
echo
"<!-- This is the renderer modal -->
<div id='renderer_modal' class='modal fade'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'
aria-hidden='true'>
×</button>
<h3>Markdown Renderer</h3>
</div>
<div class='modal-body'>
<!-- This rendering goes inside this div -->
<div class='panel panel-default'>
<div class='panel-body'>
<div id='renderer_modal_div'></div>
</div>
</div>
</div>
</div>
</div>
</div>
\n
"
;
echo
"<script type='text/javascript'>
\n
"
;
echo
" window.EDITING =
$editing
;
\n
"
;
echo
"</script>
\n
"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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