Answer the question
In order to leave comments, you need to log in
How to properly save files in node-webkit?
Hello **userName**!
I have this problem with saving a file in node-webkit :
// Save
// ----------------------------------------
// #app-save -> ID кнопки диалога сохранения.
// #app-function-menu -> ID меню.
// #editor-input -> ID поля, содержащее введённый текст (textarea).
// ----------------------------------------
// notifier -> npm node-notifier
// ----------------------------------------
$('#app-save').on("click", function() {
$('#app-function-menu').toggle();
var content = $('#editor-input').val();
var contentBuffer = new Buffer(content, 'utf-8');
var saveDialog = new fdialogs.FDialog({
type: 'save',
accept: ['.md']
});
saveDialog.saveFile(contentBuffer, 'utf-8', function(err, filepath) {
notifier.notify({
title: 'Title',
message: 'Message!',
icon: path.join(__dirname, '../images/brand.png')
});
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question