Commit b015d168 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add a double click handler so render the instructions

when editing/creating a profile.
parent 8eacc948
......@@ -2,7 +2,7 @@ window.APT_OPTIONS.config();
require(['jquery', 'js/quickvm_sup',
// jQuery modules
function ($, sup)
'use strict';
......@@ -118,6 +118,17 @@ function ($, sup)
* A double click handler that will render the instructions
* in a modal.
$('#profile_instructions').dblclick(function() {
var text = $(this).val();
var marked = require("marked");
* 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);
......@@ -273,7 +273,8 @@ function SPITFORM($formfields, $errors)
"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)
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'
<h3>Markdown Renderer</h3>
<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>
echo "<script type='text/javascript'>\n";
echo " window.EDITING = $editing;\n";
echo "</script>\n";
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment