mirror of
https://github.com/chinchang/web-maker.git
synced 2025-06-12 04:31:35 +02:00
Change the function name
This commit is contained in:
@ -177,13 +177,13 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
saveHtmlBtn.addEventListener('click', function (e) {
|
saveHtmlBtn.addEventListener('click', function (e) {
|
||||||
save_file();
|
saveFile();
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('keydown',function(event) {
|
window.addEventListener('keydown',function(event) {
|
||||||
if ((event.ctrlKey)&&(event.keyCode==83)){
|
if ((event.ctrlKey)&&(event.keyCode==83)){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
save_file();
|
saveFile();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -235,14 +235,14 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function save_file() {
|
function saveFile() {
|
||||||
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();
|
||||||
|
|
||||||
var fileContent = '<html><head>\n<style>\n'
|
var fileContent = '<html><head>\n<style>\n'
|
||||||
+ css + '\n</style>\n</head>\n<body>\n'
|
+ css + '\n</style>\n</head>\n<body>\n'
|
||||||
+ html + '\n<script>\n' + js + '\n</script>\n\n</body>\n</html>';
|
+ html + '\n<script>\n' + js + '\n</script>\n\n</body>\n</html>';
|
||||||
|
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var fileName = [ 'web-maker', d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds() ].join('-');
|
var fileName = [ 'web-maker', d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds() ].join('-');
|
||||||
@ -256,7 +256,7 @@
|
|||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
a.remove();
|
a.remove();
|
||||||
};
|
};
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user