mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-31 18:50:14 +02:00
Add key short for the save file
This commit is contained in:
@@ -176,7 +176,7 @@
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
saveHtmlBtn.addEventListener('click', function (e) {
|
function save_file() {
|
||||||
var html = editur.cm.html.getValue();
|
var html = editur.cm.html.getValue();
|
||||||
var css = editur.cm.css.getValue();
|
var css = editur.cm.css.getValue();
|
||||||
var js = editur.cm.js.getValue();
|
var js = editur.cm.js.getValue();
|
||||||
@@ -197,8 +197,19 @@
|
|||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
saveHtmlBtn.addEventListener('click', function (e) {
|
||||||
|
save_file();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.addEventListener('keydown',function(event) {
|
||||||
|
if ((event.ctrlKey)&&(event.keyCode==83)){
|
||||||
|
event.returnValue=false;
|
||||||
|
save_file();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
window.addEventListener('click', function(e) {
|
window.addEventListener('click', function(e) {
|
||||||
if (typeof e.target.className === 'string' && e.target.className.indexOf('modal-overlay') !== -1) {
|
if (typeof e.target.className === 'string' && e.target.className.indexOf('modal-overlay') !== -1) {
|
||||||
e.target.previousElementSibling.classList.toggle('is-modal-visible');
|
e.target.previousElementSibling.classList.toggle('is-modal-visible');
|
||||||
|
Reference in New Issue
Block a user