Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos.toolbox
Commits
869851b6
Commit
869851b6
authored
Feb 11, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: ace do not ask for unsaved changes after loading file
parent
fd65c451
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
slapos/runner/static/js/scripts/softwareFolder.js
slapos/runner/static/js/scripts/softwareFolder.js
+8
-11
No files found.
slapos/runner/static/js/scripts/softwareFolder.js
View file @
869851b6
...
...
@@ -57,6 +57,8 @@ $(document).ready(function () {
var
mode
=
modelist
.
getModeForPath
(
file
);
editor
.
getSession
().
modeName
=
mode
.
name
;
editor
.
getSession
().
setMode
(
mode
.
mode
);
beforeunload_warning_set
=
false
;
window
.
onbeforeunload
=
function
()
{
return
;
};
edit
=
true
;
current_file
=
file
;
$
(
"
span#edit_status
"
).
html
(
""
);
...
...
@@ -607,23 +609,16 @@ $(document).ready(function () {
$
(
"
#option
"
).
Tooltip
();
$
(
"
#filelist
"
).
Tooltip
();
editor
.
getSession
().
on
(
'
change
'
,
function
(){
$
(
"
#editor
"
).
val
(
editor
.
getSession
().
getValue
());
editor
.
on
(
"
change
"
,
function
(
e
)
{
if
(
edit_status
===
""
&&
edit
)
{
$
(
"
span#edit_status
"
).
html
(
"
*
"
);
}
if
(
!
beforeunload_warning_set
)
{
window
.
onbeforeunload
=
function
()
{
return
"
You have unsaved changes
"
;
};
beforeunload_warning_set
=
true
;
}
});
$
(
'
input[value="Save Changes"]
'
).
click
(
function
()
{
window
.
onbeforeunload
=
function
()
{
return
;
};
});
editor
.
on
(
"
change
"
,
function
(
e
)
{
if
(
edit_status
===
""
&&
edit
)
{
$
(
"
span#edit_status
"
).
html
(
"
*
"
);
}
});
editor
.
commands
.
addCommand
({
name
:
'
myCommand
'
,
bindKey
:
{
win
:
'
Ctrl-S
'
,
mac
:
'
Command-S
'
},
...
...
@@ -634,6 +629,8 @@ $(document).ready(function () {
});
$
(
"
#save
"
).
click
(
function
()
{
beforeunload_warning_set
=
false
;
window
.
onbeforeunload
=
function
()
{
return
;
};
if
(
!
edit
)
{
$
(
"
#error
"
).
Popup
(
"
Please select the file to edit
"
,
{
type
:
'
alert
'
,
duration
:
3000
});
return
false
;
...
...
Write
Preview
Markdown
is supported
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