]> source.dussan.org Git - nextcloud-server.git/commitdiff
Updated saving feedback
authorTom Needham <needham.thomas@gmail.com>
Wed, 5 Oct 2011 20:59:03 +0000 (21:59 +0100)
committerTom Needham <needham.thomas@gmail.com>
Wed, 5 Oct 2011 20:59:03 +0000 (21:59 +0100)
apps/files_texteditor/appinfo/app.php
apps/files_texteditor/js/editor.js
files/index.php

index 15d79933a17f3da84c28507500948edbc204f32e..1bf09b5da2a1c0c847a43745302fd2fb77ca842e 100644 (file)
@@ -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
index f352e191c9d451dc8f1e0ef31dabefcaf208c93e..62a945c6fafbdeb48b5bf276045d85cd0fa8e7ab 100644 (file)
@@ -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();
index aa081d4880432433a2f1723b3fe5117e0380c16e..bd37598289af361cc2824b7229288a57cd9248ef 100644 (file)
@@ -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' );