Commit 38cee316 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

When cloning a running instance, the source cannot be changed since

that messes up the snapshot. So make it read-only.
parent 07447323
......@@ -226,15 +226,17 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
var source = $.trim($('#profile_rspec_textarea').val());
$('#rspec_modal_editbuttons').addClass("hidden");
$('#rspec_modal_viewbuttons').removeClass("hidden");
$('#modal_profile_rspec_textarea').prop("readonly", true);
$('#modal_profile_rspec_textarea').val(source);
$('#modal_profile_rspec_textarea').prop("readonly", true);
$('#rspec_modal').modal({'backdrop':'static','keyboard':false});
$('#rspec_modal').modal('show');
});
$('#rspec_modal').on('shown.bs.modal', function() {
var source = $('#modal_profile_rspec_textarea').val();
var mode = "text/xml";
var source = $('#modal_profile_rspec_textarea').val();
var mode = "text/xml";
var readonly = window.CLONING ||
$('#modal_profile_rspec_textarea').prop("readonly");
// Need to determine the mode.
var myRe = /^import/m;
......@@ -249,6 +251,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
smartIndent: true,
autofocus: true,
mode: mode,
readOnly: readonly,
});
//
......@@ -468,7 +471,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
if (window.UPDATED) {
initNotifyUpdate();
}
else if (gotscript && window.CLONEWARN) {
else if (gotscript && window.CLONING) {
sup.ShowModal('#warn_pp_modal');
}
}
......
......@@ -68,7 +68,7 @@ function SPITFORM($formfields, $errors)
$ispp = 0;
$isadmin = (ISADMIN() ? 1 : 0);
$multisite = 1;
$clonewarn = 0;
$cloning = 0;
$version_uuid = "null";
$profile_uuid = "null";
......@@ -94,7 +94,7 @@ function SPITFORM($formfields, $errors)
# New page action is now create, not copy or clone.
if ($action == "copy" || $action == "clone") {
if ($action == "clone") {
$clonewarn = 1;
$cloning = 1;
}
$action = "create";
}
......@@ -176,7 +176,7 @@ function SPITFORM($formfields, $errors)
echo " window.ISADMIN = $isadmin;\n";
echo " window.MULTISITE = $multisite;\n";
echo " window.HISTORY = $history;\n";
echo " window.CLONEWARN = $clonewarn;\n";
echo " window.CLONING = $cloning;\n";
echo " window.ACTIVITY = $activity;\n";
echo " window.TITLE = '$title';\n";
echo " window.AMDEFAULT= '$amdefault';\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