Procházet zdrojové kódy

Изменить 'ace/index.html'

master
KaiSD před 4 roky
rodič
revize
6ff85e4927
1 změnil soubory, kde provedl 15 přidání a 1 odebrání
  1. +15
    -1
      ace/index.html

+ 15
- 1
ace/index.html Zobrazit soubor

@@ -100,7 +100,8 @@
});

function save() {
alert("not yet implemented");
var file = prompt("Name the file:", "text.txt");
download(file, editor.getSession().getValue());
}

editor.commands.addCommand({
@@ -139,6 +140,19 @@
}
}
function download(filename, text) {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);

element.style.display = 'none';
document.body.appendChild(element);

element.click();

document.body.removeChild(element);
}
window.editor = editor;
</script>


Načítá se…
Zrušit
Uložit