diff options
author | Florian Hülsmann <fh@cbix.de> | 2012-03-25 08:14:35 +0400 |
---|---|---|
committer | Florian Hülsmann <fh@cbix.de> | 2012-03-25 08:14:35 +0400 |
commit | f42f25fb2f5922b198667293d1aa5ad70c3cdae1 (patch) | |
tree | e15af41333de150a2f9659408f00713998e4eeaf /files_svgedit | |
parent | 735dfa8df17a3859311178ffe547a402bf3f4f1b (diff) |
saving error messages optimized (show prompt again after error)
Diffstat (limited to 'files_svgedit')
-rw-r--r-- | files_svgedit/ajax/save.php | 7 | ||||
-rw-r--r-- | files_svgedit/js/ocsvgEditor.js | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/files_svgedit/ajax/save.php b/files_svgedit/ajax/save.php index c370c4e1b..b94c9e00a 100644 --- a/files_svgedit/ajax/save.php +++ b/files_svgedit/ajax/save.php @@ -25,12 +25,13 @@ if($path != '' && $mtime != '') { if($mtime != $filemtime) { // Then the file has changed since opening OC_JSON::error(array("data" => array("message" => "File has been modified since opening!"))); - OC_Log::write('files_svgedit',"File: ".$path." modified since opening.",OC_Log::ERROR); + OC_Log::write('files_svgedit',"File: ".$path." modified since opening.",OC_Log::ERROR); + exit(); } } else { // file doesn't exist yet, so let's create it! if($file == '') { - OC_JSON::error(array("data" => array( "message" => "Empty Filename" ))); + OC_JSON::error(array("data" => array( "message" => "Empty Filename") )); exit(); } if(!OC_Files::newFile($dir, $file, 'file')) { @@ -49,7 +50,7 @@ if($path != '' && $mtime != '') { OC_JSON::success(array('data' => array('mtime' => $newmtime))); } else { // Not writeable! - OC_JSON::error(array('data' => array( 'message' => 'Insufficient permissions'))); + OC_JSON::error(array('data' => array( 'message' => 'Insufficient permissions'))); OC_Log::write('files_svgedit',"User does not have permission to write to file: ".$path,OC_Log::ERROR); } } else { diff --git a/files_svgedit/js/ocsvgEditor.js b/files_svgedit/js/ocsvgEditor.js index 852a6dd4c..97d4e5175 100644 --- a/files_svgedit/js/ocsvgEditor.js +++ b/files_svgedit/js/ocsvgEditor.js @@ -20,7 +20,7 @@ var ocsvg = { // set last modified time of the file this.currentFile.mtime = mtime; }, - save: function(window, svgString) { + save: function(win, svgString) { var savePath = prompt(t('files_svgedit', 'Save as'), ocsvg.currentFile.path); if(savePath === null || savePath == '') { return; @@ -34,6 +34,7 @@ var ocsvg = { if(result.status!='success'){ // Save failed alert(t('files_svgedit', 'Could not save:') + "\n" + ocsvg.currentFile.path + "\n" + result.data.message); + ocsvg.save(win, svgString); } else { // Save OK // Update mtime: |