videoconf/static/js/save.js
admini 8314861611 geändert: static/js/index.js
geändert:       static/js/save.js
2018-02-21 23:39:44 +01:00

19 lines
427 B
JavaScript

$(function() {
function reloadMarkdown() {
$('#slides-frame')[0].contentWindow.postMessage(JSON.stringify({
method: 'reloadMarkdown'
}), window.location.origin);
}
window.save = function() {
var editor = ace.edit("editor");
$.ajax("/slides.md", {
type: 'put',
data: editor.getValue(),
success: reloadMarkdown
});
};
$('#editor').keyup($.debounce(window.save, 600));
});