summaryrefslogtreecommitdiffstats
path: root/apps/files_texteditor/js
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2011-10-03 23:28:47 +0100
committerTom Needham <needham.thomas@gmail.com>2011-10-03 23:28:47 +0100
commit32ce0d3c6eb7873b3bdec424f9aefa9ec4ab3d40 (patch)
tree4a284888285579ef2e9e1c7f9cb94ab5c6b347ef /apps/files_texteditor/js
parent02d7b1a1fc8f4bf62bfb973acfa0ee19ffa469ff (diff)
downloadnextcloud-server-32ce0d3c6eb7873b3bdec424f9aefa9ec4ab3d40.tar.gz
nextcloud-server-32ce0d3c6eb7873b3bdec424f9aefa9ec4ab3d40.zip
Fixed file saving issue.
Diffstat (limited to 'apps/files_texteditor/js')
-rw-r--r--apps/files_texteditor/js/editor.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/files_texteditor/js/editor.js b/apps/files_texteditor/js/editor.js
index d4c5bca51f2..e9ed6720bea 100644
--- a/apps/files_texteditor/js/editor.js
+++ b/apps/files_texteditor/js/editor.js
@@ -67,13 +67,22 @@ function editorIsShown(){
}
}
+function updateSessionFileHash(path){
+ $.get(OC.filePath('apps','files_texteditor','ajax','loadfile.php'),
+ { path: path },
+ function(jsondata){
+ if(jsondata.status=='failure'){
+ alert('Failed to update session file hash.');
+ }
+ }, "json");}
+
function doFileSave(){
if(editorIsShown()){
$('#editor_save').val(t('files_texteditor','Saving')+'...');
var filecontents = window.aceEditor.getSession().getValue();
var dir = $('#editor').attr('data-dir');
var file = $('#editor').attr('data-filename');
- $.post('http://cloud.tomneedham.com/apps/files_texteditor/ajax/savefile.php', { filecontents: filecontents, file: file, dir: dir },function(jsondata){
+ $.post(OC.filePath('apps','files_texteditor','ajax','savefile.php'), { filecontents: filecontents, file: file, dir: dir },function(jsondata){
if(jsondata.status == 'failure'){
var answer = confirm(jsondata.data.message);
@@ -118,6 +127,7 @@ function showFileEditor(dir,filename){
complete: function(data){
var data = data.responseText;
// Initialise the editor
+ updateSessionFileHash(dir+'/'+filename);
showControlBar(filename);
$('table').fadeOut('slow', function() {
$('#editor').html(data);