summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2011-09-28 20:17:45 +0100
committerTom Needham <needham.thomas@gmail.com>2011-09-28 20:17:45 +0100
commit3129855cc43cf94292623b74b625914578d23316 (patch)
tree19e663cc1cc77efcea413297f0a6ad59d60c05f3
parent3886a749fb419654ef1af981754877c89d97c69d (diff)
downloadnextcloud-server-3129855cc43cf94292623b74b625914578d23316.tar.gz
nextcloud-server-3129855cc43cf94292623b74b625914578d23316.zip
Fixed typo. Added translation support.
-rw-r--r--apps/editor/ajax/savefile.php5
-rw-r--r--apps/editor/index.php2
-rw-r--r--apps/editor/js/editor.js6
3 files changed, 6 insertions, 7 deletions
diff --git a/apps/editor/ajax/savefile.php b/apps/editor/ajax/savefile.php
index 95afb458837..634197c7a10 100644
--- a/apps/editor/ajax/savefile.php
+++ b/apps/editor/ajax/savefile.php
@@ -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
diff --git a/apps/editor/index.php b/apps/editor/index.php
index 437934b3e85..209bca75ddb 100644
--- a/apps/editor/index.php
+++ b/apps/editor/index.php
@@ -1,6 +1,6 @@
<?php
/**
- * ownCloud - Addressbook
+ * ownCloud - Editor
*
* @author Tom Needham
* @copyright 2011 Tom Needham contact@tomneedham.com
diff --git a/apps/editor/js/editor.js b/apps/editor/js/editor.js
index 86b0461c53d..324666110d8 100644
--- a/apps/editor/js/editor.js
+++ b/apps/editor/js/editor.js
@@ -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');
}