From d9464de690801dc41dbd17232a95019f274ab172 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Wed, 5 Oct 2011 21:59:03 +0100 Subject: [PATCH] Updated saving feedback --- apps/files_texteditor/appinfo/app.php | 2 +- apps/files_texteditor/js/editor.js | 24 +++++++++++++++++++++--- files/index.php | 3 +++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/apps/files_texteditor/appinfo/app.php b/apps/files_texteditor/appinfo/app.php index 15d79933a17..1bf09b5da2a 100644 --- a/apps/files_texteditor/appinfo/app.php +++ b/apps/files_texteditor/appinfo/app.php @@ -3,4 +3,4 @@ OC_Util::addStyle( 'files_texteditor', 'style' ); OC_Util::addScript( 'files_texteditor', 'editor'); OC_Util::addScript( 'files_texteditor', 'aceeditor/ace'); -?> +?> \ No newline at end of file diff --git a/apps/files_texteditor/js/editor.js b/apps/files_texteditor/js/editor.js index f352e191c9d..62a945c6faf 100644 --- a/apps/files_texteditor/js/editor.js +++ b/apps/files_texteditor/js/editor.js @@ -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('

Saved!

') + setTimeout(function() { + $('#save_result').remove(); + }, 2000); } else { // Save error - alert(jsondata.data.message); + $('#saving_icon').remove(); + $('#editor_save').after('

Failed!

'); + 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('

Saved!

'); + 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('

Saved!

'); + setTimeout(function() { + $('#save_result').fadeOut('slow',function(){ $(this).remove(); }); + }, 2000); } }, 'json'); giveEditorFocus(); diff --git a/files/index.php b/files/index.php index aa081d48804..bd37598289a 100644 --- a/files/index.php +++ b/files/index.php @@ -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' ); -- 2.39.5