Index: gc_lang/fr/tb/content/lex_editor.js ================================================================== --- gc_lang/fr/tb/content/lex_editor.js +++ gc_lang/fr/tb/content/lex_editor.js @@ -499,16 +499,15 @@ let xFilePicker = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); xFilePicker.init(window, "Enregistrer sous", Ci.nsIFilePicker.modeSave); xFilePicker.appendFilters(Ci.nsIFilePicker.filterAll | Ci.nsIFilePicker.filterText); xFilePicker.open(function (nReturnValue) { if (nReturnValue == Ci.nsIFilePicker.returnOK || nReturnValue == Ci.nsIFilePicker.returnReplace) { - // write file - // OS.File.writeAtomic(xFilePicker.file.path, sJSON, {tmpPath: "file.txt.tmp"}); - + // https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/OSFile.jsm + OS.File.writeAtomic(xFilePicker.file.path, sJSON, {tmpPath: "file.txt.tmp"}); + /* // You can also optionally pass a flags parameter here. It defaults to // FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE | FileUtils.MODE_TRUNCATE; - console.log(xFilePicker); let xOutStream = FileUtils.openSafeFileOutputStream(xFilePicker.file); let xConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter); xConverter.charset = "UTF-8"; let xInStream = xConverter.convertToInputStream(sJSON); // The last argument (the callback) is optional. @@ -516,10 +515,11 @@ if (!Components.isSuccessCode(status)) { console.log(status); return; } }); + */ } }); } }