mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 01:50:33 -04:00
Updated saving feedback
This commit is contained in:
parent
30343f15e2
commit
d9464de690
3 changed files with 25 additions and 4 deletions
|
|
@ -3,4 +3,4 @@
|
|||
OC_Util::addStyle( 'files_texteditor', 'style' );
|
||||
OC_Util::addScript( 'files_texteditor', 'editor');
|
||||
OC_Util::addScript( 'files_texteditor', 'aceeditor/ace');
|
||||
?>
|
||||
?>
|
||||
|
|
@ -102,21 +102,39 @@ function doFileSave(){
|
|||
$.post(OC.filePath('files_texteditor','ajax','savefile.php'),{ filecontents: filecontents, file: file, dir: dir, force: 'true' },function(jsondata){
|
||||
if(jsondata.status =='success'){
|
||||
$('#saving_icon').remove();
|
||||
$('#editor_save').after('<p id="save_result" style="float: left">Saved!</p>')
|
||||
setTimeout(function() {
|
||||
$('#save_result').remove();
|
||||
}, 2000);
|
||||
}
|
||||
else {
|
||||
// Save error
|
||||
alert(jsondata.data.message);
|
||||
$('#saving_icon').remove();
|
||||
$('#editor_save').after('<p id="save_result" style="float: left">Failed!</p>');
|
||||
setTimeout(function() {
|
||||
$('#save_result').fadeOut('slow',function(){ $(this).remove(); });
|
||||
}, 2000);
|
||||
}
|
||||
}, 'json');
|
||||
}
|
||||
else {
|
||||
// Don't save!
|
||||
$('#editor_save').effect("highlight", {color:'#FF5757'}, 1000);
|
||||
}
|
||||
$('#saving_icon').remove();
|
||||
// Temporary measure until we get a tick icon
|
||||
$('#editor_save').after('<p id="save_result" style="float: left">Saved!</p>');
|
||||
setTimeout(function() {
|
||||
$('#save_result').fadeOut('slow',function(){ $(this).remove(); });
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
else if(jsondata.status == 'success'){
|
||||
// Success
|
||||
$('#saving_icon').remove();
|
||||
// Temporary measure until we get a tick icon
|
||||
$('#editor_save').after('<p id="save_result" style="float: left">Saved!</p>');
|
||||
setTimeout(function() {
|
||||
$('#save_result').fadeOut('slow',function(){ $(this).remove(); });
|
||||
}, 2000);
|
||||
}
|
||||
}, 'json');
|
||||
giveEditorFocus();
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ require_once('../lib/base.php');
|
|||
OC_Util::checkLoggedIn();
|
||||
|
||||
// Load the files we need
|
||||
OC_Util::addStyle( 'files_texteditor', 'style' );
|
||||
OC_Util::addScript( 'files_texteditor', 'editor');
|
||||
OC_Util::addScript( 'files_texteditor', 'aceeditor/ace');
|
||||
OC_Util::addStyle( "files", "files" );
|
||||
OC_Util::addScript( "files", "files" );
|
||||
OC_Util::addScript( 'files', 'filelist' );
|
||||
|
|
|
|||
Loading…
Reference in a new issue