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
7c3c4aab
Commit
7c3c4aab
authored
Jun 09, 2015
by
Leigh B Stoller
Browse files
Description and Instructions are now read-only in the text boxes,
the source is the geni-lib script.
parent
4f32b1f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
www/aptui/js/manage_profile.js
View file @
7c3c4aab
...
...
@@ -32,7 +32,8 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
var
myCodeMirror
=
null
;
var
genilibwarned
=
false
;
var
isppprofile
=
false
;
var
isadmin
=
0
;
var
isadmin
=
0
;
var
APT_NS
=
"
http://www.protogeni.net/resources/rspec/ext/apt-tour/1
"
;
var
manageTemplate
=
_
.
template
(
manageString
);
var
waitwaitTemplate
=
_
.
template
(
waitwaitString
);
var
rendererTemplate
=
_
.
template
(
rendererString
);
...
...
@@ -416,7 +417,11 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
ExtractFromRspec
();
// We also got a geni-lib script, so show the XML button.
if
(
gotscript
)
{
// No need to warn if starting with a script.
genilibwarned
=
1
;
$
(
'
#show_xml_modal_button
'
).
removeClass
(
"
hidden
"
);
$
(
'
#profile_instructions
'
).
prop
(
"
readonly
"
,
true
);
$
(
'
#profile_description
'
).
prop
(
"
readonly
"
,
true
);
}
}
else
{
...
...
@@ -621,7 +626,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
if
(
expression
.
exec
(
rspec
))
{
return
;
}
console
.
log
(
'
"
'
+
rspec
+
'
"
'
);
//
console.log('"' + rspec + '"');
var
xmlDoc
=
$
.
parseXML
(
rspec
);
var
xml
=
$
(
xmlDoc
);
...
...
@@ -666,8 +671,8 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
// Write it back to the text area.
var
s
=
new
XMLSerializer
();
var
str
=
s
.
serializeToString
(
xml
[
0
]);
console
.
info
(
"
SyncSteps
"
);
console
.
info
(
str
);
//
console.info("SyncSteps");
//
console.info(str);
$
(
'
#profile_rspec_textarea
'
).
val
(
str
);
return
0
;
}
...
...
@@ -774,10 +779,18 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
ExtractFromRspec
();
SyncSteps
();
ProfileModified
();
// Allow editing the boxes now that we have an rspec.
// This only matters on a brand new create age.
$
(
'
#profile_instructions
'
).
prop
(
"
disabled
"
,
false
);
$
(
'
#profile_description
'
).
prop
(
"
disabled
"
,
false
);
if
(
gotscript
)
{
$
(
'
#profile_instructions
'
).
prop
(
"
readonly
"
,
true
);
$
(
'
#profile_description
'
).
prop
(
"
readonly
"
,
true
);
}
else
{
// Allow editing the boxes now that we have an rspec.
// This only matters on a brand new create age.
$
(
'
#profile_instructions
'
).
prop
(
"
readonly
"
,
false
);
$
(
'
#profile_description
'
).
prop
(
"
readonly
"
,
false
);
$
(
'
#profile_instructions
'
).
prop
(
"
disabled
"
,
false
);
$
(
'
#profile_description
'
).
prop
(
"
disabled
"
,
false
);
}
};
// No old rspec, use new one.
...
...
@@ -790,7 +803,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
return
;
// A script generated rspec, reuse the old tour section.
if
(
gotscript
)
{
if
(
gotscript
&&
!
newtour
.
length
)
{
continuation
(
true
);
return
;
}
...
...
@@ -825,6 +838,8 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
if
(
xmlDoc
==
null
)
return
;
var
xml
=
$
(
xmlDoc
);
console
.
info
(
rspec
);
console
.
info
(
xml
);
$
(
'
#profile_description
'
).
val
(
""
);
$
(
xml
).
find
(
"
rspec_tour > description
"
).
each
(
function
()
{
...
...
@@ -1065,7 +1080,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
var
callback
=
function
(
json
)
{
sup
.
HideModal
(
"
#waitwait-modal
"
);
console
.
info
(
json
.
value
);
//
console.info(json.value);
if
(
json
.
code
)
{
sup
.
SpitOops
(
"
oops
"
,
...
...
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