]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed typo. Added translation support.
authorTom Needham <needham.thomas@gmail.com>
Wed, 28 Sep 2011 19:17:45 +0000 (20:17 +0100)
committerTom Needham <needham.thomas@gmail.com>
Wed, 28 Sep 2011 19:17:45 +0000 (20:17 +0100)
apps/editor/ajax/savefile.php
apps/editor/index.php
apps/editor/js/editor.js

index 95afb4588379fd8abfebf3c4cf9bcd417e997eb9..634197c7a10b64311e2dc3ce8b8e49e22be3b93c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * ownCloud - Addressbook
+ * ownCloud - Editor
  *
  * @author Tom Needham
  * @copyright 2011 Tom Needham contact@tomneedham.com
@@ -57,8 +57,7 @@ if(isset($_SESSION[$sessionname])){
                OC_JSON::success();
             } else {   
                // No force
-               // Show error
-               OC_JSON::faliure();
+               OC_JSON::error(array('data' => array( 'message' => $l10n->t('The file has been edited since you opened it. Overwrite the file?'))));
             }
         } else  {
             // No body has edited it whilst you were, so save the file
index 437934b3e85760f641573aad50b76841c27b88bb..209bca75ddbd731dd07891d906873c1be6adfa77 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * ownCloud - Addressbook
+ * ownCloud - Editor
  *
  * @author Tom Needham
  * @copyright 2011 Tom Needham contact@tomneedham.com
index 86b0461c53db4db91434c241ccc6fd80da789eae..324666110d89fa539c8a33eddc750e8a5df98062 100644 (file)
@@ -24,8 +24,8 @@ $(document).ready(function(){
                var dir =  $('#editor').attr('data-dir');
                var file =  $('#editor').attr('data-file');
                $.post('ajax/savefile.php',{ filecontents: filecontents, file: file, dir: dir },function(jsondata){
-                       if(jsondata.satus == 'failure'){
-                               var answer = confirm('The file has been modified after you opened it. Do you want to overwrite the file with your changes?');
+                       if(jsondata.status == 'failure'){
+                               var answer = confirm(jsondata.data.message);
                                if(answer){
                                        $.post('ajax/savefile.php',{ filecontents: filecontents, file: file, dir: dir, force: 'true' },function(jsondata){
                                                if(jsondata.status =='success'){
@@ -34,7 +34,7 @@ $(document).ready(function(){
                                                } 
                                                else {
                                                        // Save error
-                                                       alert('Error saving the file. Please report this!');    
+                                                       alert(jsondata.data.message);   
                                                }
                                        }, 'json');
                                }