summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2011-10-04 17:43:13 +0100
committerTom Needham <needham.thomas@gmail.com>2011-10-04 17:43:13 +0100
commit5c9b069fe54f384bc3a1006c13b9e05dca4efb33 (patch)
treeb4aa97ec68a429658afbb705380cc95c73923018
parent9d918b5ac83c1d491ea7ecfab5d3487580b099f6 (diff)
downloadnextcloud-server-5c9b069fe54f384bc3a1006c13b9e05dca4efb33.tar.gz
nextcloud-server-5c9b069fe54f384bc3a1006c13b9e05dca4efb33.zip
Updated saving feedback to use loading.gif
-rw-r--r--apps/files_texteditor/css/style.css4
-rw-r--r--apps/files_texteditor/js/editor.js17
-rw-r--r--core/img/loader.gifbin0 -> 847 bytes
3 files changed, 8 insertions, 13 deletions
diff --git a/apps/files_texteditor/css/style.css b/apps/files_texteditor/css/style.css
index 2a9066839c3..e94244d1be3 100644
--- a/apps/files_texteditor/css/style.css
+++ b/apps/files_texteditor/css/style.css
@@ -22,4 +22,8 @@
#editor_save{
margin-left: 7px;
float: left;
+}
+#saving_icon{
+ padding-top: 3px;
+ float: left;
} \ No newline at end of file
diff --git a/apps/files_texteditor/js/editor.js b/apps/files_texteditor/js/editor.js
index 1823b5155a1..73bc2f41114 100644
--- a/apps/files_texteditor/js/editor.js
+++ b/apps/files_texteditor/js/editor.js
@@ -55,14 +55,6 @@ function bindControlEvents(){
$('#editor_close').live('click',function() {
hideFileEditor();
});
-
- $(window).keypress(function(event) {
- if (!(event.which == 115 && (event.ctrlKey || event.metaKey)) && !(event.which == 19)) return true;
- event.preventDefault();
- alert("Saved file");
- doFileSave();
- return false;
- });
}
function editorIsShown(){
@@ -84,7 +76,7 @@ function updateSessionFileHash(path){
function doFileSave(){
if(editorIsShown()){
- $('#editor_save').val(t('files_texteditor','Saving')+'...');
+ $('#editor_save').after('<img id="saving_icon" src="'+OC.filePath('core','img','loading.gif')+'"></img>');
var filecontents = window.aceEditor.getSession().getValue();
var dir = $('#editor').attr('data-dir');
var file = $('#editor').attr('data-filename');
@@ -95,7 +87,7 @@ function doFileSave(){
if(answer){
$.post(OC.filePath('files_texteditor','ajax','savefile.php'),{ filecontents: filecontents, file: file, dir: dir, force: 'true' },function(jsondata){
if(jsondata.status =='success'){
- $('#editor_save').val(t('files_texteditor','Save'));
+ $('#saving_icon').remove();
}
else {
// Save error
@@ -105,13 +97,12 @@ function doFileSave(){
}
else {
// Don't save!
- $('#editor_save').effect("highlight", {color:'#FF5757'}, 3000);
- $('#editor_save').val(t('files_texteditor','Save'));
+ $('#editor_save').effect("highlight", {color:'#FF5757'}, 1000);
}
}
else if(jsondata.status == 'success'){
// Success
- $('#editor_save').val(t('files_texteditor','Save'));
+ $('#saving_icon').remove();
}
}, 'json');
giveEditorFocus();
diff --git a/core/img/loader.gif b/core/img/loader.gif
new file mode 100644
index 00000000000..e192ca895cd
--- /dev/null
+++ b/core/img/loader.gif
Binary files differ