diff --git a/www/aptui/js/manage_profile.js b/www/aptui/js/manage_profile.js index dfde7e9c4726d7d76c79844583d02476e1e09899..8e9a7100915b71181a0e0b6cea1f6ed8b1c8a65c 100644 --- a/www/aptui/js/manage_profile.js +++ b/www/aptui/js/manage_profile.js @@ -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); diff --git a/www/aptui/manage_profile.php b/www/aptui/manage_profile.php index c9ff180ec347ba56d50701055e12e7a16afcbd11..920957fa03394be6cb53cd25b55529f798bb6d93 100644 --- a/www/aptui/manage_profile.php +++ b/www/aptui/manage_profile.php @@ -273,7 +273,8 @@ function SPITFORM($formfields, $errors) class='form-control' placeholder='' type='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?", "
@@ -369,6 +370,28 @@ function SPITFORM($formfields, $errors)
\n"; + echo " + \n"; + echo "\n";